ffmpeg-filters.html 1.0 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <title>FFmpeg documentation</title>
  7. <link rel="stylesheet" href="bootstrap.min.css" />
  8. <link rel="stylesheet" href="style.min.css" />
  9. <meta name="description" content="FFmpeg Filters Documentation: ">
  10. <meta name="keywords" content="FFmpeg documentation : FFmpeg Filters ">
  11. <meta name="Generator" content="texi2html 5.0">
  12. <!-- Created on June 8, 2020 by texi2html 5.0 -->
  13. <!--
  14. texi2html was written by:
  15. Lionel Cons <Lionel.Cons@cern.ch> (original author)
  16. Karl Berry <karl@freefriends.org>
  17. Olaf Bachmann <obachman@mathematik.uni-kl.de>
  18. and many others.
  19. Maintained by: Many creative people.
  20. Send bugs and suggestions to <texi2html-bug@nongnu.org>
  21. -->
  22. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  23. </head>
  24. <body>
  25. <div class="container">
  26. <h1 class="titlefont">FFmpeg Filters Documentation</h1>
  27. <hr>
  28. <a name="SEC_Top"></a>
  29. <a name="SEC_Contents"></a>
  30. <h1>Table of Contents</h1>
  31. <div class="contents">
  32. <ul class="no-bullet">
  33. <li><a name="toc-Description" href="#Description">1 Description</a></li>
  34. <li><a name="toc-Filtering-Introduction" href="#Filtering-Introduction">2 Filtering Introduction</a></li>
  35. <li><a name="toc-graph2dot" href="#graph2dot">3 graph2dot</a></li>
  36. <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">4 Filtergraph description</a>
  37. <ul class="no-bullet">
  38. <li><a name="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">4.1 Filtergraph syntax</a></li>
  39. <li><a name="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">4.2 Notes on filtergraph escaping</a></li>
  40. </ul></li>
  41. <li><a name="toc-Timeline-editing" href="#Timeline-editing">5 Timeline editing</a></li>
  42. <li><a name="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>
  43. <li><a name="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>
  44. <li><a name="toc-Audio-Filters" href="#Audio-Filters">8 Audio Filters</a>
  45. <ul class="no-bullet">
  46. <li><a name="toc-acompressor" href="#acompressor">8.1 acompressor</a>
  47. <ul class="no-bullet">
  48. <li><a name="toc-Commands-71" href="#Commands-71">8.1.1 Commands</a></li>
  49. </ul></li>
  50. <li><a name="toc-acontrast" href="#acontrast">8.2 acontrast</a></li>
  51. <li><a name="toc-acopy" href="#acopy">8.3 acopy</a></li>
  52. <li><a name="toc-acrossfade" href="#acrossfade">8.4 acrossfade</a>
  53. <ul class="no-bullet">
  54. <li><a name="toc-Examples-26" href="#Examples-26">8.4.1 Examples</a></li>
  55. </ul></li>
  56. <li><a name="toc-acrossover" href="#acrossover">8.5 acrossover</a></li>
  57. <li><a name="toc-acrusher" href="#acrusher">8.6 acrusher</a></li>
  58. <li><a name="toc-acue" href="#acue">8.7 acue</a></li>
  59. <li><a name="toc-adeclick" href="#adeclick">8.8 adeclick</a></li>
  60. <li><a name="toc-adeclip" href="#adeclip">8.9 adeclip</a></li>
  61. <li><a name="toc-adelay" href="#adelay">8.10 adelay</a>
  62. <ul class="no-bullet">
  63. <li><a name="toc-Examples-102" href="#Examples-102">8.10.1 Examples</a></li>
  64. </ul></li>
  65. <li><a name="toc-aderivative_002c-aintegral" href="#aderivative_002c-aintegral">8.11 aderivative, aintegral</a></li>
  66. <li><a name="toc-aecho" href="#aecho">8.12 aecho</a>
  67. <ul class="no-bullet">
  68. <li><a name="toc-Examples-121" href="#Examples-121">8.12.1 Examples</a></li>
  69. </ul></li>
  70. <li><a name="toc-aemphasis" href="#aemphasis">8.13 aemphasis</a></li>
  71. <li><a name="toc-aeval" href="#aeval">8.14 aeval</a>
  72. <ul class="no-bullet">
  73. <li><a name="toc-Examples-108" href="#Examples-108">8.14.1 Examples</a></li>
  74. </ul></li>
  75. <li><a name="toc-afade-1" href="#afade-1">8.15 afade</a>
  76. <ul class="no-bullet">
  77. <li><a name="toc-Examples-148" href="#Examples-148">8.15.1 Examples</a></li>
  78. </ul></li>
  79. <li><a name="toc-afftdn" href="#afftdn">8.16 afftdn</a>
  80. <ul class="no-bullet">
  81. <li><a name="toc-Commands-49" href="#Commands-49">8.16.1 Commands</a></li>
  82. </ul></li>
  83. <li><a name="toc-afftfilt" href="#afftfilt">8.17 afftfilt</a>
  84. <ul class="no-bullet">
  85. <li><a name="toc-Examples-130" href="#Examples-130">8.17.1 Examples</a></li>
  86. </ul></li>
  87. <li><a name="toc-afir-1" href="#afir-1">8.18 afir</a>
  88. <ul class="no-bullet">
  89. <li><a name="toc-Examples-86" href="#Examples-86">8.18.1 Examples</a></li>
  90. </ul></li>
  91. <li><a name="toc-aformat-1" href="#aformat-1">8.19 aformat</a></li>
  92. <li><a name="toc-agate" href="#agate">8.20 agate</a></li>
  93. <li><a name="toc-aiir" href="#aiir">8.21 aiir</a>
  94. <ul class="no-bullet">
  95. <li><a name="toc-Examples-29" href="#Examples-29">8.21.1 Examples</a></li>
  96. </ul></li>
  97. <li><a name="toc-alimiter" href="#alimiter">8.22 alimiter</a></li>
  98. <li><a name="toc-allpass" href="#allpass">8.23 allpass</a>
  99. <ul class="no-bullet">
  100. <li><a name="toc-Commands-21" href="#Commands-21">8.23.1 Commands</a></li>
  101. </ul></li>
  102. <li><a name="toc-aloop" href="#aloop">8.24 aloop</a></li>
  103. <li><a name="toc-amerge-1" href="#amerge-1">8.25 amerge</a>
  104. <ul class="no-bullet">
  105. <li><a name="toc-Examples-2" href="#Examples-2">8.25.1 Examples</a></li>
  106. </ul></li>
  107. <li><a name="toc-amix" href="#amix">8.26 amix</a>
  108. <ul class="no-bullet">
  109. <li><a name="toc-Commands-19" href="#Commands-19">8.26.1 Commands</a></li>
  110. </ul></li>
  111. <li><a name="toc-amultiply" href="#amultiply">8.27 amultiply</a></li>
  112. <li><a name="toc-anequalizer" href="#anequalizer">8.28 anequalizer</a>
  113. <ul class="no-bullet">
  114. <li><a name="toc-Examples-90" href="#Examples-90">8.28.1 Examples</a></li>
  115. <li><a name="toc-Commands-42" href="#Commands-42">8.28.2 Commands</a></li>
  116. </ul></li>
  117. <li><a name="toc-anlmdn" href="#anlmdn">8.29 anlmdn</a>
  118. <ul class="no-bullet">
  119. <li><a name="toc-Commands-69" href="#Commands-69">8.29.1 Commands</a></li>
  120. </ul></li>
  121. <li><a name="toc-anlms" href="#anlms">8.30 anlms</a>
  122. <ul class="no-bullet">
  123. <li><a name="toc-Examples-44" href="#Examples-44">8.30.1 Examples</a></li>
  124. <li><a name="toc-Commands-27" href="#Commands-27">8.30.2 Commands</a></li>
  125. </ul></li>
  126. <li><a name="toc-anull" href="#anull">8.31 anull</a></li>
  127. <li><a name="toc-apad" href="#apad">8.32 apad</a>
  128. <ul class="no-bullet">
  129. <li><a name="toc-Examples-77" href="#Examples-77">8.32.1 Examples</a></li>
  130. </ul></li>
  131. <li><a name="toc-aphaser" href="#aphaser">8.33 aphaser</a></li>
  132. <li><a name="toc-apulsator" href="#apulsator">8.34 apulsator</a></li>
  133. <li><a name="toc-aresample-1" href="#aresample-1">8.35 aresample</a>
  134. <ul class="no-bullet">
  135. <li><a name="toc-Examples-13" href="#Examples-13">8.35.1 Examples</a></li>
  136. </ul></li>
  137. <li><a name="toc-areverse" href="#areverse">8.36 areverse</a>
  138. <ul class="no-bullet">
  139. <li><a name="toc-Examples-124" href="#Examples-124">8.36.1 Examples</a></li>
  140. </ul></li>
  141. <li><a name="toc-arnndn" href="#arnndn">8.37 arnndn</a></li>
  142. <li><a name="toc-asetnsamples" href="#asetnsamples">8.38 asetnsamples</a></li>
  143. <li><a name="toc-asetrate" href="#asetrate">8.39 asetrate</a></li>
  144. <li><a name="toc-ashowinfo" href="#ashowinfo">8.40 ashowinfo</a></li>
  145. <li><a name="toc-asoftclip" href="#asoftclip">8.41 asoftclip</a>
  146. <ul class="no-bullet">
  147. <li><a name="toc-Commands-29" href="#Commands-29">8.41.1 Commands</a></li>
  148. </ul></li>
  149. <li><a name="toc-asr" href="#asr">8.42 asr</a></li>
  150. <li><a name="toc-astats-1" href="#astats-1">8.43 astats</a></li>
  151. <li><a name="toc-asubboost" href="#asubboost">8.44 asubboost</a>
  152. <ul class="no-bullet">
  153. <li><a name="toc-Commands-3" href="#Commands-3">8.44.1 Commands</a></li>
  154. </ul></li>
  155. <li><a name="toc-atempo" href="#atempo">8.45 atempo</a>
  156. <ul class="no-bullet">
  157. <li><a name="toc-Examples-84" href="#Examples-84">8.45.1 Examples</a></li>
  158. <li><a name="toc-Commands-64" href="#Commands-64">8.45.2 Commands</a></li>
  159. </ul></li>
  160. <li><a name="toc-atrim" href="#atrim">8.46 atrim</a></li>
  161. <li><a name="toc-axcorrelate" href="#axcorrelate">8.47 axcorrelate</a>
  162. <ul class="no-bullet">
  163. <li><a name="toc-Examples-31" href="#Examples-31">8.47.1 Examples</a></li>
  164. </ul></li>
  165. <li><a name="toc-bandpass" href="#bandpass">8.48 bandpass</a>
  166. <ul class="no-bullet">
  167. <li><a name="toc-Commands-66" href="#Commands-66">8.48.1 Commands</a></li>
  168. </ul></li>
  169. <li><a name="toc-bandreject" href="#bandreject">8.49 bandreject</a>
  170. <ul class="no-bullet">
  171. <li><a name="toc-Commands" href="#Commands">8.49.1 Commands</a></li>
  172. </ul></li>
  173. <li><a name="toc-bass_002c-lowshelf" href="#bass_002c-lowshelf">8.50 bass, lowshelf</a>
  174. <ul class="no-bullet">
  175. <li><a name="toc-Commands-50" href="#Commands-50">8.50.1 Commands</a></li>
  176. </ul></li>
  177. <li><a name="toc-biquad" href="#biquad">8.51 biquad</a>
  178. <ul class="no-bullet">
  179. <li><a name="toc-Commands-53" href="#Commands-53">8.51.1 Commands</a></li>
  180. </ul></li>
  181. <li><a name="toc-bs2b" href="#bs2b">8.52 bs2b</a></li>
  182. <li><a name="toc-channelmap" href="#channelmap">8.53 channelmap</a>
  183. <ul class="no-bullet">
  184. <li><a name="toc-Examples-149" href="#Examples-149">8.53.1 Examples</a></li>
  185. </ul></li>
  186. <li><a name="toc-channelsplit" href="#channelsplit">8.54 channelsplit</a>
  187. <ul class="no-bullet">
  188. <li><a name="toc-Examples-47" href="#Examples-47">8.54.1 Examples</a></li>
  189. </ul></li>
  190. <li><a name="toc-chorus" href="#chorus">8.55 chorus</a>
  191. <ul class="no-bullet">
  192. <li><a name="toc-Examples-42" href="#Examples-42">8.55.1 Examples</a></li>
  193. </ul></li>
  194. <li><a name="toc-compand" href="#compand">8.56 compand</a>
  195. <ul class="no-bullet">
  196. <li><a name="toc-Examples-98" href="#Examples-98">8.56.1 Examples</a></li>
  197. </ul></li>
  198. <li><a name="toc-compensationdelay" href="#compensationdelay">8.57 compensationdelay</a></li>
  199. <li><a name="toc-crossfeed" href="#crossfeed">8.58 crossfeed</a>
  200. <ul class="no-bullet">
  201. <li><a name="toc-Commands-39" href="#Commands-39">8.58.1 Commands</a></li>
  202. </ul></li>
  203. <li><a name="toc-crystalizer" href="#crystalizer">8.59 crystalizer</a>
  204. <ul class="no-bullet">
  205. <li><a name="toc-Commands-65" href="#Commands-65">8.59.1 Commands</a></li>
  206. </ul></li>
  207. <li><a name="toc-dcshift" href="#dcshift">8.60 dcshift</a></li>
  208. <li><a name="toc-deesser" href="#deesser">8.61 deesser</a></li>
  209. <li><a name="toc-drmeter" href="#drmeter">8.62 drmeter</a></li>
  210. <li><a name="toc-dynaudnorm" href="#dynaudnorm">8.63 dynaudnorm</a>
  211. <ul class="no-bullet">
  212. <li><a name="toc-Commands-26" href="#Commands-26">8.63.1 Commands</a></li>
  213. </ul></li>
  214. <li><a name="toc-earwax" href="#earwax">8.64 earwax</a></li>
  215. <li><a name="toc-equalizer" href="#equalizer">8.65 equalizer</a>
  216. <ul class="no-bullet">
  217. <li><a name="toc-Examples-139" href="#Examples-139">8.65.1 Examples</a></li>
  218. <li><a name="toc-Commands-11" href="#Commands-11">8.65.2 Commands</a></li>
  219. </ul></li>
  220. <li><a name="toc-extrastereo" href="#extrastereo">8.66 extrastereo</a>
  221. <ul class="no-bullet">
  222. <li><a name="toc-Commands-46" href="#Commands-46">8.66.1 Commands</a></li>
  223. </ul></li>
  224. <li><a name="toc-firequalizer" href="#firequalizer">8.67 firequalizer</a>
  225. <ul class="no-bullet">
  226. <li><a name="toc-Examples-72" href="#Examples-72">8.67.1 Examples</a></li>
  227. </ul></li>
  228. <li><a name="toc-flanger" href="#flanger">8.68 flanger</a></li>
  229. <li><a name="toc-haas" href="#haas">8.69 haas</a></li>
  230. <li><a name="toc-hdcd" href="#hdcd">8.70 hdcd</a></li>
  231. <li><a name="toc-headphone" href="#headphone">8.71 headphone</a>
  232. <ul class="no-bullet">
  233. <li><a name="toc-Examples-111" href="#Examples-111">8.71.1 Examples</a></li>
  234. </ul></li>
  235. <li><a name="toc-highpass" href="#highpass">8.72 highpass</a>
  236. <ul class="no-bullet">
  237. <li><a name="toc-Commands-37" href="#Commands-37">8.72.1 Commands</a></li>
  238. </ul></li>
  239. <li><a name="toc-join" href="#join">8.73 join</a></li>
  240. <li><a name="toc-ladspa" href="#ladspa">8.74 ladspa</a>
  241. <ul class="no-bullet">
  242. <li><a name="toc-Examples-114" href="#Examples-114">8.74.1 Examples</a></li>
  243. <li><a name="toc-Commands-61" href="#Commands-61">8.74.2 Commands</a></li>
  244. </ul></li>
  245. <li><a name="toc-loudnorm" href="#loudnorm">8.75 loudnorm</a></li>
  246. <li><a name="toc-lowpass" href="#lowpass">8.76 lowpass</a>
  247. <ul class="no-bullet">
  248. <li><a name="toc-Examples-123" href="#Examples-123">8.76.1 Examples</a></li>
  249. <li><a name="toc-Commands-62" href="#Commands-62">8.76.2 Commands</a></li>
  250. </ul></li>
  251. <li><a name="toc-lv2" href="#lv2">8.77 lv2</a>
  252. <ul class="no-bullet">
  253. <li><a name="toc-Examples-116" href="#Examples-116">8.77.1 Examples</a></li>
  254. </ul></li>
  255. <li><a name="toc-mcompand" href="#mcompand">8.78 mcompand</a></li>
  256. <li><a name="toc-pan-1" href="#pan-1">8.79 pan</a>
  257. <ul class="no-bullet">
  258. <li><a name="toc-Mixing-examples" href="#Mixing-examples">8.79.1 Mixing examples</a></li>
  259. <li><a name="toc-Remapping-examples" href="#Remapping-examples">8.79.2 Remapping examples</a></li>
  260. </ul></li>
  261. <li><a name="toc-replaygain" href="#replaygain">8.80 replaygain</a></li>
  262. <li><a name="toc-resample" href="#resample">8.81 resample</a></li>
  263. <li><a name="toc-rubberband" href="#rubberband">8.82 rubberband</a>
  264. <ul class="no-bullet">
  265. <li><a name="toc-Commands-44" href="#Commands-44">8.82.1 Commands</a></li>
  266. </ul></li>
  267. <li><a name="toc-sidechaincompress" href="#sidechaincompress">8.83 sidechaincompress</a>
  268. <ul class="no-bullet">
  269. <li><a name="toc-Commands-35" href="#Commands-35">8.83.1 Commands</a></li>
  270. <li><a name="toc-Examples-137" href="#Examples-137">8.83.2 Examples</a></li>
  271. </ul></li>
  272. <li><a name="toc-sidechaingate" href="#sidechaingate">8.84 sidechaingate</a></li>
  273. <li><a name="toc-silencedetect" href="#silencedetect">8.85 silencedetect</a>
  274. <ul class="no-bullet">
  275. <li><a name="toc-Examples-133" href="#Examples-133">8.85.1 Examples</a></li>
  276. </ul></li>
  277. <li><a name="toc-silenceremove" href="#silenceremove">8.86 silenceremove</a>
  278. <ul class="no-bullet">
  279. <li><a name="toc-Examples-57" href="#Examples-57">8.86.1 Examples</a></li>
  280. </ul></li>
  281. <li><a name="toc-sofalizer" href="#sofalizer">8.87 sofalizer</a>
  282. <ul class="no-bullet">
  283. <li><a name="toc-Examples-68" href="#Examples-68">8.87.1 Examples</a></li>
  284. </ul></li>
  285. <li><a name="toc-stereotools" href="#stereotools">8.88 stereotools</a>
  286. <ul class="no-bullet">
  287. <li><a name="toc-Examples-35" href="#Examples-35">8.88.1 Examples</a></li>
  288. </ul></li>
  289. <li><a name="toc-stereowiden" href="#stereowiden">8.89 stereowiden</a>
  290. <ul class="no-bullet">
  291. <li><a name="toc-Commands-14" href="#Commands-14">8.89.1 Commands</a></li>
  292. </ul></li>
  293. <li><a name="toc-superequalizer" href="#superequalizer">8.90 superequalizer</a></li>
  294. <li><a name="toc-surround" href="#surround">8.91 surround</a></li>
  295. <li><a name="toc-treble_002c-highshelf" href="#treble_002c-highshelf">8.92 treble, highshelf</a>
  296. <ul class="no-bullet">
  297. <li><a name="toc-Commands-67" href="#Commands-67">8.92.1 Commands</a></li>
  298. </ul></li>
  299. <li><a name="toc-tremolo" href="#tremolo">8.93 tremolo</a></li>
  300. <li><a name="toc-vibrato" href="#vibrato">8.94 vibrato</a></li>
  301. <li><a name="toc-volume" href="#volume">8.95 volume</a>
  302. <ul class="no-bullet">
  303. <li><a name="toc-Commands-43" href="#Commands-43">8.95.1 Commands</a></li>
  304. <li><a name="toc-Examples-107" href="#Examples-107">8.95.2 Examples</a></li>
  305. </ul></li>
  306. <li><a name="toc-volumedetect" href="#volumedetect">8.96 volumedetect</a>
  307. <ul class="no-bullet">
  308. <li><a name="toc-Examples-25" href="#Examples-25">8.96.1 Examples</a></li>
  309. </ul>
  310. </li>
  311. </ul></li>
  312. <li><a name="toc-Audio-Sources" href="#Audio-Sources">9 Audio Sources</a>
  313. <ul class="no-bullet">
  314. <li><a name="toc-abuffer" href="#abuffer">9.1 abuffer</a>
  315. <ul class="no-bullet">
  316. <li><a name="toc-Examples-60" href="#Examples-60">9.1.1 Examples</a></li>
  317. </ul></li>
  318. <li><a name="toc-aevalsrc" href="#aevalsrc">9.2 aevalsrc</a>
  319. <ul class="no-bullet">
  320. <li><a name="toc-Examples-66" href="#Examples-66">9.2.1 Examples</a></li>
  321. </ul></li>
  322. <li><a name="toc-afirsrc" href="#afirsrc">9.3 afirsrc</a></li>
  323. <li><a name="toc-anullsrc" href="#anullsrc">9.4 anullsrc</a>
  324. <ul class="no-bullet">
  325. <li><a name="toc-Examples-28" href="#Examples-28">9.4.1 Examples</a></li>
  326. </ul></li>
  327. <li><a name="toc-flite" href="#flite">9.5 flite</a>
  328. <ul class="no-bullet">
  329. <li><a name="toc-Examples-23" href="#Examples-23">9.5.1 Examples</a></li>
  330. </ul></li>
  331. <li><a name="toc-anoisesrc" href="#anoisesrc">9.6 anoisesrc</a>
  332. <ul class="no-bullet">
  333. <li><a name="toc-Examples-120" href="#Examples-120">9.6.1 Examples</a></li>
  334. </ul></li>
  335. <li><a name="toc-hilbert" href="#hilbert">9.7 hilbert</a></li>
  336. <li><a name="toc-sinc" href="#sinc">9.8 sinc</a></li>
  337. <li><a name="toc-sine" href="#sine">9.9 sine</a>
  338. <ul class="no-bullet">
  339. <li><a name="toc-Examples-34" href="#Examples-34">9.9.1 Examples</a></li>
  340. </ul>
  341. </li>
  342. </ul></li>
  343. <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">10 Audio Sinks</a>
  344. <ul class="no-bullet">
  345. <li><a name="toc-abuffersink" href="#abuffersink">10.1 abuffersink</a></li>
  346. <li><a name="toc-anullsink" href="#anullsink">10.2 anullsink</a></li>
  347. </ul></li>
  348. <li><a name="toc-Video-Filters" href="#Video-Filters">11 Video Filters</a>
  349. <ul class="no-bullet">
  350. <li><a name="toc-addroi" href="#addroi">11.1 addroi</a>
  351. <ul class="no-bullet">
  352. <li><a name="toc-Examples-17" href="#Examples-17">11.1.1 Examples</a></li>
  353. </ul></li>
  354. <li><a name="toc-alphaextract" href="#alphaextract">11.2 alphaextract</a></li>
  355. <li><a name="toc-alphamerge" href="#alphamerge">11.3 alphamerge</a></li>
  356. <li><a name="toc-amplify" href="#amplify">11.4 amplify</a>
  357. <ul class="no-bullet">
  358. <li><a name="toc-Commands-45" href="#Commands-45">11.4.1 Commands</a></li>
  359. </ul></li>
  360. <li><a name="toc-ass" href="#ass">11.5 ass</a></li>
  361. <li><a name="toc-atadenoise" href="#atadenoise">11.6 atadenoise</a>
  362. <ul class="no-bullet">
  363. <li><a name="toc-Commands-47" href="#Commands-47">11.6.1 Commands</a></li>
  364. </ul></li>
  365. <li><a name="toc-avgblur" href="#avgblur">11.7 avgblur</a>
  366. <ul class="no-bullet">
  367. <li><a name="toc-Commands-13" href="#Commands-13">11.7.1 Commands</a></li>
  368. </ul></li>
  369. <li><a name="toc-bbox" href="#bbox">11.8 bbox</a></li>
  370. <li><a name="toc-bilateral" href="#bilateral">11.9 bilateral</a></li>
  371. <li><a name="toc-bitplanenoise" href="#bitplanenoise">11.10 bitplanenoise</a></li>
  372. <li><a name="toc-blackdetect" href="#blackdetect">11.11 blackdetect</a></li>
  373. <li><a name="toc-blackframe" href="#blackframe">11.12 blackframe</a></li>
  374. <li><a name="toc-blend-1" href="#blend-1">11.13 blend</a>
  375. <ul class="no-bullet">
  376. <li><a name="toc-Examples-110" href="#Examples-110">11.13.1 Examples</a></li>
  377. </ul></li>
  378. <li><a name="toc-bm3d" href="#bm3d">11.14 bm3d</a>
  379. <ul class="no-bullet">
  380. <li><a name="toc-Examples-140" href="#Examples-140">11.14.1 Examples</a></li>
  381. </ul></li>
  382. <li><a name="toc-boxblur" href="#boxblur">11.15 boxblur</a>
  383. <ul class="no-bullet">
  384. <li><a name="toc-Examples-97" href="#Examples-97">11.15.1 Examples</a></li>
  385. </ul></li>
  386. <li><a name="toc-bwdif" href="#bwdif">11.16 bwdif</a></li>
  387. <li><a name="toc-cas" href="#cas">11.17 cas</a></li>
  388. <li><a name="toc-chromahold" href="#chromahold">11.18 chromahold</a>
  389. <ul class="no-bullet">
  390. <li><a name="toc-Commands-7" href="#Commands-7">11.18.1 Commands</a></li>
  391. </ul></li>
  392. <li><a name="toc-chromakey" href="#chromakey">11.19 chromakey</a>
  393. <ul class="no-bullet">
  394. <li><a name="toc-Commands-60" href="#Commands-60">11.19.1 Commands</a></li>
  395. <li><a name="toc-Examples-59" href="#Examples-59">11.19.2 Examples</a></li>
  396. </ul></li>
  397. <li><a name="toc-chromashift" href="#chromashift">11.20 chromashift</a>
  398. <ul class="no-bullet">
  399. <li><a name="toc-Commands-2" href="#Commands-2">11.20.1 Commands</a></li>
  400. </ul></li>
  401. <li><a name="toc-ciescope" href="#ciescope">11.21 ciescope</a></li>
  402. <li><a name="toc-codecview" href="#codecview">11.22 codecview</a>
  403. <ul class="no-bullet">
  404. <li><a name="toc-Examples-6" href="#Examples-6">11.22.1 Examples</a></li>
  405. </ul></li>
  406. <li><a name="toc-colorbalance" href="#colorbalance">11.23 colorbalance</a>
  407. <ul class="no-bullet">
  408. <li><a name="toc-Examples-22" href="#Examples-22">11.23.1 Examples</a></li>
  409. <li><a name="toc-Commands-4" href="#Commands-4">11.23.2 Commands</a></li>
  410. </ul></li>
  411. <li><a name="toc-colorchannelmixer" href="#colorchannelmixer">11.24 colorchannelmixer</a>
  412. <ul class="no-bullet">
  413. <li><a name="toc-Examples-82" href="#Examples-82">11.24.1 Examples</a></li>
  414. <li><a name="toc-Commands-56" href="#Commands-56">11.24.2 Commands</a></li>
  415. </ul></li>
  416. <li><a name="toc-colorkey" href="#colorkey">11.25 colorkey</a>
  417. <ul class="no-bullet">
  418. <li><a name="toc-Examples-56" href="#Examples-56">11.25.1 Examples</a></li>
  419. <li><a name="toc-Commands-31" href="#Commands-31">11.25.2 Commands</a></li>
  420. </ul></li>
  421. <li><a name="toc-colorhold" href="#colorhold">11.26 colorhold</a>
  422. <ul class="no-bullet">
  423. <li><a name="toc-Commands-70" href="#Commands-70">11.26.1 Commands</a></li>
  424. </ul></li>
  425. <li><a name="toc-colorlevels" href="#colorlevels">11.27 colorlevels</a>
  426. <ul class="no-bullet">
  427. <li><a name="toc-Examples-150" href="#Examples-150">11.27.1 Examples</a></li>
  428. <li><a name="toc-Commands-15" href="#Commands-15">11.27.2 Commands</a></li>
  429. </ul></li>
  430. <li><a name="toc-colormatrix" href="#colormatrix">11.28 colormatrix</a></li>
  431. <li><a name="toc-colorspace" href="#colorspace">11.29 colorspace</a></li>
  432. <li><a name="toc-convolution" href="#convolution">11.30 convolution</a>
  433. <ul class="no-bullet">
  434. <li><a name="toc-Examples-146" href="#Examples-146">11.30.1 Examples</a></li>
  435. </ul></li>
  436. <li><a name="toc-convolve" href="#convolve">11.31 convolve</a></li>
  437. <li><a name="toc-copy" href="#copy">11.32 copy</a></li>
  438. <li><a name="toc-coreimage-1" href="#coreimage-1">11.33 coreimage</a>
  439. <ul class="no-bullet">
  440. <li><a name="toc-Examples" href="#Examples">11.33.1 Examples</a></li>
  441. </ul></li>
  442. <li><a name="toc-cover_005frect" href="#cover_005frect">11.34 cover_rect</a>
  443. <ul class="no-bullet">
  444. <li><a name="toc-Examples-40" href="#Examples-40">11.34.1 Examples</a></li>
  445. </ul></li>
  446. <li><a name="toc-crop" href="#crop">11.35 crop</a>
  447. <ul class="no-bullet">
  448. <li><a name="toc-Examples-106" href="#Examples-106">11.35.1 Examples</a></li>
  449. <li><a name="toc-Commands-63" href="#Commands-63">11.35.2 Commands</a></li>
  450. </ul></li>
  451. <li><a name="toc-cropdetect" href="#cropdetect">11.36 cropdetect</a></li>
  452. <li><a name="toc-cue-1" href="#cue-1">11.37 cue</a></li>
  453. <li><a name="toc-curves-1" href="#curves-1">11.38 curves</a>
  454. <ul class="no-bullet">
  455. <li><a name="toc-Examples-53" href="#Examples-53">11.38.1 Examples</a></li>
  456. </ul></li>
  457. <li><a name="toc-datascope" href="#datascope">11.39 datascope</a></li>
  458. <li><a name="toc-dblur" href="#dblur">11.40 dblur</a>
  459. <ul class="no-bullet">
  460. <li><a name="toc-Commands-54" href="#Commands-54">11.40.1 Commands</a></li>
  461. </ul></li>
  462. <li><a name="toc-dctdnoiz" href="#dctdnoiz">11.41 dctdnoiz</a>
  463. <ul class="no-bullet">
  464. <li><a name="toc-Examples-5" href="#Examples-5">11.41.1 Examples</a></li>
  465. </ul></li>
  466. <li><a name="toc-deband" href="#deband">11.42 deband</a></li>
  467. <li><a name="toc-deblock" href="#deblock">11.43 deblock</a>
  468. <ul class="no-bullet">
  469. <li><a name="toc-Examples-36" href="#Examples-36">11.43.1 Examples</a></li>
  470. </ul></li>
  471. <li><a name="toc-decimate-1" href="#decimate-1">11.44 decimate</a></li>
  472. <li><a name="toc-deconvolve" href="#deconvolve">11.45 deconvolve</a></li>
  473. <li><a name="toc-dedot" href="#dedot">11.46 dedot</a></li>
  474. <li><a name="toc-deflate" href="#deflate">11.47 deflate</a>
  475. <ul class="no-bullet">
  476. <li><a name="toc-Commands-40" href="#Commands-40">11.47.1 Commands</a></li>
  477. </ul></li>
  478. <li><a name="toc-deflicker" href="#deflicker">11.48 deflicker</a></li>
  479. <li><a name="toc-dejudder" href="#dejudder">11.49 dejudder</a></li>
  480. <li><a name="toc-delogo" href="#delogo">11.50 delogo</a>
  481. <ul class="no-bullet">
  482. <li><a name="toc-Examples-19" href="#Examples-19">11.50.1 Examples</a></li>
  483. </ul></li>
  484. <li><a name="toc-derain-1" href="#derain-1">11.51 derain</a></li>
  485. <li><a name="toc-deshake" href="#deshake">11.52 deshake</a></li>
  486. <li><a name="toc-despill" href="#despill">11.53 despill</a></li>
  487. <li><a name="toc-detelecine" href="#detelecine">11.54 detelecine</a></li>
  488. <li><a name="toc-dilation" href="#dilation">11.55 dilation</a>
  489. <ul class="no-bullet">
  490. <li><a name="toc-Commands-1" href="#Commands-1">11.55.1 Commands</a></li>
  491. </ul></li>
  492. <li><a name="toc-displace" href="#displace">11.56 displace</a>
  493. <ul class="no-bullet">
  494. <li><a name="toc-Examples-48" href="#Examples-48">11.56.1 Examples</a></li>
  495. </ul></li>
  496. <li><a name="toc-dnn_005fprocessing-1" href="#dnn_005fprocessing-1">11.57 dnn_processing</a>
  497. <ul class="no-bullet">
  498. <li><a name="toc-Examples-128" href="#Examples-128">11.57.1 Examples</a></li>
  499. </ul></li>
  500. <li><a name="toc-drawbox" href="#drawbox">11.58 drawbox</a>
  501. <ul class="no-bullet">
  502. <li><a name="toc-Examples-96" href="#Examples-96">11.58.1 Examples</a></li>
  503. <li><a name="toc-Commands-6" href="#Commands-6">11.58.2 Commands</a></li>
  504. </ul></li>
  505. <li><a name="toc-drawgraph-1" href="#drawgraph-1">11.59 drawgraph</a></li>
  506. <li><a name="toc-drawgrid" href="#drawgrid">11.60 drawgrid</a>
  507. <ul class="no-bullet">
  508. <li><a name="toc-Examples-27" href="#Examples-27">11.60.1 Examples</a></li>
  509. <li><a name="toc-Commands-57" href="#Commands-57">11.60.2 Commands</a></li>
  510. </ul></li>
  511. <li><a name="toc-drawtext-1" href="#drawtext-1">11.61 drawtext</a>
  512. <ul class="no-bullet">
  513. <li><a name="toc-Syntax" href="#Syntax">11.61.1 Syntax</a></li>
  514. <li><a name="toc-Text-expansion" href="#Text-expansion">11.61.2 Text expansion</a></li>
  515. <li><a name="toc-Commands-16" href="#Commands-16">11.61.3 Commands</a></li>
  516. <li><a name="toc-Examples-46" href="#Examples-46">11.61.4 Examples</a></li>
  517. </ul></li>
  518. <li><a name="toc-edgedetect" href="#edgedetect">11.62 edgedetect</a>
  519. <ul class="no-bullet">
  520. <li><a name="toc-Examples-100" href="#Examples-100">11.62.1 Examples</a></li>
  521. </ul></li>
  522. <li><a name="toc-elbg" href="#elbg">11.63 elbg</a></li>
  523. <li><a name="toc-entropy" href="#entropy">11.64 entropy</a></li>
  524. <li><a name="toc-eq" href="#eq">11.65 eq</a>
  525. <ul class="no-bullet">
  526. <li><a name="toc-Commands-41" href="#Commands-41">11.65.1 Commands</a></li>
  527. </ul></li>
  528. <li><a name="toc-erosion" href="#erosion">11.66 erosion</a>
  529. <ul class="no-bullet">
  530. <li><a name="toc-Commands-28" href="#Commands-28">11.66.1 Commands</a></li>
  531. </ul></li>
  532. <li><a name="toc-extractplanes" href="#extractplanes">11.67 extractplanes</a>
  533. <ul class="no-bullet">
  534. <li><a name="toc-Examples-32" href="#Examples-32">11.67.1 Examples</a></li>
  535. </ul></li>
  536. <li><a name="toc-fade" href="#fade">11.68 fade</a>
  537. <ul class="no-bullet">
  538. <li><a name="toc-Examples-33" href="#Examples-33">11.68.1 Examples</a></li>
  539. </ul></li>
  540. <li><a name="toc-fftdnoiz" href="#fftdnoiz">11.69 fftdnoiz</a></li>
  541. <li><a name="toc-fftfilt" href="#fftfilt">11.70 fftfilt</a>
  542. <ul class="no-bullet">
  543. <li><a name="toc-Examples-3" href="#Examples-3">11.70.1 Examples</a></li>
  544. </ul></li>
  545. <li><a name="toc-field" href="#field">11.71 field</a></li>
  546. <li><a name="toc-fieldhint" href="#fieldhint">11.72 fieldhint</a></li>
  547. <li><a name="toc-fieldmatch" href="#fieldmatch">11.73 fieldmatch</a>
  548. <ul class="no-bullet">
  549. <li><a name="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">11.73.1 p/c/n/u/b meaning</a>
  550. <ul class="no-bullet">
  551. <li><a name="toc-p_002fc_002fn" href="#p_002fc_002fn">11.73.1.1 p/c/n</a></li>
  552. <li><a name="toc-u_002fb" href="#u_002fb">11.73.1.2 u/b</a></li>
  553. </ul></li>
  554. <li><a name="toc-Examples-16" href="#Examples-16">11.73.2 Examples</a></li>
  555. </ul></li>
  556. <li><a name="toc-fieldorder" href="#fieldorder">11.74 fieldorder</a></li>
  557. <li><a name="toc-fifo_002c-afifo" href="#fifo_002c-afifo">11.75 fifo, afifo</a></li>
  558. <li><a name="toc-fillborders" href="#fillborders">11.76 fillborders</a>
  559. <ul class="no-bullet">
  560. <li><a name="toc-Commands-38" href="#Commands-38">11.76.1 Commands</a></li>
  561. </ul></li>
  562. <li><a name="toc-find_005frect" href="#find_005frect">11.77 find_rect</a>
  563. <ul class="no-bullet">
  564. <li><a name="toc-Examples-88" href="#Examples-88">11.77.1 Examples</a></li>
  565. </ul></li>
  566. <li><a name="toc-floodfill" href="#floodfill">11.78 floodfill</a></li>
  567. <li><a name="toc-format-1" href="#format-1">11.79 format</a>
  568. <ul class="no-bullet">
  569. <li><a name="toc-Examples-15" href="#Examples-15">11.79.1 Examples</a></li>
  570. </ul></li>
  571. <li><a name="toc-fps-1" href="#fps-1">11.80 fps</a>
  572. <ul class="no-bullet">
  573. <li><a name="toc-Examples-101" href="#Examples-101">11.80.1 Examples</a></li>
  574. </ul></li>
  575. <li><a name="toc-framepack" href="#framepack">11.81 framepack</a></li>
  576. <li><a name="toc-framerate" href="#framerate">11.82 framerate</a></li>
  577. <li><a name="toc-framestep" href="#framestep">11.83 framestep</a></li>
  578. <li><a name="toc-freezedetect" href="#freezedetect">11.84 freezedetect</a></li>
  579. <li><a name="toc-freezeframes" href="#freezeframes">11.85 freezeframes</a></li>
  580. <li><a name="toc-frei0r-1" href="#frei0r-1">11.86 frei0r</a>
  581. <ul class="no-bullet">
  582. <li><a name="toc-Examples-79" href="#Examples-79">11.86.1 Examples</a></li>
  583. </ul></li>
  584. <li><a name="toc-fspp" href="#fspp">11.87 fspp</a></li>
  585. <li><a name="toc-gblur" href="#gblur">11.88 gblur</a>
  586. <ul class="no-bullet">
  587. <li><a name="toc-Commands-48" href="#Commands-48">11.88.1 Commands</a></li>
  588. </ul></li>
  589. <li><a name="toc-geq" href="#geq">11.89 geq</a>
  590. <ul class="no-bullet">
  591. <li><a name="toc-Examples-78" href="#Examples-78">11.89.1 Examples</a></li>
  592. </ul></li>
  593. <li><a name="toc-gradfun" href="#gradfun">11.90 gradfun</a>
  594. <ul class="no-bullet">
  595. <li><a name="toc-Examples-92" href="#Examples-92">11.90.1 Examples</a></li>
  596. </ul></li>
  597. <li><a name="toc-graphmonitor-1" href="#graphmonitor-1">11.91 graphmonitor</a></li>
  598. <li><a name="toc-greyedge" href="#greyedge">11.92 greyedge</a>
  599. <ul class="no-bullet">
  600. <li><a name="toc-Examples-64" href="#Examples-64">11.92.1 Examples</a></li>
  601. </ul></li>
  602. <li><a name="toc-haldclut-1" href="#haldclut-1">11.93 haldclut</a>
  603. <ul class="no-bullet">
  604. <li><a name="toc-Workflow-examples" href="#Workflow-examples">11.93.1 Workflow examples</a>
  605. <ul class="no-bullet">
  606. <li><a name="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">11.93.1.1 Hald CLUT video stream</a></li>
  607. <li><a name="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">11.93.1.2 Hald CLUT with preview</a></li>
  608. </ul>
  609. </li>
  610. </ul></li>
  611. <li><a name="toc-hflip" href="#hflip">11.94 hflip</a></li>
  612. <li><a name="toc-histeq" href="#histeq">11.95 histeq</a></li>
  613. <li><a name="toc-histogram-1" href="#histogram-1">11.96 histogram</a>
  614. <ul class="no-bullet">
  615. <li><a name="toc-Examples-129" href="#Examples-129">11.96.1 Examples</a></li>
  616. </ul></li>
  617. <li><a name="toc-hqdn3d-1" href="#hqdn3d-1">11.97 hqdn3d</a>
  618. <ul class="no-bullet">
  619. <li><a name="toc-Commands-30" href="#Commands-30">11.97.1 Commands</a></li>
  620. </ul></li>
  621. <li><a name="toc-hwdownload-1" href="#hwdownload-1">11.98 hwdownload</a></li>
  622. <li><a name="toc-hwmap" href="#hwmap">11.99 hwmap</a></li>
  623. <li><a name="toc-hwupload-1" href="#hwupload-1">11.100 hwupload</a></li>
  624. <li><a name="toc-hwupload_005fcuda-1" href="#hwupload_005fcuda-1">11.101 hwupload_cuda</a></li>
  625. <li><a name="toc-hqx" href="#hqx">11.102 hqx</a></li>
  626. <li><a name="toc-hstack" href="#hstack">11.103 hstack</a></li>
  627. <li><a name="toc-hue" href="#hue">11.104 hue</a>
  628. <ul class="no-bullet">
  629. <li><a name="toc-Examples-135" href="#Examples-135">11.104.1 Examples</a></li>
  630. <li><a name="toc-Commands-9" href="#Commands-9">11.104.2 Commands</a></li>
  631. </ul></li>
  632. <li><a name="toc-hysteresis" href="#hysteresis">11.105 hysteresis</a></li>
  633. <li><a name="toc-idet" href="#idet">11.106 idet</a></li>
  634. <li><a name="toc-il" href="#il">11.107 il</a>
  635. <ul class="no-bullet">
  636. <li><a name="toc-Commands-23" href="#Commands-23">11.107.1 Commands</a></li>
  637. </ul></li>
  638. <li><a name="toc-inflate" href="#inflate">11.108 inflate</a>
  639. <ul class="no-bullet">
  640. <li><a name="toc-Commands-36" href="#Commands-36">11.108.1 Commands</a></li>
  641. </ul></li>
  642. <li><a name="toc-interlace" href="#interlace">11.109 interlace</a></li>
  643. <li><a name="toc-kerndeint" href="#kerndeint">11.110 kerndeint</a>
  644. <ul class="no-bullet">
  645. <li><a name="toc-Examples-58" href="#Examples-58">11.110.1 Examples</a></li>
  646. </ul></li>
  647. <li><a name="toc-lagfun" href="#lagfun">11.111 lagfun</a></li>
  648. <li><a name="toc-lenscorrection" href="#lenscorrection">11.112 lenscorrection</a>
  649. <ul class="no-bullet">
  650. <li><a name="toc-Options-1" href="#Options-1">11.112.1 Options</a></li>
  651. </ul></li>
  652. <li><a name="toc-lensfun" href="#lensfun">11.113 lensfun</a>
  653. <ul class="no-bullet">
  654. <li><a name="toc-Examples-18" href="#Examples-18">11.113.1 Examples</a></li>
  655. </ul></li>
  656. <li><a name="toc-libvmaf" href="#libvmaf">11.114 libvmaf</a>
  657. <ul class="no-bullet">
  658. <li><a name="toc-Examples-45" href="#Examples-45">11.114.1 Examples</a></li>
  659. </ul></li>
  660. <li><a name="toc-limiter" href="#limiter">11.115 limiter</a></li>
  661. <li><a name="toc-loop" href="#loop">11.116 loop</a>
  662. <ul class="no-bullet">
  663. <li><a name="toc-Examples-21" href="#Examples-21">11.116.1 Examples</a></li>
  664. </ul></li>
  665. <li><a name="toc-lut1d" href="#lut1d">11.117 lut1d</a></li>
  666. <li><a name="toc-lut3d-1" href="#lut3d-1">11.118 lut3d</a></li>
  667. <li><a name="toc-lumakey" href="#lumakey">11.119 lumakey</a>
  668. <ul class="no-bullet">
  669. <li><a name="toc-Commands-5" href="#Commands-5">11.119.1 Commands</a></li>
  670. </ul></li>
  671. <li><a name="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">11.120 lut, lutrgb, lutyuv</a>
  672. <ul class="no-bullet">
  673. <li><a name="toc-Examples-143" href="#Examples-143">11.120.1 Examples</a></li>
  674. </ul></li>
  675. <li><a name="toc-lut2_002c-tlut2" href="#lut2_002c-tlut2">11.121 lut2, tlut2</a>
  676. <ul class="no-bullet">
  677. <li><a name="toc-Examples-20" href="#Examples-20">11.121.1 Examples</a></li>
  678. </ul></li>
  679. <li><a name="toc-maskedclamp" href="#maskedclamp">11.122 maskedclamp</a></li>
  680. <li><a name="toc-maskedmax" href="#maskedmax">11.123 maskedmax</a></li>
  681. <li><a name="toc-maskedmerge" href="#maskedmerge">11.124 maskedmerge</a></li>
  682. <li><a name="toc-maskedmin" href="#maskedmin">11.125 maskedmin</a></li>
  683. <li><a name="toc-maskedthreshold" href="#maskedthreshold">11.126 maskedthreshold</a></li>
  684. <li><a name="toc-maskfun" href="#maskfun">11.127 maskfun</a></li>
  685. <li><a name="toc-mcdeint" href="#mcdeint">11.128 mcdeint</a></li>
  686. <li><a name="toc-median" href="#median">11.129 median</a>
  687. <ul class="no-bullet">
  688. <li><a name="toc-Commands-58" href="#Commands-58">11.129.1 Commands</a></li>
  689. </ul></li>
  690. <li><a name="toc-mergeplanes" href="#mergeplanes">11.130 mergeplanes</a>
  691. <ul class="no-bullet">
  692. <li><a name="toc-Examples-95" href="#Examples-95">11.130.1 Examples</a></li>
  693. </ul></li>
  694. <li><a name="toc-mestimate" href="#mestimate">11.131 mestimate</a></li>
  695. <li><a name="toc-midequalizer" href="#midequalizer">11.132 midequalizer</a></li>
  696. <li><a name="toc-minterpolate" href="#minterpolate">11.133 minterpolate</a></li>
  697. <li><a name="toc-mix" href="#mix">11.134 mix</a></li>
  698. <li><a name="toc-mpdecimate" href="#mpdecimate">11.135 mpdecimate</a></li>
  699. <li><a name="toc-negate" href="#negate">11.136 negate</a></li>
  700. <li><a name="toc-nlmeans-1" href="#nlmeans-1">11.137 nlmeans</a></li>
  701. <li><a name="toc-nnedi" href="#nnedi">11.138 nnedi</a></li>
  702. <li><a name="toc-noformat" href="#noformat">11.139 noformat</a>
  703. <ul class="no-bullet">
  704. <li><a name="toc-Examples-141" href="#Examples-141">11.139.1 Examples</a></li>
  705. </ul></li>
  706. <li><a name="toc-noise" href="#noise">11.140 noise</a>
  707. <ul class="no-bullet">
  708. <li><a name="toc-Examples-73" href="#Examples-73">11.140.1 Examples</a></li>
  709. </ul></li>
  710. <li><a name="toc-normalize" href="#normalize">11.141 normalize</a>
  711. <ul class="no-bullet">
  712. <li><a name="toc-Commands-20" href="#Commands-20">11.141.1 Commands</a></li>
  713. <li><a name="toc-Examples-91" href="#Examples-91">11.141.2 Examples</a></li>
  714. </ul></li>
  715. <li><a name="toc-null" href="#null">11.142 null</a></li>
  716. <li><a name="toc-ocr" href="#ocr">11.143 ocr</a></li>
  717. <li><a name="toc-ocv" href="#ocv">11.144 ocv</a>
  718. <ul class="no-bullet">
  719. <li><a name="toc-dilate-1" href="#dilate-1">11.144.1 dilate</a></li>
  720. <li><a name="toc-erode" href="#erode">11.144.2 erode</a></li>
  721. <li><a name="toc-smooth" href="#smooth">11.144.3 smooth</a></li>
  722. </ul></li>
  723. <li><a name="toc-oscilloscope" href="#oscilloscope">11.145 oscilloscope</a>
  724. <ul class="no-bullet">
  725. <li><a name="toc-Commands-8" href="#Commands-8">11.145.1 Commands</a></li>
  726. <li><a name="toc-Examples-50" href="#Examples-50">11.145.2 Examples</a></li>
  727. </ul></li>
  728. <li><a name="toc-overlay-1" href="#overlay-1">11.146 overlay</a>
  729. <ul class="no-bullet">
  730. <li><a name="toc-Commands-52" href="#Commands-52">11.146.1 Commands</a></li>
  731. <li><a name="toc-Examples-1" href="#Examples-1">11.146.2 Examples</a></li>
  732. </ul></li>
  733. <li><a name="toc-overlay_005fcuda-1" href="#overlay_005fcuda-1">11.147 overlay_cuda</a></li>
  734. <li><a name="toc-owdenoise" href="#owdenoise">11.148 owdenoise</a></li>
  735. <li><a name="toc-pad-1" href="#pad-1">11.149 pad</a>
  736. <ul class="no-bullet">
  737. <li><a name="toc-Examples-80" href="#Examples-80">11.149.1 Examples</a></li>
  738. </ul></li>
  739. <li><a name="toc-palettegen-1" href="#palettegen-1">11.150 palettegen</a>
  740. <ul class="no-bullet">
  741. <li><a name="toc-Examples-118" href="#Examples-118">11.150.1 Examples</a></li>
  742. </ul></li>
  743. <li><a name="toc-paletteuse" href="#paletteuse">11.151 paletteuse</a>
  744. <ul class="no-bullet">
  745. <li><a name="toc-Examples-55" href="#Examples-55">11.151.1 Examples</a></li>
  746. </ul></li>
  747. <li><a name="toc-perspective" href="#perspective">11.152 perspective</a></li>
  748. <li><a name="toc-phase" href="#phase">11.153 phase</a></li>
  749. <li><a name="toc-photosensitivity" href="#photosensitivity">11.154 photosensitivity</a></li>
  750. <li><a name="toc-pixdesctest" href="#pixdesctest">11.155 pixdesctest</a></li>
  751. <li><a name="toc-pixscope" href="#pixscope">11.156 pixscope</a></li>
  752. <li><a name="toc-pp" href="#pp">11.157 pp</a>
  753. <ul class="no-bullet">
  754. <li><a name="toc-Examples-70" href="#Examples-70">11.157.1 Examples</a></li>
  755. </ul></li>
  756. <li><a name="toc-pp7" href="#pp7">11.158 pp7</a></li>
  757. <li><a name="toc-premultiply" href="#premultiply">11.159 premultiply</a></li>
  758. <li><a name="toc-prewitt" href="#prewitt">11.160 prewitt</a></li>
  759. <li><a name="toc-pseudocolor" href="#pseudocolor">11.161 pseudocolor</a>
  760. <ul class="no-bullet">
  761. <li><a name="toc-Examples-54" href="#Examples-54">11.161.1 Examples</a></li>
  762. </ul></li>
  763. <li><a name="toc-psnr" href="#psnr">11.162 psnr</a>
  764. <ul class="no-bullet">
  765. <li><a name="toc-Examples-51" href="#Examples-51">11.162.1 Examples</a></li>
  766. </ul></li>
  767. <li><a name="toc-pullup-1" href="#pullup-1">11.163 pullup</a></li>
  768. <li><a name="toc-qp" href="#qp">11.164 qp</a>
  769. <ul class="no-bullet">
  770. <li><a name="toc-Examples-14" href="#Examples-14">11.164.1 Examples</a></li>
  771. </ul></li>
  772. <li><a name="toc-random" href="#random">11.165 random</a></li>
  773. <li><a name="toc-readeia608" href="#readeia608">11.166 readeia608</a>
  774. <ul class="no-bullet">
  775. <li><a name="toc-Examples-132" href="#Examples-132">11.166.1 Examples</a></li>
  776. </ul></li>
  777. <li><a name="toc-readvitc" href="#readvitc">11.167 readvitc</a>
  778. <ul class="no-bullet">
  779. <li><a name="toc-Examples-39" href="#Examples-39">11.167.1 Examples</a></li>
  780. </ul></li>
  781. <li><a name="toc-remap" href="#remap">11.168 remap</a></li>
  782. <li><a name="toc-removegrain" href="#removegrain">11.169 removegrain</a></li>
  783. <li><a name="toc-removelogo" href="#removelogo">11.170 removelogo</a></li>
  784. <li><a name="toc-repeatfields" href="#repeatfields">11.171 repeatfields</a></li>
  785. <li><a name="toc-reverse" href="#reverse">11.172 reverse</a>
  786. <ul class="no-bullet">
  787. <li><a name="toc-Examples-9" href="#Examples-9">11.172.1 Examples</a></li>
  788. </ul></li>
  789. <li><a name="toc-rgbashift" href="#rgbashift">11.173 rgbashift</a>
  790. <ul class="no-bullet">
  791. <li><a name="toc-Commands-10" href="#Commands-10">11.173.1 Commands</a></li>
  792. </ul></li>
  793. <li><a name="toc-roberts" href="#roberts">11.174 roberts</a></li>
  794. <li><a name="toc-rotate" href="#rotate">11.175 rotate</a>
  795. <ul class="no-bullet">
  796. <li><a name="toc-Examples-152" href="#Examples-152">11.175.1 Examples</a></li>
  797. <li><a name="toc-Commands-59" href="#Commands-59">11.175.2 Commands</a></li>
  798. </ul></li>
  799. <li><a name="toc-sab" href="#sab">11.176 sab</a></li>
  800. <li><a name="toc-scale-1" href="#scale-1">11.177 scale</a>
  801. <ul class="no-bullet">
  802. <li><a name="toc-Options-2" href="#Options-2">11.177.1 Options</a></li>
  803. <li><a name="toc-Examples-43" href="#Examples-43">11.177.2 Examples</a></li>
  804. <li><a name="toc-Commands-51" href="#Commands-51">11.177.3 Commands</a></li>
  805. </ul></li>
  806. <li><a name="toc-scale_005fnpp" href="#scale_005fnpp">11.178 scale_npp</a></li>
  807. <li><a name="toc-scale2ref" href="#scale2ref">11.179 scale2ref</a>
  808. <ul class="no-bullet">
  809. <li><a name="toc-Examples-63" href="#Examples-63">11.179.1 Examples</a></li>
  810. <li><a name="toc-Commands-68" href="#Commands-68">11.179.2 Commands</a></li>
  811. </ul></li>
  812. <li><a name="toc-scroll" href="#scroll">11.180 scroll</a>
  813. <ul class="no-bullet">
  814. <li><a name="toc-Commands-55" href="#Commands-55">11.180.1 Commands</a></li>
  815. </ul></li>
  816. <li><a name="toc-scdet-1" href="#scdet-1">11.181 scdet</a></li>
  817. <li><a name="toc-selectivecolor-1" href="#selectivecolor-1">11.182 selectivecolor</a>
  818. <ul class="no-bullet">
  819. <li><a name="toc-Examples-76" href="#Examples-76">11.182.1 Examples</a></li>
  820. </ul></li>
  821. <li><a name="toc-separatefields-1" href="#separatefields-1">11.183 separatefields</a></li>
  822. <li><a name="toc-setdar_002c-setsar" href="#setdar_002c-setsar">11.184 setdar, setsar</a>
  823. <ul class="no-bullet">
  824. <li><a name="toc-Examples-74" href="#Examples-74">11.184.1 Examples</a></li>
  825. </ul></li>
  826. <li><a name="toc-setfield-1" href="#setfield-1">11.185 setfield</a></li>
  827. <li><a name="toc-setparams-1" href="#setparams-1">11.186 setparams</a></li>
  828. <li><a name="toc-showinfo" href="#showinfo">11.187 showinfo</a></li>
  829. <li><a name="toc-showpalette" href="#showpalette">11.188 showpalette</a></li>
  830. <li><a name="toc-shuffleframes" href="#shuffleframes">11.189 shuffleframes</a>
  831. <ul class="no-bullet">
  832. <li><a name="toc-Examples-122" href="#Examples-122">11.189.1 Examples</a></li>
  833. </ul></li>
  834. <li><a name="toc-shuffleplanes" href="#shuffleplanes">11.190 shuffleplanes</a>
  835. <ul class="no-bullet">
  836. <li><a name="toc-Examples-71" href="#Examples-71">11.190.1 Examples</a></li>
  837. </ul></li>
  838. <li><a name="toc-signalstats-1" href="#signalstats-1">11.191 signalstats</a>
  839. <ul class="no-bullet">
  840. <li><a name="toc-Examples-93" href="#Examples-93">11.191.1 Examples</a></li>
  841. </ul></li>
  842. <li><a name="toc-signature-1" href="#signature-1">11.192 signature</a>
  843. <ul class="no-bullet">
  844. <li><a name="toc-Examples-30" href="#Examples-30">11.192.1 Examples</a></li>
  845. </ul></li>
  846. <li><a name="toc-smartblur-1" href="#smartblur-1">11.193 smartblur</a></li>
  847. <li><a name="toc-sobel" href="#sobel">11.194 sobel</a></li>
  848. <li><a name="toc-spp-1" href="#spp-1">11.195 spp</a>
  849. <ul class="no-bullet">
  850. <li><a name="toc-Commands-18" href="#Commands-18">11.195.1 Commands</a></li>
  851. </ul></li>
  852. <li><a name="toc-sr-1" href="#sr-1">11.196 sr</a></li>
  853. <li><a name="toc-ssim" href="#ssim">11.197 ssim</a>
  854. <ul class="no-bullet">
  855. <li><a name="toc-Examples-127" href="#Examples-127">11.197.1 Examples</a></li>
  856. </ul></li>
  857. <li><a name="toc-stereo3d" href="#stereo3d">11.198 stereo3d</a>
  858. <ul class="no-bullet">
  859. <li><a name="toc-Examples-69" href="#Examples-69">11.198.1 Examples</a></li>
  860. </ul></li>
  861. <li><a name="toc-streamselect_002c-astreamselect" href="#streamselect_002c-astreamselect">11.199 streamselect, astreamselect</a>
  862. <ul class="no-bullet">
  863. <li><a name="toc-Commands-32" href="#Commands-32">11.199.1 Commands</a></li>
  864. <li><a name="toc-Examples-109" href="#Examples-109">11.199.2 Examples</a></li>
  865. </ul></li>
  866. <li><a name="toc-subtitles-1" href="#subtitles-1">11.200 subtitles</a></li>
  867. <li><a name="toc-super2xsai" href="#super2xsai">11.201 super2xsai</a></li>
  868. <li><a name="toc-swaprect" href="#swaprect">11.202 swaprect</a></li>
  869. <li><a name="toc-swapuv" href="#swapuv">11.203 swapuv</a></li>
  870. <li><a name="toc-tblend" href="#tblend">11.204 tblend</a></li>
  871. <li><a name="toc-telecine" href="#telecine">11.205 telecine</a></li>
  872. <li><a name="toc-thistogram" href="#thistogram">11.206 thistogram</a></li>
  873. <li><a name="toc-threshold" href="#threshold">11.207 threshold</a>
  874. <ul class="no-bullet">
  875. <li><a name="toc-Examples-67" href="#Examples-67">11.207.1 Examples</a></li>
  876. </ul></li>
  877. <li><a name="toc-thumbnail" href="#thumbnail">11.208 thumbnail</a>
  878. <ul class="no-bullet">
  879. <li><a name="toc-Examples-94" href="#Examples-94">11.208.1 Examples</a></li>
  880. </ul></li>
  881. <li><a name="toc-tile-1" href="#tile-1">11.209 tile</a>
  882. <ul class="no-bullet">
  883. <li><a name="toc-Examples-105" href="#Examples-105">11.209.1 Examples</a></li>
  884. </ul></li>
  885. <li><a name="toc-tinterlace" href="#tinterlace">11.210 tinterlace</a></li>
  886. <li><a name="toc-tmedian" href="#tmedian">11.211 tmedian</a></li>
  887. <li><a name="toc-tmix" href="#tmix">11.212 tmix</a>
  888. <ul class="no-bullet">
  889. <li><a name="toc-Examples-83" href="#Examples-83">11.212.1 Examples</a></li>
  890. </ul></li>
  891. <li><a name="toc-tonemap-1" href="#tonemap-1">11.213 tonemap</a>
  892. <ul class="no-bullet">
  893. <li><a name="toc-Options" href="#Options">11.213.1 Options</a></li>
  894. </ul></li>
  895. <li><a name="toc-tpad" href="#tpad">11.214 tpad</a></li>
  896. <li><a name="toc-transpose-1" href="#transpose-1">11.215 transpose</a></li>
  897. <li><a name="toc-transpose_005fnpp" href="#transpose_005fnpp">11.216 transpose_npp</a></li>
  898. <li><a name="toc-trim" href="#trim">11.217 trim</a></li>
  899. <li><a name="toc-unpremultiply" href="#unpremultiply">11.218 unpremultiply</a></li>
  900. <li><a name="toc-unsharp-1" href="#unsharp-1">11.219 unsharp</a>
  901. <ul class="no-bullet">
  902. <li><a name="toc-Examples-126" href="#Examples-126">11.219.1 Examples</a></li>
  903. </ul></li>
  904. <li><a name="toc-untile-1" href="#untile-1">11.220 untile</a>
  905. <ul class="no-bullet">
  906. <li><a name="toc-Examples-112" href="#Examples-112">11.220.1 Examples</a></li>
  907. </ul></li>
  908. <li><a name="toc-uspp" href="#uspp">11.221 uspp</a></li>
  909. <li><a name="toc-v360" href="#v360">11.222 v360</a>
  910. <ul class="no-bullet">
  911. <li><a name="toc-Examples-8" href="#Examples-8">11.222.1 Examples</a></li>
  912. <li><a name="toc-Commands-34" href="#Commands-34">11.222.2 Commands</a></li>
  913. </ul></li>
  914. <li><a name="toc-vaguedenoiser" href="#vaguedenoiser">11.223 vaguedenoiser</a></li>
  915. <li><a name="toc-vectorscope" href="#vectorscope">11.224 vectorscope</a></li>
  916. <li><a name="toc-vidstabdetect-1" href="#vidstabdetect-1">11.225 vidstabdetect</a>
  917. <ul class="no-bullet">
  918. <li><a name="toc-Examples-7" href="#Examples-7">11.225.1 Examples</a></li>
  919. </ul></li>
  920. <li><a name="toc-vidstabtransform-1" href="#vidstabtransform-1">11.226 vidstabtransform</a>
  921. <ul class="no-bullet">
  922. <li><a name="toc-Options-4" href="#Options-4">11.226.1 Options</a></li>
  923. <li><a name="toc-Examples-138" href="#Examples-138">11.226.2 Examples</a></li>
  924. </ul></li>
  925. <li><a name="toc-vflip" href="#vflip">11.227 vflip</a></li>
  926. <li><a name="toc-vfrdet" href="#vfrdet">11.228 vfrdet</a></li>
  927. <li><a name="toc-vibrance" href="#vibrance">11.229 vibrance</a>
  928. <ul class="no-bullet">
  929. <li><a name="toc-Commands-12" href="#Commands-12">11.229.1 Commands</a></li>
  930. </ul></li>
  931. <li><a name="toc-vignette-1" href="#vignette-1">11.230 vignette</a>
  932. <ul class="no-bullet">
  933. <li><a name="toc-Expressions" href="#Expressions">11.230.1 Expressions</a></li>
  934. <li><a name="toc-Examples-37" href="#Examples-37">11.230.2 Examples</a></li>
  935. </ul></li>
  936. <li><a name="toc-vmafmotion" href="#vmafmotion">11.231 vmafmotion</a></li>
  937. <li><a name="toc-vstack" href="#vstack">11.232 vstack</a></li>
  938. <li><a name="toc-w3fdif" href="#w3fdif">11.233 w3fdif</a></li>
  939. <li><a name="toc-waveform" href="#waveform">11.234 waveform</a></li>
  940. <li><a name="toc-weave_002c-doubleweave" href="#weave_002c-doubleweave">11.235 weave, doubleweave</a>
  941. <ul class="no-bullet">
  942. <li><a name="toc-Examples-81" href="#Examples-81">11.235.1 Examples</a></li>
  943. </ul></li>
  944. <li><a name="toc-xbr" href="#xbr">11.236 xbr</a></li>
  945. <li><a name="toc-xfade" href="#xfade">11.237 xfade</a>
  946. <ul class="no-bullet">
  947. <li><a name="toc-Examples-12" href="#Examples-12">11.237.1 Examples</a></li>
  948. </ul></li>
  949. <li><a name="toc-xmedian" href="#xmedian">11.238 xmedian</a></li>
  950. <li><a name="toc-xstack" href="#xstack">11.239 xstack</a>
  951. <ul class="no-bullet">
  952. <li><a name="toc-Examples-89" href="#Examples-89">11.239.1 Examples</a></li>
  953. </ul></li>
  954. <li><a name="toc-yadif-1" href="#yadif-1">11.240 yadif</a></li>
  955. <li><a name="toc-yadif_005fcuda" href="#yadif_005fcuda">11.241 yadif_cuda</a></li>
  956. <li><a name="toc-yaepblur" href="#yaepblur">11.242 yaepblur</a>
  957. <ul class="no-bullet">
  958. <li><a name="toc-Commands-33" href="#Commands-33">11.242.1 Commands</a></li>
  959. </ul></li>
  960. <li><a name="toc-zoompan" href="#zoompan">11.243 zoompan</a>
  961. <ul class="no-bullet">
  962. <li><a name="toc-Examples-75" href="#Examples-75">11.243.1 Examples</a></li>
  963. </ul></li>
  964. <li><a name="toc-zscale-1" href="#zscale-1">11.244 zscale</a>
  965. <ul class="no-bullet">
  966. <li><a name="toc-Options-3" href="#Options-3">11.244.1 Options</a></li>
  967. <li><a name="toc-Commands-22" href="#Commands-22">11.244.2 Commands</a></li>
  968. </ul>
  969. </li>
  970. </ul></li>
  971. <li><a name="toc-OpenCL-Video-Filters" href="#OpenCL-Video-Filters">12 OpenCL Video Filters</a>
  972. <ul class="no-bullet">
  973. <li><a name="toc-avgblur_005fopencl" href="#avgblur_005fopencl">12.1 avgblur_opencl</a>
  974. <ul class="no-bullet">
  975. <li><a name="toc-Example-1" href="#Example-1">12.1.1 Example</a></li>
  976. </ul></li>
  977. <li><a name="toc-boxblur_005fopencl" href="#boxblur_005fopencl">12.2 boxblur_opencl</a>
  978. <ul class="no-bullet">
  979. <li><a name="toc-Examples-117" href="#Examples-117">12.2.1 Examples</a></li>
  980. </ul></li>
  981. <li><a name="toc-colorkey_005fopencl" href="#colorkey_005fopencl">12.3 colorkey_opencl</a>
  982. <ul class="no-bullet">
  983. <li><a name="toc-Examples-10" href="#Examples-10">12.3.1 Examples</a></li>
  984. </ul></li>
  985. <li><a name="toc-convolution_005fopencl" href="#convolution_005fopencl">12.4 convolution_opencl</a>
  986. <ul class="no-bullet">
  987. <li><a name="toc-Examples-115" href="#Examples-115">12.4.1 Examples</a></li>
  988. </ul></li>
  989. <li><a name="toc-erosion_005fopencl" href="#erosion_005fopencl">12.5 erosion_opencl</a>
  990. <ul class="no-bullet">
  991. <li><a name="toc-Example-5" href="#Example-5">12.5.1 Example</a></li>
  992. </ul></li>
  993. <li><a name="toc-deshake_005fopencl" href="#deshake_005fopencl">12.6 deshake_opencl</a>
  994. <ul class="no-bullet">
  995. <li><a name="toc-Examples-65" href="#Examples-65">12.6.1 Examples</a></li>
  996. </ul></li>
  997. <li><a name="toc-dilation_005fopencl" href="#dilation_005fopencl">12.7 dilation_opencl</a>
  998. <ul class="no-bullet">
  999. <li><a name="toc-Example-3" href="#Example-3">12.7.1 Example</a></li>
  1000. </ul></li>
  1001. <li><a name="toc-nlmeans_005fopencl" href="#nlmeans_005fopencl">12.8 nlmeans_opencl</a></li>
  1002. <li><a name="toc-overlay_005fopencl" href="#overlay_005fopencl">12.9 overlay_opencl</a>
  1003. <ul class="no-bullet">
  1004. <li><a name="toc-Examples-119" href="#Examples-119">12.9.1 Examples</a></li>
  1005. </ul></li>
  1006. <li><a name="toc-pad_005fopencl" href="#pad_005fopencl">12.10 pad_opencl</a></li>
  1007. <li><a name="toc-prewitt_005fopencl" href="#prewitt_005fopencl">12.11 prewitt_opencl</a>
  1008. <ul class="no-bullet">
  1009. <li><a name="toc-Example-6" href="#Example-6">12.11.1 Example</a></li>
  1010. </ul></li>
  1011. <li><a name="toc-program_005fopencl-1" href="#program_005fopencl-1">12.12 program_opencl</a></li>
  1012. <li><a name="toc-roberts_005fopencl" href="#roberts_005fopencl">12.13 roberts_opencl</a>
  1013. <ul class="no-bullet">
  1014. <li><a name="toc-Example" href="#Example">12.13.1 Example</a></li>
  1015. </ul></li>
  1016. <li><a name="toc-sobel_005fopencl" href="#sobel_005fopencl">12.14 sobel_opencl</a>
  1017. <ul class="no-bullet">
  1018. <li><a name="toc-Example-4" href="#Example-4">12.14.1 Example</a></li>
  1019. </ul></li>
  1020. <li><a name="toc-tonemap_005fopencl" href="#tonemap_005fopencl">12.15 tonemap_opencl</a>
  1021. <ul class="no-bullet">
  1022. <li><a name="toc-Example-2" href="#Example-2">12.15.1 Example</a></li>
  1023. </ul></li>
  1024. <li><a name="toc-unsharp_005fopencl" href="#unsharp_005fopencl">12.16 unsharp_opencl</a>
  1025. <ul class="no-bullet">
  1026. <li><a name="toc-Examples-136" href="#Examples-136">12.16.1 Examples</a></li>
  1027. </ul></li>
  1028. <li><a name="toc-xfade_005fopencl" href="#xfade_005fopencl">12.17 xfade_opencl</a></li>
  1029. </ul></li>
  1030. <li><a name="toc-VAAPI-Video-Filters" href="#VAAPI-Video-Filters">13 VAAPI Video Filters</a>
  1031. <ul class="no-bullet">
  1032. <li><a name="toc-tonemap_005fvaapi" href="#tonemap_005fvaapi">13.1 tonemap_vaapi</a>
  1033. <ul class="no-bullet">
  1034. <li><a name="toc-Example-7" href="#Example-7">13.1.1 Example</a></li>
  1035. </ul>
  1036. </li>
  1037. </ul></li>
  1038. <li><a name="toc-Video-Sources" href="#Video-Sources">14 Video Sources</a>
  1039. <ul class="no-bullet">
  1040. <li><a name="toc-buffer" href="#buffer">14.1 buffer</a></li>
  1041. <li><a name="toc-cellauto" href="#cellauto">14.2 cellauto</a>
  1042. <ul class="no-bullet">
  1043. <li><a name="toc-Examples-131" href="#Examples-131">14.2.1 Examples</a></li>
  1044. </ul></li>
  1045. <li><a name="toc-coreimagesrc-1" href="#coreimagesrc-1">14.3 coreimagesrc</a>
  1046. <ul class="no-bullet">
  1047. <li><a name="toc-Examples-62" href="#Examples-62">14.3.1 Examples</a></li>
  1048. </ul></li>
  1049. <li><a name="toc-gradients" href="#gradients">14.4 gradients</a></li>
  1050. <li><a name="toc-mandelbrot" href="#mandelbrot">14.5 mandelbrot</a></li>
  1051. <li><a name="toc-mptestsrc" href="#mptestsrc">14.6 mptestsrc</a></li>
  1052. <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">14.7 frei0r_src</a></li>
  1053. <li><a name="toc-life" href="#life">14.8 life</a>
  1054. <ul class="no-bullet">
  1055. <li><a name="toc-Examples-38" href="#Examples-38">14.8.1 Examples</a></li>
  1056. </ul></li>
  1057. <li><a name="toc-allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" href="#allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc">14.9 allrgb, allyuv, color, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a>
  1058. <ul class="no-bullet">
  1059. <li><a name="toc-Examples-24" href="#Examples-24">14.9.1 Examples</a></li>
  1060. <li><a name="toc-Commands-25" href="#Commands-25">14.9.2 Commands</a></li>
  1061. </ul></li>
  1062. <li><a name="toc-openclsrc" href="#openclsrc">14.10 openclsrc</a></li>
  1063. <li><a name="toc-sierpinski" href="#sierpinski">14.11 sierpinski</a></li>
  1064. </ul></li>
  1065. <li><a name="toc-Video-Sinks" href="#Video-Sinks">15 Video Sinks</a>
  1066. <ul class="no-bullet">
  1067. <li><a name="toc-buffersink" href="#buffersink">15.1 buffersink</a></li>
  1068. <li><a name="toc-nullsink" href="#nullsink">15.2 nullsink</a></li>
  1069. </ul></li>
  1070. <li><a name="toc-Multimedia-Filters" href="#Multimedia-Filters">16 Multimedia Filters</a>
  1071. <ul class="no-bullet">
  1072. <li><a name="toc-abitscope" href="#abitscope">16.1 abitscope</a></li>
  1073. <li><a name="toc-adrawgraph" href="#adrawgraph">16.2 adrawgraph</a></li>
  1074. <li><a name="toc-agraphmonitor" href="#agraphmonitor">16.3 agraphmonitor</a></li>
  1075. <li><a name="toc-ahistogram" href="#ahistogram">16.4 ahistogram</a></li>
  1076. <li><a name="toc-aphasemeter" href="#aphasemeter">16.5 aphasemeter</a></li>
  1077. <li><a name="toc-avectorscope" href="#avectorscope">16.6 avectorscope</a>
  1078. <ul class="no-bullet">
  1079. <li><a name="toc-Examples-99" href="#Examples-99">16.6.1 Examples</a></li>
  1080. </ul></li>
  1081. <li><a name="toc-bench_002c-abench" href="#bench_002c-abench">16.7 bench, abench</a>
  1082. <ul class="no-bullet">
  1083. <li><a name="toc-Examples-142" href="#Examples-142">16.7.1 Examples</a></li>
  1084. </ul></li>
  1085. <li><a name="toc-concat" href="#concat">16.8 concat</a>
  1086. <ul class="no-bullet">
  1087. <li><a name="toc-Examples-144" href="#Examples-144">16.8.1 Examples</a></li>
  1088. <li><a name="toc-Commands-24" href="#Commands-24">16.8.2 Commands</a></li>
  1089. </ul></li>
  1090. <li><a name="toc-ebur128-1" href="#ebur128-1">16.9 ebur128</a>
  1091. <ul class="no-bullet">
  1092. <li><a name="toc-Examples-4" href="#Examples-4">16.9.1 Examples</a></li>
  1093. </ul></li>
  1094. <li><a name="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">16.10 interleave, ainterleave</a>
  1095. <ul class="no-bullet">
  1096. <li><a name="toc-Examples-134" href="#Examples-134">16.10.1 Examples</a></li>
  1097. </ul></li>
  1098. <li><a name="toc-metadata_002c-ametadata" href="#metadata_002c-ametadata">16.11 metadata, ametadata</a>
  1099. <ul class="no-bullet">
  1100. <li><a name="toc-Examples-104" href="#Examples-104">16.11.1 Examples</a></li>
  1101. </ul></li>
  1102. <li><a name="toc-perms_002c-aperms" href="#perms_002c-aperms">16.12 perms, aperms</a></li>
  1103. <li><a name="toc-realtime_002c-arealtime" href="#realtime_002c-arealtime">16.13 realtime, arealtime</a></li>
  1104. <li><a name="toc-select_002c-aselect" href="#select_002c-aselect">16.14 select, aselect</a>
  1105. <ul class="no-bullet">
  1106. <li><a name="toc-Examples-113" href="#Examples-113">16.14.1 Examples</a></li>
  1107. </ul></li>
  1108. <li><a name="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">16.15 sendcmd, asendcmd</a>
  1109. <ul class="no-bullet">
  1110. <li><a name="toc-Commands-syntax" href="#Commands-syntax">16.15.1 Commands syntax</a></li>
  1111. <li><a name="toc-Examples-103" href="#Examples-103">16.15.2 Examples</a></li>
  1112. </ul></li>
  1113. <li><a name="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">16.16 setpts, asetpts</a>
  1114. <ul class="no-bullet">
  1115. <li><a name="toc-Examples-61" href="#Examples-61">16.16.1 Examples</a></li>
  1116. </ul></li>
  1117. <li><a name="toc-setrange" href="#setrange">16.17 setrange</a></li>
  1118. <li><a name="toc-settb_002c-asettb" href="#settb_002c-asettb">16.18 settb, asettb</a>
  1119. <ul class="no-bullet">
  1120. <li><a name="toc-Examples-147" href="#Examples-147">16.18.1 Examples</a></li>
  1121. </ul></li>
  1122. <li><a name="toc-showcqt" href="#showcqt">16.19 showcqt</a>
  1123. <ul class="no-bullet">
  1124. <li><a name="toc-Examples-85" href="#Examples-85">16.19.1 Examples</a></li>
  1125. </ul></li>
  1126. <li><a name="toc-showfreqs" href="#showfreqs">16.20 showfreqs</a></li>
  1127. <li><a name="toc-showspatial" href="#showspatial">16.21 showspatial</a></li>
  1128. <li><a name="toc-showspectrum-1" href="#showspectrum-1">16.22 showspectrum</a>
  1129. <ul class="no-bullet">
  1130. <li><a name="toc-Examples-87" href="#Examples-87">16.22.1 Examples</a></li>
  1131. </ul></li>
  1132. <li><a name="toc-showspectrumpic" href="#showspectrumpic">16.23 showspectrumpic</a>
  1133. <ul class="no-bullet">
  1134. <li><a name="toc-Examples-52" href="#Examples-52">16.23.1 Examples</a></li>
  1135. </ul></li>
  1136. <li><a name="toc-showvolume" href="#showvolume">16.24 showvolume</a></li>
  1137. <li><a name="toc-showwaves" href="#showwaves">16.25 showwaves</a>
  1138. <ul class="no-bullet">
  1139. <li><a name="toc-Examples-41" href="#Examples-41">16.25.1 Examples</a></li>
  1140. </ul></li>
  1141. <li><a name="toc-showwavespic" href="#showwavespic">16.26 showwavespic</a>
  1142. <ul class="no-bullet">
  1143. <li><a name="toc-Examples-125" href="#Examples-125">16.26.1 Examples</a></li>
  1144. </ul></li>
  1145. <li><a name="toc-sidedata_002c-asidedata" href="#sidedata_002c-asidedata">16.27 sidedata, asidedata</a></li>
  1146. <li><a name="toc-spectrumsynth" href="#spectrumsynth">16.28 spectrumsynth</a>
  1147. <ul class="no-bullet">
  1148. <li><a name="toc-Examples-49" href="#Examples-49">16.28.1 Examples</a></li>
  1149. </ul></li>
  1150. <li><a name="toc-split_002c-asplit" href="#split_002c-asplit">16.29 split, asplit</a>
  1151. <ul class="no-bullet">
  1152. <li><a name="toc-Examples-151" href="#Examples-151">16.29.1 Examples</a></li>
  1153. </ul></li>
  1154. <li><a name="toc-zmq_002c-azmq" href="#zmq_002c-azmq">16.30 zmq, azmq</a>
  1155. <ul class="no-bullet">
  1156. <li><a name="toc-Examples-145" href="#Examples-145">16.30.1 Examples</a></li>
  1157. </ul>
  1158. </li>
  1159. </ul></li>
  1160. <li><a name="toc-Multimedia-Sources" href="#Multimedia-Sources">17 Multimedia Sources</a>
  1161. <ul class="no-bullet">
  1162. <li><a name="toc-amovie" href="#amovie">17.1 amovie</a></li>
  1163. <li><a name="toc-movie-1" href="#movie-1">17.2 movie</a>
  1164. <ul class="no-bullet">
  1165. <li><a name="toc-Examples-11" href="#Examples-11">17.2.1 Examples</a></li>
  1166. <li><a name="toc-Commands-17" href="#Commands-17">17.2.2 Commands</a></li>
  1167. </ul>
  1168. </li>
  1169. </ul></li>
  1170. <li><a name="toc-See-Also" href="#See-Also">18 See Also</a></li>
  1171. <li><a name="toc-Authors" href="#Authors">19 Authors</a></li>
  1172. </ul>
  1173. </div>
  1174. <hr size="6">
  1175. <a name="Description"></a>
  1176. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Description">1 Description</a></h1>
  1177. <p>This document describes filters, sources, and sinks provided by the
  1178. libavfilter library.
  1179. </p>
  1180. <a name="Filtering-Introduction"></a>
  1181. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Filtering-Introduction">2 Filtering Introduction</a></h1>
  1182. <p>Filtering in FFmpeg is enabled through the libavfilter library.
  1183. </p>
  1184. <p>In libavfilter, a filter can have multiple inputs and multiple
  1185. outputs.
  1186. To illustrate the sorts of things that are possible, we consider the
  1187. following filtergraph.
  1188. </p>
  1189. <pre class="verbatim"> [main]
  1190. input --&gt; split ---------------------&gt; overlay --&gt; output
  1191. | ^
  1192. |[tmp] [flip]|
  1193. +-----&gt; crop --&gt; vflip -------+
  1194. </pre>
  1195. <p>This filtergraph splits the input stream in two streams, then sends one
  1196. stream through the crop filter and the vflip filter, before merging it
  1197. back with the other stream by overlaying it on top. You can use the
  1198. following command to achieve this:
  1199. </p>
  1200. <div class="example">
  1201. <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
  1202. </pre></div>
  1203. <p>The result will be that the top half of the video is mirrored
  1204. onto the bottom half of the output video.
  1205. </p>
  1206. <p>Filters in the same linear chain are separated by commas, and distinct
  1207. linear chains of filters are separated by semicolons. In our example,
  1208. <var>crop,vflip</var> are in one linear chain, <var>split</var> and
  1209. <var>overlay</var> are separately in another. The points where the linear
  1210. chains join are labelled by names enclosed in square brackets. In the
  1211. example, the split filter generates two outputs that are associated to
  1212. the labels <var>[main]</var> and <var>[tmp]</var>.
  1213. </p>
  1214. <p>The stream sent to the second output of <var>split</var>, labelled as
  1215. <var>[tmp]</var>, is processed through the <var>crop</var> filter, which crops
  1216. away the lower half part of the video, and then vertically flipped. The
  1217. <var>overlay</var> filter takes in input the first unchanged output of the
  1218. split filter (which was labelled as <var>[main]</var>), and overlay on its
  1219. lower half the output generated by the <var>crop,vflip</var> filterchain.
  1220. </p>
  1221. <p>Some filters take in input a list of parameters: they are specified
  1222. after the filter name and an equal sign, and are separated from each other
  1223. by a colon.
  1224. </p>
  1225. <p>There exist so-called <var>source filters</var> that do not have an
  1226. audio/video input, and <var>sink filters</var> that will not have audio/video
  1227. output.
  1228. </p>
  1229. <a name="graph2dot"></a>
  1230. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-graph2dot">3 graph2dot</a></h1>
  1231. <p>The &lsquo;<tt>graph2dot</tt>&rsquo; program included in the FFmpeg &lsquo;<tt>tools</tt>&rsquo;
  1232. directory can be used to parse a filtergraph description and issue a
  1233. corresponding textual representation in the dot language.
  1234. </p>
  1235. <p>Invoke the command:
  1236. </p><div class="example">
  1237. <pre class="example">graph2dot -h
  1238. </pre></div>
  1239. <p>to see how to use &lsquo;<tt>graph2dot</tt>&rsquo;.
  1240. </p>
  1241. <p>You can then pass the dot description to the &lsquo;<tt>dot</tt>&rsquo; program (from
  1242. the graphviz suite of programs) and obtain a graphical representation
  1243. of the filtergraph.
  1244. </p>
  1245. <p>For example the sequence of commands:
  1246. </p><div class="example">
  1247. <pre class="example">echo <var>GRAPH_DESCRIPTION</var> | \
  1248. tools/graph2dot -o graph.tmp &amp;&amp; \
  1249. dot -Tpng graph.tmp -o graph.png &amp;&amp; \
  1250. display graph.png
  1251. </pre></div>
  1252. <p>can be used to create and display an image representing the graph
  1253. described by the <var>GRAPH_DESCRIPTION</var> string. Note that this string must be
  1254. a complete self-contained graph, with its inputs and outputs explicitly defined.
  1255. For example if your command line is of the form:
  1256. </p><div class="example">
  1257. <pre class="example">ffmpeg -i infile -vf scale=640:360 outfile
  1258. </pre></div>
  1259. <p>your <var>GRAPH_DESCRIPTION</var> string will need to be of the form:
  1260. </p><div class="example">
  1261. <pre class="example">nullsrc,scale=640:360,nullsink
  1262. </pre></div>
  1263. <p>you may also need to set the <var>nullsrc</var> parameters and add a <var>format</var>
  1264. filter in order to simulate a specific input file.
  1265. </p>
  1266. <a name="Filtergraph-description"></a>
  1267. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Filtergraph-description">4 Filtergraph description</a></h1>
  1268. <p>A filtergraph is a directed graph of connected filters. It can contain
  1269. cycles, and there can be multiple links between a pair of
  1270. filters. Each link has one input pad on one side connecting it to one
  1271. filter from which it takes its input, and one output pad on the other
  1272. side connecting it to one filter accepting its output.
  1273. </p>
  1274. <p>Each filter in a filtergraph is an instance of a filter class
  1275. registered in the application, which defines the features and the
  1276. number of input and output pads of the filter.
  1277. </p>
  1278. <p>A filter with no input pads is called a &quot;source&quot;, and a filter with no
  1279. output pads is called a &quot;sink&quot;.
  1280. </p>
  1281. <p><a name="Filtergraph-syntax"></a>
  1282. </p><a name="Filtergraph-syntax-1"></a>
  1283. <h2 class="section"><a href="ffmpeg-filters.html#toc-Filtergraph-syntax-1">4.1 Filtergraph syntax</a></h2>
  1284. <p>A filtergraph has a textual representation, which is recognized by the
  1285. &lsquo;<samp>-filter</samp>&rsquo;/&lsquo;<samp>-vf</samp>&rsquo;/&lsquo;<samp>-af</samp>&rsquo; and
  1286. &lsquo;<samp>-filter_complex</samp>&rsquo; options in <code>ffmpeg</code> and
  1287. &lsquo;<samp>-vf</samp>&rsquo;/&lsquo;<samp>-af</samp>&rsquo; in <code>ffplay</code>, and by the
  1288. <code>avfilter_graph_parse_ptr()</code> function defined in
  1289. &lsquo;<tt>libavfilter/avfilter.h</tt>&rsquo;.
  1290. </p>
  1291. <p>A filterchain consists of a sequence of connected filters, each one
  1292. connected to the previous one in the sequence. A filterchain is
  1293. represented by a list of &quot;,&quot;-separated filter descriptions.
  1294. </p>
  1295. <p>A filtergraph consists of a sequence of filterchains. A sequence of
  1296. filterchains is represented by a list of &quot;;&quot;-separated filterchain
  1297. descriptions.
  1298. </p>
  1299. <p>A filter is represented by a string of the form:
  1300. [<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>]
  1301. </p>
  1302. <p><var>filter_name</var> is the name of the filter class of which the
  1303. described filter is an instance of, and has to be the name of one of
  1304. the filter classes registered in the program optionally followed by &quot;@<var>id</var>&quot;.
  1305. The name of the filter class is optionally followed by a string
  1306. &quot;=<var>arguments</var>&quot;.
  1307. </p>
  1308. <p><var>arguments</var> is a string which contains the parameters used to
  1309. initialize the filter instance. It may have one of two forms:
  1310. </p><ul>
  1311. <li>
  1312. A &rsquo;:&rsquo;-separated list of <var>key=value</var> pairs.
  1313. </li><li>
  1314. A &rsquo;:&rsquo;-separated list of <var>value</var>. In this case, the keys are assumed to be
  1315. the option names in the order they are declared. E.g. the <code>fade</code> filter
  1316. declares three options in this order &ndash; &lsquo;<samp>type</samp>&rsquo;, &lsquo;<samp>start_frame</samp>&rsquo; and
  1317. &lsquo;<samp>nb_frames</samp>&rsquo;. Then the parameter list <var>in:0:30</var> means that the value
  1318. <var>in</var> is assigned to the option &lsquo;<samp>type</samp>&rsquo;, <var>0</var> to
  1319. &lsquo;<samp>start_frame</samp>&rsquo; and <var>30</var> to &lsquo;<samp>nb_frames</samp>&rsquo;.
  1320. </li><li>
  1321. A &rsquo;:&rsquo;-separated list of mixed direct <var>value</var> and long <var>key=value</var>
  1322. pairs. The direct <var>value</var> must precede the <var>key=value</var> pairs, and
  1323. follow the same constraints order of the previous point. The following
  1324. <var>key=value</var> pairs can be set in any preferred order.
  1325. </li></ul>
  1326. <p>If the option value itself is a list of items (e.g. the <code>format</code> filter
  1327. takes a list of pixel formats), the items in the list are usually separated by
  1328. &lsquo;<samp>|</samp>&rsquo;.
  1329. </p>
  1330. <p>The list of arguments can be quoted using the character &lsquo;<samp>'</samp>&rsquo; as initial
  1331. and ending mark, and the character &lsquo;<samp>\</samp>&rsquo; for escaping the characters
  1332. within the quoted text; otherwise the argument string is considered
  1333. terminated when the next special character (belonging to the set
  1334. &lsquo;<samp>[]=;,</samp>&rsquo;) is encountered.
  1335. </p>
  1336. <p>The name and arguments of the filter are optionally preceded and
  1337. followed by a list of link labels.
  1338. A link label allows one to name a link and associate it to a filter output
  1339. or input pad. The preceding labels <var>in_link_1</var>
  1340. ... <var>in_link_N</var>, are associated to the filter input pads,
  1341. the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
  1342. associated to the output pads.
  1343. </p>
  1344. <p>When two link labels with the same name are found in the
  1345. filtergraph, a link between the corresponding input and output pad is
  1346. created.
  1347. </p>
  1348. <p>If an output pad is not labelled, it is linked by default to the first
  1349. unlabelled input pad of the next filter in the filterchain.
  1350. For example in the filterchain
  1351. </p><div class="example">
  1352. <pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
  1353. </pre></div>
  1354. <p>the split filter instance has two output pads, and the overlay filter
  1355. instance two input pads. The first output pad of split is labelled
  1356. &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
  1357. output pad of split is linked to the second input pad of overlay,
  1358. which are both unlabelled.
  1359. </p>
  1360. <p>In a filter description, if the input label of the first filter is not
  1361. specified, &quot;in&quot; is assumed; if the output label of the last filter is not
  1362. specified, &quot;out&quot; is assumed.
  1363. </p>
  1364. <p>In a complete filterchain all the unlabelled filter input and output
  1365. pads must be connected. A filtergraph is considered valid if all the
  1366. filter input and output pads of all the filterchains are connected.
  1367. </p>
  1368. <p>Libavfilter will automatically insert <a href="#scale">scale</a> filters where format
  1369. conversion is required. It is possible to specify swscale flags
  1370. for those automatically inserted scalers by prepending
  1371. <code>sws_flags=<var>flags</var>;</code>
  1372. to the filtergraph description.
  1373. </p>
  1374. <p>Here is a BNF description of the filtergraph syntax:
  1375. </p><div class="example">
  1376. <pre class="example"><var>NAME</var> ::= sequence of alphanumeric characters and '_'
  1377. <var>FILTER_NAME</var> ::= <var>NAME</var>[&quot;@&quot;<var>NAME</var>]
  1378. <var>LINKLABEL</var> ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
  1379. <var>LINKLABELS</var> ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
  1380. <var>FILTER_ARGUMENTS</var> ::= sequence of chars (possibly quoted)
  1381. <var>FILTER</var> ::= [<var>LINKLABELS</var>] <var>FILTER_NAME</var> [&quot;=&quot; <var>FILTER_ARGUMENTS</var>] [<var>LINKLABELS</var>]
  1382. <var>FILTERCHAIN</var> ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
  1383. <var>FILTERGRAPH</var> ::= [sws_flags=<var>flags</var>;] <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
  1384. </pre></div>
  1385. <p><a name="filtergraph-escaping"></a>
  1386. </p><a name="Notes-on-filtergraph-escaping"></a>
  1387. <h2 class="section"><a href="ffmpeg-filters.html#toc-Notes-on-filtergraph-escaping">4.2 Notes on filtergraph escaping</a></h2>
  1388. <p>Filtergraph description composition entails several levels of
  1389. escaping. See <a href="ffmpeg-utils.html#quoting_005fand_005fescaping">(ffmpeg-utils)the &quot;Quoting and escaping&quot; section in the ffmpeg-utils(1) manual</a> for more
  1390. information about the employed escaping procedure.
  1391. </p>
  1392. <p>A first level escaping affects the content of each filter option
  1393. value, which may contain the special character <code>:</code> used to
  1394. separate values, or one of the escaping characters <code>\'</code>.
  1395. </p>
  1396. <p>A second level escaping affects the whole filter description, which
  1397. may contain the escaping characters <code>\'</code> or the special
  1398. characters <code>[],;</code> used by the filtergraph description.
  1399. </p>
  1400. <p>Finally, when you specify a filtergraph on a shell commandline, you
  1401. need to perform a third level escaping for the shell special
  1402. characters contained within it.
  1403. </p>
  1404. <p>For example, consider the following string to be embedded in
  1405. the <a href="#drawtext">drawtext</a> filter description &lsquo;<samp>text</samp>&rsquo; value:
  1406. </p><div class="example">
  1407. <pre class="example">this is a 'string': may contain one, or more, special characters
  1408. </pre></div>
  1409. <p>This string contains the <code>'</code> special escaping character, and the
  1410. <code>:</code> special character, so it needs to be escaped in this way:
  1411. </p><div class="example">
  1412. <pre class="example">text=this is a \'string\'\: may contain one, or more, special characters
  1413. </pre></div>
  1414. <p>A second level of escaping is required when embedding the filter
  1415. description in a filtergraph description, in order to escape all the
  1416. filtergraph special characters. Thus the example above becomes:
  1417. </p><div class="example">
  1418. <pre class="example">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
  1419. </pre></div>
  1420. <p>(note that in addition to the <code>\'</code> escaping special characters,
  1421. also <code>,</code> needs to be escaped).
  1422. </p>
  1423. <p>Finally an additional level of escaping is needed when writing the
  1424. filtergraph description in a shell command, which depends on the
  1425. escaping rules of the adopted shell. For example, assuming that
  1426. <code>\</code> is special and needs to be escaped with another <code>\</code>, the
  1427. previous string will finally result in:
  1428. </p><div class="example">
  1429. <pre class="example">-vf &quot;drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&quot;
  1430. </pre></div>
  1431. <a name="Timeline-editing"></a>
  1432. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Timeline-editing">5 Timeline editing</a></h1>
  1433. <p>Some filters support a generic &lsquo;<samp>enable</samp>&rsquo; option. For the filters
  1434. supporting timeline editing, this option can be set to an expression which is
  1435. evaluated before sending a frame to the filter. If the evaluation is non-zero,
  1436. the filter will be enabled, otherwise the frame will be sent unchanged to the
  1437. next filter in the filtergraph.
  1438. </p>
  1439. <p>The expression accepts the following values:
  1440. </p><dl compact="compact">
  1441. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  1442. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  1443. </p>
  1444. </dd>
  1445. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  1446. <dd><p>sequential number of the input frame, starting from 0
  1447. </p>
  1448. </dd>
  1449. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  1450. <dd><p>the position in the file of the input frame, NAN if unknown
  1451. </p>
  1452. </dd>
  1453. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  1454. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  1455. <dd><p>width and height of the input frame if video
  1456. </p></dd>
  1457. </dl>
  1458. <p>Additionally, these filters support an &lsquo;<samp>enable</samp>&rsquo; command that can be used
  1459. to re-define the expression.
  1460. </p>
  1461. <p>Like any other filtering option, the &lsquo;<samp>enable</samp>&rsquo; option follows the same
  1462. rules.
  1463. </p>
  1464. <p>For example, to enable a blur filter (<a href="#smartblur">smartblur</a>) from 10 seconds to 3
  1465. minutes, and a <a href="#curves">curves</a> filter starting at 3 seconds:
  1466. </p><div class="example">
  1467. <pre class="example">smartblur = enable='between(t,10,3*60)',
  1468. curves = enable='gte(t,3)' : preset=cross_process
  1469. </pre></div>
  1470. <p>See <code>ffmpeg -filters</code> to view which filters have timeline support.
  1471. </p>
  1472. <p><a name="commands"></a>
  1473. </p><a name="Changing-options-at-runtime-with-a-command"></a>
  1474. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Changing-options-at-runtime-with-a-command">6 Changing options at runtime with a command</a></h1>
  1475. <p>Some options can be changed during the operation of the filter using
  1476. a command. These options are marked &rsquo;T&rsquo; on the output of
  1477. <code>ffmpeg</code> &lsquo;<samp>-h filter=&lt;name of filter&gt;</samp>&rsquo;.
  1478. The name of the command is the name of the option and the argument is
  1479. the new value.
  1480. </p>
  1481. <p><a name="framesync"></a>
  1482. </p><a name="Options-for-filters-with-several-inputs-_0028framesync_0029"></a>
  1483. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Options-for-filters-with-several-inputs-_0028framesync_0029">7 Options for filters with several inputs (framesync)</a></h1>
  1484. <p>Some filters with several inputs support a common set of options.
  1485. These options can only be set by name, not with the short notation.
  1486. </p>
  1487. <dl compact="compact">
  1488. <dt>&lsquo;<samp>eof_action</samp>&rsquo;</dt>
  1489. <dd><p>The action to take when EOF is encountered on the secondary input; it accepts
  1490. one of the following values:
  1491. </p>
  1492. <dl compact="compact">
  1493. <dt>&lsquo;<samp>repeat</samp>&rsquo;</dt>
  1494. <dd><p>Repeat the last frame (the default).
  1495. </p></dd>
  1496. <dt>&lsquo;<samp>endall</samp>&rsquo;</dt>
  1497. <dd><p>End both streams.
  1498. </p></dd>
  1499. <dt>&lsquo;<samp>pass</samp>&rsquo;</dt>
  1500. <dd><p>Pass the main input through.
  1501. </p></dd>
  1502. </dl>
  1503. </dd>
  1504. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  1505. <dd><p>If set to 1, force the output to terminate when the shortest input
  1506. terminates. Default value is 0.
  1507. </p>
  1508. </dd>
  1509. <dt>&lsquo;<samp>repeatlast</samp>&rsquo;</dt>
  1510. <dd><p>If set to 1, force the filter to extend the last frame of secondary streams
  1511. until the end of the primary stream. A value of 0 disables this behavior.
  1512. Default value is 1.
  1513. </p></dd>
  1514. </dl>
  1515. <a name="Audio-Filters"></a>
  1516. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Audio-Filters">8 Audio Filters</a></h1>
  1517. <p>When you configure your FFmpeg build, you can disable any of the
  1518. existing filters using <code>--disable-filters</code>.
  1519. The configure output will show the audio filters included in your
  1520. build.
  1521. </p>
  1522. <p>Below is a description of the currently available audio filters.
  1523. </p>
  1524. <a name="acompressor"></a>
  1525. <h2 class="section"><a href="ffmpeg-filters.html#toc-acompressor">8.1 acompressor</a></h2>
  1526. <p>A compressor is mainly used to reduce the dynamic range of a signal.
  1527. Especially modern music is mostly compressed at a high ratio to
  1528. improve the overall loudness. It&rsquo;s done to get the highest attention
  1529. of a listener, &quot;fatten&quot; the sound and bring more &quot;power&quot; to the track.
  1530. If a signal is compressed too much it may sound dull or &quot;dead&quot;
  1531. afterwards or it may start to &quot;pump&quot; (which could be a powerful effect
  1532. but can also destroy a track completely).
  1533. The right compression is the key to reach a professional sound and is
  1534. the high art of mixing and mastering. Because of its complex settings
  1535. it may take a long time to get the right feeling for this kind of effect.
  1536. </p>
  1537. <p>Compression is done by detecting the volume above a chosen level
  1538. <code>threshold</code> and dividing it by the factor set with <code>ratio</code>.
  1539. So if you set the threshold to -12dB and your signal reaches -6dB a ratio
  1540. of 2:1 will result in a signal at -9dB. Because an exact manipulation of
  1541. the signal would cause distortion of the waveform the reduction can be
  1542. levelled over the time. This is done by setting &quot;Attack&quot; and &quot;Release&quot;.
  1543. <code>attack</code> determines how long the signal has to rise above the threshold
  1544. before any reduction will occur and <code>release</code> sets the time the signal
  1545. has to fall below the threshold to reduce the reduction again. Shorter signals
  1546. than the chosen attack time will be left untouched.
  1547. The overall reduction of the signal can be made up afterwards with the
  1548. <code>makeup</code> setting. So compressing the peaks of a signal about 6dB and
  1549. raising the makeup to this level results in a signal twice as loud than the
  1550. source. To gain a softer entry in the compression the <code>knee</code> flattens the
  1551. hard edge at the threshold in the range of the chosen decibels.
  1552. </p>
  1553. <p>The filter accepts the following options:
  1554. </p>
  1555. <dl compact="compact">
  1556. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  1557. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  1558. </p>
  1559. </dd>
  1560. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  1561. <dd><p>Set mode of compressor operation. Can be <code>upward</code> or <code>downward</code>.
  1562. Default is <code>downward</code>.
  1563. </p>
  1564. </dd>
  1565. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  1566. <dd><p>If a signal of stream rises above this level it will affect the gain
  1567. reduction.
  1568. By default it is 0.125. Range is between 0.00097563 and 1.
  1569. </p>
  1570. </dd>
  1571. <dt>&lsquo;<samp>ratio</samp>&rsquo;</dt>
  1572. <dd><p>Set a ratio by which the signal is reduced. 1:2 means that if the level
  1573. rose 4dB above the threshold, it will be only 2dB above after the reduction.
  1574. Default is 2. Range is between 1 and 20.
  1575. </p>
  1576. </dd>
  1577. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  1578. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  1579. reduction starts. Default is 20. Range is between 0.01 and 2000.
  1580. </p>
  1581. </dd>
  1582. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  1583. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  1584. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  1585. </p>
  1586. </dd>
  1587. <dt>&lsquo;<samp>makeup</samp>&rsquo;</dt>
  1588. <dd><p>Set the amount by how much signal will be amplified after processing.
  1589. Default is 1. Range is from 1 to 64.
  1590. </p>
  1591. </dd>
  1592. <dt>&lsquo;<samp>knee</samp>&rsquo;</dt>
  1593. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  1594. Default is 2.82843. Range is between 1 and 8.
  1595. </p>
  1596. </dd>
  1597. <dt>&lsquo;<samp>link</samp>&rsquo;</dt>
  1598. <dd><p>Choose if the <code>average</code> level between all channels of input stream
  1599. or the louder(<code>maximum</code>) channel of input stream affects the
  1600. reduction. Default is <code>average</code>.
  1601. </p>
  1602. </dd>
  1603. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  1604. <dd><p>Should the exact signal be taken in case of <code>peak</code> or an RMS one in case
  1605. of <code>rms</code>. Default is <code>rms</code> which is mostly smoother.
  1606. </p>
  1607. </dd>
  1608. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  1609. <dd><p>How much to use compressed signal in output. Default is 1.
  1610. Range is between 0 and 1.
  1611. </p></dd>
  1612. </dl>
  1613. <a name="Commands-71"></a>
  1614. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-71">8.1.1 Commands</a></h3>
  1615. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  1616. </p>
  1617. <a name="acontrast"></a>
  1618. <h2 class="section"><a href="ffmpeg-filters.html#toc-acontrast">8.2 acontrast</a></h2>
  1619. <p>Simple audio dynamic range compression/expansion filter.
  1620. </p>
  1621. <p>The filter accepts the following options:
  1622. </p>
  1623. <dl compact="compact">
  1624. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  1625. <dd><p>Set contrast. Default is 33. Allowed range is between 0 and 100.
  1626. </p></dd>
  1627. </dl>
  1628. <a name="acopy"></a>
  1629. <h2 class="section"><a href="ffmpeg-filters.html#toc-acopy">8.3 acopy</a></h2>
  1630. <p>Copy the input audio source unchanged to the output. This is mainly useful for
  1631. testing purposes.
  1632. </p>
  1633. <a name="acrossfade"></a>
  1634. <h2 class="section"><a href="ffmpeg-filters.html#toc-acrossfade">8.4 acrossfade</a></h2>
  1635. <p>Apply cross fade from one input audio stream to another input audio stream.
  1636. The cross fade is applied for specified duration near the end of first stream.
  1637. </p>
  1638. <p>The filter accepts the following options:
  1639. </p>
  1640. <dl compact="compact">
  1641. <dt>&lsquo;<samp>nb_samples, ns</samp>&rsquo;</dt>
  1642. <dd><p>Specify the number of samples for which the cross fade effect has to last.
  1643. At the end of the cross fade effect the first input audio will be completely
  1644. silent. Default is 44100.
  1645. </p>
  1646. </dd>
  1647. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  1648. <dd><p>Specify the duration of the cross fade effect. See
  1649. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  1650. for the accepted syntax.
  1651. By default the duration is determined by <var>nb_samples</var>.
  1652. If set this option is used instead of <var>nb_samples</var>.
  1653. </p>
  1654. </dd>
  1655. <dt>&lsquo;<samp>overlap, o</samp>&rsquo;</dt>
  1656. <dd><p>Should first stream end overlap with second stream start. Default is enabled.
  1657. </p>
  1658. </dd>
  1659. <dt>&lsquo;<samp>curve1</samp>&rsquo;</dt>
  1660. <dd><p>Set curve for cross fade transition for first stream.
  1661. </p>
  1662. </dd>
  1663. <dt>&lsquo;<samp>curve2</samp>&rsquo;</dt>
  1664. <dd><p>Set curve for cross fade transition for second stream.
  1665. </p>
  1666. <p>For description of available curve types see <a href="#afade">afade</a> filter description.
  1667. </p></dd>
  1668. </dl>
  1669. <a name="Examples-26"></a>
  1670. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-26">8.4.1 Examples</a></h3>
  1671. <ul>
  1672. <li>
  1673. Cross fade from one input to another:
  1674. <div class="example">
  1675. <pre class="example">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
  1676. </pre></div>
  1677. </li><li>
  1678. Cross fade from one input to another but without overlapping:
  1679. <div class="example">
  1680. <pre class="example">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
  1681. </pre></div>
  1682. </li></ul>
  1683. <a name="acrossover"></a>
  1684. <h2 class="section"><a href="ffmpeg-filters.html#toc-acrossover">8.5 acrossover</a></h2>
  1685. <p>Split audio stream into several bands.
  1686. </p>
  1687. <p>This filter splits audio stream into two or more frequency ranges.
  1688. Summing all streams back will give flat output.
  1689. </p>
  1690. <p>The filter accepts the following options:
  1691. </p>
  1692. <dl compact="compact">
  1693. <dt>&lsquo;<samp>split</samp>&rsquo;</dt>
  1694. <dd><p>Set split frequencies. Those must be positive and increasing.
  1695. </p>
  1696. </dd>
  1697. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  1698. <dd><p>Set filter order, can be <var>2nd</var>, <var>4th</var> or <var>8th</var>.
  1699. Default is <var>4th</var>.
  1700. </p></dd>
  1701. </dl>
  1702. <a name="acrusher"></a>
  1703. <h2 class="section"><a href="ffmpeg-filters.html#toc-acrusher">8.6 acrusher</a></h2>
  1704. <p>Reduce audio bit resolution.
  1705. </p>
  1706. <p>This filter is bit crusher with enhanced functionality. A bit crusher
  1707. is used to audibly reduce number of bits an audio signal is sampled
  1708. with. This doesn&rsquo;t change the bit depth at all, it just produces the
  1709. effect. Material reduced in bit depth sounds more harsh and &quot;digital&quot;.
  1710. This filter is able to even round to continuous values instead of discrete
  1711. bit depths.
  1712. Additionally it has a D/C offset which results in different crushing of
  1713. the lower and the upper half of the signal.
  1714. An Anti-Aliasing setting is able to produce &quot;softer&quot; crushing sounds.
  1715. </p>
  1716. <p>Another feature of this filter is the logarithmic mode.
  1717. This setting switches from linear distances between bits to logarithmic ones.
  1718. The result is a much more &quot;natural&quot; sounding crusher which doesn&rsquo;t gate low
  1719. signals for example. The human ear has a logarithmic perception,
  1720. so this kind of crushing is much more pleasant.
  1721. Logarithmic crushing is also able to get anti-aliased.
  1722. </p>
  1723. <p>The filter accepts the following options:
  1724. </p>
  1725. <dl compact="compact">
  1726. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  1727. <dd><p>Set level in.
  1728. </p>
  1729. </dd>
  1730. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  1731. <dd><p>Set level out.
  1732. </p>
  1733. </dd>
  1734. <dt>&lsquo;<samp>bits</samp>&rsquo;</dt>
  1735. <dd><p>Set bit reduction.
  1736. </p>
  1737. </dd>
  1738. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  1739. <dd><p>Set mixing amount.
  1740. </p>
  1741. </dd>
  1742. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  1743. <dd><p>Can be linear: <code>lin</code> or logarithmic: <code>log</code>.
  1744. </p>
  1745. </dd>
  1746. <dt>&lsquo;<samp>dc</samp>&rsquo;</dt>
  1747. <dd><p>Set DC.
  1748. </p>
  1749. </dd>
  1750. <dt>&lsquo;<samp>aa</samp>&rsquo;</dt>
  1751. <dd><p>Set anti-aliasing.
  1752. </p>
  1753. </dd>
  1754. <dt>&lsquo;<samp>samples</samp>&rsquo;</dt>
  1755. <dd><p>Set sample reduction.
  1756. </p>
  1757. </dd>
  1758. <dt>&lsquo;<samp>lfo</samp>&rsquo;</dt>
  1759. <dd><p>Enable LFO. By default disabled.
  1760. </p>
  1761. </dd>
  1762. <dt>&lsquo;<samp>lforange</samp>&rsquo;</dt>
  1763. <dd><p>Set LFO range.
  1764. </p>
  1765. </dd>
  1766. <dt>&lsquo;<samp>lforate</samp>&rsquo;</dt>
  1767. <dd><p>Set LFO rate.
  1768. </p></dd>
  1769. </dl>
  1770. <a name="acue"></a>
  1771. <h2 class="section"><a href="ffmpeg-filters.html#toc-acue">8.7 acue</a></h2>
  1772. <p>Delay audio filtering until a given wallclock timestamp. See the <a href="#cue">cue</a>
  1773. filter.
  1774. </p>
  1775. <a name="adeclick"></a>
  1776. <h2 class="section"><a href="ffmpeg-filters.html#toc-adeclick">8.8 adeclick</a></h2>
  1777. <p>Remove impulsive noise from input audio.
  1778. </p>
  1779. <p>Samples detected as impulsive noise are replaced by interpolated samples using
  1780. autoregressive modelling.
  1781. </p>
  1782. <dl compact="compact">
  1783. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  1784. <dd><p>Set window size, in milliseconds. Allowed range is from <code>10</code> to
  1785. <code>100</code>. Default value is <code>55</code> milliseconds.
  1786. This sets size of window which will be processed at once.
  1787. </p>
  1788. </dd>
  1789. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  1790. <dd><p>Set window overlap, in percentage of window size. Allowed range is from
  1791. <code>50</code> to <code>95</code>. Default value is <code>75</code> percent.
  1792. Setting this to a very high value increases impulsive noise removal but makes
  1793. whole process much slower.
  1794. </p>
  1795. </dd>
  1796. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  1797. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  1798. <code>0</code> to <code>25</code>. Default value is <code>2</code> percent. This option also
  1799. controls quality of interpolated samples using neighbour good samples.
  1800. </p>
  1801. </dd>
  1802. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  1803. <dd><p>Set threshold value. Allowed range is from <code>1</code> to <code>100</code>.
  1804. Default value is <code>2</code>.
  1805. This controls the strength of impulsive noise which is going to be removed.
  1806. The lower value, the more samples will be detected as impulsive noise.
  1807. </p>
  1808. </dd>
  1809. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  1810. <dd><p>Set burst fusion, in percentage of window size. Allowed range is <code>0</code> to
  1811. <code>10</code>. Default value is <code>2</code>.
  1812. If any two samples detected as noise are spaced less than this value then any
  1813. sample between those two samples will be also detected as noise.
  1814. </p>
  1815. </dd>
  1816. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  1817. <dd><p>Set overlap method.
  1818. </p>
  1819. <p>It accepts the following values:
  1820. </p><dl compact="compact">
  1821. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  1822. <dd><p>Select overlap-add method. Even not interpolated samples are slightly
  1823. changed with this method.
  1824. </p>
  1825. </dd>
  1826. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  1827. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  1828. </p></dd>
  1829. </dl>
  1830. <p>Default value is <code>a</code>.
  1831. </p></dd>
  1832. </dl>
  1833. <a name="adeclip"></a>
  1834. <h2 class="section"><a href="ffmpeg-filters.html#toc-adeclip">8.9 adeclip</a></h2>
  1835. <p>Remove clipped samples from input audio.
  1836. </p>
  1837. <p>Samples detected as clipped are replaced by interpolated samples using
  1838. autoregressive modelling.
  1839. </p>
  1840. <dl compact="compact">
  1841. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  1842. <dd><p>Set window size, in milliseconds. Allowed range is from <code>10</code> to <code>100</code>.
  1843. Default value is <code>55</code> milliseconds.
  1844. This sets size of window which will be processed at once.
  1845. </p>
  1846. </dd>
  1847. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  1848. <dd><p>Set window overlap, in percentage of window size. Allowed range is from <code>50</code>
  1849. to <code>95</code>. Default value is <code>75</code> percent.
  1850. </p>
  1851. </dd>
  1852. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  1853. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  1854. <code>0</code> to <code>25</code>. Default value is <code>8</code> percent. This option also controls
  1855. quality of interpolated samples using neighbour good samples.
  1856. </p>
  1857. </dd>
  1858. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  1859. <dd><p>Set threshold value. Allowed range is from <code>1</code> to <code>100</code>.
  1860. Default value is <code>10</code>. Higher values make clip detection less aggressive.
  1861. </p>
  1862. </dd>
  1863. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  1864. <dd><p>Set size of histogram used to detect clips. Allowed range is from <code>100</code> to <code>9999</code>.
  1865. Default value is <code>1000</code>. Higher values make clip detection less aggressive.
  1866. </p>
  1867. </dd>
  1868. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  1869. <dd><p>Set overlap method.
  1870. </p>
  1871. <p>It accepts the following values:
  1872. </p><dl compact="compact">
  1873. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  1874. <dd><p>Select overlap-add method. Even not interpolated samples are slightly changed
  1875. with this method.
  1876. </p>
  1877. </dd>
  1878. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  1879. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  1880. </p></dd>
  1881. </dl>
  1882. <p>Default value is <code>a</code>.
  1883. </p></dd>
  1884. </dl>
  1885. <a name="adelay"></a>
  1886. <h2 class="section"><a href="ffmpeg-filters.html#toc-adelay">8.10 adelay</a></h2>
  1887. <p>Delay one or more audio channels.
  1888. </p>
  1889. <p>Samples in delayed channel are filled with silence.
  1890. </p>
  1891. <p>The filter accepts the following option:
  1892. </p>
  1893. <dl compact="compact">
  1894. <dt>&lsquo;<samp>delays</samp>&rsquo;</dt>
  1895. <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
  1896. Unused delays will be silently ignored. If number of given delays is
  1897. smaller than number of channels all remaining channels will not be delayed.
  1898. If you want to delay exact number of samples, append &rsquo;S&rsquo; to number.
  1899. If you want instead to delay in seconds, append &rsquo;s&rsquo; to number.
  1900. </p>
  1901. </dd>
  1902. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  1903. <dd><p>Use last set delay for all remaining channels. By default is disabled.
  1904. This option if enabled changes how option <code>delays</code> is interpreted.
  1905. </p></dd>
  1906. </dl>
  1907. <a name="Examples-102"></a>
  1908. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-102">8.10.1 Examples</a></h3>
  1909. <ul>
  1910. <li>
  1911. Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
  1912. the second channel (and any other channels that may be present) unchanged.
  1913. <div class="example">
  1914. <pre class="example">adelay=1500|0|500
  1915. </pre></div>
  1916. </li><li>
  1917. Delay second channel by 500 samples, the third channel by 700 samples and leave
  1918. the first channel (and any other channels that may be present) unchanged.
  1919. <div class="example">
  1920. <pre class="example">adelay=0|500S|700S
  1921. </pre></div>
  1922. </li><li>
  1923. Delay all channels by same number of samples:
  1924. <div class="example">
  1925. <pre class="example">adelay=delays=64S:all=1
  1926. </pre></div>
  1927. </li></ul>
  1928. <a name="aderivative_002c-aintegral"></a>
  1929. <h2 class="section"><a href="ffmpeg-filters.html#toc-aderivative_002c-aintegral">8.11 aderivative, aintegral</a></h2>
  1930. <p>Compute derivative/integral of audio stream.
  1931. </p>
  1932. <p>Applying both filters one after another produces original audio.
  1933. </p>
  1934. <a name="aecho"></a>
  1935. <h2 class="section"><a href="ffmpeg-filters.html#toc-aecho">8.12 aecho</a></h2>
  1936. <p>Apply echoing to the input audio.
  1937. </p>
  1938. <p>Echoes are reflected sound and can occur naturally amongst mountains
  1939. (and sometimes large buildings) when talking or shouting; digital echo
  1940. effects emulate this behaviour and are often used to help fill out the
  1941. sound of a single instrument or vocal. The time difference between the
  1942. original signal and the reflection is the <code>delay</code>, and the
  1943. loudness of the reflected signal is the <code>decay</code>.
  1944. Multiple echoes can have different delays and decays.
  1945. </p>
  1946. <p>A description of the accepted parameters follows.
  1947. </p>
  1948. <dl compact="compact">
  1949. <dt>&lsquo;<samp>in_gain</samp>&rsquo;</dt>
  1950. <dd><p>Set input gain of reflected signal. Default is <code>0.6</code>.
  1951. </p>
  1952. </dd>
  1953. <dt>&lsquo;<samp>out_gain</samp>&rsquo;</dt>
  1954. <dd><p>Set output gain of reflected signal. Default is <code>0.3</code>.
  1955. </p>
  1956. </dd>
  1957. <dt>&lsquo;<samp>delays</samp>&rsquo;</dt>
  1958. <dd><p>Set list of time intervals in milliseconds between original signal and reflections
  1959. separated by &rsquo;|&rsquo;. Allowed range for each <code>delay</code> is <code>(0 - 90000.0]</code>.
  1960. Default is <code>1000</code>.
  1961. </p>
  1962. </dd>
  1963. <dt>&lsquo;<samp>decays</samp>&rsquo;</dt>
  1964. <dd><p>Set list of loudness of reflected signals separated by &rsquo;|&rsquo;.
  1965. Allowed range for each <code>decay</code> is <code>(0 - 1.0]</code>.
  1966. Default is <code>0.5</code>.
  1967. </p></dd>
  1968. </dl>
  1969. <a name="Examples-121"></a>
  1970. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-121">8.12.1 Examples</a></h3>
  1971. <ul>
  1972. <li>
  1973. Make it sound as if there are twice as many instruments as are actually playing:
  1974. <div class="example">
  1975. <pre class="example">aecho=0.8:0.88:60:0.4
  1976. </pre></div>
  1977. </li><li>
  1978. If delay is very short, then it sounds like a (metallic) robot playing music:
  1979. <div class="example">
  1980. <pre class="example">aecho=0.8:0.88:6:0.4
  1981. </pre></div>
  1982. </li><li>
  1983. A longer delay will sound like an open air concert in the mountains:
  1984. <div class="example">
  1985. <pre class="example">aecho=0.8:0.9:1000:0.3
  1986. </pre></div>
  1987. </li><li>
  1988. Same as above but with one more mountain:
  1989. <div class="example">
  1990. <pre class="example">aecho=0.8:0.9:1000|1800:0.3|0.25
  1991. </pre></div>
  1992. </li></ul>
  1993. <a name="aemphasis"></a>
  1994. <h2 class="section"><a href="ffmpeg-filters.html#toc-aemphasis">8.13 aemphasis</a></h2>
  1995. <p>Audio emphasis filter creates or restores material directly taken from LPs or
  1996. emphased CDs with different filter curves. E.g. to store music on vinyl the
  1997. signal has to be altered by a filter first to even out the disadvantages of
  1998. this recording medium.
  1999. Once the material is played back the inverse filter has to be applied to
  2000. restore the distortion of the frequency response.
  2001. </p>
  2002. <p>The filter accepts the following options:
  2003. </p>
  2004. <dl compact="compact">
  2005. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  2006. <dd><p>Set input gain.
  2007. </p>
  2008. </dd>
  2009. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  2010. <dd><p>Set output gain.
  2011. </p>
  2012. </dd>
  2013. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  2014. <dd><p>Set filter mode. For restoring material use <code>reproduction</code> mode, otherwise
  2015. use <code>production</code> mode. Default is <code>reproduction</code> mode.
  2016. </p>
  2017. </dd>
  2018. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  2019. <dd><p>Set filter type. Selects medium. Can be one of the following:
  2020. </p>
  2021. <dl compact="compact">
  2022. <dt>&lsquo;<samp>col</samp>&rsquo;</dt>
  2023. <dd><p>select Columbia.
  2024. </p></dd>
  2025. <dt>&lsquo;<samp>emi</samp>&rsquo;</dt>
  2026. <dd><p>select EMI.
  2027. </p></dd>
  2028. <dt>&lsquo;<samp>bsi</samp>&rsquo;</dt>
  2029. <dd><p>select BSI (78RPM).
  2030. </p></dd>
  2031. <dt>&lsquo;<samp>riaa</samp>&rsquo;</dt>
  2032. <dd><p>select RIAA.
  2033. </p></dd>
  2034. <dt>&lsquo;<samp>cd</samp>&rsquo;</dt>
  2035. <dd><p>select Compact Disc (CD).
  2036. </p></dd>
  2037. <dt>&lsquo;<samp>50fm</samp>&rsquo;</dt>
  2038. <dd><p>select 50µs (FM).
  2039. </p></dd>
  2040. <dt>&lsquo;<samp>75fm</samp>&rsquo;</dt>
  2041. <dd><p>select 75µs (FM).
  2042. </p></dd>
  2043. <dt>&lsquo;<samp>50kf</samp>&rsquo;</dt>
  2044. <dd><p>select 50µs (FM-KF).
  2045. </p></dd>
  2046. <dt>&lsquo;<samp>75kf</samp>&rsquo;</dt>
  2047. <dd><p>select 75µs (FM-KF).
  2048. </p></dd>
  2049. </dl>
  2050. </dd>
  2051. </dl>
  2052. <a name="aeval"></a>
  2053. <h2 class="section"><a href="ffmpeg-filters.html#toc-aeval">8.14 aeval</a></h2>
  2054. <p>Modify an audio signal according to the specified expressions.
  2055. </p>
  2056. <p>This filter accepts one or more expressions (one for each channel),
  2057. which are evaluated and used to modify a corresponding audio signal.
  2058. </p>
  2059. <p>It accepts the following parameters:
  2060. </p>
  2061. <dl compact="compact">
  2062. <dt>&lsquo;<samp>exprs</samp>&rsquo;</dt>
  2063. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. If
  2064. the number of input channels is greater than the number of
  2065. expressions, the last specified expression is used for the remaining
  2066. output channels.
  2067. </p>
  2068. </dd>
  2069. <dt>&lsquo;<samp>channel_layout, c</samp>&rsquo;</dt>
  2070. <dd><p>Set output channel layout. If not specified, the channel layout is
  2071. specified by the number of expressions. If set to &lsquo;<samp>same</samp>&rsquo;, it will
  2072. use by default the same input channel layout.
  2073. </p></dd>
  2074. </dl>
  2075. <p>Each expression in <var>exprs</var> can contain the following constants and functions:
  2076. </p>
  2077. <dl compact="compact">
  2078. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  2079. <dd><p>channel number of the current expression
  2080. </p>
  2081. </dd>
  2082. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  2083. <dd><p>number of the evaluated sample, starting from 0
  2084. </p>
  2085. </dd>
  2086. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  2087. <dd><p>sample rate
  2088. </p>
  2089. </dd>
  2090. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  2091. <dd><p>time of the evaluated sample expressed in seconds
  2092. </p>
  2093. </dd>
  2094. <dt>&lsquo;<samp>nb_in_channels</samp>&rsquo;</dt>
  2095. <dt>&lsquo;<samp>nb_out_channels</samp>&rsquo;</dt>
  2096. <dd><p>input and output number of channels
  2097. </p>
  2098. </dd>
  2099. <dt>&lsquo;<samp>val(CH)</samp>&rsquo;</dt>
  2100. <dd><p>the value of input channel with number <var>CH</var>
  2101. </p></dd>
  2102. </dl>
  2103. <p>Note: this filter is slow. For faster processing you should use a
  2104. dedicated filter.
  2105. </p>
  2106. <a name="Examples-108"></a>
  2107. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-108">8.14.1 Examples</a></h3>
  2108. <ul>
  2109. <li>
  2110. Half volume:
  2111. <div class="example">
  2112. <pre class="example">aeval=val(ch)/2:c=same
  2113. </pre></div>
  2114. </li><li>
  2115. Invert phase of the second channel:
  2116. <div class="example">
  2117. <pre class="example">aeval=val(0)|-val(1)
  2118. </pre></div>
  2119. </li></ul>
  2120. <p><a name="afade"></a>
  2121. </p><a name="afade-1"></a>
  2122. <h2 class="section"><a href="ffmpeg-filters.html#toc-afade-1">8.15 afade</a></h2>
  2123. <p>Apply fade-in/out effect to input audio.
  2124. </p>
  2125. <p>A description of the accepted parameters follows.
  2126. </p>
  2127. <dl compact="compact">
  2128. <dt>&lsquo;<samp>type, t</samp>&rsquo;</dt>
  2129. <dd><p>Specify the effect type, can be either <code>in</code> for fade-in, or
  2130. <code>out</code> for a fade-out effect. Default is <code>in</code>.
  2131. </p>
  2132. </dd>
  2133. <dt>&lsquo;<samp>start_sample, ss</samp>&rsquo;</dt>
  2134. <dd><p>Specify the number of the start sample for starting to apply the fade
  2135. effect. Default is 0.
  2136. </p>
  2137. </dd>
  2138. <dt>&lsquo;<samp>nb_samples, ns</samp>&rsquo;</dt>
  2139. <dd><p>Specify the number of samples for which the fade effect has to last. At
  2140. the end of the fade-in effect the output audio will have the same
  2141. volume as the input audio, at the end of the fade-out transition
  2142. the output audio will be silence. Default is 44100.
  2143. </p>
  2144. </dd>
  2145. <dt>&lsquo;<samp>start_time, st</samp>&rsquo;</dt>
  2146. <dd><p>Specify the start time of the fade effect. Default is 0.
  2147. The value must be specified as a time duration; see
  2148. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  2149. for the accepted syntax.
  2150. If set this option is used instead of <var>start_sample</var>.
  2151. </p>
  2152. </dd>
  2153. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  2154. <dd><p>Specify the duration of the fade effect. See
  2155. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  2156. for the accepted syntax.
  2157. At the end of the fade-in effect the output audio will have the same
  2158. volume as the input audio, at the end of the fade-out transition
  2159. the output audio will be silence.
  2160. By default the duration is determined by <var>nb_samples</var>.
  2161. If set this option is used instead of <var>nb_samples</var>.
  2162. </p>
  2163. </dd>
  2164. <dt>&lsquo;<samp>curve</samp>&rsquo;</dt>
  2165. <dd><p>Set curve for fade transition.
  2166. </p>
  2167. <p>It accepts the following values:
  2168. </p><dl compact="compact">
  2169. <dt>&lsquo;<samp>tri</samp>&rsquo;</dt>
  2170. <dd><p>select triangular, linear slope (default)
  2171. </p></dd>
  2172. <dt>&lsquo;<samp>qsin</samp>&rsquo;</dt>
  2173. <dd><p>select quarter of sine wave
  2174. </p></dd>
  2175. <dt>&lsquo;<samp>hsin</samp>&rsquo;</dt>
  2176. <dd><p>select half of sine wave
  2177. </p></dd>
  2178. <dt>&lsquo;<samp>esin</samp>&rsquo;</dt>
  2179. <dd><p>select exponential sine wave
  2180. </p></dd>
  2181. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  2182. <dd><p>select logarithmic
  2183. </p></dd>
  2184. <dt>&lsquo;<samp>ipar</samp>&rsquo;</dt>
  2185. <dd><p>select inverted parabola
  2186. </p></dd>
  2187. <dt>&lsquo;<samp>qua</samp>&rsquo;</dt>
  2188. <dd><p>select quadratic
  2189. </p></dd>
  2190. <dt>&lsquo;<samp>cub</samp>&rsquo;</dt>
  2191. <dd><p>select cubic
  2192. </p></dd>
  2193. <dt>&lsquo;<samp>squ</samp>&rsquo;</dt>
  2194. <dd><p>select square root
  2195. </p></dd>
  2196. <dt>&lsquo;<samp>cbr</samp>&rsquo;</dt>
  2197. <dd><p>select cubic root
  2198. </p></dd>
  2199. <dt>&lsquo;<samp>par</samp>&rsquo;</dt>
  2200. <dd><p>select parabola
  2201. </p></dd>
  2202. <dt>&lsquo;<samp>exp</samp>&rsquo;</dt>
  2203. <dd><p>select exponential
  2204. </p></dd>
  2205. <dt>&lsquo;<samp>iqsin</samp>&rsquo;</dt>
  2206. <dd><p>select inverted quarter of sine wave
  2207. </p></dd>
  2208. <dt>&lsquo;<samp>ihsin</samp>&rsquo;</dt>
  2209. <dd><p>select inverted half of sine wave
  2210. </p></dd>
  2211. <dt>&lsquo;<samp>dese</samp>&rsquo;</dt>
  2212. <dd><p>select double-exponential seat
  2213. </p></dd>
  2214. <dt>&lsquo;<samp>desi</samp>&rsquo;</dt>
  2215. <dd><p>select double-exponential sigmoid
  2216. </p></dd>
  2217. <dt>&lsquo;<samp>losi</samp>&rsquo;</dt>
  2218. <dd><p>select logistic sigmoid
  2219. </p></dd>
  2220. <dt>&lsquo;<samp>nofade</samp>&rsquo;</dt>
  2221. <dd><p>no fade applied
  2222. </p></dd>
  2223. </dl>
  2224. </dd>
  2225. </dl>
  2226. <a name="Examples-148"></a>
  2227. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-148">8.15.1 Examples</a></h3>
  2228. <ul>
  2229. <li>
  2230. Fade in first 15 seconds of audio:
  2231. <div class="example">
  2232. <pre class="example">afade=t=in:ss=0:d=15
  2233. </pre></div>
  2234. </li><li>
  2235. Fade out last 25 seconds of a 900 seconds audio:
  2236. <div class="example">
  2237. <pre class="example">afade=t=out:st=875:d=25
  2238. </pre></div>
  2239. </li></ul>
  2240. <a name="afftdn"></a>
  2241. <h2 class="section"><a href="ffmpeg-filters.html#toc-afftdn">8.16 afftdn</a></h2>
  2242. <p>Denoise audio samples with FFT.
  2243. </p>
  2244. <p>A description of the accepted parameters follows.
  2245. </p>
  2246. <dl compact="compact">
  2247. <dt>&lsquo;<samp>nr</samp>&rsquo;</dt>
  2248. <dd><p>Set the noise reduction in dB, allowed range is 0.01 to 97.
  2249. Default value is 12 dB.
  2250. </p>
  2251. </dd>
  2252. <dt>&lsquo;<samp>nf</samp>&rsquo;</dt>
  2253. <dd><p>Set the noise floor in dB, allowed range is -80 to -20.
  2254. Default value is -50 dB.
  2255. </p>
  2256. </dd>
  2257. <dt>&lsquo;<samp>nt</samp>&rsquo;</dt>
  2258. <dd><p>Set the noise type.
  2259. </p>
  2260. <p>It accepts the following values:
  2261. </p><dl compact="compact">
  2262. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  2263. <dd><p>Select white noise.
  2264. </p>
  2265. </dd>
  2266. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  2267. <dd><p>Select vinyl noise.
  2268. </p>
  2269. </dd>
  2270. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  2271. <dd><p>Select shellac noise.
  2272. </p>
  2273. </dd>
  2274. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  2275. <dd><p>Select custom noise, defined in <code>bn</code> option.
  2276. </p>
  2277. <p>Default value is white noise.
  2278. </p></dd>
  2279. </dl>
  2280. </dd>
  2281. <dt>&lsquo;<samp>bn</samp>&rsquo;</dt>
  2282. <dd><p>Set custom band noise for every one of 15 bands.
  2283. Bands are separated by &rsquo; &rsquo; or &rsquo;|&rsquo;.
  2284. </p>
  2285. </dd>
  2286. <dt>&lsquo;<samp>rf</samp>&rsquo;</dt>
  2287. <dd><p>Set the residual floor in dB, allowed range is -80 to -20.
  2288. Default value is -38 dB.
  2289. </p>
  2290. </dd>
  2291. <dt>&lsquo;<samp>tn</samp>&rsquo;</dt>
  2292. <dd><p>Enable noise tracking. By default is disabled.
  2293. With this enabled, noise floor is automatically adjusted.
  2294. </p>
  2295. </dd>
  2296. <dt>&lsquo;<samp>tr</samp>&rsquo;</dt>
  2297. <dd><p>Enable residual tracking. By default is disabled.
  2298. </p>
  2299. </dd>
  2300. <dt>&lsquo;<samp>om</samp>&rsquo;</dt>
  2301. <dd><p>Set the output mode.
  2302. </p>
  2303. <p>It accepts the following values:
  2304. </p><dl compact="compact">
  2305. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  2306. <dd><p>Pass input unchanged.
  2307. </p>
  2308. </dd>
  2309. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  2310. <dd><p>Pass noise filtered out.
  2311. </p>
  2312. </dd>
  2313. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  2314. <dd><p>Pass only noise.
  2315. </p>
  2316. <p>Default value is <var>o</var>.
  2317. </p></dd>
  2318. </dl>
  2319. </dd>
  2320. </dl>
  2321. <a name="Commands-49"></a>
  2322. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-49">8.16.1 Commands</a></h3>
  2323. <p>This filter supports the following commands:
  2324. </p><dl compact="compact">
  2325. <dt>&lsquo;<samp>sample_noise, sn</samp>&rsquo;</dt>
  2326. <dd><p>Start or stop measuring noise profile.
  2327. Syntax for the command is : &quot;start&quot; or &quot;stop&quot; string.
  2328. After measuring noise profile is stopped it will be
  2329. automatically applied in filtering.
  2330. </p>
  2331. </dd>
  2332. <dt>&lsquo;<samp>noise_reduction, nr</samp>&rsquo;</dt>
  2333. <dd><p>Change noise reduction. Argument is single float number.
  2334. Syntax for the command is : &quot;<var>noise_reduction</var>&quot;
  2335. </p>
  2336. </dd>
  2337. <dt>&lsquo;<samp>noise_floor, nf</samp>&rsquo;</dt>
  2338. <dd><p>Change noise floor. Argument is single float number.
  2339. Syntax for the command is : &quot;<var>noise_floor</var>&quot;
  2340. </p>
  2341. </dd>
  2342. <dt>&lsquo;<samp>output_mode, om</samp>&rsquo;</dt>
  2343. <dd><p>Change output mode operation.
  2344. Syntax for the command is : &quot;i&quot;, &quot;o&quot; or &quot;n&quot; string.
  2345. </p></dd>
  2346. </dl>
  2347. <a name="afftfilt"></a>
  2348. <h2 class="section"><a href="ffmpeg-filters.html#toc-afftfilt">8.17 afftfilt</a></h2>
  2349. <p>Apply arbitrary expressions to samples in frequency domain.
  2350. </p>
  2351. <dl compact="compact">
  2352. <dt>&lsquo;<samp>real</samp>&rsquo;</dt>
  2353. <dd><p>Set frequency domain real expression for each separate channel separated
  2354. by &rsquo;|&rsquo;. Default is &quot;re&quot;.
  2355. If the number of input channels is greater than the number of
  2356. expressions, the last specified expression is used for the remaining
  2357. output channels.
  2358. </p>
  2359. </dd>
  2360. <dt>&lsquo;<samp>imag</samp>&rsquo;</dt>
  2361. <dd><p>Set frequency domain imaginary expression for each separate channel
  2362. separated by &rsquo;|&rsquo;. Default is &quot;im&quot;.
  2363. </p>
  2364. <p>Each expression in <var>real</var> and <var>imag</var> can contain the following
  2365. constants and functions:
  2366. </p>
  2367. <dl compact="compact">
  2368. <dt>&lsquo;<samp>sr</samp>&rsquo;</dt>
  2369. <dd><p>sample rate
  2370. </p>
  2371. </dd>
  2372. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  2373. <dd><p>current frequency bin number
  2374. </p>
  2375. </dd>
  2376. <dt>&lsquo;<samp>nb</samp>&rsquo;</dt>
  2377. <dd><p>number of available bins
  2378. </p>
  2379. </dd>
  2380. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  2381. <dd><p>channel number of the current expression
  2382. </p>
  2383. </dd>
  2384. <dt>&lsquo;<samp>chs</samp>&rsquo;</dt>
  2385. <dd><p>number of channels
  2386. </p>
  2387. </dd>
  2388. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  2389. <dd><p>current frame pts
  2390. </p>
  2391. </dd>
  2392. <dt>&lsquo;<samp>re</samp>&rsquo;</dt>
  2393. <dd><p>current real part of frequency bin of current channel
  2394. </p>
  2395. </dd>
  2396. <dt>&lsquo;<samp>im</samp>&rsquo;</dt>
  2397. <dd><p>current imaginary part of frequency bin of current channel
  2398. </p>
  2399. </dd>
  2400. <dt>&lsquo;<samp>real(b, ch)</samp>&rsquo;</dt>
  2401. <dd><p>Return the value of real part of frequency bin at location (<var>bin</var>,<var>channel</var>)
  2402. </p>
  2403. </dd>
  2404. <dt>&lsquo;<samp>imag(b, ch)</samp>&rsquo;</dt>
  2405. <dd><p>Return the value of imaginary part of frequency bin at location (<var>bin</var>,<var>channel</var>)
  2406. </p></dd>
  2407. </dl>
  2408. </dd>
  2409. <dt>&lsquo;<samp>win_size</samp>&rsquo;</dt>
  2410. <dd><p>Set window size. Allowed range is from 16 to 131072.
  2411. Default is <code>4096</code>
  2412. </p>
  2413. </dd>
  2414. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  2415. <dd><p>Set window function. Default is <code>hann</code>.
  2416. </p>
  2417. </dd>
  2418. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  2419. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  2420. window function will be picked. Default is <code>0.75</code>.
  2421. </p></dd>
  2422. </dl>
  2423. <a name="Examples-130"></a>
  2424. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-130">8.17.1 Examples</a></h3>
  2425. <ul>
  2426. <li>
  2427. Leave almost only low frequencies in audio:
  2428. <div class="example">
  2429. <pre class="example">afftfilt=&quot;'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'&quot;
  2430. </pre></div>
  2431. </li><li>
  2432. Apply robotize effect:
  2433. <div class="example">
  2434. <pre class="example">afftfilt=&quot;real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75&quot;
  2435. </pre></div>
  2436. </li><li>
  2437. Apply whisper effect:
  2438. <div class="example">
  2439. <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;
  2440. </pre></div>
  2441. </li></ul>
  2442. <p><a name="afir"></a>
  2443. </p><a name="afir-1"></a>
  2444. <h2 class="section"><a href="ffmpeg-filters.html#toc-afir-1">8.18 afir</a></h2>
  2445. <p>Apply an arbitrary Finite Impulse Response filter.
  2446. </p>
  2447. <p>This filter is designed for applying long FIR filters,
  2448. up to 60 seconds long.
  2449. </p>
  2450. <p>It can be used as component for digital crossover filters,
  2451. room equalization, cross talk cancellation, wavefield synthesis,
  2452. auralization, ambiophonics, ambisonics and spatialization.
  2453. </p>
  2454. <p>This filter uses the streams higher than first one as FIR coefficients.
  2455. If the non-first stream holds a single channel, it will be used
  2456. for all input channels in the first stream, otherwise
  2457. the number of channels in the non-first stream must be same as
  2458. the number of channels in the first stream.
  2459. </p>
  2460. <p>It accepts the following parameters:
  2461. </p>
  2462. <dl compact="compact">
  2463. <dt>&lsquo;<samp>dry</samp>&rsquo;</dt>
  2464. <dd><p>Set dry gain. This sets input gain.
  2465. </p>
  2466. </dd>
  2467. <dt>&lsquo;<samp>wet</samp>&rsquo;</dt>
  2468. <dd><p>Set wet gain. This sets final output gain.
  2469. </p>
  2470. </dd>
  2471. <dt>&lsquo;<samp>length</samp>&rsquo;</dt>
  2472. <dd><p>Set Impulse Response filter length. Default is 1, which means whole IR is processed.
  2473. </p>
  2474. </dd>
  2475. <dt>&lsquo;<samp>gtype</samp>&rsquo;</dt>
  2476. <dd><p>Enable applying gain measured from power of IR.
  2477. </p>
  2478. <p>Set which approach to use for auto gain measurement.
  2479. </p>
  2480. <dl compact="compact">
  2481. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  2482. <dd><p>Do not apply any gain.
  2483. </p>
  2484. </dd>
  2485. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  2486. <dd><p>select peak gain, very conservative approach. This is default value.
  2487. </p>
  2488. </dd>
  2489. <dt>&lsquo;<samp>dc</samp>&rsquo;</dt>
  2490. <dd><p>select DC gain, limited application.
  2491. </p>
  2492. </dd>
  2493. <dt>&lsquo;<samp>gn</samp>&rsquo;</dt>
  2494. <dd><p>select gain to noise approach, this is most popular one.
  2495. </p></dd>
  2496. </dl>
  2497. </dd>
  2498. <dt>&lsquo;<samp>irgain</samp>&rsquo;</dt>
  2499. <dd><p>Set gain to be applied to IR coefficients before filtering.
  2500. Allowed range is 0 to 1. This gain is applied after any gain applied with <var>gtype</var> option.
  2501. </p>
  2502. </dd>
  2503. <dt>&lsquo;<samp>irfmt</samp>&rsquo;</dt>
  2504. <dd><p>Set format of IR stream. Can be <code>mono</code> or <code>input</code>.
  2505. Default is <code>input</code>.
  2506. </p>
  2507. </dd>
  2508. <dt>&lsquo;<samp>maxir</samp>&rsquo;</dt>
  2509. <dd><p>Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds.
  2510. Allowed range is 0.1 to 60 seconds.
  2511. </p>
  2512. </dd>
  2513. <dt>&lsquo;<samp>response</samp>&rsquo;</dt>
  2514. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  2515. By default it is disabled.
  2516. </p>
  2517. </dd>
  2518. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  2519. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  2520. displayed. This option is used only when <var>response</var> is enabled.
  2521. </p>
  2522. </dd>
  2523. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  2524. <dd><p>Set video stream size. This option is used only when <var>response</var> is enabled.
  2525. </p>
  2526. </dd>
  2527. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  2528. <dd><p>Set video stream frame rate. This option is used only when <var>response</var> is enabled.
  2529. </p>
  2530. </dd>
  2531. <dt>&lsquo;<samp>minp</samp>&rsquo;</dt>
  2532. <dd><p>Set minimal partition size used for convolution. Default is <var>8192</var>.
  2533. Allowed range is from <var>1</var> to <var>32768</var>.
  2534. Lower values decreases latency at cost of higher CPU usage.
  2535. </p>
  2536. </dd>
  2537. <dt>&lsquo;<samp>maxp</samp>&rsquo;</dt>
  2538. <dd><p>Set maximal partition size used for convolution. Default is <var>8192</var>.
  2539. Allowed range is from <var>8</var> to <var>32768</var>.
  2540. Lower values may increase CPU usage.
  2541. </p>
  2542. </dd>
  2543. <dt>&lsquo;<samp>nbirs</samp>&rsquo;</dt>
  2544. <dd><p>Set number of input impulse responses streams which will be switchable at runtime.
  2545. Allowed range is from <var>1</var> to <var>32</var>. Default is <var>1</var>.
  2546. </p>
  2547. </dd>
  2548. <dt>&lsquo;<samp>ir</samp>&rsquo;</dt>
  2549. <dd><p>Set IR stream which will be used for convolution, starting from <var>0</var>, should always be
  2550. lower than supplied value by <code>nbirs</code> option. Default is <var>0</var>.
  2551. This option can be changed at runtime via <a href="#commands">commands</a>.
  2552. </p></dd>
  2553. </dl>
  2554. <a name="Examples-86"></a>
  2555. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-86">8.18.1 Examples</a></h3>
  2556. <ul>
  2557. <li>
  2558. Apply reverb to stream using mono IR file as second input, complete command using ffmpeg:
  2559. <div class="example">
  2560. <pre class="example">ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
  2561. </pre></div>
  2562. </li></ul>
  2563. <p><a name="aformat"></a>
  2564. </p><a name="aformat-1"></a>
  2565. <h2 class="section"><a href="ffmpeg-filters.html#toc-aformat-1">8.19 aformat</a></h2>
  2566. <p>Set output format constraints for the input audio. The framework will
  2567. negotiate the most appropriate format to minimize conversions.
  2568. </p>
  2569. <p>It accepts the following parameters:
  2570. </p><dl compact="compact">
  2571. <dt>&lsquo;<samp>sample_fmts, f</samp>&rsquo;</dt>
  2572. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
  2573. </p>
  2574. </dd>
  2575. <dt>&lsquo;<samp>sample_rates, r</samp>&rsquo;</dt>
  2576. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
  2577. </p>
  2578. </dd>
  2579. <dt>&lsquo;<samp>channel_layouts, cl</samp>&rsquo;</dt>
  2580. <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
  2581. </p>
  2582. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  2583. for the required syntax.
  2584. </p></dd>
  2585. </dl>
  2586. <p>If a parameter is omitted, all values are allowed.
  2587. </p>
  2588. <p>Force the output to either unsigned 8-bit or signed 16-bit stereo
  2589. </p><div class="example">
  2590. <pre class="example">aformat=sample_fmts=u8|s16:channel_layouts=stereo
  2591. </pre></div>
  2592. <a name="agate"></a>
  2593. <h2 class="section"><a href="ffmpeg-filters.html#toc-agate">8.20 agate</a></h2>
  2594. <p>A gate is mainly used to reduce lower parts of a signal. This kind of signal
  2595. processing reduces disturbing noise between useful signals.
  2596. </p>
  2597. <p>Gating is done by detecting the volume below a chosen level <var>threshold</var>
  2598. and dividing it by the factor set with <var>ratio</var>. The bottom of the noise
  2599. floor is set via <var>range</var>. Because an exact manipulation of the signal
  2600. would cause distortion of the waveform the reduction can be levelled over
  2601. time. This is done by setting <var>attack</var> and <var>release</var>.
  2602. </p>
  2603. <p><var>attack</var> determines how long the signal has to fall below the threshold
  2604. before any reduction will occur and <var>release</var> sets the time the signal
  2605. has to rise above the threshold to reduce the reduction again.
  2606. Shorter signals than the chosen attack time will be left untouched.
  2607. </p>
  2608. <dl compact="compact">
  2609. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  2610. <dd><p>Set input level before filtering.
  2611. Default is 1. Allowed range is from 0.015625 to 64.
  2612. </p>
  2613. </dd>
  2614. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  2615. <dd><p>Set the mode of operation. Can be <code>upward</code> or <code>downward</code>.
  2616. Default is <code>downward</code>. If set to <code>upward</code> mode, higher parts of signal
  2617. will be amplified, expanding dynamic range in upward direction.
  2618. Otherwise, in case of <code>downward</code> lower parts of signal will be reduced.
  2619. </p>
  2620. </dd>
  2621. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  2622. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  2623. Default is 0.06125. Allowed range is from 0 to 1.
  2624. Setting this to 0 disables reduction and then filter behaves like expander.
  2625. </p>
  2626. </dd>
  2627. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  2628. <dd><p>If a signal rises above this level the gain reduction is released.
  2629. Default is 0.125. Allowed range is from 0 to 1.
  2630. </p>
  2631. </dd>
  2632. <dt>&lsquo;<samp>ratio</samp>&rsquo;</dt>
  2633. <dd><p>Set a ratio by which the signal is reduced.
  2634. Default is 2. Allowed range is from 1 to 9000.
  2635. </p>
  2636. </dd>
  2637. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  2638. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  2639. reduction stops.
  2640. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  2641. </p>
  2642. </dd>
  2643. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  2644. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  2645. reduction is increased again. Default is 250 milliseconds.
  2646. Allowed range is from 0.01 to 9000.
  2647. </p>
  2648. </dd>
  2649. <dt>&lsquo;<samp>makeup</samp>&rsquo;</dt>
  2650. <dd><p>Set amount of amplification of signal after processing.
  2651. Default is 1. Allowed range is from 1 to 64.
  2652. </p>
  2653. </dd>
  2654. <dt>&lsquo;<samp>knee</samp>&rsquo;</dt>
  2655. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  2656. Default is 2.828427125. Allowed range is from 1 to 8.
  2657. </p>
  2658. </dd>
  2659. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  2660. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  2661. Default is <code>rms</code>. Can be <code>peak</code> or <code>rms</code>.
  2662. </p>
  2663. </dd>
  2664. <dt>&lsquo;<samp>link</samp>&rsquo;</dt>
  2665. <dd><p>Choose if the average level between all channels or the louder channel affects
  2666. the reduction.
  2667. Default is <code>average</code>. Can be <code>average</code> or <code>maximum</code>.
  2668. </p></dd>
  2669. </dl>
  2670. <a name="aiir"></a>
  2671. <h2 class="section"><a href="ffmpeg-filters.html#toc-aiir">8.21 aiir</a></h2>
  2672. <p>Apply an arbitrary Infinite Impulse Response filter.
  2673. </p>
  2674. <p>It accepts the following parameters:
  2675. </p>
  2676. <dl compact="compact">
  2677. <dt>&lsquo;<samp>zeros, z</samp>&rsquo;</dt>
  2678. <dd><p>Set numerator/zeros coefficients.
  2679. </p>
  2680. </dd>
  2681. <dt>&lsquo;<samp>poles, p</samp>&rsquo;</dt>
  2682. <dd><p>Set denominator/poles coefficients.
  2683. </p>
  2684. </dd>
  2685. <dt>&lsquo;<samp>gains, k</samp>&rsquo;</dt>
  2686. <dd><p>Set channels gains.
  2687. </p>
  2688. </dd>
  2689. <dt>&lsquo;<samp>dry_gain</samp>&rsquo;</dt>
  2690. <dd><p>Set input gain.
  2691. </p>
  2692. </dd>
  2693. <dt>&lsquo;<samp>wet_gain</samp>&rsquo;</dt>
  2694. <dd><p>Set output gain.
  2695. </p>
  2696. </dd>
  2697. <dt>&lsquo;<samp>format, f</samp>&rsquo;</dt>
  2698. <dd><p>Set coefficients format.
  2699. </p>
  2700. <dl compact="compact">
  2701. <dt>&lsquo;<samp>tf</samp>&rsquo;</dt>
  2702. <dd><p>digital transfer function
  2703. </p></dd>
  2704. <dt>&lsquo;<samp>zp</samp>&rsquo;</dt>
  2705. <dd><p>Z-plane zeros/poles, cartesian (default)
  2706. </p></dd>
  2707. <dt>&lsquo;<samp>pr</samp>&rsquo;</dt>
  2708. <dd><p>Z-plane zeros/poles, polar radians
  2709. </p></dd>
  2710. <dt>&lsquo;<samp>pd</samp>&rsquo;</dt>
  2711. <dd><p>Z-plane zeros/poles, polar degrees
  2712. </p></dd>
  2713. <dt>&lsquo;<samp>sp</samp>&rsquo;</dt>
  2714. <dd><p>S-plane zeros/poles
  2715. </p></dd>
  2716. </dl>
  2717. </dd>
  2718. <dt>&lsquo;<samp>process, r</samp>&rsquo;</dt>
  2719. <dd><p>Set kind of processing.
  2720. Can be <code>d</code> - direct or <code>s</code> - serial cascading. Default is <code>s</code>.
  2721. </p>
  2722. </dd>
  2723. <dt>&lsquo;<samp>precision, e</samp>&rsquo;</dt>
  2724. <dd><p>Set filtering precision.
  2725. </p>
  2726. <dl compact="compact">
  2727. <dt>&lsquo;<samp>dbl</samp>&rsquo;</dt>
  2728. <dd><p>double-precision floating-point (default)
  2729. </p></dd>
  2730. <dt>&lsquo;<samp>flt</samp>&rsquo;</dt>
  2731. <dd><p>single-precision floating-point
  2732. </p></dd>
  2733. <dt>&lsquo;<samp>i32</samp>&rsquo;</dt>
  2734. <dd><p>32-bit integers
  2735. </p></dd>
  2736. <dt>&lsquo;<samp>i16</samp>&rsquo;</dt>
  2737. <dd><p>16-bit integers
  2738. </p></dd>
  2739. </dl>
  2740. </dd>
  2741. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  2742. <dd><p>Normalize filter coefficients, by default is enabled.
  2743. Enabling it will normalize magnitude response at DC to 0dB.
  2744. </p>
  2745. </dd>
  2746. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  2747. <dd><p>How much to use filtered signal in output. Default is 1.
  2748. Range is between 0 and 1.
  2749. </p>
  2750. </dd>
  2751. <dt>&lsquo;<samp>response</samp>&rsquo;</dt>
  2752. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  2753. By default it is disabled.
  2754. </p>
  2755. </dd>
  2756. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  2757. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  2758. displayed. This option is used only when <var>response</var> is enabled.
  2759. </p>
  2760. </dd>
  2761. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  2762. <dd><p>Set video stream size. This option is used only when <var>response</var> is enabled.
  2763. </p></dd>
  2764. </dl>
  2765. <p>Coefficients in <code>tf</code> format are separated by spaces and are in ascending
  2766. order.
  2767. </p>
  2768. <p>Coefficients in <code>zp</code> format are separated by spaces and order of coefficients
  2769. doesn&rsquo;t matter. Coefficients in <code>zp</code> format are complex numbers with <var>i</var>
  2770. imaginary unit.
  2771. </p>
  2772. <p>Different coefficients and gains can be provided for every channel, in such case
  2773. use &rsquo;|&rsquo; to separate coefficients or gains. Last provided coefficients will be
  2774. used for all remaining channels.
  2775. </p>
  2776. <a name="Examples-29"></a>
  2777. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-29">8.21.1 Examples</a></h3>
  2778. <ul>
  2779. <li>
  2780. Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate:
  2781. <div class="example">
  2782. <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
  2783. </pre></div>
  2784. </li><li>
  2785. Same as above but in <code>zp</code> format:
  2786. <div class="example">
  2787. <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
  2788. </pre></div>
  2789. </li></ul>
  2790. <a name="alimiter"></a>
  2791. <h2 class="section"><a href="ffmpeg-filters.html#toc-alimiter">8.22 alimiter</a></h2>
  2792. <p>The limiter prevents an input signal from rising over a desired threshold.
  2793. This limiter uses lookahead technology to prevent your signal from distorting.
  2794. It means that there is a small delay after the signal is processed. Keep in mind
  2795. that the delay it produces is the attack time you set.
  2796. </p>
  2797. <p>The filter accepts the following options:
  2798. </p>
  2799. <dl compact="compact">
  2800. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  2801. <dd><p>Set input gain. Default is 1.
  2802. </p>
  2803. </dd>
  2804. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  2805. <dd><p>Set output gain. Default is 1.
  2806. </p>
  2807. </dd>
  2808. <dt>&lsquo;<samp>limit</samp>&rsquo;</dt>
  2809. <dd><p>Don&rsquo;t let signals above this level pass the limiter. Default is 1.
  2810. </p>
  2811. </dd>
  2812. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  2813. <dd><p>The limiter will reach its attenuation level in this amount of time in
  2814. milliseconds. Default is 5 milliseconds.
  2815. </p>
  2816. </dd>
  2817. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  2818. <dd><p>Come back from limiting to attenuation 1.0 in this amount of milliseconds.
  2819. Default is 50 milliseconds.
  2820. </p>
  2821. </dd>
  2822. <dt>&lsquo;<samp>asc</samp>&rsquo;</dt>
  2823. <dd><p>When gain reduction is always needed ASC takes care of releasing to an
  2824. average reduction level rather than reaching a reduction of 0 in the release
  2825. time.
  2826. </p>
  2827. </dd>
  2828. <dt>&lsquo;<samp>asc_level</samp>&rsquo;</dt>
  2829. <dd><p>Select how much the release time is affected by ASC, 0 means nearly no changes
  2830. in release time while 1 produces higher release times.
  2831. </p>
  2832. </dd>
  2833. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  2834. <dd><p>Auto level output signal. Default is enabled.
  2835. This normalizes audio back to 0dB if enabled.
  2836. </p></dd>
  2837. </dl>
  2838. <p>Depending on picked setting it is recommended to upsample input 2x or 4x times
  2839. with <a href="#aresample">aresample</a> before applying this filter.
  2840. </p>
  2841. <a name="allpass"></a>
  2842. <h2 class="section"><a href="ffmpeg-filters.html#toc-allpass">8.23 allpass</a></h2>
  2843. <p>Apply a two-pole all-pass filter with central frequency (in Hz)
  2844. <var>frequency</var>, and filter-width <var>width</var>.
  2845. An all-pass filter changes the audio&rsquo;s frequency to phase relationship
  2846. without changing its frequency to amplitude relationship.
  2847. </p>
  2848. <p>The filter accepts the following options:
  2849. </p>
  2850. <dl compact="compact">
  2851. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  2852. <dd><p>Set frequency in Hz.
  2853. </p>
  2854. </dd>
  2855. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  2856. <dd><p>Set method to specify band-width of filter.
  2857. </p><dl compact="compact">
  2858. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  2859. <dd><p>Hz
  2860. </p></dd>
  2861. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  2862. <dd><p>Q-Factor
  2863. </p></dd>
  2864. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  2865. <dd><p>octave
  2866. </p></dd>
  2867. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  2868. <dd><p>slope
  2869. </p></dd>
  2870. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  2871. <dd><p>kHz
  2872. </p></dd>
  2873. </dl>
  2874. </dd>
  2875. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  2876. <dd><p>Specify the band-width of a filter in width_type units.
  2877. </p>
  2878. </dd>
  2879. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  2880. <dd><p>How much to use filtered signal in output. Default is 1.
  2881. Range is between 0 and 1.
  2882. </p>
  2883. </dd>
  2884. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  2885. <dd><p>Specify which channels to filter, by default all available are filtered.
  2886. </p>
  2887. </dd>
  2888. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  2889. <dd><p>Normalize biquad coefficients, by default is disabled.
  2890. Enabling it will normalize magnitude response at DC to 0dB.
  2891. </p>
  2892. </dd>
  2893. <dt>&lsquo;<samp>order, o</samp>&rsquo;</dt>
  2894. <dd><p>Set the filter order, can be 1 or 2. Default is 2.
  2895. </p></dd>
  2896. </dl>
  2897. <a name="Commands-21"></a>
  2898. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-21">8.23.1 Commands</a></h3>
  2899. <p>This filter supports the following commands:
  2900. </p><dl compact="compact">
  2901. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  2902. <dd><p>Change allpass frequency.
  2903. Syntax for the command is : &quot;<var>frequency</var>&quot;
  2904. </p>
  2905. </dd>
  2906. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  2907. <dd><p>Change allpass width_type.
  2908. Syntax for the command is : &quot;<var>width_type</var>&quot;
  2909. </p>
  2910. </dd>
  2911. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  2912. <dd><p>Change allpass width.
  2913. Syntax for the command is : &quot;<var>width</var>&quot;
  2914. </p>
  2915. </dd>
  2916. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  2917. <dd><p>Change allpass mix.
  2918. Syntax for the command is : &quot;<var>mix</var>&quot;
  2919. </p></dd>
  2920. </dl>
  2921. <a name="aloop"></a>
  2922. <h2 class="section"><a href="ffmpeg-filters.html#toc-aloop">8.24 aloop</a></h2>
  2923. <p>Loop audio samples.
  2924. </p>
  2925. <p>The filter accepts the following options:
  2926. </p>
  2927. <dl compact="compact">
  2928. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  2929. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  2930. Default is 0.
  2931. </p>
  2932. </dd>
  2933. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  2934. <dd><p>Set maximal number of samples. Default is 0.
  2935. </p>
  2936. </dd>
  2937. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  2938. <dd><p>Set first sample of loop. Default is 0.
  2939. </p></dd>
  2940. </dl>
  2941. <p><a name="amerge"></a>
  2942. </p><a name="amerge-1"></a>
  2943. <h2 class="section"><a href="ffmpeg-filters.html#toc-amerge-1">8.25 amerge</a></h2>
  2944. <p>Merge two or more audio streams into a single multi-channel stream.
  2945. </p>
  2946. <p>The filter accepts the following options:
  2947. </p>
  2948. <dl compact="compact">
  2949. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  2950. <dd><p>Set the number of inputs. Default is 2.
  2951. </p>
  2952. </dd>
  2953. </dl>
  2954. <p>If the channel layouts of the inputs are disjoint, and therefore compatible,
  2955. the channel layout of the output will be set accordingly and the channels
  2956. will be reordered as necessary. If the channel layouts of the inputs are not
  2957. disjoint, the output will have all the channels of the first input then all
  2958. the channels of the second input, in that order, and the channel layout of
  2959. the output will be the default value corresponding to the total number of
  2960. channels.
  2961. </p>
  2962. <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
  2963. is FC+BL+BR, then the output will be in 5.1, with the channels in the
  2964. following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
  2965. first input, b1 is the first channel of the second input).
  2966. </p>
  2967. <p>On the other hand, if both input are in stereo, the output channels will be
  2968. in the default order: a1, a2, b1, b2, and the channel layout will be
  2969. arbitrarily set to 4.0, which may or may not be the expected value.
  2970. </p>
  2971. <p>All inputs must have the same sample rate, and format.
  2972. </p>
  2973. <p>If inputs do not have the same duration, the output will stop with the
  2974. shortest.
  2975. </p>
  2976. <a name="Examples-2"></a>
  2977. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-2">8.25.1 Examples</a></h3>
  2978. <ul>
  2979. <li>
  2980. Merge two mono files into a stereo stream:
  2981. <div class="example">
  2982. <pre class="example">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
  2983. </pre></div>
  2984. </li><li>
  2985. Multiple merges assuming 1 video stream and 6 audio streams in &lsquo;<tt>input.mkv</tt>&rsquo;:
  2986. <div class="example">
  2987. <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
  2988. </pre></div>
  2989. </li></ul>
  2990. <a name="amix"></a>
  2991. <h2 class="section"><a href="ffmpeg-filters.html#toc-amix">8.26 amix</a></h2>
  2992. <p>Mixes multiple audio inputs into a single output.
  2993. </p>
  2994. <p>Note that this filter only supports float samples (the <var>amerge</var>
  2995. and <var>pan</var> audio filters support many formats). If the <var>amix</var>
  2996. input has integer samples then <a href="#aresample">aresample</a> will be automatically
  2997. inserted to perform the conversion to float samples.
  2998. </p>
  2999. <p>For example
  3000. </p><div class="example">
  3001. <pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
  3002. </pre></div>
  3003. <p>will mix 3 input audio streams to a single output with the same duration as the
  3004. first input and a dropout transition time of 3 seconds.
  3005. </p>
  3006. <p>It accepts the following parameters:
  3007. </p><dl compact="compact">
  3008. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  3009. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  3010. </p>
  3011. </dd>
  3012. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  3013. <dd><p>How to determine the end-of-stream.
  3014. </p><dl compact="compact">
  3015. <dt>&lsquo;<samp>longest</samp>&rsquo;</dt>
  3016. <dd><p>The duration of the longest input. (default)
  3017. </p>
  3018. </dd>
  3019. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  3020. <dd><p>The duration of the shortest input.
  3021. </p>
  3022. </dd>
  3023. <dt>&lsquo;<samp>first</samp>&rsquo;</dt>
  3024. <dd><p>The duration of the first input.
  3025. </p>
  3026. </dd>
  3027. </dl>
  3028. </dd>
  3029. <dt>&lsquo;<samp>dropout_transition</samp>&rsquo;</dt>
  3030. <dd><p>The transition time, in seconds, for volume renormalization when an input
  3031. stream ends. The default value is 2 seconds.
  3032. </p>
  3033. </dd>
  3034. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  3035. <dd><p>Specify weight of each input audio stream as sequence.
  3036. Each weight is separated by space. By default all inputs have same weight.
  3037. </p></dd>
  3038. </dl>
  3039. <a name="Commands-19"></a>
  3040. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-19">8.26.1 Commands</a></h3>
  3041. <p>This filter supports the following commands:
  3042. </p><dl compact="compact">
  3043. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  3044. <dd><p>Syntax is same as option with same name.
  3045. </p></dd>
  3046. </dl>
  3047. <a name="amultiply"></a>
  3048. <h2 class="section"><a href="ffmpeg-filters.html#toc-amultiply">8.27 amultiply</a></h2>
  3049. <p>Multiply first audio stream with second audio stream and store result
  3050. in output audio stream. Multiplication is done by multiplying each
  3051. sample from first stream with sample at same position from second stream.
  3052. </p>
  3053. <p>With this element-wise multiplication one can create amplitude fades and
  3054. amplitude modulations.
  3055. </p>
  3056. <a name="anequalizer"></a>
  3057. <h2 class="section"><a href="ffmpeg-filters.html#toc-anequalizer">8.28 anequalizer</a></h2>
  3058. <p>High-order parametric multiband equalizer for each channel.
  3059. </p>
  3060. <p>It accepts the following parameters:
  3061. </p><dl compact="compact">
  3062. <dt>&lsquo;<samp>params</samp>&rsquo;</dt>
  3063. <dd>
  3064. <p>This option string is in format:
  3065. &quot;c<var>chn</var> f=<var>cf</var> w=<var>w</var> g=<var>g</var> t=<var>f</var> | ...&quot;
  3066. Each equalizer band is separated by &rsquo;|&rsquo;.
  3067. </p>
  3068. <dl compact="compact">
  3069. <dt>&lsquo;<samp>chn</samp>&rsquo;</dt>
  3070. <dd><p>Set channel number to which equalization will be applied.
  3071. If input doesn&rsquo;t have that channel the entry is ignored.
  3072. </p>
  3073. </dd>
  3074. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  3075. <dd><p>Set central frequency for band.
  3076. If input doesn&rsquo;t have that frequency the entry is ignored.
  3077. </p>
  3078. </dd>
  3079. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  3080. <dd><p>Set band width in hertz.
  3081. </p>
  3082. </dd>
  3083. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  3084. <dd><p>Set band gain in dB.
  3085. </p>
  3086. </dd>
  3087. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  3088. <dd><p>Set filter type for band, optional, can be:
  3089. </p>
  3090. <dl compact="compact">
  3091. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  3092. <dd><p>Butterworth, this is default.
  3093. </p>
  3094. </dd>
  3095. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  3096. <dd><p>Chebyshev type 1.
  3097. </p>
  3098. </dd>
  3099. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  3100. <dd><p>Chebyshev type 2.
  3101. </p></dd>
  3102. </dl>
  3103. </dd>
  3104. </dl>
  3105. </dd>
  3106. <dt>&lsquo;<samp>curves</samp>&rsquo;</dt>
  3107. <dd><p>With this option activated frequency response of anequalizer is displayed
  3108. in video stream.
  3109. </p>
  3110. </dd>
  3111. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  3112. <dd><p>Set video stream size. Only useful if curves option is activated.
  3113. </p>
  3114. </dd>
  3115. <dt>&lsquo;<samp>mgain</samp>&rsquo;</dt>
  3116. <dd><p>Set max gain that will be displayed. Only useful if curves option is activated.
  3117. Setting this to a reasonable value makes it possible to display gain which is derived from
  3118. neighbour bands which are too close to each other and thus produce higher gain
  3119. when both are activated.
  3120. </p>
  3121. </dd>
  3122. <dt>&lsquo;<samp>fscale</samp>&rsquo;</dt>
  3123. <dd><p>Set frequency scale used to draw frequency response in video output.
  3124. Can be linear or logarithmic. Default is logarithmic.
  3125. </p>
  3126. </dd>
  3127. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  3128. <dd><p>Set color for each channel curve which is going to be displayed in video stream.
  3129. This is list of color names separated by space or by &rsquo;|&rsquo;.
  3130. Unrecognised or missing colors will be replaced by white color.
  3131. </p></dd>
  3132. </dl>
  3133. <a name="Examples-90"></a>
  3134. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-90">8.28.1 Examples</a></h3>
  3135. <ul>
  3136. <li>
  3137. Lower gain by 10 of central frequency 200Hz and width 100 Hz
  3138. for first 2 channels using Chebyshev type 1 filter:
  3139. <div class="example">
  3140. <pre class="example">anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
  3141. </pre></div>
  3142. </li></ul>
  3143. <a name="Commands-42"></a>
  3144. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-42">8.28.2 Commands</a></h3>
  3145. <p>This filter supports the following commands:
  3146. </p><dl compact="compact">
  3147. <dt>&lsquo;<samp>change</samp>&rsquo;</dt>
  3148. <dd><p>Alter existing filter parameters.
  3149. Syntax for the commands is : &quot;<var>fN</var>|f=<var>freq</var>|w=<var>width</var>|g=<var>gain</var>&quot;
  3150. </p>
  3151. <p><var>fN</var> is existing filter number, starting from 0, if no such filter is available
  3152. error is returned.
  3153. <var>freq</var> set new frequency parameter.
  3154. <var>width</var> set new width parameter in herz.
  3155. <var>gain</var> set new gain parameter in dB.
  3156. </p>
  3157. <p>Full filter invocation with asendcmd may look like this:
  3158. asendcmd=c=&rsquo;4.0 anequalizer change 0|f=200|w=50|g=1&rsquo;,anequalizer=...
  3159. </p></dd>
  3160. </dl>
  3161. <a name="anlmdn"></a>
  3162. <h2 class="section"><a href="ffmpeg-filters.html#toc-anlmdn">8.29 anlmdn</a></h2>
  3163. <p>Reduce broadband noise in audio samples using Non-Local Means algorithm.
  3164. </p>
  3165. <p>Each sample is adjusted by looking for other samples with similar contexts. This
  3166. context similarity is defined by comparing their surrounding patches of size
  3167. &lsquo;<samp>p</samp>&rsquo;. Patches are searched in an area of &lsquo;<samp>r</samp>&rsquo; around the sample.
  3168. </p>
  3169. <p>The filter accepts the following options:
  3170. </p>
  3171. <dl compact="compact">
  3172. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  3173. <dd><p>Set denoising strength. Allowed range is from 0.00001 to 10. Default value is 0.00001.
  3174. </p>
  3175. </dd>
  3176. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  3177. <dd><p>Set patch radius duration. Allowed range is from 1 to 100 milliseconds.
  3178. Default value is 2 milliseconds.
  3179. </p>
  3180. </dd>
  3181. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  3182. <dd><p>Set research radius duration. Allowed range is from 2 to 300 milliseconds.
  3183. Default value is 6 milliseconds.
  3184. </p>
  3185. </dd>
  3186. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  3187. <dd><p>Set the output mode.
  3188. </p>
  3189. <p>It accepts the following values:
  3190. </p><dl compact="compact">
  3191. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  3192. <dd><p>Pass input unchanged.
  3193. </p>
  3194. </dd>
  3195. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  3196. <dd><p>Pass noise filtered out.
  3197. </p>
  3198. </dd>
  3199. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  3200. <dd><p>Pass only noise.
  3201. </p>
  3202. <p>Default value is <var>o</var>.
  3203. </p></dd>
  3204. </dl>
  3205. </dd>
  3206. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  3207. <dd><p>Set smooth factor. Default value is <var>11</var>. Allowed range is from <var>1</var> to <var>15</var>.
  3208. </p></dd>
  3209. </dl>
  3210. <a name="Commands-69"></a>
  3211. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-69">8.29.1 Commands</a></h3>
  3212. <p>This filter supports the following commands:
  3213. </p><dl compact="compact">
  3214. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  3215. <dd><p>Change denoise strength. Argument is single float number.
  3216. Syntax for the command is : &quot;<var>s</var>&quot;
  3217. </p>
  3218. </dd>
  3219. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  3220. <dd><p>Change output mode.
  3221. Syntax for the command is : &quot;i&quot;, &quot;o&quot; or &quot;n&quot; string.
  3222. </p></dd>
  3223. </dl>
  3224. <a name="anlms"></a>
  3225. <h2 class="section"><a href="ffmpeg-filters.html#toc-anlms">8.30 anlms</a></h2>
  3226. <p>Apply Normalized Least-Mean-Squares algorithm to the first audio stream using the second audio stream.
  3227. </p>
  3228. <p>This adaptive filter is used to mimic a desired filter by finding the filter coefficients that
  3229. relate to producing the least mean square of the error signal (difference between the desired,
  3230. 2nd input audio stream and the actual signal, the 1st input audio stream).
  3231. </p>
  3232. <p>A description of the accepted options follows.
  3233. </p>
  3234. <dl compact="compact">
  3235. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  3236. <dd><p>Set filter order.
  3237. </p>
  3238. </dd>
  3239. <dt>&lsquo;<samp>mu</samp>&rsquo;</dt>
  3240. <dd><p>Set filter mu.
  3241. </p>
  3242. </dd>
  3243. <dt>&lsquo;<samp>eps</samp>&rsquo;</dt>
  3244. <dd><p>Set the filter eps.
  3245. </p>
  3246. </dd>
  3247. <dt>&lsquo;<samp>leakage</samp>&rsquo;</dt>
  3248. <dd><p>Set the filter leakage.
  3249. </p>
  3250. </dd>
  3251. <dt>&lsquo;<samp>out_mode</samp>&rsquo;</dt>
  3252. <dd><p>It accepts the following values:
  3253. </p><dl compact="compact">
  3254. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  3255. <dd><p>Pass the 1st input.
  3256. </p>
  3257. </dd>
  3258. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  3259. <dd><p>Pass the 2nd input.
  3260. </p>
  3261. </dd>
  3262. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  3263. <dd><p>Pass filtered samples.
  3264. </p>
  3265. </dd>
  3266. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  3267. <dd><p>Pass difference between desired and filtered samples.
  3268. </p>
  3269. <p>Default value is <var>o</var>.
  3270. </p></dd>
  3271. </dl>
  3272. </dd>
  3273. </dl>
  3274. <a name="Examples-44"></a>
  3275. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-44">8.30.1 Examples</a></h3>
  3276. <ul>
  3277. <li>
  3278. One of many usages of this filter is noise reduction, input audio is filtered
  3279. with same samples that are delayed by fixed amount, one such example for stereo audio is:
  3280. <div class="example">
  3281. <pre class="example">asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
  3282. </pre></div>
  3283. </li></ul>
  3284. <a name="Commands-27"></a>
  3285. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-27">8.30.2 Commands</a></h3>
  3286. <p>This filter supports the same commands as options, excluding option <code>order</code>.
  3287. </p>
  3288. <a name="anull"></a>
  3289. <h2 class="section"><a href="ffmpeg-filters.html#toc-anull">8.31 anull</a></h2>
  3290. <p>Pass the audio source unchanged to the output.
  3291. </p>
  3292. <a name="apad"></a>
  3293. <h2 class="section"><a href="ffmpeg-filters.html#toc-apad">8.32 apad</a></h2>
  3294. <p>Pad the end of an audio stream with silence.
  3295. </p>
  3296. <p>This can be used together with <code>ffmpeg</code> &lsquo;<samp>-shortest</samp>&rsquo; to
  3297. extend audio streams to the same length as the video stream.
  3298. </p>
  3299. <p>A description of the accepted options follows.
  3300. </p>
  3301. <dl compact="compact">
  3302. <dt>&lsquo;<samp>packet_size</samp>&rsquo;</dt>
  3303. <dd><p>Set silence packet size. Default value is 4096.
  3304. </p>
  3305. </dd>
  3306. <dt>&lsquo;<samp>pad_len</samp>&rsquo;</dt>
  3307. <dd><p>Set the number of samples of silence to add to the end. After the
  3308. value is reached, the stream is terminated. This option is mutually
  3309. exclusive with &lsquo;<samp>whole_len</samp>&rsquo;.
  3310. </p>
  3311. </dd>
  3312. <dt>&lsquo;<samp>whole_len</samp>&rsquo;</dt>
  3313. <dd><p>Set the minimum total number of samples in the output audio stream. If
  3314. the value is longer than the input audio length, silence is added to
  3315. the end, until the value is reached. This option is mutually exclusive
  3316. with &lsquo;<samp>pad_len</samp>&rsquo;.
  3317. </p>
  3318. </dd>
  3319. <dt>&lsquo;<samp>pad_dur</samp>&rsquo;</dt>
  3320. <dd><p>Specify the duration of samples of silence to add. See
  3321. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  3322. for the accepted syntax. Used only if set to non-zero value.
  3323. </p>
  3324. </dd>
  3325. <dt>&lsquo;<samp>whole_dur</samp>&rsquo;</dt>
  3326. <dd><p>Specify the minimum total duration in the output audio stream. See
  3327. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  3328. for the accepted syntax. Used only if set to non-zero value. If the value is longer than
  3329. the input audio length, silence is added to the end, until the value is reached.
  3330. This option is mutually exclusive with &lsquo;<samp>pad_dur</samp>&rsquo;
  3331. </p></dd>
  3332. </dl>
  3333. <p>If neither the &lsquo;<samp>pad_len</samp>&rsquo; nor the &lsquo;<samp>whole_len</samp>&rsquo; nor &lsquo;<samp>pad_dur</samp>&rsquo;
  3334. nor &lsquo;<samp>whole_dur</samp>&rsquo; option is set, the filter will add silence to the end of
  3335. the input stream indefinitely.
  3336. </p>
  3337. <a name="Examples-77"></a>
  3338. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-77">8.32.1 Examples</a></h3>
  3339. <ul>
  3340. <li>
  3341. Add 1024 samples of silence to the end of the input:
  3342. <div class="example">
  3343. <pre class="example">apad=pad_len=1024
  3344. </pre></div>
  3345. </li><li>
  3346. Make sure the audio output will contain at least 10000 samples, pad
  3347. the input with silence if required:
  3348. <div class="example">
  3349. <pre class="example">apad=whole_len=10000
  3350. </pre></div>
  3351. </li><li>
  3352. Use <code>ffmpeg</code> to pad the audio input with silence, so that the
  3353. video stream will always result the shortest and will be converted
  3354. until the end in the output file when using the &lsquo;<samp>shortest</samp>&rsquo;
  3355. option:
  3356. <div class="example">
  3357. <pre class="example">ffmpeg -i VIDEO -i AUDIO -filter_complex &quot;[1:0]apad&quot; -shortest OUTPUT
  3358. </pre></div>
  3359. </li></ul>
  3360. <a name="aphaser"></a>
  3361. <h2 class="section"><a href="ffmpeg-filters.html#toc-aphaser">8.33 aphaser</a></h2>
  3362. <p>Add a phasing effect to the input audio.
  3363. </p>
  3364. <p>A phaser filter creates series of peaks and troughs in the frequency spectrum.
  3365. The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
  3366. </p>
  3367. <p>A description of the accepted parameters follows.
  3368. </p>
  3369. <dl compact="compact">
  3370. <dt>&lsquo;<samp>in_gain</samp>&rsquo;</dt>
  3371. <dd><p>Set input gain. Default is 0.4.
  3372. </p>
  3373. </dd>
  3374. <dt>&lsquo;<samp>out_gain</samp>&rsquo;</dt>
  3375. <dd><p>Set output gain. Default is 0.74
  3376. </p>
  3377. </dd>
  3378. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  3379. <dd><p>Set delay in milliseconds. Default is 3.0.
  3380. </p>
  3381. </dd>
  3382. <dt>&lsquo;<samp>decay</samp>&rsquo;</dt>
  3383. <dd><p>Set decay. Default is 0.4.
  3384. </p>
  3385. </dd>
  3386. <dt>&lsquo;<samp>speed</samp>&rsquo;</dt>
  3387. <dd><p>Set modulation speed in Hz. Default is 0.5.
  3388. </p>
  3389. </dd>
  3390. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  3391. <dd><p>Set modulation type. Default is triangular.
  3392. </p>
  3393. <p>It accepts the following values:
  3394. </p><dl compact="compact">
  3395. <dt>&lsquo;<samp>triangular, t</samp>&rsquo;</dt>
  3396. <dt>&lsquo;<samp>sinusoidal, s</samp>&rsquo;</dt>
  3397. </dl>
  3398. </dd>
  3399. </dl>
  3400. <a name="apulsator"></a>
  3401. <h2 class="section"><a href="ffmpeg-filters.html#toc-apulsator">8.34 apulsator</a></h2>
  3402. <p>Audio pulsator is something between an autopanner and a tremolo.
  3403. But it can produce funny stereo effects as well. Pulsator changes the volume
  3404. of the left and right channel based on a LFO (low frequency oscillator) with
  3405. different waveforms and shifted phases.
  3406. This filter have the ability to define an offset between left and right
  3407. channel. An offset of 0 means that both LFO shapes match each other.
  3408. The left and right channel are altered equally - a conventional tremolo.
  3409. An offset of 50% means that the shape of the right channel is exactly shifted
  3410. in phase (or moved backwards about half of the frequency) - pulsator acts as
  3411. an autopanner. At 1 both curves match again. Every setting in between moves the
  3412. phase shift gapless between all stages and produces some &quot;bypassing&quot; sounds with
  3413. sine and triangle waveforms. The more you set the offset near 1 (starting from
  3414. the 0.5) the faster the signal passes from the left to the right speaker.
  3415. </p>
  3416. <p>The filter accepts the following options:
  3417. </p>
  3418. <dl compact="compact">
  3419. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  3420. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  3421. </p>
  3422. </dd>
  3423. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  3424. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  3425. </p>
  3426. </dd>
  3427. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  3428. <dd><p>Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
  3429. sawup or sawdown. Default is sine.
  3430. </p>
  3431. </dd>
  3432. <dt>&lsquo;<samp>amount</samp>&rsquo;</dt>
  3433. <dd><p>Set modulation. Define how much of original signal is affected by the LFO.
  3434. </p>
  3435. </dd>
  3436. <dt>&lsquo;<samp>offset_l</samp>&rsquo;</dt>
  3437. <dd><p>Set left channel offset. Default is 0. Allowed range is [0 - 1].
  3438. </p>
  3439. </dd>
  3440. <dt>&lsquo;<samp>offset_r</samp>&rsquo;</dt>
  3441. <dd><p>Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
  3442. </p>
  3443. </dd>
  3444. <dt>&lsquo;<samp>width</samp>&rsquo;</dt>
  3445. <dd><p>Set pulse width. Default is 1. Allowed range is [0 - 2].
  3446. </p>
  3447. </dd>
  3448. <dt>&lsquo;<samp>timing</samp>&rsquo;</dt>
  3449. <dd><p>Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
  3450. </p>
  3451. </dd>
  3452. <dt>&lsquo;<samp>bpm</samp>&rsquo;</dt>
  3453. <dd><p>Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
  3454. is set to bpm.
  3455. </p>
  3456. </dd>
  3457. <dt>&lsquo;<samp>ms</samp>&rsquo;</dt>
  3458. <dd><p>Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
  3459. is set to ms.
  3460. </p>
  3461. </dd>
  3462. <dt>&lsquo;<samp>hz</samp>&rsquo;</dt>
  3463. <dd><p>Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
  3464. if timing is set to hz.
  3465. </p></dd>
  3466. </dl>
  3467. <p><a name="aresample"></a>
  3468. </p><a name="aresample-1"></a>
  3469. <h2 class="section"><a href="ffmpeg-filters.html#toc-aresample-1">8.35 aresample</a></h2>
  3470. <p>Resample the input audio to the specified parameters, using the
  3471. libswresample library. If none are specified then the filter will
  3472. automatically convert between its input and output.
  3473. </p>
  3474. <p>This filter is also able to stretch/squeeze the audio data to make it match
  3475. the timestamps or to inject silence / cut out audio to make it match the
  3476. timestamps, do a combination of both or do neither.
  3477. </p>
  3478. <p>The filter accepts the syntax
  3479. [<var>sample_rate</var>:]<var>resampler_options</var>, where <var>sample_rate</var>
  3480. expresses a sample rate and <var>resampler_options</var> is a list of
  3481. <var>key</var>=<var>value</var> pairs, separated by &quot;:&quot;. See the
  3482. <a href="ffmpeg-resampler.html#Resampler-Options">(ffmpeg-resampler)&quot;Resampler Options&quot; section in the ffmpeg-resampler(1) manual</a>
  3483. for the complete list of supported options.
  3484. </p>
  3485. <a name="Examples-13"></a>
  3486. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-13">8.35.1 Examples</a></h3>
  3487. <ul>
  3488. <li>
  3489. Resample the input audio to 44100Hz:
  3490. <div class="example">
  3491. <pre class="example">aresample=44100
  3492. </pre></div>
  3493. </li><li>
  3494. Stretch/squeeze samples to the given timestamps, with a maximum of 1000
  3495. samples per second compensation:
  3496. <div class="example">
  3497. <pre class="example">aresample=async=1000
  3498. </pre></div>
  3499. </li></ul>
  3500. <a name="areverse"></a>
  3501. <h2 class="section"><a href="ffmpeg-filters.html#toc-areverse">8.36 areverse</a></h2>
  3502. <p>Reverse an audio clip.
  3503. </p>
  3504. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  3505. is suggested.
  3506. </p>
  3507. <a name="Examples-124"></a>
  3508. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-124">8.36.1 Examples</a></h3>
  3509. <ul>
  3510. <li>
  3511. Take the first 5 seconds of a clip, and reverse it.
  3512. <div class="example">
  3513. <pre class="example">atrim=end=5,areverse
  3514. </pre></div>
  3515. </li></ul>
  3516. <a name="arnndn"></a>
  3517. <h2 class="section"><a href="ffmpeg-filters.html#toc-arnndn">8.37 arnndn</a></h2>
  3518. <p>Reduce noise from speech using Recurrent Neural Networks.
  3519. </p>
  3520. <p>This filter accepts the following options:
  3521. </p>
  3522. <dl compact="compact">
  3523. <dt>&lsquo;<samp>model, m</samp>&rsquo;</dt>
  3524. <dd><p>Set train model file to load. This option is always required.
  3525. </p></dd>
  3526. </dl>
  3527. <a name="asetnsamples"></a>
  3528. <h2 class="section"><a href="ffmpeg-filters.html#toc-asetnsamples">8.38 asetnsamples</a></h2>
  3529. <p>Set the number of samples per each output audio frame.
  3530. </p>
  3531. <p>The last output packet may contain a different number of samples, as
  3532. the filter will flush all the remaining samples when the input audio
  3533. signals its end.
  3534. </p>
  3535. <p>The filter accepts the following options:
  3536. </p>
  3537. <dl compact="compact">
  3538. <dt>&lsquo;<samp>nb_out_samples, n</samp>&rsquo;</dt>
  3539. <dd><p>Set the number of frames per each output audio frame. The number is
  3540. intended as the number of samples <em>per each channel</em>.
  3541. Default value is 1024.
  3542. </p>
  3543. </dd>
  3544. <dt>&lsquo;<samp>pad, p</samp>&rsquo;</dt>
  3545. <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
  3546. that the last frame will contain the same number of samples as the
  3547. previous ones. Default value is 1.
  3548. </p></dd>
  3549. </dl>
  3550. <p>For example, to set the number of per-frame samples to 1234 and
  3551. disable padding for the last frame, use:
  3552. </p><div class="example">
  3553. <pre class="example">asetnsamples=n=1234:p=0
  3554. </pre></div>
  3555. <a name="asetrate"></a>
  3556. <h2 class="section"><a href="ffmpeg-filters.html#toc-asetrate">8.39 asetrate</a></h2>
  3557. <p>Set the sample rate without altering the PCM data.
  3558. This will result in a change of speed and pitch.
  3559. </p>
  3560. <p>The filter accepts the following options:
  3561. </p>
  3562. <dl compact="compact">
  3563. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  3564. <dd><p>Set the output sample rate. Default is 44100 Hz.
  3565. </p></dd>
  3566. </dl>
  3567. <a name="ashowinfo"></a>
  3568. <h2 class="section"><a href="ffmpeg-filters.html#toc-ashowinfo">8.40 ashowinfo</a></h2>
  3569. <p>Show a line containing various information for each input audio frame.
  3570. The input audio is not modified.
  3571. </p>
  3572. <p>The shown line contains a sequence of key/value pairs of the form
  3573. <var>key</var>:<var>value</var>.
  3574. </p>
  3575. <p>The following values are shown in the output:
  3576. </p>
  3577. <dl compact="compact">
  3578. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  3579. <dd><p>The (sequential) number of the input frame, starting from 0.
  3580. </p>
  3581. </dd>
  3582. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  3583. <dd><p>The presentation timestamp of the input frame, in time base units; the time base
  3584. depends on the filter input pad, and is usually 1/<var>sample_rate</var>.
  3585. </p>
  3586. </dd>
  3587. <dt>&lsquo;<samp>pts_time</samp>&rsquo;</dt>
  3588. <dd><p>The presentation timestamp of the input frame in seconds.
  3589. </p>
  3590. </dd>
  3591. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  3592. <dd><p>position of the frame in the input stream, -1 if this information in
  3593. unavailable and/or meaningless (for example in case of synthetic audio)
  3594. </p>
  3595. </dd>
  3596. <dt>&lsquo;<samp>fmt</samp>&rsquo;</dt>
  3597. <dd><p>The sample format.
  3598. </p>
  3599. </dd>
  3600. <dt>&lsquo;<samp>chlayout</samp>&rsquo;</dt>
  3601. <dd><p>The channel layout.
  3602. </p>
  3603. </dd>
  3604. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  3605. <dd><p>The sample rate for the audio frame.
  3606. </p>
  3607. </dd>
  3608. <dt>&lsquo;<samp>nb_samples</samp>&rsquo;</dt>
  3609. <dd><p>The number of samples (per channel) in the frame.
  3610. </p>
  3611. </dd>
  3612. <dt>&lsquo;<samp>checksum</samp>&rsquo;</dt>
  3613. <dd><p>The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
  3614. audio, the data is treated as if all the planes were concatenated.
  3615. </p>
  3616. </dd>
  3617. <dt>&lsquo;<samp>plane_checksums</samp>&rsquo;</dt>
  3618. <dd><p>A list of Adler-32 checksums for each data plane.
  3619. </p></dd>
  3620. </dl>
  3621. <a name="asoftclip"></a>
  3622. <h2 class="section"><a href="ffmpeg-filters.html#toc-asoftclip">8.41 asoftclip</a></h2>
  3623. <p>Apply audio soft clipping.
  3624. </p>
  3625. <p>Soft clipping is a type of distortion effect where the amplitude of a signal is saturated
  3626. along a smooth curve, rather than the abrupt shape of hard-clipping.
  3627. </p>
  3628. <p>This filter accepts the following options:
  3629. </p>
  3630. <dl compact="compact">
  3631. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  3632. <dd><p>Set type of soft-clipping.
  3633. </p>
  3634. <p>It accepts the following values:
  3635. </p><dl compact="compact">
  3636. <dt>&lsquo;<samp>tanh</samp>&rsquo;</dt>
  3637. <dt>&lsquo;<samp>atan</samp>&rsquo;</dt>
  3638. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  3639. <dt>&lsquo;<samp>exp</samp>&rsquo;</dt>
  3640. <dt>&lsquo;<samp>alg</samp>&rsquo;</dt>
  3641. <dt>&lsquo;<samp>quintic</samp>&rsquo;</dt>
  3642. <dt>&lsquo;<samp>sin</samp>&rsquo;</dt>
  3643. </dl>
  3644. </dd>
  3645. <dt>&lsquo;<samp>param</samp>&rsquo;</dt>
  3646. <dd><p>Set additional parameter which controls sigmoid function.
  3647. </p></dd>
  3648. </dl>
  3649. <a name="Commands-29"></a>
  3650. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-29">8.41.1 Commands</a></h3>
  3651. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  3652. </p>
  3653. <a name="asr"></a>
  3654. <h2 class="section"><a href="ffmpeg-filters.html#toc-asr">8.42 asr</a></h2>
  3655. <p>Automatic Speech Recognition
  3656. </p>
  3657. <p>This filter uses PocketSphinx for speech recognition. To enable
  3658. compilation of this filter, you need to configure FFmpeg with
  3659. <code>--enable-pocketsphinx</code>.
  3660. </p>
  3661. <p>It accepts the following options:
  3662. </p>
  3663. <dl compact="compact">
  3664. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  3665. <dd><p>Set sampling rate of input audio. Defaults is <code>16000</code>.
  3666. This need to match speech models, otherwise one will get poor results.
  3667. </p>
  3668. </dd>
  3669. <dt>&lsquo;<samp>hmm</samp>&rsquo;</dt>
  3670. <dd><p>Set dictionary containing acoustic model files.
  3671. </p>
  3672. </dd>
  3673. <dt>&lsquo;<samp>dict</samp>&rsquo;</dt>
  3674. <dd><p>Set pronunciation dictionary.
  3675. </p>
  3676. </dd>
  3677. <dt>&lsquo;<samp>lm</samp>&rsquo;</dt>
  3678. <dd><p>Set language model file.
  3679. </p>
  3680. </dd>
  3681. <dt>&lsquo;<samp>lmctl</samp>&rsquo;</dt>
  3682. <dd><p>Set language model set.
  3683. </p>
  3684. </dd>
  3685. <dt>&lsquo;<samp>lmname</samp>&rsquo;</dt>
  3686. <dd><p>Set which language model to use.
  3687. </p>
  3688. </dd>
  3689. <dt>&lsquo;<samp>logfn</samp>&rsquo;</dt>
  3690. <dd><p>Set output for log messages.
  3691. </p></dd>
  3692. </dl>
  3693. <p>The filter exports recognized speech as the frame metadata <code>lavfi.asr.text</code>.
  3694. </p>
  3695. <p><a name="astats"></a>
  3696. </p><a name="astats-1"></a>
  3697. <h2 class="section"><a href="ffmpeg-filters.html#toc-astats-1">8.43 astats</a></h2>
  3698. <p>Display time domain statistical information about the audio channels.
  3699. Statistics are calculated and displayed for each audio channel and,
  3700. where applicable, an overall figure is also given.
  3701. </p>
  3702. <p>It accepts the following option:
  3703. </p><dl compact="compact">
  3704. <dt>&lsquo;<samp>length</samp>&rsquo;</dt>
  3705. <dd><p>Short window length in seconds, used for peak and trough RMS measurement.
  3706. Default is <code>0.05</code> (50 milliseconds). Allowed range is <code>[0.01 - 10]</code>.
  3707. </p>
  3708. </dd>
  3709. <dt>&lsquo;<samp>metadata</samp>&rsquo;</dt>
  3710. <dd>
  3711. <p>Set metadata injection. All the metadata keys are prefixed with <code>lavfi.astats.X</code>,
  3712. where <code>X</code> is channel number starting from 1 or string <code>Overall</code>. Default is
  3713. disabled.
  3714. </p>
  3715. <p>Available keys for each channel are:
  3716. DC_offset
  3717. Min_level
  3718. Max_level
  3719. Min_difference
  3720. Max_difference
  3721. Mean_difference
  3722. RMS_difference
  3723. Peak_level
  3724. RMS_peak
  3725. RMS_trough
  3726. Crest_factor
  3727. Flat_factor
  3728. Peak_count
  3729. Noise_floor
  3730. Noise_floor_count
  3731. Bit_depth
  3732. Dynamic_range
  3733. Zero_crossings
  3734. Zero_crossings_rate
  3735. Number_of_NaNs
  3736. Number_of_Infs
  3737. Number_of_denormals
  3738. </p>
  3739. <p>and for Overall:
  3740. DC_offset
  3741. Min_level
  3742. Max_level
  3743. Min_difference
  3744. Max_difference
  3745. Mean_difference
  3746. RMS_difference
  3747. Peak_level
  3748. RMS_level
  3749. RMS_peak
  3750. RMS_trough
  3751. Flat_factor
  3752. Peak_count
  3753. Noise_floor
  3754. Noise_floor_count
  3755. Bit_depth
  3756. Number_of_samples
  3757. Number_of_NaNs
  3758. Number_of_Infs
  3759. Number_of_denormals
  3760. </p>
  3761. <p>For example full key look like this <code>lavfi.astats.1.DC_offset</code> or
  3762. this <code>lavfi.astats.Overall.Peak_count</code>.
  3763. </p>
  3764. <p>For description what each key means read below.
  3765. </p>
  3766. </dd>
  3767. <dt>&lsquo;<samp>reset</samp>&rsquo;</dt>
  3768. <dd><p>Set number of frame after which stats are going to be recalculated.
  3769. Default is disabled.
  3770. </p>
  3771. </dd>
  3772. <dt>&lsquo;<samp>measure_perchannel</samp>&rsquo;</dt>
  3773. <dd><p>Select the entries which need to be measured per channel. The metadata keys can
  3774. be used as flags, default is &lsquo;<samp>all</samp>&rsquo; which measures everything.
  3775. &lsquo;<samp>none</samp>&rsquo; disables all per channel measurement.
  3776. </p>
  3777. </dd>
  3778. <dt>&lsquo;<samp>measure_overall</samp>&rsquo;</dt>
  3779. <dd><p>Select the entries which need to be measured overall. The metadata keys can
  3780. be used as flags, default is &lsquo;<samp>all</samp>&rsquo; which measures everything.
  3781. &lsquo;<samp>none</samp>&rsquo; disables all overall measurement.
  3782. </p>
  3783. </dd>
  3784. </dl>
  3785. <p>A description of each shown parameter follows:
  3786. </p>
  3787. <dl compact="compact">
  3788. <dt>&lsquo;<samp>DC offset</samp>&rsquo;</dt>
  3789. <dd><p>Mean amplitude displacement from zero.
  3790. </p>
  3791. </dd>
  3792. <dt>&lsquo;<samp>Min level</samp>&rsquo;</dt>
  3793. <dd><p>Minimal sample level.
  3794. </p>
  3795. </dd>
  3796. <dt>&lsquo;<samp>Max level</samp>&rsquo;</dt>
  3797. <dd><p>Maximal sample level.
  3798. </p>
  3799. </dd>
  3800. <dt>&lsquo;<samp>Min difference</samp>&rsquo;</dt>
  3801. <dd><p>Minimal difference between two consecutive samples.
  3802. </p>
  3803. </dd>
  3804. <dt>&lsquo;<samp>Max difference</samp>&rsquo;</dt>
  3805. <dd><p>Maximal difference between two consecutive samples.
  3806. </p>
  3807. </dd>
  3808. <dt>&lsquo;<samp>Mean difference</samp>&rsquo;</dt>
  3809. <dd><p>Mean difference between two consecutive samples.
  3810. The average of each difference between two consecutive samples.
  3811. </p>
  3812. </dd>
  3813. <dt>&lsquo;<samp>RMS difference</samp>&rsquo;</dt>
  3814. <dd><p>Root Mean Square difference between two consecutive samples.
  3815. </p>
  3816. </dd>
  3817. <dt>&lsquo;<samp>Peak level dB</samp>&rsquo;</dt>
  3818. <dt>&lsquo;<samp>RMS level dB</samp>&rsquo;</dt>
  3819. <dd><p>Standard peak and RMS level measured in dBFS.
  3820. </p>
  3821. </dd>
  3822. <dt>&lsquo;<samp>RMS peak dB</samp>&rsquo;</dt>
  3823. <dt>&lsquo;<samp>RMS trough dB</samp>&rsquo;</dt>
  3824. <dd><p>Peak and trough values for RMS level measured over a short window.
  3825. </p>
  3826. </dd>
  3827. <dt>&lsquo;<samp>Crest factor</samp>&rsquo;</dt>
  3828. <dd><p>Standard ratio of peak to RMS level (note: not in dB).
  3829. </p>
  3830. </dd>
  3831. <dt>&lsquo;<samp>Flat factor</samp>&rsquo;</dt>
  3832. <dd><p>Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
  3833. (i.e. either <var>Min level</var> or <var>Max level</var>).
  3834. </p>
  3835. </dd>
  3836. <dt>&lsquo;<samp>Peak count</samp>&rsquo;</dt>
  3837. <dd><p>Number of occasions (not the number of samples) that the signal attained either
  3838. <var>Min level</var> or <var>Max level</var>.
  3839. </p>
  3840. </dd>
  3841. <dt>&lsquo;<samp>Noise floor dB</samp>&rsquo;</dt>
  3842. <dd><p>Minimum local peak measured in dBFS over a short window.
  3843. </p>
  3844. </dd>
  3845. <dt>&lsquo;<samp>Noise floor count</samp>&rsquo;</dt>
  3846. <dd><p>Number of occasions (not the number of samples) that the signal attained
  3847. <var>Noise floor</var>.
  3848. </p>
  3849. </dd>
  3850. <dt>&lsquo;<samp>Bit depth</samp>&rsquo;</dt>
  3851. <dd><p>Overall bit depth of audio. Number of bits used for each sample.
  3852. </p>
  3853. </dd>
  3854. <dt>&lsquo;<samp>Dynamic range</samp>&rsquo;</dt>
  3855. <dd><p>Measured dynamic range of audio in dB.
  3856. </p>
  3857. </dd>
  3858. <dt>&lsquo;<samp>Zero crossings</samp>&rsquo;</dt>
  3859. <dd><p>Number of points where the waveform crosses the zero level axis.
  3860. </p>
  3861. </dd>
  3862. <dt>&lsquo;<samp>Zero crossings rate</samp>&rsquo;</dt>
  3863. <dd><p>Rate of Zero crossings and number of audio samples.
  3864. </p></dd>
  3865. </dl>
  3866. <a name="asubboost"></a>
  3867. <h2 class="section"><a href="ffmpeg-filters.html#toc-asubboost">8.44 asubboost</a></h2>
  3868. <p>Boost subwoofer frequencies.
  3869. </p>
  3870. <p>The filter accepts the following options:
  3871. </p>
  3872. <dl compact="compact">
  3873. <dt>&lsquo;<samp>dry</samp>&rsquo;</dt>
  3874. <dd><p>Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1.
  3875. Default value is 0.5.
  3876. </p>
  3877. </dd>
  3878. <dt>&lsquo;<samp>wet</samp>&rsquo;</dt>
  3879. <dd><p>Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1.
  3880. Default value is 0.8.
  3881. </p>
  3882. </dd>
  3883. <dt>&lsquo;<samp>decay</samp>&rsquo;</dt>
  3884. <dd><p>Set delay line decay gain value. Allowed range is from 0 to 1.
  3885. Default value is 0.7.
  3886. </p>
  3887. </dd>
  3888. <dt>&lsquo;<samp>feedback</samp>&rsquo;</dt>
  3889. <dd><p>Set delay line feedback gain value. Allowed range is from 0 to 1.
  3890. Default value is 0.5.
  3891. </p>
  3892. </dd>
  3893. <dt>&lsquo;<samp>cutoff</samp>&rsquo;</dt>
  3894. <dd><p>Set cutoff frequency in herz. Allowed range is 50 to 900.
  3895. Default value is 100.
  3896. </p>
  3897. </dd>
  3898. <dt>&lsquo;<samp>slope</samp>&rsquo;</dt>
  3899. <dd><p>Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1.
  3900. Default value is 0.5.
  3901. </p>
  3902. </dd>
  3903. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  3904. <dd><p>Set delay. Allowed range is from 1 to 100.
  3905. Default value is 20.
  3906. </p></dd>
  3907. </dl>
  3908. <a name="Commands-3"></a>
  3909. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-3">8.44.1 Commands</a></h3>
  3910. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  3911. </p>
  3912. <a name="atempo"></a>
  3913. <h2 class="section"><a href="ffmpeg-filters.html#toc-atempo">8.45 atempo</a></h2>
  3914. <p>Adjust audio tempo.
  3915. </p>
  3916. <p>The filter accepts exactly one parameter, the audio tempo. If not
  3917. specified then the filter will assume nominal 1.0 tempo. Tempo must
  3918. be in the [0.5, 100.0] range.
  3919. </p>
  3920. <p>Note that tempo greater than 2 will skip some samples rather than
  3921. blend them in. If for any reason this is a concern it is always
  3922. possible to daisy-chain several instances of atempo to achieve the
  3923. desired product tempo.
  3924. </p>
  3925. <a name="Examples-84"></a>
  3926. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-84">8.45.1 Examples</a></h3>
  3927. <ul>
  3928. <li>
  3929. Slow down audio to 80% tempo:
  3930. <div class="example">
  3931. <pre class="example">atempo=0.8
  3932. </pre></div>
  3933. </li><li>
  3934. To speed up audio to 300% tempo:
  3935. <div class="example">
  3936. <pre class="example">atempo=3
  3937. </pre></div>
  3938. </li><li>
  3939. To speed up audio to 300% tempo by daisy-chaining two atempo instances:
  3940. <div class="example">
  3941. <pre class="example">atempo=sqrt(3),atempo=sqrt(3)
  3942. </pre></div>
  3943. </li></ul>
  3944. <a name="Commands-64"></a>
  3945. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-64">8.45.2 Commands</a></h3>
  3946. <p>This filter supports the following commands:
  3947. </p><dl compact="compact">
  3948. <dt>&lsquo;<samp>tempo</samp>&rsquo;</dt>
  3949. <dd><p>Change filter tempo scale factor.
  3950. Syntax for the command is : &quot;<var>tempo</var>&quot;
  3951. </p></dd>
  3952. </dl>
  3953. <a name="atrim"></a>
  3954. <h2 class="section"><a href="ffmpeg-filters.html#toc-atrim">8.46 atrim</a></h2>
  3955. <p>Trim the input so that the output contains one continuous subpart of the input.
  3956. </p>
  3957. <p>It accepts the following parameters:
  3958. </p><dl compact="compact">
  3959. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  3960. <dd><p>Timestamp (in seconds) of the start of the section to keep. I.e. the audio
  3961. sample with the timestamp <var>start</var> will be the first sample in the output.
  3962. </p>
  3963. </dd>
  3964. <dt>&lsquo;<samp>end</samp>&rsquo;</dt>
  3965. <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
  3966. audio sample immediately preceding the one with the timestamp <var>end</var> will be
  3967. the last sample in the output.
  3968. </p>
  3969. </dd>
  3970. <dt>&lsquo;<samp>start_pts</samp>&rsquo;</dt>
  3971. <dd><p>Same as <var>start</var>, except this option sets the start timestamp in samples
  3972. instead of seconds.
  3973. </p>
  3974. </dd>
  3975. <dt>&lsquo;<samp>end_pts</samp>&rsquo;</dt>
  3976. <dd><p>Same as <var>end</var>, except this option sets the end timestamp in samples instead
  3977. of seconds.
  3978. </p>
  3979. </dd>
  3980. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  3981. <dd><p>The maximum duration of the output in seconds.
  3982. </p>
  3983. </dd>
  3984. <dt>&lsquo;<samp>start_sample</samp>&rsquo;</dt>
  3985. <dd><p>The number of the first sample that should be output.
  3986. </p>
  3987. </dd>
  3988. <dt>&lsquo;<samp>end_sample</samp>&rsquo;</dt>
  3989. <dd><p>The number of the first sample that should be dropped.
  3990. </p></dd>
  3991. </dl>
  3992. <p>&lsquo;<samp>start</samp>&rsquo;, &lsquo;<samp>end</samp>&rsquo;, and &lsquo;<samp>duration</samp>&rsquo; are expressed as time
  3993. duration specifications; see
  3994. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  3995. </p>
  3996. <p>Note that the first two sets of the start/end options and the &lsquo;<samp>duration</samp>&rsquo;
  3997. option look at the frame timestamp, while the _sample options simply count the
  3998. samples that pass through the filter. So start/end_pts and start/end_sample will
  3999. give different results when the timestamps are wrong, inexact or do not start at
  4000. zero. Also note that this filter does not modify the timestamps. If you wish
  4001. to have the output timestamps start at zero, insert the asetpts filter after the
  4002. atrim filter.
  4003. </p>
  4004. <p>If multiple start or end options are set, this filter tries to be greedy and
  4005. keep all samples that match at least one of the specified constraints. To keep
  4006. only the part that matches all the constraints at once, chain multiple atrim
  4007. filters.
  4008. </p>
  4009. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  4010. just the end values to keep everything before the specified time.
  4011. </p>
  4012. <p>Examples:
  4013. </p><ul>
  4014. <li>
  4015. Drop everything except the second minute of input:
  4016. <div class="example">
  4017. <pre class="example">ffmpeg -i INPUT -af atrim=60:120
  4018. </pre></div>
  4019. </li><li>
  4020. Keep only the first 1000 samples:
  4021. <div class="example">
  4022. <pre class="example">ffmpeg -i INPUT -af atrim=end_sample=1000
  4023. </pre></div>
  4024. </li></ul>
  4025. <a name="axcorrelate"></a>
  4026. <h2 class="section"><a href="ffmpeg-filters.html#toc-axcorrelate">8.47 axcorrelate</a></h2>
  4027. <p>Calculate normalized cross-correlation between two input audio streams.
  4028. </p>
  4029. <p>Resulted samples are always between -1 and 1 inclusive.
  4030. If result is 1 it means two input samples are highly correlated in that selected segment.
  4031. Result 0 means they are not correlated at all.
  4032. If result is -1 it means two input samples are out of phase, which means they cancel each
  4033. other.
  4034. </p>
  4035. <p>The filter accepts the following options:
  4036. </p>
  4037. <dl compact="compact">
  4038. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  4039. <dd><p>Set size of segment over which cross-correlation is calculated.
  4040. Default is 256. Allowed range is from 2 to 131072.
  4041. </p>
  4042. </dd>
  4043. <dt>&lsquo;<samp>algo</samp>&rsquo;</dt>
  4044. <dd><p>Set algorithm for cross-correlation. Can be <code>slow</code> or <code>fast</code>.
  4045. Default is <code>slow</code>. Fast algorithm assumes mean values over any given segment
  4046. are always zero and thus need much less calculations to make.
  4047. This is generally not true, but is valid for typical audio streams.
  4048. </p></dd>
  4049. </dl>
  4050. <a name="Examples-31"></a>
  4051. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-31">8.47.1 Examples</a></h3>
  4052. <ul>
  4053. <li>
  4054. Calculate correlation between channels in stereo audio stream:
  4055. <div class="example">
  4056. <pre class="example">ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
  4057. </pre></div>
  4058. </li></ul>
  4059. <a name="bandpass"></a>
  4060. <h2 class="section"><a href="ffmpeg-filters.html#toc-bandpass">8.48 bandpass</a></h2>
  4061. <p>Apply a two-pole Butterworth band-pass filter with central
  4062. frequency <var>frequency</var>, and (3dB-point) band-width width.
  4063. The <var>csg</var> option selects a constant skirt gain (peak gain = Q)
  4064. instead of the default: constant 0dB peak gain.
  4065. The filter roll off at 6dB per octave (20dB per decade).
  4066. </p>
  4067. <p>The filter accepts the following options:
  4068. </p>
  4069. <dl compact="compact">
  4070. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  4071. <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
  4072. </p>
  4073. </dd>
  4074. <dt>&lsquo;<samp>csg</samp>&rsquo;</dt>
  4075. <dd><p>Constant skirt gain if set to 1. Defaults to 0.
  4076. </p>
  4077. </dd>
  4078. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  4079. <dd><p>Set method to specify band-width of filter.
  4080. </p><dl compact="compact">
  4081. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  4082. <dd><p>Hz
  4083. </p></dd>
  4084. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  4085. <dd><p>Q-Factor
  4086. </p></dd>
  4087. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  4088. <dd><p>octave
  4089. </p></dd>
  4090. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  4091. <dd><p>slope
  4092. </p></dd>
  4093. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  4094. <dd><p>kHz
  4095. </p></dd>
  4096. </dl>
  4097. </dd>
  4098. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  4099. <dd><p>Specify the band-width of a filter in width_type units.
  4100. </p>
  4101. </dd>
  4102. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  4103. <dd><p>How much to use filtered signal in output. Default is 1.
  4104. Range is between 0 and 1.
  4105. </p>
  4106. </dd>
  4107. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  4108. <dd><p>Specify which channels to filter, by default all available are filtered.
  4109. </p>
  4110. </dd>
  4111. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  4112. <dd><p>Normalize biquad coefficients, by default is disabled.
  4113. Enabling it will normalize magnitude response at DC to 0dB.
  4114. </p></dd>
  4115. </dl>
  4116. <a name="Commands-66"></a>
  4117. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-66">8.48.1 Commands</a></h3>
  4118. <p>This filter supports the following commands:
  4119. </p><dl compact="compact">
  4120. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  4121. <dd><p>Change bandpass frequency.
  4122. Syntax for the command is : &quot;<var>frequency</var>&quot;
  4123. </p>
  4124. </dd>
  4125. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  4126. <dd><p>Change bandpass width_type.
  4127. Syntax for the command is : &quot;<var>width_type</var>&quot;
  4128. </p>
  4129. </dd>
  4130. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  4131. <dd><p>Change bandpass width.
  4132. Syntax for the command is : &quot;<var>width</var>&quot;
  4133. </p>
  4134. </dd>
  4135. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  4136. <dd><p>Change bandpass mix.
  4137. Syntax for the command is : &quot;<var>mix</var>&quot;
  4138. </p></dd>
  4139. </dl>
  4140. <a name="bandreject"></a>
  4141. <h2 class="section"><a href="ffmpeg-filters.html#toc-bandreject">8.49 bandreject</a></h2>
  4142. <p>Apply a two-pole Butterworth band-reject filter with central
  4143. frequency <var>frequency</var>, and (3dB-point) band-width <var>width</var>.
  4144. The filter roll off at 6dB per octave (20dB per decade).
  4145. </p>
  4146. <p>The filter accepts the following options:
  4147. </p>
  4148. <dl compact="compact">
  4149. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  4150. <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
  4151. </p>
  4152. </dd>
  4153. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  4154. <dd><p>Set method to specify band-width of filter.
  4155. </p><dl compact="compact">
  4156. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  4157. <dd><p>Hz
  4158. </p></dd>
  4159. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  4160. <dd><p>Q-Factor
  4161. </p></dd>
  4162. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  4163. <dd><p>octave
  4164. </p></dd>
  4165. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  4166. <dd><p>slope
  4167. </p></dd>
  4168. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  4169. <dd><p>kHz
  4170. </p></dd>
  4171. </dl>
  4172. </dd>
  4173. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  4174. <dd><p>Specify the band-width of a filter in width_type units.
  4175. </p>
  4176. </dd>
  4177. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  4178. <dd><p>How much to use filtered signal in output. Default is 1.
  4179. Range is between 0 and 1.
  4180. </p>
  4181. </dd>
  4182. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  4183. <dd><p>Specify which channels to filter, by default all available are filtered.
  4184. </p>
  4185. </dd>
  4186. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  4187. <dd><p>Normalize biquad coefficients, by default is disabled.
  4188. Enabling it will normalize magnitude response at DC to 0dB.
  4189. </p></dd>
  4190. </dl>
  4191. <a name="Commands"></a>
  4192. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands">8.49.1 Commands</a></h3>
  4193. <p>This filter supports the following commands:
  4194. </p><dl compact="compact">
  4195. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  4196. <dd><p>Change bandreject frequency.
  4197. Syntax for the command is : &quot;<var>frequency</var>&quot;
  4198. </p>
  4199. </dd>
  4200. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  4201. <dd><p>Change bandreject width_type.
  4202. Syntax for the command is : &quot;<var>width_type</var>&quot;
  4203. </p>
  4204. </dd>
  4205. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  4206. <dd><p>Change bandreject width.
  4207. Syntax for the command is : &quot;<var>width</var>&quot;
  4208. </p>
  4209. </dd>
  4210. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  4211. <dd><p>Change bandreject mix.
  4212. Syntax for the command is : &quot;<var>mix</var>&quot;
  4213. </p></dd>
  4214. </dl>
  4215. <a name="bass_002c-lowshelf"></a>
  4216. <h2 class="section"><a href="ffmpeg-filters.html#toc-bass_002c-lowshelf">8.50 bass, lowshelf</a></h2>
  4217. <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
  4218. shelving filter with a response similar to that of a standard
  4219. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  4220. </p>
  4221. <p>The filter accepts the following options:
  4222. </p>
  4223. <dl compact="compact">
  4224. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  4225. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  4226. (for a large cut) to +20 (for a large boost).
  4227. Beware of clipping when using a positive gain.
  4228. </p>
  4229. </dd>
  4230. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  4231. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  4232. to extend or reduce the frequency range to be boosted or cut.
  4233. The default value is <code>100</code> Hz.
  4234. </p>
  4235. </dd>
  4236. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  4237. <dd><p>Set method to specify band-width of filter.
  4238. </p><dl compact="compact">
  4239. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  4240. <dd><p>Hz
  4241. </p></dd>
  4242. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  4243. <dd><p>Q-Factor
  4244. </p></dd>
  4245. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  4246. <dd><p>octave
  4247. </p></dd>
  4248. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  4249. <dd><p>slope
  4250. </p></dd>
  4251. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  4252. <dd><p>kHz
  4253. </p></dd>
  4254. </dl>
  4255. </dd>
  4256. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  4257. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  4258. </p>
  4259. </dd>
  4260. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  4261. <dd><p>How much to use filtered signal in output. Default is 1.
  4262. Range is between 0 and 1.
  4263. </p>
  4264. </dd>
  4265. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  4266. <dd><p>Specify which channels to filter, by default all available are filtered.
  4267. </p>
  4268. </dd>
  4269. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  4270. <dd><p>Normalize biquad coefficients, by default is disabled.
  4271. Enabling it will normalize magnitude response at DC to 0dB.
  4272. </p></dd>
  4273. </dl>
  4274. <a name="Commands-50"></a>
  4275. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-50">8.50.1 Commands</a></h3>
  4276. <p>This filter supports the following commands:
  4277. </p><dl compact="compact">
  4278. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  4279. <dd><p>Change bass frequency.
  4280. Syntax for the command is : &quot;<var>frequency</var>&quot;
  4281. </p>
  4282. </dd>
  4283. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  4284. <dd><p>Change bass width_type.
  4285. Syntax for the command is : &quot;<var>width_type</var>&quot;
  4286. </p>
  4287. </dd>
  4288. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  4289. <dd><p>Change bass width.
  4290. Syntax for the command is : &quot;<var>width</var>&quot;
  4291. </p>
  4292. </dd>
  4293. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  4294. <dd><p>Change bass gain.
  4295. Syntax for the command is : &quot;<var>gain</var>&quot;
  4296. </p>
  4297. </dd>
  4298. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  4299. <dd><p>Change bass mix.
  4300. Syntax for the command is : &quot;<var>mix</var>&quot;
  4301. </p></dd>
  4302. </dl>
  4303. <a name="biquad"></a>
  4304. <h2 class="section"><a href="ffmpeg-filters.html#toc-biquad">8.51 biquad</a></h2>
  4305. <p>Apply a biquad IIR filter with the given coefficients.
  4306. Where <var>b0</var>, <var>b1</var>, <var>b2</var> and <var>a0</var>, <var>a1</var>, <var>a2</var>
  4307. are the numerator and denominator coefficients respectively.
  4308. and <var>channels</var>, <var>c</var> specify which channels to filter, by default all
  4309. available are filtered.
  4310. </p>
  4311. <a name="Commands-53"></a>
  4312. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-53">8.51.1 Commands</a></h3>
  4313. <p>This filter supports the following commands:
  4314. </p><dl compact="compact">
  4315. <dt>&lsquo;<samp>a0</samp>&rsquo;</dt>
  4316. <dt>&lsquo;<samp>a1</samp>&rsquo;</dt>
  4317. <dt>&lsquo;<samp>a2</samp>&rsquo;</dt>
  4318. <dt>&lsquo;<samp>b0</samp>&rsquo;</dt>
  4319. <dt>&lsquo;<samp>b1</samp>&rsquo;</dt>
  4320. <dt>&lsquo;<samp>b2</samp>&rsquo;</dt>
  4321. <dd><p>Change biquad parameter.
  4322. Syntax for the command is : &quot;<var>value</var>&quot;
  4323. </p>
  4324. </dd>
  4325. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  4326. <dd><p>How much to use filtered signal in output. Default is 1.
  4327. Range is between 0 and 1.
  4328. </p>
  4329. </dd>
  4330. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  4331. <dd><p>Specify which channels to filter, by default all available are filtered.
  4332. </p>
  4333. </dd>
  4334. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  4335. <dd><p>Normalize biquad coefficients, by default is disabled.
  4336. Enabling it will normalize magnitude response at DC to 0dB.
  4337. </p></dd>
  4338. </dl>
  4339. <a name="bs2b"></a>
  4340. <h2 class="section"><a href="ffmpeg-filters.html#toc-bs2b">8.52 bs2b</a></h2>
  4341. <p>Bauer stereo to binaural transformation, which improves headphone listening of
  4342. stereo audio records.
  4343. </p>
  4344. <p>To enable compilation of this filter you need to configure FFmpeg with
  4345. <code>--enable-libbs2b</code>.
  4346. </p>
  4347. <p>It accepts the following parameters:
  4348. </p><dl compact="compact">
  4349. <dt>&lsquo;<samp>profile</samp>&rsquo;</dt>
  4350. <dd><p>Pre-defined crossfeed level.
  4351. </p><dl compact="compact">
  4352. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  4353. <dd><p>Default level (fcut=700, feed=50).
  4354. </p>
  4355. </dd>
  4356. <dt>&lsquo;<samp>cmoy</samp>&rsquo;</dt>
  4357. <dd><p>Chu Moy circuit (fcut=700, feed=60).
  4358. </p>
  4359. </dd>
  4360. <dt>&lsquo;<samp>jmeier</samp>&rsquo;</dt>
  4361. <dd><p>Jan Meier circuit (fcut=650, feed=95).
  4362. </p>
  4363. </dd>
  4364. </dl>
  4365. </dd>
  4366. <dt>&lsquo;<samp>fcut</samp>&rsquo;</dt>
  4367. <dd><p>Cut frequency (in Hz).
  4368. </p>
  4369. </dd>
  4370. <dt>&lsquo;<samp>feed</samp>&rsquo;</dt>
  4371. <dd><p>Feed level (in Hz).
  4372. </p>
  4373. </dd>
  4374. </dl>
  4375. <a name="channelmap"></a>
  4376. <h2 class="section"><a href="ffmpeg-filters.html#toc-channelmap">8.53 channelmap</a></h2>
  4377. <p>Remap input channels to new locations.
  4378. </p>
  4379. <p>It accepts the following parameters:
  4380. </p><dl compact="compact">
  4381. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  4382. <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-separated list of
  4383. mappings, each in the <code><var>in_channel</var>-<var>out_channel</var></code> or
  4384. <var>in_channel</var> form. <var>in_channel</var> can be either the name of the input
  4385. channel (e.g. FL for front left) or its index in the input channel layout.
  4386. <var>out_channel</var> is the name of the output channel or its index in the output
  4387. channel layout. If <var>out_channel</var> is not given then it is implicitly an
  4388. index, starting with zero and increasing by one for each mapping.
  4389. </p>
  4390. </dd>
  4391. <dt>&lsquo;<samp>channel_layout</samp>&rsquo;</dt>
  4392. <dd><p>The channel layout of the output stream.
  4393. </p></dd>
  4394. </dl>
  4395. <p>If no mapping is present, the filter will implicitly map input channels to
  4396. output channels, preserving indices.
  4397. </p>
  4398. <a name="Examples-149"></a>
  4399. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-149">8.53.1 Examples</a></h3>
  4400. <ul>
  4401. <li>
  4402. For example, assuming a 5.1+downmix input MOV file,
  4403. <div class="example">
  4404. <pre class="example">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
  4405. </pre></div>
  4406. <p>will create an output WAV file tagged as stereo from the downmix channels of
  4407. the input.
  4408. </p>
  4409. </li><li>
  4410. To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
  4411. <div class="example">
  4412. <pre class="example">ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
  4413. </pre></div>
  4414. </li></ul>
  4415. <a name="channelsplit"></a>
  4416. <h2 class="section"><a href="ffmpeg-filters.html#toc-channelsplit">8.54 channelsplit</a></h2>
  4417. <p>Split each channel from an input audio stream into a separate output stream.
  4418. </p>
  4419. <p>It accepts the following parameters:
  4420. </p><dl compact="compact">
  4421. <dt>&lsquo;<samp>channel_layout</samp>&rsquo;</dt>
  4422. <dd><p>The channel layout of the input stream. The default is &quot;stereo&quot;.
  4423. </p></dd>
  4424. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  4425. <dd><p>A channel layout describing the channels to be extracted as separate output streams
  4426. or &quot;all&quot; to extract each input channel as a separate stream. The default is &quot;all&quot;.
  4427. </p>
  4428. <p>Choosing channels not present in channel layout in the input will result in an error.
  4429. </p></dd>
  4430. </dl>
  4431. <a name="Examples-47"></a>
  4432. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-47">8.54.1 Examples</a></h3>
  4433. <ul>
  4434. <li>
  4435. For example, assuming a stereo input MP3 file,
  4436. <div class="example">
  4437. <pre class="example">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
  4438. </pre></div>
  4439. <p>will create an output Matroska file with two audio streams, one containing only
  4440. the left channel and the other the right channel.
  4441. </p>
  4442. </li><li>
  4443. Split a 5.1 WAV file into per-channel files:
  4444. <div class="example">
  4445. <pre class="example">ffmpeg -i in.wav -filter_complex
  4446. 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
  4447. -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
  4448. front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
  4449. side_right.wav
  4450. </pre></div>
  4451. </li><li>
  4452. Extract only LFE from a 5.1 WAV file:
  4453. <div class="example">
  4454. <pre class="example">ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
  4455. -map '[LFE]' lfe.wav
  4456. </pre></div>
  4457. </li></ul>
  4458. <a name="chorus"></a>
  4459. <h2 class="section"><a href="ffmpeg-filters.html#toc-chorus">8.55 chorus</a></h2>
  4460. <p>Add a chorus effect to the audio.
  4461. </p>
  4462. <p>Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
  4463. </p>
  4464. <p>Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
  4465. constant, with chorus, it is varied using using sinusoidal or triangular modulation.
  4466. The modulation depth defines the range the modulated delay is played before or after
  4467. the delay. Hence the delayed sound will sound slower or faster, that is the delayed
  4468. sound tuned around the original one, like in a chorus where some vocals are slightly
  4469. off key.
  4470. </p>
  4471. <p>It accepts the following parameters:
  4472. </p><dl compact="compact">
  4473. <dt>&lsquo;<samp>in_gain</samp>&rsquo;</dt>
  4474. <dd><p>Set input gain. Default is 0.4.
  4475. </p>
  4476. </dd>
  4477. <dt>&lsquo;<samp>out_gain</samp>&rsquo;</dt>
  4478. <dd><p>Set output gain. Default is 0.4.
  4479. </p>
  4480. </dd>
  4481. <dt>&lsquo;<samp>delays</samp>&rsquo;</dt>
  4482. <dd><p>Set delays. A typical delay is around 40ms to 60ms.
  4483. </p>
  4484. </dd>
  4485. <dt>&lsquo;<samp>decays</samp>&rsquo;</dt>
  4486. <dd><p>Set decays.
  4487. </p>
  4488. </dd>
  4489. <dt>&lsquo;<samp>speeds</samp>&rsquo;</dt>
  4490. <dd><p>Set speeds.
  4491. </p>
  4492. </dd>
  4493. <dt>&lsquo;<samp>depths</samp>&rsquo;</dt>
  4494. <dd><p>Set depths.
  4495. </p></dd>
  4496. </dl>
  4497. <a name="Examples-42"></a>
  4498. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-42">8.55.1 Examples</a></h3>
  4499. <ul>
  4500. <li>
  4501. A single delay:
  4502. <div class="example">
  4503. <pre class="example">chorus=0.7:0.9:55:0.4:0.25:2
  4504. </pre></div>
  4505. </li><li>
  4506. Two delays:
  4507. <div class="example">
  4508. <pre class="example">chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
  4509. </pre></div>
  4510. </li><li>
  4511. Fuller sounding chorus with three delays:
  4512. <div class="example">
  4513. <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
  4514. </pre></div>
  4515. </li></ul>
  4516. <a name="compand"></a>
  4517. <h2 class="section"><a href="ffmpeg-filters.html#toc-compand">8.56 compand</a></h2>
  4518. <p>Compress or expand the audio&rsquo;s dynamic range.
  4519. </p>
  4520. <p>It accepts the following parameters:
  4521. </p>
  4522. <dl compact="compact">
  4523. <dt>&lsquo;<samp>attacks</samp>&rsquo;</dt>
  4524. <dt>&lsquo;<samp>decays</samp>&rsquo;</dt>
  4525. <dd><p>A list of times in seconds for each channel over which the instantaneous level
  4526. of the input signal is averaged to determine its volume. <var>attacks</var> refers to
  4527. increase of volume and <var>decays</var> refers to decrease of volume. For most
  4528. situations, the attack time (response to the audio getting louder) should be
  4529. shorter than the decay time, because the human ear is more sensitive to sudden
  4530. loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
  4531. a typical value for decay is 0.8 seconds.
  4532. If specified number of attacks &amp; decays is lower than number of channels, the last
  4533. set attack/decay will be used for all remaining channels.
  4534. </p>
  4535. </dd>
  4536. <dt>&lsquo;<samp>points</samp>&rsquo;</dt>
  4537. <dd><p>A list of points for the transfer function, specified in dB relative to the
  4538. maximum possible signal amplitude. Each key points list must be defined using
  4539. the following syntax: <code>x0/y0|x1/y1|x2/y2|....</code> or
  4540. <code>x0/y0 x1/y1 x2/y2 ....</code>
  4541. </p>
  4542. <p>The input values must be in strictly increasing order but the transfer function
  4543. does not have to be monotonically rising. The point <code>0/0</code> is assumed but
  4544. may be overridden (by <code>0/out-dBn</code>). Typical values for the transfer
  4545. function are <code>-70/-70|-60/-20|1/0</code>.
  4546. </p>
  4547. </dd>
  4548. <dt>&lsquo;<samp>soft-knee</samp>&rsquo;</dt>
  4549. <dd><p>Set the curve radius in dB for all joints. It defaults to 0.01.
  4550. </p>
  4551. </dd>
  4552. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  4553. <dd><p>Set the additional gain in dB to be applied at all points on the transfer
  4554. function. This allows for easy adjustment of the overall gain.
  4555. It defaults to 0.
  4556. </p>
  4557. </dd>
  4558. <dt>&lsquo;<samp>volume</samp>&rsquo;</dt>
  4559. <dd><p>Set an initial volume, in dB, to be assumed for each channel when filtering
  4560. starts. This permits the user to supply a nominal level initially, so that, for
  4561. example, a very large gain is not applied to initial signal levels before the
  4562. companding has begun to operate. A typical value for audio which is initially
  4563. quiet is -90 dB. It defaults to 0.
  4564. </p>
  4565. </dd>
  4566. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  4567. <dd><p>Set a delay, in seconds. The input audio is analyzed immediately, but audio is
  4568. delayed before being fed to the volume adjuster. Specifying a delay
  4569. approximately equal to the attack/decay times allows the filter to effectively
  4570. operate in predictive rather than reactive mode. It defaults to 0.
  4571. </p>
  4572. </dd>
  4573. </dl>
  4574. <a name="Examples-98"></a>
  4575. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-98">8.56.1 Examples</a></h3>
  4576. <ul>
  4577. <li>
  4578. Make music with both quiet and loud passages suitable for listening to in a
  4579. noisy environment:
  4580. <div class="example">
  4581. <pre class="example">compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
  4582. </pre></div>
  4583. <p>Another example for audio with whisper and explosion parts:
  4584. </p><div class="example">
  4585. <pre class="example">compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
  4586. </pre></div>
  4587. </li><li>
  4588. A noise gate for when the noise is at a lower level than the signal:
  4589. <div class="example">
  4590. <pre class="example">compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
  4591. </pre></div>
  4592. </li><li>
  4593. Here is another noise gate, this time for when the noise is at a higher level
  4594. than the signal (making it, in some ways, similar to squelch):
  4595. <div class="example">
  4596. <pre class="example">compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
  4597. </pre></div>
  4598. </li><li>
  4599. 2:1 compression starting at -6dB:
  4600. <div class="example">
  4601. <pre class="example">compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
  4602. </pre></div>
  4603. </li><li>
  4604. 2:1 compression starting at -9dB:
  4605. <div class="example">
  4606. <pre class="example">compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
  4607. </pre></div>
  4608. </li><li>
  4609. 2:1 compression starting at -12dB:
  4610. <div class="example">
  4611. <pre class="example">compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
  4612. </pre></div>
  4613. </li><li>
  4614. 2:1 compression starting at -18dB:
  4615. <div class="example">
  4616. <pre class="example">compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
  4617. </pre></div>
  4618. </li><li>
  4619. 3:1 compression starting at -15dB:
  4620. <div class="example">
  4621. <pre class="example">compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
  4622. </pre></div>
  4623. </li><li>
  4624. Compressor/Gate:
  4625. <div class="example">
  4626. <pre class="example">compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
  4627. </pre></div>
  4628. </li><li>
  4629. Expander:
  4630. <div class="example">
  4631. <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
  4632. </pre></div>
  4633. </li><li>
  4634. Hard limiter at -6dB:
  4635. <div class="example">
  4636. <pre class="example">compand=attacks=0:points=-80/-80|-6/-6|20/-6
  4637. </pre></div>
  4638. </li><li>
  4639. Hard limiter at -12dB:
  4640. <div class="example">
  4641. <pre class="example">compand=attacks=0:points=-80/-80|-12/-12|20/-12
  4642. </pre></div>
  4643. </li><li>
  4644. Hard noise gate at -35 dB:
  4645. <div class="example">
  4646. <pre class="example">compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
  4647. </pre></div>
  4648. </li><li>
  4649. Soft limiter:
  4650. <div class="example">
  4651. <pre class="example">compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
  4652. </pre></div>
  4653. </li></ul>
  4654. <a name="compensationdelay"></a>
  4655. <h2 class="section"><a href="ffmpeg-filters.html#toc-compensationdelay">8.57 compensationdelay</a></h2>
  4656. <p>Compensation Delay Line is a metric based delay to compensate differing
  4657. positions of microphones or speakers.
  4658. </p>
  4659. <p>For example, you have recorded guitar with two microphones placed in
  4660. different locations. Because the front of sound wave has fixed speed in
  4661. normal conditions, the phasing of microphones can vary and depends on
  4662. their location and interposition. The best sound mix can be achieved when
  4663. these microphones are in phase (synchronized). Note that a distance of
  4664. ~30 cm between microphones makes one microphone capture the signal in
  4665. antiphase to the other microphone. That makes the final mix sound moody.
  4666. This filter helps to solve phasing problems by adding different delays
  4667. to each microphone track and make them synchronized.
  4668. </p>
  4669. <p>The best result can be reached when you take one track as base and
  4670. synchronize other tracks one by one with it.
  4671. Remember that synchronization/delay tolerance depends on sample rate, too.
  4672. Higher sample rates will give more tolerance.
  4673. </p>
  4674. <p>The filter accepts the following parameters:
  4675. </p>
  4676. <dl compact="compact">
  4677. <dt>&lsquo;<samp>mm</samp>&rsquo;</dt>
  4678. <dd><p>Set millimeters distance. This is compensation distance for fine tuning.
  4679. Default is 0.
  4680. </p>
  4681. </dd>
  4682. <dt>&lsquo;<samp>cm</samp>&rsquo;</dt>
  4683. <dd><p>Set cm distance. This is compensation distance for tightening distance setup.
  4684. Default is 0.
  4685. </p>
  4686. </dd>
  4687. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  4688. <dd><p>Set meters distance. This is compensation distance for hard distance setup.
  4689. Default is 0.
  4690. </p>
  4691. </dd>
  4692. <dt>&lsquo;<samp>dry</samp>&rsquo;</dt>
  4693. <dd><p>Set dry amount. Amount of unprocessed (dry) signal.
  4694. Default is 0.
  4695. </p>
  4696. </dd>
  4697. <dt>&lsquo;<samp>wet</samp>&rsquo;</dt>
  4698. <dd><p>Set wet amount. Amount of processed (wet) signal.
  4699. Default is 1.
  4700. </p>
  4701. </dd>
  4702. <dt>&lsquo;<samp>temp</samp>&rsquo;</dt>
  4703. <dd><p>Set temperature in degrees Celsius. This is the temperature of the environment.
  4704. Default is 20.
  4705. </p></dd>
  4706. </dl>
  4707. <a name="crossfeed"></a>
  4708. <h2 class="section"><a href="ffmpeg-filters.html#toc-crossfeed">8.58 crossfeed</a></h2>
  4709. <p>Apply headphone crossfeed filter.
  4710. </p>
  4711. <p>Crossfeed is the process of blending the left and right channels of stereo
  4712. audio recording.
  4713. It is mainly used to reduce extreme stereo separation of low frequencies.
  4714. </p>
  4715. <p>The intent is to produce more speaker like sound to the listener.
  4716. </p>
  4717. <p>The filter accepts the following options:
  4718. </p>
  4719. <dl compact="compact">
  4720. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  4721. <dd><p>Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1.
  4722. This sets gain of low shelf filter for side part of stereo image.
  4723. Default is -6dB. Max allowed is -30db when strength is set to 1.
  4724. </p>
  4725. </dd>
  4726. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  4727. <dd><p>Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1.
  4728. This sets cut off frequency of low shelf filter. Default is cut off near
  4729. 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz.
  4730. </p>
  4731. </dd>
  4732. <dt>&lsquo;<samp>slope</samp>&rsquo;</dt>
  4733. <dd><p>Set curve slope of low shelf filter. Default is 0.5.
  4734. Allowed range is from 0.01 to 1.
  4735. </p>
  4736. </dd>
  4737. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  4738. <dd><p>Set input gain. Default is 0.9.
  4739. </p>
  4740. </dd>
  4741. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  4742. <dd><p>Set output gain. Default is 1.
  4743. </p></dd>
  4744. </dl>
  4745. <a name="Commands-39"></a>
  4746. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-39">8.58.1 Commands</a></h3>
  4747. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  4748. </p>
  4749. <a name="crystalizer"></a>
  4750. <h2 class="section"><a href="ffmpeg-filters.html#toc-crystalizer">8.59 crystalizer</a></h2>
  4751. <p>Simple algorithm to expand audio dynamic range.
  4752. </p>
  4753. <p>The filter accepts the following options:
  4754. </p>
  4755. <dl compact="compact">
  4756. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  4757. <dd><p>Sets the intensity of effect (default: 2.0). Must be in range between 0.0
  4758. (unchanged sound) to 10.0 (maximum effect).
  4759. </p>
  4760. </dd>
  4761. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  4762. <dd><p>Enable clipping. By default is enabled.
  4763. </p></dd>
  4764. </dl>
  4765. <a name="Commands-65"></a>
  4766. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-65">8.59.1 Commands</a></h3>
  4767. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  4768. </p>
  4769. <a name="dcshift"></a>
  4770. <h2 class="section"><a href="ffmpeg-filters.html#toc-dcshift">8.60 dcshift</a></h2>
  4771. <p>Apply a DC shift to the audio.
  4772. </p>
  4773. <p>This can be useful to remove a DC offset (caused perhaps by a hardware problem
  4774. in the recording chain) from the audio. The effect of a DC offset is reduced
  4775. headroom and hence volume. The <a href="#astats">astats</a> filter can be used to determine if
  4776. a signal has a DC offset.
  4777. </p>
  4778. <dl compact="compact">
  4779. <dt>&lsquo;<samp>shift</samp>&rsquo;</dt>
  4780. <dd><p>Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
  4781. the audio.
  4782. </p>
  4783. </dd>
  4784. <dt>&lsquo;<samp>limitergain</samp>&rsquo;</dt>
  4785. <dd><p>Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
  4786. used to prevent clipping.
  4787. </p></dd>
  4788. </dl>
  4789. <a name="deesser"></a>
  4790. <h2 class="section"><a href="ffmpeg-filters.html#toc-deesser">8.61 deesser</a></h2>
  4791. <p>Apply de-essing to the audio samples.
  4792. </p>
  4793. <dl compact="compact">
  4794. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  4795. <dd><p>Set intensity for triggering de-essing. Allowed range is from 0 to 1.
  4796. Default is 0.
  4797. </p>
  4798. </dd>
  4799. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  4800. <dd><p>Set amount of ducking on treble part of sound. Allowed range is from 0 to 1.
  4801. Default is 0.5.
  4802. </p>
  4803. </dd>
  4804. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  4805. <dd><p>How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1.
  4806. Default is 0.5.
  4807. </p>
  4808. </dd>
  4809. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  4810. <dd><p>Set the output mode.
  4811. </p>
  4812. <p>It accepts the following values:
  4813. </p><dl compact="compact">
  4814. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  4815. <dd><p>Pass input unchanged.
  4816. </p>
  4817. </dd>
  4818. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  4819. <dd><p>Pass ess filtered out.
  4820. </p>
  4821. </dd>
  4822. <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
  4823. <dd><p>Pass only ess.
  4824. </p>
  4825. <p>Default value is <var>o</var>.
  4826. </p></dd>
  4827. </dl>
  4828. </dd>
  4829. </dl>
  4830. <a name="drmeter"></a>
  4831. <h2 class="section"><a href="ffmpeg-filters.html#toc-drmeter">8.62 drmeter</a></h2>
  4832. <p>Measure audio dynamic range.
  4833. </p>
  4834. <p>DR values of 14 and higher is found in very dynamic material. DR of 8 to 13
  4835. is found in transition material. And anything less that 8 have very poor dynamics
  4836. and is very compressed.
  4837. </p>
  4838. <p>The filter accepts the following options:
  4839. </p>
  4840. <dl compact="compact">
  4841. <dt>&lsquo;<samp>length</samp>&rsquo;</dt>
  4842. <dd><p>Set window length in seconds used to split audio into segments of equal length.
  4843. Default is 3 seconds.
  4844. </p></dd>
  4845. </dl>
  4846. <a name="dynaudnorm"></a>
  4847. <h2 class="section"><a href="ffmpeg-filters.html#toc-dynaudnorm">8.63 dynaudnorm</a></h2>
  4848. <p>Dynamic Audio Normalizer.
  4849. </p>
  4850. <p>This filter applies a certain amount of gain to the input audio in order
  4851. to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
  4852. contrast to more &quot;simple&quot; normalization algorithms, the Dynamic Audio
  4853. Normalizer *dynamically* re-adjusts the gain factor to the input audio.
  4854. This allows for applying extra gain to the &quot;quiet&quot; sections of the audio
  4855. while avoiding distortions or clipping the &quot;loud&quot; sections. In other words:
  4856. The Dynamic Audio Normalizer will &quot;even out&quot; the volume of quiet and loud
  4857. sections, in the sense that the volume of each section is brought to the
  4858. same target level. Note, however, that the Dynamic Audio Normalizer achieves
  4859. this goal *without* applying &quot;dynamic range compressing&quot;. It will retain 100%
  4860. of the dynamic range *within* each section of the audio file.
  4861. </p>
  4862. <dl compact="compact">
  4863. <dt>&lsquo;<samp>framelen, f</samp>&rsquo;</dt>
  4864. <dd><p>Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
  4865. Default is 500 milliseconds.
  4866. The Dynamic Audio Normalizer processes the input audio in small chunks,
  4867. referred to as frames. This is required, because a peak magnitude has no
  4868. meaning for just a single sample value. Instead, we need to determine the
  4869. peak magnitude for a contiguous sequence of sample values. While a &quot;standard&quot;
  4870. normalizer would simply use the peak magnitude of the complete file, the
  4871. Dynamic Audio Normalizer determines the peak magnitude individually for each
  4872. frame. The length of a frame is specified in milliseconds. By default, the
  4873. Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
  4874. been found to give good results with most files.
  4875. Note that the exact frame length, in number of samples, will be determined
  4876. automatically, based on the sampling rate of the individual input audio file.
  4877. </p>
  4878. </dd>
  4879. <dt>&lsquo;<samp>gausssize, g</samp>&rsquo;</dt>
  4880. <dd><p>Set the Gaussian filter window size. In range from 3 to 301, must be odd
  4881. number. Default is 31.
  4882. Probably the most important parameter of the Dynamic Audio Normalizer is the
  4883. <code>window size</code> of the Gaussian smoothing filter. The filter&rsquo;s window size
  4884. is specified in frames, centered around the current frame. For the sake of
  4885. simplicity, this must be an odd number. Consequently, the default value of 31
  4886. takes into account the current frame, as well as the 15 preceding frames and
  4887. the 15 subsequent frames. Using a larger window results in a stronger
  4888. smoothing effect and thus in less gain variation, i.e. slower gain
  4889. adaptation. Conversely, using a smaller window results in a weaker smoothing
  4890. effect and thus in more gain variation, i.e. faster gain adaptation.
  4891. In other words, the more you increase this value, the more the Dynamic Audio
  4892. Normalizer will behave like a &quot;traditional&quot; normalization filter. On the
  4893. contrary, the more you decrease this value, the more the Dynamic Audio
  4894. Normalizer will behave like a dynamic range compressor.
  4895. </p>
  4896. </dd>
  4897. <dt>&lsquo;<samp>peak, p</samp>&rsquo;</dt>
  4898. <dd><p>Set the target peak value. This specifies the highest permissible magnitude
  4899. level for the normalized audio input. This filter will try to approach the
  4900. target peak magnitude as closely as possible, but at the same time it also
  4901. makes sure that the normalized signal will never exceed the peak magnitude.
  4902. A frame&rsquo;s maximum local gain factor is imposed directly by the target peak
  4903. magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
  4904. It is not recommended to go above this value.
  4905. </p>
  4906. </dd>
  4907. <dt>&lsquo;<samp>maxgain, m</samp>&rsquo;</dt>
  4908. <dd><p>Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
  4909. The Dynamic Audio Normalizer determines the maximum possible (local) gain
  4910. factor for each input frame, i.e. the maximum gain factor that does not
  4911. result in clipping or distortion. The maximum gain factor is determined by
  4912. the frame&rsquo;s highest magnitude sample. However, the Dynamic Audio Normalizer
  4913. additionally bounds the frame&rsquo;s maximum gain factor by a predetermined
  4914. (global) maximum gain factor. This is done in order to avoid excessive gain
  4915. factors in &quot;silent&quot; or almost silent frames. By default, the maximum gain
  4916. factor is 10.0, For most inputs the default value should be sufficient and
  4917. it usually is not recommended to increase this value. Though, for input
  4918. with an extremely low overall volume level, it may be necessary to allow even
  4919. higher gain factors. Note, however, that the Dynamic Audio Normalizer does
  4920. not simply apply a &quot;hard&quot; threshold (i.e. cut off values above the threshold).
  4921. Instead, a &quot;sigmoid&quot; threshold function will be applied. This way, the
  4922. gain factors will smoothly approach the threshold value, but never exceed that
  4923. value.
  4924. </p>
  4925. </dd>
  4926. <dt>&lsquo;<samp>targetrms, r</samp>&rsquo;</dt>
  4927. <dd><p>Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
  4928. By default, the Dynamic Audio Normalizer performs &quot;peak&quot; normalization.
  4929. This means that the maximum local gain factor for each frame is defined
  4930. (only) by the frame&rsquo;s highest magnitude sample. This way, the samples can
  4931. be amplified as much as possible without exceeding the maximum signal
  4932. level, i.e. without clipping. Optionally, however, the Dynamic Audio
  4933. Normalizer can also take into account the frame&rsquo;s root mean square,
  4934. abbreviated RMS. In electrical engineering, the RMS is commonly used to
  4935. determine the power of a time-varying signal. It is therefore considered
  4936. that the RMS is a better approximation of the &quot;perceived loudness&quot; than
  4937. just looking at the signal&rsquo;s peak magnitude. Consequently, by adjusting all
  4938. frames to a constant RMS value, a uniform &quot;perceived loudness&quot; can be
  4939. established. If a target RMS value has been specified, a frame&rsquo;s local gain
  4940. factor is defined as the factor that would result in exactly that RMS value.
  4941. Note, however, that the maximum local gain factor is still restricted by the
  4942. frame&rsquo;s highest magnitude sample, in order to prevent clipping.
  4943. </p>
  4944. </dd>
  4945. <dt>&lsquo;<samp>coupling, n</samp>&rsquo;</dt>
  4946. <dd><p>Enable channels coupling. By default is enabled.
  4947. By default, the Dynamic Audio Normalizer will amplify all channels by the same
  4948. amount. This means the same gain factor will be applied to all channels, i.e.
  4949. the maximum possible gain factor is determined by the &quot;loudest&quot; channel.
  4950. However, in some recordings, it may happen that the volume of the different
  4951. channels is uneven, e.g. one channel may be &quot;quieter&quot; than the other one(s).
  4952. In this case, this option can be used to disable the channel coupling. This way,
  4953. the gain factor will be determined independently for each channel, depending
  4954. only on the individual channel&rsquo;s highest magnitude sample. This allows for
  4955. harmonizing the volume of the different channels.
  4956. </p>
  4957. </dd>
  4958. <dt>&lsquo;<samp>correctdc, c</samp>&rsquo;</dt>
  4959. <dd><p>Enable DC bias correction. By default is disabled.
  4960. An audio signal (in the time domain) is a sequence of sample values.
  4961. In the Dynamic Audio Normalizer these sample values are represented in the
  4962. -1.0 to 1.0 range, regardless of the original input format. Normally, the
  4963. audio signal, or &quot;waveform&quot;, should be centered around the zero point.
  4964. That means if we calculate the mean value of all samples in a file, or in a
  4965. single frame, then the result should be 0.0 or at least very close to that
  4966. value. If, however, there is a significant deviation of the mean value from
  4967. 0.0, in either positive or negative direction, this is referred to as a
  4968. DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
  4969. Audio Normalizer provides optional DC bias correction.
  4970. With DC bias correction enabled, the Dynamic Audio Normalizer will determine
  4971. the mean value, or &quot;DC correction&quot; offset, of each input frame and subtract
  4972. that value from all of the frame&rsquo;s sample values which ensures those samples
  4973. are centered around 0.0 again. Also, in order to avoid &quot;gaps&quot; at the frame
  4974. boundaries, the DC correction offset values will be interpolated smoothly
  4975. between neighbouring frames.
  4976. </p>
  4977. </dd>
  4978. <dt>&lsquo;<samp>altboundary, b</samp>&rsquo;</dt>
  4979. <dd><p>Enable alternative boundary mode. By default is disabled.
  4980. The Dynamic Audio Normalizer takes into account a certain neighbourhood
  4981. around each frame. This includes the preceding frames as well as the
  4982. subsequent frames. However, for the &quot;boundary&quot; frames, located at the very
  4983. beginning and at the very end of the audio file, not all neighbouring
  4984. frames are available. In particular, for the first few frames in the audio
  4985. file, the preceding frames are not known. And, similarly, for the last few
  4986. frames in the audio file, the subsequent frames are not known. Thus, the
  4987. question arises which gain factors should be assumed for the missing frames
  4988. in the &quot;boundary&quot; region. The Dynamic Audio Normalizer implements two modes
  4989. to deal with this situation. The default boundary mode assumes a gain factor
  4990. of exactly 1.0 for the missing frames, resulting in a smooth &quot;fade in&quot; and
  4991. &quot;fade out&quot; at the beginning and at the end of the input, respectively.
  4992. </p>
  4993. </dd>
  4994. <dt>&lsquo;<samp>compress, s</samp>&rsquo;</dt>
  4995. <dd><p>Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
  4996. By default, the Dynamic Audio Normalizer does not apply &quot;traditional&quot;
  4997. compression. This means that signal peaks will not be pruned and thus the
  4998. full dynamic range will be retained within each local neighbourhood. However,
  4999. in some cases it may be desirable to combine the Dynamic Audio Normalizer&rsquo;s
  5000. normalization algorithm with a more &quot;traditional&quot; compression.
  5001. For this purpose, the Dynamic Audio Normalizer provides an optional compression
  5002. (thresholding) function. If (and only if) the compression feature is enabled,
  5003. all input frames will be processed by a soft knee thresholding function prior
  5004. to the actual normalization process. Put simply, the thresholding function is
  5005. going to prune all samples whose magnitude exceeds a certain threshold value.
  5006. However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
  5007. value. Instead, the threshold value will be adjusted for each individual
  5008. frame.
  5009. In general, smaller parameters result in stronger compression, and vice versa.
  5010. Values below 3.0 are not recommended, because audible distortion may appear.
  5011. </p>
  5012. </dd>
  5013. <dt>&lsquo;<samp>threshold, t</samp>&rsquo;</dt>
  5014. <dd><p>Set the target threshold value. This specifies the lowest permissible
  5015. magnitude level for the audio input which will be normalized.
  5016. If input frame volume is above this value frame will be normalized.
  5017. Otherwise frame may not be normalized at all. The default value is set
  5018. to 0, which means all input frames will be normalized.
  5019. This option is mostly useful if digital noise is not wanted to be amplified.
  5020. </p></dd>
  5021. </dl>
  5022. <a name="Commands-26"></a>
  5023. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-26">8.63.1 Commands</a></h3>
  5024. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  5025. </p>
  5026. <a name="earwax"></a>
  5027. <h2 class="section"><a href="ffmpeg-filters.html#toc-earwax">8.64 earwax</a></h2>
  5028. <p>Make audio easier to listen to on headphones.
  5029. </p>
  5030. <p>This filter adds &lsquo;cues&rsquo; to 44.1kHz stereo (i.e. audio CD format) audio
  5031. so that when listened to on headphones the stereo image is moved from
  5032. inside your head (standard for headphones) to outside and in front of
  5033. the listener (standard for speakers).
  5034. </p>
  5035. <p>Ported from SoX.
  5036. </p>
  5037. <a name="equalizer"></a>
  5038. <h2 class="section"><a href="ffmpeg-filters.html#toc-equalizer">8.65 equalizer</a></h2>
  5039. <p>Apply a two-pole peaking equalisation (EQ) filter. With this
  5040. filter, the signal-level at and around a selected frequency can
  5041. be increased or decreased, whilst (unlike bandpass and bandreject
  5042. filters) that at all other frequencies is unchanged.
  5043. </p>
  5044. <p>In order to produce complex equalisation curves, this filter can
  5045. be given several times, each with a different central frequency.
  5046. </p>
  5047. <p>The filter accepts the following options:
  5048. </p>
  5049. <dl compact="compact">
  5050. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  5051. <dd><p>Set the filter&rsquo;s central frequency in Hz.
  5052. </p>
  5053. </dd>
  5054. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  5055. <dd><p>Set method to specify band-width of filter.
  5056. </p><dl compact="compact">
  5057. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  5058. <dd><p>Hz
  5059. </p></dd>
  5060. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  5061. <dd><p>Q-Factor
  5062. </p></dd>
  5063. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  5064. <dd><p>octave
  5065. </p></dd>
  5066. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  5067. <dd><p>slope
  5068. </p></dd>
  5069. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  5070. <dd><p>kHz
  5071. </p></dd>
  5072. </dl>
  5073. </dd>
  5074. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  5075. <dd><p>Specify the band-width of a filter in width_type units.
  5076. </p>
  5077. </dd>
  5078. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  5079. <dd><p>Set the required gain or attenuation in dB.
  5080. Beware of clipping when using a positive gain.
  5081. </p>
  5082. </dd>
  5083. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  5084. <dd><p>How much to use filtered signal in output. Default is 1.
  5085. Range is between 0 and 1.
  5086. </p>
  5087. </dd>
  5088. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  5089. <dd><p>Specify which channels to filter, by default all available are filtered.
  5090. </p>
  5091. </dd>
  5092. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  5093. <dd><p>Normalize biquad coefficients, by default is disabled.
  5094. Enabling it will normalize magnitude response at DC to 0dB.
  5095. </p></dd>
  5096. </dl>
  5097. <a name="Examples-139"></a>
  5098. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-139">8.65.1 Examples</a></h3>
  5099. <ul>
  5100. <li>
  5101. Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
  5102. <div class="example">
  5103. <pre class="example">equalizer=f=1000:t=h:width=200:g=-10
  5104. </pre></div>
  5105. </li><li>
  5106. Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
  5107. <div class="example">
  5108. <pre class="example">equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
  5109. </pre></div>
  5110. </li></ul>
  5111. <a name="Commands-11"></a>
  5112. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-11">8.65.2 Commands</a></h3>
  5113. <p>This filter supports the following commands:
  5114. </p><dl compact="compact">
  5115. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  5116. <dd><p>Change equalizer frequency.
  5117. Syntax for the command is : &quot;<var>frequency</var>&quot;
  5118. </p>
  5119. </dd>
  5120. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  5121. <dd><p>Change equalizer width_type.
  5122. Syntax for the command is : &quot;<var>width_type</var>&quot;
  5123. </p>
  5124. </dd>
  5125. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  5126. <dd><p>Change equalizer width.
  5127. Syntax for the command is : &quot;<var>width</var>&quot;
  5128. </p>
  5129. </dd>
  5130. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  5131. <dd><p>Change equalizer gain.
  5132. Syntax for the command is : &quot;<var>gain</var>&quot;
  5133. </p>
  5134. </dd>
  5135. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  5136. <dd><p>Change equalizer mix.
  5137. Syntax for the command is : &quot;<var>mix</var>&quot;
  5138. </p></dd>
  5139. </dl>
  5140. <a name="extrastereo"></a>
  5141. <h2 class="section"><a href="ffmpeg-filters.html#toc-extrastereo">8.66 extrastereo</a></h2>
  5142. <p>Linearly increases the difference between left and right channels which
  5143. adds some sort of &quot;live&quot; effect to playback.
  5144. </p>
  5145. <p>The filter accepts the following options:
  5146. </p>
  5147. <dl compact="compact">
  5148. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  5149. <dd><p>Sets the difference coefficient (default: 2.5). 0.0 means mono sound
  5150. (average of both channels), with 1.0 sound will be unchanged, with
  5151. -1.0 left and right channels will be swapped.
  5152. </p>
  5153. </dd>
  5154. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  5155. <dd><p>Enable clipping. By default is enabled.
  5156. </p></dd>
  5157. </dl>
  5158. <a name="Commands-46"></a>
  5159. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-46">8.66.1 Commands</a></h3>
  5160. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  5161. </p>
  5162. <a name="firequalizer"></a>
  5163. <h2 class="section"><a href="ffmpeg-filters.html#toc-firequalizer">8.67 firequalizer</a></h2>
  5164. <p>Apply FIR Equalization using arbitrary frequency response.
  5165. </p>
  5166. <p>The filter accepts the following option:
  5167. </p>
  5168. <dl compact="compact">
  5169. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  5170. <dd><p>Set gain curve equation (in dB). The expression can contain variables:
  5171. </p><dl compact="compact">
  5172. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  5173. <dd><p>the evaluated frequency
  5174. </p></dd>
  5175. <dt>&lsquo;<samp>sr</samp>&rsquo;</dt>
  5176. <dd><p>sample rate
  5177. </p></dd>
  5178. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  5179. <dd><p>channel number, set to 0 when multichannels evaluation is disabled
  5180. </p></dd>
  5181. <dt>&lsquo;<samp>chid</samp>&rsquo;</dt>
  5182. <dd><p>channel id, see libavutil/channel_layout.h, set to the first channel id when
  5183. multichannels evaluation is disabled
  5184. </p></dd>
  5185. <dt>&lsquo;<samp>chs</samp>&rsquo;</dt>
  5186. <dd><p>number of channels
  5187. </p></dd>
  5188. <dt>&lsquo;<samp>chlayout</samp>&rsquo;</dt>
  5189. <dd><p>channel_layout, see libavutil/channel_layout.h
  5190. </p>
  5191. </dd>
  5192. </dl>
  5193. <p>and functions:
  5194. </p><dl compact="compact">
  5195. <dt>&lsquo;<samp>gain_interpolate(f)</samp>&rsquo;</dt>
  5196. <dd><p>interpolate gain on frequency f based on gain_entry
  5197. </p></dd>
  5198. <dt>&lsquo;<samp>cubic_interpolate(f)</samp>&rsquo;</dt>
  5199. <dd><p>same as gain_interpolate, but smoother
  5200. </p></dd>
  5201. </dl>
  5202. <p>This option is also available as command. Default is <code>gain_interpolate(f)</code>.
  5203. </p>
  5204. </dd>
  5205. <dt>&lsquo;<samp>gain_entry</samp>&rsquo;</dt>
  5206. <dd><p>Set gain entry for gain_interpolate function. The expression can
  5207. contain functions:
  5208. </p><dl compact="compact">
  5209. <dt>&lsquo;<samp>entry(f, g)</samp>&rsquo;</dt>
  5210. <dd><p>store gain entry at frequency f with value g
  5211. </p></dd>
  5212. </dl>
  5213. <p>This option is also available as command.
  5214. </p>
  5215. </dd>
  5216. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  5217. <dd><p>Set filter delay in seconds. Higher value means more accurate.
  5218. Default is <code>0.01</code>.
  5219. </p>
  5220. </dd>
  5221. <dt>&lsquo;<samp>accuracy</samp>&rsquo;</dt>
  5222. <dd><p>Set filter accuracy in Hz. Lower value means more accurate.
  5223. Default is <code>5</code>.
  5224. </p>
  5225. </dd>
  5226. <dt>&lsquo;<samp>wfunc</samp>&rsquo;</dt>
  5227. <dd><p>Set window function. Acceptable values are:
  5228. </p><dl compact="compact">
  5229. <dt>&lsquo;<samp>rectangular</samp>&rsquo;</dt>
  5230. <dd><p>rectangular window, useful when gain curve is already smooth
  5231. </p></dd>
  5232. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  5233. <dd><p>hann window (default)
  5234. </p></dd>
  5235. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  5236. <dd><p>hamming window
  5237. </p></dd>
  5238. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  5239. <dd><p>blackman window
  5240. </p></dd>
  5241. <dt>&lsquo;<samp>nuttall3</samp>&rsquo;</dt>
  5242. <dd><p>3-terms continuous 1st derivative nuttall window
  5243. </p></dd>
  5244. <dt>&lsquo;<samp>mnuttall3</samp>&rsquo;</dt>
  5245. <dd><p>minimum 3-terms discontinuous nuttall window
  5246. </p></dd>
  5247. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  5248. <dd><p>4-terms continuous 1st derivative nuttall window
  5249. </p></dd>
  5250. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  5251. <dd><p>minimum 4-terms discontinuous nuttall (blackman-nuttall) window
  5252. </p></dd>
  5253. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  5254. <dd><p>blackman-harris window
  5255. </p></dd>
  5256. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  5257. <dd><p>tukey window
  5258. </p></dd>
  5259. </dl>
  5260. </dd>
  5261. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  5262. <dd><p>If enabled, use fixed number of audio samples. This improves speed when
  5263. filtering with large delay. Default is disabled.
  5264. </p>
  5265. </dd>
  5266. <dt>&lsquo;<samp>multi</samp>&rsquo;</dt>
  5267. <dd><p>Enable multichannels evaluation on gain. Default is disabled.
  5268. </p>
  5269. </dd>
  5270. <dt>&lsquo;<samp>zero_phase</samp>&rsquo;</dt>
  5271. <dd><p>Enable zero phase mode by subtracting timestamp to compensate delay.
  5272. Default is disabled.
  5273. </p>
  5274. </dd>
  5275. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  5276. <dd><p>Set scale used by gain. Acceptable values are:
  5277. </p><dl compact="compact">
  5278. <dt>&lsquo;<samp>linlin</samp>&rsquo;</dt>
  5279. <dd><p>linear frequency, linear gain
  5280. </p></dd>
  5281. <dt>&lsquo;<samp>linlog</samp>&rsquo;</dt>
  5282. <dd><p>linear frequency, logarithmic (in dB) gain (default)
  5283. </p></dd>
  5284. <dt>&lsquo;<samp>loglin</samp>&rsquo;</dt>
  5285. <dd><p>logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
  5286. </p></dd>
  5287. <dt>&lsquo;<samp>loglog</samp>&rsquo;</dt>
  5288. <dd><p>logarithmic frequency, logarithmic gain
  5289. </p></dd>
  5290. </dl>
  5291. </dd>
  5292. <dt>&lsquo;<samp>dumpfile</samp>&rsquo;</dt>
  5293. <dd><p>Set file for dumping, suitable for gnuplot.
  5294. </p>
  5295. </dd>
  5296. <dt>&lsquo;<samp>dumpscale</samp>&rsquo;</dt>
  5297. <dd><p>Set scale for dumpfile. Acceptable values are same with scale option.
  5298. Default is linlog.
  5299. </p>
  5300. </dd>
  5301. <dt>&lsquo;<samp>fft2</samp>&rsquo;</dt>
  5302. <dd><p>Enable 2-channel convolution using complex FFT. This improves speed significantly.
  5303. Default is disabled.
  5304. </p>
  5305. </dd>
  5306. <dt>&lsquo;<samp>min_phase</samp>&rsquo;</dt>
  5307. <dd><p>Enable minimum phase impulse response. Default is disabled.
  5308. </p></dd>
  5309. </dl>
  5310. <a name="Examples-72"></a>
  5311. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-72">8.67.1 Examples</a></h3>
  5312. <ul>
  5313. <li>
  5314. lowpass at 1000 Hz:
  5315. <div class="example">
  5316. <pre class="example">firequalizer=gain='if(lt(f,1000), 0, -INF)'
  5317. </pre></div>
  5318. </li><li>
  5319. lowpass at 1000 Hz with gain_entry:
  5320. <div class="example">
  5321. <pre class="example">firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
  5322. </pre></div>
  5323. </li><li>
  5324. custom equalization:
  5325. <div class="example">
  5326. <pre class="example">firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
  5327. </pre></div>
  5328. </li><li>
  5329. higher delay with zero phase to compensate delay:
  5330. <div class="example">
  5331. <pre class="example">firequalizer=delay=0.1:fixed=on:zero_phase=on
  5332. </pre></div>
  5333. </li><li>
  5334. lowpass on left channel, highpass on right channel:
  5335. <div class="example">
  5336. <pre class="example">firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
  5337. :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
  5338. </pre></div>
  5339. </li></ul>
  5340. <a name="flanger"></a>
  5341. <h2 class="section"><a href="ffmpeg-filters.html#toc-flanger">8.68 flanger</a></h2>
  5342. <p>Apply a flanging effect to the audio.
  5343. </p>
  5344. <p>The filter accepts the following options:
  5345. </p>
  5346. <dl compact="compact">
  5347. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  5348. <dd><p>Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
  5349. </p>
  5350. </dd>
  5351. <dt>&lsquo;<samp>depth</samp>&rsquo;</dt>
  5352. <dd><p>Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2.
  5353. </p>
  5354. </dd>
  5355. <dt>&lsquo;<samp>regen</samp>&rsquo;</dt>
  5356. <dd><p>Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
  5357. Default value is 0.
  5358. </p>
  5359. </dd>
  5360. <dt>&lsquo;<samp>width</samp>&rsquo;</dt>
  5361. <dd><p>Set percentage of delayed signal mixed with original. Range from 0 to 100.
  5362. Default value is 71.
  5363. </p>
  5364. </dd>
  5365. <dt>&lsquo;<samp>speed</samp>&rsquo;</dt>
  5366. <dd><p>Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
  5367. </p>
  5368. </dd>
  5369. <dt>&lsquo;<samp>shape</samp>&rsquo;</dt>
  5370. <dd><p>Set swept wave shape, can be <var>triangular</var> or <var>sinusoidal</var>.
  5371. Default value is <var>sinusoidal</var>.
  5372. </p>
  5373. </dd>
  5374. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  5375. <dd><p>Set swept wave percentage-shift for multi channel. Range from 0 to 100.
  5376. Default value is 25.
  5377. </p>
  5378. </dd>
  5379. <dt>&lsquo;<samp>interp</samp>&rsquo;</dt>
  5380. <dd><p>Set delay-line interpolation, <var>linear</var> or <var>quadratic</var>.
  5381. Default is <var>linear</var>.
  5382. </p></dd>
  5383. </dl>
  5384. <a name="haas"></a>
  5385. <h2 class="section"><a href="ffmpeg-filters.html#toc-haas">8.69 haas</a></h2>
  5386. <p>Apply Haas effect to audio.
  5387. </p>
  5388. <p>Note that this makes most sense to apply on mono signals.
  5389. With this filter applied to mono signals it give some directionality and
  5390. stretches its stereo image.
  5391. </p>
  5392. <p>The filter accepts the following options:
  5393. </p>
  5394. <dl compact="compact">
  5395. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  5396. <dd><p>Set input level. By default is <var>1</var>, or 0dB
  5397. </p>
  5398. </dd>
  5399. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  5400. <dd><p>Set output level. By default is <var>1</var>, or 0dB.
  5401. </p>
  5402. </dd>
  5403. <dt>&lsquo;<samp>side_gain</samp>&rsquo;</dt>
  5404. <dd><p>Set gain applied to side part of signal. By default is <var>1</var>.
  5405. </p>
  5406. </dd>
  5407. <dt>&lsquo;<samp>middle_source</samp>&rsquo;</dt>
  5408. <dd><p>Set kind of middle source. Can be one of the following:
  5409. </p>
  5410. <dl compact="compact">
  5411. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  5412. <dd><p>Pick left channel.
  5413. </p>
  5414. </dd>
  5415. <dt>&lsquo;<samp>right</samp>&rsquo;</dt>
  5416. <dd><p>Pick right channel.
  5417. </p>
  5418. </dd>
  5419. <dt>&lsquo;<samp>mid</samp>&rsquo;</dt>
  5420. <dd><p>Pick middle part signal of stereo image.
  5421. </p>
  5422. </dd>
  5423. <dt>&lsquo;<samp>side</samp>&rsquo;</dt>
  5424. <dd><p>Pick side part signal of stereo image.
  5425. </p></dd>
  5426. </dl>
  5427. </dd>
  5428. <dt>&lsquo;<samp>middle_phase</samp>&rsquo;</dt>
  5429. <dd><p>Change middle phase. By default is disabled.
  5430. </p>
  5431. </dd>
  5432. <dt>&lsquo;<samp>left_delay</samp>&rsquo;</dt>
  5433. <dd><p>Set left channel delay. By default is <var>2.05</var> milliseconds.
  5434. </p>
  5435. </dd>
  5436. <dt>&lsquo;<samp>left_balance</samp>&rsquo;</dt>
  5437. <dd><p>Set left channel balance. By default is <var>-1</var>.
  5438. </p>
  5439. </dd>
  5440. <dt>&lsquo;<samp>left_gain</samp>&rsquo;</dt>
  5441. <dd><p>Set left channel gain. By default is <var>1</var>.
  5442. </p>
  5443. </dd>
  5444. <dt>&lsquo;<samp>left_phase</samp>&rsquo;</dt>
  5445. <dd><p>Change left phase. By default is disabled.
  5446. </p>
  5447. </dd>
  5448. <dt>&lsquo;<samp>right_delay</samp>&rsquo;</dt>
  5449. <dd><p>Set right channel delay. By defaults is <var>2.12</var> milliseconds.
  5450. </p>
  5451. </dd>
  5452. <dt>&lsquo;<samp>right_balance</samp>&rsquo;</dt>
  5453. <dd><p>Set right channel balance. By default is <var>1</var>.
  5454. </p>
  5455. </dd>
  5456. <dt>&lsquo;<samp>right_gain</samp>&rsquo;</dt>
  5457. <dd><p>Set right channel gain. By default is <var>1</var>.
  5458. </p>
  5459. </dd>
  5460. <dt>&lsquo;<samp>right_phase</samp>&rsquo;</dt>
  5461. <dd><p>Change right phase. By default is enabled.
  5462. </p></dd>
  5463. </dl>
  5464. <a name="hdcd"></a>
  5465. <h2 class="section"><a href="ffmpeg-filters.html#toc-hdcd">8.70 hdcd</a></h2>
  5466. <p>Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with
  5467. embedded HDCD codes is expanded into a 20-bit PCM stream.
  5468. </p>
  5469. <p>The filter supports the Peak Extend and Low-level Gain Adjustment features
  5470. of HDCD, and detects the Transient Filter flag.
  5471. </p>
  5472. <div class="example">
  5473. <pre class="example">ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
  5474. </pre></div>
  5475. <p>When using the filter with wav, note the default encoding for wav is 16-bit,
  5476. so the resulting 20-bit stream will be truncated back to 16-bit. Use something
  5477. like <code>-acodec pcm_s24le</code> after the filter to get 24-bit PCM output.
  5478. </p><div class="example">
  5479. <pre class="example">ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
  5480. ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
  5481. </pre></div>
  5482. <p>The filter accepts the following options:
  5483. </p>
  5484. <dl compact="compact">
  5485. <dt>&lsquo;<samp>disable_autoconvert</samp>&rsquo;</dt>
  5486. <dd><p>Disable any automatic format conversion or resampling in the filter graph.
  5487. </p>
  5488. </dd>
  5489. <dt>&lsquo;<samp>process_stereo</samp>&rsquo;</dt>
  5490. <dd><p>Process the stereo channels together. If target_gain does not match between
  5491. channels, consider it invalid and use the last valid target_gain.
  5492. </p>
  5493. </dd>
  5494. <dt>&lsquo;<samp>cdt_ms</samp>&rsquo;</dt>
  5495. <dd><p>Set the code detect timer period in ms.
  5496. </p>
  5497. </dd>
  5498. <dt>&lsquo;<samp>force_pe</samp>&rsquo;</dt>
  5499. <dd><p>Always extend peaks above -3dBFS even if PE isn&rsquo;t signaled.
  5500. </p>
  5501. </dd>
  5502. <dt>&lsquo;<samp>analyze_mode</samp>&rsquo;</dt>
  5503. <dd><p>Replace audio with a solid tone and adjust the amplitude to signal some
  5504. specific aspect of the decoding process. The output file can be loaded in
  5505. an audio editor alongside the original to aid analysis.
  5506. </p>
  5507. <p><code>analyze_mode=pe:force_pe=true</code> can be used to see all samples above the PE level.
  5508. </p>
  5509. <p>Modes are:
  5510. </p><dl compact="compact">
  5511. <dt>&lsquo;<samp>0, off</samp>&rsquo;</dt>
  5512. <dd><p>Disabled
  5513. </p></dd>
  5514. <dt>&lsquo;<samp>1, lle</samp>&rsquo;</dt>
  5515. <dd><p>Gain adjustment level at each sample
  5516. </p></dd>
  5517. <dt>&lsquo;<samp>2, pe</samp>&rsquo;</dt>
  5518. <dd><p>Samples where peak extend occurs
  5519. </p></dd>
  5520. <dt>&lsquo;<samp>3, cdt</samp>&rsquo;</dt>
  5521. <dd><p>Samples where the code detect timer is active
  5522. </p></dd>
  5523. <dt>&lsquo;<samp>4, tgm</samp>&rsquo;</dt>
  5524. <dd><p>Samples where the target gain does not match between channels
  5525. </p></dd>
  5526. </dl>
  5527. </dd>
  5528. </dl>
  5529. <a name="headphone"></a>
  5530. <h2 class="section"><a href="ffmpeg-filters.html#toc-headphone">8.71 headphone</a></h2>
  5531. <p>Apply head-related transfer functions (HRTFs) to create virtual
  5532. loudspeakers around the user for binaural listening via headphones.
  5533. The HRIRs are provided via additional streams, for each channel
  5534. one stereo input stream is needed.
  5535. </p>
  5536. <p>The filter accepts the following options:
  5537. </p>
  5538. <dl compact="compact">
  5539. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  5540. <dd><p>Set mapping of input streams for convolution.
  5541. The argument is a &rsquo;|&rsquo;-separated list of channel names in order as they
  5542. are given as additional stream inputs for filter.
  5543. This also specify number of input streams. Number of input streams
  5544. must be not less than number of channels in first stream plus one.
  5545. </p>
  5546. </dd>
  5547. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  5548. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  5549. </p>
  5550. </dd>
  5551. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  5552. <dd><p>Set processing type. Can be <var>time</var> or <var>freq</var>. <var>time</var> is
  5553. processing audio in time domain which is slow.
  5554. <var>freq</var> is processing audio in frequency domain which is fast.
  5555. Default is <var>freq</var>.
  5556. </p>
  5557. </dd>
  5558. <dt>&lsquo;<samp>lfe</samp>&rsquo;</dt>
  5559. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  5560. </p>
  5561. </dd>
  5562. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  5563. <dd><p>Set size of frame in number of samples which will be processed at once.
  5564. Default value is <var>1024</var>. Allowed range is from 1024 to 96000.
  5565. </p>
  5566. </dd>
  5567. <dt>&lsquo;<samp>hrir</samp>&rsquo;</dt>
  5568. <dd><p>Set format of hrir stream.
  5569. Default value is <var>stereo</var>. Alternative value is <var>multich</var>.
  5570. If value is set to <var>stereo</var>, number of additional streams should
  5571. be greater or equal to number of input channels in first input stream.
  5572. Also each additional stream should have stereo number of channels.
  5573. If value is set to <var>multich</var>, number of additional streams should
  5574. be exactly one. Also number of input channels of additional stream
  5575. should be equal or greater than twice number of channels of first input
  5576. stream.
  5577. </p></dd>
  5578. </dl>
  5579. <a name="Examples-111"></a>
  5580. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-111">8.71.1 Examples</a></h3>
  5581. <ul>
  5582. <li>
  5583. Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  5584. each amovie filter use stereo file with IR coefficients as input.
  5585. The files give coefficients for each position of virtual loudspeaker:
  5586. <div class="example">
  5587. <pre class="example">ffmpeg -i input.wav
  5588. -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;
  5589. output.wav
  5590. </pre></div>
  5591. </li><li>
  5592. Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  5593. but now in <var>multich</var> <var>hrir</var> format.
  5594. <div class="example">
  5595. <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;
  5596. output.wav
  5597. </pre></div>
  5598. </li></ul>
  5599. <a name="highpass"></a>
  5600. <h2 class="section"><a href="ffmpeg-filters.html#toc-highpass">8.72 highpass</a></h2>
  5601. <p>Apply a high-pass filter with 3dB point frequency.
  5602. The filter can be either single-pole, or double-pole (the default).
  5603. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  5604. </p>
  5605. <p>The filter accepts the following options:
  5606. </p>
  5607. <dl compact="compact">
  5608. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  5609. <dd><p>Set frequency in Hz. Default is 3000.
  5610. </p>
  5611. </dd>
  5612. <dt>&lsquo;<samp>poles, p</samp>&rsquo;</dt>
  5613. <dd><p>Set number of poles. Default is 2.
  5614. </p>
  5615. </dd>
  5616. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  5617. <dd><p>Set method to specify band-width of filter.
  5618. </p><dl compact="compact">
  5619. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  5620. <dd><p>Hz
  5621. </p></dd>
  5622. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  5623. <dd><p>Q-Factor
  5624. </p></dd>
  5625. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  5626. <dd><p>octave
  5627. </p></dd>
  5628. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  5629. <dd><p>slope
  5630. </p></dd>
  5631. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  5632. <dd><p>kHz
  5633. </p></dd>
  5634. </dl>
  5635. </dd>
  5636. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  5637. <dd><p>Specify the band-width of a filter in width_type units.
  5638. Applies only to double-pole filter.
  5639. The default is 0.707q and gives a Butterworth response.
  5640. </p>
  5641. </dd>
  5642. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  5643. <dd><p>How much to use filtered signal in output. Default is 1.
  5644. Range is between 0 and 1.
  5645. </p>
  5646. </dd>
  5647. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  5648. <dd><p>Specify which channels to filter, by default all available are filtered.
  5649. </p>
  5650. </dd>
  5651. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  5652. <dd><p>Normalize biquad coefficients, by default is disabled.
  5653. Enabling it will normalize magnitude response at DC to 0dB.
  5654. </p></dd>
  5655. </dl>
  5656. <a name="Commands-37"></a>
  5657. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-37">8.72.1 Commands</a></h3>
  5658. <p>This filter supports the following commands:
  5659. </p><dl compact="compact">
  5660. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  5661. <dd><p>Change highpass frequency.
  5662. Syntax for the command is : &quot;<var>frequency</var>&quot;
  5663. </p>
  5664. </dd>
  5665. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  5666. <dd><p>Change highpass width_type.
  5667. Syntax for the command is : &quot;<var>width_type</var>&quot;
  5668. </p>
  5669. </dd>
  5670. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  5671. <dd><p>Change highpass width.
  5672. Syntax for the command is : &quot;<var>width</var>&quot;
  5673. </p>
  5674. </dd>
  5675. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  5676. <dd><p>Change highpass mix.
  5677. Syntax for the command is : &quot;<var>mix</var>&quot;
  5678. </p></dd>
  5679. </dl>
  5680. <a name="join"></a>
  5681. <h2 class="section"><a href="ffmpeg-filters.html#toc-join">8.73 join</a></h2>
  5682. <p>Join multiple input streams into one multi-channel stream.
  5683. </p>
  5684. <p>It accepts the following parameters:
  5685. </p><dl compact="compact">
  5686. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  5687. <dd><p>The number of input streams. It defaults to 2.
  5688. </p>
  5689. </dd>
  5690. <dt>&lsquo;<samp>channel_layout</samp>&rsquo;</dt>
  5691. <dd><p>The desired output channel layout. It defaults to stereo.
  5692. </p>
  5693. </dd>
  5694. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  5695. <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-separated list of
  5696. mappings, each in the <code><var>input_idx</var>.<var>in_channel</var>-<var>out_channel</var></code>
  5697. form. <var>input_idx</var> is the 0-based index of the input stream. <var>in_channel</var>
  5698. can be either the name of the input channel (e.g. FL for front left) or its
  5699. index in the specified input stream. <var>out_channel</var> is the name of the output
  5700. channel.
  5701. </p></dd>
  5702. </dl>
  5703. <p>The filter will attempt to guess the mappings when they are not specified
  5704. explicitly. It does so by first trying to find an unused matching input channel
  5705. and if that fails it picks the first unused input channel.
  5706. </p>
  5707. <p>Join 3 inputs (with properly set channel layouts):
  5708. </p><div class="example">
  5709. <pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
  5710. </pre></div>
  5711. <p>Build a 5.1 output from 6 single-channel streams:
  5712. </p><div class="example">
  5713. <pre class="example">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
  5714. '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'
  5715. out
  5716. </pre></div>
  5717. <a name="ladspa"></a>
  5718. <h2 class="section"><a href="ffmpeg-filters.html#toc-ladspa">8.74 ladspa</a></h2>
  5719. <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
  5720. </p>
  5721. <p>To enable compilation of this filter you need to configure FFmpeg with
  5722. <code>--enable-ladspa</code>.
  5723. </p>
  5724. <dl compact="compact">
  5725. <dt>&lsquo;<samp>file, f</samp>&rsquo;</dt>
  5726. <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
  5727. variable <code>LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
  5728. each one of the directories specified by the colon separated list in
  5729. <code>LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
  5730. this order: &lsquo;<tt>HOME/.ladspa/lib/</tt>&rsquo;, &lsquo;<tt>/usr/local/lib/ladspa/</tt>&rsquo;,
  5731. &lsquo;<tt>/usr/lib/ladspa/</tt>&rsquo;.
  5732. </p>
  5733. </dd>
  5734. <dt>&lsquo;<samp>plugin, p</samp>&rsquo;</dt>
  5735. <dd><p>Specifies the plugin within the library. Some libraries contain only
  5736. one plugin, but others contain many of them. If this is not set filter
  5737. will list all available plugins within the specified library.
  5738. </p>
  5739. </dd>
  5740. <dt>&lsquo;<samp>controls, c</samp>&rsquo;</dt>
  5741. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  5742. values that determine the behavior of the loaded plugin (for example delay,
  5743. threshold or gain).
  5744. Controls need to be defined using the following syntax:
  5745. c0=<var>value0</var>|c1=<var>value1</var>|c2=<var>value2</var>|..., where
  5746. <var>valuei</var> is the value set on the <var>i</var>-th control.
  5747. Alternatively they can be also defined using the following syntax:
  5748. <var>value0</var>|<var>value1</var>|<var>value2</var>|..., where
  5749. <var>valuei</var> is the value set on the <var>i</var>-th control.
  5750. If &lsquo;<samp>controls</samp>&rsquo; is set to <code>help</code>, all available controls and
  5751. their valid ranges are printed.
  5752. </p>
  5753. </dd>
  5754. <dt>&lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
  5755. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  5756. zero inputs.
  5757. </p>
  5758. </dd>
  5759. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  5760. <dd><p>Set the number of samples per channel per each output frame, default
  5761. is 1024. Only used if plugin have zero inputs.
  5762. </p>
  5763. </dd>
  5764. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  5765. <dd><p>Set the minimum duration of the sourced audio. See
  5766. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  5767. for the accepted syntax.
  5768. Note that the resulting duration may be greater than the specified duration,
  5769. as the generated audio is always cut at the end of a complete frame.
  5770. If not specified, or the expressed duration is negative, the audio is
  5771. supposed to be generated forever.
  5772. Only used if plugin have zero inputs.
  5773. </p>
  5774. </dd>
  5775. </dl>
  5776. <a name="Examples-114"></a>
  5777. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-114">8.74.1 Examples</a></h3>
  5778. <ul>
  5779. <li>
  5780. List all available plugins within amp (LADSPA example plugin) library:
  5781. <div class="example">
  5782. <pre class="example">ladspa=file=amp
  5783. </pre></div>
  5784. </li><li>
  5785. List all available controls and their valid ranges for <code>vcf_notch</code>
  5786. plugin from <code>VCF</code> library:
  5787. <div class="example">
  5788. <pre class="example">ladspa=f=vcf:p=vcf_notch:c=help
  5789. </pre></div>
  5790. </li><li>
  5791. Simulate low quality audio equipment using <code>Computer Music Toolkit</code> (CMT)
  5792. plugin library:
  5793. <div class="example">
  5794. <pre class="example">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
  5795. </pre></div>
  5796. </li><li>
  5797. Add reverberation to the audio using TAP-plugins
  5798. (Tom&rsquo;s Audio Processing plugins):
  5799. <div class="example">
  5800. <pre class="example">ladspa=file=tap_reverb:tap_reverb
  5801. </pre></div>
  5802. </li><li>
  5803. Generate white noise, with 0.2 amplitude:
  5804. <div class="example">
  5805. <pre class="example">ladspa=file=cmt:noise_source_white:c=c0=.2
  5806. </pre></div>
  5807. </li><li>
  5808. Generate 20 bpm clicks using plugin <code>C* Click - Metronome</code> from the
  5809. <code>C* Audio Plugin Suite</code> (CAPS) library:
  5810. <div class="example">
  5811. <pre class="example">ladspa=file=caps:Click:c=c1=20'
  5812. </pre></div>
  5813. </li><li>
  5814. Apply <code>C* Eq10X2 - Stereo 10-band equaliser</code> effect:
  5815. <div class="example">
  5816. <pre class="example">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
  5817. </pre></div>
  5818. </li><li>
  5819. Increase volume by 20dB using fast lookahead limiter from Steve Harris
  5820. <code>SWH Plugins</code> collection:
  5821. <div class="example">
  5822. <pre class="example">ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
  5823. </pre></div>
  5824. </li><li>
  5825. Attenuate low frequencies using Multiband EQ from Steve Harris
  5826. <code>SWH Plugins</code> collection:
  5827. <div class="example">
  5828. <pre class="example">ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
  5829. </pre></div>
  5830. </li><li>
  5831. Reduce stereo image using <code>Narrower</code> from the <code>C* Audio Plugin Suite</code>
  5832. (CAPS) library:
  5833. <div class="example">
  5834. <pre class="example">ladspa=caps:Narrower
  5835. </pre></div>
  5836. </li><li>
  5837. Another white noise, now using <code>C* Audio Plugin Suite</code> (CAPS) library:
  5838. <div class="example">
  5839. <pre class="example">ladspa=caps:White:.2
  5840. </pre></div>
  5841. </li><li>
  5842. Some fractal noise, using <code>C* Audio Plugin Suite</code> (CAPS) library:
  5843. <div class="example">
  5844. <pre class="example">ladspa=caps:Fractal:c=c1=1
  5845. </pre></div>
  5846. </li><li>
  5847. Dynamic volume normalization using <code>VLevel</code> plugin:
  5848. <div class="example">
  5849. <pre class="example">ladspa=vlevel-ladspa:vlevel_mono
  5850. </pre></div>
  5851. </li></ul>
  5852. <a name="Commands-61"></a>
  5853. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-61">8.74.2 Commands</a></h3>
  5854. <p>This filter supports the following commands:
  5855. </p><dl compact="compact">
  5856. <dt>&lsquo;<samp>cN</samp>&rsquo;</dt>
  5857. <dd><p>Modify the <var>N</var>-th control value.
  5858. </p>
  5859. <p>If the specified value is not valid, it is ignored and prior one is kept.
  5860. </p></dd>
  5861. </dl>
  5862. <a name="loudnorm"></a>
  5863. <h2 class="section"><a href="ffmpeg-filters.html#toc-loudnorm">8.75 loudnorm</a></h2>
  5864. <p>EBU R128 loudness normalization. Includes both dynamic and linear normalization modes.
  5865. Support for both single pass (livestreams, files) and double pass (files) modes.
  5866. This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately
  5867. detect true peaks, the audio stream will be upsampled to 192 kHz.
  5868. Use the <code>-ar</code> option or <code>aresample</code> filter to explicitly set an output sample rate.
  5869. </p>
  5870. <p>The filter accepts the following options:
  5871. </p>
  5872. <dl compact="compact">
  5873. <dt>&lsquo;<samp>I, i</samp>&rsquo;</dt>
  5874. <dd><p>Set integrated loudness target.
  5875. Range is -70.0 - -5.0. Default value is -24.0.
  5876. </p>
  5877. </dd>
  5878. <dt>&lsquo;<samp>LRA, lra</samp>&rsquo;</dt>
  5879. <dd><p>Set loudness range target.
  5880. Range is 1.0 - 20.0. Default value is 7.0.
  5881. </p>
  5882. </dd>
  5883. <dt>&lsquo;<samp>TP, tp</samp>&rsquo;</dt>
  5884. <dd><p>Set maximum true peak.
  5885. Range is -9.0 - +0.0. Default value is -2.0.
  5886. </p>
  5887. </dd>
  5888. <dt>&lsquo;<samp>measured_I, measured_i</samp>&rsquo;</dt>
  5889. <dd><p>Measured IL of input file.
  5890. Range is -99.0 - +0.0.
  5891. </p>
  5892. </dd>
  5893. <dt>&lsquo;<samp>measured_LRA, measured_lra</samp>&rsquo;</dt>
  5894. <dd><p>Measured LRA of input file.
  5895. Range is 0.0 - 99.0.
  5896. </p>
  5897. </dd>
  5898. <dt>&lsquo;<samp>measured_TP, measured_tp</samp>&rsquo;</dt>
  5899. <dd><p>Measured true peak of input file.
  5900. Range is -99.0 - +99.0.
  5901. </p>
  5902. </dd>
  5903. <dt>&lsquo;<samp>measured_thresh</samp>&rsquo;</dt>
  5904. <dd><p>Measured threshold of input file.
  5905. Range is -99.0 - +0.0.
  5906. </p>
  5907. </dd>
  5908. <dt>&lsquo;<samp>offset</samp>&rsquo;</dt>
  5909. <dd><p>Set offset gain. Gain is applied before the true-peak limiter.
  5910. Range is -99.0 - +99.0. Default is +0.0.
  5911. </p>
  5912. </dd>
  5913. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  5914. <dd><p>Normalize by linearly scaling the source audio.
  5915. <code>measured_I</code>, <code>measured_LRA</code>, <code>measured_TP</code>,
  5916. and <code>measured_thresh</code> must all be specified. Target LRA shouldn&rsquo;t
  5917. be lower than source LRA and the change in integrated loudness shouldn&rsquo;t
  5918. result in a true peak which exceeds the target TP. If any of these
  5919. conditions aren&rsquo;t met, normalization mode will revert to <var>dynamic</var>.
  5920. Options are <code>true</code> or <code>false</code>. Default is <code>true</code>.
  5921. </p>
  5922. </dd>
  5923. <dt>&lsquo;<samp>dual_mono</samp>&rsquo;</dt>
  5924. <dd><p>Treat mono input files as &quot;dual-mono&quot;. If a mono file is intended for playback
  5925. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  5926. If set to <code>true</code>, this option will compensate for this effect.
  5927. Multi-channel input files are not affected by this option.
  5928. Options are true or false. Default is false.
  5929. </p>
  5930. </dd>
  5931. <dt>&lsquo;<samp>print_format</samp>&rsquo;</dt>
  5932. <dd><p>Set print format for stats. Options are summary, json, or none.
  5933. Default value is none.
  5934. </p></dd>
  5935. </dl>
  5936. <a name="lowpass"></a>
  5937. <h2 class="section"><a href="ffmpeg-filters.html#toc-lowpass">8.76 lowpass</a></h2>
  5938. <p>Apply a low-pass filter with 3dB point frequency.
  5939. The filter can be either single-pole or double-pole (the default).
  5940. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  5941. </p>
  5942. <p>The filter accepts the following options:
  5943. </p>
  5944. <dl compact="compact">
  5945. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  5946. <dd><p>Set frequency in Hz. Default is 500.
  5947. </p>
  5948. </dd>
  5949. <dt>&lsquo;<samp>poles, p</samp>&rsquo;</dt>
  5950. <dd><p>Set number of poles. Default is 2.
  5951. </p>
  5952. </dd>
  5953. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  5954. <dd><p>Set method to specify band-width of filter.
  5955. </p><dl compact="compact">
  5956. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  5957. <dd><p>Hz
  5958. </p></dd>
  5959. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  5960. <dd><p>Q-Factor
  5961. </p></dd>
  5962. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  5963. <dd><p>octave
  5964. </p></dd>
  5965. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  5966. <dd><p>slope
  5967. </p></dd>
  5968. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  5969. <dd><p>kHz
  5970. </p></dd>
  5971. </dl>
  5972. </dd>
  5973. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  5974. <dd><p>Specify the band-width of a filter in width_type units.
  5975. Applies only to double-pole filter.
  5976. The default is 0.707q and gives a Butterworth response.
  5977. </p>
  5978. </dd>
  5979. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  5980. <dd><p>How much to use filtered signal in output. Default is 1.
  5981. Range is between 0 and 1.
  5982. </p>
  5983. </dd>
  5984. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  5985. <dd><p>Specify which channels to filter, by default all available are filtered.
  5986. </p>
  5987. </dd>
  5988. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  5989. <dd><p>Normalize biquad coefficients, by default is disabled.
  5990. Enabling it will normalize magnitude response at DC to 0dB.
  5991. </p></dd>
  5992. </dl>
  5993. <a name="Examples-123"></a>
  5994. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-123">8.76.1 Examples</a></h3>
  5995. <ul>
  5996. <li>
  5997. Lowpass only LFE channel, it LFE is not present it does nothing:
  5998. <div class="example">
  5999. <pre class="example">lowpass=c=LFE
  6000. </pre></div>
  6001. </li></ul>
  6002. <a name="Commands-62"></a>
  6003. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-62">8.76.2 Commands</a></h3>
  6004. <p>This filter supports the following commands:
  6005. </p><dl compact="compact">
  6006. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  6007. <dd><p>Change lowpass frequency.
  6008. Syntax for the command is : &quot;<var>frequency</var>&quot;
  6009. </p>
  6010. </dd>
  6011. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  6012. <dd><p>Change lowpass width_type.
  6013. Syntax for the command is : &quot;<var>width_type</var>&quot;
  6014. </p>
  6015. </dd>
  6016. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  6017. <dd><p>Change lowpass width.
  6018. Syntax for the command is : &quot;<var>width</var>&quot;
  6019. </p>
  6020. </dd>
  6021. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  6022. <dd><p>Change lowpass mix.
  6023. Syntax for the command is : &quot;<var>mix</var>&quot;
  6024. </p></dd>
  6025. </dl>
  6026. <a name="lv2"></a>
  6027. <h2 class="section"><a href="ffmpeg-filters.html#toc-lv2">8.77 lv2</a></h2>
  6028. <p>Load a LV2 (LADSPA Version 2) plugin.
  6029. </p>
  6030. <p>To enable compilation of this filter you need to configure FFmpeg with
  6031. <code>--enable-lv2</code>.
  6032. </p>
  6033. <dl compact="compact">
  6034. <dt>&lsquo;<samp>plugin, p</samp>&rsquo;</dt>
  6035. <dd><p>Specifies the plugin URI. You may need to escape &rsquo;:&rsquo;.
  6036. </p>
  6037. </dd>
  6038. <dt>&lsquo;<samp>controls, c</samp>&rsquo;</dt>
  6039. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  6040. values that determine the behavior of the loaded plugin (for example delay,
  6041. threshold or gain).
  6042. If &lsquo;<samp>controls</samp>&rsquo; is set to <code>help</code>, all available controls and
  6043. their valid ranges are printed.
  6044. </p>
  6045. </dd>
  6046. <dt>&lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
  6047. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  6048. zero inputs.
  6049. </p>
  6050. </dd>
  6051. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  6052. <dd><p>Set the number of samples per channel per each output frame, default
  6053. is 1024. Only used if plugin have zero inputs.
  6054. </p>
  6055. </dd>
  6056. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  6057. <dd><p>Set the minimum duration of the sourced audio. See
  6058. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  6059. for the accepted syntax.
  6060. Note that the resulting duration may be greater than the specified duration,
  6061. as the generated audio is always cut at the end of a complete frame.
  6062. If not specified, or the expressed duration is negative, the audio is
  6063. supposed to be generated forever.
  6064. Only used if plugin have zero inputs.
  6065. </p></dd>
  6066. </dl>
  6067. <a name="Examples-116"></a>
  6068. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-116">8.77.1 Examples</a></h3>
  6069. <ul>
  6070. <li>
  6071. Apply bass enhancer plugin from Calf:
  6072. <div class="example">
  6073. <pre class="example">lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
  6074. </pre></div>
  6075. </li><li>
  6076. Apply vinyl plugin from Calf:
  6077. <div class="example">
  6078. <pre class="example">lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
  6079. </pre></div>
  6080. </li><li>
  6081. Apply bit crusher plugin from ArtyFX:
  6082. <div class="example">
  6083. <pre class="example">lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
  6084. </pre></div>
  6085. </li></ul>
  6086. <a name="mcompand"></a>
  6087. <h2 class="section"><a href="ffmpeg-filters.html#toc-mcompand">8.78 mcompand</a></h2>
  6088. <p>Multiband Compress or expand the audio&rsquo;s dynamic range.
  6089. </p>
  6090. <p>The input audio is divided into bands using 4th order Linkwitz-Riley IIRs.
  6091. This is akin to the crossover of a loudspeaker, and results in flat frequency
  6092. response when absent compander action.
  6093. </p>
  6094. <p>It accepts the following parameters:
  6095. </p>
  6096. <dl compact="compact">
  6097. <dt>&lsquo;<samp>args</samp>&rsquo;</dt>
  6098. <dd><p>This option syntax is:
  6099. attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ...
  6100. For explanation of each item refer to compand filter documentation.
  6101. </p></dd>
  6102. </dl>
  6103. <p><a name="pan"></a>
  6104. </p><a name="pan-1"></a>
  6105. <h2 class="section"><a href="ffmpeg-filters.html#toc-pan-1">8.79 pan</a></h2>
  6106. <p>Mix channels with specific gain levels. The filter accepts the output
  6107. channel layout followed by a set of channels definitions.
  6108. </p>
  6109. <p>This filter is also designed to efficiently remap the channels of an audio
  6110. stream.
  6111. </p>
  6112. <p>The filter accepts parameters of the form:
  6113. &quot;<var>l</var>|<var>outdef</var>|<var>outdef</var>|...&quot;
  6114. </p>
  6115. <dl compact="compact">
  6116. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  6117. <dd><p>output channel layout or number of channels
  6118. </p>
  6119. </dd>
  6120. <dt>&lsquo;<samp>outdef</samp>&rsquo;</dt>
  6121. <dd><p>output channel specification, of the form:
  6122. &quot;<var>out_name</var>=[<var>gain</var>*]<var>in_name</var>[(+-)[<var>gain</var>*]<var>in_name</var>...]&quot;
  6123. </p>
  6124. </dd>
  6125. <dt>&lsquo;<samp>out_name</samp>&rsquo;</dt>
  6126. <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
  6127. number (c0, c1, etc.)
  6128. </p>
  6129. </dd>
  6130. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  6131. <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
  6132. </p>
  6133. </dd>
  6134. <dt>&lsquo;<samp>in_name</samp>&rsquo;</dt>
  6135. <dd><p>input channel to use, see out_name for details; it is not possible to mix
  6136. named and numbered input channels
  6137. </p></dd>
  6138. </dl>
  6139. <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
  6140. that specification will be renormalized so that the total is 1, thus
  6141. avoiding clipping noise.
  6142. </p>
  6143. <a name="Mixing-examples"></a>
  6144. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Mixing-examples">8.79.1 Mixing examples</a></h3>
  6145. <p>For example, if you want to down-mix from stereo to mono, but with a bigger
  6146. factor for the left channel:
  6147. </p><div class="example">
  6148. <pre class="example">pan=1c|c0=0.9*c0+0.1*c1
  6149. </pre></div>
  6150. <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
  6151. 7-channels surround:
  6152. </p><div class="example">
  6153. <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
  6154. </pre></div>
  6155. <p>Note that <code>ffmpeg</code> integrates a default down-mix (and up-mix) system
  6156. that should be preferred (see &quot;-ac&quot; option) unless you have very specific
  6157. needs.
  6158. </p>
  6159. <a name="Remapping-examples"></a>
  6160. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Remapping-examples">8.79.2 Remapping examples</a></h3>
  6161. <p>The channel remapping will be effective if, and only if:
  6162. </p>
  6163. <ul>
  6164. <li> gain coefficients are zeroes or ones,
  6165. </li><li> only one input per channel output,
  6166. </li></ul>
  6167. <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
  6168. channel mapping detected&quot;), and use an optimized and lossless method to do the
  6169. remapping.
  6170. </p>
  6171. <p>For example, if you have a 5.1 source and want a stereo audio stream by
  6172. dropping the extra channels:
  6173. </p><div class="example">
  6174. <pre class="example">pan=&quot;stereo| c0=FL | c1=FR&quot;
  6175. </pre></div>
  6176. <p>Given the same source, you can also switch front left and front right channels
  6177. and keep the input channel layout:
  6178. </p><div class="example">
  6179. <pre class="example">pan=&quot;5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5&quot;
  6180. </pre></div>
  6181. <p>If the input is a stereo audio stream, you can mute the front left channel (and
  6182. still keep the stereo channel layout) with:
  6183. </p><div class="example">
  6184. <pre class="example">pan=&quot;stereo|c1=c1&quot;
  6185. </pre></div>
  6186. <p>Still with a stereo audio stream input, you can copy the right channel in both
  6187. front left and right:
  6188. </p><div class="example">
  6189. <pre class="example">pan=&quot;stereo| c0=FR | c1=FR&quot;
  6190. </pre></div>
  6191. <a name="replaygain"></a>
  6192. <h2 class="section"><a href="ffmpeg-filters.html#toc-replaygain">8.80 replaygain</a></h2>
  6193. <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
  6194. outputs it unchanged.
  6195. At end of filtering it displays <code>track_gain</code> and <code>track_peak</code>.
  6196. </p>
  6197. <a name="resample"></a>
  6198. <h2 class="section"><a href="ffmpeg-filters.html#toc-resample">8.81 resample</a></h2>
  6199. <p>Convert the audio sample format, sample rate and channel layout. It is
  6200. not meant to be used directly.
  6201. </p>
  6202. <a name="rubberband"></a>
  6203. <h2 class="section"><a href="ffmpeg-filters.html#toc-rubberband">8.82 rubberband</a></h2>
  6204. <p>Apply time-stretching and pitch-shifting with librubberband.
  6205. </p>
  6206. <p>To enable compilation of this filter, you need to configure FFmpeg with
  6207. <code>--enable-librubberband</code>.
  6208. </p>
  6209. <p>The filter accepts the following options:
  6210. </p>
  6211. <dl compact="compact">
  6212. <dt>&lsquo;<samp>tempo</samp>&rsquo;</dt>
  6213. <dd><p>Set tempo scale factor.
  6214. </p>
  6215. </dd>
  6216. <dt>&lsquo;<samp>pitch</samp>&rsquo;</dt>
  6217. <dd><p>Set pitch scale factor.
  6218. </p>
  6219. </dd>
  6220. <dt>&lsquo;<samp>transients</samp>&rsquo;</dt>
  6221. <dd><p>Set transients detector.
  6222. Possible values are:
  6223. </p><dl compact="compact">
  6224. <dt><var>crisp</var></dt>
  6225. <dt><var>mixed</var></dt>
  6226. <dt><var>smooth</var></dt>
  6227. </dl>
  6228. </dd>
  6229. <dt>&lsquo;<samp>detector</samp>&rsquo;</dt>
  6230. <dd><p>Set detector.
  6231. Possible values are:
  6232. </p><dl compact="compact">
  6233. <dt><var>compound</var></dt>
  6234. <dt><var>percussive</var></dt>
  6235. <dt><var>soft</var></dt>
  6236. </dl>
  6237. </dd>
  6238. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  6239. <dd><p>Set phase.
  6240. Possible values are:
  6241. </p><dl compact="compact">
  6242. <dt><var>laminar</var></dt>
  6243. <dt><var>independent</var></dt>
  6244. </dl>
  6245. </dd>
  6246. <dt>&lsquo;<samp>window</samp>&rsquo;</dt>
  6247. <dd><p>Set processing window size.
  6248. Possible values are:
  6249. </p><dl compact="compact">
  6250. <dt><var>standard</var></dt>
  6251. <dt><var>short</var></dt>
  6252. <dt><var>long</var></dt>
  6253. </dl>
  6254. </dd>
  6255. <dt>&lsquo;<samp>smoothing</samp>&rsquo;</dt>
  6256. <dd><p>Set smoothing.
  6257. Possible values are:
  6258. </p><dl compact="compact">
  6259. <dt><var>off</var></dt>
  6260. <dt><var>on</var></dt>
  6261. </dl>
  6262. </dd>
  6263. <dt>&lsquo;<samp>formant</samp>&rsquo;</dt>
  6264. <dd><p>Enable formant preservation when shift pitching.
  6265. Possible values are:
  6266. </p><dl compact="compact">
  6267. <dt><var>shifted</var></dt>
  6268. <dt><var>preserved</var></dt>
  6269. </dl>
  6270. </dd>
  6271. <dt>&lsquo;<samp>pitchq</samp>&rsquo;</dt>
  6272. <dd><p>Set pitch quality.
  6273. Possible values are:
  6274. </p><dl compact="compact">
  6275. <dt><var>quality</var></dt>
  6276. <dt><var>speed</var></dt>
  6277. <dt><var>consistency</var></dt>
  6278. </dl>
  6279. </dd>
  6280. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  6281. <dd><p>Set channels.
  6282. Possible values are:
  6283. </p><dl compact="compact">
  6284. <dt><var>apart</var></dt>
  6285. <dt><var>together</var></dt>
  6286. </dl>
  6287. </dd>
  6288. </dl>
  6289. <a name="Commands-44"></a>
  6290. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-44">8.82.1 Commands</a></h3>
  6291. <p>This filter supports the following commands:
  6292. </p><dl compact="compact">
  6293. <dt>&lsquo;<samp>tempo</samp>&rsquo;</dt>
  6294. <dd><p>Change filter tempo scale factor.
  6295. Syntax for the command is : &quot;<var>tempo</var>&quot;
  6296. </p>
  6297. </dd>
  6298. <dt>&lsquo;<samp>pitch</samp>&rsquo;</dt>
  6299. <dd><p>Change filter pitch scale factor.
  6300. Syntax for the command is : &quot;<var>pitch</var>&quot;
  6301. </p></dd>
  6302. </dl>
  6303. <a name="sidechaincompress"></a>
  6304. <h2 class="section"><a href="ffmpeg-filters.html#toc-sidechaincompress">8.83 sidechaincompress</a></h2>
  6305. <p>This filter acts like normal compressor but has the ability to compress
  6306. detected signal using second input signal.
  6307. It needs two input streams and returns one output stream.
  6308. First input stream will be processed depending on second stream signal.
  6309. The filtered signal then can be filtered with other filters in later stages of
  6310. processing. See <a href="#pan">pan</a> and <a href="#amerge">amerge</a> filter.
  6311. </p>
  6312. <p>The filter accepts the following options:
  6313. </p>
  6314. <dl compact="compact">
  6315. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  6316. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  6317. </p>
  6318. </dd>
  6319. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  6320. <dd><p>Set mode of compressor operation. Can be <code>upward</code> or <code>downward</code>.
  6321. Default is <code>downward</code>.
  6322. </p>
  6323. </dd>
  6324. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  6325. <dd><p>If a signal of second stream raises above this level it will affect the gain
  6326. reduction of first stream.
  6327. By default is 0.125. Range is between 0.00097563 and 1.
  6328. </p>
  6329. </dd>
  6330. <dt>&lsquo;<samp>ratio</samp>&rsquo;</dt>
  6331. <dd><p>Set a ratio about which the signal is reduced. 1:2 means that if the level
  6332. raised 4dB above the threshold, it will be only 2dB above after the reduction.
  6333. Default is 2. Range is between 1 and 20.
  6334. </p>
  6335. </dd>
  6336. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  6337. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  6338. reduction starts. Default is 20. Range is between 0.01 and 2000.
  6339. </p>
  6340. </dd>
  6341. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  6342. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  6343. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  6344. </p>
  6345. </dd>
  6346. <dt>&lsquo;<samp>makeup</samp>&rsquo;</dt>
  6347. <dd><p>Set the amount by how much signal will be amplified after processing.
  6348. Default is 1. Range is from 1 to 64.
  6349. </p>
  6350. </dd>
  6351. <dt>&lsquo;<samp>knee</samp>&rsquo;</dt>
  6352. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  6353. Default is 2.82843. Range is between 1 and 8.
  6354. </p>
  6355. </dd>
  6356. <dt>&lsquo;<samp>link</samp>&rsquo;</dt>
  6357. <dd><p>Choose if the <code>average</code> level between all channels of side-chain stream
  6358. or the louder(<code>maximum</code>) channel of side-chain stream affects the
  6359. reduction. Default is <code>average</code>.
  6360. </p>
  6361. </dd>
  6362. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  6363. <dd><p>Should the exact signal be taken in case of <code>peak</code> or an RMS one in case
  6364. of <code>rms</code>. Default is <code>rms</code> which is mainly smoother.
  6365. </p>
  6366. </dd>
  6367. <dt>&lsquo;<samp>level_sc</samp>&rsquo;</dt>
  6368. <dd><p>Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
  6369. </p>
  6370. </dd>
  6371. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  6372. <dd><p>How much to use compressed signal in output. Default is 1.
  6373. Range is between 0 and 1.
  6374. </p></dd>
  6375. </dl>
  6376. <a name="Commands-35"></a>
  6377. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-35">8.83.1 Commands</a></h3>
  6378. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  6379. </p>
  6380. <a name="Examples-137"></a>
  6381. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-137">8.83.2 Examples</a></h3>
  6382. <ul>
  6383. <li>
  6384. Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
  6385. depending on the signal of 2nd input and later compressed signal to be
  6386. merged with 2nd input:
  6387. <div class="example">
  6388. <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;
  6389. </pre></div>
  6390. </li></ul>
  6391. <a name="sidechaingate"></a>
  6392. <h2 class="section"><a href="ffmpeg-filters.html#toc-sidechaingate">8.84 sidechaingate</a></h2>
  6393. <p>A sidechain gate acts like a normal (wideband) gate but has the ability to
  6394. filter the detected signal before sending it to the gain reduction stage.
  6395. Normally a gate uses the full range signal to detect a level above the
  6396. threshold.
  6397. For example: If you cut all lower frequencies from your sidechain signal
  6398. the gate will decrease the volume of your track only if not enough highs
  6399. appear. With this technique you are able to reduce the resonation of a
  6400. natural drum or remove &quot;rumbling&quot; of muted strokes from a heavily distorted
  6401. guitar.
  6402. It needs two input streams and returns one output stream.
  6403. First input stream will be processed depending on second stream signal.
  6404. </p>
  6405. <p>The filter accepts the following options:
  6406. </p>
  6407. <dl compact="compact">
  6408. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  6409. <dd><p>Set input level before filtering.
  6410. Default is 1. Allowed range is from 0.015625 to 64.
  6411. </p>
  6412. </dd>
  6413. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  6414. <dd><p>Set the mode of operation. Can be <code>upward</code> or <code>downward</code>.
  6415. Default is <code>downward</code>. If set to <code>upward</code> mode, higher parts of signal
  6416. will be amplified, expanding dynamic range in upward direction.
  6417. Otherwise, in case of <code>downward</code> lower parts of signal will be reduced.
  6418. </p>
  6419. </dd>
  6420. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  6421. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  6422. Default is 0.06125. Allowed range is from 0 to 1.
  6423. Setting this to 0 disables reduction and then filter behaves like expander.
  6424. </p>
  6425. </dd>
  6426. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  6427. <dd><p>If a signal rises above this level the gain reduction is released.
  6428. Default is 0.125. Allowed range is from 0 to 1.
  6429. </p>
  6430. </dd>
  6431. <dt>&lsquo;<samp>ratio</samp>&rsquo;</dt>
  6432. <dd><p>Set a ratio about which the signal is reduced.
  6433. Default is 2. Allowed range is from 1 to 9000.
  6434. </p>
  6435. </dd>
  6436. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  6437. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  6438. reduction stops.
  6439. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  6440. </p>
  6441. </dd>
  6442. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  6443. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  6444. reduction is increased again. Default is 250 milliseconds.
  6445. Allowed range is from 0.01 to 9000.
  6446. </p>
  6447. </dd>
  6448. <dt>&lsquo;<samp>makeup</samp>&rsquo;</dt>
  6449. <dd><p>Set amount of amplification of signal after processing.
  6450. Default is 1. Allowed range is from 1 to 64.
  6451. </p>
  6452. </dd>
  6453. <dt>&lsquo;<samp>knee</samp>&rsquo;</dt>
  6454. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  6455. Default is 2.828427125. Allowed range is from 1 to 8.
  6456. </p>
  6457. </dd>
  6458. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  6459. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  6460. Default is rms. Can be peak or rms.
  6461. </p>
  6462. </dd>
  6463. <dt>&lsquo;<samp>link</samp>&rsquo;</dt>
  6464. <dd><p>Choose if the average level between all channels or the louder channel affects
  6465. the reduction.
  6466. Default is average. Can be average or maximum.
  6467. </p>
  6468. </dd>
  6469. <dt>&lsquo;<samp>level_sc</samp>&rsquo;</dt>
  6470. <dd><p>Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
  6471. </p></dd>
  6472. </dl>
  6473. <a name="silencedetect"></a>
  6474. <h2 class="section"><a href="ffmpeg-filters.html#toc-silencedetect">8.85 silencedetect</a></h2>
  6475. <p>Detect silence in an audio stream.
  6476. </p>
  6477. <p>This filter logs a message when it detects that the input audio volume is less
  6478. or equal to a noise tolerance value for a duration greater or equal to the
  6479. minimum detected noise duration.
  6480. </p>
  6481. <p>The printed times and duration are expressed in seconds. The
  6482. <code>lavfi.silence_start</code> or <code>lavfi.silence_start.X</code> metadata key
  6483. is set on the first frame whose timestamp equals or exceeds the detection
  6484. duration and it contains the timestamp of the first frame of the silence.
  6485. </p>
  6486. <p>The <code>lavfi.silence_duration</code> or <code>lavfi.silence_duration.X</code>
  6487. and <code>lavfi.silence_end</code> or <code>lavfi.silence_end.X</code> metadata
  6488. keys are set on the first frame after the silence. If &lsquo;<samp>mono</samp>&rsquo; is
  6489. enabled, and each channel is evaluated separately, the <code>.X</code>
  6490. suffixed keys are used, and <code>X</code> corresponds to the channel number.
  6491. </p>
  6492. <p>The filter accepts the following options:
  6493. </p>
  6494. <dl compact="compact">
  6495. <dt>&lsquo;<samp>noise, n</samp>&rsquo;</dt>
  6496. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  6497. specified value) or amplitude ratio. Default is -60dB, or 0.001.
  6498. </p>
  6499. </dd>
  6500. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  6501. <dd><p>Set silence duration until notification (default is 2 seconds). See
  6502. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  6503. for the accepted syntax.
  6504. </p>
  6505. </dd>
  6506. <dt>&lsquo;<samp>mono, m</samp>&rsquo;</dt>
  6507. <dd><p>Process each channel separately, instead of combined. By default is disabled.
  6508. </p></dd>
  6509. </dl>
  6510. <a name="Examples-133"></a>
  6511. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-133">8.85.1 Examples</a></h3>
  6512. <ul>
  6513. <li>
  6514. Detect 5 seconds of silence with -50dB noise tolerance:
  6515. <div class="example">
  6516. <pre class="example">silencedetect=n=-50dB:d=5
  6517. </pre></div>
  6518. </li><li>
  6519. Complete example with <code>ffmpeg</code> to detect silence with 0.0001 noise
  6520. tolerance in &lsquo;<tt>silence.mp3</tt>&rsquo;:
  6521. <div class="example">
  6522. <pre class="example">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
  6523. </pre></div>
  6524. </li></ul>
  6525. <a name="silenceremove"></a>
  6526. <h2 class="section"><a href="ffmpeg-filters.html#toc-silenceremove">8.86 silenceremove</a></h2>
  6527. <p>Remove silence from the beginning, middle or end of the audio.
  6528. </p>
  6529. <p>The filter accepts the following options:
  6530. </p>
  6531. <dl compact="compact">
  6532. <dt>&lsquo;<samp>start_periods</samp>&rsquo;</dt>
  6533. <dd><p>This value is used to indicate if audio should be trimmed at beginning of
  6534. the audio. A value of zero indicates no silence should be trimmed from the
  6535. beginning. When specifying a non-zero value, it trims audio up until it
  6536. finds non-silence. Normally, when trimming silence from beginning of audio
  6537. the <var>start_periods</var> will be <code>1</code> but it can be increased to higher
  6538. values to trim all audio up to specific count of non-silence periods.
  6539. Default value is <code>0</code>.
  6540. </p>
  6541. </dd>
  6542. <dt>&lsquo;<samp>start_duration</samp>&rsquo;</dt>
  6543. <dd><p>Specify the amount of time that non-silence must be detected before it stops
  6544. trimming audio. By increasing the duration, bursts of noises can be treated
  6545. as silence and trimmed off. Default value is <code>0</code>.
  6546. </p>
  6547. </dd>
  6548. <dt>&lsquo;<samp>start_threshold</samp>&rsquo;</dt>
  6549. <dd><p>This indicates what sample value should be treated as silence. For digital
  6550. audio, a value of <code>0</code> may be fine but for audio recorded from analog,
  6551. you may wish to increase the value to account for background noise.
  6552. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  6553. or amplitude ratio. Default value is <code>0</code>.
  6554. </p>
  6555. </dd>
  6556. <dt>&lsquo;<samp>start_silence</samp>&rsquo;</dt>
  6557. <dd><p>Specify max duration of silence at beginning that will be kept after
  6558. trimming. Default is 0, which is equal to trimming all samples detected
  6559. as silence.
  6560. </p>
  6561. </dd>
  6562. <dt>&lsquo;<samp>start_mode</samp>&rsquo;</dt>
  6563. <dd><p>Specify mode of detection of silence end in start of multi-channel audio.
  6564. Can be <var>any</var> or <var>all</var>. Default is <var>any</var>.
  6565. With <var>any</var>, any sample that is detected as non-silence will cause
  6566. stopped trimming of silence.
  6567. With <var>all</var>, only if all channels are detected as non-silence will cause
  6568. stopped trimming of silence.
  6569. </p>
  6570. </dd>
  6571. <dt>&lsquo;<samp>stop_periods</samp>&rsquo;</dt>
  6572. <dd><p>Set the count for trimming silence from the end of audio.
  6573. To remove silence from the middle of a file, specify a <var>stop_periods</var>
  6574. that is negative. This value is then treated as a positive value and is
  6575. used to indicate the effect should restart processing as specified by
  6576. <var>start_periods</var>, making it suitable for removing periods of silence
  6577. in the middle of the audio.
  6578. Default value is <code>0</code>.
  6579. </p>
  6580. </dd>
  6581. <dt>&lsquo;<samp>stop_duration</samp>&rsquo;</dt>
  6582. <dd><p>Specify a duration of silence that must exist before audio is not copied any
  6583. more. By specifying a higher duration, silence that is wanted can be left in
  6584. the audio.
  6585. Default value is <code>0</code>.
  6586. </p>
  6587. </dd>
  6588. <dt>&lsquo;<samp>stop_threshold</samp>&rsquo;</dt>
  6589. <dd><p>This is the same as &lsquo;<samp>start_threshold</samp>&rsquo; but for trimming silence from
  6590. the end of audio.
  6591. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  6592. or amplitude ratio. Default value is <code>0</code>.
  6593. </p>
  6594. </dd>
  6595. <dt>&lsquo;<samp>stop_silence</samp>&rsquo;</dt>
  6596. <dd><p>Specify max duration of silence at end that will be kept after
  6597. trimming. Default is 0, which is equal to trimming all samples detected
  6598. as silence.
  6599. </p>
  6600. </dd>
  6601. <dt>&lsquo;<samp>stop_mode</samp>&rsquo;</dt>
  6602. <dd><p>Specify mode of detection of silence start in end of multi-channel audio.
  6603. Can be <var>any</var> or <var>all</var>. Default is <var>any</var>.
  6604. With <var>any</var>, any sample that is detected as non-silence will cause
  6605. stopped trimming of silence.
  6606. With <var>all</var>, only if all channels are detected as non-silence will cause
  6607. stopped trimming of silence.
  6608. </p>
  6609. </dd>
  6610. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  6611. <dd><p>Set how is silence detected. Can be <code>rms</code> or <code>peak</code>. Second is faster
  6612. and works better with digital silence which is exactly 0.
  6613. Default value is <code>rms</code>.
  6614. </p>
  6615. </dd>
  6616. <dt>&lsquo;<samp>window</samp>&rsquo;</dt>
  6617. <dd><p>Set duration in number of seconds used to calculate size of window in number
  6618. of samples for detecting silence.
  6619. Default value is <code>0.02</code>. Allowed range is from <code>0</code> to <code>10</code>.
  6620. </p></dd>
  6621. </dl>
  6622. <a name="Examples-57"></a>
  6623. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-57">8.86.1 Examples</a></h3>
  6624. <ul>
  6625. <li>
  6626. The following example shows how this filter can be used to start a recording
  6627. that does not contain the delay at the start which usually occurs between
  6628. pressing the record button and the start of the performance:
  6629. <div class="example">
  6630. <pre class="example">silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
  6631. </pre></div>
  6632. </li><li>
  6633. Trim all silence encountered from beginning to end where there is more than 1
  6634. second of silence in audio:
  6635. <div class="example">
  6636. <pre class="example">silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
  6637. </pre></div>
  6638. </li><li>
  6639. Trim all digital silence samples, using peak detection, from beginning to end
  6640. where there is more than 0 samples of digital silence in audio and digital
  6641. silence is detected in all channels at same positions in stream:
  6642. <div class="example">
  6643. <pre class="example">silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
  6644. </pre></div>
  6645. </li></ul>
  6646. <a name="sofalizer"></a>
  6647. <h2 class="section"><a href="ffmpeg-filters.html#toc-sofalizer">8.87 sofalizer</a></h2>
  6648. <p>SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
  6649. loudspeakers around the user for binaural listening via headphones (audio
  6650. formats up to 9 channels supported).
  6651. The HRTFs are stored in SOFA files (see <a href="http://www.sofacoustics.org/">http://www.sofacoustics.org/</a> for a database).
  6652. SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
  6653. Austrian Academy of Sciences.
  6654. </p>
  6655. <p>To enable compilation of this filter you need to configure FFmpeg with
  6656. <code>--enable-libmysofa</code>.
  6657. </p>
  6658. <p>The filter accepts the following options:
  6659. </p>
  6660. <dl compact="compact">
  6661. <dt>&lsquo;<samp>sofa</samp>&rsquo;</dt>
  6662. <dd><p>Set the SOFA file used for rendering.
  6663. </p>
  6664. </dd>
  6665. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  6666. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  6667. </p>
  6668. </dd>
  6669. <dt>&lsquo;<samp>rotation</samp>&rsquo;</dt>
  6670. <dd><p>Set rotation of virtual loudspeakers in deg. Default is 0.
  6671. </p>
  6672. </dd>
  6673. <dt>&lsquo;<samp>elevation</samp>&rsquo;</dt>
  6674. <dd><p>Set elevation of virtual speakers in deg. Default is 0.
  6675. </p>
  6676. </dd>
  6677. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  6678. <dd><p>Set distance in meters between loudspeakers and the listener with near-field
  6679. HRTFs. Default is 1.
  6680. </p>
  6681. </dd>
  6682. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  6683. <dd><p>Set processing type. Can be <var>time</var> or <var>freq</var>. <var>time</var> is
  6684. processing audio in time domain which is slow.
  6685. <var>freq</var> is processing audio in frequency domain which is fast.
  6686. Default is <var>freq</var>.
  6687. </p>
  6688. </dd>
  6689. <dt>&lsquo;<samp>speakers</samp>&rsquo;</dt>
  6690. <dd><p>Set custom positions of virtual loudspeakers. Syntax for this option is:
  6691. &lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;[|&lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;|...].
  6692. Each virtual loudspeaker is described with short channel name following with
  6693. azimuth and elevation in degrees.
  6694. Each virtual loudspeaker description is separated by &rsquo;|&rsquo;.
  6695. For example to override front left and front right channel positions use:
  6696. &rsquo;speakers=FL 45 15|FR 345 15&rsquo;.
  6697. Descriptions with unrecognised channel names are ignored.
  6698. </p>
  6699. </dd>
  6700. <dt>&lsquo;<samp>lfegain</samp>&rsquo;</dt>
  6701. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  6702. </p>
  6703. </dd>
  6704. <dt>&lsquo;<samp>framesize</samp>&rsquo;</dt>
  6705. <dd><p>Set custom frame size in number of samples. Default is 1024.
  6706. Allowed range is from 1024 to 96000. Only used if option &lsquo;<samp>type</samp>&rsquo;
  6707. is set to <var>freq</var>.
  6708. </p>
  6709. </dd>
  6710. <dt>&lsquo;<samp>normalize</samp>&rsquo;</dt>
  6711. <dd><p>Should all IRs be normalized upon importing SOFA file.
  6712. By default is enabled.
  6713. </p>
  6714. </dd>
  6715. <dt>&lsquo;<samp>interpolate</samp>&rsquo;</dt>
  6716. <dd><p>Should nearest IRs be interpolated with neighbor IRs if exact position
  6717. does not match. By default is disabled.
  6718. </p>
  6719. </dd>
  6720. <dt>&lsquo;<samp>minphase</samp>&rsquo;</dt>
  6721. <dd><p>Minphase all IRs upon loading of SOFA file. By default is disabled.
  6722. </p>
  6723. </dd>
  6724. <dt>&lsquo;<samp>anglestep</samp>&rsquo;</dt>
  6725. <dd><p>Set neighbor search angle step. Only used if option <var>interpolate</var> is enabled.
  6726. </p>
  6727. </dd>
  6728. <dt>&lsquo;<samp>radstep</samp>&rsquo;</dt>
  6729. <dd><p>Set neighbor search radius step. Only used if option <var>interpolate</var> is enabled.
  6730. </p></dd>
  6731. </dl>
  6732. <a name="Examples-68"></a>
  6733. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-68">8.87.1 Examples</a></h3>
  6734. <ul>
  6735. <li>
  6736. Using ClubFritz6 sofa file:
  6737. <div class="example">
  6738. <pre class="example">sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
  6739. </pre></div>
  6740. </li><li>
  6741. Using ClubFritz12 sofa file and bigger radius with small rotation:
  6742. <div class="example">
  6743. <pre class="example">sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
  6744. </pre></div>
  6745. </li><li>
  6746. Similar as above but with custom speaker positions for front left, front right, back left and back right
  6747. and also with custom gain:
  6748. <div class="example">
  6749. <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;
  6750. </pre></div>
  6751. </li></ul>
  6752. <a name="stereotools"></a>
  6753. <h2 class="section"><a href="ffmpeg-filters.html#toc-stereotools">8.88 stereotools</a></h2>
  6754. <p>This filter has some handy utilities to manage stereo signals, for converting
  6755. M/S stereo recordings to L/R signal while having control over the parameters
  6756. or spreading the stereo image of master track.
  6757. </p>
  6758. <p>The filter accepts the following options:
  6759. </p>
  6760. <dl compact="compact">
  6761. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  6762. <dd><p>Set input level before filtering for both channels. Defaults is 1.
  6763. Allowed range is from 0.015625 to 64.
  6764. </p>
  6765. </dd>
  6766. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  6767. <dd><p>Set output level after filtering for both channels. Defaults is 1.
  6768. Allowed range is from 0.015625 to 64.
  6769. </p>
  6770. </dd>
  6771. <dt>&lsquo;<samp>balance_in</samp>&rsquo;</dt>
  6772. <dd><p>Set input balance between both channels. Default is 0.
  6773. Allowed range is from -1 to 1.
  6774. </p>
  6775. </dd>
  6776. <dt>&lsquo;<samp>balance_out</samp>&rsquo;</dt>
  6777. <dd><p>Set output balance between both channels. Default is 0.
  6778. Allowed range is from -1 to 1.
  6779. </p>
  6780. </dd>
  6781. <dt>&lsquo;<samp>softclip</samp>&rsquo;</dt>
  6782. <dd><p>Enable softclipping. Results in analog distortion instead of harsh digital 0dB
  6783. clipping. Disabled by default.
  6784. </p>
  6785. </dd>
  6786. <dt>&lsquo;<samp>mutel</samp>&rsquo;</dt>
  6787. <dd><p>Mute the left channel. Disabled by default.
  6788. </p>
  6789. </dd>
  6790. <dt>&lsquo;<samp>muter</samp>&rsquo;</dt>
  6791. <dd><p>Mute the right channel. Disabled by default.
  6792. </p>
  6793. </dd>
  6794. <dt>&lsquo;<samp>phasel</samp>&rsquo;</dt>
  6795. <dd><p>Change the phase of the left channel. Disabled by default.
  6796. </p>
  6797. </dd>
  6798. <dt>&lsquo;<samp>phaser</samp>&rsquo;</dt>
  6799. <dd><p>Change the phase of the right channel. Disabled by default.
  6800. </p>
  6801. </dd>
  6802. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  6803. <dd><p>Set stereo mode. Available values are:
  6804. </p>
  6805. <dl compact="compact">
  6806. <dt>&lsquo;<samp>lr&gt;lr</samp>&rsquo;</dt>
  6807. <dd><p>Left/Right to Left/Right, this is default.
  6808. </p>
  6809. </dd>
  6810. <dt>&lsquo;<samp>lr&gt;ms</samp>&rsquo;</dt>
  6811. <dd><p>Left/Right to Mid/Side.
  6812. </p>
  6813. </dd>
  6814. <dt>&lsquo;<samp>ms&gt;lr</samp>&rsquo;</dt>
  6815. <dd><p>Mid/Side to Left/Right.
  6816. </p>
  6817. </dd>
  6818. <dt>&lsquo;<samp>lr&gt;ll</samp>&rsquo;</dt>
  6819. <dd><p>Left/Right to Left/Left.
  6820. </p>
  6821. </dd>
  6822. <dt>&lsquo;<samp>lr&gt;rr</samp>&rsquo;</dt>
  6823. <dd><p>Left/Right to Right/Right.
  6824. </p>
  6825. </dd>
  6826. <dt>&lsquo;<samp>lr&gt;l+r</samp>&rsquo;</dt>
  6827. <dd><p>Left/Right to Left + Right.
  6828. </p>
  6829. </dd>
  6830. <dt>&lsquo;<samp>lr&gt;rl</samp>&rsquo;</dt>
  6831. <dd><p>Left/Right to Right/Left.
  6832. </p>
  6833. </dd>
  6834. <dt>&lsquo;<samp>ms&gt;ll</samp>&rsquo;</dt>
  6835. <dd><p>Mid/Side to Left/Left.
  6836. </p>
  6837. </dd>
  6838. <dt>&lsquo;<samp>ms&gt;rr</samp>&rsquo;</dt>
  6839. <dd><p>Mid/Side to Right/Right.
  6840. </p></dd>
  6841. </dl>
  6842. </dd>
  6843. <dt>&lsquo;<samp>slev</samp>&rsquo;</dt>
  6844. <dd><p>Set level of side signal. Default is 1.
  6845. Allowed range is from 0.015625 to 64.
  6846. </p>
  6847. </dd>
  6848. <dt>&lsquo;<samp>sbal</samp>&rsquo;</dt>
  6849. <dd><p>Set balance of side signal. Default is 0.
  6850. Allowed range is from -1 to 1.
  6851. </p>
  6852. </dd>
  6853. <dt>&lsquo;<samp>mlev</samp>&rsquo;</dt>
  6854. <dd><p>Set level of the middle signal. Default is 1.
  6855. Allowed range is from 0.015625 to 64.
  6856. </p>
  6857. </dd>
  6858. <dt>&lsquo;<samp>mpan</samp>&rsquo;</dt>
  6859. <dd><p>Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
  6860. </p>
  6861. </dd>
  6862. <dt>&lsquo;<samp>base</samp>&rsquo;</dt>
  6863. <dd><p>Set stereo base between mono and inversed channels. Default is 0.
  6864. Allowed range is from -1 to 1.
  6865. </p>
  6866. </dd>
  6867. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  6868. <dd><p>Set delay in milliseconds how much to delay left from right channel and
  6869. vice versa. Default is 0. Allowed range is from -20 to 20.
  6870. </p>
  6871. </dd>
  6872. <dt>&lsquo;<samp>sclevel</samp>&rsquo;</dt>
  6873. <dd><p>Set S/C level. Default is 1. Allowed range is from 1 to 100.
  6874. </p>
  6875. </dd>
  6876. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  6877. <dd><p>Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
  6878. </p>
  6879. </dd>
  6880. <dt>&lsquo;<samp>bmode_in, bmode_out</samp>&rsquo;</dt>
  6881. <dd><p>Set balance mode for balance_in/balance_out option.
  6882. </p>
  6883. <p>Can be one of the following:
  6884. </p>
  6885. <dl compact="compact">
  6886. <dt>&lsquo;<samp>balance</samp>&rsquo;</dt>
  6887. <dd><p>Classic balance mode. Attenuate one channel at time.
  6888. Gain is raised up to 1.
  6889. </p>
  6890. </dd>
  6891. <dt>&lsquo;<samp>amplitude</samp>&rsquo;</dt>
  6892. <dd><p>Similar as classic mode above but gain is raised up to 2.
  6893. </p>
  6894. </dd>
  6895. <dt>&lsquo;<samp>power</samp>&rsquo;</dt>
  6896. <dd><p>Equal power distribution, from -6dB to +6dB range.
  6897. </p></dd>
  6898. </dl>
  6899. </dd>
  6900. </dl>
  6901. <a name="Examples-35"></a>
  6902. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-35">8.88.1 Examples</a></h3>
  6903. <ul>
  6904. <li>
  6905. Apply karaoke like effect:
  6906. <div class="example">
  6907. <pre class="example">stereotools=mlev=0.015625
  6908. </pre></div>
  6909. </li><li>
  6910. Convert M/S signal to L/R:
  6911. <div class="example">
  6912. <pre class="example">&quot;stereotools=mode=ms&gt;lr&quot;
  6913. </pre></div>
  6914. </li></ul>
  6915. <a name="stereowiden"></a>
  6916. <h2 class="section"><a href="ffmpeg-filters.html#toc-stereowiden">8.89 stereowiden</a></h2>
  6917. <p>This filter enhance the stereo effect by suppressing signal common to both
  6918. channels and by delaying the signal of left into right and vice versa,
  6919. thereby widening the stereo effect.
  6920. </p>
  6921. <p>The filter accepts the following options:
  6922. </p>
  6923. <dl compact="compact">
  6924. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  6925. <dd><p>Time in milliseconds of the delay of left signal into right and vice versa.
  6926. Default is 20 milliseconds.
  6927. </p>
  6928. </dd>
  6929. <dt>&lsquo;<samp>feedback</samp>&rsquo;</dt>
  6930. <dd><p>Amount of gain in delayed signal into right and vice versa. Gives a delay
  6931. effect of left signal in right output and vice versa which gives widening
  6932. effect. Default is 0.3.
  6933. </p>
  6934. </dd>
  6935. <dt>&lsquo;<samp>crossfeed</samp>&rsquo;</dt>
  6936. <dd><p>Cross feed of left into right with inverted phase. This helps in suppressing
  6937. the mono. If the value is 1 it will cancel all the signal common to both
  6938. channels. Default is 0.3.
  6939. </p>
  6940. </dd>
  6941. <dt>&lsquo;<samp>drymix</samp>&rsquo;</dt>
  6942. <dd><p>Set level of input signal of original channel. Default is 0.8.
  6943. </p></dd>
  6944. </dl>
  6945. <a name="Commands-14"></a>
  6946. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-14">8.89.1 Commands</a></h3>
  6947. <p>This filter supports the all above options except <code>delay</code> as <a href="#commands">commands</a>.
  6948. </p>
  6949. <a name="superequalizer"></a>
  6950. <h2 class="section"><a href="ffmpeg-filters.html#toc-superequalizer">8.90 superequalizer</a></h2>
  6951. <p>Apply 18 band equalizer.
  6952. </p>
  6953. <p>The filter accepts the following options:
  6954. </p><dl compact="compact">
  6955. <dt>&lsquo;<samp>1b</samp>&rsquo;</dt>
  6956. <dd><p>Set 65Hz band gain.
  6957. </p></dd>
  6958. <dt>&lsquo;<samp>2b</samp>&rsquo;</dt>
  6959. <dd><p>Set 92Hz band gain.
  6960. </p></dd>
  6961. <dt>&lsquo;<samp>3b</samp>&rsquo;</dt>
  6962. <dd><p>Set 131Hz band gain.
  6963. </p></dd>
  6964. <dt>&lsquo;<samp>4b</samp>&rsquo;</dt>
  6965. <dd><p>Set 185Hz band gain.
  6966. </p></dd>
  6967. <dt>&lsquo;<samp>5b</samp>&rsquo;</dt>
  6968. <dd><p>Set 262Hz band gain.
  6969. </p></dd>
  6970. <dt>&lsquo;<samp>6b</samp>&rsquo;</dt>
  6971. <dd><p>Set 370Hz band gain.
  6972. </p></dd>
  6973. <dt>&lsquo;<samp>7b</samp>&rsquo;</dt>
  6974. <dd><p>Set 523Hz band gain.
  6975. </p></dd>
  6976. <dt>&lsquo;<samp>8b</samp>&rsquo;</dt>
  6977. <dd><p>Set 740Hz band gain.
  6978. </p></dd>
  6979. <dt>&lsquo;<samp>9b</samp>&rsquo;</dt>
  6980. <dd><p>Set 1047Hz band gain.
  6981. </p></dd>
  6982. <dt>&lsquo;<samp>10b</samp>&rsquo;</dt>
  6983. <dd><p>Set 1480Hz band gain.
  6984. </p></dd>
  6985. <dt>&lsquo;<samp>11b</samp>&rsquo;</dt>
  6986. <dd><p>Set 2093Hz band gain.
  6987. </p></dd>
  6988. <dt>&lsquo;<samp>12b</samp>&rsquo;</dt>
  6989. <dd><p>Set 2960Hz band gain.
  6990. </p></dd>
  6991. <dt>&lsquo;<samp>13b</samp>&rsquo;</dt>
  6992. <dd><p>Set 4186Hz band gain.
  6993. </p></dd>
  6994. <dt>&lsquo;<samp>14b</samp>&rsquo;</dt>
  6995. <dd><p>Set 5920Hz band gain.
  6996. </p></dd>
  6997. <dt>&lsquo;<samp>15b</samp>&rsquo;</dt>
  6998. <dd><p>Set 8372Hz band gain.
  6999. </p></dd>
  7000. <dt>&lsquo;<samp>16b</samp>&rsquo;</dt>
  7001. <dd><p>Set 11840Hz band gain.
  7002. </p></dd>
  7003. <dt>&lsquo;<samp>17b</samp>&rsquo;</dt>
  7004. <dd><p>Set 16744Hz band gain.
  7005. </p></dd>
  7006. <dt>&lsquo;<samp>18b</samp>&rsquo;</dt>
  7007. <dd><p>Set 20000Hz band gain.
  7008. </p></dd>
  7009. </dl>
  7010. <a name="surround"></a>
  7011. <h2 class="section"><a href="ffmpeg-filters.html#toc-surround">8.91 surround</a></h2>
  7012. <p>Apply audio surround upmix filter.
  7013. </p>
  7014. <p>This filter allows to produce multichannel output from audio stream.
  7015. </p>
  7016. <p>The filter accepts the following options:
  7017. </p>
  7018. <dl compact="compact">
  7019. <dt>&lsquo;<samp>chl_out</samp>&rsquo;</dt>
  7020. <dd><p>Set output channel layout. By default, this is <var>5.1</var>.
  7021. </p>
  7022. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  7023. for the required syntax.
  7024. </p>
  7025. </dd>
  7026. <dt>&lsquo;<samp>chl_in</samp>&rsquo;</dt>
  7027. <dd><p>Set input channel layout. By default, this is <var>stereo</var>.
  7028. </p>
  7029. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  7030. for the required syntax.
  7031. </p>
  7032. </dd>
  7033. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  7034. <dd><p>Set input volume level. By default, this is <var>1</var>.
  7035. </p>
  7036. </dd>
  7037. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  7038. <dd><p>Set output volume level. By default, this is <var>1</var>.
  7039. </p>
  7040. </dd>
  7041. <dt>&lsquo;<samp>lfe</samp>&rsquo;</dt>
  7042. <dd><p>Enable LFE channel output if output channel layout has it. By default, this is enabled.
  7043. </p>
  7044. </dd>
  7045. <dt>&lsquo;<samp>lfe_low</samp>&rsquo;</dt>
  7046. <dd><p>Set LFE low cut off frequency. By default, this is <var>128</var> Hz.
  7047. </p>
  7048. </dd>
  7049. <dt>&lsquo;<samp>lfe_high</samp>&rsquo;</dt>
  7050. <dd><p>Set LFE high cut off frequency. By default, this is <var>256</var> Hz.
  7051. </p>
  7052. </dd>
  7053. <dt>&lsquo;<samp>lfe_mode</samp>&rsquo;</dt>
  7054. <dd><p>Set LFE mode, can be <var>add</var> or <var>sub</var>. Default is <var>add</var>.
  7055. In <var>add</var> mode, LFE channel is created from input audio and added to output.
  7056. In <var>sub</var> mode, LFE channel is created from input audio and added to output but
  7057. also all non-LFE output channels are subtracted with output LFE channel.
  7058. </p>
  7059. </dd>
  7060. <dt>&lsquo;<samp>angle</samp>&rsquo;</dt>
  7061. <dd><p>Set angle of stereo surround transform, Allowed range is from <var>0</var> to <var>360</var>.
  7062. Default is <var>90</var>.
  7063. </p>
  7064. </dd>
  7065. <dt>&lsquo;<samp>fc_in</samp>&rsquo;</dt>
  7066. <dd><p>Set front center input volume. By default, this is <var>1</var>.
  7067. </p>
  7068. </dd>
  7069. <dt>&lsquo;<samp>fc_out</samp>&rsquo;</dt>
  7070. <dd><p>Set front center output volume. By default, this is <var>1</var>.
  7071. </p>
  7072. </dd>
  7073. <dt>&lsquo;<samp>fl_in</samp>&rsquo;</dt>
  7074. <dd><p>Set front left input volume. By default, this is <var>1</var>.
  7075. </p>
  7076. </dd>
  7077. <dt>&lsquo;<samp>fl_out</samp>&rsquo;</dt>
  7078. <dd><p>Set front left output volume. By default, this is <var>1</var>.
  7079. </p>
  7080. </dd>
  7081. <dt>&lsquo;<samp>fr_in</samp>&rsquo;</dt>
  7082. <dd><p>Set front right input volume. By default, this is <var>1</var>.
  7083. </p>
  7084. </dd>
  7085. <dt>&lsquo;<samp>fr_out</samp>&rsquo;</dt>
  7086. <dd><p>Set front right output volume. By default, this is <var>1</var>.
  7087. </p>
  7088. </dd>
  7089. <dt>&lsquo;<samp>sl_in</samp>&rsquo;</dt>
  7090. <dd><p>Set side left input volume. By default, this is <var>1</var>.
  7091. </p>
  7092. </dd>
  7093. <dt>&lsquo;<samp>sl_out</samp>&rsquo;</dt>
  7094. <dd><p>Set side left output volume. By default, this is <var>1</var>.
  7095. </p>
  7096. </dd>
  7097. <dt>&lsquo;<samp>sr_in</samp>&rsquo;</dt>
  7098. <dd><p>Set side right input volume. By default, this is <var>1</var>.
  7099. </p>
  7100. </dd>
  7101. <dt>&lsquo;<samp>sr_out</samp>&rsquo;</dt>
  7102. <dd><p>Set side right output volume. By default, this is <var>1</var>.
  7103. </p>
  7104. </dd>
  7105. <dt>&lsquo;<samp>bl_in</samp>&rsquo;</dt>
  7106. <dd><p>Set back left input volume. By default, this is <var>1</var>.
  7107. </p>
  7108. </dd>
  7109. <dt>&lsquo;<samp>bl_out</samp>&rsquo;</dt>
  7110. <dd><p>Set back left output volume. By default, this is <var>1</var>.
  7111. </p>
  7112. </dd>
  7113. <dt>&lsquo;<samp>br_in</samp>&rsquo;</dt>
  7114. <dd><p>Set back right input volume. By default, this is <var>1</var>.
  7115. </p>
  7116. </dd>
  7117. <dt>&lsquo;<samp>br_out</samp>&rsquo;</dt>
  7118. <dd><p>Set back right output volume. By default, this is <var>1</var>.
  7119. </p>
  7120. </dd>
  7121. <dt>&lsquo;<samp>bc_in</samp>&rsquo;</dt>
  7122. <dd><p>Set back center input volume. By default, this is <var>1</var>.
  7123. </p>
  7124. </dd>
  7125. <dt>&lsquo;<samp>bc_out</samp>&rsquo;</dt>
  7126. <dd><p>Set back center output volume. By default, this is <var>1</var>.
  7127. </p>
  7128. </dd>
  7129. <dt>&lsquo;<samp>lfe_in</samp>&rsquo;</dt>
  7130. <dd><p>Set LFE input volume. By default, this is <var>1</var>.
  7131. </p>
  7132. </dd>
  7133. <dt>&lsquo;<samp>lfe_out</samp>&rsquo;</dt>
  7134. <dd><p>Set LFE output volume. By default, this is <var>1</var>.
  7135. </p>
  7136. </dd>
  7137. <dt>&lsquo;<samp>allx</samp>&rsquo;</dt>
  7138. <dd><p>Set spread usage of stereo image across X axis for all channels.
  7139. </p>
  7140. </dd>
  7141. <dt>&lsquo;<samp>ally</samp>&rsquo;</dt>
  7142. <dd><p>Set spread usage of stereo image across Y axis for all channels.
  7143. </p>
  7144. </dd>
  7145. <dt>&lsquo;<samp>fcx, flx, frx, blx, brx, slx, srx, bcx</samp>&rsquo;</dt>
  7146. <dd><p>Set spread usage of stereo image across X axis for each channel.
  7147. </p>
  7148. </dd>
  7149. <dt>&lsquo;<samp>fcy, fly, fry, bly, bry, sly, sry, bcy</samp>&rsquo;</dt>
  7150. <dd><p>Set spread usage of stereo image across Y axis for each channel.
  7151. </p>
  7152. </dd>
  7153. <dt>&lsquo;<samp>win_size</samp>&rsquo;</dt>
  7154. <dd><p>Set window size. Allowed range is from <var>1024</var> to <var>65536</var>. Default size is <var>4096</var>.
  7155. </p>
  7156. </dd>
  7157. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  7158. <dd><p>Set window function.
  7159. </p>
  7160. <p>It accepts the following values:
  7161. </p><dl compact="compact">
  7162. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  7163. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  7164. <dt>&lsquo;<samp>hann, hanning</samp>&rsquo;</dt>
  7165. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  7166. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  7167. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  7168. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  7169. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  7170. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  7171. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  7172. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  7173. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  7174. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  7175. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  7176. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  7177. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  7178. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  7179. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  7180. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  7181. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  7182. </dl>
  7183. <p>Default is <code>hann</code>.
  7184. </p>
  7185. </dd>
  7186. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  7187. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  7188. window function will be picked. Default is <code>0.5</code>.
  7189. </p></dd>
  7190. </dl>
  7191. <a name="treble_002c-highshelf"></a>
  7192. <h2 class="section"><a href="ffmpeg-filters.html#toc-treble_002c-highshelf">8.92 treble, highshelf</a></h2>
  7193. <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
  7194. shelving filter with a response similar to that of a standard
  7195. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  7196. </p>
  7197. <p>The filter accepts the following options:
  7198. </p>
  7199. <dl compact="compact">
  7200. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  7201. <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
  7202. Nyquist frequency. Its useful range is about -20 (for a large cut)
  7203. to +20 (for a large boost). Beware of clipping when using a positive gain.
  7204. </p>
  7205. </dd>
  7206. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  7207. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  7208. to extend or reduce the frequency range to be boosted or cut.
  7209. The default value is <code>3000</code> Hz.
  7210. </p>
  7211. </dd>
  7212. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  7213. <dd><p>Set method to specify band-width of filter.
  7214. </p><dl compact="compact">
  7215. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  7216. <dd><p>Hz
  7217. </p></dd>
  7218. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  7219. <dd><p>Q-Factor
  7220. </p></dd>
  7221. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  7222. <dd><p>octave
  7223. </p></dd>
  7224. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  7225. <dd><p>slope
  7226. </p></dd>
  7227. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  7228. <dd><p>kHz
  7229. </p></dd>
  7230. </dl>
  7231. </dd>
  7232. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  7233. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  7234. </p>
  7235. </dd>
  7236. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  7237. <dd><p>How much to use filtered signal in output. Default is 1.
  7238. Range is between 0 and 1.
  7239. </p>
  7240. </dd>
  7241. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  7242. <dd><p>Specify which channels to filter, by default all available are filtered.
  7243. </p>
  7244. </dd>
  7245. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  7246. <dd><p>Normalize biquad coefficients, by default is disabled.
  7247. Enabling it will normalize magnitude response at DC to 0dB.
  7248. </p></dd>
  7249. </dl>
  7250. <a name="Commands-67"></a>
  7251. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-67">8.92.1 Commands</a></h3>
  7252. <p>This filter supports the following commands:
  7253. </p><dl compact="compact">
  7254. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  7255. <dd><p>Change treble frequency.
  7256. Syntax for the command is : &quot;<var>frequency</var>&quot;
  7257. </p>
  7258. </dd>
  7259. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  7260. <dd><p>Change treble width_type.
  7261. Syntax for the command is : &quot;<var>width_type</var>&quot;
  7262. </p>
  7263. </dd>
  7264. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  7265. <dd><p>Change treble width.
  7266. Syntax for the command is : &quot;<var>width</var>&quot;
  7267. </p>
  7268. </dd>
  7269. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  7270. <dd><p>Change treble gain.
  7271. Syntax for the command is : &quot;<var>gain</var>&quot;
  7272. </p>
  7273. </dd>
  7274. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  7275. <dd><p>Change treble mix.
  7276. Syntax for the command is : &quot;<var>mix</var>&quot;
  7277. </p></dd>
  7278. </dl>
  7279. <a name="tremolo"></a>
  7280. <h2 class="section"><a href="ffmpeg-filters.html#toc-tremolo">8.93 tremolo</a></h2>
  7281. <p>Sinusoidal amplitude modulation.
  7282. </p>
  7283. <p>The filter accepts the following options:
  7284. </p>
  7285. <dl compact="compact">
  7286. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  7287. <dd><p>Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
  7288. (20 Hz or lower) will result in a tremolo effect.
  7289. This filter may also be used as a ring modulator by specifying
  7290. a modulation frequency higher than 20 Hz.
  7291. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  7292. </p>
  7293. </dd>
  7294. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  7295. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  7296. Default value is 0.5.
  7297. </p></dd>
  7298. </dl>
  7299. <a name="vibrato"></a>
  7300. <h2 class="section"><a href="ffmpeg-filters.html#toc-vibrato">8.94 vibrato</a></h2>
  7301. <p>Sinusoidal phase modulation.
  7302. </p>
  7303. <p>The filter accepts the following options:
  7304. </p>
  7305. <dl compact="compact">
  7306. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  7307. <dd><p>Modulation frequency in Hertz.
  7308. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  7309. </p>
  7310. </dd>
  7311. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  7312. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  7313. Default value is 0.5.
  7314. </p></dd>
  7315. </dl>
  7316. <a name="volume"></a>
  7317. <h2 class="section"><a href="ffmpeg-filters.html#toc-volume">8.95 volume</a></h2>
  7318. <p>Adjust the input audio volume.
  7319. </p>
  7320. <p>It accepts the following parameters:
  7321. </p><dl compact="compact">
  7322. <dt>&lsquo;<samp>volume</samp>&rsquo;</dt>
  7323. <dd><p>Set audio volume expression.
  7324. </p>
  7325. <p>Output values are clipped to the maximum value.
  7326. </p>
  7327. <p>The output audio volume is given by the relation:
  7328. </p><div class="example">
  7329. <pre class="example"><var>output_volume</var> = <var>volume</var> * <var>input_volume</var>
  7330. </pre></div>
  7331. <p>The default value for <var>volume</var> is &quot;1.0&quot;.
  7332. </p>
  7333. </dd>
  7334. <dt>&lsquo;<samp>precision</samp>&rsquo;</dt>
  7335. <dd><p>This parameter represents the mathematical precision.
  7336. </p>
  7337. <p>It determines which input sample formats will be allowed, which affects the
  7338. precision of the volume scaling.
  7339. </p>
  7340. <dl compact="compact">
  7341. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  7342. <dd><p>8-bit fixed-point; this limits input sample format to U8, S16, and S32.
  7343. </p></dd>
  7344. <dt>&lsquo;<samp>float</samp>&rsquo;</dt>
  7345. <dd><p>32-bit floating-point; this limits input sample format to FLT. (default)
  7346. </p></dd>
  7347. <dt>&lsquo;<samp>double</samp>&rsquo;</dt>
  7348. <dd><p>64-bit floating-point; this limits input sample format to DBL.
  7349. </p></dd>
  7350. </dl>
  7351. </dd>
  7352. <dt>&lsquo;<samp>replaygain</samp>&rsquo;</dt>
  7353. <dd><p>Choose the behaviour on encountering ReplayGain side data in input frames.
  7354. </p>
  7355. <dl compact="compact">
  7356. <dt>&lsquo;<samp>drop</samp>&rsquo;</dt>
  7357. <dd><p>Remove ReplayGain side data, ignoring its contents (the default).
  7358. </p>
  7359. </dd>
  7360. <dt>&lsquo;<samp>ignore</samp>&rsquo;</dt>
  7361. <dd><p>Ignore ReplayGain side data, but leave it in the frame.
  7362. </p>
  7363. </dd>
  7364. <dt>&lsquo;<samp>track</samp>&rsquo;</dt>
  7365. <dd><p>Prefer the track gain, if present.
  7366. </p>
  7367. </dd>
  7368. <dt>&lsquo;<samp>album</samp>&rsquo;</dt>
  7369. <dd><p>Prefer the album gain, if present.
  7370. </p></dd>
  7371. </dl>
  7372. </dd>
  7373. <dt>&lsquo;<samp>replaygain_preamp</samp>&rsquo;</dt>
  7374. <dd><p>Pre-amplification gain in dB to apply to the selected replaygain gain.
  7375. </p>
  7376. <p>Default value for <var>replaygain_preamp</var> is 0.0.
  7377. </p>
  7378. </dd>
  7379. <dt>&lsquo;<samp>replaygain_noclip</samp>&rsquo;</dt>
  7380. <dd><p>Prevent clipping by limiting the gain applied.
  7381. </p>
  7382. <p>Default value for <var>replaygain_noclip</var> is 1.
  7383. </p>
  7384. </dd>
  7385. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  7386. <dd><p>Set when the volume expression is evaluated.
  7387. </p>
  7388. <p>It accepts the following values:
  7389. </p><dl compact="compact">
  7390. <dt>&lsquo;<samp>once</samp>&rsquo;</dt>
  7391. <dd><p>only evaluate expression once during the filter initialization, or
  7392. when the &lsquo;<samp>volume</samp>&rsquo; command is sent
  7393. </p>
  7394. </dd>
  7395. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  7396. <dd><p>evaluate expression for each incoming frame
  7397. </p></dd>
  7398. </dl>
  7399. <p>Default value is &lsquo;<samp>once</samp>&rsquo;.
  7400. </p></dd>
  7401. </dl>
  7402. <p>The volume expression can contain the following parameters.
  7403. </p>
  7404. <dl compact="compact">
  7405. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  7406. <dd><p>frame number (starting at zero)
  7407. </p></dd>
  7408. <dt>&lsquo;<samp>nb_channels</samp>&rsquo;</dt>
  7409. <dd><p>number of channels
  7410. </p></dd>
  7411. <dt>&lsquo;<samp>nb_consumed_samples</samp>&rsquo;</dt>
  7412. <dd><p>number of samples consumed by the filter
  7413. </p></dd>
  7414. <dt>&lsquo;<samp>nb_samples</samp>&rsquo;</dt>
  7415. <dd><p>number of samples in the current frame
  7416. </p></dd>
  7417. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  7418. <dd><p>original frame position in the file
  7419. </p></dd>
  7420. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  7421. <dd><p>frame PTS
  7422. </p></dd>
  7423. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  7424. <dd><p>sample rate
  7425. </p></dd>
  7426. <dt>&lsquo;<samp>startpts</samp>&rsquo;</dt>
  7427. <dd><p>PTS at start of stream
  7428. </p></dd>
  7429. <dt>&lsquo;<samp>startt</samp>&rsquo;</dt>
  7430. <dd><p>time at start of stream
  7431. </p></dd>
  7432. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  7433. <dd><p>frame time
  7434. </p></dd>
  7435. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  7436. <dd><p>timestamp timebase
  7437. </p></dd>
  7438. <dt>&lsquo;<samp>volume</samp>&rsquo;</dt>
  7439. <dd><p>last set volume value
  7440. </p></dd>
  7441. </dl>
  7442. <p>Note that when &lsquo;<samp>eval</samp>&rsquo; is set to &lsquo;<samp>once</samp>&rsquo; only the
  7443. <var>sample_rate</var> and <var>tb</var> variables are available, all other
  7444. variables will evaluate to NAN.
  7445. </p>
  7446. <a name="Commands-43"></a>
  7447. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-43">8.95.1 Commands</a></h3>
  7448. <p>This filter supports the following commands:
  7449. </p><dl compact="compact">
  7450. <dt>&lsquo;<samp>volume</samp>&rsquo;</dt>
  7451. <dd><p>Modify the volume expression.
  7452. The command accepts the same syntax of the corresponding option.
  7453. </p>
  7454. <p>If the specified expression is not valid, it is kept at its current
  7455. value.
  7456. </p></dd>
  7457. </dl>
  7458. <a name="Examples-107"></a>
  7459. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-107">8.95.2 Examples</a></h3>
  7460. <ul>
  7461. <li>
  7462. Halve the input audio volume:
  7463. <div class="example">
  7464. <pre class="example">volume=volume=0.5
  7465. volume=volume=1/2
  7466. volume=volume=-6.0206dB
  7467. </pre></div>
  7468. <p>In all the above example the named key for &lsquo;<samp>volume</samp>&rsquo; can be
  7469. omitted, for example like in:
  7470. </p><div class="example">
  7471. <pre class="example">volume=0.5
  7472. </pre></div>
  7473. </li><li>
  7474. Increase input audio power by 6 decibels using fixed-point precision:
  7475. <div class="example">
  7476. <pre class="example">volume=volume=6dB:precision=fixed
  7477. </pre></div>
  7478. </li><li>
  7479. Fade volume after time 10 with an annihilation period of 5 seconds:
  7480. <div class="example">
  7481. <pre class="example">volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
  7482. </pre></div>
  7483. </li></ul>
  7484. <a name="volumedetect"></a>
  7485. <h2 class="section"><a href="ffmpeg-filters.html#toc-volumedetect">8.96 volumedetect</a></h2>
  7486. <p>Detect the volume of the input video.
  7487. </p>
  7488. <p>The filter has no parameters. The input is not modified. Statistics about
  7489. the volume will be printed in the log when the input stream end is reached.
  7490. </p>
  7491. <p>In particular it will show the mean volume (root mean square), maximum
  7492. volume (on a per-sample basis), and the beginning of a histogram of the
  7493. registered volume values (from the maximum value to a cumulated 1/1000 of
  7494. the samples).
  7495. </p>
  7496. <p>All volumes are in decibels relative to the maximum PCM value.
  7497. </p>
  7498. <a name="Examples-25"></a>
  7499. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-25">8.96.1 Examples</a></h3>
  7500. <p>Here is an excerpt of the output:
  7501. </p><div class="example">
  7502. <pre class="example">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
  7503. [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
  7504. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
  7505. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
  7506. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
  7507. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
  7508. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
  7509. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
  7510. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
  7511. </pre></div>
  7512. <p>It means that:
  7513. </p><ul>
  7514. <li>
  7515. The mean square energy is approximately -27 dB, or 10^-2.7.
  7516. </li><li>
  7517. The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
  7518. </li><li>
  7519. There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
  7520. </li></ul>
  7521. <p>In other words, raising the volume by +4 dB does not cause any clipping,
  7522. raising it by +5 dB causes clipping for 6 samples, etc.
  7523. </p>
  7524. <a name="Audio-Sources"></a>
  7525. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Audio-Sources">9 Audio Sources</a></h1>
  7526. <p>Below is a description of the currently available audio sources.
  7527. </p>
  7528. <a name="abuffer"></a>
  7529. <h2 class="section"><a href="ffmpeg-filters.html#toc-abuffer">9.1 abuffer</a></h2>
  7530. <p>Buffer audio frames, and make them available to the filter chain.
  7531. </p>
  7532. <p>This source is mainly intended for a programmatic use, in particular
  7533. through the interface defined in &lsquo;<tt>libavfilter/asrc_abuffer.h</tt>&rsquo;.
  7534. </p>
  7535. <p>It accepts the following parameters:
  7536. </p><dl compact="compact">
  7537. <dt>&lsquo;<samp>time_base</samp>&rsquo;</dt>
  7538. <dd><p>The timebase which will be used for timestamps of submitted frames. It must be
  7539. either a floating-point number or in <var>numerator</var>/<var>denominator</var> form.
  7540. </p>
  7541. </dd>
  7542. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  7543. <dd><p>The sample rate of the incoming audio buffers.
  7544. </p>
  7545. </dd>
  7546. <dt>&lsquo;<samp>sample_fmt</samp>&rsquo;</dt>
  7547. <dd><p>The sample format of the incoming audio buffers.
  7548. Either a sample format name or its corresponding integer representation from
  7549. the enum AVSampleFormat in &lsquo;<tt>libavutil/samplefmt.h</tt>&rsquo;
  7550. </p>
  7551. </dd>
  7552. <dt>&lsquo;<samp>channel_layout</samp>&rsquo;</dt>
  7553. <dd><p>The channel layout of the incoming audio buffers.
  7554. Either a channel layout name from channel_layout_map in
  7555. &lsquo;<tt>libavutil/channel_layout.c</tt>&rsquo; or its corresponding integer representation
  7556. from the AV_CH_LAYOUT_* macros in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;
  7557. </p>
  7558. </dd>
  7559. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  7560. <dd><p>The number of channels of the incoming audio buffers.
  7561. If both <var>channels</var> and <var>channel_layout</var> are specified, then they
  7562. must be consistent.
  7563. </p>
  7564. </dd>
  7565. </dl>
  7566. <a name="Examples-60"></a>
  7567. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-60">9.1.1 Examples</a></h3>
  7568. <div class="example">
  7569. <pre class="example">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
  7570. </pre></div>
  7571. <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
  7572. Since the sample format with name &quot;s16p&quot; corresponds to the number
  7573. 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
  7574. equivalent to:
  7575. </p><div class="example">
  7576. <pre class="example">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
  7577. </pre></div>
  7578. <a name="aevalsrc"></a>
  7579. <h2 class="section"><a href="ffmpeg-filters.html#toc-aevalsrc">9.2 aevalsrc</a></h2>
  7580. <p>Generate an audio signal specified by an expression.
  7581. </p>
  7582. <p>This source accepts in input one or more expressions (one for each
  7583. channel), which are evaluated and used to generate a corresponding
  7584. audio signal.
  7585. </p>
  7586. <p>This source accepts the following options:
  7587. </p>
  7588. <dl compact="compact">
  7589. <dt>&lsquo;<samp>exprs</samp>&rsquo;</dt>
  7590. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
  7591. &lsquo;<samp>channel_layout</samp>&rsquo; option is not specified, the selected channel layout
  7592. depends on the number of provided expressions. Otherwise the last
  7593. specified expression is applied to the remaining output channels.
  7594. </p>
  7595. </dd>
  7596. <dt>&lsquo;<samp>channel_layout, c</samp>&rsquo;</dt>
  7597. <dd><p>Set the channel layout. The number of channels in the specified layout
  7598. must be equal to the number of specified expressions.
  7599. </p>
  7600. </dd>
  7601. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  7602. <dd><p>Set the minimum duration of the sourced audio. See
  7603. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  7604. for the accepted syntax.
  7605. Note that the resulting duration may be greater than the specified
  7606. duration, as the generated audio is always cut at the end of a
  7607. complete frame.
  7608. </p>
  7609. <p>If not specified, or the expressed duration is negative, the audio is
  7610. supposed to be generated forever.
  7611. </p>
  7612. </dd>
  7613. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  7614. <dd><p>Set the number of samples per channel per each output frame,
  7615. default to 1024.
  7616. </p>
  7617. </dd>
  7618. <dt>&lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
  7619. <dd><p>Specify the sample rate, default to 44100.
  7620. </p></dd>
  7621. </dl>
  7622. <p>Each expression in <var>exprs</var> can contain the following constants:
  7623. </p>
  7624. <dl compact="compact">
  7625. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  7626. <dd><p>number of the evaluated sample, starting from 0
  7627. </p>
  7628. </dd>
  7629. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  7630. <dd><p>time of the evaluated sample expressed in seconds, starting from 0
  7631. </p>
  7632. </dd>
  7633. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  7634. <dd><p>sample rate
  7635. </p>
  7636. </dd>
  7637. </dl>
  7638. <a name="Examples-66"></a>
  7639. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-66">9.2.1 Examples</a></h3>
  7640. <ul>
  7641. <li>
  7642. Generate silence:
  7643. <div class="example">
  7644. <pre class="example">aevalsrc=0
  7645. </pre></div>
  7646. </li><li>
  7647. Generate a sin signal with frequency of 440 Hz, set sample rate to
  7648. 8000 Hz:
  7649. <div class="example">
  7650. <pre class="example">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
  7651. </pre></div>
  7652. </li><li>
  7653. Generate a two channels signal, specify the channel layout (Front
  7654. Center + Back Center) explicitly:
  7655. <div class="example">
  7656. <pre class="example">aevalsrc=&quot;sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC&quot;
  7657. </pre></div>
  7658. </li><li>
  7659. Generate white noise:
  7660. <div class="example">
  7661. <pre class="example">aevalsrc=&quot;-2+random(0)&quot;
  7662. </pre></div>
  7663. </li><li>
  7664. Generate an amplitude modulated signal:
  7665. <div class="example">
  7666. <pre class="example">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
  7667. </pre></div>
  7668. </li><li>
  7669. Generate 2.5 Hz binaural beats on a 360 Hz carrier:
  7670. <div class="example">
  7671. <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;
  7672. </pre></div>
  7673. </li></ul>
  7674. <a name="afirsrc"></a>
  7675. <h2 class="section"><a href="ffmpeg-filters.html#toc-afirsrc">9.3 afirsrc</a></h2>
  7676. <p>Generate a FIR coefficients using frequency sampling method.
  7677. </p>
  7678. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for filtering the audio signal.
  7679. </p>
  7680. <p>The filter accepts the following options:
  7681. </p>
  7682. <dl compact="compact">
  7683. <dt>&lsquo;<samp>taps, t</samp>&rsquo;</dt>
  7684. <dd><p>Set number of filter coefficents in output audio stream.
  7685. Default value is 1025.
  7686. </p>
  7687. </dd>
  7688. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  7689. <dd><p>Set frequency points from where magnitude and phase are set.
  7690. This must be in non decreasing order, and first element must be 0, while last element
  7691. must be 1. Elements are separated by white spaces.
  7692. </p>
  7693. </dd>
  7694. <dt>&lsquo;<samp>magnitude, m</samp>&rsquo;</dt>
  7695. <dd><p>Set magnitude value for every frequency point set by &lsquo;<samp>frequency</samp>&rsquo;.
  7696. Number of values must be same as number of frequency points.
  7697. Values are separated by white spaces.
  7698. </p>
  7699. </dd>
  7700. <dt>&lsquo;<samp>phase, p</samp>&rsquo;</dt>
  7701. <dd><p>Set phase value for every frequency point set by &lsquo;<samp>frequency</samp>&rsquo;.
  7702. Number of values must be same as number of frequency points.
  7703. Values are separated by white spaces.
  7704. </p>
  7705. </dd>
  7706. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  7707. <dd><p>Set sample rate, default is 44100.
  7708. </p>
  7709. </dd>
  7710. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  7711. <dd><p>Set number of samples per each frame. Default is 1024.
  7712. </p>
  7713. </dd>
  7714. <dt>&lsquo;<samp>win_func, w</samp>&rsquo;</dt>
  7715. <dd><p>Set window function. Default is blackman.
  7716. </p></dd>
  7717. </dl>
  7718. <a name="anullsrc"></a>
  7719. <h2 class="section"><a href="ffmpeg-filters.html#toc-anullsrc">9.4 anullsrc</a></h2>
  7720. <p>The null audio source, return unprocessed audio frames. It is mainly useful
  7721. as a template and to be employed in analysis / debugging tools, or as
  7722. the source for filters which ignore the input data (for example the sox
  7723. synth filter).
  7724. </p>
  7725. <p>This source accepts the following options:
  7726. </p>
  7727. <dl compact="compact">
  7728. <dt>&lsquo;<samp>channel_layout, cl</samp>&rsquo;</dt>
  7729. <dd>
  7730. <p>Specifies the channel layout, and can be either an integer or a string
  7731. representing a channel layout. The default value of <var>channel_layout</var>
  7732. is &quot;stereo&quot;.
  7733. </p>
  7734. <p>Check the channel_layout_map definition in
  7735. &lsquo;<tt>libavutil/channel_layout.c</tt>&rsquo; for the mapping between strings and
  7736. channel layout values.
  7737. </p>
  7738. </dd>
  7739. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  7740. <dd><p>Specifies the sample rate, and defaults to 44100.
  7741. </p>
  7742. </dd>
  7743. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  7744. <dd><p>Set the number of samples per requested frames.
  7745. </p>
  7746. </dd>
  7747. </dl>
  7748. <a name="Examples-28"></a>
  7749. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-28">9.4.1 Examples</a></h3>
  7750. <ul>
  7751. <li>
  7752. Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
  7753. <div class="example">
  7754. <pre class="example">anullsrc=r=48000:cl=4
  7755. </pre></div>
  7756. </li><li>
  7757. Do the same operation with a more obvious syntax:
  7758. <div class="example">
  7759. <pre class="example">anullsrc=r=48000:cl=mono
  7760. </pre></div>
  7761. </li></ul>
  7762. <p>All the parameters need to be explicitly defined.
  7763. </p>
  7764. <a name="flite"></a>
  7765. <h2 class="section"><a href="ffmpeg-filters.html#toc-flite">9.5 flite</a></h2>
  7766. <p>Synthesize a voice utterance using the libflite library.
  7767. </p>
  7768. <p>To enable compilation of this filter you need to configure FFmpeg with
  7769. <code>--enable-libflite</code>.
  7770. </p>
  7771. <p>Note that versions of the flite library prior to 2.0 are not thread-safe.
  7772. </p>
  7773. <p>The filter accepts the following options:
  7774. </p>
  7775. <dl compact="compact">
  7776. <dt>&lsquo;<samp>list_voices</samp>&rsquo;</dt>
  7777. <dd><p>If set to 1, list the names of the available voices and exit
  7778. immediately. Default value is 0.
  7779. </p>
  7780. </dd>
  7781. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  7782. <dd><p>Set the maximum number of samples per frame. Default value is 512.
  7783. </p>
  7784. </dd>
  7785. <dt>&lsquo;<samp>textfile</samp>&rsquo;</dt>
  7786. <dd><p>Set the filename containing the text to speak.
  7787. </p>
  7788. </dd>
  7789. <dt>&lsquo;<samp>text</samp>&rsquo;</dt>
  7790. <dd><p>Set the text to speak.
  7791. </p>
  7792. </dd>
  7793. <dt>&lsquo;<samp>voice, v</samp>&rsquo;</dt>
  7794. <dd><p>Set the voice to use for the speech synthesis. Default value is
  7795. <code>kal</code>. See also the <var>list_voices</var> option.
  7796. </p></dd>
  7797. </dl>
  7798. <a name="Examples-23"></a>
  7799. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-23">9.5.1 Examples</a></h3>
  7800. <ul>
  7801. <li>
  7802. Read from file &lsquo;<tt>speech.txt</tt>&rsquo;, and synthesize the text using the
  7803. standard flite voice:
  7804. <div class="example">
  7805. <pre class="example">flite=textfile=speech.txt
  7806. </pre></div>
  7807. </li><li>
  7808. Read the specified text selecting the <code>slt</code> voice:
  7809. <div class="example">
  7810. <pre class="example">flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  7811. </pre></div>
  7812. </li><li>
  7813. Input text to ffmpeg:
  7814. <div class="example">
  7815. <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
  7816. </pre></div>
  7817. </li><li>
  7818. Make &lsquo;<tt>ffplay</tt>&rsquo; speak the specified text, using <code>flite</code> and
  7819. the <code>lavfi</code> device:
  7820. <div class="example">
  7821. <pre class="example">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
  7822. </pre></div>
  7823. </li></ul>
  7824. <p>For more information about libflite, check:
  7825. <a href="http://www.festvox.org/flite/">http://www.festvox.org/flite/</a>
  7826. </p>
  7827. <a name="anoisesrc"></a>
  7828. <h2 class="section"><a href="ffmpeg-filters.html#toc-anoisesrc">9.6 anoisesrc</a></h2>
  7829. <p>Generate a noise audio signal.
  7830. </p>
  7831. <p>The filter accepts the following options:
  7832. </p>
  7833. <dl compact="compact">
  7834. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  7835. <dd><p>Specify the sample rate. Default value is 48000 Hz.
  7836. </p>
  7837. </dd>
  7838. <dt>&lsquo;<samp>amplitude, a</samp>&rsquo;</dt>
  7839. <dd><p>Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value
  7840. is 1.0.
  7841. </p>
  7842. </dd>
  7843. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  7844. <dd><p>Specify the duration of the generated audio stream. Not specifying this option
  7845. results in noise with an infinite length.
  7846. </p>
  7847. </dd>
  7848. <dt>&lsquo;<samp>color, colour, c</samp>&rsquo;</dt>
  7849. <dd><p>Specify the color of noise. Available noise colors are white, pink, brown,
  7850. blue, violet and velvet. Default color is white.
  7851. </p>
  7852. </dd>
  7853. <dt>&lsquo;<samp>seed, s</samp>&rsquo;</dt>
  7854. <dd><p>Specify a value used to seed the PRNG.
  7855. </p>
  7856. </dd>
  7857. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  7858. <dd><p>Set the number of samples per each output frame, default is 1024.
  7859. </p></dd>
  7860. </dl>
  7861. <a name="Examples-120"></a>
  7862. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-120">9.6.1 Examples</a></h3>
  7863. <ul>
  7864. <li>
  7865. Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5:
  7866. <div class="example">
  7867. <pre class="example">anoisesrc=d=60:c=pink:r=44100:a=0.5
  7868. </pre></div>
  7869. </li></ul>
  7870. <a name="hilbert"></a>
  7871. <h2 class="section"><a href="ffmpeg-filters.html#toc-hilbert">9.7 hilbert</a></h2>
  7872. <p>Generate odd-tap Hilbert transform FIR coefficients.
  7873. </p>
  7874. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for phase-shifting
  7875. the signal by 90 degrees.
  7876. </p>
  7877. <p>This is used in many matrix coding schemes and for analytic signal generation.
  7878. The process is often written as a multiplication by i (or j), the imaginary unit.
  7879. </p>
  7880. <p>The filter accepts the following options:
  7881. </p>
  7882. <dl compact="compact">
  7883. <dt>&lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
  7884. <dd><p>Set sample rate, default is 44100.
  7885. </p>
  7886. </dd>
  7887. <dt>&lsquo;<samp>taps, t</samp>&rsquo;</dt>
  7888. <dd><p>Set length of FIR filter, default is 22051.
  7889. </p>
  7890. </dd>
  7891. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  7892. <dd><p>Set number of samples per each frame.
  7893. </p>
  7894. </dd>
  7895. <dt>&lsquo;<samp>win_func, w</samp>&rsquo;</dt>
  7896. <dd><p>Set window function to be used when generating FIR coefficients.
  7897. </p></dd>
  7898. </dl>
  7899. <a name="sinc"></a>
  7900. <h2 class="section"><a href="ffmpeg-filters.html#toc-sinc">9.8 sinc</a></h2>
  7901. <p>Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients.
  7902. </p>
  7903. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for filtering the audio signal.
  7904. </p>
  7905. <p>The filter accepts the following options:
  7906. </p>
  7907. <dl compact="compact">
  7908. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  7909. <dd><p>Set sample rate, default is 44100.
  7910. </p>
  7911. </dd>
  7912. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  7913. <dd><p>Set number of samples per each frame. Default is 1024.
  7914. </p>
  7915. </dd>
  7916. <dt>&lsquo;<samp>hp</samp>&rsquo;</dt>
  7917. <dd><p>Set high-pass frequency. Default is 0.
  7918. </p>
  7919. </dd>
  7920. <dt>&lsquo;<samp>lp</samp>&rsquo;</dt>
  7921. <dd><p>Set low-pass frequency. Default is 0.
  7922. If high-pass frequency is lower than low-pass frequency and low-pass frequency
  7923. is higher than 0 then filter will create band-pass filter coefficients,
  7924. otherwise band-reject filter coefficients.
  7925. </p>
  7926. </dd>
  7927. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  7928. <dd><p>Set filter phase response. Default is 50. Allowed range is from 0 to 100.
  7929. </p>
  7930. </dd>
  7931. <dt>&lsquo;<samp>beta</samp>&rsquo;</dt>
  7932. <dd><p>Set Kaiser window beta.
  7933. </p>
  7934. </dd>
  7935. <dt>&lsquo;<samp>att</samp>&rsquo;</dt>
  7936. <dd><p>Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB.
  7937. </p>
  7938. </dd>
  7939. <dt>&lsquo;<samp>round</samp>&rsquo;</dt>
  7940. <dd><p>Enable rounding, by default is disabled.
  7941. </p>
  7942. </dd>
  7943. <dt>&lsquo;<samp>hptaps</samp>&rsquo;</dt>
  7944. <dd><p>Set number of taps for high-pass filter.
  7945. </p>
  7946. </dd>
  7947. <dt>&lsquo;<samp>lptaps</samp>&rsquo;</dt>
  7948. <dd><p>Set number of taps for low-pass filter.
  7949. </p></dd>
  7950. </dl>
  7951. <a name="sine"></a>
  7952. <h2 class="section"><a href="ffmpeg-filters.html#toc-sine">9.9 sine</a></h2>
  7953. <p>Generate an audio signal made of a sine wave with amplitude 1/8.
  7954. </p>
  7955. <p>The audio signal is bit-exact.
  7956. </p>
  7957. <p>The filter accepts the following options:
  7958. </p>
  7959. <dl compact="compact">
  7960. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  7961. <dd><p>Set the carrier frequency. Default is 440 Hz.
  7962. </p>
  7963. </dd>
  7964. <dt>&lsquo;<samp>beep_factor, b</samp>&rsquo;</dt>
  7965. <dd><p>Enable a periodic beep every second with frequency <var>beep_factor</var> times
  7966. the carrier frequency. Default is 0, meaning the beep is disabled.
  7967. </p>
  7968. </dd>
  7969. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  7970. <dd><p>Specify the sample rate, default is 44100.
  7971. </p>
  7972. </dd>
  7973. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  7974. <dd><p>Specify the duration of the generated audio stream.
  7975. </p>
  7976. </dd>
  7977. <dt>&lsquo;<samp>samples_per_frame</samp>&rsquo;</dt>
  7978. <dd><p>Set the number of samples per output frame.
  7979. </p>
  7980. <p>The expression can contain the following constants:
  7981. </p>
  7982. <dl compact="compact">
  7983. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  7984. <dd><p>The (sequential) number of the output audio frame, starting from 0.
  7985. </p>
  7986. </dd>
  7987. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  7988. <dd><p>The PTS (Presentation TimeStamp) of the output audio frame,
  7989. expressed in <var>TB</var> units.
  7990. </p>
  7991. </dd>
  7992. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  7993. <dd><p>The PTS of the output audio frame, expressed in seconds.
  7994. </p>
  7995. </dd>
  7996. <dt>&lsquo;<samp>TB</samp>&rsquo;</dt>
  7997. <dd><p>The timebase of the output audio frames.
  7998. </p></dd>
  7999. </dl>
  8000. <p>Default is <code>1024</code>.
  8001. </p></dd>
  8002. </dl>
  8003. <a name="Examples-34"></a>
  8004. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-34">9.9.1 Examples</a></h3>
  8005. <ul>
  8006. <li>
  8007. Generate a simple 440 Hz sine wave:
  8008. <div class="example">
  8009. <pre class="example">sine
  8010. </pre></div>
  8011. </li><li>
  8012. Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
  8013. <div class="example">
  8014. <pre class="example">sine=220:4:d=5
  8015. sine=f=220:b=4:d=5
  8016. sine=frequency=220:beep_factor=4:duration=5
  8017. </pre></div>
  8018. </li><li>
  8019. Generate a 1 kHz sine wave following <code>1602,1601,1602,1601,1602</code> NTSC
  8020. pattern:
  8021. <div class="example">
  8022. <pre class="example">sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
  8023. </pre></div>
  8024. </li></ul>
  8025. <a name="Audio-Sinks"></a>
  8026. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Audio-Sinks">10 Audio Sinks</a></h1>
  8027. <p>Below is a description of the currently available audio sinks.
  8028. </p>
  8029. <a name="abuffersink"></a>
  8030. <h2 class="section"><a href="ffmpeg-filters.html#toc-abuffersink">10.1 abuffersink</a></h2>
  8031. <p>Buffer audio frames, and make them available to the end of filter chain.
  8032. </p>
  8033. <p>This sink is mainly intended for programmatic use, in particular
  8034. through the interface defined in &lsquo;<tt>libavfilter/buffersink.h</tt>&rsquo;
  8035. or the options system.
  8036. </p>
  8037. <p>It accepts a pointer to an AVABufferSinkContext structure, which
  8038. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  8039. parameter to <code>avfilter_init_filter</code> for initialization.
  8040. </p><a name="anullsink"></a>
  8041. <h2 class="section"><a href="ffmpeg-filters.html#toc-anullsink">10.2 anullsink</a></h2>
  8042. <p>Null audio sink; do absolutely nothing with the input audio. It is
  8043. mainly useful as a template and for use in analysis / debugging
  8044. tools.
  8045. </p>
  8046. <a name="Video-Filters"></a>
  8047. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Video-Filters">11 Video Filters</a></h1>
  8048. <p>When you configure your FFmpeg build, you can disable any of the
  8049. existing filters using <code>--disable-filters</code>.
  8050. The configure output will show the video filters included in your
  8051. build.
  8052. </p>
  8053. <p>Below is a description of the currently available video filters.
  8054. </p>
  8055. <a name="addroi"></a>
  8056. <h2 class="section"><a href="ffmpeg-filters.html#toc-addroi">11.1 addroi</a></h2>
  8057. <p>Mark a region of interest in a video frame.
  8058. </p>
  8059. <p>The frame data is passed through unchanged, but metadata is attached
  8060. to the frame indicating regions of interest which can affect the
  8061. behaviour of later encoding. Multiple regions can be marked by
  8062. applying the filter multiple times.
  8063. </p>
  8064. <dl compact="compact">
  8065. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  8066. <dd><p>Region distance in pixels from the left edge of the frame.
  8067. </p></dd>
  8068. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  8069. <dd><p>Region distance in pixels from the top edge of the frame.
  8070. </p></dd>
  8071. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  8072. <dd><p>Region width in pixels.
  8073. </p></dd>
  8074. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  8075. <dd><p>Region height in pixels.
  8076. </p>
  8077. <p>The parameters <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are expressions,
  8078. and may contain the following variables:
  8079. </p><dl compact="compact">
  8080. <dt>&lsquo;<samp>iw</samp>&rsquo;</dt>
  8081. <dd><p>Width of the input frame.
  8082. </p></dd>
  8083. <dt>&lsquo;<samp>ih</samp>&rsquo;</dt>
  8084. <dd><p>Height of the input frame.
  8085. </p></dd>
  8086. </dl>
  8087. </dd>
  8088. <dt>&lsquo;<samp>qoffset</samp>&rsquo;</dt>
  8089. <dd><p>Quantisation offset to apply within the region.
  8090. </p>
  8091. <p>This must be a real value in the range -1 to +1. A value of zero
  8092. indicates no quality change. A negative value asks for better quality
  8093. (less quantisation), while a positive value asks for worse quality
  8094. (greater quantisation).
  8095. </p>
  8096. <p>The range is calibrated so that the extreme values indicate the
  8097. largest possible offset - if the rest of the frame is encoded with the
  8098. worst possible quality, an offset of -1 indicates that this region
  8099. should be encoded with the best possible quality anyway. Intermediate
  8100. values are then interpolated in some codec-dependent way.
  8101. </p>
  8102. <p>For example, in 10-bit H.264 the quantisation parameter varies between
  8103. -12 and 51. A typical qoffset value of -1/10 therefore indicates that
  8104. this region should be encoded with a QP around one-tenth of the full
  8105. range better than the rest of the frame. So, if most of the frame
  8106. were to be encoded with a QP of around 30, this region would get a QP
  8107. of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3).
  8108. An extreme value of -1 would indicate that this region should be
  8109. encoded with the best possible quality regardless of the treatment of
  8110. the rest of the frame - that is, should be encoded at a QP of -12.
  8111. </p></dd>
  8112. <dt>&lsquo;<samp>clear</samp>&rsquo;</dt>
  8113. <dd><p>If set to true, remove any existing regions of interest marked on the
  8114. frame before adding the new one.
  8115. </p></dd>
  8116. </dl>
  8117. <a name="Examples-17"></a>
  8118. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-17">11.1.1 Examples</a></h3>
  8119. <ul>
  8120. <li>
  8121. Mark the centre quarter of the frame as interesting.
  8122. <div class="example">
  8123. <pre class="example">addroi=iw/4:ih/4:iw/2:ih/2:-1/10
  8124. </pre></div>
  8125. </li><li>
  8126. Mark the 100-pixel-wide region on the left edge of the frame as very
  8127. uninteresting (to be encoded at much lower quality than the rest of
  8128. the frame).
  8129. <div class="example">
  8130. <pre class="example">addroi=0:0:100:ih:+1/5
  8131. </pre></div>
  8132. </li></ul>
  8133. <a name="alphaextract"></a>
  8134. <h2 class="section"><a href="ffmpeg-filters.html#toc-alphaextract">11.2 alphaextract</a></h2>
  8135. <p>Extract the alpha component from the input as a grayscale video. This
  8136. is especially useful with the <var>alphamerge</var> filter.
  8137. </p>
  8138. <a name="alphamerge"></a>
  8139. <h2 class="section"><a href="ffmpeg-filters.html#toc-alphamerge">11.3 alphamerge</a></h2>
  8140. <p>Add or replace the alpha component of the primary input with the
  8141. grayscale value of a second input. This is intended for use with
  8142. <var>alphaextract</var> to allow the transmission or storage of frame
  8143. sequences that have alpha in a format that doesn&rsquo;t support an alpha
  8144. channel.
  8145. </p>
  8146. <p>For example, to reconstruct full frames from a normal YUV-encoded video
  8147. and a separate video created with <var>alphaextract</var>, you might use:
  8148. </p><div class="example">
  8149. <pre class="example">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
  8150. </pre></div>
  8151. <p>Since this filter is designed for reconstruction, it operates on frame
  8152. sequences without considering timestamps, and terminates when either
  8153. input reaches end of stream. This will cause problems if your encoding
  8154. pipeline drops frames. If you&rsquo;re trying to apply an image as an
  8155. overlay to a video stream, consider the <var>overlay</var> filter instead.
  8156. </p>
  8157. <a name="amplify"></a>
  8158. <h2 class="section"><a href="ffmpeg-filters.html#toc-amplify">11.4 amplify</a></h2>
  8159. <p>Amplify differences between current pixel and pixels of adjacent frames in
  8160. same pixel location.
  8161. </p>
  8162. <p>This filter accepts the following options:
  8163. </p>
  8164. <dl compact="compact">
  8165. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  8166. <dd><p>Set frame radius. Default is 2. Allowed range is from 1 to 63.
  8167. For example radius of 3 will instruct filter to calculate average of 7 frames.
  8168. </p>
  8169. </dd>
  8170. <dt>&lsquo;<samp>factor</samp>&rsquo;</dt>
  8171. <dd><p>Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535.
  8172. </p>
  8173. </dd>
  8174. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  8175. <dd><p>Set threshold for difference amplification. Any difference greater or equal to
  8176. this value will not alter source pixel. Default is 10.
  8177. Allowed range is from 0 to 65535.
  8178. </p>
  8179. </dd>
  8180. <dt>&lsquo;<samp>tolerance</samp>&rsquo;</dt>
  8181. <dd><p>Set tolerance for difference amplification. Any difference lower to
  8182. this value will not alter source pixel. Default is 0.
  8183. Allowed range is from 0 to 65535.
  8184. </p>
  8185. </dd>
  8186. <dt>&lsquo;<samp>low</samp>&rsquo;</dt>
  8187. <dd><p>Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  8188. This option controls maximum possible value that will decrease source pixel value.
  8189. </p>
  8190. </dd>
  8191. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  8192. <dd><p>Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  8193. This option controls maximum possible value that will increase source pixel value.
  8194. </p>
  8195. </dd>
  8196. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  8197. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  8198. </p></dd>
  8199. </dl>
  8200. <a name="Commands-45"></a>
  8201. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-45">11.4.1 Commands</a></h3>
  8202. <p>This filter supports the following <a href="#commands">commands</a> that corresponds to option of same name:
  8203. </p><dl compact="compact">
  8204. <dt>&lsquo;<samp>factor</samp>&rsquo;</dt>
  8205. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  8206. <dt>&lsquo;<samp>tolerance</samp>&rsquo;</dt>
  8207. <dt>&lsquo;<samp>low</samp>&rsquo;</dt>
  8208. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  8209. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  8210. </dl>
  8211. <a name="ass"></a>
  8212. <h2 class="section"><a href="ffmpeg-filters.html#toc-ass">11.5 ass</a></h2>
  8213. <p>Same as the <a href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
  8214. and libavformat to work. On the other hand, it is limited to ASS (Advanced
  8215. Substation Alpha) subtitles files.
  8216. </p>
  8217. <p>This filter accepts the following option in addition to the common options from
  8218. the <a href="#subtitles">subtitles</a> filter:
  8219. </p>
  8220. <dl compact="compact">
  8221. <dt>&lsquo;<samp>shaping</samp>&rsquo;</dt>
  8222. <dd><p>Set the shaping engine
  8223. </p>
  8224. <p>Available values are:
  8225. </p><dl compact="compact">
  8226. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  8227. <dd><p>The default libass shaping engine, which is the best available.
  8228. </p></dd>
  8229. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  8230. <dd><p>Fast, font-agnostic shaper that can do only substitutions
  8231. </p></dd>
  8232. <dt>&lsquo;<samp>complex</samp>&rsquo;</dt>
  8233. <dd><p>Slower shaper using OpenType for substitutions and positioning
  8234. </p></dd>
  8235. </dl>
  8236. <p>The default is <code>auto</code>.
  8237. </p></dd>
  8238. </dl>
  8239. <a name="atadenoise"></a>
  8240. <h2 class="section"><a href="ffmpeg-filters.html#toc-atadenoise">11.6 atadenoise</a></h2>
  8241. <p>Apply an Adaptive Temporal Averaging Denoiser to the video input.
  8242. </p>
  8243. <p>The filter accepts the following options:
  8244. </p>
  8245. <dl compact="compact">
  8246. <dt>&lsquo;<samp>0a</samp>&rsquo;</dt>
  8247. <dd><p>Set threshold A for 1st plane. Default is 0.02.
  8248. Valid range is 0 to 0.3.
  8249. </p>
  8250. </dd>
  8251. <dt>&lsquo;<samp>0b</samp>&rsquo;</dt>
  8252. <dd><p>Set threshold B for 1st plane. Default is 0.04.
  8253. Valid range is 0 to 5.
  8254. </p>
  8255. </dd>
  8256. <dt>&lsquo;<samp>1a</samp>&rsquo;</dt>
  8257. <dd><p>Set threshold A for 2nd plane. Default is 0.02.
  8258. Valid range is 0 to 0.3.
  8259. </p>
  8260. </dd>
  8261. <dt>&lsquo;<samp>1b</samp>&rsquo;</dt>
  8262. <dd><p>Set threshold B for 2nd plane. Default is 0.04.
  8263. Valid range is 0 to 5.
  8264. </p>
  8265. </dd>
  8266. <dt>&lsquo;<samp>2a</samp>&rsquo;</dt>
  8267. <dd><p>Set threshold A for 3rd plane. Default is 0.02.
  8268. Valid range is 0 to 0.3.
  8269. </p>
  8270. </dd>
  8271. <dt>&lsquo;<samp>2b</samp>&rsquo;</dt>
  8272. <dd><p>Set threshold B for 3rd plane. Default is 0.04.
  8273. Valid range is 0 to 5.
  8274. </p>
  8275. <p>Threshold A is designed to react on abrupt changes in the input signal and
  8276. threshold B is designed to react on continuous changes in the input signal.
  8277. </p>
  8278. </dd>
  8279. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  8280. <dd><p>Set number of frames filter will use for averaging. Default is 9. Must be odd
  8281. number in range [5, 129].
  8282. </p>
  8283. </dd>
  8284. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  8285. <dd><p>Set what planes of frame filter will use for averaging. Default is all.
  8286. </p>
  8287. </dd>
  8288. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  8289. <dd><p>Set what variant of algorithm filter will use for averaging. Default is <code>p</code> parallel.
  8290. Alternatively can be set to <code>s</code> serial.
  8291. </p>
  8292. <p>Parallel can be faster then serial, while other way around is never true.
  8293. Parallel will abort early on first change being greater then thresholds, while serial
  8294. will continue processing other side of frames if they are equal or bellow thresholds.
  8295. </p></dd>
  8296. </dl>
  8297. <a name="Commands-47"></a>
  8298. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-47">11.6.1 Commands</a></h3>
  8299. <p>This filter supports same <a href="#commands">commands</a> as options except option <code>s</code>.
  8300. The command accepts the same syntax of the corresponding option.
  8301. </p>
  8302. <a name="avgblur"></a>
  8303. <h2 class="section"><a href="ffmpeg-filters.html#toc-avgblur">11.7 avgblur</a></h2>
  8304. <p>Apply average blur filter.
  8305. </p>
  8306. <p>The filter accepts the following options:
  8307. </p>
  8308. <dl compact="compact">
  8309. <dt>&lsquo;<samp>sizeX</samp>&rsquo;</dt>
  8310. <dd><p>Set horizontal radius size.
  8311. </p>
  8312. </dd>
  8313. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  8314. <dd><p>Set which planes to filter. By default all planes are filtered.
  8315. </p>
  8316. </dd>
  8317. <dt>&lsquo;<samp>sizeY</samp>&rsquo;</dt>
  8318. <dd><p>Set vertical radius size, if zero it will be same as <code>sizeX</code>.
  8319. Default is <code>0</code>.
  8320. </p></dd>
  8321. </dl>
  8322. <a name="Commands-13"></a>
  8323. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-13">11.7.1 Commands</a></h3>
  8324. <p>This filter supports same commands as options.
  8325. The command accepts the same syntax of the corresponding option.
  8326. </p>
  8327. <p>If the specified expression is not valid, it is kept at its current
  8328. value.
  8329. </p>
  8330. <a name="bbox"></a>
  8331. <h2 class="section"><a href="ffmpeg-filters.html#toc-bbox">11.8 bbox</a></h2>
  8332. <p>Compute the bounding box for the non-black pixels in the input frame
  8333. luminance plane.
  8334. </p>
  8335. <p>This filter computes the bounding box containing all the pixels with a
  8336. luminance value greater than the minimum allowed value.
  8337. The parameters describing the bounding box are printed on the filter
  8338. log.
  8339. </p>
  8340. <p>The filter accepts the following option:
  8341. </p>
  8342. <dl compact="compact">
  8343. <dt>&lsquo;<samp>min_val</samp>&rsquo;</dt>
  8344. <dd><p>Set the minimal luminance value. Default is <code>16</code>.
  8345. </p></dd>
  8346. </dl>
  8347. <a name="bilateral"></a>
  8348. <h2 class="section"><a href="ffmpeg-filters.html#toc-bilateral">11.9 bilateral</a></h2>
  8349. <p>Apply bilateral filter, spatial smoothing while preserving edges.
  8350. </p>
  8351. <p>The filter accepts the following options:
  8352. </p><dl compact="compact">
  8353. <dt>&lsquo;<samp>sigmaS</samp>&rsquo;</dt>
  8354. <dd><p>Set sigma of gaussian function to calculate spatial weight.
  8355. Allowed range is 0 to 10. Default is 0.1.
  8356. </p>
  8357. </dd>
  8358. <dt>&lsquo;<samp>sigmaR</samp>&rsquo;</dt>
  8359. <dd><p>Set sigma of gaussian function to calculate range weight.
  8360. Allowed range is 0 to 1. Default is 0.1.
  8361. </p>
  8362. </dd>
  8363. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  8364. <dd><p>Set planes to filter. Default is first only.
  8365. </p></dd>
  8366. </dl>
  8367. <a name="bitplanenoise"></a>
  8368. <h2 class="section"><a href="ffmpeg-filters.html#toc-bitplanenoise">11.10 bitplanenoise</a></h2>
  8369. <p>Show and measure bit plane noise.
  8370. </p>
  8371. <p>The filter accepts the following options:
  8372. </p>
  8373. <dl compact="compact">
  8374. <dt>&lsquo;<samp>bitplane</samp>&rsquo;</dt>
  8375. <dd><p>Set which plane to analyze. Default is <code>1</code>.
  8376. </p>
  8377. </dd>
  8378. <dt>&lsquo;<samp>filter</samp>&rsquo;</dt>
  8379. <dd><p>Filter out noisy pixels from <code>bitplane</code> set above.
  8380. Default is disabled.
  8381. </p></dd>
  8382. </dl>
  8383. <a name="blackdetect"></a>
  8384. <h2 class="section"><a href="ffmpeg-filters.html#toc-blackdetect">11.11 blackdetect</a></h2>
  8385. <p>Detect video intervals that are (almost) completely black. Can be
  8386. useful to detect chapter transitions, commercials, or invalid
  8387. recordings.
  8388. </p>
  8389. <p>The filter outputs its detection analysis to both the log as well as
  8390. frame metadata. If a black segment of at least the specified minimum
  8391. duration is found, a line with the start and end timestamps as well
  8392. as duration is printed to the log with level <code>info</code>. In addition,
  8393. a log line with level <code>debug</code> is printed per frame showing the
  8394. black amount detected for that frame.
  8395. </p>
  8396. <p>The filter also attaches metadata to the first frame of a black
  8397. segment with key <code>lavfi.black_start</code> and to the first frame
  8398. after the black segment ends with key <code>lavfi.black_end</code>. The
  8399. value is the frame&rsquo;s timestamp. This metadata is added regardless
  8400. of the minimum duration specified.
  8401. </p>
  8402. <p>The filter accepts the following options:
  8403. </p>
  8404. <dl compact="compact">
  8405. <dt>&lsquo;<samp>black_min_duration, d</samp>&rsquo;</dt>
  8406. <dd><p>Set the minimum detected black duration expressed in seconds. It must
  8407. be a non-negative floating point number.
  8408. </p>
  8409. <p>Default value is 2.0.
  8410. </p>
  8411. </dd>
  8412. <dt>&lsquo;<samp>picture_black_ratio_th, pic_th</samp>&rsquo;</dt>
  8413. <dd><p>Set the threshold for considering a picture &quot;black&quot;.
  8414. Express the minimum value for the ratio:
  8415. </p><div class="example">
  8416. <pre class="example"><var>nb_black_pixels</var> / <var>nb_pixels</var>
  8417. </pre></div>
  8418. <p>for which a picture is considered black.
  8419. Default value is 0.98.
  8420. </p>
  8421. </dd>
  8422. <dt>&lsquo;<samp>pixel_black_th, pix_th</samp>&rsquo;</dt>
  8423. <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
  8424. </p>
  8425. <p>The threshold expresses the maximum pixel luminance value for which a
  8426. pixel is considered &quot;black&quot;. The provided value is scaled according to
  8427. the following equation:
  8428. </p><div class="example">
  8429. <pre class="example"><var>absolute_threshold</var> = <var>luminance_minimum_value</var> + <var>pixel_black_th</var> * <var>luminance_range_size</var>
  8430. </pre></div>
  8431. <p><var>luminance_range_size</var> and <var>luminance_minimum_value</var> depend on
  8432. the input video format, the range is [0-255] for YUV full-range
  8433. formats and [16-235] for YUV non full-range formats.
  8434. </p>
  8435. <p>Default value is 0.10.
  8436. </p></dd>
  8437. </dl>
  8438. <p>The following example sets the maximum pixel threshold to the minimum
  8439. value, and detects only black intervals of 2 or more seconds:
  8440. </p><div class="example">
  8441. <pre class="example">blackdetect=d=2:pix_th=0.00
  8442. </pre></div>
  8443. <a name="blackframe"></a>
  8444. <h2 class="section"><a href="ffmpeg-filters.html#toc-blackframe">11.12 blackframe</a></h2>
  8445. <p>Detect frames that are (almost) completely black. Can be useful to
  8446. detect chapter transitions or commercials. Output lines consist of
  8447. the frame number of the detected frame, the percentage of blackness,
  8448. the position in the file if known or -1 and the timestamp in seconds.
  8449. </p>
  8450. <p>In order to display the output lines, you need to set the loglevel at
  8451. least to the AV_LOG_INFO value.
  8452. </p>
  8453. <p>This filter exports frame metadata <code>lavfi.blackframe.pblack</code>.
  8454. The value represents the percentage of pixels in the picture that
  8455. are below the threshold value.
  8456. </p>
  8457. <p>It accepts the following parameters:
  8458. </p>
  8459. <dl compact="compact">
  8460. <dt>&lsquo;<samp>amount</samp>&rsquo;</dt>
  8461. <dd><p>The percentage of the pixels that have to be below the threshold; it defaults to
  8462. <code>98</code>.
  8463. </p>
  8464. </dd>
  8465. <dt>&lsquo;<samp>threshold, thresh</samp>&rsquo;</dt>
  8466. <dd><p>The threshold below which a pixel value is considered black; it defaults to
  8467. <code>32</code>.
  8468. </p>
  8469. </dd>
  8470. </dl>
  8471. <p><a name="blend"></a>
  8472. </p><a name="blend-1"></a>
  8473. <h2 class="section"><a href="ffmpeg-filters.html#toc-blend-1">11.13 blend</a></h2>
  8474. <p>Blend two video frames into each other.
  8475. </p>
  8476. <p>The <code>blend</code> filter takes two input streams and outputs one
  8477. stream, the first input is the &quot;top&quot; layer and second input is
  8478. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  8479. </p>
  8480. <p>The <code>tblend</code> (time blend) filter takes two consecutive frames
  8481. from one single stream, and outputs the result obtained by blending
  8482. the new frame on top of the old frame.
  8483. </p>
  8484. <p>A description of the accepted options follows.
  8485. </p>
  8486. <dl compact="compact">
  8487. <dt>&lsquo;<samp>c0_mode</samp>&rsquo;</dt>
  8488. <dt>&lsquo;<samp>c1_mode</samp>&rsquo;</dt>
  8489. <dt>&lsquo;<samp>c2_mode</samp>&rsquo;</dt>
  8490. <dt>&lsquo;<samp>c3_mode</samp>&rsquo;</dt>
  8491. <dt>&lsquo;<samp>all_mode</samp>&rsquo;</dt>
  8492. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  8493. of <var>all_mode</var>. Default value is <code>normal</code>.
  8494. </p>
  8495. <p>Available values for component modes are:
  8496. </p><dl compact="compact">
  8497. <dt>&lsquo;<samp>addition</samp>&rsquo;</dt>
  8498. <dt>&lsquo;<samp>grainmerge</samp>&rsquo;</dt>
  8499. <dt>&lsquo;<samp>and</samp>&rsquo;</dt>
  8500. <dt>&lsquo;<samp>average</samp>&rsquo;</dt>
  8501. <dt>&lsquo;<samp>burn</samp>&rsquo;</dt>
  8502. <dt>&lsquo;<samp>darken</samp>&rsquo;</dt>
  8503. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  8504. <dt>&lsquo;<samp>grainextract</samp>&rsquo;</dt>
  8505. <dt>&lsquo;<samp>divide</samp>&rsquo;</dt>
  8506. <dt>&lsquo;<samp>dodge</samp>&rsquo;</dt>
  8507. <dt>&lsquo;<samp>freeze</samp>&rsquo;</dt>
  8508. <dt>&lsquo;<samp>exclusion</samp>&rsquo;</dt>
  8509. <dt>&lsquo;<samp>extremity</samp>&rsquo;</dt>
  8510. <dt>&lsquo;<samp>glow</samp>&rsquo;</dt>
  8511. <dt>&lsquo;<samp>hardlight</samp>&rsquo;</dt>
  8512. <dt>&lsquo;<samp>hardmix</samp>&rsquo;</dt>
  8513. <dt>&lsquo;<samp>heat</samp>&rsquo;</dt>
  8514. <dt>&lsquo;<samp>lighten</samp>&rsquo;</dt>
  8515. <dt>&lsquo;<samp>linearlight</samp>&rsquo;</dt>
  8516. <dt>&lsquo;<samp>multiply</samp>&rsquo;</dt>
  8517. <dt>&lsquo;<samp>multiply128</samp>&rsquo;</dt>
  8518. <dt>&lsquo;<samp>negation</samp>&rsquo;</dt>
  8519. <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
  8520. <dt>&lsquo;<samp>or</samp>&rsquo;</dt>
  8521. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  8522. <dt>&lsquo;<samp>phoenix</samp>&rsquo;</dt>
  8523. <dt>&lsquo;<samp>pinlight</samp>&rsquo;</dt>
  8524. <dt>&lsquo;<samp>reflect</samp>&rsquo;</dt>
  8525. <dt>&lsquo;<samp>screen</samp>&rsquo;</dt>
  8526. <dt>&lsquo;<samp>softlight</samp>&rsquo;</dt>
  8527. <dt>&lsquo;<samp>subtract</samp>&rsquo;</dt>
  8528. <dt>&lsquo;<samp>vividlight</samp>&rsquo;</dt>
  8529. <dt>&lsquo;<samp>xor</samp>&rsquo;</dt>
  8530. </dl>
  8531. </dd>
  8532. <dt>&lsquo;<samp>c0_opacity</samp>&rsquo;</dt>
  8533. <dt>&lsquo;<samp>c1_opacity</samp>&rsquo;</dt>
  8534. <dt>&lsquo;<samp>c2_opacity</samp>&rsquo;</dt>
  8535. <dt>&lsquo;<samp>c3_opacity</samp>&rsquo;</dt>
  8536. <dt>&lsquo;<samp>all_opacity</samp>&rsquo;</dt>
  8537. <dd><p>Set blend opacity for specific pixel component or all pixel components in case
  8538. of <var>all_opacity</var>. Only used in combination with pixel component blend modes.
  8539. </p>
  8540. </dd>
  8541. <dt>&lsquo;<samp>c0_expr</samp>&rsquo;</dt>
  8542. <dt>&lsquo;<samp>c1_expr</samp>&rsquo;</dt>
  8543. <dt>&lsquo;<samp>c2_expr</samp>&rsquo;</dt>
  8544. <dt>&lsquo;<samp>c3_expr</samp>&rsquo;</dt>
  8545. <dt>&lsquo;<samp>all_expr</samp>&rsquo;</dt>
  8546. <dd><p>Set blend expression for specific pixel component or all pixel components in case
  8547. of <var>all_expr</var>. Note that related mode options will be ignored if those are set.
  8548. </p>
  8549. <p>The expressions can use the following variables:
  8550. </p>
  8551. <dl compact="compact">
  8552. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  8553. <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
  8554. </p>
  8555. </dd>
  8556. <dt>&lsquo;<samp>X</samp>&rsquo;</dt>
  8557. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  8558. <dd><p>the coordinates of the current sample
  8559. </p>
  8560. </dd>
  8561. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  8562. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  8563. <dd><p>the width and height of currently filtered plane
  8564. </p>
  8565. </dd>
  8566. <dt>&lsquo;<samp>SW</samp>&rsquo;</dt>
  8567. <dt>&lsquo;<samp>SH</samp>&rsquo;</dt>
  8568. <dd><p>Width and height scale for the plane being filtered. It is the
  8569. ratio between the dimensions of the current plane to the luma plane,
  8570. e.g. for a <code>yuv420p</code> frame, the values are <code>1,1</code> for
  8571. the luma plane and <code>0.5,0.5</code> for the chroma planes.
  8572. </p>
  8573. </dd>
  8574. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  8575. <dd><p>Time of the current frame, expressed in seconds.
  8576. </p>
  8577. </dd>
  8578. <dt>&lsquo;<samp>TOP, A</samp>&rsquo;</dt>
  8579. <dd><p>Value of pixel component at current location for first video frame (top layer).
  8580. </p>
  8581. </dd>
  8582. <dt>&lsquo;<samp>BOTTOM, B</samp>&rsquo;</dt>
  8583. <dd><p>Value of pixel component at current location for second video frame (bottom layer).
  8584. </p></dd>
  8585. </dl>
  8586. </dd>
  8587. </dl>
  8588. <p>The <code>blend</code> filter also supports the <a href="#framesync">framesync</a> options.
  8589. </p>
  8590. <a name="Examples-110"></a>
  8591. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-110">11.13.1 Examples</a></h3>
  8592. <ul>
  8593. <li>
  8594. Apply transition from bottom layer to top layer in first 10 seconds:
  8595. <div class="example">
  8596. <pre class="example">blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
  8597. </pre></div>
  8598. </li><li>
  8599. Apply linear horizontal transition from top layer to bottom layer:
  8600. <div class="example">
  8601. <pre class="example">blend=all_expr='A*(X/W)+B*(1-X/W)'
  8602. </pre></div>
  8603. </li><li>
  8604. Apply 1x1 checkerboard effect:
  8605. <div class="example">
  8606. <pre class="example">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
  8607. </pre></div>
  8608. </li><li>
  8609. Apply uncover left effect:
  8610. <div class="example">
  8611. <pre class="example">blend=all_expr='if(gte(N*SW+X,W),A,B)'
  8612. </pre></div>
  8613. </li><li>
  8614. Apply uncover down effect:
  8615. <div class="example">
  8616. <pre class="example">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
  8617. </pre></div>
  8618. </li><li>
  8619. Apply uncover up-left effect:
  8620. <div class="example">
  8621. <pre class="example">blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
  8622. </pre></div>
  8623. </li><li>
  8624. Split diagonally video and shows top and bottom layer on each side:
  8625. <div class="example">
  8626. <pre class="example">blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
  8627. </pre></div>
  8628. </li><li>
  8629. Display differences between the current and the previous frame:
  8630. <div class="example">
  8631. <pre class="example">tblend=all_mode=grainextract
  8632. </pre></div>
  8633. </li></ul>
  8634. <a name="bm3d"></a>
  8635. <h2 class="section"><a href="ffmpeg-filters.html#toc-bm3d">11.14 bm3d</a></h2>
  8636. <p>Denoise frames using Block-Matching 3D algorithm.
  8637. </p>
  8638. <p>The filter accepts the following options.
  8639. </p>
  8640. <dl compact="compact">
  8641. <dt>&lsquo;<samp>sigma</samp>&rsquo;</dt>
  8642. <dd><p>Set denoising strength. Default value is 1.
  8643. Allowed range is from 0 to 999.9.
  8644. The denoising algorithm is very sensitive to sigma, so adjust it
  8645. according to the source.
  8646. </p>
  8647. </dd>
  8648. <dt>&lsquo;<samp>block</samp>&rsquo;</dt>
  8649. <dd><p>Set local patch size. This sets dimensions in 2D.
  8650. </p>
  8651. </dd>
  8652. <dt>&lsquo;<samp>bstep</samp>&rsquo;</dt>
  8653. <dd><p>Set sliding step for processing blocks. Default value is 4.
  8654. Allowed range is from 1 to 64.
  8655. Smaller values allows processing more reference blocks and is slower.
  8656. </p>
  8657. </dd>
  8658. <dt>&lsquo;<samp>group</samp>&rsquo;</dt>
  8659. <dd><p>Set maximal number of similar blocks for 3rd dimension. Default value is 1.
  8660. When set to 1, no block matching is done. Larger values allows more blocks
  8661. in single group.
  8662. Allowed range is from 1 to 256.
  8663. </p>
  8664. </dd>
  8665. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  8666. <dd><p>Set radius for search block matching. Default is 9.
  8667. Allowed range is from 1 to INT32_MAX.
  8668. </p>
  8669. </dd>
  8670. <dt>&lsquo;<samp>mstep</samp>&rsquo;</dt>
  8671. <dd><p>Set step between two search locations for block matching. Default is 1.
  8672. Allowed range is from 1 to 64. Smaller is slower.
  8673. </p>
  8674. </dd>
  8675. <dt>&lsquo;<samp>thmse</samp>&rsquo;</dt>
  8676. <dd><p>Set threshold of mean square error for block matching. Valid range is 0 to
  8677. INT32_MAX.
  8678. </p>
  8679. </dd>
  8680. <dt>&lsquo;<samp>hdthr</samp>&rsquo;</dt>
  8681. <dd><p>Set thresholding parameter for hard thresholding in 3D transformed domain.
  8682. Larger values results in stronger hard-thresholding filtering in frequency
  8683. domain.
  8684. </p>
  8685. </dd>
  8686. <dt>&lsquo;<samp>estim</samp>&rsquo;</dt>
  8687. <dd><p>Set filtering estimation mode. Can be <code>basic</code> or <code>final</code>.
  8688. Default is <code>basic</code>.
  8689. </p>
  8690. </dd>
  8691. <dt>&lsquo;<samp>ref</samp>&rsquo;</dt>
  8692. <dd><p>If enabled, filter will use 2nd stream for block matching.
  8693. Default is disabled for <code>basic</code> value of <var>estim</var> option,
  8694. and always enabled if value of <var>estim</var> is <code>final</code>.
  8695. </p>
  8696. </dd>
  8697. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  8698. <dd><p>Set planes to filter. Default is all available except alpha.
  8699. </p></dd>
  8700. </dl>
  8701. <a name="Examples-140"></a>
  8702. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-140">11.14.1 Examples</a></h3>
  8703. <ul>
  8704. <li>
  8705. Basic filtering with bm3d:
  8706. <div class="example">
  8707. <pre class="example">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
  8708. </pre></div>
  8709. </li><li>
  8710. Same as above, but filtering only luma:
  8711. <div class="example">
  8712. <pre class="example">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
  8713. </pre></div>
  8714. </li><li>
  8715. Same as above, but with both estimation modes:
  8716. <div class="example">
  8717. <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
  8718. </pre></div>
  8719. </li><li>
  8720. Same as above, but prefilter with <a href="#nlmeans">nlmeans</a> filter instead:
  8721. <div class="example">
  8722. <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
  8723. </pre></div>
  8724. </li></ul>
  8725. <a name="boxblur"></a>
  8726. <h2 class="section"><a href="ffmpeg-filters.html#toc-boxblur">11.15 boxblur</a></h2>
  8727. <p>Apply a boxblur algorithm to the input video.
  8728. </p>
  8729. <p>It accepts the following parameters:
  8730. </p>
  8731. <dl compact="compact">
  8732. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  8733. <dt>&lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
  8734. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  8735. <dt>&lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
  8736. <dt>&lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
  8737. <dt>&lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
  8738. </dl>
  8739. <p>A description of the accepted options follows.
  8740. </p>
  8741. <dl compact="compact">
  8742. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  8743. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  8744. <dt>&lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
  8745. <dd><p>Set an expression for the box radius in pixels used for blurring the
  8746. corresponding input plane.
  8747. </p>
  8748. <p>The radius value must be a non-negative number, and must not be
  8749. greater than the value of the expression <code>min(w,h)/2</code> for the
  8750. luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
  8751. planes.
  8752. </p>
  8753. <p>Default value for &lsquo;<samp>luma_radius</samp>&rsquo; is &quot;2&quot;. If not specified,
  8754. &lsquo;<samp>chroma_radius</samp>&rsquo; and &lsquo;<samp>alpha_radius</samp>&rsquo; default to the
  8755. corresponding value set for &lsquo;<samp>luma_radius</samp>&rsquo;.
  8756. </p>
  8757. <p>The expressions can contain the following constants:
  8758. </p><dl compact="compact">
  8759. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  8760. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  8761. <dd><p>The input width and height in pixels.
  8762. </p>
  8763. </dd>
  8764. <dt>&lsquo;<samp>cw</samp>&rsquo;</dt>
  8765. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  8766. <dd><p>The input chroma image width and height in pixels.
  8767. </p>
  8768. </dd>
  8769. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  8770. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  8771. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  8772. pixel format &quot;yuv422p&quot;, <var>hsub</var> is 2 and <var>vsub</var> is 1.
  8773. </p></dd>
  8774. </dl>
  8775. </dd>
  8776. <dt>&lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
  8777. <dt>&lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
  8778. <dt>&lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
  8779. <dd><p>Specify how many times the boxblur filter is applied to the
  8780. corresponding plane.
  8781. </p>
  8782. <p>Default value for &lsquo;<samp>luma_power</samp>&rsquo; is 2. If not specified,
  8783. &lsquo;<samp>chroma_power</samp>&rsquo; and &lsquo;<samp>alpha_power</samp>&rsquo; default to the
  8784. corresponding value set for &lsquo;<samp>luma_power</samp>&rsquo;.
  8785. </p>
  8786. <p>A value of 0 will disable the effect.
  8787. </p></dd>
  8788. </dl>
  8789. <a name="Examples-97"></a>
  8790. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-97">11.15.1 Examples</a></h3>
  8791. <ul>
  8792. <li>
  8793. Apply a boxblur filter with the luma, chroma, and alpha radii
  8794. set to 2:
  8795. <div class="example">
  8796. <pre class="example">boxblur=luma_radius=2:luma_power=1
  8797. boxblur=2:1
  8798. </pre></div>
  8799. </li><li>
  8800. Set the luma radius to 2, and alpha and chroma radius to 0:
  8801. <div class="example">
  8802. <pre class="example">boxblur=2:1:cr=0:ar=0
  8803. </pre></div>
  8804. </li><li>
  8805. Set the luma and chroma radii to a fraction of the video dimension:
  8806. <div class="example">
  8807. <pre class="example">boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
  8808. </pre></div>
  8809. </li></ul>
  8810. <a name="bwdif"></a>
  8811. <h2 class="section"><a href="ffmpeg-filters.html#toc-bwdif">11.16 bwdif</a></h2>
  8812. <p>Deinterlace the input video (&quot;bwdif&quot; stands for &quot;Bob Weaver
  8813. Deinterlacing Filter&quot;).
  8814. </p>
  8815. <p>Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic
  8816. interpolation algorithms.
  8817. It accepts the following parameters:
  8818. </p>
  8819. <dl compact="compact">
  8820. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  8821. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  8822. </p>
  8823. <dl compact="compact">
  8824. <dt>&lsquo;<samp>0, send_frame</samp>&rsquo;</dt>
  8825. <dd><p>Output one frame for each frame.
  8826. </p></dd>
  8827. <dt>&lsquo;<samp>1, send_field</samp>&rsquo;</dt>
  8828. <dd><p>Output one frame for each field.
  8829. </p></dd>
  8830. </dl>
  8831. <p>The default value is <code>send_field</code>.
  8832. </p>
  8833. </dd>
  8834. <dt>&lsquo;<samp>parity</samp>&rsquo;</dt>
  8835. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  8836. of the following values:
  8837. </p>
  8838. <dl compact="compact">
  8839. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  8840. <dd><p>Assume the top field is first.
  8841. </p></dd>
  8842. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  8843. <dd><p>Assume the bottom field is first.
  8844. </p></dd>
  8845. <dt>&lsquo;<samp>-1, auto</samp>&rsquo;</dt>
  8846. <dd><p>Enable automatic detection of field parity.
  8847. </p></dd>
  8848. </dl>
  8849. <p>The default value is <code>auto</code>.
  8850. If the interlacing is unknown or the decoder does not export this information,
  8851. top field first will be assumed.
  8852. </p>
  8853. </dd>
  8854. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  8855. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  8856. values:
  8857. </p>
  8858. <dl compact="compact">
  8859. <dt>&lsquo;<samp>0, all</samp>&rsquo;</dt>
  8860. <dd><p>Deinterlace all frames.
  8861. </p></dd>
  8862. <dt>&lsquo;<samp>1, interlaced</samp>&rsquo;</dt>
  8863. <dd><p>Only deinterlace frames marked as interlaced.
  8864. </p></dd>
  8865. </dl>
  8866. <p>The default value is <code>all</code>.
  8867. </p></dd>
  8868. </dl>
  8869. <a name="cas"></a>
  8870. <h2 class="section"><a href="ffmpeg-filters.html#toc-cas">11.17 cas</a></h2>
  8871. <p>Apply Contrast Adaptive Sharpen filter to video stream.
  8872. </p>
  8873. <p>The filter accepts the following options:
  8874. </p>
  8875. <dl compact="compact">
  8876. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  8877. <dd><p>Set the sharpening strength. Default value is 0.
  8878. </p>
  8879. </dd>
  8880. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  8881. <dd><p>Set planes to filter. Default value is to filter all
  8882. planes except alpha plane.
  8883. </p></dd>
  8884. </dl>
  8885. <a name="chromahold"></a>
  8886. <h2 class="section"><a href="ffmpeg-filters.html#toc-chromahold">11.18 chromahold</a></h2>
  8887. <p>Remove all color information for all colors except for certain one.
  8888. </p>
  8889. <p>The filter accepts the following options:
  8890. </p>
  8891. <dl compact="compact">
  8892. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  8893. <dd><p>The color which will not be replaced with neutral chroma.
  8894. </p>
  8895. </dd>
  8896. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  8897. <dd><p>Similarity percentage with the above color.
  8898. 0.01 matches only the exact key color, while 1.0 matches everything.
  8899. </p>
  8900. </dd>
  8901. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  8902. <dd><p>Blend percentage.
  8903. 0.0 makes pixels either fully gray, or not gray at all.
  8904. Higher values result in more preserved color.
  8905. </p>
  8906. </dd>
  8907. <dt>&lsquo;<samp>yuv</samp>&rsquo;</dt>
  8908. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  8909. </p>
  8910. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  8911. This can be used to pass exact YUV values as hexadecimal numbers.
  8912. </p></dd>
  8913. </dl>
  8914. <a name="Commands-7"></a>
  8915. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-7">11.18.1 Commands</a></h3>
  8916. <p>This filter supports same <a href="#commands">commands</a> as options.
  8917. The command accepts the same syntax of the corresponding option.
  8918. </p>
  8919. <p>If the specified expression is not valid, it is kept at its current
  8920. value.
  8921. </p>
  8922. <a name="chromakey"></a>
  8923. <h2 class="section"><a href="ffmpeg-filters.html#toc-chromakey">11.19 chromakey</a></h2>
  8924. <p>YUV colorspace color/chroma keying.
  8925. </p>
  8926. <p>The filter accepts the following options:
  8927. </p>
  8928. <dl compact="compact">
  8929. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  8930. <dd><p>The color which will be replaced with transparency.
  8931. </p>
  8932. </dd>
  8933. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  8934. <dd><p>Similarity percentage with the key color.
  8935. </p>
  8936. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  8937. </p>
  8938. </dd>
  8939. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  8940. <dd><p>Blend percentage.
  8941. </p>
  8942. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  8943. </p>
  8944. <p>Higher values result in semi-transparent pixels, with a higher transparency
  8945. the more similar the pixels color is to the key color.
  8946. </p>
  8947. </dd>
  8948. <dt>&lsquo;<samp>yuv</samp>&rsquo;</dt>
  8949. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  8950. </p>
  8951. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  8952. This can be used to pass exact YUV values as hexadecimal numbers.
  8953. </p></dd>
  8954. </dl>
  8955. <a name="Commands-60"></a>
  8956. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-60">11.19.1 Commands</a></h3>
  8957. <p>This filter supports same <a href="#commands">commands</a> as options.
  8958. The command accepts the same syntax of the corresponding option.
  8959. </p>
  8960. <p>If the specified expression is not valid, it is kept at its current
  8961. value.
  8962. </p>
  8963. <a name="Examples-59"></a>
  8964. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-59">11.19.2 Examples</a></h3>
  8965. <ul>
  8966. <li>
  8967. Make every green pixel in the input image transparent:
  8968. <div class="example">
  8969. <pre class="example">ffmpeg -i input.png -vf chromakey=green out.png
  8970. </pre></div>
  8971. </li><li>
  8972. Overlay a greenscreen-video on top of a static black background.
  8973. <div class="example">
  8974. <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
  8975. </pre></div>
  8976. </li></ul>
  8977. <a name="chromashift"></a>
  8978. <h2 class="section"><a href="ffmpeg-filters.html#toc-chromashift">11.20 chromashift</a></h2>
  8979. <p>Shift chroma pixels horizontally and/or vertically.
  8980. </p>
  8981. <p>The filter accepts the following options:
  8982. </p><dl compact="compact">
  8983. <dt>&lsquo;<samp>cbh</samp>&rsquo;</dt>
  8984. <dd><p>Set amount to shift chroma-blue horizontally.
  8985. </p></dd>
  8986. <dt>&lsquo;<samp>cbv</samp>&rsquo;</dt>
  8987. <dd><p>Set amount to shift chroma-blue vertically.
  8988. </p></dd>
  8989. <dt>&lsquo;<samp>crh</samp>&rsquo;</dt>
  8990. <dd><p>Set amount to shift chroma-red horizontally.
  8991. </p></dd>
  8992. <dt>&lsquo;<samp>crv</samp>&rsquo;</dt>
  8993. <dd><p>Set amount to shift chroma-red vertically.
  8994. </p></dd>
  8995. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  8996. <dd><p>Set edge mode, can be <var>smear</var>, default, or <var>warp</var>.
  8997. </p></dd>
  8998. </dl>
  8999. <a name="Commands-2"></a>
  9000. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-2">11.20.1 Commands</a></h3>
  9001. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  9002. </p>
  9003. <a name="ciescope"></a>
  9004. <h2 class="section"><a href="ffmpeg-filters.html#toc-ciescope">11.21 ciescope</a></h2>
  9005. <p>Display CIE color diagram with pixels overlaid onto it.
  9006. </p>
  9007. <p>The filter accepts the following options:
  9008. </p>
  9009. <dl compact="compact">
  9010. <dt>&lsquo;<samp>system</samp>&rsquo;</dt>
  9011. <dd><p>Set color system.
  9012. </p>
  9013. <dl compact="compact">
  9014. <dt>&lsquo;<samp>ntsc, 470m</samp>&rsquo;</dt>
  9015. <dt>&lsquo;<samp>ebu, 470bg</samp>&rsquo;</dt>
  9016. <dt>&lsquo;<samp>smpte</samp>&rsquo;</dt>
  9017. <dt>&lsquo;<samp>240m</samp>&rsquo;</dt>
  9018. <dt>&lsquo;<samp>apple</samp>&rsquo;</dt>
  9019. <dt>&lsquo;<samp>widergb</samp>&rsquo;</dt>
  9020. <dt>&lsquo;<samp>cie1931</samp>&rsquo;</dt>
  9021. <dt>&lsquo;<samp>rec709, hdtv</samp>&rsquo;</dt>
  9022. <dt>&lsquo;<samp>uhdtv, rec2020</samp>&rsquo;</dt>
  9023. <dt>&lsquo;<samp>dcip3</samp>&rsquo;</dt>
  9024. </dl>
  9025. </dd>
  9026. <dt>&lsquo;<samp>cie</samp>&rsquo;</dt>
  9027. <dd><p>Set CIE system.
  9028. </p>
  9029. <dl compact="compact">
  9030. <dt>&lsquo;<samp>xyy</samp>&rsquo;</dt>
  9031. <dt>&lsquo;<samp>ucs</samp>&rsquo;</dt>
  9032. <dt>&lsquo;<samp>luv</samp>&rsquo;</dt>
  9033. </dl>
  9034. </dd>
  9035. <dt>&lsquo;<samp>gamuts</samp>&rsquo;</dt>
  9036. <dd><p>Set what gamuts to draw.
  9037. </p>
  9038. <p>See <code>system</code> option for available values.
  9039. </p>
  9040. </dd>
  9041. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  9042. <dd><p>Set ciescope size, by default set to 512.
  9043. </p>
  9044. </dd>
  9045. <dt>&lsquo;<samp>intensity, i</samp>&rsquo;</dt>
  9046. <dd><p>Set intensity used to map input pixel values to CIE diagram.
  9047. </p>
  9048. </dd>
  9049. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  9050. <dd><p>Set contrast used to draw tongue colors that are out of active color system gamut.
  9051. </p>
  9052. </dd>
  9053. <dt>&lsquo;<samp>corrgamma</samp>&rsquo;</dt>
  9054. <dd><p>Correct gamma displayed on scope, by default enabled.
  9055. </p>
  9056. </dd>
  9057. <dt>&lsquo;<samp>showwhite</samp>&rsquo;</dt>
  9058. <dd><p>Show white point on CIE diagram, by default disabled.
  9059. </p>
  9060. </dd>
  9061. <dt>&lsquo;<samp>gamma</samp>&rsquo;</dt>
  9062. <dd><p>Set input gamma. Used only with XYZ input color space.
  9063. </p></dd>
  9064. </dl>
  9065. <a name="codecview"></a>
  9066. <h2 class="section"><a href="ffmpeg-filters.html#toc-codecview">11.22 codecview</a></h2>
  9067. <p>Visualize information exported by some codecs.
  9068. </p>
  9069. <p>Some codecs can export information through frames using side-data or other
  9070. means. For example, some MPEG based codecs export motion vectors through the
  9071. <var>export_mvs</var> flag in the codec &lsquo;<samp>flags2</samp>&rsquo; option.
  9072. </p>
  9073. <p>The filter accepts the following option:
  9074. </p>
  9075. <dl compact="compact">
  9076. <dt>&lsquo;<samp>mv</samp>&rsquo;</dt>
  9077. <dd><p>Set motion vectors to visualize.
  9078. </p>
  9079. <p>Available flags for <var>mv</var> are:
  9080. </p>
  9081. <dl compact="compact">
  9082. <dt>&lsquo;<samp>pf</samp>&rsquo;</dt>
  9083. <dd><p>forward predicted MVs of P-frames
  9084. </p></dd>
  9085. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  9086. <dd><p>forward predicted MVs of B-frames
  9087. </p></dd>
  9088. <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
  9089. <dd><p>backward predicted MVs of B-frames
  9090. </p></dd>
  9091. </dl>
  9092. </dd>
  9093. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  9094. <dd><p>Display quantization parameters using the chroma planes.
  9095. </p>
  9096. </dd>
  9097. <dt>&lsquo;<samp>mv_type, mvt</samp>&rsquo;</dt>
  9098. <dd><p>Set motion vectors type to visualize. Includes MVs from all frames unless specified by <var>frame_type</var> option.
  9099. </p>
  9100. <p>Available flags for <var>mv_type</var> are:
  9101. </p>
  9102. <dl compact="compact">
  9103. <dt>&lsquo;<samp>fp</samp>&rsquo;</dt>
  9104. <dd><p>forward predicted MVs
  9105. </p></dd>
  9106. <dt>&lsquo;<samp>bp</samp>&rsquo;</dt>
  9107. <dd><p>backward predicted MVs
  9108. </p></dd>
  9109. </dl>
  9110. </dd>
  9111. <dt>&lsquo;<samp>frame_type, ft</samp>&rsquo;</dt>
  9112. <dd><p>Set frame type to visualize motion vectors of.
  9113. </p>
  9114. <p>Available flags for <var>frame_type</var> are:
  9115. </p>
  9116. <dl compact="compact">
  9117. <dt>&lsquo;<samp>if</samp>&rsquo;</dt>
  9118. <dd><p>intra-coded frames (I-frames)
  9119. </p></dd>
  9120. <dt>&lsquo;<samp>pf</samp>&rsquo;</dt>
  9121. <dd><p>predicted frames (P-frames)
  9122. </p></dd>
  9123. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  9124. <dd><p>bi-directionally predicted frames (B-frames)
  9125. </p></dd>
  9126. </dl>
  9127. </dd>
  9128. </dl>
  9129. <a name="Examples-6"></a>
  9130. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-6">11.22.1 Examples</a></h3>
  9131. <ul>
  9132. <li>
  9133. Visualize forward predicted MVs of all frames using <code>ffplay</code>:
  9134. <div class="example">
  9135. <pre class="example">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
  9136. </pre></div>
  9137. </li><li>
  9138. Visualize multi-directionals MVs of P and B-Frames using <code>ffplay</code>:
  9139. <div class="example">
  9140. <pre class="example">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
  9141. </pre></div>
  9142. </li></ul>
  9143. <a name="colorbalance"></a>
  9144. <h2 class="section"><a href="ffmpeg-filters.html#toc-colorbalance">11.23 colorbalance</a></h2>
  9145. <p>Modify intensity of primary colors (red, green and blue) of input frames.
  9146. </p>
  9147. <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
  9148. regions for the red-cyan, green-magenta or blue-yellow balance.
  9149. </p>
  9150. <p>A positive adjustment value shifts the balance towards the primary color, a negative
  9151. value towards the complementary color.
  9152. </p>
  9153. <p>The filter accepts the following options:
  9154. </p>
  9155. <dl compact="compact">
  9156. <dt>&lsquo;<samp>rs</samp>&rsquo;</dt>
  9157. <dt>&lsquo;<samp>gs</samp>&rsquo;</dt>
  9158. <dt>&lsquo;<samp>bs</samp>&rsquo;</dt>
  9159. <dd><p>Adjust red, green and blue shadows (darkest pixels).
  9160. </p>
  9161. </dd>
  9162. <dt>&lsquo;<samp>rm</samp>&rsquo;</dt>
  9163. <dt>&lsquo;<samp>gm</samp>&rsquo;</dt>
  9164. <dt>&lsquo;<samp>bm</samp>&rsquo;</dt>
  9165. <dd><p>Adjust red, green and blue midtones (medium pixels).
  9166. </p>
  9167. </dd>
  9168. <dt>&lsquo;<samp>rh</samp>&rsquo;</dt>
  9169. <dt>&lsquo;<samp>gh</samp>&rsquo;</dt>
  9170. <dt>&lsquo;<samp>bh</samp>&rsquo;</dt>
  9171. <dd><p>Adjust red, green and blue highlights (brightest pixels).
  9172. </p>
  9173. <p>Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
  9174. </p>
  9175. </dd>
  9176. <dt>&lsquo;<samp>pl</samp>&rsquo;</dt>
  9177. <dd><p>Preserve lightness when changing color balance. Default is disabled.
  9178. </p></dd>
  9179. </dl>
  9180. <a name="Examples-22"></a>
  9181. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-22">11.23.1 Examples</a></h3>
  9182. <ul>
  9183. <li>
  9184. Add red color cast to shadows:
  9185. <div class="example">
  9186. <pre class="example">colorbalance=rs=.3
  9187. </pre></div>
  9188. </li></ul>
  9189. <a name="Commands-4"></a>
  9190. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-4">11.23.2 Commands</a></h3>
  9191. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  9192. </p>
  9193. <a name="colorchannelmixer"></a>
  9194. <h2 class="section"><a href="ffmpeg-filters.html#toc-colorchannelmixer">11.24 colorchannelmixer</a></h2>
  9195. <p>Adjust video input frames by re-mixing color channels.
  9196. </p>
  9197. <p>This filter modifies a color channel by adding the values associated to
  9198. the other channels of the same pixels. For example if the value to
  9199. modify is red, the output value will be:
  9200. </p><div class="example">
  9201. <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>
  9202. </pre></div>
  9203. <p>The filter accepts the following options:
  9204. </p>
  9205. <dl compact="compact">
  9206. <dt>&lsquo;<samp>rr</samp>&rsquo;</dt>
  9207. <dt>&lsquo;<samp>rg</samp>&rsquo;</dt>
  9208. <dt>&lsquo;<samp>rb</samp>&rsquo;</dt>
  9209. <dt>&lsquo;<samp>ra</samp>&rsquo;</dt>
  9210. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
  9211. Default is <code>1</code> for <var>rr</var>, and <code>0</code> for <var>rg</var>, <var>rb</var> and <var>ra</var>.
  9212. </p>
  9213. </dd>
  9214. <dt>&lsquo;<samp>gr</samp>&rsquo;</dt>
  9215. <dt>&lsquo;<samp>gg</samp>&rsquo;</dt>
  9216. <dt>&lsquo;<samp>gb</samp>&rsquo;</dt>
  9217. <dt>&lsquo;<samp>ga</samp>&rsquo;</dt>
  9218. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
  9219. Default is <code>1</code> for <var>gg</var>, and <code>0</code> for <var>gr</var>, <var>gb</var> and <var>ga</var>.
  9220. </p>
  9221. </dd>
  9222. <dt>&lsquo;<samp>br</samp>&rsquo;</dt>
  9223. <dt>&lsquo;<samp>bg</samp>&rsquo;</dt>
  9224. <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
  9225. <dt>&lsquo;<samp>ba</samp>&rsquo;</dt>
  9226. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
  9227. Default is <code>1</code> for <var>bb</var>, and <code>0</code> for <var>br</var>, <var>bg</var> and <var>ba</var>.
  9228. </p>
  9229. </dd>
  9230. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  9231. <dt>&lsquo;<samp>ag</samp>&rsquo;</dt>
  9232. <dt>&lsquo;<samp>ab</samp>&rsquo;</dt>
  9233. <dt>&lsquo;<samp>aa</samp>&rsquo;</dt>
  9234. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
  9235. Default is <code>1</code> for <var>aa</var>, and <code>0</code> for <var>ar</var>, <var>ag</var> and <var>ab</var>.
  9236. </p>
  9237. <p>Allowed ranges for options are <code>[-2.0, 2.0]</code>.
  9238. </p></dd>
  9239. </dl>
  9240. <a name="Examples-82"></a>
  9241. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-82">11.24.1 Examples</a></h3>
  9242. <ul>
  9243. <li>
  9244. Convert source to grayscale:
  9245. <div class="example">
  9246. <pre class="example">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
  9247. </pre></div>
  9248. </li><li>
  9249. Simulate sepia tones:
  9250. <div class="example">
  9251. <pre class="example">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
  9252. </pre></div>
  9253. </li></ul>
  9254. <a name="Commands-56"></a>
  9255. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-56">11.24.2 Commands</a></h3>
  9256. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  9257. </p>
  9258. <a name="colorkey"></a>
  9259. <h2 class="section"><a href="ffmpeg-filters.html#toc-colorkey">11.25 colorkey</a></h2>
  9260. <p>RGB colorspace color keying.
  9261. </p>
  9262. <p>The filter accepts the following options:
  9263. </p>
  9264. <dl compact="compact">
  9265. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  9266. <dd><p>The color which will be replaced with transparency.
  9267. </p>
  9268. </dd>
  9269. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  9270. <dd><p>Similarity percentage with the key color.
  9271. </p>
  9272. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  9273. </p>
  9274. </dd>
  9275. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  9276. <dd><p>Blend percentage.
  9277. </p>
  9278. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  9279. </p>
  9280. <p>Higher values result in semi-transparent pixels, with a higher transparency
  9281. the more similar the pixels color is to the key color.
  9282. </p></dd>
  9283. </dl>
  9284. <a name="Examples-56"></a>
  9285. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-56">11.25.1 Examples</a></h3>
  9286. <ul>
  9287. <li>
  9288. Make every green pixel in the input image transparent:
  9289. <div class="example">
  9290. <pre class="example">ffmpeg -i input.png -vf colorkey=green out.png
  9291. </pre></div>
  9292. </li><li>
  9293. Overlay a greenscreen-video on top of a static background image.
  9294. <div class="example">
  9295. <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
  9296. </pre></div>
  9297. </li></ul>
  9298. <a name="Commands-31"></a>
  9299. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-31">11.25.2 Commands</a></h3>
  9300. <p>This filter supports same <a href="#commands">commands</a> as options.
  9301. The command accepts the same syntax of the corresponding option.
  9302. </p>
  9303. <p>If the specified expression is not valid, it is kept at its current
  9304. value.
  9305. </p>
  9306. <a name="colorhold"></a>
  9307. <h2 class="section"><a href="ffmpeg-filters.html#toc-colorhold">11.26 colorhold</a></h2>
  9308. <p>Remove all color information for all RGB colors except for certain one.
  9309. </p>
  9310. <p>The filter accepts the following options:
  9311. </p>
  9312. <dl compact="compact">
  9313. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  9314. <dd><p>The color which will not be replaced with neutral gray.
  9315. </p>
  9316. </dd>
  9317. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  9318. <dd><p>Similarity percentage with the above color.
  9319. 0.01 matches only the exact key color, while 1.0 matches everything.
  9320. </p>
  9321. </dd>
  9322. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  9323. <dd><p>Blend percentage. 0.0 makes pixels fully gray.
  9324. Higher values result in more preserved color.
  9325. </p></dd>
  9326. </dl>
  9327. <a name="Commands-70"></a>
  9328. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-70">11.26.1 Commands</a></h3>
  9329. <p>This filter supports same <a href="#commands">commands</a> as options.
  9330. The command accepts the same syntax of the corresponding option.
  9331. </p>
  9332. <p>If the specified expression is not valid, it is kept at its current
  9333. value.
  9334. </p>
  9335. <a name="colorlevels"></a>
  9336. <h2 class="section"><a href="ffmpeg-filters.html#toc-colorlevels">11.27 colorlevels</a></h2>
  9337. <p>Adjust video input frames using levels.
  9338. </p>
  9339. <p>The filter accepts the following options:
  9340. </p>
  9341. <dl compact="compact">
  9342. <dt>&lsquo;<samp>rimin</samp>&rsquo;</dt>
  9343. <dt>&lsquo;<samp>gimin</samp>&rsquo;</dt>
  9344. <dt>&lsquo;<samp>bimin</samp>&rsquo;</dt>
  9345. <dt>&lsquo;<samp>aimin</samp>&rsquo;</dt>
  9346. <dd><p>Adjust red, green, blue and alpha input black point.
  9347. Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
  9348. </p>
  9349. </dd>
  9350. <dt>&lsquo;<samp>rimax</samp>&rsquo;</dt>
  9351. <dt>&lsquo;<samp>gimax</samp>&rsquo;</dt>
  9352. <dt>&lsquo;<samp>bimax</samp>&rsquo;</dt>
  9353. <dt>&lsquo;<samp>aimax</samp>&rsquo;</dt>
  9354. <dd><p>Adjust red, green, blue and alpha input white point.
  9355. Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>1</code>.
  9356. </p>
  9357. <p>Input levels are used to lighten highlights (bright tones), darken shadows
  9358. (dark tones), change the balance of bright and dark tones.
  9359. </p>
  9360. </dd>
  9361. <dt>&lsquo;<samp>romin</samp>&rsquo;</dt>
  9362. <dt>&lsquo;<samp>gomin</samp>&rsquo;</dt>
  9363. <dt>&lsquo;<samp>bomin</samp>&rsquo;</dt>
  9364. <dt>&lsquo;<samp>aomin</samp>&rsquo;</dt>
  9365. <dd><p>Adjust red, green, blue and alpha output black point.
  9366. Allowed ranges for options are <code>[0, 1.0]</code>. Defaults are <code>0</code>.
  9367. </p>
  9368. </dd>
  9369. <dt>&lsquo;<samp>romax</samp>&rsquo;</dt>
  9370. <dt>&lsquo;<samp>gomax</samp>&rsquo;</dt>
  9371. <dt>&lsquo;<samp>bomax</samp>&rsquo;</dt>
  9372. <dt>&lsquo;<samp>aomax</samp>&rsquo;</dt>
  9373. <dd><p>Adjust red, green, blue and alpha output white point.
  9374. Allowed ranges for options are <code>[0, 1.0]</code>. Defaults are <code>1</code>.
  9375. </p>
  9376. <p>Output levels allows manual selection of a constrained output level range.
  9377. </p></dd>
  9378. </dl>
  9379. <a name="Examples-150"></a>
  9380. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-150">11.27.1 Examples</a></h3>
  9381. <ul>
  9382. <li>
  9383. Make video output darker:
  9384. <div class="example">
  9385. <pre class="example">colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
  9386. </pre></div>
  9387. </li><li>
  9388. Increase contrast:
  9389. <div class="example">
  9390. <pre class="example">colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
  9391. </pre></div>
  9392. </li><li>
  9393. Make video output lighter:
  9394. <div class="example">
  9395. <pre class="example">colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
  9396. </pre></div>
  9397. </li><li>
  9398. Increase brightness:
  9399. <div class="example">
  9400. <pre class="example">colorlevels=romin=0.5:gomin=0.5:bomin=0.5
  9401. </pre></div>
  9402. </li></ul>
  9403. <a name="Commands-15"></a>
  9404. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-15">11.27.2 Commands</a></h3>
  9405. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  9406. </p>
  9407. <a name="colormatrix"></a>
  9408. <h2 class="section"><a href="ffmpeg-filters.html#toc-colormatrix">11.28 colormatrix</a></h2>
  9409. <p>Convert color matrix.
  9410. </p>
  9411. <p>The filter accepts the following options:
  9412. </p>
  9413. <dl compact="compact">
  9414. <dt>&lsquo;<samp>src</samp>&rsquo;</dt>
  9415. <dt>&lsquo;<samp>dst</samp>&rsquo;</dt>
  9416. <dd><p>Specify the source and destination color matrix. Both values must be
  9417. specified.
  9418. </p>
  9419. <p>The accepted values are:
  9420. </p><dl compact="compact">
  9421. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  9422. <dd><p>BT.709
  9423. </p>
  9424. </dd>
  9425. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  9426. <dd><p>FCC
  9427. </p>
  9428. </dd>
  9429. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  9430. <dd><p>BT.601
  9431. </p>
  9432. </dd>
  9433. <dt>&lsquo;<samp>bt470</samp>&rsquo;</dt>
  9434. <dd><p>BT.470
  9435. </p>
  9436. </dd>
  9437. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  9438. <dd><p>BT.470BG
  9439. </p>
  9440. </dd>
  9441. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  9442. <dd><p>SMPTE-170M
  9443. </p>
  9444. </dd>
  9445. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  9446. <dd><p>SMPTE-240M
  9447. </p>
  9448. </dd>
  9449. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  9450. <dd><p>BT.2020
  9451. </p></dd>
  9452. </dl>
  9453. </dd>
  9454. </dl>
  9455. <p>For example to convert from BT.601 to SMPTE-240M, use the command:
  9456. </p><div class="example">
  9457. <pre class="example">colormatrix=bt601:smpte240m
  9458. </pre></div>
  9459. <a name="colorspace"></a>
  9460. <h2 class="section"><a href="ffmpeg-filters.html#toc-colorspace">11.29 colorspace</a></h2>
  9461. <p>Convert colorspace, transfer characteristics or color primaries.
  9462. Input video needs to have an even size.
  9463. </p>
  9464. <p>The filter accepts the following options:
  9465. </p>
  9466. <dl compact="compact">
  9467. <dd><p><a name="all"></a>
  9468. </p></dd>
  9469. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  9470. <dd><p>Specify all color properties at once.
  9471. </p>
  9472. <p>The accepted values are:
  9473. </p><dl compact="compact">
  9474. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  9475. <dd><p>BT.470M
  9476. </p>
  9477. </dd>
  9478. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  9479. <dd><p>BT.470BG
  9480. </p>
  9481. </dd>
  9482. <dt>&lsquo;<samp>bt601-6-525</samp>&rsquo;</dt>
  9483. <dd><p>BT.601-6 525
  9484. </p>
  9485. </dd>
  9486. <dt>&lsquo;<samp>bt601-6-625</samp>&rsquo;</dt>
  9487. <dd><p>BT.601-6 625
  9488. </p>
  9489. </dd>
  9490. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  9491. <dd><p>BT.709
  9492. </p>
  9493. </dd>
  9494. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  9495. <dd><p>SMPTE-170M
  9496. </p>
  9497. </dd>
  9498. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  9499. <dd><p>SMPTE-240M
  9500. </p>
  9501. </dd>
  9502. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  9503. <dd><p>BT.2020
  9504. </p>
  9505. </dd>
  9506. </dl>
  9507. <p><a name="space"></a>
  9508. </p></dd>
  9509. <dt>&lsquo;<samp>space</samp>&rsquo;</dt>
  9510. <dd><p>Specify output colorspace.
  9511. </p>
  9512. <p>The accepted values are:
  9513. </p><dl compact="compact">
  9514. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  9515. <dd><p>BT.709
  9516. </p>
  9517. </dd>
  9518. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  9519. <dd><p>FCC
  9520. </p>
  9521. </dd>
  9522. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  9523. <dd><p>BT.470BG or BT.601-6 625
  9524. </p>
  9525. </dd>
  9526. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  9527. <dd><p>SMPTE-170M or BT.601-6 525
  9528. </p>
  9529. </dd>
  9530. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  9531. <dd><p>SMPTE-240M
  9532. </p>
  9533. </dd>
  9534. <dt>&lsquo;<samp>ycgco</samp>&rsquo;</dt>
  9535. <dd><p>YCgCo
  9536. </p>
  9537. </dd>
  9538. <dt>&lsquo;<samp>bt2020ncl</samp>&rsquo;</dt>
  9539. <dd><p>BT.2020 with non-constant luminance
  9540. </p>
  9541. </dd>
  9542. </dl>
  9543. <p><a name="trc"></a>
  9544. </p></dd>
  9545. <dt>&lsquo;<samp>trc</samp>&rsquo;</dt>
  9546. <dd><p>Specify output transfer characteristics.
  9547. </p>
  9548. <p>The accepted values are:
  9549. </p><dl compact="compact">
  9550. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  9551. <dd><p>BT.709
  9552. </p>
  9553. </dd>
  9554. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  9555. <dd><p>BT.470M
  9556. </p>
  9557. </dd>
  9558. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  9559. <dd><p>BT.470BG
  9560. </p>
  9561. </dd>
  9562. <dt>&lsquo;<samp>gamma22</samp>&rsquo;</dt>
  9563. <dd><p>Constant gamma of 2.2
  9564. </p>
  9565. </dd>
  9566. <dt>&lsquo;<samp>gamma28</samp>&rsquo;</dt>
  9567. <dd><p>Constant gamma of 2.8
  9568. </p>
  9569. </dd>
  9570. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  9571. <dd><p>SMPTE-170M, BT.601-6 625 or BT.601-6 525
  9572. </p>
  9573. </dd>
  9574. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  9575. <dd><p>SMPTE-240M
  9576. </p>
  9577. </dd>
  9578. <dt>&lsquo;<samp>srgb</samp>&rsquo;</dt>
  9579. <dd><p>SRGB
  9580. </p>
  9581. </dd>
  9582. <dt>&lsquo;<samp>iec61966-2-1</samp>&rsquo;</dt>
  9583. <dd><p>iec61966-2-1
  9584. </p>
  9585. </dd>
  9586. <dt>&lsquo;<samp>iec61966-2-4</samp>&rsquo;</dt>
  9587. <dd><p>iec61966-2-4
  9588. </p>
  9589. </dd>
  9590. <dt>&lsquo;<samp>xvycc</samp>&rsquo;</dt>
  9591. <dd><p>xvycc
  9592. </p>
  9593. </dd>
  9594. <dt>&lsquo;<samp>bt2020-10</samp>&rsquo;</dt>
  9595. <dd><p>BT.2020 for 10-bits content
  9596. </p>
  9597. </dd>
  9598. <dt>&lsquo;<samp>bt2020-12</samp>&rsquo;</dt>
  9599. <dd><p>BT.2020 for 12-bits content
  9600. </p>
  9601. </dd>
  9602. </dl>
  9603. <p><a name="primaries"></a>
  9604. </p></dd>
  9605. <dt>&lsquo;<samp>primaries</samp>&rsquo;</dt>
  9606. <dd><p>Specify output color primaries.
  9607. </p>
  9608. <p>The accepted values are:
  9609. </p><dl compact="compact">
  9610. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  9611. <dd><p>BT.709
  9612. </p>
  9613. </dd>
  9614. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  9615. <dd><p>BT.470M
  9616. </p>
  9617. </dd>
  9618. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  9619. <dd><p>BT.470BG or BT.601-6 625
  9620. </p>
  9621. </dd>
  9622. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  9623. <dd><p>SMPTE-170M or BT.601-6 525
  9624. </p>
  9625. </dd>
  9626. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  9627. <dd><p>SMPTE-240M
  9628. </p>
  9629. </dd>
  9630. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  9631. <dd><p>film
  9632. </p>
  9633. </dd>
  9634. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  9635. <dd><p>SMPTE-431
  9636. </p>
  9637. </dd>
  9638. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  9639. <dd><p>SMPTE-432
  9640. </p>
  9641. </dd>
  9642. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  9643. <dd><p>BT.2020
  9644. </p>
  9645. </dd>
  9646. <dt>&lsquo;<samp>jedec-p22</samp>&rsquo;</dt>
  9647. <dd><p>JEDEC P22 phosphors
  9648. </p>
  9649. </dd>
  9650. </dl>
  9651. <p><a name="range"></a>
  9652. </p></dd>
  9653. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  9654. <dd><p>Specify output color range.
  9655. </p>
  9656. <p>The accepted values are:
  9657. </p><dl compact="compact">
  9658. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  9659. <dd><p>TV (restricted) range
  9660. </p>
  9661. </dd>
  9662. <dt>&lsquo;<samp>mpeg</samp>&rsquo;</dt>
  9663. <dd><p>MPEG (restricted) range
  9664. </p>
  9665. </dd>
  9666. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  9667. <dd><p>PC (full) range
  9668. </p>
  9669. </dd>
  9670. <dt>&lsquo;<samp>jpeg</samp>&rsquo;</dt>
  9671. <dd><p>JPEG (full) range
  9672. </p>
  9673. </dd>
  9674. </dl>
  9675. </dd>
  9676. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  9677. <dd><p>Specify output color format.
  9678. </p>
  9679. <p>The accepted values are:
  9680. </p><dl compact="compact">
  9681. <dt>&lsquo;<samp>yuv420p</samp>&rsquo;</dt>
  9682. <dd><p>YUV 4:2:0 planar 8-bits
  9683. </p>
  9684. </dd>
  9685. <dt>&lsquo;<samp>yuv420p10</samp>&rsquo;</dt>
  9686. <dd><p>YUV 4:2:0 planar 10-bits
  9687. </p>
  9688. </dd>
  9689. <dt>&lsquo;<samp>yuv420p12</samp>&rsquo;</dt>
  9690. <dd><p>YUV 4:2:0 planar 12-bits
  9691. </p>
  9692. </dd>
  9693. <dt>&lsquo;<samp>yuv422p</samp>&rsquo;</dt>
  9694. <dd><p>YUV 4:2:2 planar 8-bits
  9695. </p>
  9696. </dd>
  9697. <dt>&lsquo;<samp>yuv422p10</samp>&rsquo;</dt>
  9698. <dd><p>YUV 4:2:2 planar 10-bits
  9699. </p>
  9700. </dd>
  9701. <dt>&lsquo;<samp>yuv422p12</samp>&rsquo;</dt>
  9702. <dd><p>YUV 4:2:2 planar 12-bits
  9703. </p>
  9704. </dd>
  9705. <dt>&lsquo;<samp>yuv444p</samp>&rsquo;</dt>
  9706. <dd><p>YUV 4:4:4 planar 8-bits
  9707. </p>
  9708. </dd>
  9709. <dt>&lsquo;<samp>yuv444p10</samp>&rsquo;</dt>
  9710. <dd><p>YUV 4:4:4 planar 10-bits
  9711. </p>
  9712. </dd>
  9713. <dt>&lsquo;<samp>yuv444p12</samp>&rsquo;</dt>
  9714. <dd><p>YUV 4:4:4 planar 12-bits
  9715. </p>
  9716. </dd>
  9717. </dl>
  9718. </dd>
  9719. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  9720. <dd><p>Do a fast conversion, which skips gamma/primary correction. This will take
  9721. significantly less CPU, but will be mathematically incorrect. To get output
  9722. compatible with that produced by the colormatrix filter, use fast=1.
  9723. </p>
  9724. </dd>
  9725. <dt>&lsquo;<samp>dither</samp>&rsquo;</dt>
  9726. <dd><p>Specify dithering mode.
  9727. </p>
  9728. <p>The accepted values are:
  9729. </p><dl compact="compact">
  9730. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  9731. <dd><p>No dithering
  9732. </p>
  9733. </dd>
  9734. <dt>&lsquo;<samp>fsb</samp>&rsquo;</dt>
  9735. <dd><p>Floyd-Steinberg dithering
  9736. </p></dd>
  9737. </dl>
  9738. </dd>
  9739. <dt>&lsquo;<samp>wpadapt</samp>&rsquo;</dt>
  9740. <dd><p>Whitepoint adaptation mode.
  9741. </p>
  9742. <p>The accepted values are:
  9743. </p><dl compact="compact">
  9744. <dt>&lsquo;<samp>bradford</samp>&rsquo;</dt>
  9745. <dd><p>Bradford whitepoint adaptation
  9746. </p>
  9747. </dd>
  9748. <dt>&lsquo;<samp>vonkries</samp>&rsquo;</dt>
  9749. <dd><p>von Kries whitepoint adaptation
  9750. </p>
  9751. </dd>
  9752. <dt>&lsquo;<samp>identity</samp>&rsquo;</dt>
  9753. <dd><p>identity whitepoint adaptation (i.e. no whitepoint adaptation)
  9754. </p></dd>
  9755. </dl>
  9756. </dd>
  9757. <dt>&lsquo;<samp>iall</samp>&rsquo;</dt>
  9758. <dd><p>Override all input properties at once. Same accepted values as <a href="#all">all</a>.
  9759. </p>
  9760. </dd>
  9761. <dt>&lsquo;<samp>ispace</samp>&rsquo;</dt>
  9762. <dd><p>Override input colorspace. Same accepted values as <a href="#space">space</a>.
  9763. </p>
  9764. </dd>
  9765. <dt>&lsquo;<samp>iprimaries</samp>&rsquo;</dt>
  9766. <dd><p>Override input color primaries. Same accepted values as <a href="#primaries">primaries</a>.
  9767. </p>
  9768. </dd>
  9769. <dt>&lsquo;<samp>itrc</samp>&rsquo;</dt>
  9770. <dd><p>Override input transfer characteristics. Same accepted values as <a href="#trc">trc</a>.
  9771. </p>
  9772. </dd>
  9773. <dt>&lsquo;<samp>irange</samp>&rsquo;</dt>
  9774. <dd><p>Override input color range. Same accepted values as <a href="#range">range</a>.
  9775. </p>
  9776. </dd>
  9777. </dl>
  9778. <p>The filter converts the transfer characteristics, color space and color
  9779. primaries to the specified user values. The output value, if not specified,
  9780. is set to a default value based on the &quot;all&quot; property. If that property is
  9781. also not specified, the filter will log an error. The output color range and
  9782. format default to the same value as the input color range and format. The
  9783. input transfer characteristics, color space, color primaries and color range
  9784. should be set on the input data. If any of these are missing, the filter will
  9785. log an error and no conversion will take place.
  9786. </p>
  9787. <p>For example to convert the input to SMPTE-240M, use the command:
  9788. </p><div class="example">
  9789. <pre class="example">colorspace=smpte240m
  9790. </pre></div>
  9791. <a name="convolution"></a>
  9792. <h2 class="section"><a href="ffmpeg-filters.html#toc-convolution">11.30 convolution</a></h2>
  9793. <p>Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements.
  9794. </p>
  9795. <p>The filter accepts the following options:
  9796. </p>
  9797. <dl compact="compact">
  9798. <dt>&lsquo;<samp>0m</samp>&rsquo;</dt>
  9799. <dt>&lsquo;<samp>1m</samp>&rsquo;</dt>
  9800. <dt>&lsquo;<samp>2m</samp>&rsquo;</dt>
  9801. <dt>&lsquo;<samp>3m</samp>&rsquo;</dt>
  9802. <dd><p>Set matrix for each plane.
  9803. Matrix is sequence of 9, 25 or 49 signed integers in <var>square</var> mode,
  9804. and from 1 to 49 odd number of signed integers in <var>row</var> mode.
  9805. </p>
  9806. </dd>
  9807. <dt>&lsquo;<samp>0rdiv</samp>&rsquo;</dt>
  9808. <dt>&lsquo;<samp>1rdiv</samp>&rsquo;</dt>
  9809. <dt>&lsquo;<samp>2rdiv</samp>&rsquo;</dt>
  9810. <dt>&lsquo;<samp>3rdiv</samp>&rsquo;</dt>
  9811. <dd><p>Set multiplier for calculated value for each plane.
  9812. If unset or 0, it will be sum of all matrix elements.
  9813. </p>
  9814. </dd>
  9815. <dt>&lsquo;<samp>0bias</samp>&rsquo;</dt>
  9816. <dt>&lsquo;<samp>1bias</samp>&rsquo;</dt>
  9817. <dt>&lsquo;<samp>2bias</samp>&rsquo;</dt>
  9818. <dt>&lsquo;<samp>3bias</samp>&rsquo;</dt>
  9819. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  9820. Useful for making the overall image brighter or darker. Default is 0.0.
  9821. </p>
  9822. </dd>
  9823. <dt>&lsquo;<samp>0mode</samp>&rsquo;</dt>
  9824. <dt>&lsquo;<samp>1mode</samp>&rsquo;</dt>
  9825. <dt>&lsquo;<samp>2mode</samp>&rsquo;</dt>
  9826. <dt>&lsquo;<samp>3mode</samp>&rsquo;</dt>
  9827. <dd><p>Set matrix mode for each plane. Can be <var>square</var>, <var>row</var> or <var>column</var>.
  9828. Default is <var>square</var>.
  9829. </p></dd>
  9830. </dl>
  9831. <a name="Examples-146"></a>
  9832. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-146">11.30.1 Examples</a></h3>
  9833. <ul>
  9834. <li>
  9835. Apply sharpen:
  9836. <div class="example">
  9837. <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;
  9838. </pre></div>
  9839. </li><li>
  9840. Apply blur:
  9841. <div class="example">
  9842. <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;
  9843. </pre></div>
  9844. </li><li>
  9845. Apply edge enhance:
  9846. <div class="example">
  9847. <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;
  9848. </pre></div>
  9849. </li><li>
  9850. Apply edge detect:
  9851. <div class="example">
  9852. <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;
  9853. </pre></div>
  9854. </li><li>
  9855. Apply laplacian edge detector which includes diagonals:
  9856. <div class="example">
  9857. <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;
  9858. </pre></div>
  9859. </li><li>
  9860. Apply emboss:
  9861. <div class="example">
  9862. <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;
  9863. </pre></div>
  9864. </li></ul>
  9865. <a name="convolve"></a>
  9866. <h2 class="section"><a href="ffmpeg-filters.html#toc-convolve">11.31 convolve</a></h2>
  9867. <p>Apply 2D convolution of video stream in frequency domain using second stream
  9868. as impulse.
  9869. </p>
  9870. <p>The filter accepts the following options:
  9871. </p>
  9872. <dl compact="compact">
  9873. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  9874. <dd><p>Set which planes to process.
  9875. </p>
  9876. </dd>
  9877. <dt>&lsquo;<samp>impulse</samp>&rsquo;</dt>
  9878. <dd><p>Set which impulse video frames will be processed, can be <var>first</var>
  9879. or <var>all</var>. Default is <var>all</var>.
  9880. </p></dd>
  9881. </dl>
  9882. <p>The <code>convolve</code> filter also supports the <a href="#framesync">framesync</a> options.
  9883. </p>
  9884. <a name="copy"></a>
  9885. <h2 class="section"><a href="ffmpeg-filters.html#toc-copy">11.32 copy</a></h2>
  9886. <p>Copy the input video source unchanged to the output. This is mainly useful for
  9887. testing purposes.
  9888. </p>
  9889. <p><a name="coreimage"></a>
  9890. </p><a name="coreimage-1"></a>
  9891. <h2 class="section"><a href="ffmpeg-filters.html#toc-coreimage-1">11.33 coreimage</a></h2>
  9892. <p>Video filtering on GPU using Apple&rsquo;s CoreImage API on OSX.
  9893. </p>
  9894. <p>Hardware acceleration is based on an OpenGL context. Usually, this means it is
  9895. processed by video hardware. However, software-based OpenGL implementations
  9896. exist which means there is no guarantee for hardware processing. It depends on
  9897. the respective OSX.
  9898. </p>
  9899. <p>There are many filters and image generators provided by Apple that come with a
  9900. large variety of options. The filter has to be referenced by its name along
  9901. with its options.
  9902. </p>
  9903. <p>The coreimage filter accepts the following options:
  9904. </p><dl compact="compact">
  9905. <dt>&lsquo;<samp>list_filters</samp>&rsquo;</dt>
  9906. <dd><p>List all available filters and generators along with all their respective
  9907. options as well as possible minimum and maximum values along with the default
  9908. values.
  9909. </p><div class="example">
  9910. <pre class="example">list_filters=true
  9911. </pre></div>
  9912. </dd>
  9913. <dt>&lsquo;<samp>filter</samp>&rsquo;</dt>
  9914. <dd><p>Specify all filters by their respective name and options.
  9915. Use <var>list_filters</var> to determine all valid filter names and options.
  9916. Numerical options are specified by a float value and are automatically clamped
  9917. to their respective value range. Vector and color options have to be specified
  9918. by a list of space separated float values. Character escaping has to be done.
  9919. A special option name <code>default</code> is available to use default options for a
  9920. filter.
  9921. </p>
  9922. <p>It is required to specify either <code>default</code> or at least one of the filter options.
  9923. All omitted options are used with their default values.
  9924. The syntax of the filter string is as follows:
  9925. </p><div class="example">
  9926. <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;][@...]][#...]
  9927. </pre></div>
  9928. </dd>
  9929. <dt>&lsquo;<samp>output_rect</samp>&rsquo;</dt>
  9930. <dd><p>Specify a rectangle where the output of the filter chain is copied into the
  9931. input image. It is given by a list of space separated float values:
  9932. </p><div class="example">
  9933. <pre class="example">output_rect=x\ y\ width\ height
  9934. </pre></div>
  9935. <p>If not given, the output rectangle equals the dimensions of the input image.
  9936. The output rectangle is automatically cropped at the borders of the input
  9937. image. Negative values are valid for each component.
  9938. </p><div class="example">
  9939. <pre class="example">output_rect=25\ 25\ 100\ 100
  9940. </pre></div>
  9941. </dd>
  9942. </dl>
  9943. <p>Several filters can be chained for successive processing without GPU-HOST
  9944. transfers allowing for fast processing of complex filter chains.
  9945. Currently, only filters with zero (generators) or exactly one (filters) input
  9946. image and one output image are supported. Also, transition filters are not yet
  9947. usable as intended.
  9948. </p>
  9949. <p>Some filters generate output images with additional padding depending on the
  9950. respective filter kernel. The padding is automatically removed to ensure the
  9951. filter output has the same size as the input image.
  9952. </p>
  9953. <p>For image generators, the size of the output image is determined by the
  9954. previous output image of the filter chain or the input image of the whole
  9955. filterchain, respectively. The generators do not use the pixel information of
  9956. this image to generate their output. However, the generated output is
  9957. blended onto this image, resulting in partial or complete coverage of the
  9958. output image.
  9959. </p>
  9960. <p>The <a href="#coreimagesrc">coreimagesrc</a> video source can be used for generating input images
  9961. which are directly fed into the filter chain. By using it, providing input
  9962. images by another video source or an input video is not required.
  9963. </p>
  9964. <a name="Examples"></a>
  9965. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples">11.33.1 Examples</a></h3>
  9966. <ul>
  9967. <li>
  9968. List all filters available:
  9969. <div class="example">
  9970. <pre class="example">coreimage=list_filters=true
  9971. </pre></div>
  9972. </li><li>
  9973. Use the CIBoxBlur filter with default options to blur an image:
  9974. <div class="example">
  9975. <pre class="example">coreimage=filter=CIBoxBlur@default
  9976. </pre></div>
  9977. </li><li>
  9978. Use a filter chain with CISepiaTone at default values and CIVignetteEffect with
  9979. its center at 100x100 and a radius of 50 pixels:
  9980. <div class="example">
  9981. <pre class="example">coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
  9982. </pre></div>
  9983. </li><li>
  9984. Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  9985. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  9986. <div class="example">
  9987. <pre class="example">ffmpeg -f lavfi -i nullsrc=s=100x100,coreimage=filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  9988. </pre></div>
  9989. </li></ul>
  9990. <a name="cover_005frect"></a>
  9991. <h2 class="section"><a href="ffmpeg-filters.html#toc-cover_005frect">11.34 cover_rect</a></h2>
  9992. <p>Cover a rectangular object
  9993. </p>
  9994. <p>It accepts the following options:
  9995. </p>
  9996. <dl compact="compact">
  9997. <dt>&lsquo;<samp>cover</samp>&rsquo;</dt>
  9998. <dd><p>Filepath of the optional cover image, needs to be in yuv420.
  9999. </p>
  10000. </dd>
  10001. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  10002. <dd><p>Set covering mode.
  10003. </p>
  10004. <p>It accepts the following values:
  10005. </p><dl compact="compact">
  10006. <dt>&lsquo;<samp>cover</samp>&rsquo;</dt>
  10007. <dd><p>cover it by the supplied image
  10008. </p></dd>
  10009. <dt>&lsquo;<samp>blur</samp>&rsquo;</dt>
  10010. <dd><p>cover it by interpolating the surrounding pixels
  10011. </p></dd>
  10012. </dl>
  10013. <p>Default value is <var>blur</var>.
  10014. </p></dd>
  10015. </dl>
  10016. <a name="Examples-40"></a>
  10017. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-40">11.34.1 Examples</a></h3>
  10018. <ul>
  10019. <li>
  10020. Cover a rectangular object by the supplied image of a given video using <code>ffmpeg</code>:
  10021. <div class="example">
  10022. <pre class="example">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  10023. </pre></div>
  10024. </li></ul>
  10025. <a name="crop"></a>
  10026. <h2 class="section"><a href="ffmpeg-filters.html#toc-crop">11.35 crop</a></h2>
  10027. <p>Crop the input video to given dimensions.
  10028. </p>
  10029. <p>It accepts the following parameters:
  10030. </p>
  10031. <dl compact="compact">
  10032. <dt>&lsquo;<samp>w, out_w</samp>&rsquo;</dt>
  10033. <dd><p>The width of the output video. It defaults to <code>iw</code>.
  10034. This expression is evaluated only once during the filter
  10035. configuration, or when the &lsquo;<samp>w</samp>&rsquo; or &lsquo;<samp>out_w</samp>&rsquo; command is sent.
  10036. </p>
  10037. </dd>
  10038. <dt>&lsquo;<samp>h, out_h</samp>&rsquo;</dt>
  10039. <dd><p>The height of the output video. It defaults to <code>ih</code>.
  10040. This expression is evaluated only once during the filter
  10041. configuration, or when the &lsquo;<samp>h</samp>&rsquo; or &lsquo;<samp>out_h</samp>&rsquo; command is sent.
  10042. </p>
  10043. </dd>
  10044. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  10045. <dd><p>The horizontal position, in the input video, of the left edge of the output
  10046. video. It defaults to <code>(in_w-out_w)/2</code>.
  10047. This expression is evaluated per-frame.
  10048. </p>
  10049. </dd>
  10050. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  10051. <dd><p>The vertical position, in the input video, of the top edge of the output video.
  10052. It defaults to <code>(in_h-out_h)/2</code>.
  10053. This expression is evaluated per-frame.
  10054. </p>
  10055. </dd>
  10056. <dt>&lsquo;<samp>keep_aspect</samp>&rsquo;</dt>
  10057. <dd><p>If set to 1 will force the output display aspect ratio
  10058. to be the same of the input, by changing the output sample aspect
  10059. ratio. It defaults to 0.
  10060. </p>
  10061. </dd>
  10062. <dt>&lsquo;<samp>exact</samp>&rsquo;</dt>
  10063. <dd><p>Enable exact cropping. If enabled, subsampled videos will be cropped at exact
  10064. width/height/x/y as specified and will not be rounded to nearest smaller value.
  10065. It defaults to 0.
  10066. </p></dd>
  10067. </dl>
  10068. <p>The <var>out_w</var>, <var>out_h</var>, <var>x</var>, <var>y</var> parameters are
  10069. expressions containing the following constants:
  10070. </p>
  10071. <dl compact="compact">
  10072. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  10073. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  10074. <dd><p>The computed values for <var>x</var> and <var>y</var>. They are evaluated for
  10075. each new frame.
  10076. </p>
  10077. </dd>
  10078. <dt>&lsquo;<samp>in_w</samp>&rsquo;</dt>
  10079. <dt>&lsquo;<samp>in_h</samp>&rsquo;</dt>
  10080. <dd><p>The input width and height.
  10081. </p>
  10082. </dd>
  10083. <dt>&lsquo;<samp>iw</samp>&rsquo;</dt>
  10084. <dt>&lsquo;<samp>ih</samp>&rsquo;</dt>
  10085. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  10086. </p>
  10087. </dd>
  10088. <dt>&lsquo;<samp>out_w</samp>&rsquo;</dt>
  10089. <dt>&lsquo;<samp>out_h</samp>&rsquo;</dt>
  10090. <dd><p>The output (cropped) width and height.
  10091. </p>
  10092. </dd>
  10093. <dt>&lsquo;<samp>ow</samp>&rsquo;</dt>
  10094. <dt>&lsquo;<samp>oh</samp>&rsquo;</dt>
  10095. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  10096. </p>
  10097. </dd>
  10098. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  10099. <dd><p>same as <var>iw</var> / <var>ih</var>
  10100. </p>
  10101. </dd>
  10102. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  10103. <dd><p>input sample aspect ratio
  10104. </p>
  10105. </dd>
  10106. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  10107. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  10108. </p>
  10109. </dd>
  10110. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  10111. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  10112. <dd><p>horizontal and vertical chroma subsample values. For example for the
  10113. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  10114. </p>
  10115. </dd>
  10116. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  10117. <dd><p>The number of the input frame, starting from 0.
  10118. </p>
  10119. </dd>
  10120. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  10121. <dd><p>the position in the file of the input frame, NAN if unknown
  10122. </p>
  10123. </dd>
  10124. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  10125. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  10126. </p>
  10127. </dd>
  10128. </dl>
  10129. <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
  10130. and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
  10131. cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
  10132. evaluated after <var>out_w</var> and <var>out_h</var>.
  10133. </p>
  10134. <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
  10135. position of the top-left corner of the output (non-cropped) area. They
  10136. are evaluated for each frame. If the evaluated value is not valid, it
  10137. is approximated to the nearest valid value.
  10138. </p>
  10139. <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
  10140. for <var>y</var> may depend on <var>x</var>.
  10141. </p>
  10142. <a name="Examples-106"></a>
  10143. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-106">11.35.1 Examples</a></h3>
  10144. <ul>
  10145. <li>
  10146. Crop area with size 100x100 at position (12,34).
  10147. <div class="example">
  10148. <pre class="example">crop=100:100:12:34
  10149. </pre></div>
  10150. <p>Using named options, the example above becomes:
  10151. </p><div class="example">
  10152. <pre class="example">crop=w=100:h=100:x=12:y=34
  10153. </pre></div>
  10154. </li><li>
  10155. Crop the central input area with size 100x100:
  10156. <div class="example">
  10157. <pre class="example">crop=100:100
  10158. </pre></div>
  10159. </li><li>
  10160. Crop the central input area with size 2/3 of the input video:
  10161. <div class="example">
  10162. <pre class="example">crop=2/3*in_w:2/3*in_h
  10163. </pre></div>
  10164. </li><li>
  10165. Crop the input video central square:
  10166. <div class="example">
  10167. <pre class="example">crop=out_w=in_h
  10168. crop=in_h
  10169. </pre></div>
  10170. </li><li>
  10171. Delimit the rectangle with the top-left corner placed at position
  10172. 100:100 and the right-bottom corner corresponding to the right-bottom
  10173. corner of the input image.
  10174. <div class="example">
  10175. <pre class="example">crop=in_w-100:in_h-100:100:100
  10176. </pre></div>
  10177. </li><li>
  10178. Crop 10 pixels from the left and right borders, and 20 pixels from
  10179. the top and bottom borders
  10180. <div class="example">
  10181. <pre class="example">crop=in_w-2*10:in_h-2*20
  10182. </pre></div>
  10183. </li><li>
  10184. Keep only the bottom right quarter of the input image:
  10185. <div class="example">
  10186. <pre class="example">crop=in_w/2:in_h/2:in_w/2:in_h/2
  10187. </pre></div>
  10188. </li><li>
  10189. Crop height for getting Greek harmony:
  10190. <div class="example">
  10191. <pre class="example">crop=in_w:1/PHI*in_w
  10192. </pre></div>
  10193. </li><li>
  10194. Apply trembling effect:
  10195. <div class="example">
  10196. <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)
  10197. </pre></div>
  10198. </li><li>
  10199. Apply erratic camera effect depending on timestamp:
  10200. <div class="example">
  10201. <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;
  10202. </pre></div>
  10203. </li><li>
  10204. Set x depending on the value of y:
  10205. <div class="example">
  10206. <pre class="example">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
  10207. </pre></div>
  10208. </li></ul>
  10209. <a name="Commands-63"></a>
  10210. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-63">11.35.2 Commands</a></h3>
  10211. <p>This filter supports the following commands:
  10212. </p><dl compact="compact">
  10213. <dt>&lsquo;<samp>w, out_w</samp>&rsquo;</dt>
  10214. <dt>&lsquo;<samp>h, out_h</samp>&rsquo;</dt>
  10215. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  10216. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  10217. <dd><p>Set width/height of the output video and the horizontal/vertical position
  10218. in the input video.
  10219. The command accepts the same syntax of the corresponding option.
  10220. </p>
  10221. <p>If the specified expression is not valid, it is kept at its current
  10222. value.
  10223. </p></dd>
  10224. </dl>
  10225. <a name="cropdetect"></a>
  10226. <h2 class="section"><a href="ffmpeg-filters.html#toc-cropdetect">11.36 cropdetect</a></h2>
  10227. <p>Auto-detect the crop size.
  10228. </p>
  10229. <p>It calculates the necessary cropping parameters and prints the
  10230. recommended parameters via the logging system. The detected dimensions
  10231. correspond to the non-black area of the input video.
  10232. </p>
  10233. <p>It accepts the following parameters:
  10234. </p>
  10235. <dl compact="compact">
  10236. <dt>&lsquo;<samp>limit</samp>&rsquo;</dt>
  10237. <dd><p>Set higher black value threshold, which can be optionally specified
  10238. from nothing (0) to everything (255 for 8-bit based formats). An intensity
  10239. value greater to the set value is considered non-black. It defaults to 24.
  10240. You can also specify a value between 0.0 and 1.0 which will be scaled depending
  10241. on the bitdepth of the pixel format.
  10242. </p>
  10243. </dd>
  10244. <dt>&lsquo;<samp>round</samp>&rsquo;</dt>
  10245. <dd><p>The value which the width/height should be divisible by. It defaults to
  10246. 16. The offset is automatically adjusted to center the video. Use 2 to
  10247. get only even dimensions (needed for 4:2:2 video). 16 is best when
  10248. encoding to most video codecs.
  10249. </p>
  10250. </dd>
  10251. <dt>&lsquo;<samp>reset_count, reset</samp>&rsquo;</dt>
  10252. <dd><p>Set the counter that determines after how many frames cropdetect will
  10253. reset the previously detected largest video area and start over to
  10254. detect the current optimal crop area. Default value is 0.
  10255. </p>
  10256. <p>This can be useful when channel logos distort the video area. 0
  10257. indicates &rsquo;never reset&rsquo;, and returns the largest area encountered during
  10258. playback.
  10259. </p></dd>
  10260. </dl>
  10261. <p><a name="cue"></a>
  10262. </p><a name="cue-1"></a>
  10263. <h2 class="section"><a href="ffmpeg-filters.html#toc-cue-1">11.37 cue</a></h2>
  10264. <p>Delay video filtering until a given wallclock timestamp. The filter first
  10265. passes on &lsquo;<samp>preroll</samp>&rsquo; amount of frames, then it buffers at most
  10266. &lsquo;<samp>buffer</samp>&rsquo; amount of frames and waits for the cue. After reaching the cue
  10267. it forwards the buffered frames and also any subsequent frames coming in its
  10268. input.
  10269. </p>
  10270. <p>The filter can be used synchronize the output of multiple ffmpeg processes for
  10271. realtime output devices like decklink. By putting the delay in the filtering
  10272. chain and pre-buffering frames the process can pass on data to output almost
  10273. immediately after the target wallclock timestamp is reached.
  10274. </p>
  10275. <p>Perfect frame accuracy cannot be guaranteed, but the result is good enough for
  10276. some use cases.
  10277. </p>
  10278. <dl compact="compact">
  10279. <dt>&lsquo;<samp>cue</samp>&rsquo;</dt>
  10280. <dd><p>The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0.
  10281. </p>
  10282. </dd>
  10283. <dt>&lsquo;<samp>preroll</samp>&rsquo;</dt>
  10284. <dd><p>The duration of content to pass on as preroll expressed in seconds. Default is 0.
  10285. </p>
  10286. </dd>
  10287. <dt>&lsquo;<samp>buffer</samp>&rsquo;</dt>
  10288. <dd><p>The maximum duration of content to buffer before waiting for the cue expressed
  10289. in seconds. Default is 0.
  10290. </p>
  10291. </dd>
  10292. </dl>
  10293. <p><a name="curves"></a>
  10294. </p><a name="curves-1"></a>
  10295. <h2 class="section"><a href="ffmpeg-filters.html#toc-curves-1">11.38 curves</a></h2>
  10296. <p>Apply color adjustments using curves.
  10297. </p>
  10298. <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
  10299. component (red, green and blue) has its values defined by <var>N</var> key points
  10300. tied from each other using a smooth curve. The x-axis represents the pixel
  10301. values from the input frame, and the y-axis the new pixel values to be set for
  10302. the output frame.
  10303. </p>
  10304. <p>By default, a component curve is defined by the two points <var>(0;0)</var> and
  10305. <var>(1;1)</var>. This creates a straight line where each original pixel value is
  10306. &quot;adjusted&quot; to its own value, which means no change to the image.
  10307. </p>
  10308. <p>The filter allows you to redefine these two points and add some more. A new
  10309. curve (using a natural cubic spline interpolation) will be define to pass
  10310. smoothly through all these new coordinates. The new defined points needs to be
  10311. strictly increasing over the x-axis, and their <var>x</var> and <var>y</var> values must
  10312. be in the <var>[0;1]</var> interval. If the computed curves happened to go outside
  10313. the vector spaces, the values will be clipped accordingly.
  10314. </p>
  10315. <p>The filter accepts the following options:
  10316. </p>
  10317. <dl compact="compact">
  10318. <dt>&lsquo;<samp>preset</samp>&rsquo;</dt>
  10319. <dd><p>Select one of the available color presets. This option can be used in addition
  10320. to the &lsquo;<samp>r</samp>&rsquo;, &lsquo;<samp>g</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; parameters; in this case, the later
  10321. options takes priority on the preset values.
  10322. Available presets are:
  10323. </p><dl compact="compact">
  10324. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  10325. <dt>&lsquo;<samp>color_negative</samp>&rsquo;</dt>
  10326. <dt>&lsquo;<samp>cross_process</samp>&rsquo;</dt>
  10327. <dt>&lsquo;<samp>darker</samp>&rsquo;</dt>
  10328. <dt>&lsquo;<samp>increase_contrast</samp>&rsquo;</dt>
  10329. <dt>&lsquo;<samp>lighter</samp>&rsquo;</dt>
  10330. <dt>&lsquo;<samp>linear_contrast</samp>&rsquo;</dt>
  10331. <dt>&lsquo;<samp>medium_contrast</samp>&rsquo;</dt>
  10332. <dt>&lsquo;<samp>negative</samp>&rsquo;</dt>
  10333. <dt>&lsquo;<samp>strong_contrast</samp>&rsquo;</dt>
  10334. <dt>&lsquo;<samp>vintage</samp>&rsquo;</dt>
  10335. </dl>
  10336. <p>Default is <code>none</code>.
  10337. </p></dd>
  10338. <dt>&lsquo;<samp>master, m</samp>&rsquo;</dt>
  10339. <dd><p>Set the master key points. These points will define a second pass mapping. It
  10340. is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
  10341. &lsquo;<samp>r</samp>&rsquo;, &lsquo;<samp>g</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; or &lsquo;<samp>all</samp>&rsquo; since it acts like a
  10342. post-processing LUT.
  10343. </p></dd>
  10344. <dt>&lsquo;<samp>red, r</samp>&rsquo;</dt>
  10345. <dd><p>Set the key points for the red component.
  10346. </p></dd>
  10347. <dt>&lsquo;<samp>green, g</samp>&rsquo;</dt>
  10348. <dd><p>Set the key points for the green component.
  10349. </p></dd>
  10350. <dt>&lsquo;<samp>blue, b</samp>&rsquo;</dt>
  10351. <dd><p>Set the key points for the blue component.
  10352. </p></dd>
  10353. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  10354. <dd><p>Set the key points for all components (not including master).
  10355. Can be used in addition to the other key points component
  10356. options. In this case, the unset component(s) will fallback on this
  10357. &lsquo;<samp>all</samp>&rsquo; setting.
  10358. </p></dd>
  10359. <dt>&lsquo;<samp>psfile</samp>&rsquo;</dt>
  10360. <dd><p>Specify a Photoshop curves file (<code>.acv</code>) to import the settings from.
  10361. </p></dd>
  10362. <dt>&lsquo;<samp>plot</samp>&rsquo;</dt>
  10363. <dd><p>Save Gnuplot script of the curves in specified file.
  10364. </p></dd>
  10365. </dl>
  10366. <p>To avoid some filtergraph syntax conflicts, each key points list need to be
  10367. defined using the following syntax: <code>x0/y0 x1/y1 x2/y2 ...</code>.
  10368. </p>
  10369. <a name="Examples-53"></a>
  10370. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-53">11.38.1 Examples</a></h3>
  10371. <ul>
  10372. <li>
  10373. Increase slightly the middle level of blue:
  10374. <div class="example">
  10375. <pre class="example">curves=blue='0/0 0.5/0.58 1/1'
  10376. </pre></div>
  10377. </li><li>
  10378. Vintage effect:
  10379. <div class="example">
  10380. <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'
  10381. </pre></div>
  10382. <p>Here we obtain the following coordinates for each components:
  10383. </p><dl compact="compact">
  10384. <dt><var>red</var></dt>
  10385. <dd><p><code>(0;0.11) (0.42;0.51) (1;0.95)</code>
  10386. </p></dd>
  10387. <dt><var>green</var></dt>
  10388. <dd><p><code>(0;0) (0.50;0.48) (1;1)</code>
  10389. </p></dd>
  10390. <dt><var>blue</var></dt>
  10391. <dd><p><code>(0;0.22) (0.49;0.44) (1;0.80)</code>
  10392. </p></dd>
  10393. </dl>
  10394. </li><li>
  10395. The previous example can also be achieved with the associated built-in preset:
  10396. <div class="example">
  10397. <pre class="example">curves=preset=vintage
  10398. </pre></div>
  10399. </li><li>
  10400. Or simply:
  10401. <div class="example">
  10402. <pre class="example">curves=vintage
  10403. </pre></div>
  10404. </li><li>
  10405. Use a Photoshop preset and redefine the points of the green component:
  10406. <div class="example">
  10407. <pre class="example">curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
  10408. </pre></div>
  10409. </li><li>
  10410. Check out the curves of the <code>cross_process</code> profile using <code>ffmpeg</code>
  10411. and <code>gnuplot</code>:
  10412. <div class="example">
  10413. <pre class="example">ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
  10414. gnuplot -p /tmp/curves.plt
  10415. </pre></div>
  10416. </li></ul>
  10417. <a name="datascope"></a>
  10418. <h2 class="section"><a href="ffmpeg-filters.html#toc-datascope">11.39 datascope</a></h2>
  10419. <p>Video data analysis filter.
  10420. </p>
  10421. <p>This filter shows hexadecimal pixel values of part of video.
  10422. </p>
  10423. <p>The filter accepts the following options:
  10424. </p>
  10425. <dl compact="compact">
  10426. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  10427. <dd><p>Set output video size.
  10428. </p>
  10429. </dd>
  10430. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  10431. <dd><p>Set x offset from where to pick pixels.
  10432. </p>
  10433. </dd>
  10434. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  10435. <dd><p>Set y offset from where to pick pixels.
  10436. </p>
  10437. </dd>
  10438. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  10439. <dd><p>Set scope mode, can be one of the following:
  10440. </p><dl compact="compact">
  10441. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  10442. <dd><p>Draw hexadecimal pixel values with white color on black background.
  10443. </p>
  10444. </dd>
  10445. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  10446. <dd><p>Draw hexadecimal pixel values with input video pixel color on black
  10447. background.
  10448. </p>
  10449. </dd>
  10450. <dt>&lsquo;<samp>color2</samp>&rsquo;</dt>
  10451. <dd><p>Draw hexadecimal pixel values on color background picked from input video,
  10452. the text color is picked in such way so its always visible.
  10453. </p></dd>
  10454. </dl>
  10455. </dd>
  10456. <dt>&lsquo;<samp>axis</samp>&rsquo;</dt>
  10457. <dd><p>Draw rows and columns numbers on left and top of video.
  10458. </p>
  10459. </dd>
  10460. <dt>&lsquo;<samp>opacity</samp>&rsquo;</dt>
  10461. <dd><p>Set background opacity.
  10462. </p>
  10463. </dd>
  10464. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  10465. <dd><p>Set display number format. Can be <code>hex</code>, or <code>dec</code>. Default is <code>hex</code>.
  10466. </p></dd>
  10467. </dl>
  10468. <a name="dblur"></a>
  10469. <h2 class="section"><a href="ffmpeg-filters.html#toc-dblur">11.40 dblur</a></h2>
  10470. <p>Apply Directional blur filter.
  10471. </p>
  10472. <p>The filter accepts the following options:
  10473. </p>
  10474. <dl compact="compact">
  10475. <dt>&lsquo;<samp>angle</samp>&rsquo;</dt>
  10476. <dd><p>Set angle of directional blur. Default is <code>45</code>.
  10477. </p>
  10478. </dd>
  10479. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  10480. <dd><p>Set radius of directional blur. Default is <code>5</code>.
  10481. </p>
  10482. </dd>
  10483. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  10484. <dd><p>Set which planes to filter. By default all planes are filtered.
  10485. </p></dd>
  10486. </dl>
  10487. <a name="Commands-54"></a>
  10488. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-54">11.40.1 Commands</a></h3>
  10489. <p>This filter supports same <a href="#commands">commands</a> as options.
  10490. The command accepts the same syntax of the corresponding option.
  10491. </p>
  10492. <p>If the specified expression is not valid, it is kept at its current
  10493. value.
  10494. </p>
  10495. <a name="dctdnoiz"></a>
  10496. <h2 class="section"><a href="ffmpeg-filters.html#toc-dctdnoiz">11.41 dctdnoiz</a></h2>
  10497. <p>Denoise frames using 2D DCT (frequency domain filtering).
  10498. </p>
  10499. <p>This filter is not designed for real time.
  10500. </p>
  10501. <p>The filter accepts the following options:
  10502. </p>
  10503. <dl compact="compact">
  10504. <dt>&lsquo;<samp>sigma, s</samp>&rsquo;</dt>
  10505. <dd><p>Set the noise sigma constant.
  10506. </p>
  10507. <p>This <var>sigma</var> defines a hard threshold of <code>3 * sigma</code>; every DCT
  10508. coefficient (absolute value) below this threshold with be dropped.
  10509. </p>
  10510. <p>If you need a more advanced filtering, see &lsquo;<samp>expr</samp>&rsquo;.
  10511. </p>
  10512. <p>Default is <code>0</code>.
  10513. </p>
  10514. </dd>
  10515. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  10516. <dd><p>Set number overlapping pixels for each block. Since the filter can be slow, you
  10517. may want to reduce this value, at the cost of a less effective filter and the
  10518. risk of various artefacts.
  10519. </p>
  10520. <p>If the overlapping value doesn&rsquo;t permit processing the whole input width or
  10521. height, a warning will be displayed and according borders won&rsquo;t be denoised.
  10522. </p>
  10523. <p>Default value is <var>blocksize</var>-1, which is the best possible setting.
  10524. </p>
  10525. </dd>
  10526. <dt>&lsquo;<samp>expr, e</samp>&rsquo;</dt>
  10527. <dd><p>Set the coefficient factor expression.
  10528. </p>
  10529. <p>For each coefficient of a DCT block, this expression will be evaluated as a
  10530. multiplier value for the coefficient.
  10531. </p>
  10532. <p>If this is option is set, the &lsquo;<samp>sigma</samp>&rsquo; option will be ignored.
  10533. </p>
  10534. <p>The absolute value of the coefficient can be accessed through the <var>c</var>
  10535. variable.
  10536. </p>
  10537. </dd>
  10538. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  10539. <dd><p>Set the <var>blocksize</var> using the number of bits. <code>1&lt;&lt;<var>n</var></code> defines the
  10540. <var>blocksize</var>, which is the width and height of the processed blocks.
  10541. </p>
  10542. <p>The default value is <var>3</var> (8x8) and can be raised to <var>4</var> for a
  10543. <var>blocksize</var> of 16x16. Note that changing this setting has huge consequences
  10544. on the speed processing. Also, a larger block size does not necessarily means a
  10545. better de-noising.
  10546. </p></dd>
  10547. </dl>
  10548. <a name="Examples-5"></a>
  10549. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-5">11.41.1 Examples</a></h3>
  10550. <p>Apply a denoise with a &lsquo;<samp>sigma</samp>&rsquo; of <code>4.5</code>:
  10551. </p><div class="example">
  10552. <pre class="example">dctdnoiz=4.5
  10553. </pre></div>
  10554. <p>The same operation can be achieved using the expression system:
  10555. </p><div class="example">
  10556. <pre class="example">dctdnoiz=e='gte(c, 4.5*3)'
  10557. </pre></div>
  10558. <p>Violent denoise using a block size of <code>16x16</code>:
  10559. </p><div class="example">
  10560. <pre class="example">dctdnoiz=15:n=4
  10561. </pre></div>
  10562. <a name="deband"></a>
  10563. <h2 class="section"><a href="ffmpeg-filters.html#toc-deband">11.42 deband</a></h2>
  10564. <p>Remove banding artifacts from input video.
  10565. It works by replacing banded pixels with average value of referenced pixels.
  10566. </p>
  10567. <p>The filter accepts the following options:
  10568. </p>
  10569. <dl compact="compact">
  10570. <dt>&lsquo;<samp>1thr</samp>&rsquo;</dt>
  10571. <dt>&lsquo;<samp>2thr</samp>&rsquo;</dt>
  10572. <dt>&lsquo;<samp>3thr</samp>&rsquo;</dt>
  10573. <dt>&lsquo;<samp>4thr</samp>&rsquo;</dt>
  10574. <dd><p>Set banding detection threshold for each plane. Default is 0.02.
  10575. Valid range is 0.00003 to 0.5.
  10576. If difference between current pixel and reference pixel is less than threshold,
  10577. it will be considered as banded.
  10578. </p>
  10579. </dd>
  10580. <dt>&lsquo;<samp>range, r</samp>&rsquo;</dt>
  10581. <dd><p>Banding detection range in pixels. Default is 16. If positive, random number
  10582. in range 0 to set value will be used. If negative, exact absolute value
  10583. will be used.
  10584. The range defines square of four pixels around current pixel.
  10585. </p>
  10586. </dd>
  10587. <dt>&lsquo;<samp>direction, d</samp>&rsquo;</dt>
  10588. <dd><p>Set direction in radians from which four pixel will be compared. If positive,
  10589. random direction from 0 to set direction will be picked. If negative, exact of
  10590. absolute value will be picked. For example direction 0, -PI or -2*PI radians
  10591. will pick only pixels on same row and -PI/2 will pick only pixels on same
  10592. column.
  10593. </p>
  10594. </dd>
  10595. <dt>&lsquo;<samp>blur, b</samp>&rsquo;</dt>
  10596. <dd><p>If enabled, current pixel is compared with average value of all four
  10597. surrounding pixels. The default is enabled. If disabled current pixel is
  10598. compared with all four surrounding pixels. The pixel is considered banded
  10599. if only all four differences with surrounding pixels are less than threshold.
  10600. </p>
  10601. </dd>
  10602. <dt>&lsquo;<samp>coupling, c</samp>&rsquo;</dt>
  10603. <dd><p>If enabled, current pixel is changed if and only if all pixel components are banded,
  10604. e.g. banding detection threshold is triggered for all color components.
  10605. The default is disabled.
  10606. </p></dd>
  10607. </dl>
  10608. <a name="deblock"></a>
  10609. <h2 class="section"><a href="ffmpeg-filters.html#toc-deblock">11.43 deblock</a></h2>
  10610. <p>Remove blocking artifacts from input video.
  10611. </p>
  10612. <p>The filter accepts the following options:
  10613. </p>
  10614. <dl compact="compact">
  10615. <dt>&lsquo;<samp>filter</samp>&rsquo;</dt>
  10616. <dd><p>Set filter type, can be <var>weak</var> or <var>strong</var>. Default is <var>strong</var>.
  10617. This controls what kind of deblocking is applied.
  10618. </p>
  10619. </dd>
  10620. <dt>&lsquo;<samp>block</samp>&rsquo;</dt>
  10621. <dd><p>Set size of block, allowed range is from 4 to 512. Default is <var>8</var>.
  10622. </p>
  10623. </dd>
  10624. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  10625. <dt>&lsquo;<samp>beta</samp>&rsquo;</dt>
  10626. <dt>&lsquo;<samp>gamma</samp>&rsquo;</dt>
  10627. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  10628. <dd><p>Set blocking detection thresholds. Allowed range is 0 to 1.
  10629. Defaults are: <var>0.098</var> for <var>alpha</var> and <var>0.05</var> for the rest.
  10630. Using higher threshold gives more deblocking strength.
  10631. Setting <var>alpha</var> controls threshold detection at exact edge of block.
  10632. Remaining options controls threshold detection near the edge. Each one for
  10633. below/above or left/right. Setting any of those to <var>0</var> disables
  10634. deblocking.
  10635. </p>
  10636. </dd>
  10637. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  10638. <dd><p>Set planes to filter. Default is to filter all available planes.
  10639. </p></dd>
  10640. </dl>
  10641. <a name="Examples-36"></a>
  10642. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-36">11.43.1 Examples</a></h3>
  10643. <ul>
  10644. <li>
  10645. Deblock using weak filter and block size of 4 pixels.
  10646. <div class="example">
  10647. <pre class="example">deblock=filter=weak:block=4
  10648. </pre></div>
  10649. </li><li>
  10650. Deblock using strong filter, block size of 4 pixels and custom thresholds for
  10651. deblocking more edges.
  10652. <div class="example">
  10653. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
  10654. </pre></div>
  10655. </li><li>
  10656. Similar as above, but filter only first plane.
  10657. <div class="example">
  10658. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
  10659. </pre></div>
  10660. </li><li>
  10661. Similar as above, but filter only second and third plane.
  10662. <div class="example">
  10663. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
  10664. </pre></div>
  10665. </li></ul>
  10666. <p><a name="decimate"></a>
  10667. </p><a name="decimate-1"></a>
  10668. <h2 class="section"><a href="ffmpeg-filters.html#toc-decimate-1">11.44 decimate</a></h2>
  10669. <p>Drop duplicated frames at regular intervals.
  10670. </p>
  10671. <p>The filter accepts the following options:
  10672. </p>
  10673. <dl compact="compact">
  10674. <dt>&lsquo;<samp>cycle</samp>&rsquo;</dt>
  10675. <dd><p>Set the number of frames from which one will be dropped. Setting this to
  10676. <var>N</var> means one frame in every batch of <var>N</var> frames will be dropped.
  10677. Default is <code>5</code>.
  10678. </p>
  10679. </dd>
  10680. <dt>&lsquo;<samp>dupthresh</samp>&rsquo;</dt>
  10681. <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
  10682. is less than or equal to this value, then it is declared as duplicate. Default
  10683. is <code>1.1</code>
  10684. </p>
  10685. </dd>
  10686. <dt>&lsquo;<samp>scthresh</samp>&rsquo;</dt>
  10687. <dd><p>Set scene change threshold. Default is <code>15</code>.
  10688. </p>
  10689. </dd>
  10690. <dt>&lsquo;<samp>blockx</samp>&rsquo;</dt>
  10691. <dt>&lsquo;<samp>blocky</samp>&rsquo;</dt>
  10692. <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
  10693. Larger blocks give better noise suppression, but also give worse detection of
  10694. small movements. Must be a power of two. Default is <code>32</code>.
  10695. </p>
  10696. </dd>
  10697. <dt>&lsquo;<samp>ppsrc</samp>&rsquo;</dt>
  10698. <dd><p>Mark main input as a pre-processed input and activate clean source input
  10699. stream. This allows the input to be pre-processed with various filters to help
  10700. the metrics calculation while keeping the frame selection lossless. When set to
  10701. <code>1</code>, the first stream is for the pre-processed input, and the second
  10702. stream is the clean source from where the kept frames are chosen. Default is
  10703. <code>0</code>.
  10704. </p>
  10705. </dd>
  10706. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  10707. <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
  10708. <code>1</code>.
  10709. </p></dd>
  10710. </dl>
  10711. <a name="deconvolve"></a>
  10712. <h2 class="section"><a href="ffmpeg-filters.html#toc-deconvolve">11.45 deconvolve</a></h2>
  10713. <p>Apply 2D deconvolution of video stream in frequency domain using second stream
  10714. as impulse.
  10715. </p>
  10716. <p>The filter accepts the following options:
  10717. </p>
  10718. <dl compact="compact">
  10719. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  10720. <dd><p>Set which planes to process.
  10721. </p>
  10722. </dd>
  10723. <dt>&lsquo;<samp>impulse</samp>&rsquo;</dt>
  10724. <dd><p>Set which impulse video frames will be processed, can be <var>first</var>
  10725. or <var>all</var>. Default is <var>all</var>.
  10726. </p>
  10727. </dd>
  10728. <dt>&lsquo;<samp>noise</samp>&rsquo;</dt>
  10729. <dd><p>Set noise when doing divisions. Default is <var>0.0000001</var>. Useful when width
  10730. and height are not same and not power of 2 or if stream prior to convolving
  10731. had noise.
  10732. </p></dd>
  10733. </dl>
  10734. <p>The <code>deconvolve</code> filter also supports the <a href="#framesync">framesync</a> options.
  10735. </p>
  10736. <a name="dedot"></a>
  10737. <h2 class="section"><a href="ffmpeg-filters.html#toc-dedot">11.46 dedot</a></h2>
  10738. <p>Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video.
  10739. </p>
  10740. <p>It accepts the following options:
  10741. </p>
  10742. <dl compact="compact">
  10743. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  10744. <dd><p>Set mode of operation. Can be combination of <var>dotcrawl</var> for cross-luminance reduction and/or
  10745. <var>rainbows</var> for cross-color reduction.
  10746. </p>
  10747. </dd>
  10748. <dt>&lsquo;<samp>lt</samp>&rsquo;</dt>
  10749. <dd><p>Set spatial luma threshold. Lower values increases reduction of cross-luminance.
  10750. </p>
  10751. </dd>
  10752. <dt>&lsquo;<samp>tl</samp>&rsquo;</dt>
  10753. <dd><p>Set tolerance for temporal luma. Higher values increases reduction of cross-luminance.
  10754. </p>
  10755. </dd>
  10756. <dt>&lsquo;<samp>tc</samp>&rsquo;</dt>
  10757. <dd><p>Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color.
  10758. </p>
  10759. </dd>
  10760. <dt>&lsquo;<samp>ct</samp>&rsquo;</dt>
  10761. <dd><p>Set temporal chroma threshold. Lower values increases reduction of cross-color.
  10762. </p></dd>
  10763. </dl>
  10764. <a name="deflate"></a>
  10765. <h2 class="section"><a href="ffmpeg-filters.html#toc-deflate">11.47 deflate</a></h2>
  10766. <p>Apply deflate effect to the video.
  10767. </p>
  10768. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  10769. only values lower than the pixel.
  10770. </p>
  10771. <p>It accepts the following options:
  10772. </p>
  10773. <dl compact="compact">
  10774. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  10775. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  10776. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  10777. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  10778. <dd><p>Limit the maximum change for each plane, default is 65535.
  10779. If 0, plane will remain unchanged.
  10780. </p></dd>
  10781. </dl>
  10782. <a name="Commands-40"></a>
  10783. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-40">11.47.1 Commands</a></h3>
  10784. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  10785. </p>
  10786. <a name="deflicker"></a>
  10787. <h2 class="section"><a href="ffmpeg-filters.html#toc-deflicker">11.48 deflicker</a></h2>
  10788. <p>Remove temporal frame luminance variations.
  10789. </p>
  10790. <p>It accepts the following options:
  10791. </p>
  10792. <dl compact="compact">
  10793. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  10794. <dd><p>Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129.
  10795. </p>
  10796. </dd>
  10797. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  10798. <dd><p>Set averaging mode to smooth temporal luminance variations.
  10799. </p>
  10800. <p>Available values are:
  10801. </p><dl compact="compact">
  10802. <dt>&lsquo;<samp>am</samp>&rsquo;</dt>
  10803. <dd><p>Arithmetic mean
  10804. </p>
  10805. </dd>
  10806. <dt>&lsquo;<samp>gm</samp>&rsquo;</dt>
  10807. <dd><p>Geometric mean
  10808. </p>
  10809. </dd>
  10810. <dt>&lsquo;<samp>hm</samp>&rsquo;</dt>
  10811. <dd><p>Harmonic mean
  10812. </p>
  10813. </dd>
  10814. <dt>&lsquo;<samp>qm</samp>&rsquo;</dt>
  10815. <dd><p>Quadratic mean
  10816. </p>
  10817. </dd>
  10818. <dt>&lsquo;<samp>cm</samp>&rsquo;</dt>
  10819. <dd><p>Cubic mean
  10820. </p>
  10821. </dd>
  10822. <dt>&lsquo;<samp>pm</samp>&rsquo;</dt>
  10823. <dd><p>Power mean
  10824. </p>
  10825. </dd>
  10826. <dt>&lsquo;<samp>median</samp>&rsquo;</dt>
  10827. <dd><p>Median
  10828. </p></dd>
  10829. </dl>
  10830. </dd>
  10831. <dt>&lsquo;<samp>bypass</samp>&rsquo;</dt>
  10832. <dd><p>Do not actually modify frame. Useful when one only wants metadata.
  10833. </p></dd>
  10834. </dl>
  10835. <a name="dejudder"></a>
  10836. <h2 class="section"><a href="ffmpeg-filters.html#toc-dejudder">11.49 dejudder</a></h2>
  10837. <p>Remove judder produced by partially interlaced telecined content.
  10838. </p>
  10839. <p>Judder can be introduced, for instance, by <a href="#pullup">pullup</a> filter. If the original
  10840. source was partially telecined content then the output of <code>pullup,dejudder</code>
  10841. will have a variable frame rate. May change the recorded frame rate of the
  10842. container. Aside from that change, this filter will not affect constant frame
  10843. rate video.
  10844. </p>
  10845. <p>The option available in this filter is:
  10846. </p><dl compact="compact">
  10847. <dt>&lsquo;<samp>cycle</samp>&rsquo;</dt>
  10848. <dd><p>Specify the length of the window over which the judder repeats.
  10849. </p>
  10850. <p>Accepts any integer greater than 1. Useful values are:
  10851. </p><dl compact="compact">
  10852. <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
  10853. <dd><p>If the original was telecined from 24 to 30 fps (Film to NTSC).
  10854. </p>
  10855. </dd>
  10856. <dt>&lsquo;<samp>5</samp>&rsquo;</dt>
  10857. <dd><p>If the original was telecined from 25 to 30 fps (PAL to NTSC).
  10858. </p>
  10859. </dd>
  10860. <dt>&lsquo;<samp>20</samp>&rsquo;</dt>
  10861. <dd><p>If a mixture of the two.
  10862. </p></dd>
  10863. </dl>
  10864. <p>The default is &lsquo;<samp>4</samp>&rsquo;.
  10865. </p></dd>
  10866. </dl>
  10867. <a name="delogo"></a>
  10868. <h2 class="section"><a href="ffmpeg-filters.html#toc-delogo">11.50 delogo</a></h2>
  10869. <p>Suppress a TV station logo by a simple interpolation of the surrounding
  10870. pixels. Just set a rectangle covering the logo and watch it disappear
  10871. (and sometimes something even uglier appear - your mileage may vary).
  10872. </p>
  10873. <p>It accepts the following parameters:
  10874. </p><dl compact="compact">
  10875. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  10876. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  10877. <dd><p>Specify the top left corner coordinates of the logo. They must be
  10878. specified.
  10879. </p>
  10880. </dd>
  10881. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  10882. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  10883. <dd><p>Specify the width and height of the logo to clear. They must be
  10884. specified.
  10885. </p>
  10886. </dd>
  10887. <dt>&lsquo;<samp>band, t</samp>&rsquo;</dt>
  10888. <dd><p>Specify the thickness of the fuzzy edge of the rectangle (added to
  10889. <var>w</var> and <var>h</var>). The default value is 1. This option is
  10890. deprecated, setting higher values should no longer be necessary and
  10891. is not recommended.
  10892. </p>
  10893. </dd>
  10894. <dt>&lsquo;<samp>show</samp>&rsquo;</dt>
  10895. <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
  10896. finding the right <var>x</var>, <var>y</var>, <var>w</var>, and <var>h</var> parameters.
  10897. The default value is 0.
  10898. </p>
  10899. <p>The rectangle is drawn on the outermost pixels which will be (partly)
  10900. replaced with interpolated values. The values of the next pixels
  10901. immediately outside this rectangle in each direction will be used to
  10902. compute the interpolated pixel values inside the rectangle.
  10903. </p>
  10904. </dd>
  10905. </dl>
  10906. <a name="Examples-19"></a>
  10907. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-19">11.50.1 Examples</a></h3>
  10908. <ul>
  10909. <li>
  10910. Set a rectangle covering the area with top left corner coordinates 0,0
  10911. and size 100x77, and a band of size 10:
  10912. <div class="example">
  10913. <pre class="example">delogo=x=0:y=0:w=100:h=77:band=10
  10914. </pre></div>
  10915. </li></ul>
  10916. <p><a name="derain"></a>
  10917. </p><a name="derain-1"></a>
  10918. <h2 class="section"><a href="ffmpeg-filters.html#toc-derain-1">11.51 derain</a></h2>
  10919. <p>Remove the rain in the input image/video by applying the derain methods based on
  10920. convolutional neural networks. Supported models:
  10921. </p>
  10922. <ul>
  10923. <li>
  10924. Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN).
  10925. 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>.
  10926. </li></ul>
  10927. <p>Training as well as model generation scripts are provided in
  10928. the repository at <a href="https://github.com/XueweiMeng/derain_filter.git">https://github.com/XueweiMeng/derain_filter.git</a>.
  10929. </p>
  10930. <p>Native model files (.model) can be generated from TensorFlow model
  10931. files (.pb) by using tools/python/convert.py
  10932. </p>
  10933. <p>The filter accepts the following options:
  10934. </p>
  10935. <dl compact="compact">
  10936. <dt>&lsquo;<samp>filter_type</samp>&rsquo;</dt>
  10937. <dd><p>Specify which filter to use. This option accepts the following values:
  10938. </p>
  10939. <dl compact="compact">
  10940. <dt>&lsquo;<samp>derain</samp>&rsquo;</dt>
  10941. <dd><p>Derain filter. To conduct derain filter, you need to use a derain model.
  10942. </p>
  10943. </dd>
  10944. <dt>&lsquo;<samp>dehaze</samp>&rsquo;</dt>
  10945. <dd><p>Dehaze filter. To conduct dehaze filter, you need to use a dehaze model.
  10946. </p></dd>
  10947. </dl>
  10948. <p>Default value is &lsquo;<samp>derain</samp>&rsquo;.
  10949. </p>
  10950. </dd>
  10951. <dt>&lsquo;<samp>dnn_backend</samp>&rsquo;</dt>
  10952. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  10953. the following values:
  10954. </p>
  10955. <dl compact="compact">
  10956. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  10957. <dd><p>Native implementation of DNN loading and execution.
  10958. </p>
  10959. </dd>
  10960. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  10961. <dd><p>TensorFlow backend. To enable this backend you
  10962. need to install the TensorFlow for C library (see
  10963. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  10964. <code>--enable-libtensorflow</code>
  10965. </p></dd>
  10966. </dl>
  10967. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  10968. </p>
  10969. </dd>
  10970. <dt>&lsquo;<samp>model</samp>&rsquo;</dt>
  10971. <dd><p>Set path to model file specifying network architecture and its parameters.
  10972. Note that different backends use different file formats. TensorFlow and native
  10973. backend can load files for only its format.
  10974. </p></dd>
  10975. </dl>
  10976. <p>It can also be finished with <a href="#dnn_005fprocessing">dnn_processing</a> filter.
  10977. </p>
  10978. <a name="deshake"></a>
  10979. <h2 class="section"><a href="ffmpeg-filters.html#toc-deshake">11.52 deshake</a></h2>
  10980. <p>Attempt to fix small changes in horizontal and/or vertical shift. This
  10981. filter helps remove camera shake from hand-holding a camera, bumping a
  10982. tripod, moving on a vehicle, etc.
  10983. </p>
  10984. <p>The filter accepts the following options:
  10985. </p>
  10986. <dl compact="compact">
  10987. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  10988. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  10989. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  10990. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  10991. <dd><p>Specify a rectangular area where to limit the search for motion
  10992. vectors.
  10993. If desired the search for motion vectors can be limited to a
  10994. rectangular area of the frame defined by its top left corner, width
  10995. and height. These parameters have the same meaning as the drawbox
  10996. filter which can be used to visualise the position of the bounding
  10997. box.
  10998. </p>
  10999. <p>This is useful when simultaneous movement of subjects within the frame
  11000. might be confused for camera motion by the motion vector search.
  11001. </p>
  11002. <p>If any or all of <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are set to -1
  11003. then the full frame is used. This allows later options to be set
  11004. without specifying the bounding box for the motion vector search.
  11005. </p>
  11006. <p>Default - search the whole frame.
  11007. </p>
  11008. </dd>
  11009. <dt>&lsquo;<samp>rx</samp>&rsquo;</dt>
  11010. <dt>&lsquo;<samp>ry</samp>&rsquo;</dt>
  11011. <dd><p>Specify the maximum extent of movement in x and y directions in the
  11012. range 0-64 pixels. Default 16.
  11013. </p>
  11014. </dd>
  11015. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  11016. <dd><p>Specify how to generate pixels to fill blanks at the edge of the
  11017. frame. Available values are:
  11018. </p><dl compact="compact">
  11019. <dt>&lsquo;<samp>blank, 0</samp>&rsquo;</dt>
  11020. <dd><p>Fill zeroes at blank locations
  11021. </p></dd>
  11022. <dt>&lsquo;<samp>original, 1</samp>&rsquo;</dt>
  11023. <dd><p>Original image at blank locations
  11024. </p></dd>
  11025. <dt>&lsquo;<samp>clamp, 2</samp>&rsquo;</dt>
  11026. <dd><p>Extruded edge value at blank locations
  11027. </p></dd>
  11028. <dt>&lsquo;<samp>mirror, 3</samp>&rsquo;</dt>
  11029. <dd><p>Mirrored edge at blank locations
  11030. </p></dd>
  11031. </dl>
  11032. <p>Default value is &lsquo;<samp>mirror</samp>&rsquo;.
  11033. </p>
  11034. </dd>
  11035. <dt>&lsquo;<samp>blocksize</samp>&rsquo;</dt>
  11036. <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
  11037. default 8.
  11038. </p>
  11039. </dd>
  11040. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  11041. <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
  11042. the specified contrast (difference between darkest and lightest
  11043. pixels) will be considered. Range 1-255, default 125.
  11044. </p>
  11045. </dd>
  11046. <dt>&lsquo;<samp>search</samp>&rsquo;</dt>
  11047. <dd><p>Specify the search strategy. Available values are:
  11048. </p><dl compact="compact">
  11049. <dt>&lsquo;<samp>exhaustive, 0</samp>&rsquo;</dt>
  11050. <dd><p>Set exhaustive search
  11051. </p></dd>
  11052. <dt>&lsquo;<samp>less, 1</samp>&rsquo;</dt>
  11053. <dd><p>Set less exhaustive search.
  11054. </p></dd>
  11055. </dl>
  11056. <p>Default value is &lsquo;<samp>exhaustive</samp>&rsquo;.
  11057. </p>
  11058. </dd>
  11059. <dt>&lsquo;<samp>filename</samp>&rsquo;</dt>
  11060. <dd><p>If set then a detailed log of the motion search is written to the
  11061. specified file.
  11062. </p>
  11063. </dd>
  11064. </dl>
  11065. <a name="despill"></a>
  11066. <h2 class="section"><a href="ffmpeg-filters.html#toc-despill">11.53 despill</a></h2>
  11067. <p>Remove unwanted contamination of foreground colors, caused by reflected color of
  11068. greenscreen or bluescreen.
  11069. </p>
  11070. <p>This filter accepts the following options:
  11071. </p>
  11072. <dl compact="compact">
  11073. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  11074. <dd><p>Set what type of despill to use.
  11075. </p>
  11076. </dd>
  11077. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  11078. <dd><p>Set how spillmap will be generated.
  11079. </p>
  11080. </dd>
  11081. <dt>&lsquo;<samp>expand</samp>&rsquo;</dt>
  11082. <dd><p>Set how much to get rid of still remaining spill.
  11083. </p>
  11084. </dd>
  11085. <dt>&lsquo;<samp>red</samp>&rsquo;</dt>
  11086. <dd><p>Controls amount of red in spill area.
  11087. </p>
  11088. </dd>
  11089. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  11090. <dd><p>Controls amount of green in spill area.
  11091. Should be -1 for greenscreen.
  11092. </p>
  11093. </dd>
  11094. <dt>&lsquo;<samp>blue</samp>&rsquo;</dt>
  11095. <dd><p>Controls amount of blue in spill area.
  11096. Should be -1 for bluescreen.
  11097. </p>
  11098. </dd>
  11099. <dt>&lsquo;<samp>brightness</samp>&rsquo;</dt>
  11100. <dd><p>Controls brightness of spill area, preserving colors.
  11101. </p>
  11102. </dd>
  11103. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  11104. <dd><p>Modify alpha from generated spillmap.
  11105. </p></dd>
  11106. </dl>
  11107. <a name="detelecine"></a>
  11108. <h2 class="section"><a href="ffmpeg-filters.html#toc-detelecine">11.54 detelecine</a></h2>
  11109. <p>Apply an exact inverse of the telecine operation. It requires a predefined
  11110. pattern specified using the pattern option which must be the same as that passed
  11111. to the telecine filter.
  11112. </p>
  11113. <p>This filter accepts the following options:
  11114. </p>
  11115. <dl compact="compact">
  11116. <dt>&lsquo;<samp>first_field</samp>&rsquo;</dt>
  11117. <dd><dl compact="compact">
  11118. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  11119. <dd><p>top field first
  11120. </p></dd>
  11121. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  11122. <dd><p>bottom field first
  11123. The default value is <code>top</code>.
  11124. </p></dd>
  11125. </dl>
  11126. </dd>
  11127. <dt>&lsquo;<samp>pattern</samp>&rsquo;</dt>
  11128. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  11129. The default value is <code>23</code>.
  11130. </p>
  11131. </dd>
  11132. <dt>&lsquo;<samp>start_frame</samp>&rsquo;</dt>
  11133. <dd><p>A number representing position of the first frame with respect to the telecine
  11134. pattern. This is to be used if the stream is cut. The default value is <code>0</code>.
  11135. </p></dd>
  11136. </dl>
  11137. <a name="dilation"></a>
  11138. <h2 class="section"><a href="ffmpeg-filters.html#toc-dilation">11.55 dilation</a></h2>
  11139. <p>Apply dilation effect to the video.
  11140. </p>
  11141. <p>This filter replaces the pixel by the local(3x3) maximum.
  11142. </p>
  11143. <p>It accepts the following options:
  11144. </p>
  11145. <dl compact="compact">
  11146. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  11147. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  11148. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  11149. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  11150. <dd><p>Limit the maximum change for each plane, default is 65535.
  11151. If 0, plane will remain unchanged.
  11152. </p>
  11153. </dd>
  11154. <dt>&lsquo;<samp>coordinates</samp>&rsquo;</dt>
  11155. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  11156. pixels are used.
  11157. </p>
  11158. <p>Flags to local 3x3 coordinates maps like this:
  11159. </p>
  11160. <p> 1 2 3
  11161. 4 5
  11162. 6 7 8
  11163. </p></dd>
  11164. </dl>
  11165. <a name="Commands-1"></a>
  11166. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-1">11.55.1 Commands</a></h3>
  11167. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  11168. </p>
  11169. <a name="displace"></a>
  11170. <h2 class="section"><a href="ffmpeg-filters.html#toc-displace">11.56 displace</a></h2>
  11171. <p>Displace pixels as indicated by second and third input stream.
  11172. </p>
  11173. <p>It takes three input streams and outputs one stream, the first input is the
  11174. source, and second and third input are displacement maps.
  11175. </p>
  11176. <p>The second input specifies how much to displace pixels along the
  11177. x-axis, while the third input specifies how much to displace pixels
  11178. along the y-axis.
  11179. If one of displacement map streams terminates, last frame from that
  11180. displacement map will be used.
  11181. </p>
  11182. <p>Note that once generated, displacements maps can be reused over and over again.
  11183. </p>
  11184. <p>A description of the accepted options follows.
  11185. </p>
  11186. <dl compact="compact">
  11187. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  11188. <dd><p>Set displace behavior for pixels that are out of range.
  11189. </p>
  11190. <p>Available values are:
  11191. </p><dl compact="compact">
  11192. <dt>&lsquo;<samp>blank</samp>&rsquo;</dt>
  11193. <dd><p>Missing pixels are replaced by black pixels.
  11194. </p>
  11195. </dd>
  11196. <dt>&lsquo;<samp>smear</samp>&rsquo;</dt>
  11197. <dd><p>Adjacent pixels will spread out to replace missing pixels.
  11198. </p>
  11199. </dd>
  11200. <dt>&lsquo;<samp>wrap</samp>&rsquo;</dt>
  11201. <dd><p>Out of range pixels are wrapped so they point to pixels of other side.
  11202. </p>
  11203. </dd>
  11204. <dt>&lsquo;<samp>mirror</samp>&rsquo;</dt>
  11205. <dd><p>Out of range pixels will be replaced with mirrored pixels.
  11206. </p></dd>
  11207. </dl>
  11208. <p>Default is &lsquo;<samp>smear</samp>&rsquo;.
  11209. </p>
  11210. </dd>
  11211. </dl>
  11212. <a name="Examples-48"></a>
  11213. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-48">11.56.1 Examples</a></h3>
  11214. <ul>
  11215. <li>
  11216. Add ripple effect to rgb input of video size hd720:
  11217. <div class="example">
  11218. <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
  11219. </pre></div>
  11220. </li><li>
  11221. Add wave effect to rgb input of video size hd720:
  11222. <div class="example">
  11223. <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
  11224. </pre></div>
  11225. </li></ul>
  11226. <p><a name="dnn_005fprocessing"></a>
  11227. </p><a name="dnn_005fprocessing-1"></a>
  11228. <h2 class="section"><a href="ffmpeg-filters.html#toc-dnn_005fprocessing-1">11.57 dnn_processing</a></h2>
  11229. <p>Do image processing with deep neural networks. It works together with another filter
  11230. which converts the pixel format of the Frame to what the dnn network requires.
  11231. </p>
  11232. <p>The filter accepts the following options:
  11233. </p>
  11234. <dl compact="compact">
  11235. <dt>&lsquo;<samp>dnn_backend</samp>&rsquo;</dt>
  11236. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  11237. the following values:
  11238. </p>
  11239. <dl compact="compact">
  11240. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  11241. <dd><p>Native implementation of DNN loading and execution.
  11242. </p>
  11243. </dd>
  11244. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  11245. <dd><p>TensorFlow backend. To enable this backend you
  11246. need to install the TensorFlow for C library (see
  11247. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  11248. <code>--enable-libtensorflow</code>
  11249. </p></dd>
  11250. </dl>
  11251. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  11252. </p>
  11253. </dd>
  11254. <dt>&lsquo;<samp>model</samp>&rsquo;</dt>
  11255. <dd><p>Set path to model file specifying network architecture and its parameters.
  11256. Note that different backends use different file formats. TensorFlow and native
  11257. backend can load files for only its format.
  11258. </p>
  11259. <p>Native model file (.model) can be generated from TensorFlow model file (.pb) by using tools/python/convert.py
  11260. </p>
  11261. </dd>
  11262. <dt>&lsquo;<samp>input</samp>&rsquo;</dt>
  11263. <dd><p>Set the input name of the dnn network.
  11264. </p>
  11265. </dd>
  11266. <dt>&lsquo;<samp>output</samp>&rsquo;</dt>
  11267. <dd><p>Set the output name of the dnn network.
  11268. </p>
  11269. </dd>
  11270. </dl>
  11271. <a name="Examples-128"></a>
  11272. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-128">11.57.1 Examples</a></h3>
  11273. <ul>
  11274. <li>
  11275. Remove rain in rgb24 frame with can.pb (see <a href="#derain">derain</a> filter):
  11276. <div class="example">
  11277. <pre class="example">./ffmpeg -i rain.jpg -vf format=rgb24,dnn_processing=dnn_backend=tensorflow:model=can.pb:input=x:output=y derain.jpg
  11278. </pre></div>
  11279. </li><li>
  11280. Halve the pixel value of the frame with format gray32f:
  11281. <div class="example">
  11282. <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
  11283. </pre></div>
  11284. </li><li>
  11285. Handle the Y channel with srcnn.pb (see <a href="#sr">sr</a> filter) for frame with yuv420p (planar YUV formats supported):
  11286. <div class="example">
  11287. <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
  11288. </pre></div>
  11289. </li><li>
  11290. 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):
  11291. <div class="example">
  11292. <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
  11293. </pre></div>
  11294. </li></ul>
  11295. <a name="drawbox"></a>
  11296. <h2 class="section"><a href="ffmpeg-filters.html#toc-drawbox">11.58 drawbox</a></h2>
  11297. <p>Draw a colored box on the input image.
  11298. </p>
  11299. <p>It accepts the following parameters:
  11300. </p>
  11301. <dl compact="compact">
  11302. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  11303. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  11304. <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
  11305. </p>
  11306. </dd>
  11307. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  11308. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  11309. <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
  11310. the input width and height. It defaults to 0.
  11311. </p>
  11312. </dd>
  11313. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  11314. <dd><p>Specify the color of the box to write. For the general syntax of this option,
  11315. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  11316. value <code>invert</code> is used, the box edge color is the same as the
  11317. video with inverted luma.
  11318. </p>
  11319. </dd>
  11320. <dt>&lsquo;<samp>thickness, t</samp>&rsquo;</dt>
  11321. <dd><p>The expression which sets the thickness of the box edge.
  11322. A value of <code>fill</code> will create a filled box. Default value is <code>3</code>.
  11323. </p>
  11324. <p>See below for the list of accepted constants.
  11325. </p>
  11326. </dd>
  11327. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  11328. <dd><p>Applicable if the input has alpha. With value <code>1</code>, the pixels of the painted box
  11329. will overwrite the video&rsquo;s color and alpha pixels.
  11330. Default is <code>0</code>, which composites the box onto the input, leaving the video&rsquo;s alpha intact.
  11331. </p></dd>
  11332. </dl>
  11333. <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
  11334. following constants:
  11335. </p>
  11336. <dl compact="compact">
  11337. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  11338. <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
  11339. </p>
  11340. </dd>
  11341. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  11342. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  11343. <dd><p>horizontal and vertical chroma subsample values. For example for the
  11344. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  11345. </p>
  11346. </dd>
  11347. <dt>&lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
  11348. <dt>&lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
  11349. <dd><p>The input width and height.
  11350. </p>
  11351. </dd>
  11352. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  11353. <dd><p>The input sample aspect ratio.
  11354. </p>
  11355. </dd>
  11356. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  11357. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  11358. <dd><p>The x and y offset coordinates where the box is drawn.
  11359. </p>
  11360. </dd>
  11361. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  11362. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  11363. <dd><p>The width and height of the drawn box.
  11364. </p>
  11365. </dd>
  11366. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  11367. <dd><p>The thickness of the drawn box.
  11368. </p>
  11369. <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
  11370. each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
  11371. </p>
  11372. </dd>
  11373. </dl>
  11374. <a name="Examples-96"></a>
  11375. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-96">11.58.1 Examples</a></h3>
  11376. <ul>
  11377. <li>
  11378. Draw a black box around the edge of the input image:
  11379. <div class="example">
  11380. <pre class="example">drawbox
  11381. </pre></div>
  11382. </li><li>
  11383. Draw a box with color red and an opacity of 50%:
  11384. <div class="example">
  11385. <pre class="example">drawbox=10:20:200:60:red@0.5
  11386. </pre></div>
  11387. <p>The previous example can be specified as:
  11388. </p><div class="example">
  11389. <pre class="example">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
  11390. </pre></div>
  11391. </li><li>
  11392. Fill the box with pink color:
  11393. <div class="example">
  11394. <pre class="example">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
  11395. </pre></div>
  11396. </li><li>
  11397. Draw a 2-pixel red 2.40:1 mask:
  11398. <div class="example">
  11399. <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
  11400. </pre></div>
  11401. </li></ul>
  11402. <a name="Commands-6"></a>
  11403. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-6">11.58.2 Commands</a></h3>
  11404. <p>This filter supports same commands as options.
  11405. The command accepts the same syntax of the corresponding option.
  11406. </p>
  11407. <p>If the specified expression is not valid, it is kept at its current
  11408. value.
  11409. </p>
  11410. <p><a name="drawgraph"></a>
  11411. </p><a name="drawgraph-1"></a>
  11412. <h2 class="section"><a href="ffmpeg-filters.html#toc-drawgraph-1">11.59 drawgraph</a></h2>
  11413. <p>Draw a graph using input video metadata.
  11414. </p>
  11415. <p>It accepts the following parameters:
  11416. </p>
  11417. <dl compact="compact">
  11418. <dt>&lsquo;<samp>m1</samp>&rsquo;</dt>
  11419. <dd><p>Set 1st frame metadata key from which metadata values will be used to draw a graph.
  11420. </p>
  11421. </dd>
  11422. <dt>&lsquo;<samp>fg1</samp>&rsquo;</dt>
  11423. <dd><p>Set 1st foreground color expression.
  11424. </p>
  11425. </dd>
  11426. <dt>&lsquo;<samp>m2</samp>&rsquo;</dt>
  11427. <dd><p>Set 2nd frame metadata key from which metadata values will be used to draw a graph.
  11428. </p>
  11429. </dd>
  11430. <dt>&lsquo;<samp>fg2</samp>&rsquo;</dt>
  11431. <dd><p>Set 2nd foreground color expression.
  11432. </p>
  11433. </dd>
  11434. <dt>&lsquo;<samp>m3</samp>&rsquo;</dt>
  11435. <dd><p>Set 3rd frame metadata key from which metadata values will be used to draw a graph.
  11436. </p>
  11437. </dd>
  11438. <dt>&lsquo;<samp>fg3</samp>&rsquo;</dt>
  11439. <dd><p>Set 3rd foreground color expression.
  11440. </p>
  11441. </dd>
  11442. <dt>&lsquo;<samp>m4</samp>&rsquo;</dt>
  11443. <dd><p>Set 4th frame metadata key from which metadata values will be used to draw a graph.
  11444. </p>
  11445. </dd>
  11446. <dt>&lsquo;<samp>fg4</samp>&rsquo;</dt>
  11447. <dd><p>Set 4th foreground color expression.
  11448. </p>
  11449. </dd>
  11450. <dt>&lsquo;<samp>min</samp>&rsquo;</dt>
  11451. <dd><p>Set minimal value of metadata value.
  11452. </p>
  11453. </dd>
  11454. <dt>&lsquo;<samp>max</samp>&rsquo;</dt>
  11455. <dd><p>Set maximal value of metadata value.
  11456. </p>
  11457. </dd>
  11458. <dt>&lsquo;<samp>bg</samp>&rsquo;</dt>
  11459. <dd><p>Set graph background color. Default is white.
  11460. </p>
  11461. </dd>
  11462. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  11463. <dd><p>Set graph mode.
  11464. </p>
  11465. <p>Available values for mode is:
  11466. </p><dl compact="compact">
  11467. <dt>&lsquo;<samp>bar</samp>&rsquo;</dt>
  11468. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  11469. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  11470. </dl>
  11471. <p>Default is <code>line</code>.
  11472. </p>
  11473. </dd>
  11474. <dt>&lsquo;<samp>slide</samp>&rsquo;</dt>
  11475. <dd><p>Set slide mode.
  11476. </p>
  11477. <p>Available values for slide is:
  11478. </p><dl compact="compact">
  11479. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  11480. <dd><p>Draw new frame when right border is reached.
  11481. </p>
  11482. </dd>
  11483. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  11484. <dd><p>Replace old columns with new ones.
  11485. </p>
  11486. </dd>
  11487. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  11488. <dd><p>Scroll from right to left.
  11489. </p>
  11490. </dd>
  11491. <dt>&lsquo;<samp>rscroll</samp>&rsquo;</dt>
  11492. <dd><p>Scroll from left to right.
  11493. </p>
  11494. </dd>
  11495. <dt>&lsquo;<samp>picture</samp>&rsquo;</dt>
  11496. <dd><p>Draw single picture.
  11497. </p></dd>
  11498. </dl>
  11499. <p>Default is <code>frame</code>.
  11500. </p>
  11501. </dd>
  11502. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  11503. <dd><p>Set size of graph video. For the syntax of this option, check the
  11504. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  11505. The default value is <code>900x256</code>.
  11506. </p>
  11507. </dd>
  11508. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  11509. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  11510. </p>
  11511. <p>The foreground color expressions can use the following variables:
  11512. </p><dl compact="compact">
  11513. <dt>&lsquo;<samp>MIN</samp>&rsquo;</dt>
  11514. <dd><p>Minimal value of metadata value.
  11515. </p>
  11516. </dd>
  11517. <dt>&lsquo;<samp>MAX</samp>&rsquo;</dt>
  11518. <dd><p>Maximal value of metadata value.
  11519. </p>
  11520. </dd>
  11521. <dt>&lsquo;<samp>VAL</samp>&rsquo;</dt>
  11522. <dd><p>Current metadata key value.
  11523. </p></dd>
  11524. </dl>
  11525. <p>The color is defined as 0xAABBGGRR.
  11526. </p></dd>
  11527. </dl>
  11528. <p>Example using metadata from <a href="#signalstats">signalstats</a> filter:
  11529. </p><div class="example">
  11530. <pre class="example">signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
  11531. </pre></div>
  11532. <p>Example using metadata from <a href="#ebur128">ebur128</a> filter:
  11533. </p><div class="example">
  11534. <pre class="example">ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
  11535. </pre></div>
  11536. <a name="drawgrid"></a>
  11537. <h2 class="section"><a href="ffmpeg-filters.html#toc-drawgrid">11.60 drawgrid</a></h2>
  11538. <p>Draw a grid on the input image.
  11539. </p>
  11540. <p>It accepts the following parameters:
  11541. </p>
  11542. <dl compact="compact">
  11543. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  11544. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  11545. <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
  11546. </p>
  11547. </dd>
  11548. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  11549. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  11550. <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
  11551. input width and height, respectively, minus <code>thickness</code>, so image gets
  11552. framed. Default to 0.
  11553. </p>
  11554. </dd>
  11555. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  11556. <dd><p>Specify the color of the grid. For the general syntax of this option,
  11557. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  11558. value <code>invert</code> is used, the grid color is the same as the
  11559. video with inverted luma.
  11560. </p>
  11561. </dd>
  11562. <dt>&lsquo;<samp>thickness, t</samp>&rsquo;</dt>
  11563. <dd><p>The expression which sets the thickness of the grid line. Default value is <code>1</code>.
  11564. </p>
  11565. <p>See below for the list of accepted constants.
  11566. </p>
  11567. </dd>
  11568. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  11569. <dd><p>Applicable if the input has alpha. With <code>1</code> the pixels of the painted grid
  11570. will overwrite the video&rsquo;s color and alpha pixels.
  11571. Default is <code>0</code>, which composites the grid onto the input, leaving the video&rsquo;s alpha intact.
  11572. </p></dd>
  11573. </dl>
  11574. <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
  11575. following constants:
  11576. </p>
  11577. <dl compact="compact">
  11578. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  11579. <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
  11580. </p>
  11581. </dd>
  11582. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  11583. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  11584. <dd><p>horizontal and vertical chroma subsample values. For example for the
  11585. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  11586. </p>
  11587. </dd>
  11588. <dt>&lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
  11589. <dt>&lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
  11590. <dd><p>The input grid cell width and height.
  11591. </p>
  11592. </dd>
  11593. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  11594. <dd><p>The input sample aspect ratio.
  11595. </p>
  11596. </dd>
  11597. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  11598. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  11599. <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
  11600. </p>
  11601. </dd>
  11602. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  11603. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  11604. <dd><p>The width and height of the drawn cell.
  11605. </p>
  11606. </dd>
  11607. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  11608. <dd><p>The thickness of the drawn cell.
  11609. </p>
  11610. <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
  11611. each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
  11612. </p>
  11613. </dd>
  11614. </dl>
  11615. <a name="Examples-27"></a>
  11616. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-27">11.60.1 Examples</a></h3>
  11617. <ul>
  11618. <li>
  11619. Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
  11620. <div class="example">
  11621. <pre class="example">drawgrid=width=100:height=100:thickness=2:color=red@0.5
  11622. </pre></div>
  11623. </li><li>
  11624. Draw a white 3x3 grid with an opacity of 50%:
  11625. <div class="example">
  11626. <pre class="example">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
  11627. </pre></div>
  11628. </li></ul>
  11629. <a name="Commands-57"></a>
  11630. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-57">11.60.2 Commands</a></h3>
  11631. <p>This filter supports same commands as options.
  11632. The command accepts the same syntax of the corresponding option.
  11633. </p>
  11634. <p>If the specified expression is not valid, it is kept at its current
  11635. value.
  11636. </p>
  11637. <p><a name="drawtext"></a>
  11638. </p><a name="drawtext-1"></a>
  11639. <h2 class="section"><a href="ffmpeg-filters.html#toc-drawtext-1">11.61 drawtext</a></h2>
  11640. <p>Draw a text string or text from a specified file on top of a video, using the
  11641. libfreetype library.
  11642. </p>
  11643. <p>To enable compilation of this filter, you need to configure FFmpeg with
  11644. <code>--enable-libfreetype</code>.
  11645. To enable default font fallback and the <var>font</var> option you need to
  11646. configure FFmpeg with <code>--enable-libfontconfig</code>.
  11647. To enable the <var>text_shaping</var> option, you need to configure FFmpeg with
  11648. <code>--enable-libfribidi</code>.
  11649. </p>
  11650. <a name="Syntax"></a>
  11651. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Syntax">11.61.1 Syntax</a></h3>
  11652. <p>It accepts the following parameters:
  11653. </p>
  11654. <dl compact="compact">
  11655. <dt>&lsquo;<samp>box</samp>&rsquo;</dt>
  11656. <dd><p>Used to draw a box around text using the background color.
  11657. The value must be either 1 (enable) or 0 (disable).
  11658. The default value of <var>box</var> is 0.
  11659. </p>
  11660. </dd>
  11661. <dt>&lsquo;<samp>boxborderw</samp>&rsquo;</dt>
  11662. <dd><p>Set the width of the border to be drawn around the box using <var>boxcolor</var>.
  11663. The default value of <var>boxborderw</var> is 0.
  11664. </p>
  11665. </dd>
  11666. <dt>&lsquo;<samp>boxcolor</samp>&rsquo;</dt>
  11667. <dd><p>The color to be used for drawing box around text. For the syntax of this
  11668. option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  11669. </p>
  11670. <p>The default value of <var>boxcolor</var> is &quot;white&quot;.
  11671. </p>
  11672. </dd>
  11673. <dt>&lsquo;<samp>line_spacing</samp>&rsquo;</dt>
  11674. <dd><p>Set the line spacing in pixels of the border to be drawn around the box using <var>box</var>.
  11675. The default value of <var>line_spacing</var> is 0.
  11676. </p>
  11677. </dd>
  11678. <dt>&lsquo;<samp>borderw</samp>&rsquo;</dt>
  11679. <dd><p>Set the width of the border to be drawn around the text using <var>bordercolor</var>.
  11680. The default value of <var>borderw</var> is 0.
  11681. </p>
  11682. </dd>
  11683. <dt>&lsquo;<samp>bordercolor</samp>&rsquo;</dt>
  11684. <dd><p>Set the color to be used for drawing border around text. For the syntax of this
  11685. option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  11686. </p>
  11687. <p>The default value of <var>bordercolor</var> is &quot;black&quot;.
  11688. </p>
  11689. </dd>
  11690. <dt>&lsquo;<samp>expansion</samp>&rsquo;</dt>
  11691. <dd><p>Select how the <var>text</var> is expanded. Can be either <code>none</code>,
  11692. <code>strftime</code> (deprecated) or
  11693. <code>normal</code> (default). See the <a href="#drawtext_005fexpansion">Text expansion</a> section
  11694. below for details.
  11695. </p>
  11696. </dd>
  11697. <dt>&lsquo;<samp>basetime</samp>&rsquo;</dt>
  11698. <dd><p>Set a start time for the count. Value is in microseconds. Only applied
  11699. in the deprecated strftime expansion mode. To emulate in normal expansion
  11700. mode use the <code>pts</code> function, supplying the start time (in seconds)
  11701. as the second argument.
  11702. </p>
  11703. </dd>
  11704. <dt>&lsquo;<samp>fix_bounds</samp>&rsquo;</dt>
  11705. <dd><p>If true, check and fix text coords to avoid clipping.
  11706. </p>
  11707. </dd>
  11708. <dt>&lsquo;<samp>fontcolor</samp>&rsquo;</dt>
  11709. <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
  11710. the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  11711. </p>
  11712. <p>The default value of <var>fontcolor</var> is &quot;black&quot;.
  11713. </p>
  11714. </dd>
  11715. <dt>&lsquo;<samp>fontcolor_expr</samp>&rsquo;</dt>
  11716. <dd><p>String which is expanded the same way as <var>text</var> to obtain dynamic
  11717. <var>fontcolor</var> value. By default this option has empty value and is not
  11718. processed. When this option is set, it overrides <var>fontcolor</var> option.
  11719. </p>
  11720. </dd>
  11721. <dt>&lsquo;<samp>font</samp>&rsquo;</dt>
  11722. <dd><p>The font family to be used for drawing text. By default Sans.
  11723. </p>
  11724. </dd>
  11725. <dt>&lsquo;<samp>fontfile</samp>&rsquo;</dt>
  11726. <dd><p>The font file to be used for drawing text. The path must be included.
  11727. This parameter is mandatory if the fontconfig support is disabled.
  11728. </p>
  11729. </dd>
  11730. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  11731. <dd><p>Draw the text applying alpha blending. The value can
  11732. be a number between 0.0 and 1.0.
  11733. The expression accepts the same variables <var>x, y</var> as well.
  11734. The default value is 1.
  11735. Please see <var>fontcolor_expr</var>.
  11736. </p>
  11737. </dd>
  11738. <dt>&lsquo;<samp>fontsize</samp>&rsquo;</dt>
  11739. <dd><p>The font size to be used for drawing text.
  11740. The default value of <var>fontsize</var> is 16.
  11741. </p>
  11742. </dd>
  11743. <dt>&lsquo;<samp>text_shaping</samp>&rsquo;</dt>
  11744. <dd><p>If set to 1, attempt to shape the text (for example, reverse the order of
  11745. right-to-left text and join Arabic characters) before drawing it.
  11746. Otherwise, just draw the text exactly as given.
  11747. By default 1 (if supported).
  11748. </p>
  11749. </dd>
  11750. <dt>&lsquo;<samp>ft_load_flags</samp>&rsquo;</dt>
  11751. <dd><p>The flags to be used for loading the fonts.
  11752. </p>
  11753. <p>The flags map the corresponding flags supported by libfreetype, and are
  11754. a combination of the following values:
  11755. </p><dl compact="compact">
  11756. <dt><var>default</var></dt>
  11757. <dt><var>no_scale</var></dt>
  11758. <dt><var>no_hinting</var></dt>
  11759. <dt><var>render</var></dt>
  11760. <dt><var>no_bitmap</var></dt>
  11761. <dt><var>vertical_layout</var></dt>
  11762. <dt><var>force_autohint</var></dt>
  11763. <dt><var>crop_bitmap</var></dt>
  11764. <dt><var>pedantic</var></dt>
  11765. <dt><var>ignore_global_advance_width</var></dt>
  11766. <dt><var>no_recurse</var></dt>
  11767. <dt><var>ignore_transform</var></dt>
  11768. <dt><var>monochrome</var></dt>
  11769. <dt><var>linear_design</var></dt>
  11770. <dt><var>no_autohint</var></dt>
  11771. </dl>
  11772. <p>Default value is &quot;default&quot;.
  11773. </p>
  11774. <p>For more information consult the documentation for the FT_LOAD_*
  11775. libfreetype flags.
  11776. </p>
  11777. </dd>
  11778. <dt>&lsquo;<samp>shadowcolor</samp>&rsquo;</dt>
  11779. <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
  11780. syntax of this option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  11781. </p>
  11782. <p>The default value of <var>shadowcolor</var> is &quot;black&quot;.
  11783. </p>
  11784. </dd>
  11785. <dt>&lsquo;<samp>shadowx</samp>&rsquo;</dt>
  11786. <dt>&lsquo;<samp>shadowy</samp>&rsquo;</dt>
  11787. <dd><p>The x and y offsets for the text shadow position with respect to the
  11788. position of the text. They can be either positive or negative
  11789. values. The default value for both is &quot;0&quot;.
  11790. </p>
  11791. </dd>
  11792. <dt>&lsquo;<samp>start_number</samp>&rsquo;</dt>
  11793. <dd><p>The starting frame number for the n/frame_num variable. The default value
  11794. is &quot;0&quot;.
  11795. </p>
  11796. </dd>
  11797. <dt>&lsquo;<samp>tabsize</samp>&rsquo;</dt>
  11798. <dd><p>The size in number of spaces to use for rendering the tab.
  11799. Default value is 4.
  11800. </p>
  11801. </dd>
  11802. <dt>&lsquo;<samp>timecode</samp>&rsquo;</dt>
  11803. <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
  11804. format. It can be used with or without text parameter. <var>timecode_rate</var>
  11805. option must be specified.
  11806. </p>
  11807. </dd>
  11808. <dt>&lsquo;<samp>timecode_rate, rate, r</samp>&rsquo;</dt>
  11809. <dd><p>Set the timecode frame rate (timecode only). Value will be rounded to nearest
  11810. integer. Minimum value is &quot;1&quot;.
  11811. Drop-frame timecode is supported for frame rates 30 &amp; 60.
  11812. </p>
  11813. </dd>
  11814. <dt>&lsquo;<samp>tc24hmax</samp>&rsquo;</dt>
  11815. <dd><p>If set to 1, the output of the timecode option will wrap around at 24 hours.
  11816. Default is 0 (disabled).
  11817. </p>
  11818. </dd>
  11819. <dt>&lsquo;<samp>text</samp>&rsquo;</dt>
  11820. <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
  11821. encoded characters.
  11822. This parameter is mandatory if no file is specified with the parameter
  11823. <var>textfile</var>.
  11824. </p>
  11825. </dd>
  11826. <dt>&lsquo;<samp>textfile</samp>&rsquo;</dt>
  11827. <dd><p>A text file containing text to be drawn. The text must be a sequence
  11828. of UTF-8 encoded characters.
  11829. </p>
  11830. <p>This parameter is mandatory if no text string is specified with the
  11831. parameter <var>text</var>.
  11832. </p>
  11833. <p>If both <var>text</var> and <var>textfile</var> are specified, an error is thrown.
  11834. </p>
  11835. </dd>
  11836. <dt>&lsquo;<samp>reload</samp>&rsquo;</dt>
  11837. <dd><p>If set to 1, the <var>textfile</var> will be reloaded before each frame.
  11838. Be sure to update it atomically, or it may be read partially, or even fail.
  11839. </p>
  11840. </dd>
  11841. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  11842. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  11843. <dd><p>The expressions which specify the offsets where text will be drawn
  11844. within the video frame. They are relative to the top/left border of the
  11845. output image.
  11846. </p>
  11847. <p>The default value of <var>x</var> and <var>y</var> is &quot;0&quot;.
  11848. </p>
  11849. <p>See below for the list of accepted constants and functions.
  11850. </p></dd>
  11851. </dl>
  11852. <p>The parameters for <var>x</var> and <var>y</var> are expressions containing the
  11853. following constants and functions:
  11854. </p>
  11855. <dl compact="compact">
  11856. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  11857. <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
  11858. </p>
  11859. </dd>
  11860. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  11861. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  11862. <dd><p>horizontal and vertical chroma subsample values. For example for the
  11863. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  11864. </p>
  11865. </dd>
  11866. <dt>&lsquo;<samp>line_h, lh</samp>&rsquo;</dt>
  11867. <dd><p>the height of each text line
  11868. </p>
  11869. </dd>
  11870. <dt>&lsquo;<samp>main_h, h, H</samp>&rsquo;</dt>
  11871. <dd><p>the input height
  11872. </p>
  11873. </dd>
  11874. <dt>&lsquo;<samp>main_w, w, W</samp>&rsquo;</dt>
  11875. <dd><p>the input width
  11876. </p>
  11877. </dd>
  11878. <dt>&lsquo;<samp>max_glyph_a, ascent</samp>&rsquo;</dt>
  11879. <dd><p>the maximum distance from the baseline to the highest/upper grid
  11880. coordinate used to place a glyph outline point, for all the rendered
  11881. glyphs.
  11882. It is a positive value, due to the grid&rsquo;s orientation with the Y axis
  11883. upwards.
  11884. </p>
  11885. </dd>
  11886. <dt>&lsquo;<samp>max_glyph_d, descent</samp>&rsquo;</dt>
  11887. <dd><p>the maximum distance from the baseline to the lowest grid coordinate
  11888. used to place a glyph outline point, for all the rendered glyphs.
  11889. This is a negative value, due to the grid&rsquo;s orientation, with the Y axis
  11890. upwards.
  11891. </p>
  11892. </dd>
  11893. <dt>&lsquo;<samp>max_glyph_h</samp>&rsquo;</dt>
  11894. <dd><p>maximum glyph height, that is the maximum height for all the glyphs
  11895. contained in the rendered text, it is equivalent to <var>ascent</var> -
  11896. <var>descent</var>.
  11897. </p>
  11898. </dd>
  11899. <dt>&lsquo;<samp>max_glyph_w</samp>&rsquo;</dt>
  11900. <dd><p>maximum glyph width, that is the maximum width for all the glyphs
  11901. contained in the rendered text
  11902. </p>
  11903. </dd>
  11904. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  11905. <dd><p>the number of input frame, starting from 0
  11906. </p>
  11907. </dd>
  11908. <dt>&lsquo;<samp>rand(min, max)</samp>&rsquo;</dt>
  11909. <dd><p>return a random number included between <var>min</var> and <var>max</var>
  11910. </p>
  11911. </dd>
  11912. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  11913. <dd><p>The input sample aspect ratio.
  11914. </p>
  11915. </dd>
  11916. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  11917. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  11918. </p>
  11919. </dd>
  11920. <dt>&lsquo;<samp>text_h, th</samp>&rsquo;</dt>
  11921. <dd><p>the height of the rendered text
  11922. </p>
  11923. </dd>
  11924. <dt>&lsquo;<samp>text_w, tw</samp>&rsquo;</dt>
  11925. <dd><p>the width of the rendered text
  11926. </p>
  11927. </dd>
  11928. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  11929. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  11930. <dd><p>the x and y offset coordinates where the text is drawn.
  11931. </p>
  11932. <p>These parameters allow the <var>x</var> and <var>y</var> expressions to refer
  11933. to each other, so you can for example specify <code>y=x/dar</code>.
  11934. </p>
  11935. </dd>
  11936. <dt>&lsquo;<samp>pict_type</samp>&rsquo;</dt>
  11937. <dd><p>A one character description of the current frame&rsquo;s picture type.
  11938. </p>
  11939. </dd>
  11940. <dt>&lsquo;<samp>pkt_pos</samp>&rsquo;</dt>
  11941. <dd><p>The current packet&rsquo;s position in the input file or stream
  11942. (in bytes, from the start of the input). A value of -1 indicates
  11943. this info is not available.
  11944. </p>
  11945. </dd>
  11946. <dt>&lsquo;<samp>pkt_duration</samp>&rsquo;</dt>
  11947. <dd><p>The current packet&rsquo;s duration, in seconds.
  11948. </p>
  11949. </dd>
  11950. <dt>&lsquo;<samp>pkt_size</samp>&rsquo;</dt>
  11951. <dd><p>The current packet&rsquo;s size (in bytes).
  11952. </p></dd>
  11953. </dl>
  11954. <p><a name="drawtext_005fexpansion"></a>
  11955. </p><a name="Text-expansion"></a>
  11956. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Text-expansion">11.61.2 Text expansion</a></h3>
  11957. <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>strftime</code>,
  11958. the filter recognizes strftime() sequences in the provided text and
  11959. expands them accordingly. Check the documentation of strftime(). This
  11960. feature is deprecated.
  11961. </p>
  11962. <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>none</code>, the text is printed verbatim.
  11963. </p>
  11964. <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>normal</code> (which is the default),
  11965. the following expansion mechanism is used.
  11966. </p>
  11967. <p>The backslash character &lsquo;<samp>\</samp>&rsquo;, followed by any character, always expands to
  11968. the second character.
  11969. </p>
  11970. <p>Sequences of the form <code>%{...}</code> are expanded. The text between the
  11971. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  11972. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  11973. they should be escaped.
  11974. </p>
  11975. <p>Note that they probably must also be escaped as the value for the
  11976. &lsquo;<samp>text</samp>&rsquo; option in the filter argument string and as the filter
  11977. argument in the filtergraph description, and possibly also for the shell,
  11978. that makes up to four levels of escaping; using a text file avoids these
  11979. problems.
  11980. </p>
  11981. <p>The following functions are available:
  11982. </p>
  11983. <dl compact="compact">
  11984. <dt><code>expr, e</code></dt>
  11985. <dd><p>The expression evaluation result.
  11986. </p>
  11987. <p>It must take one argument specifying the expression to be evaluated,
  11988. which accepts the same constants and functions as the <var>x</var> and
  11989. <var>y</var> values. Note that not all constants should be used, for
  11990. example the text size is not known when evaluating the expression, so
  11991. the constants <var>text_w</var> and <var>text_h</var> will have an undefined
  11992. value.
  11993. </p>
  11994. </dd>
  11995. <dt><code>expr_int_format, eif</code></dt>
  11996. <dd><p>Evaluate the expression&rsquo;s value and output as formatted integer.
  11997. </p>
  11998. <p>The first argument is the expression to be evaluated, just as for the <var>expr</var> function.
  11999. The second argument specifies the output format. Allowed values are &lsquo;<samp>x</samp>&rsquo;,
  12000. &lsquo;<samp>X</samp>&rsquo;, &lsquo;<samp>d</samp>&rsquo; and &lsquo;<samp>u</samp>&rsquo;. They are treated exactly as in the
  12001. <code>printf</code> function.
  12002. The third parameter is optional and sets the number of positions taken by the output.
  12003. It can be used to add padding with zeros from the left.
  12004. </p>
  12005. </dd>
  12006. <dt><code>gmtime</code></dt>
  12007. <dd><p>The time at which the filter is running, expressed in UTC.
  12008. It can accept an argument: a strftime() format string.
  12009. </p>
  12010. </dd>
  12011. <dt><code>localtime</code></dt>
  12012. <dd><p>The time at which the filter is running, expressed in the local time zone.
  12013. It can accept an argument: a strftime() format string.
  12014. </p>
  12015. </dd>
  12016. <dt><code>metadata</code></dt>
  12017. <dd><p>Frame metadata. Takes one or two arguments.
  12018. </p>
  12019. <p>The first argument is mandatory and specifies the metadata key.
  12020. </p>
  12021. <p>The second argument is optional and specifies a default value, used when the
  12022. metadata key is not found or empty.
  12023. </p>
  12024. <p>Available metadata can be identified by inspecting entries
  12025. starting with TAG included within each frame section
  12026. printed by running <code>ffprobe -show_frames</code>.
  12027. </p>
  12028. <p>String metadata generated in filters leading to
  12029. the drawtext filter are also available.
  12030. </p>
  12031. </dd>
  12032. <dt><code>n, frame_num</code></dt>
  12033. <dd><p>The frame number, starting from 0.
  12034. </p>
  12035. </dd>
  12036. <dt><code>pict_type</code></dt>
  12037. <dd><p>A one character description of the current picture type.
  12038. </p>
  12039. </dd>
  12040. <dt><code>pts</code></dt>
  12041. <dd><p>The timestamp of the current frame.
  12042. It can take up to three arguments.
  12043. </p>
  12044. <p>The first argument is the format of the timestamp; it defaults to <code>flt</code>
  12045. for seconds as a decimal number with microsecond accuracy; <code>hms</code> stands
  12046. for a formatted <var>[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  12047. <code>gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  12048. <code>localtime</code> stands for the timestamp of the frame formatted as
  12049. local time zone time.
  12050. </p>
  12051. <p>The second argument is an offset added to the timestamp.
  12052. </p>
  12053. <p>If the format is set to <code>hms</code>, a third argument <code>24HH</code> may be
  12054. supplied to present the hour part of the formatted timestamp in 24h format
  12055. (00-23).
  12056. </p>
  12057. <p>If the format is set to <code>localtime</code> or <code>gmtime</code>,
  12058. a third argument may be supplied: a strftime() format string.
  12059. By default, <var>YYYY-MM-DD HH:MM:SS</var> format will be used.
  12060. </p></dd>
  12061. </dl>
  12062. <a name="Commands-16"></a>
  12063. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-16">11.61.3 Commands</a></h3>
  12064. <p>This filter supports altering parameters via commands:
  12065. </p><dl compact="compact">
  12066. <dt>&lsquo;<samp>reinit</samp>&rsquo;</dt>
  12067. <dd><p>Alter existing filter parameters.
  12068. </p>
  12069. <p>Syntax for the argument is the same as for filter invocation, e.g.
  12070. </p>
  12071. <div class="example">
  12072. <pre class="example">fontsize=56:fontcolor=green:text='Hello World'
  12073. </pre></div>
  12074. <p>Full filter invocation with sendcmd would look like this:
  12075. </p>
  12076. <div class="example">
  12077. <pre class="example">sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
  12078. </pre></div>
  12079. </dd>
  12080. </dl>
  12081. <p>If the entire argument can&rsquo;t be parsed or applied as valid values then the filter will
  12082. continue with its existing parameters.
  12083. </p>
  12084. <a name="Examples-46"></a>
  12085. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-46">11.61.4 Examples</a></h3>
  12086. <ul>
  12087. <li>
  12088. Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
  12089. optional parameters.
  12090. <div class="example">
  12091. <pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
  12092. </pre></div>
  12093. </li><li>
  12094. Draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
  12095. and y=50 (counting from the top-left corner of the screen), text is
  12096. yellow with a red box around it. Both the text and the box have an
  12097. opacity of 20%.
  12098. <div class="example">
  12099. <pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
  12100. x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
  12101. </pre></div>
  12102. <p>Note that the double quotes are not necessary if spaces are not used
  12103. within the parameter list.
  12104. </p>
  12105. </li><li>
  12106. Show the text at the center of the video frame:
  12107. <div class="example">
  12108. <pre class="example">drawtext=&quot;fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2&quot;
  12109. </pre></div>
  12110. </li><li>
  12111. Show the text at a random position, switching to a new position every 30 seconds:
  12112. <div class="example">
  12113. <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;
  12114. </pre></div>
  12115. </li><li>
  12116. Show a text line sliding from right to left in the last row of the video
  12117. frame. The file &lsquo;<tt>LONG_LINE</tt>&rsquo; is assumed to contain a single line
  12118. with no newlines.
  12119. <div class="example">
  12120. <pre class="example">drawtext=&quot;fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t&quot;
  12121. </pre></div>
  12122. </li><li>
  12123. Show the content of file &lsquo;<tt>CREDITS</tt>&rsquo; off the bottom of the frame and scroll up.
  12124. <div class="example">
  12125. <pre class="example">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
  12126. </pre></div>
  12127. </li><li>
  12128. Draw a single green letter &quot;g&quot;, at the center of the input video.
  12129. The glyph baseline is placed at half screen height.
  12130. <div class="example">
  12131. <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;
  12132. </pre></div>
  12133. </li><li>
  12134. Show text for 1 second every 3 seconds:
  12135. <div class="example">
  12136. <pre class="example">drawtext=&quot;fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'&quot;
  12137. </pre></div>
  12138. </li><li>
  12139. Use fontconfig to set the font. Note that the colons need to be escaped.
  12140. <div class="example">
  12141. <pre class="example">drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
  12142. </pre></div>
  12143. </li><li>
  12144. Print the date of a real-time encoding (see strftime(3)):
  12145. <div class="example">
  12146. <pre class="example">drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
  12147. </pre></div>
  12148. </li><li>
  12149. Show text fading in and out (appearing/disappearing):
  12150. <div class="example">
  12151. <pre class="example">#!/bin/sh
  12152. DS=1.0 # display start
  12153. DE=10.0 # display end
  12154. FID=1.5 # fade in duration
  12155. FOD=5 # fade out duration
  12156. 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;
  12157. </pre></div>
  12158. </li><li>
  12159. Horizontally align multiple separate texts. Note that &lsquo;<samp>max_glyph_a</samp>&rsquo;
  12160. and the &lsquo;<samp>fontsize</samp>&rsquo; value are included in the &lsquo;<samp>y</samp>&rsquo; offset.
  12161. <div class="example">
  12162. <pre class="example">drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
  12163. drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
  12164. </pre></div>
  12165. </li><li>
  12166. Plot special <var>lavf.image2dec.source_basename</var> metadata onto each frame if
  12167. such metadata exists. Otherwise, plot the string &quot;NA&quot;. Note that image2 demuxer
  12168. must have option &lsquo;<samp>-export_path_metadata 1</samp>&rsquo; for the special metadata fields
  12169. to be available for filters.
  12170. <div class="example">
  12171. <pre class="example">drawtext=&quot;fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=10:y=10&quot;
  12172. </pre></div>
  12173. </li></ul>
  12174. <p>For more information about libfreetype, check:
  12175. <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
  12176. </p>
  12177. <p>For more information about fontconfig, check:
  12178. <a href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
  12179. </p>
  12180. <p>For more information about libfribidi, check:
  12181. <a href="http://fribidi.org/">http://fribidi.org/</a>.
  12182. </p>
  12183. <a name="edgedetect"></a>
  12184. <h2 class="section"><a href="ffmpeg-filters.html#toc-edgedetect">11.62 edgedetect</a></h2>
  12185. <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
  12186. </p>
  12187. <p>The filter accepts the following options:
  12188. </p>
  12189. <dl compact="compact">
  12190. <dt>&lsquo;<samp>low</samp>&rsquo;</dt>
  12191. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  12192. <dd><p>Set low and high threshold values used by the Canny thresholding
  12193. algorithm.
  12194. </p>
  12195. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  12196. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  12197. by the low threshold.
  12198. </p>
  12199. <p><var>low</var> and <var>high</var> threshold values must be chosen in the range
  12200. [0,1], and <var>low</var> should be lesser or equal to <var>high</var>.
  12201. </p>
  12202. <p>Default value for <var>low</var> is <code>20/255</code>, and default value for <var>high</var>
  12203. is <code>50/255</code>.
  12204. </p>
  12205. </dd>
  12206. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  12207. <dd><p>Define the drawing mode.
  12208. </p>
  12209. <dl compact="compact">
  12210. <dt>&lsquo;<samp>wires</samp>&rsquo;</dt>
  12211. <dd><p>Draw white/gray wires on black background.
  12212. </p>
  12213. </dd>
  12214. <dt>&lsquo;<samp>colormix</samp>&rsquo;</dt>
  12215. <dd><p>Mix the colors to create a paint/cartoon effect.
  12216. </p>
  12217. </dd>
  12218. <dt>&lsquo;<samp>canny</samp>&rsquo;</dt>
  12219. <dd><p>Apply Canny edge detector on all selected planes.
  12220. </p></dd>
  12221. </dl>
  12222. <p>Default value is <var>wires</var>.
  12223. </p>
  12224. </dd>
  12225. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  12226. <dd><p>Select planes for filtering. By default all available planes are filtered.
  12227. </p></dd>
  12228. </dl>
  12229. <a name="Examples-100"></a>
  12230. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-100">11.62.1 Examples</a></h3>
  12231. <ul>
  12232. <li>
  12233. Standard edge detection with custom values for the hysteresis thresholding:
  12234. <div class="example">
  12235. <pre class="example">edgedetect=low=0.1:high=0.4
  12236. </pre></div>
  12237. </li><li>
  12238. Painting effect without thresholding:
  12239. <div class="example">
  12240. <pre class="example">edgedetect=mode=colormix:high=0
  12241. </pre></div>
  12242. </li></ul>
  12243. <a name="elbg"></a>
  12244. <h2 class="section"><a href="ffmpeg-filters.html#toc-elbg">11.63 elbg</a></h2>
  12245. <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
  12246. </p>
  12247. <p>For each input image, the filter will compute the optimal mapping from
  12248. the input to the output given the codebook length, that is the number
  12249. of distinct output colors.
  12250. </p>
  12251. <p>This filter accepts the following options.
  12252. </p>
  12253. <dl compact="compact">
  12254. <dt>&lsquo;<samp>codebook_length, l</samp>&rsquo;</dt>
  12255. <dd><p>Set codebook length. The value must be a positive integer, and
  12256. represents the number of distinct output colors. Default value is 256.
  12257. </p>
  12258. </dd>
  12259. <dt>&lsquo;<samp>nb_steps, n</samp>&rsquo;</dt>
  12260. <dd><p>Set the maximum number of iterations to apply for computing the optimal
  12261. mapping. The higher the value the better the result and the higher the
  12262. computation time. Default value is 1.
  12263. </p>
  12264. </dd>
  12265. <dt>&lsquo;<samp>seed, s</samp>&rsquo;</dt>
  12266. <dd><p>Set a random seed, must be an integer included between 0 and
  12267. UINT32_MAX. If not specified, or if explicitly set to -1, the filter
  12268. will try to use a good random seed on a best effort basis.
  12269. </p>
  12270. </dd>
  12271. <dt>&lsquo;<samp>pal8</samp>&rsquo;</dt>
  12272. <dd><p>Set pal8 output pixel format. This option does not work with codebook
  12273. length greater than 256.
  12274. </p></dd>
  12275. </dl>
  12276. <a name="entropy"></a>
  12277. <h2 class="section"><a href="ffmpeg-filters.html#toc-entropy">11.64 entropy</a></h2>
  12278. <p>Measure graylevel entropy in histogram of color channels of video frames.
  12279. </p>
  12280. <p>It accepts the following parameters:
  12281. </p>
  12282. <dl compact="compact">
  12283. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  12284. <dd><p>Can be either <var>normal</var> or <var>diff</var>. Default is <var>normal</var>.
  12285. </p>
  12286. <p><var>diff</var> mode measures entropy of histogram delta values, absolute differences
  12287. between neighbour histogram values.
  12288. </p></dd>
  12289. </dl>
  12290. <a name="eq"></a>
  12291. <h2 class="section"><a href="ffmpeg-filters.html#toc-eq">11.65 eq</a></h2>
  12292. <p>Set brightness, contrast, saturation and approximate gamma adjustment.
  12293. </p>
  12294. <p>The filter accepts the following options:
  12295. </p>
  12296. <dl compact="compact">
  12297. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  12298. <dd><p>Set the contrast expression. The value must be a float value in range
  12299. <code>-1000.0</code> to <code>1000.0</code>. The default value is &quot;1&quot;.
  12300. </p>
  12301. </dd>
  12302. <dt>&lsquo;<samp>brightness</samp>&rsquo;</dt>
  12303. <dd><p>Set the brightness expression. The value must be a float value in
  12304. range <code>-1.0</code> to <code>1.0</code>. The default value is &quot;0&quot;.
  12305. </p>
  12306. </dd>
  12307. <dt>&lsquo;<samp>saturation</samp>&rsquo;</dt>
  12308. <dd><p>Set the saturation expression. The value must be a float in
  12309. range <code>0.0</code> to <code>3.0</code>. The default value is &quot;1&quot;.
  12310. </p>
  12311. </dd>
  12312. <dt>&lsquo;<samp>gamma</samp>&rsquo;</dt>
  12313. <dd><p>Set the gamma expression. The value must be a float in range
  12314. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  12315. </p>
  12316. </dd>
  12317. <dt>&lsquo;<samp>gamma_r</samp>&rsquo;</dt>
  12318. <dd><p>Set the gamma expression for red. The value must be a float in
  12319. range <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  12320. </p>
  12321. </dd>
  12322. <dt>&lsquo;<samp>gamma_g</samp>&rsquo;</dt>
  12323. <dd><p>Set the gamma expression for green. The value must be a float in range
  12324. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  12325. </p>
  12326. </dd>
  12327. <dt>&lsquo;<samp>gamma_b</samp>&rsquo;</dt>
  12328. <dd><p>Set the gamma expression for blue. The value must be a float in range
  12329. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  12330. </p>
  12331. </dd>
  12332. <dt>&lsquo;<samp>gamma_weight</samp>&rsquo;</dt>
  12333. <dd><p>Set the gamma weight expression. It can be used to reduce the effect
  12334. of a high gamma value on bright image areas, e.g. keep them from
  12335. getting overamplified and just plain white. The value must be a float
  12336. in range <code>0.0</code> to <code>1.0</code>. A value of <code>0.0</code> turns the
  12337. gamma correction all the way down while <code>1.0</code> leaves it at its
  12338. full strength. Default is &quot;1&quot;.
  12339. </p>
  12340. </dd>
  12341. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  12342. <dd><p>Set when the expressions for brightness, contrast, saturation and
  12343. gamma expressions are evaluated.
  12344. </p>
  12345. <p>It accepts the following values:
  12346. </p><dl compact="compact">
  12347. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  12348. <dd><p>only evaluate expressions once during the filter initialization or
  12349. when a command is processed
  12350. </p>
  12351. </dd>
  12352. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  12353. <dd><p>evaluate expressions for each incoming frame
  12354. </p></dd>
  12355. </dl>
  12356. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  12357. </p></dd>
  12358. </dl>
  12359. <p>The expressions accept the following parameters:
  12360. </p><dl compact="compact">
  12361. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  12362. <dd><p>frame count of the input frame starting from 0
  12363. </p>
  12364. </dd>
  12365. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  12366. <dd><p>byte position of the corresponding packet in the input file, NAN if
  12367. unspecified
  12368. </p>
  12369. </dd>
  12370. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  12371. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  12372. </p>
  12373. </dd>
  12374. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  12375. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  12376. </p></dd>
  12377. </dl>
  12378. <a name="Commands-41"></a>
  12379. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-41">11.65.1 Commands</a></h3>
  12380. <p>The filter supports the following commands:
  12381. </p>
  12382. <dl compact="compact">
  12383. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  12384. <dd><p>Set the contrast expression.
  12385. </p>
  12386. </dd>
  12387. <dt>&lsquo;<samp>brightness</samp>&rsquo;</dt>
  12388. <dd><p>Set the brightness expression.
  12389. </p>
  12390. </dd>
  12391. <dt>&lsquo;<samp>saturation</samp>&rsquo;</dt>
  12392. <dd><p>Set the saturation expression.
  12393. </p>
  12394. </dd>
  12395. <dt>&lsquo;<samp>gamma</samp>&rsquo;</dt>
  12396. <dd><p>Set the gamma expression.
  12397. </p>
  12398. </dd>
  12399. <dt>&lsquo;<samp>gamma_r</samp>&rsquo;</dt>
  12400. <dd><p>Set the gamma_r expression.
  12401. </p>
  12402. </dd>
  12403. <dt>&lsquo;<samp>gamma_g</samp>&rsquo;</dt>
  12404. <dd><p>Set gamma_g expression.
  12405. </p>
  12406. </dd>
  12407. <dt>&lsquo;<samp>gamma_b</samp>&rsquo;</dt>
  12408. <dd><p>Set gamma_b expression.
  12409. </p>
  12410. </dd>
  12411. <dt>&lsquo;<samp>gamma_weight</samp>&rsquo;</dt>
  12412. <dd><p>Set gamma_weight expression.
  12413. </p>
  12414. <p>The command accepts the same syntax of the corresponding option.
  12415. </p>
  12416. <p>If the specified expression is not valid, it is kept at its current
  12417. value.
  12418. </p>
  12419. </dd>
  12420. </dl>
  12421. <a name="erosion"></a>
  12422. <h2 class="section"><a href="ffmpeg-filters.html#toc-erosion">11.66 erosion</a></h2>
  12423. <p>Apply erosion effect to the video.
  12424. </p>
  12425. <p>This filter replaces the pixel by the local(3x3) minimum.
  12426. </p>
  12427. <p>It accepts the following options:
  12428. </p>
  12429. <dl compact="compact">
  12430. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  12431. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  12432. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  12433. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  12434. <dd><p>Limit the maximum change for each plane, default is 65535.
  12435. If 0, plane will remain unchanged.
  12436. </p>
  12437. </dd>
  12438. <dt>&lsquo;<samp>coordinates</samp>&rsquo;</dt>
  12439. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  12440. pixels are used.
  12441. </p>
  12442. <p>Flags to local 3x3 coordinates maps like this:
  12443. </p>
  12444. <p> 1 2 3
  12445. 4 5
  12446. 6 7 8
  12447. </p></dd>
  12448. </dl>
  12449. <a name="Commands-28"></a>
  12450. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-28">11.66.1 Commands</a></h3>
  12451. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  12452. </p>
  12453. <a name="extractplanes"></a>
  12454. <h2 class="section"><a href="ffmpeg-filters.html#toc-extractplanes">11.67 extractplanes</a></h2>
  12455. <p>Extract color channel components from input video stream into
  12456. separate grayscale video streams.
  12457. </p>
  12458. <p>The filter accepts the following option:
  12459. </p>
  12460. <dl compact="compact">
  12461. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  12462. <dd><p>Set plane(s) to extract.
  12463. </p>
  12464. <p>Available values for planes are:
  12465. </p><dl compact="compact">
  12466. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  12467. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  12468. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  12469. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  12470. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  12471. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  12472. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  12473. </dl>
  12474. <p>Choosing planes not available in the input will result in an error.
  12475. That means you cannot select <code>r</code>, <code>g</code>, <code>b</code> planes
  12476. with <code>y</code>, <code>u</code>, <code>v</code> planes at same time.
  12477. </p></dd>
  12478. </dl>
  12479. <a name="Examples-32"></a>
  12480. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-32">11.67.1 Examples</a></h3>
  12481. <ul>
  12482. <li>
  12483. Extract luma, u and v color channel component from input video frame
  12484. into 3 grayscale outputs:
  12485. <div class="example">
  12486. <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
  12487. </pre></div>
  12488. </li></ul>
  12489. <a name="fade"></a>
  12490. <h2 class="section"><a href="ffmpeg-filters.html#toc-fade">11.68 fade</a></h2>
  12491. <p>Apply a fade-in/out effect to the input video.
  12492. </p>
  12493. <p>It accepts the following parameters:
  12494. </p>
  12495. <dl compact="compact">
  12496. <dt>&lsquo;<samp>type, t</samp>&rsquo;</dt>
  12497. <dd><p>The effect type can be either &quot;in&quot; for a fade-in, or &quot;out&quot; for a fade-out
  12498. effect.
  12499. Default is <code>in</code>.
  12500. </p>
  12501. </dd>
  12502. <dt>&lsquo;<samp>start_frame, s</samp>&rsquo;</dt>
  12503. <dd><p>Specify the number of the frame to start applying the fade
  12504. effect at. Default is 0.
  12505. </p>
  12506. </dd>
  12507. <dt>&lsquo;<samp>nb_frames, n</samp>&rsquo;</dt>
  12508. <dd><p>The number of frames that the fade effect lasts. At the end of the
  12509. fade-in effect, the output video will have the same intensity as the input video.
  12510. At the end of the fade-out transition, the output video will be filled with the
  12511. selected &lsquo;<samp>color</samp>&rsquo;.
  12512. Default is 25.
  12513. </p>
  12514. </dd>
  12515. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  12516. <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
  12517. Default value is 0.
  12518. </p>
  12519. </dd>
  12520. <dt>&lsquo;<samp>start_time, st</samp>&rsquo;</dt>
  12521. <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
  12522. effect. If both start_frame and start_time are specified, the fade will start at
  12523. whichever comes last. Default is 0.
  12524. </p>
  12525. </dd>
  12526. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  12527. <dd><p>The number of seconds for which the fade effect has to last. At the end of the
  12528. fade-in effect the output video will have the same intensity as the input video,
  12529. at the end of the fade-out transition the output video will be filled with the
  12530. selected &lsquo;<samp>color</samp>&rsquo;.
  12531. If both duration and nb_frames are specified, duration is used. Default is 0
  12532. (nb_frames is used by default).
  12533. </p>
  12534. </dd>
  12535. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  12536. <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
  12537. </p></dd>
  12538. </dl>
  12539. <a name="Examples-33"></a>
  12540. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-33">11.68.1 Examples</a></h3>
  12541. <ul>
  12542. <li>
  12543. Fade in the first 30 frames of video:
  12544. <div class="example">
  12545. <pre class="example">fade=in:0:30
  12546. </pre></div>
  12547. <p>The command above is equivalent to:
  12548. </p><div class="example">
  12549. <pre class="example">fade=t=in:s=0:n=30
  12550. </pre></div>
  12551. </li><li>
  12552. Fade out the last 45 frames of a 200-frame video:
  12553. <div class="example">
  12554. <pre class="example">fade=out:155:45
  12555. fade=type=out:start_frame=155:nb_frames=45
  12556. </pre></div>
  12557. </li><li>
  12558. Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video:
  12559. <div class="example">
  12560. <pre class="example">fade=in:0:25, fade=out:975:25
  12561. </pre></div>
  12562. </li><li>
  12563. Make the first 5 frames yellow, then fade in from frame 5-24:
  12564. <div class="example">
  12565. <pre class="example">fade=in:5:20:color=yellow
  12566. </pre></div>
  12567. </li><li>
  12568. Fade in alpha over first 25 frames of video:
  12569. <div class="example">
  12570. <pre class="example">fade=in:0:25:alpha=1
  12571. </pre></div>
  12572. </li><li>
  12573. Make the first 5.5 seconds black, then fade in for 0.5 seconds:
  12574. <div class="example">
  12575. <pre class="example">fade=t=in:st=5.5:d=0.5
  12576. </pre></div>
  12577. </li></ul>
  12578. <a name="fftdnoiz"></a>
  12579. <h2 class="section"><a href="ffmpeg-filters.html#toc-fftdnoiz">11.69 fftdnoiz</a></h2>
  12580. <p>Denoise frames using 3D FFT (frequency domain filtering).
  12581. </p>
  12582. <p>The filter accepts the following options:
  12583. </p>
  12584. <dl compact="compact">
  12585. <dt>&lsquo;<samp>sigma</samp>&rsquo;</dt>
  12586. <dd><p>Set the noise sigma constant. This sets denoising strength.
  12587. Default value is 1. Allowed range is from 0 to 30.
  12588. Using very high sigma with low overlap may give blocking artifacts.
  12589. </p>
  12590. </dd>
  12591. <dt>&lsquo;<samp>amount</samp>&rsquo;</dt>
  12592. <dd><p>Set amount of denoising. By default all detected noise is reduced.
  12593. Default value is 1. Allowed range is from 0 to 1.
  12594. </p>
  12595. </dd>
  12596. <dt>&lsquo;<samp>block</samp>&rsquo;</dt>
  12597. <dd><p>Set size of block, Default is 4, can be 3, 4, 5 or 6.
  12598. Actual size of block in pixels is 2 to power of <var>block</var>, so by default
  12599. block size in pixels is 2^4 which is 16.
  12600. </p>
  12601. </dd>
  12602. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  12603. <dd><p>Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8.
  12604. </p>
  12605. </dd>
  12606. <dt>&lsquo;<samp>prev</samp>&rsquo;</dt>
  12607. <dd><p>Set number of previous frames to use for denoising. By default is set to 0.
  12608. </p>
  12609. </dd>
  12610. <dt>&lsquo;<samp>next</samp>&rsquo;</dt>
  12611. <dd><p>Set number of next frames to to use for denoising. By default is set to 0.
  12612. </p>
  12613. </dd>
  12614. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  12615. <dd><p>Set planes which will be filtered, by default are all available filtered
  12616. except alpha.
  12617. </p></dd>
  12618. </dl>
  12619. <a name="fftfilt"></a>
  12620. <h2 class="section"><a href="ffmpeg-filters.html#toc-fftfilt">11.70 fftfilt</a></h2>
  12621. <p>Apply arbitrary expressions to samples in frequency domain
  12622. </p>
  12623. <dl compact="compact">
  12624. <dt>&lsquo;<samp>dc_Y</samp>&rsquo;</dt>
  12625. <dd><p>Adjust the dc value (gain) of the luma plane of the image. The filter
  12626. accepts an integer value in range <code>0</code> to <code>1000</code>. The default
  12627. value is set to <code>0</code>.
  12628. </p>
  12629. </dd>
  12630. <dt>&lsquo;<samp>dc_U</samp>&rsquo;</dt>
  12631. <dd><p>Adjust the dc value (gain) of the 1st chroma plane of the image. The
  12632. filter accepts an integer value in range <code>0</code> to <code>1000</code>. The
  12633. default value is set to <code>0</code>.
  12634. </p>
  12635. </dd>
  12636. <dt>&lsquo;<samp>dc_V</samp>&rsquo;</dt>
  12637. <dd><p>Adjust the dc value (gain) of the 2nd chroma plane of the image. The
  12638. filter accepts an integer value in range <code>0</code> to <code>1000</code>. The
  12639. default value is set to <code>0</code>.
  12640. </p>
  12641. </dd>
  12642. <dt>&lsquo;<samp>weight_Y</samp>&rsquo;</dt>
  12643. <dd><p>Set the frequency domain weight expression for the luma plane.
  12644. </p>
  12645. </dd>
  12646. <dt>&lsquo;<samp>weight_U</samp>&rsquo;</dt>
  12647. <dd><p>Set the frequency domain weight expression for the 1st chroma plane.
  12648. </p>
  12649. </dd>
  12650. <dt>&lsquo;<samp>weight_V</samp>&rsquo;</dt>
  12651. <dd><p>Set the frequency domain weight expression for the 2nd chroma plane.
  12652. </p>
  12653. </dd>
  12654. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  12655. <dd><p>Set when the expressions are evaluated.
  12656. </p>
  12657. <p>It accepts the following values:
  12658. </p><dl compact="compact">
  12659. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  12660. <dd><p>Only evaluate expressions once during the filter initialization.
  12661. </p>
  12662. </dd>
  12663. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  12664. <dd><p>Evaluate expressions for each incoming frame.
  12665. </p></dd>
  12666. </dl>
  12667. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  12668. </p>
  12669. <p>The filter accepts the following variables:
  12670. </p></dd>
  12671. <dt>&lsquo;<samp>X</samp>&rsquo;</dt>
  12672. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  12673. <dd><p>The coordinates of the current sample.
  12674. </p>
  12675. </dd>
  12676. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  12677. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  12678. <dd><p>The width and height of the image.
  12679. </p>
  12680. </dd>
  12681. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  12682. <dd><p>The number of input frame, starting from 0.
  12683. </p></dd>
  12684. </dl>
  12685. <a name="Examples-3"></a>
  12686. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-3">11.70.1 Examples</a></h3>
  12687. <ul>
  12688. <li>
  12689. High-pass:
  12690. <div class="example">
  12691. <pre class="example">fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
  12692. </pre></div>
  12693. </li><li>
  12694. Low-pass:
  12695. <div class="example">
  12696. <pre class="example">fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
  12697. </pre></div>
  12698. </li><li>
  12699. Sharpen:
  12700. <div class="example">
  12701. <pre class="example">fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
  12702. </pre></div>
  12703. </li><li>
  12704. Blur:
  12705. <div class="example">
  12706. <pre class="example">fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
  12707. </pre></div>
  12708. </li></ul>
  12709. <a name="field"></a>
  12710. <h2 class="section"><a href="ffmpeg-filters.html#toc-field">11.71 field</a></h2>
  12711. <p>Extract a single field from an interlaced image using stride
  12712. arithmetic to avoid wasting CPU time. The output frames are marked as
  12713. non-interlaced.
  12714. </p>
  12715. <p>The filter accepts the following options:
  12716. </p>
  12717. <dl compact="compact">
  12718. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  12719. <dd><p>Specify whether to extract the top (if the value is <code>0</code> or
  12720. <code>top</code>) or the bottom field (if the value is <code>1</code> or
  12721. <code>bottom</code>).
  12722. </p></dd>
  12723. </dl>
  12724. <a name="fieldhint"></a>
  12725. <h2 class="section"><a href="ffmpeg-filters.html#toc-fieldhint">11.72 fieldhint</a></h2>
  12726. <p>Create new frames by copying the top and bottom fields from surrounding frames
  12727. supplied as numbers by the hint file.
  12728. </p>
  12729. <dl compact="compact">
  12730. <dt>&lsquo;<samp>hint</samp>&rsquo;</dt>
  12731. <dd><p>Set file containing hints: absolute/relative frame numbers.
  12732. </p>
  12733. <p>There must be one line for each frame in a clip. Each line must contain two
  12734. numbers separated by the comma, optionally followed by <code>-</code> or <code>+</code>.
  12735. Numbers supplied on each line of file can not be out of [N-1,N+1] where N
  12736. is current frame number for <code>absolute</code> mode or out of [-1, 1] range
  12737. for <code>relative</code> mode. First number tells from which frame to pick up top
  12738. field and second number tells from which frame to pick up bottom field.
  12739. </p>
  12740. <p>If optionally followed by <code>+</code> output frame will be marked as interlaced,
  12741. else if followed by <code>-</code> output frame will be marked as progressive, else
  12742. it will be marked same as input frame.
  12743. If optionally followed by <code>t</code> output frame will use only top field, or in
  12744. case of <code>b</code> it will use only bottom field.
  12745. If line starts with <code>#</code> or <code>;</code> that line is skipped.
  12746. </p>
  12747. </dd>
  12748. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  12749. <dd><p>Can be item <code>absolute</code> or <code>relative</code>. Default is <code>absolute</code>.
  12750. </p></dd>
  12751. </dl>
  12752. <p>Example of first several lines of <code>hint</code> file for <code>relative</code> mode:
  12753. </p><div class="example">
  12754. <pre class="example">0,0 - # first frame
  12755. 1,0 - # second frame, use third's frame top field and second's frame bottom field
  12756. 1,0 - # third frame, use fourth's frame top field and third's frame bottom field
  12757. 1,0 -
  12758. 0,0 -
  12759. 0,0 -
  12760. 1,0 -
  12761. 1,0 -
  12762. 1,0 -
  12763. 0,0 -
  12764. 0,0 -
  12765. 1,0 -
  12766. 1,0 -
  12767. 1,0 -
  12768. 0,0 -
  12769. </pre></div>
  12770. <a name="fieldmatch"></a>
  12771. <h2 class="section"><a href="ffmpeg-filters.html#toc-fieldmatch">11.73 fieldmatch</a></h2>
  12772. <p>Field matching filter for inverse telecine. It is meant to reconstruct the
  12773. progressive frames from a telecined stream. The filter does not drop duplicated
  12774. frames, so to achieve a complete inverse telecine <code>fieldmatch</code> needs to be
  12775. followed by a decimation filter such as <a href="#decimate">decimate</a> in the filtergraph.
  12776. </p>
  12777. <p>The separation of the field matching and the decimation is notably motivated by
  12778. the possibility of inserting a de-interlacing filter fallback between the two.
  12779. If the source has mixed telecined and real interlaced content,
  12780. <code>fieldmatch</code> will not be able to match fields for the interlaced parts.
  12781. But these remaining combed frames will be marked as interlaced, and thus can be
  12782. de-interlaced by a later filter such as <a href="#yadif">yadif</a> before decimation.
  12783. </p>
  12784. <p>In addition to the various configuration options, <code>fieldmatch</code> can take an
  12785. optional second stream, activated through the &lsquo;<samp>ppsrc</samp>&rsquo; option. If
  12786. enabled, the frames reconstruction will be based on the fields and frames from
  12787. this second stream. This allows the first input to be pre-processed in order to
  12788. help the various algorithms of the filter, while keeping the output lossless
  12789. (assuming the fields are matched properly). Typically, a field-aware denoiser,
  12790. or brightness/contrast adjustments can help.
  12791. </p>
  12792. <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
  12793. and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
  12794. which <code>fieldmatch</code> is based on. While the semantic and usage are very
  12795. close, some behaviour and options names can differ.
  12796. </p>
  12797. <p>The <a href="#decimate">decimate</a> filter currently only works for constant frame rate input.
  12798. If your input has mixed telecined (30fps) and progressive content with a lower
  12799. framerate like 24fps use the following filterchain to produce the necessary cfr
  12800. stream: <code>dejudder,fps=30000/1001,fieldmatch,decimate</code>.
  12801. </p>
  12802. <p>The filter accepts the following options:
  12803. </p>
  12804. <dl compact="compact">
  12805. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  12806. <dd><p>Specify the assumed field order of the input stream. Available values are:
  12807. </p>
  12808. <dl compact="compact">
  12809. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  12810. <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
  12811. </p></dd>
  12812. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  12813. <dd><p>Assume bottom field first.
  12814. </p></dd>
  12815. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  12816. <dd><p>Assume top field first.
  12817. </p></dd>
  12818. </dl>
  12819. <p>Note that it is sometimes recommended not to trust the parity announced by the
  12820. stream.
  12821. </p>
  12822. <p>Default value is <var>auto</var>.
  12823. </p>
  12824. </dd>
  12825. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  12826. <dd><p>Set the matching mode or strategy to use. &lsquo;<samp>pc</samp>&rsquo; mode is the safest in the
  12827. sense that it won&rsquo;t risk creating jerkiness due to duplicate frames when
  12828. possible, but if there are bad edits or blended fields it will end up
  12829. outputting combed frames when a good match might actually exist. On the other
  12830. hand, &lsquo;<samp>pcn_ub</samp>&rsquo; mode is the most risky in terms of creating jerkiness,
  12831. but will almost always find a good frame if there is one. The other values are
  12832. all somewhere in between &lsquo;<samp>pc</samp>&rsquo; and &lsquo;<samp>pcn_ub</samp>&rsquo; in terms of risking
  12833. jerkiness and creating duplicate frames versus finding good matches in sections
  12834. with bad edits, orphaned fields, blended fields, etc.
  12835. </p>
  12836. <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.
  12837. </p>
  12838. <p>Available values are:
  12839. </p>
  12840. <dl compact="compact">
  12841. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  12842. <dd><p>2-way matching (p/c)
  12843. </p></dd>
  12844. <dt>&lsquo;<samp>pc_n</samp>&rsquo;</dt>
  12845. <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
  12846. </p></dd>
  12847. <dt>&lsquo;<samp>pc_u</samp>&rsquo;</dt>
  12848. <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
  12849. </p></dd>
  12850. <dt>&lsquo;<samp>pc_n_ub</samp>&rsquo;</dt>
  12851. <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
  12852. still combed (p/c + n + u/b)
  12853. </p></dd>
  12854. <dt>&lsquo;<samp>pcn</samp>&rsquo;</dt>
  12855. <dd><p>3-way matching (p/c/n)
  12856. </p></dd>
  12857. <dt>&lsquo;<samp>pcn_ub</samp>&rsquo;</dt>
  12858. <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
  12859. detected as combed (p/c/n + u/b)
  12860. </p></dd>
  12861. </dl>
  12862. <p>The parenthesis at the end indicate the matches that would be used for that
  12863. mode assuming &lsquo;<samp>order</samp>&rsquo;=<var>tff</var> (and &lsquo;<samp>field</samp>&rsquo; on <var>auto</var> or
  12864. <var>top</var>).
  12865. </p>
  12866. <p>In terms of speed &lsquo;<samp>pc</samp>&rsquo; mode is by far the fastest and &lsquo;<samp>pcn_ub</samp>&rsquo; is
  12867. the slowest.
  12868. </p>
  12869. <p>Default value is <var>pc_n</var>.
  12870. </p>
  12871. </dd>
  12872. <dt>&lsquo;<samp>ppsrc</samp>&rsquo;</dt>
  12873. <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
  12874. input stream as the clean source to pick the fields from. See the filter
  12875. introduction for more details. It is similar to the &lsquo;<samp>clip2</samp>&rsquo; feature from
  12876. VFM/TFM.
  12877. </p>
  12878. <p>Default value is <code>0</code> (disabled).
  12879. </p>
  12880. </dd>
  12881. <dt>&lsquo;<samp>field</samp>&rsquo;</dt>
  12882. <dd><p>Set the field to match from. It is recommended to set this to the same value as
  12883. &lsquo;<samp>order</samp>&rsquo; unless you experience matching failures with that setting. In
  12884. certain circumstances changing the field that is used to match from can have a
  12885. large impact on matching performance. Available values are:
  12886. </p>
  12887. <dl compact="compact">
  12888. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  12889. <dd><p>Automatic (same value as &lsquo;<samp>order</samp>&rsquo;).
  12890. </p></dd>
  12891. <dt>&lsquo;<samp>bottom</samp>&rsquo;</dt>
  12892. <dd><p>Match from the bottom field.
  12893. </p></dd>
  12894. <dt>&lsquo;<samp>top</samp>&rsquo;</dt>
  12895. <dd><p>Match from the top field.
  12896. </p></dd>
  12897. </dl>
  12898. <p>Default value is <var>auto</var>.
  12899. </p>
  12900. </dd>
  12901. <dt>&lsquo;<samp>mchroma</samp>&rsquo;</dt>
  12902. <dd><p>Set whether or not chroma is included during the match comparisons. In most
  12903. cases it is recommended to leave this enabled. You should set this to <code>0</code>
  12904. only if your clip has bad chroma problems such as heavy rainbowing or other
  12905. artifacts. Setting this to <code>0</code> could also be used to speed things up at
  12906. the cost of some accuracy.
  12907. </p>
  12908. <p>Default value is <code>1</code>.
  12909. </p>
  12910. </dd>
  12911. <dt>&lsquo;<samp>y0</samp>&rsquo;</dt>
  12912. <dt>&lsquo;<samp>y1</samp>&rsquo;</dt>
  12913. <dd><p>These define an exclusion band which excludes the lines between &lsquo;<samp>y0</samp>&rsquo; and
  12914. &lsquo;<samp>y1</samp>&rsquo; from being included in the field matching decision. An exclusion
  12915. band can be used to ignore subtitles, a logo, or other things that may
  12916. interfere with the matching. &lsquo;<samp>y0</samp>&rsquo; sets the starting scan line and
  12917. &lsquo;<samp>y1</samp>&rsquo; sets the ending line; all lines in between &lsquo;<samp>y0</samp>&rsquo; and
  12918. &lsquo;<samp>y1</samp>&rsquo; (including &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo;) will be ignored. Setting
  12919. &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo; to the same value will disable the feature.
  12920. &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo; defaults to <code>0</code>.
  12921. </p>
  12922. </dd>
  12923. <dt>&lsquo;<samp>scthresh</samp>&rsquo;</dt>
  12924. <dd><p>Set the scene change detection threshold as a percentage of maximum change on
  12925. the luma plane. Good values are in the <code>[8.0, 14.0]</code> range. Scene change
  12926. detection is only relevant in case &lsquo;<samp>combmatch</samp>&rsquo;=<var>sc</var>. The range for
  12927. &lsquo;<samp>scthresh</samp>&rsquo; is <code>[0.0, 100.0]</code>.
  12928. </p>
  12929. <p>Default value is <code>12.0</code>.
  12930. </p>
  12931. </dd>
  12932. <dt>&lsquo;<samp>combmatch</samp>&rsquo;</dt>
  12933. <dd><p>When &lsquo;<samp>combatch</samp>&rsquo; is not <var>none</var>, <code>fieldmatch</code> will take into
  12934. account the combed scores of matches when deciding what match to use as the
  12935. final match. Available values are:
  12936. </p>
  12937. <dl compact="compact">
  12938. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  12939. <dd><p>No final matching based on combed scores.
  12940. </p></dd>
  12941. <dt>&lsquo;<samp>sc</samp>&rsquo;</dt>
  12942. <dd><p>Combed scores are only used when a scene change is detected.
  12943. </p></dd>
  12944. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  12945. <dd><p>Use combed scores all the time.
  12946. </p></dd>
  12947. </dl>
  12948. <p>Default is <var>sc</var>.
  12949. </p>
  12950. </dd>
  12951. <dt>&lsquo;<samp>combdbg</samp>&rsquo;</dt>
  12952. <dd><p>Force <code>fieldmatch</code> to calculate the combed metrics for certain matches and
  12953. print them. This setting is known as &lsquo;<samp>micout</samp>&rsquo; in TFM/VFM vocabulary.
  12954. Available values are:
  12955. </p>
  12956. <dl compact="compact">
  12957. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  12958. <dd><p>No forced calculation.
  12959. </p></dd>
  12960. <dt>&lsquo;<samp>pcn</samp>&rsquo;</dt>
  12961. <dd><p>Force p/c/n calculations.
  12962. </p></dd>
  12963. <dt>&lsquo;<samp>pcnub</samp>&rsquo;</dt>
  12964. <dd><p>Force p/c/n/u/b calculations.
  12965. </p></dd>
  12966. </dl>
  12967. <p>Default value is <var>none</var>.
  12968. </p>
  12969. </dd>
  12970. <dt>&lsquo;<samp>cthresh</samp>&rsquo;</dt>
  12971. <dd><p>This is the area combing threshold used for combed frame detection. This
  12972. essentially controls how &quot;strong&quot; or &quot;visible&quot; combing must be to be detected.
  12973. Larger values mean combing must be more visible and smaller values mean combing
  12974. can be less visible or strong and still be detected. Valid settings are from
  12975. <code>-1</code> (every pixel will be detected as combed) to <code>255</code> (no pixel will
  12976. be detected as combed). This is basically a pixel difference value. A good
  12977. range is <code>[8, 12]</code>.
  12978. </p>
  12979. <p>Default value is <code>9</code>.
  12980. </p>
  12981. </dd>
  12982. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  12983. <dd><p>Sets whether or not chroma is considered in the combed frame decision. Only
  12984. disable this if your source has chroma problems (rainbowing, etc.) that are
  12985. causing problems for the combed frame detection with chroma enabled. Actually,
  12986. using &lsquo;<samp>chroma</samp>&rsquo;=<var>0</var> is usually more reliable, except for the case
  12987. where there is chroma only combing in the source.
  12988. </p>
  12989. <p>Default value is <code>0</code>.
  12990. </p>
  12991. </dd>
  12992. <dt>&lsquo;<samp>blockx</samp>&rsquo;</dt>
  12993. <dt>&lsquo;<samp>blocky</samp>&rsquo;</dt>
  12994. <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
  12995. frame detection. This has to do with the size of the area in which
  12996. &lsquo;<samp>combpel</samp>&rsquo; pixels are required to be detected as combed for a frame to be
  12997. declared combed. See the &lsquo;<samp>combpel</samp>&rsquo; parameter description for more info.
  12998. Possible values are any number that is a power of 2 starting at 4 and going up
  12999. to 512.
  13000. </p>
  13001. <p>Default value is <code>16</code>.
  13002. </p>
  13003. </dd>
  13004. <dt>&lsquo;<samp>combpel</samp>&rsquo;</dt>
  13005. <dd><p>The number of combed pixels inside any of the &lsquo;<samp>blocky</samp>&rsquo; by
  13006. &lsquo;<samp>blockx</samp>&rsquo; size blocks on the frame for the frame to be detected as
  13007. combed. While &lsquo;<samp>cthresh</samp>&rsquo; controls how &quot;visible&quot; the combing must be, this
  13008. setting controls &quot;how much&quot; combing there must be in any localized area (a
  13009. window defined by the &lsquo;<samp>blockx</samp>&rsquo; and &lsquo;<samp>blocky</samp>&rsquo; settings) on the
  13010. frame. Minimum value is <code>0</code> and maximum is <code>blocky x blockx</code> (at
  13011. which point no frames will ever be detected as combed). This setting is known
  13012. as &lsquo;<samp>MI</samp>&rsquo; in TFM/VFM vocabulary.
  13013. </p>
  13014. <p>Default value is <code>80</code>.
  13015. </p></dd>
  13016. </dl>
  13017. <p><a name="p_002fc_002fn_002fu_002fb-meaning"></a>
  13018. </p><a name="p_002fc_002fn_002fu_002fb-meaning-1"></a>
  13019. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-p_002fc_002fn_002fu_002fb-meaning-1">11.73.1 p/c/n/u/b meaning</a></h3>
  13020. <a name="p_002fc_002fn"></a>
  13021. <h4 class="subsubsection"><a href="ffmpeg-filters.html#toc-p_002fc_002fn">11.73.1.1 p/c/n</a></h4>
  13022. <p>We assume the following telecined stream:
  13023. </p>
  13024. <div class="example">
  13025. <pre class="example">Top fields: 1 2 2 3 4
  13026. Bottom fields: 1 2 3 4 4
  13027. </pre></div>
  13028. <p>The numbers correspond to the progressive frame the fields relate to. Here, the
  13029. first two frames are progressive, the 3rd and 4th are combed, and so on.
  13030. </p>
  13031. <p>When <code>fieldmatch</code> is configured to run a matching from bottom
  13032. (&lsquo;<samp>field</samp>&rsquo;=<var>bottom</var>) this is how this input stream get transformed:
  13033. </p>
  13034. <div class="example">
  13035. <pre class="example">Input stream:
  13036. T 1 2 2 3 4
  13037. B 1 2 3 4 4 &lt;-- matching reference
  13038. Matches: c c n n c
  13039. Output stream:
  13040. T 1 2 3 4 4
  13041. B 1 2 3 4 4
  13042. </pre></div>
  13043. <p>As a result of the field matching, we can see that some frames get duplicated.
  13044. To perform a complete inverse telecine, you need to rely on a decimation filter
  13045. after this operation. See for instance the <a href="#decimate">decimate</a> filter.
  13046. </p>
  13047. <p>The same operation now matching from top fields (&lsquo;<samp>field</samp>&rsquo;=<var>top</var>)
  13048. looks like this:
  13049. </p>
  13050. <div class="example">
  13051. <pre class="example">Input stream:
  13052. T 1 2 2 3 4 &lt;-- matching reference
  13053. B 1 2 3 4 4
  13054. Matches: c c p p c
  13055. Output stream:
  13056. T 1 2 2 3 4
  13057. B 1 2 2 3 4
  13058. </pre></div>
  13059. <p>In these examples, we can see what <var>p</var>, <var>c</var> and <var>n</var> mean;
  13060. basically, they refer to the frame and field of the opposite parity:
  13061. </p>
  13062. <ul>
  13063. <li> <var>p</var> matches the field of the opposite parity in the previous frame
  13064. </li><li> <var>c</var> matches the field of the opposite parity in the current frame
  13065. </li><li> <var>n</var> matches the field of the opposite parity in the next frame
  13066. </li></ul>
  13067. <a name="u_002fb"></a>
  13068. <h4 class="subsubsection"><a href="ffmpeg-filters.html#toc-u_002fb">11.73.1.2 u/b</a></h4>
  13069. <p>The <var>u</var> and <var>b</var> matching are a bit special in the sense that they match
  13070. from the opposite parity flag. In the following examples, we assume that we are
  13071. currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
  13072. &rsquo;x&rsquo; is placed above and below each matched fields.
  13073. </p>
  13074. <p>With bottom matching (&lsquo;<samp>field</samp>&rsquo;=<var>bottom</var>):
  13075. </p><div class="example">
  13076. <pre class="example">Match: c p n b u
  13077. x x x x x
  13078. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  13079. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  13080. x x x x x
  13081. Output frames:
  13082. 2 1 2 2 2
  13083. 2 2 2 1 3
  13084. </pre></div>
  13085. <p>With top matching (&lsquo;<samp>field</samp>&rsquo;=<var>top</var>):
  13086. </p><div class="example">
  13087. <pre class="example">Match: c p n b u
  13088. x x x x x
  13089. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  13090. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  13091. x x x x x
  13092. Output frames:
  13093. 2 2 2 1 2
  13094. 2 1 3 2 2
  13095. </pre></div>
  13096. <a name="Examples-16"></a>
  13097. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-16">11.73.2 Examples</a></h3>
  13098. <p>Simple IVTC of a top field first telecined stream:
  13099. </p><div class="example">
  13100. <pre class="example">fieldmatch=order=tff:combmatch=none, decimate
  13101. </pre></div>
  13102. <p>Advanced IVTC, with fallback on <a href="#yadif">yadif</a> for still combed frames:
  13103. </p><div class="example">
  13104. <pre class="example">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
  13105. </pre></div>
  13106. <a name="fieldorder"></a>
  13107. <h2 class="section"><a href="ffmpeg-filters.html#toc-fieldorder">11.74 fieldorder</a></h2>
  13108. <p>Transform the field order of the input video.
  13109. </p>
  13110. <p>It accepts the following parameters:
  13111. </p>
  13112. <dl compact="compact">
  13113. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  13114. <dd><p>The output field order. Valid values are <var>tff</var> for top field first or <var>bff</var>
  13115. for bottom field first.
  13116. </p></dd>
  13117. </dl>
  13118. <p>The default value is &lsquo;<samp>tff</samp>&rsquo;.
  13119. </p>
  13120. <p>The transformation is done by shifting the picture content up or down
  13121. by one line, and filling the remaining line with appropriate picture content.
  13122. This method is consistent with most broadcast field order converters.
  13123. </p>
  13124. <p>If the input video is not flagged as being interlaced, or it is already
  13125. flagged as being of the required output field order, then this filter does
  13126. not alter the incoming video.
  13127. </p>
  13128. <p>It is very useful when converting to or from PAL DV material,
  13129. which is bottom field first.
  13130. </p>
  13131. <p>For example:
  13132. </p><div class="example">
  13133. <pre class="example">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
  13134. </pre></div>
  13135. <a name="fifo_002c-afifo"></a>
  13136. <h2 class="section"><a href="ffmpeg-filters.html#toc-fifo_002c-afifo">11.75 fifo, afifo</a></h2>
  13137. <p>Buffer input images and send them when they are requested.
  13138. </p>
  13139. <p>It is mainly useful when auto-inserted by the libavfilter
  13140. framework.
  13141. </p>
  13142. <p>It does not take parameters.
  13143. </p>
  13144. <a name="fillborders"></a>
  13145. <h2 class="section"><a href="ffmpeg-filters.html#toc-fillborders">11.76 fillborders</a></h2>
  13146. <p>Fill borders of the input video, without changing video stream dimensions.
  13147. Sometimes video can have garbage at the four edges and you may not want to
  13148. crop video input to keep size multiple of some number.
  13149. </p>
  13150. <p>This filter accepts the following options:
  13151. </p>
  13152. <dl compact="compact">
  13153. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  13154. <dd><p>Number of pixels to fill from left border.
  13155. </p>
  13156. </dd>
  13157. <dt>&lsquo;<samp>right</samp>&rsquo;</dt>
  13158. <dd><p>Number of pixels to fill from right border.
  13159. </p>
  13160. </dd>
  13161. <dt>&lsquo;<samp>top</samp>&rsquo;</dt>
  13162. <dd><p>Number of pixels to fill from top border.
  13163. </p>
  13164. </dd>
  13165. <dt>&lsquo;<samp>bottom</samp>&rsquo;</dt>
  13166. <dd><p>Number of pixels to fill from bottom border.
  13167. </p>
  13168. </dd>
  13169. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  13170. <dd><p>Set fill mode.
  13171. </p>
  13172. <p>It accepts the following values:
  13173. </p><dl compact="compact">
  13174. <dt>&lsquo;<samp>smear</samp>&rsquo;</dt>
  13175. <dd><p>fill pixels using outermost pixels
  13176. </p>
  13177. </dd>
  13178. <dt>&lsquo;<samp>mirror</samp>&rsquo;</dt>
  13179. <dd><p>fill pixels using mirroring
  13180. </p>
  13181. </dd>
  13182. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  13183. <dd><p>fill pixels with constant value
  13184. </p></dd>
  13185. </dl>
  13186. <p>Default is <var>smear</var>.
  13187. </p>
  13188. </dd>
  13189. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  13190. <dd><p>Set color for pixels in fixed mode. Default is <var>black</var>.
  13191. </p></dd>
  13192. </dl>
  13193. <a name="Commands-38"></a>
  13194. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-38">11.76.1 Commands</a></h3>
  13195. <p>This filter supports same <a href="#commands">commands</a> as options.
  13196. The command accepts the same syntax of the corresponding option.
  13197. </p>
  13198. <p>If the specified expression is not valid, it is kept at its current
  13199. value.
  13200. </p>
  13201. <a name="find_005frect"></a>
  13202. <h2 class="section"><a href="ffmpeg-filters.html#toc-find_005frect">11.77 find_rect</a></h2>
  13203. <p>Find a rectangular object
  13204. </p>
  13205. <p>It accepts the following options:
  13206. </p>
  13207. <dl compact="compact">
  13208. <dt>&lsquo;<samp>object</samp>&rsquo;</dt>
  13209. <dd><p>Filepath of the object image, needs to be in gray8.
  13210. </p>
  13211. </dd>
  13212. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  13213. <dd><p>Detection threshold, default is 0.5.
  13214. </p>
  13215. </dd>
  13216. <dt>&lsquo;<samp>mipmaps</samp>&rsquo;</dt>
  13217. <dd><p>Number of mipmaps, default is 3.
  13218. </p>
  13219. </dd>
  13220. <dt>&lsquo;<samp>xmin, ymin, xmax, ymax</samp>&rsquo;</dt>
  13221. <dd><p>Specifies the rectangle in which to search.
  13222. </p></dd>
  13223. </dl>
  13224. <a name="Examples-88"></a>
  13225. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-88">11.77.1 Examples</a></h3>
  13226. <ul>
  13227. <li>
  13228. Cover a rectangular object by the supplied image of a given video using <code>ffmpeg</code>:
  13229. <div class="example">
  13230. <pre class="example">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  13231. </pre></div>
  13232. </li></ul>
  13233. <a name="floodfill"></a>
  13234. <h2 class="section"><a href="ffmpeg-filters.html#toc-floodfill">11.78 floodfill</a></h2>
  13235. <p>Flood area with values of same pixel components with another values.
  13236. </p>
  13237. <p>It accepts the following options:
  13238. </p><dl compact="compact">
  13239. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  13240. <dd><p>Set pixel x coordinate.
  13241. </p>
  13242. </dd>
  13243. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  13244. <dd><p>Set pixel y coordinate.
  13245. </p>
  13246. </dd>
  13247. <dt>&lsquo;<samp>s0</samp>&rsquo;</dt>
  13248. <dd><p>Set source #0 component value.
  13249. </p>
  13250. </dd>
  13251. <dt>&lsquo;<samp>s1</samp>&rsquo;</dt>
  13252. <dd><p>Set source #1 component value.
  13253. </p>
  13254. </dd>
  13255. <dt>&lsquo;<samp>s2</samp>&rsquo;</dt>
  13256. <dd><p>Set source #2 component value.
  13257. </p>
  13258. </dd>
  13259. <dt>&lsquo;<samp>s3</samp>&rsquo;</dt>
  13260. <dd><p>Set source #3 component value.
  13261. </p>
  13262. </dd>
  13263. <dt>&lsquo;<samp>d0</samp>&rsquo;</dt>
  13264. <dd><p>Set destination #0 component value.
  13265. </p>
  13266. </dd>
  13267. <dt>&lsquo;<samp>d1</samp>&rsquo;</dt>
  13268. <dd><p>Set destination #1 component value.
  13269. </p>
  13270. </dd>
  13271. <dt>&lsquo;<samp>d2</samp>&rsquo;</dt>
  13272. <dd><p>Set destination #2 component value.
  13273. </p>
  13274. </dd>
  13275. <dt>&lsquo;<samp>d3</samp>&rsquo;</dt>
  13276. <dd><p>Set destination #3 component value.
  13277. </p></dd>
  13278. </dl>
  13279. <p><a name="format"></a>
  13280. </p><a name="format-1"></a>
  13281. <h2 class="section"><a href="ffmpeg-filters.html#toc-format-1">11.79 format</a></h2>
  13282. <p>Convert the input video to one of the specified pixel formats.
  13283. Libavfilter will try to pick one that is suitable as input to
  13284. the next filter.
  13285. </p>
  13286. <p>It accepts the following parameters:
  13287. </p><dl compact="compact">
  13288. <dt>&lsquo;<samp>pix_fmts</samp>&rsquo;</dt>
  13289. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  13290. &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
  13291. </p>
  13292. </dd>
  13293. </dl>
  13294. <a name="Examples-15"></a>
  13295. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-15">11.79.1 Examples</a></h3>
  13296. <ul>
  13297. <li>
  13298. Convert the input video to the <var>yuv420p</var> format
  13299. <div class="example">
  13300. <pre class="example">format=pix_fmts=yuv420p
  13301. </pre></div>
  13302. <p>Convert the input video to any of the formats in the list
  13303. </p><div class="example">
  13304. <pre class="example">format=pix_fmts=yuv420p|yuv444p|yuv410p
  13305. </pre></div>
  13306. </li></ul>
  13307. <p><a name="fps"></a>
  13308. </p><a name="fps-1"></a>
  13309. <h2 class="section"><a href="ffmpeg-filters.html#toc-fps-1">11.80 fps</a></h2>
  13310. <p>Convert the video to specified constant frame rate by duplicating or dropping
  13311. frames as necessary.
  13312. </p>
  13313. <p>It accepts the following parameters:
  13314. </p><dl compact="compact">
  13315. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  13316. <dd><p>The desired output frame rate. The default is <code>25</code>.
  13317. </p>
  13318. </dd>
  13319. <dt>&lsquo;<samp>start_time</samp>&rsquo;</dt>
  13320. <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
  13321. padding/trimming at the start of stream. By default, no assumption is made
  13322. about the first frame&rsquo;s expected PTS, so no padding or trimming is done.
  13323. For example, this could be set to 0 to pad the beginning with duplicates of
  13324. the first frame if a video stream starts after the audio stream or to trim any
  13325. frames with a negative PTS.
  13326. </p>
  13327. </dd>
  13328. <dt>&lsquo;<samp>round</samp>&rsquo;</dt>
  13329. <dd><p>Timestamp (PTS) rounding method.
  13330. </p>
  13331. <p>Possible values are:
  13332. </p><dl compact="compact">
  13333. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  13334. <dd><p>round towards 0
  13335. </p></dd>
  13336. <dt>&lsquo;<samp>inf</samp>&rsquo;</dt>
  13337. <dd><p>round away from 0
  13338. </p></dd>
  13339. <dt>&lsquo;<samp>down</samp>&rsquo;</dt>
  13340. <dd><p>round towards -infinity
  13341. </p></dd>
  13342. <dt>&lsquo;<samp>up</samp>&rsquo;</dt>
  13343. <dd><p>round towards +infinity
  13344. </p></dd>
  13345. <dt>&lsquo;<samp>near</samp>&rsquo;</dt>
  13346. <dd><p>round to nearest
  13347. </p></dd>
  13348. </dl>
  13349. <p>The default is <code>near</code>.
  13350. </p>
  13351. </dd>
  13352. <dt>&lsquo;<samp>eof_action</samp>&rsquo;</dt>
  13353. <dd><p>Action performed when reading the last frame.
  13354. </p>
  13355. <p>Possible values are:
  13356. </p><dl compact="compact">
  13357. <dt>&lsquo;<samp>round</samp>&rsquo;</dt>
  13358. <dd><p>Use same timestamp rounding method as used for other frames.
  13359. </p></dd>
  13360. <dt>&lsquo;<samp>pass</samp>&rsquo;</dt>
  13361. <dd><p>Pass through last frame if input duration has not been reached yet.
  13362. </p></dd>
  13363. </dl>
  13364. <p>The default is <code>round</code>.
  13365. </p>
  13366. </dd>
  13367. </dl>
  13368. <p>Alternatively, the options can be specified as a flat string:
  13369. <var>fps</var>[:<var>start_time</var>[:<var>round</var>]].
  13370. </p>
  13371. <p>See also the <a href="#setpts">setpts</a> filter.
  13372. </p>
  13373. <a name="Examples-101"></a>
  13374. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-101">11.80.1 Examples</a></h3>
  13375. <ul>
  13376. <li>
  13377. A typical usage in order to set the fps to 25:
  13378. <div class="example">
  13379. <pre class="example">fps=fps=25
  13380. </pre></div>
  13381. </li><li>
  13382. Sets the fps to 24, using abbreviation and rounding method to round to nearest:
  13383. <div class="example">
  13384. <pre class="example">fps=fps=film:round=near
  13385. </pre></div>
  13386. </li></ul>
  13387. <a name="framepack"></a>
  13388. <h2 class="section"><a href="ffmpeg-filters.html#toc-framepack">11.81 framepack</a></h2>
  13389. <p>Pack two different video streams into a stereoscopic video, setting proper
  13390. metadata on supported codecs. The two views should have the same size and
  13391. framerate and processing will stop when the shorter video ends. Please note
  13392. that you may conveniently adjust view properties with the <a href="#scale">scale</a> and
  13393. <a href="#fps">fps</a> filters.
  13394. </p>
  13395. <p>It accepts the following parameters:
  13396. </p><dl compact="compact">
  13397. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  13398. <dd><p>The desired packing format. Supported values are:
  13399. </p>
  13400. <dl compact="compact">
  13401. <dt>&lsquo;<samp>sbs</samp>&rsquo;</dt>
  13402. <dd><p>The views are next to each other (default).
  13403. </p>
  13404. </dd>
  13405. <dt>&lsquo;<samp>tab</samp>&rsquo;</dt>
  13406. <dd><p>The views are on top of each other.
  13407. </p>
  13408. </dd>
  13409. <dt>&lsquo;<samp>lines</samp>&rsquo;</dt>
  13410. <dd><p>The views are packed by line.
  13411. </p>
  13412. </dd>
  13413. <dt>&lsquo;<samp>columns</samp>&rsquo;</dt>
  13414. <dd><p>The views are packed by column.
  13415. </p>
  13416. </dd>
  13417. <dt>&lsquo;<samp>frameseq</samp>&rsquo;</dt>
  13418. <dd><p>The views are temporally interleaved.
  13419. </p>
  13420. </dd>
  13421. </dl>
  13422. </dd>
  13423. </dl>
  13424. <p>Some examples:
  13425. </p>
  13426. <div class="example">
  13427. <pre class="example"># Convert left and right views into a frame-sequential video
  13428. ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
  13429. # Convert views into a side-by-side video with the same output resolution as the input
  13430. 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
  13431. </pre></div>
  13432. <a name="framerate"></a>
  13433. <h2 class="section"><a href="ffmpeg-filters.html#toc-framerate">11.82 framerate</a></h2>
  13434. <p>Change the frame rate by interpolating new video output frames from the source
  13435. frames.
  13436. </p>
  13437. <p>This filter is not designed to function correctly with interlaced media. If
  13438. you wish to change the frame rate of interlaced media then you are required
  13439. to deinterlace before this filter and re-interlace after this filter.
  13440. </p>
  13441. <p>A description of the accepted options follows.
  13442. </p>
  13443. <dl compact="compact">
  13444. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  13445. <dd><p>Specify the output frames per second. This option can also be specified
  13446. as a value alone. The default is <code>50</code>.
  13447. </p>
  13448. </dd>
  13449. <dt>&lsquo;<samp>interp_start</samp>&rsquo;</dt>
  13450. <dd><p>Specify the start of a range where the output frame will be created as a
  13451. linear interpolation of two frames. The range is [<code>0</code>-<code>255</code>],
  13452. the default is <code>15</code>.
  13453. </p>
  13454. </dd>
  13455. <dt>&lsquo;<samp>interp_end</samp>&rsquo;</dt>
  13456. <dd><p>Specify the end of a range where the output frame will be created as a
  13457. linear interpolation of two frames. The range is [<code>0</code>-<code>255</code>],
  13458. the default is <code>240</code>.
  13459. </p>
  13460. </dd>
  13461. <dt>&lsquo;<samp>scene</samp>&rsquo;</dt>
  13462. <dd><p>Specify the level at which a scene change is detected as a value between
  13463. 0 and 100 to indicate a new scene; a low value reflects a low
  13464. probability for the current frame to introduce a new scene, while a higher
  13465. value means the current frame is more likely to be one.
  13466. The default is <code>8.2</code>.
  13467. </p>
  13468. </dd>
  13469. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  13470. <dd><p>Specify flags influencing the filter process.
  13471. </p>
  13472. <p>Available value for <var>flags</var> is:
  13473. </p>
  13474. <dl compact="compact">
  13475. <dt>&lsquo;<samp>scene_change_detect, scd</samp>&rsquo;</dt>
  13476. <dd><p>Enable scene change detection using the value of the option <var>scene</var>.
  13477. This flag is enabled by default.
  13478. </p></dd>
  13479. </dl>
  13480. </dd>
  13481. </dl>
  13482. <a name="framestep"></a>
  13483. <h2 class="section"><a href="ffmpeg-filters.html#toc-framestep">11.83 framestep</a></h2>
  13484. <p>Select one frame every N-th frame.
  13485. </p>
  13486. <p>This filter accepts the following option:
  13487. </p><dl compact="compact">
  13488. <dt>&lsquo;<samp>step</samp>&rsquo;</dt>
  13489. <dd><p>Select frame after every <code>step</code> frames.
  13490. Allowed values are positive integers higher than 0. Default value is <code>1</code>.
  13491. </p></dd>
  13492. </dl>
  13493. <a name="freezedetect"></a>
  13494. <h2 class="section"><a href="ffmpeg-filters.html#toc-freezedetect">11.84 freezedetect</a></h2>
  13495. <p>Detect frozen video.
  13496. </p>
  13497. <p>This filter logs a message and sets frame metadata when it detects that the
  13498. input video has no significant change in content during a specified duration.
  13499. Video freeze detection calculates the mean average absolute difference of all
  13500. the components of video frames and compares it to a noise floor.
  13501. </p>
  13502. <p>The printed times and duration are expressed in seconds. The
  13503. <code>lavfi.freezedetect.freeze_start</code> metadata key is set on the first frame
  13504. whose timestamp equals or exceeds the detection duration and it contains the
  13505. timestamp of the first frame of the freeze. The
  13506. <code>lavfi.freezedetect.freeze_duration</code> and
  13507. <code>lavfi.freezedetect.freeze_end</code> metadata keys are set on the first frame
  13508. after the freeze.
  13509. </p>
  13510. <p>The filter accepts the following options:
  13511. </p>
  13512. <dl compact="compact">
  13513. <dt>&lsquo;<samp>noise, n</samp>&rsquo;</dt>
  13514. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  13515. specified value) or as a difference ratio between 0 and 1. Default is -60dB, or
  13516. 0.001.
  13517. </p>
  13518. </dd>
  13519. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  13520. <dd><p>Set freeze duration until notification (default is 2 seconds).
  13521. </p></dd>
  13522. </dl>
  13523. <a name="freezeframes"></a>
  13524. <h2 class="section"><a href="ffmpeg-filters.html#toc-freezeframes">11.85 freezeframes</a></h2>
  13525. <p>Freeze video frames.
  13526. </p>
  13527. <p>This filter freezes video frames using frame from 2nd input.
  13528. </p>
  13529. <p>The filter accepts the following options:
  13530. </p>
  13531. <dl compact="compact">
  13532. <dt>&lsquo;<samp>first</samp>&rsquo;</dt>
  13533. <dd><p>Set number of first frame from which to start freeze.
  13534. </p>
  13535. </dd>
  13536. <dt>&lsquo;<samp>last</samp>&rsquo;</dt>
  13537. <dd><p>Set number of last frame from which to end freeze.
  13538. </p>
  13539. </dd>
  13540. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  13541. <dd><p>Set number of frame from 2nd input which will be used instead of replaced frames.
  13542. </p></dd>
  13543. </dl>
  13544. <p><a name="frei0r"></a>
  13545. </p><a name="frei0r-1"></a>
  13546. <h2 class="section"><a href="ffmpeg-filters.html#toc-frei0r-1">11.86 frei0r</a></h2>
  13547. <p>Apply a frei0r effect to the input video.
  13548. </p>
  13549. <p>To enable the compilation of this filter, you need to install the frei0r
  13550. header and configure FFmpeg with <code>--enable-frei0r</code>.
  13551. </p>
  13552. <p>It accepts the following parameters:
  13553. </p>
  13554. <dl compact="compact">
  13555. <dt>&lsquo;<samp>filter_name</samp>&rsquo;</dt>
  13556. <dd><p>The name of the frei0r effect to load. If the environment variable
  13557. <code>FREI0R_PATH</code> is defined, the frei0r effect is searched for in each of the
  13558. directories specified by the colon-separated list in <code>FREI0R_PATH</code>.
  13559. Otherwise, the standard frei0r paths are searched, in this order:
  13560. &lsquo;<tt>HOME/.frei0r-1/lib/</tt>&rsquo;, &lsquo;<tt>/usr/local/lib/frei0r-1/</tt>&rsquo;,
  13561. &lsquo;<tt>/usr/lib/frei0r-1/</tt>&rsquo;.
  13562. </p>
  13563. </dd>
  13564. <dt>&lsquo;<samp>filter_params</samp>&rsquo;</dt>
  13565. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
  13566. </p>
  13567. </dd>
  13568. </dl>
  13569. <p>A frei0r effect parameter can be a boolean (its value is either
  13570. &quot;y&quot; or &quot;n&quot;), a double, a color (specified as
  13571. <var>R</var>/<var>G</var>/<var>B</var>, where <var>R</var>, <var>G</var>, and <var>B</var> are floating point
  13572. numbers between 0.0 and 1.0, inclusive) or a color description as specified in the
  13573. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>,
  13574. a position (specified as <var>X</var>/<var>Y</var>, where
  13575. <var>X</var> and <var>Y</var> are floating point numbers) and/or a string.
  13576. </p>
  13577. <p>The number and types of parameters depend on the loaded effect. If an
  13578. effect parameter is not specified, the default value is set.
  13579. </p>
  13580. <a name="Examples-79"></a>
  13581. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-79">11.86.1 Examples</a></h3>
  13582. <ul>
  13583. <li>
  13584. Apply the distort0r effect, setting the first two double parameters:
  13585. <div class="example">
  13586. <pre class="example">frei0r=filter_name=distort0r:filter_params=0.5|0.01
  13587. </pre></div>
  13588. </li><li>
  13589. Apply the colordistance effect, taking a color as the first parameter:
  13590. <div class="example">
  13591. <pre class="example">frei0r=colordistance:0.2/0.3/0.4
  13592. frei0r=colordistance:violet
  13593. frei0r=colordistance:0x112233
  13594. </pre></div>
  13595. </li><li>
  13596. Apply the perspective effect, specifying the top left and top right image
  13597. positions:
  13598. <div class="example">
  13599. <pre class="example">frei0r=perspective:0.2/0.2|0.8/0.2
  13600. </pre></div>
  13601. </li></ul>
  13602. <p>For more information, see
  13603. <a href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
  13604. </p>
  13605. <a name="fspp"></a>
  13606. <h2 class="section"><a href="ffmpeg-filters.html#toc-fspp">11.87 fspp</a></h2>
  13607. <p>Apply fast and simple postprocessing. It is a faster version of <a href="#spp">spp</a>.
  13608. </p>
  13609. <p>It splits (I)DCT into horizontal/vertical passes. Unlike the simple post-
  13610. processing filter, one of them is performed once per block, not per pixel.
  13611. This allows for much higher speed.
  13612. </p>
  13613. <p>The filter accepts the following options:
  13614. </p>
  13615. <dl compact="compact">
  13616. <dt>&lsquo;<samp>quality</samp>&rsquo;</dt>
  13617. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  13618. an integer in the range 4-5. Default value is <code>4</code>.
  13619. </p>
  13620. </dd>
  13621. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  13622. <dd><p>Force a constant quantization parameter. It accepts an integer in range 0-63.
  13623. If not set, the filter will use the QP from the video stream (if available).
  13624. </p>
  13625. </dd>
  13626. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  13627. <dd><p>Set filter strength. It accepts an integer in range -15 to 32. Lower values mean
  13628. more details but also more artifacts, while higher values make the image smoother
  13629. but also blurrier. Default value is <code>0</code> − PSNR optimal.
  13630. </p>
  13631. </dd>
  13632. <dt>&lsquo;<samp>use_bframe_qp</samp>&rsquo;</dt>
  13633. <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
  13634. option may cause flicker since the B-Frames have often larger QP. Default is
  13635. <code>0</code> (not enabled).
  13636. </p>
  13637. </dd>
  13638. </dl>
  13639. <a name="gblur"></a>
  13640. <h2 class="section"><a href="ffmpeg-filters.html#toc-gblur">11.88 gblur</a></h2>
  13641. <p>Apply Gaussian blur filter.
  13642. </p>
  13643. <p>The filter accepts the following options:
  13644. </p>
  13645. <dl compact="compact">
  13646. <dt>&lsquo;<samp>sigma</samp>&rsquo;</dt>
  13647. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code>0.5</code>.
  13648. </p>
  13649. </dd>
  13650. <dt>&lsquo;<samp>steps</samp>&rsquo;</dt>
  13651. <dd><p>Set number of steps for Gaussian approximation. Default is <code>1</code>.
  13652. </p>
  13653. </dd>
  13654. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  13655. <dd><p>Set which planes to filter. By default all planes are filtered.
  13656. </p>
  13657. </dd>
  13658. <dt>&lsquo;<samp>sigmaV</samp>&rsquo;</dt>
  13659. <dd><p>Set vertical sigma, if negative it will be same as <code>sigma</code>.
  13660. Default is <code>-1</code>.
  13661. </p></dd>
  13662. </dl>
  13663. <a name="Commands-48"></a>
  13664. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-48">11.88.1 Commands</a></h3>
  13665. <p>This filter supports same commands as options.
  13666. The command accepts the same syntax of the corresponding option.
  13667. </p>
  13668. <p>If the specified expression is not valid, it is kept at its current
  13669. value.
  13670. </p>
  13671. <a name="geq"></a>
  13672. <h2 class="section"><a href="ffmpeg-filters.html#toc-geq">11.89 geq</a></h2>
  13673. <p>Apply generic equation to each pixel.
  13674. </p>
  13675. <p>The filter accepts the following options:
  13676. </p>
  13677. <dl compact="compact">
  13678. <dt>&lsquo;<samp>lum_expr, lum</samp>&rsquo;</dt>
  13679. <dd><p>Set the luminance expression.
  13680. </p></dd>
  13681. <dt>&lsquo;<samp>cb_expr, cb</samp>&rsquo;</dt>
  13682. <dd><p>Set the chrominance blue expression.
  13683. </p></dd>
  13684. <dt>&lsquo;<samp>cr_expr, cr</samp>&rsquo;</dt>
  13685. <dd><p>Set the chrominance red expression.
  13686. </p></dd>
  13687. <dt>&lsquo;<samp>alpha_expr, a</samp>&rsquo;</dt>
  13688. <dd><p>Set the alpha expression.
  13689. </p></dd>
  13690. <dt>&lsquo;<samp>red_expr, r</samp>&rsquo;</dt>
  13691. <dd><p>Set the red expression.
  13692. </p></dd>
  13693. <dt>&lsquo;<samp>green_expr, g</samp>&rsquo;</dt>
  13694. <dd><p>Set the green expression.
  13695. </p></dd>
  13696. <dt>&lsquo;<samp>blue_expr, b</samp>&rsquo;</dt>
  13697. <dd><p>Set the blue expression.
  13698. </p></dd>
  13699. </dl>
  13700. <p>The colorspace is selected according to the specified options. If one
  13701. of the &lsquo;<samp>lum_expr</samp>&rsquo;, &lsquo;<samp>cb_expr</samp>&rsquo;, or &lsquo;<samp>cr_expr</samp>&rsquo;
  13702. options is specified, the filter will automatically select a YCbCr
  13703. colorspace. If one of the &lsquo;<samp>red_expr</samp>&rsquo;, &lsquo;<samp>green_expr</samp>&rsquo;, or
  13704. &lsquo;<samp>blue_expr</samp>&rsquo; options is specified, it will select an RGB
  13705. colorspace.
  13706. </p>
  13707. <p>If one of the chrominance expression is not defined, it falls back on the other
  13708. one. If no alpha expression is specified it will evaluate to opaque value.
  13709. If none of chrominance expressions are specified, they will evaluate
  13710. to the luminance expression.
  13711. </p>
  13712. <p>The expressions can use the following variables and functions:
  13713. </p>
  13714. <dl compact="compact">
  13715. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  13716. <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
  13717. </p>
  13718. </dd>
  13719. <dt>&lsquo;<samp>X</samp>&rsquo;</dt>
  13720. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  13721. <dd><p>The coordinates of the current sample.
  13722. </p>
  13723. </dd>
  13724. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  13725. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  13726. <dd><p>The width and height of the image.
  13727. </p>
  13728. </dd>
  13729. <dt>&lsquo;<samp>SW</samp>&rsquo;</dt>
  13730. <dt>&lsquo;<samp>SH</samp>&rsquo;</dt>
  13731. <dd><p>Width and height scale depending on the currently filtered plane. It is the
  13732. ratio between the corresponding luma plane number of pixels and the current
  13733. plane ones. E.g. for YUV4:2:0 the values are <code>1,1</code> for the luma plane, and
  13734. <code>0.5,0.5</code> for chroma planes.
  13735. </p>
  13736. </dd>
  13737. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  13738. <dd><p>Time of the current frame, expressed in seconds.
  13739. </p>
  13740. </dd>
  13741. <dt>&lsquo;<samp>p(x, y)</samp>&rsquo;</dt>
  13742. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the current
  13743. plane.
  13744. </p>
  13745. </dd>
  13746. <dt>&lsquo;<samp>lum(x, y)</samp>&rsquo;</dt>
  13747. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the luminance
  13748. plane.
  13749. </p>
  13750. </dd>
  13751. <dt>&lsquo;<samp>cb(x, y)</samp>&rsquo;</dt>
  13752. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  13753. blue-difference chroma plane. Return 0 if there is no such plane.
  13754. </p>
  13755. </dd>
  13756. <dt>&lsquo;<samp>cr(x, y)</samp>&rsquo;</dt>
  13757. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  13758. red-difference chroma plane. Return 0 if there is no such plane.
  13759. </p>
  13760. </dd>
  13761. <dt>&lsquo;<samp>r(x, y)</samp>&rsquo;</dt>
  13762. <dt>&lsquo;<samp>g(x, y)</samp>&rsquo;</dt>
  13763. <dt>&lsquo;<samp>b(x, y)</samp>&rsquo;</dt>
  13764. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  13765. red/green/blue component. Return 0 if there is no such component.
  13766. </p>
  13767. </dd>
  13768. <dt>&lsquo;<samp>alpha(x, y)</samp>&rsquo;</dt>
  13769. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the alpha
  13770. plane. Return 0 if there is no such plane.
  13771. </p>
  13772. </dd>
  13773. <dt>&lsquo;<samp>psum(x,y), lumsum(x, y), cbsum(x,y), crsum(x,y), rsum(x,y), gsum(x,y), bsum(x,y), alphasum(x,y)</samp>&rsquo;</dt>
  13774. <dd><p>Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining
  13775. sums of samples within a rectangle. See the functions without the sum postfix.
  13776. </p>
  13777. </dd>
  13778. <dt>&lsquo;<samp>interpolation</samp>&rsquo;</dt>
  13779. <dd><p>Set one of interpolation methods:
  13780. </p><dl compact="compact">
  13781. <dt>&lsquo;<samp>nearest, n</samp>&rsquo;</dt>
  13782. <dt>&lsquo;<samp>bilinear, b</samp>&rsquo;</dt>
  13783. </dl>
  13784. <p>Default is bilinear.
  13785. </p></dd>
  13786. </dl>
  13787. <p>For functions, if <var>x</var> and <var>y</var> are outside the area, the value will be
  13788. automatically clipped to the closer edge.
  13789. </p>
  13790. <p>Please note that this filter can use multiple threads in which case each slice
  13791. will have its own expression state. If you want to use only a single expression
  13792. state because your expressions depend on previous state then you should limit
  13793. the number of filter threads to 1.
  13794. </p>
  13795. <a name="Examples-78"></a>
  13796. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-78">11.89.1 Examples</a></h3>
  13797. <ul>
  13798. <li>
  13799. Flip the image horizontally:
  13800. <div class="example">
  13801. <pre class="example">geq=p(W-X\,Y)
  13802. </pre></div>
  13803. </li><li>
  13804. Generate a bidimensional sine wave, with angle <code>PI/3</code> and a
  13805. wavelength of 100 pixels:
  13806. <div class="example">
  13807. <pre class="example">geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
  13808. </pre></div>
  13809. </li><li>
  13810. Generate a fancy enigmatic moving light:
  13811. <div class="example">
  13812. <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
  13813. </pre></div>
  13814. </li><li>
  13815. Generate a quick emboss effect:
  13816. <div class="example">
  13817. <pre class="example">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
  13818. </pre></div>
  13819. </li><li>
  13820. Modify RGB components depending on pixel position:
  13821. <div class="example">
  13822. <pre class="example">geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
  13823. </pre></div>
  13824. </li><li>
  13825. Create a radial gradient that is the same size as the input (also see
  13826. the <a href="#vignette">vignette</a> filter):
  13827. <div class="example">
  13828. <pre class="example">geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
  13829. </pre></div>
  13830. </li></ul>
  13831. <a name="gradfun"></a>
  13832. <h2 class="section"><a href="ffmpeg-filters.html#toc-gradfun">11.90 gradfun</a></h2>
  13833. <p>Fix the banding artifacts that are sometimes introduced into nearly flat
  13834. regions by truncation to 8-bit color depth.
  13835. Interpolate the gradients that should go where the bands are, and
  13836. dither them.
  13837. </p>
  13838. <p>It is designed for playback only. Do not use it prior to
  13839. lossy compression, because compression tends to lose the dither and
  13840. bring back the bands.
  13841. </p>
  13842. <p>It accepts the following parameters:
  13843. </p>
  13844. <dl compact="compact">
  13845. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  13846. <dd><p>The maximum amount by which the filter will change any one pixel. This is also
  13847. the threshold for detecting nearly flat regions. Acceptable values range from
  13848. .51 to 64; the default value is 1.2. Out-of-range values will be clipped to the
  13849. valid range.
  13850. </p>
  13851. </dd>
  13852. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  13853. <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
  13854. gradients, but also prevents the filter from modifying the pixels near detailed
  13855. regions. Acceptable values are 8-32; the default value is 16. Out-of-range
  13856. values will be clipped to the valid range.
  13857. </p>
  13858. </dd>
  13859. </dl>
  13860. <p>Alternatively, the options can be specified as a flat string:
  13861. <var>strength</var>[:<var>radius</var>]
  13862. </p>
  13863. <a name="Examples-92"></a>
  13864. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-92">11.90.1 Examples</a></h3>
  13865. <ul>
  13866. <li>
  13867. Apply the filter with a <code>3.5</code> strength and radius of <code>8</code>:
  13868. <div class="example">
  13869. <pre class="example">gradfun=3.5:8
  13870. </pre></div>
  13871. </li><li>
  13872. Specify radius, omitting the strength (which will fall-back to the default
  13873. value):
  13874. <div class="example">
  13875. <pre class="example">gradfun=radius=8
  13876. </pre></div>
  13877. </li></ul>
  13878. <p><a name="graphmonitor"></a>
  13879. </p><a name="graphmonitor-1"></a>
  13880. <h2 class="section"><a href="ffmpeg-filters.html#toc-graphmonitor-1">11.91 graphmonitor</a></h2>
  13881. <p>Show various filtergraph stats.
  13882. </p>
  13883. <p>With this filter one can debug complete filtergraph.
  13884. Especially issues with links filling with queued frames.
  13885. </p>
  13886. <p>The filter accepts the following options:
  13887. </p>
  13888. <dl compact="compact">
  13889. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  13890. <dd><p>Set video output size. Default is <var>hd720</var>.
  13891. </p>
  13892. </dd>
  13893. <dt>&lsquo;<samp>opacity, o</samp>&rsquo;</dt>
  13894. <dd><p>Set video opacity. Default is <var>0.9</var>. Allowed range is from <var>0</var> to <var>1</var>.
  13895. </p>
  13896. </dd>
  13897. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  13898. <dd><p>Set output mode, can be <var>fulll</var> or <var>compact</var>.
  13899. In <var>compact</var> mode only filters with some queued frames have displayed stats.
  13900. </p>
  13901. </dd>
  13902. <dt>&lsquo;<samp>flags, f</samp>&rsquo;</dt>
  13903. <dd><p>Set flags which enable which stats are shown in video.
  13904. </p>
  13905. <p>Available values for flags are:
  13906. </p><dl compact="compact">
  13907. <dt>&lsquo;<samp>queue</samp>&rsquo;</dt>
  13908. <dd><p>Display number of queued frames in each link.
  13909. </p>
  13910. </dd>
  13911. <dt>&lsquo;<samp>frame_count_in</samp>&rsquo;</dt>
  13912. <dd><p>Display number of frames taken from filter.
  13913. </p>
  13914. </dd>
  13915. <dt>&lsquo;<samp>frame_count_out</samp>&rsquo;</dt>
  13916. <dd><p>Display number of frames given out from filter.
  13917. </p>
  13918. </dd>
  13919. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  13920. <dd><p>Display current filtered frame pts.
  13921. </p>
  13922. </dd>
  13923. <dt>&lsquo;<samp>time</samp>&rsquo;</dt>
  13924. <dd><p>Display current filtered frame time.
  13925. </p>
  13926. </dd>
  13927. <dt>&lsquo;<samp>timebase</samp>&rsquo;</dt>
  13928. <dd><p>Display time base for filter link.
  13929. </p>
  13930. </dd>
  13931. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  13932. <dd><p>Display used format for filter link.
  13933. </p>
  13934. </dd>
  13935. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  13936. <dd><p>Display video size or number of audio channels in case of audio used by filter link.
  13937. </p>
  13938. </dd>
  13939. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  13940. <dd><p>Display video frame rate or sample rate in case of audio used by filter link.
  13941. </p></dd>
  13942. </dl>
  13943. </dd>
  13944. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  13945. <dd><p>Set upper limit for video rate of output stream, Default value is <var>25</var>.
  13946. This guarantee that output video frame rate will not be higher than this value.
  13947. </p></dd>
  13948. </dl>
  13949. <a name="greyedge"></a>
  13950. <h2 class="section"><a href="ffmpeg-filters.html#toc-greyedge">11.92 greyedge</a></h2>
  13951. <p>A color constancy variation filter which estimates scene illumination via grey edge algorithm
  13952. and corrects the scene colors accordingly.
  13953. </p>
  13954. <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>
  13955. </p>
  13956. <p>The filter accepts the following options:
  13957. </p>
  13958. <dl compact="compact">
  13959. <dt>&lsquo;<samp>difford</samp>&rsquo;</dt>
  13960. <dd><p>The order of differentiation to be applied on the scene. Must be chosen in the range
  13961. [0,2] and default value is 1.
  13962. </p>
  13963. </dd>
  13964. <dt>&lsquo;<samp>minknorm</samp>&rsquo;</dt>
  13965. <dd><p>The Minkowski parameter to be used for calculating the Minkowski distance. Must
  13966. be chosen in the range [0,20] and default value is 1. Set to 0 for getting
  13967. max value instead of calculating Minkowski distance.
  13968. </p>
  13969. </dd>
  13970. <dt>&lsquo;<samp>sigma</samp>&rsquo;</dt>
  13971. <dd><p>The standard deviation of Gaussian blur to be applied on the scene. Must be
  13972. chosen in the range [0,1024.0] and default value = 1. floor( <var>sigma</var> * break_off_sigma(3) )
  13973. can&rsquo;t be equal to 0 if <var>difford</var> is greater than 0.
  13974. </p></dd>
  13975. </dl>
  13976. <a name="Examples-64"></a>
  13977. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-64">11.92.1 Examples</a></h3>
  13978. <ul>
  13979. <li>
  13980. Grey Edge:
  13981. <div class="example">
  13982. <pre class="example">greyedge=difford=1:minknorm=5:sigma=2
  13983. </pre></div>
  13984. </li><li>
  13985. Max Edge:
  13986. <div class="example">
  13987. <pre class="example">greyedge=difford=1:minknorm=0:sigma=2
  13988. </pre></div>
  13989. </li></ul>
  13990. <p><a name="haldclut"></a>
  13991. </p><a name="haldclut-1"></a>
  13992. <h2 class="section"><a href="ffmpeg-filters.html#toc-haldclut-1">11.93 haldclut</a></h2>
  13993. <p>Apply a Hald CLUT to a video stream.
  13994. </p>
  13995. <p>First input is the video stream to process, and second one is the Hald CLUT.
  13996. The Hald CLUT input can be a simple picture or a complete video stream.
  13997. </p>
  13998. <p>The filter accepts the following options:
  13999. </p>
  14000. <dl compact="compact">
  14001. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  14002. <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
  14003. </p></dd>
  14004. <dt>&lsquo;<samp>repeatlast</samp>&rsquo;</dt>
  14005. <dd><p>Continue applying the last CLUT after the end of the stream. A value of
  14006. <code>0</code> disable the filter after the last frame of the CLUT is reached.
  14007. Default is <code>1</code>.
  14008. </p></dd>
  14009. </dl>
  14010. <p><code>haldclut</code> also has the same interpolation options as <a href="#lut3d">lut3d</a> (both
  14011. filters share the same internals).
  14012. </p>
  14013. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  14014. </p>
  14015. <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
  14016. (Hald CLUT author) at <a href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
  14017. </p>
  14018. <a name="Workflow-examples"></a>
  14019. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Workflow-examples">11.93.1 Workflow examples</a></h3>
  14020. <a name="Hald-CLUT-video-stream"></a>
  14021. <h4 class="subsubsection"><a href="ffmpeg-filters.html#toc-Hald-CLUT-video-stream">11.93.1.1 Hald CLUT video stream</a></h4>
  14022. <p>Generate an identity Hald CLUT stream altered with various effects:
  14023. </p><div class="example">
  14024. <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
  14025. </pre></div>
  14026. <p>Note: make sure you use a lossless codec.
  14027. </p>
  14028. <p>Then use it with <code>haldclut</code> to apply it on some random stream:
  14029. </p><div class="example">
  14030. <pre class="example">ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
  14031. </pre></div>
  14032. <p>The Hald CLUT will be applied to the 10 first seconds (duration of
  14033. &lsquo;<tt>clut.nut</tt>&rsquo;), then the latest picture of that CLUT stream will be applied
  14034. to the remaining frames of the <code>mandelbrot</code> stream.
  14035. </p>
  14036. <a name="Hald-CLUT-with-preview"></a>
  14037. <h4 class="subsubsection"><a href="ffmpeg-filters.html#toc-Hald-CLUT-with-preview">11.93.1.2 Hald CLUT with preview</a></h4>
  14038. <p>A Hald CLUT is supposed to be a squared image of <code>Level*Level*Level</code> by
  14039. <code>Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
  14040. biggest possible square starting at the top left of the picture. The remaining
  14041. padding pixels (bottom or right) will be ignored. This area can be used to add
  14042. a preview of the Hald CLUT.
  14043. </p>
  14044. <p>Typically, the following generated Hald CLUT will be supported by the
  14045. <code>haldclut</code> filter:
  14046. </p>
  14047. <div class="example">
  14048. <pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
  14049. pad=iw+320 [padded_clut];
  14050. smptebars=s=320x256, split [a][b];
  14051. [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
  14052. [main][b] overlay=W-320&quot; -frames:v 1 clut.png
  14053. </pre></div>
  14054. <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
  14055. bars are displayed on the right-top, and below the same color bars processed by
  14056. the color changes.
  14057. </p>
  14058. <p>Then, the effect of this Hald CLUT can be visualized with:
  14059. </p><div class="example">
  14060. <pre class="example">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
  14061. </pre></div>
  14062. <a name="hflip"></a>
  14063. <h2 class="section"><a href="ffmpeg-filters.html#toc-hflip">11.94 hflip</a></h2>
  14064. <p>Flip the input video horizontally.
  14065. </p>
  14066. <p>For example, to horizontally flip the input video with <code>ffmpeg</code>:
  14067. </p><div class="example">
  14068. <pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
  14069. </pre></div>
  14070. <a name="histeq"></a>
  14071. <h2 class="section"><a href="ffmpeg-filters.html#toc-histeq">11.95 histeq</a></h2>
  14072. <p>This filter applies a global color histogram equalization on a
  14073. per-frame basis.
  14074. </p>
  14075. <p>It can be used to correct video that has a compressed range of pixel
  14076. intensities. The filter redistributes the pixel intensities to
  14077. equalize their distribution across the intensity range. It may be
  14078. viewed as an &quot;automatically adjusting contrast filter&quot;. This filter is
  14079. useful only for correcting degraded or poorly captured source
  14080. video.
  14081. </p>
  14082. <p>The filter accepts the following options:
  14083. </p>
  14084. <dl compact="compact">
  14085. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  14086. <dd><p>Determine the amount of equalization to be applied. As the strength
  14087. is reduced, the distribution of pixel intensities more-and-more
  14088. approaches that of the input frame. The value must be a float number
  14089. in the range [0,1] and defaults to 0.200.
  14090. </p>
  14091. </dd>
  14092. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  14093. <dd><p>Set the maximum intensity that can generated and scale the output
  14094. values appropriately. The strength should be set as desired and then
  14095. the intensity can be limited if needed to avoid washing-out. The value
  14096. must be a float number in the range [0,1] and defaults to 0.210.
  14097. </p>
  14098. </dd>
  14099. <dt>&lsquo;<samp>antibanding</samp>&rsquo;</dt>
  14100. <dd><p>Set the antibanding level. If enabled the filter will randomly vary
  14101. the luminance of output pixels by a small amount to avoid banding of
  14102. the histogram. Possible values are <code>none</code>, <code>weak</code> or
  14103. <code>strong</code>. It defaults to <code>none</code>.
  14104. </p></dd>
  14105. </dl>
  14106. <p><a name="histogram"></a>
  14107. </p><a name="histogram-1"></a>
  14108. <h2 class="section"><a href="ffmpeg-filters.html#toc-histogram-1">11.96 histogram</a></h2>
  14109. <p>Compute and draw a color distribution histogram for the input video.
  14110. </p>
  14111. <p>The computed histogram is a representation of the color component
  14112. distribution in an image.
  14113. </p>
  14114. <p>Standard histogram displays the color components distribution in an image.
  14115. Displays color graph for each color component. Shows distribution of
  14116. the Y, U, V, A or R, G, B components, depending on input format, in the
  14117. current frame. Below each graph a color component scale meter is shown.
  14118. </p>
  14119. <p>The filter accepts the following options:
  14120. </p>
  14121. <dl compact="compact">
  14122. <dt>&lsquo;<samp>level_height</samp>&rsquo;</dt>
  14123. <dd><p>Set height of level. Default value is <code>200</code>.
  14124. Allowed range is [50, 2048].
  14125. </p>
  14126. </dd>
  14127. <dt>&lsquo;<samp>scale_height</samp>&rsquo;</dt>
  14128. <dd><p>Set height of color scale. Default value is <code>12</code>.
  14129. Allowed range is [0, 40].
  14130. </p>
  14131. </dd>
  14132. <dt>&lsquo;<samp>display_mode</samp>&rsquo;</dt>
  14133. <dd><p>Set display mode.
  14134. It accepts the following values:
  14135. </p><dl compact="compact">
  14136. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  14137. <dd><p>Per color component graphs are placed below each other.
  14138. </p>
  14139. </dd>
  14140. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  14141. <dd><p>Per color component graphs are placed side by side.
  14142. </p>
  14143. </dd>
  14144. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  14145. <dd><p>Presents information identical to that in the <code>parade</code>, except
  14146. that the graphs representing color components are superimposed directly
  14147. over one another.
  14148. </p></dd>
  14149. </dl>
  14150. <p>Default is <code>stack</code>.
  14151. </p>
  14152. </dd>
  14153. <dt>&lsquo;<samp>levels_mode</samp>&rsquo;</dt>
  14154. <dd><p>Set mode. Can be either <code>linear</code>, or <code>logarithmic</code>.
  14155. Default is <code>linear</code>.
  14156. </p>
  14157. </dd>
  14158. <dt>&lsquo;<samp>components</samp>&rsquo;</dt>
  14159. <dd><p>Set what color components to display.
  14160. Default is <code>7</code>.
  14161. </p>
  14162. </dd>
  14163. <dt>&lsquo;<samp>fgopacity</samp>&rsquo;</dt>
  14164. <dd><p>Set foreground opacity. Default is <code>0.7</code>.
  14165. </p>
  14166. </dd>
  14167. <dt>&lsquo;<samp>bgopacity</samp>&rsquo;</dt>
  14168. <dd><p>Set background opacity. Default is <code>0.5</code>.
  14169. </p></dd>
  14170. </dl>
  14171. <a name="Examples-129"></a>
  14172. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-129">11.96.1 Examples</a></h3>
  14173. <ul>
  14174. <li>
  14175. Calculate and draw histogram:
  14176. <div class="example">
  14177. <pre class="example">ffplay -i input -vf histogram
  14178. </pre></div>
  14179. </li></ul>
  14180. <p><a name="hqdn3d"></a>
  14181. </p><a name="hqdn3d-1"></a>
  14182. <h2 class="section"><a href="ffmpeg-filters.html#toc-hqdn3d-1">11.97 hqdn3d</a></h2>
  14183. <p>This is a high precision/quality 3d denoise filter. It aims to reduce
  14184. image noise, producing smooth images and making still images really
  14185. still. It should enhance compressibility.
  14186. </p>
  14187. <p>It accepts the following optional parameters:
  14188. </p>
  14189. <dl compact="compact">
  14190. <dt>&lsquo;<samp>luma_spatial</samp>&rsquo;</dt>
  14191. <dd><p>A non-negative floating point number which specifies spatial luma strength.
  14192. It defaults to 4.0.
  14193. </p>
  14194. </dd>
  14195. <dt>&lsquo;<samp>chroma_spatial</samp>&rsquo;</dt>
  14196. <dd><p>A non-negative floating point number which specifies spatial chroma strength.
  14197. It defaults to 3.0*<var>luma_spatial</var>/4.0.
  14198. </p>
  14199. </dd>
  14200. <dt>&lsquo;<samp>luma_tmp</samp>&rsquo;</dt>
  14201. <dd><p>A floating point number which specifies luma temporal strength. It defaults to
  14202. 6.0*<var>luma_spatial</var>/4.0.
  14203. </p>
  14204. </dd>
  14205. <dt>&lsquo;<samp>chroma_tmp</samp>&rsquo;</dt>
  14206. <dd><p>A floating point number which specifies chroma temporal strength. It defaults to
  14207. <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>.
  14208. </p></dd>
  14209. </dl>
  14210. <a name="Commands-30"></a>
  14211. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-30">11.97.1 Commands</a></h3>
  14212. <p>This filter supports same <a href="#commands">commands</a> as options.
  14213. The command accepts the same syntax of the corresponding option.
  14214. </p>
  14215. <p>If the specified expression is not valid, it is kept at its current
  14216. value.
  14217. </p>
  14218. <p><a name="hwdownload"></a>
  14219. </p><a name="hwdownload-1"></a>
  14220. <h2 class="section"><a href="ffmpeg-filters.html#toc-hwdownload-1">11.98 hwdownload</a></h2>
  14221. <p>Download hardware frames to system memory.
  14222. </p>
  14223. <p>The input must be in hardware frames, and the output a non-hardware format.
  14224. Not all formats will be supported on the output - it may be necessary to insert
  14225. an additional &lsquo;<samp>format</samp>&rsquo; filter immediately following in the graph to get
  14226. the output in a supported format.
  14227. </p>
  14228. <a name="hwmap"></a>
  14229. <h2 class="section"><a href="ffmpeg-filters.html#toc-hwmap">11.99 hwmap</a></h2>
  14230. <p>Map hardware frames to system memory or to another device.
  14231. </p>
  14232. <p>This filter has several different modes of operation; which one is used depends
  14233. on the input and output formats:
  14234. </p><ul>
  14235. <li>
  14236. Hardware frame input, normal frame output
  14237. <p>Map the input frames to system memory and pass them to the output. If the
  14238. original hardware frame is later required (for example, after overlaying
  14239. something else on part of it), the &lsquo;<samp>hwmap</samp>&rsquo; filter can be used again
  14240. in the next mode to retrieve it.
  14241. </p></li><li>
  14242. Normal frame input, hardware frame output
  14243. <p>If the input is actually a software-mapped hardware frame, then unmap it -
  14244. that is, return the original hardware frame.
  14245. </p>
  14246. <p>Otherwise, a device must be provided. Create new hardware surfaces on that
  14247. device for the output, then map them back to the software format at the input
  14248. and give those frames to the preceding filter. This will then act like the
  14249. &lsquo;<samp>hwupload</samp>&rsquo; filter, but may be able to avoid an additional copy when
  14250. the input is already in a compatible format.
  14251. </p></li><li>
  14252. Hardware frame input and output
  14253. <p>A device must be supplied for the output, either directly or with the
  14254. &lsquo;<samp>derive_device</samp>&rsquo; option. The input and output devices must be of
  14255. different types and compatible - the exact meaning of this is
  14256. system-dependent, but typically it means that they must refer to the same
  14257. underlying hardware context (for example, refer to the same graphics card).
  14258. </p>
  14259. <p>If the input frames were originally created on the output device, then unmap
  14260. to retrieve the original frames.
  14261. </p>
  14262. <p>Otherwise, map the frames to the output device - create new hardware frames
  14263. on the output corresponding to the frames on the input.
  14264. </p></li></ul>
  14265. <p>The following additional parameters are accepted:
  14266. </p>
  14267. <dl compact="compact">
  14268. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  14269. <dd><p>Set the frame mapping mode. Some combination of:
  14270. </p><dl compact="compact">
  14271. <dt><var>read</var></dt>
  14272. <dd><p>The mapped frame should be readable.
  14273. </p></dd>
  14274. <dt><var>write</var></dt>
  14275. <dd><p>The mapped frame should be writeable.
  14276. </p></dd>
  14277. <dt><var>overwrite</var></dt>
  14278. <dd><p>The mapping will always overwrite the entire frame.
  14279. </p>
  14280. <p>This may improve performance in some cases, as the original contents of the
  14281. frame need not be loaded.
  14282. </p></dd>
  14283. <dt><var>direct</var></dt>
  14284. <dd><p>The mapping must not involve any copying.
  14285. </p>
  14286. <p>Indirect mappings to copies of frames are created in some cases where either
  14287. direct mapping is not possible or it would have unexpected properties.
  14288. Setting this flag ensures that the mapping is direct and will fail if that is
  14289. not possible.
  14290. </p></dd>
  14291. </dl>
  14292. <p>Defaults to <var>read+write</var> if not specified.
  14293. </p>
  14294. </dd>
  14295. <dt>&lsquo;<samp>derive_device <var>type</var></samp>&rsquo;</dt>
  14296. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  14297. device of type <var>type</var> from the device the input frames exist on.
  14298. </p>
  14299. </dd>
  14300. <dt>&lsquo;<samp>reverse</samp>&rsquo;</dt>
  14301. <dd><p>In a hardware to hardware mapping, map in reverse - create frames in the sink
  14302. and map them back to the source. This may be necessary in some cases where
  14303. a mapping in one direction is required but only the opposite direction is
  14304. supported by the devices being used.
  14305. </p>
  14306. <p>This option is dangerous - it may break the preceding filter in undefined
  14307. ways if there are any additional constraints on that filter&rsquo;s output.
  14308. Do not use it without fully understanding the implications of its use.
  14309. </p></dd>
  14310. </dl>
  14311. <p><a name="hwupload"></a>
  14312. </p><a name="hwupload-1"></a>
  14313. <h2 class="section"><a href="ffmpeg-filters.html#toc-hwupload-1">11.100 hwupload</a></h2>
  14314. <p>Upload system memory frames to hardware surfaces.
  14315. </p>
  14316. <p>The device to upload to must be supplied when the filter is initialised. If
  14317. using ffmpeg, select the appropriate device with the &lsquo;<samp>-filter_hw_device</samp>&rsquo;
  14318. option or with the &lsquo;<samp>derive_device</samp>&rsquo; option. The input and output devices
  14319. must be of different types and compatible - the exact meaning of this is
  14320. system-dependent, but typically it means that they must refer to the same
  14321. underlying hardware context (for example, refer to the same graphics card).
  14322. </p>
  14323. <p>The following additional parameters are accepted:
  14324. </p>
  14325. <dl compact="compact">
  14326. <dt>&lsquo;<samp>derive_device <var>type</var></samp>&rsquo;</dt>
  14327. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  14328. device of type <var>type</var> from the device the input frames exist on.
  14329. </p></dd>
  14330. </dl>
  14331. <p><a name="hwupload_005fcuda"></a>
  14332. </p><a name="hwupload_005fcuda-1"></a>
  14333. <h2 class="section"><a href="ffmpeg-filters.html#toc-hwupload_005fcuda-1">11.101 hwupload_cuda</a></h2>
  14334. <p>Upload system memory frames to a CUDA device.
  14335. </p>
  14336. <p>It accepts the following optional parameters:
  14337. </p>
  14338. <dl compact="compact">
  14339. <dt>&lsquo;<samp>device</samp>&rsquo;</dt>
  14340. <dd><p>The number of the CUDA device to use
  14341. </p></dd>
  14342. </dl>
  14343. <a name="hqx"></a>
  14344. <h2 class="section"><a href="ffmpeg-filters.html#toc-hqx">11.102 hqx</a></h2>
  14345. <p>Apply a high-quality magnification filter designed for pixel art. This filter
  14346. was originally created by Maxim Stepin.
  14347. </p>
  14348. <p>It accepts the following option:
  14349. </p>
  14350. <dl compact="compact">
  14351. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  14352. <dd><p>Set the scaling dimension: <code>2</code> for <code>hq2x</code>, <code>3</code> for
  14353. <code>hq3x</code> and <code>4</code> for <code>hq4x</code>.
  14354. Default is <code>3</code>.
  14355. </p></dd>
  14356. </dl>
  14357. <a name="hstack"></a>
  14358. <h2 class="section"><a href="ffmpeg-filters.html#toc-hstack">11.103 hstack</a></h2>
  14359. <p>Stack input videos horizontally.
  14360. </p>
  14361. <p>All streams must be of same pixel format and of same height.
  14362. </p>
  14363. <p>Note that this filter is faster than using <a href="#overlay">overlay</a> and <a href="#pad">pad</a> filter
  14364. to create same output.
  14365. </p>
  14366. <p>The filter accepts the following option:
  14367. </p>
  14368. <dl compact="compact">
  14369. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  14370. <dd><p>Set number of input streams. Default is 2.
  14371. </p>
  14372. </dd>
  14373. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  14374. <dd><p>If set to 1, force the output to terminate when the shortest input
  14375. terminates. Default value is 0.
  14376. </p></dd>
  14377. </dl>
  14378. <a name="hue"></a>
  14379. <h2 class="section"><a href="ffmpeg-filters.html#toc-hue">11.104 hue</a></h2>
  14380. <p>Modify the hue and/or the saturation of the input.
  14381. </p>
  14382. <p>It accepts the following parameters:
  14383. </p>
  14384. <dl compact="compact">
  14385. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  14386. <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
  14387. and defaults to &quot;0&quot;.
  14388. </p>
  14389. </dd>
  14390. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  14391. <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
  14392. defaults to &quot;1&quot;.
  14393. </p>
  14394. </dd>
  14395. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  14396. <dd><p>Specify the hue angle as a number of radians. It accepts an
  14397. expression, and defaults to &quot;0&quot;.
  14398. </p>
  14399. </dd>
  14400. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  14401. <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
  14402. defaults to &quot;0&quot;.
  14403. </p></dd>
  14404. </dl>
  14405. <p>&lsquo;<samp>h</samp>&rsquo; and &lsquo;<samp>H</samp>&rsquo; are mutually exclusive, and can&rsquo;t be
  14406. specified at the same time.
  14407. </p>
  14408. <p>The &lsquo;<samp>b</samp>&rsquo;, &lsquo;<samp>h</samp>&rsquo;, &lsquo;<samp>H</samp>&rsquo; and &lsquo;<samp>s</samp>&rsquo; option values are
  14409. expressions containing the following constants:
  14410. </p>
  14411. <dl compact="compact">
  14412. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  14413. <dd><p>frame count of the input frame starting from 0
  14414. </p>
  14415. </dd>
  14416. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  14417. <dd><p>presentation timestamp of the input frame expressed in time base units
  14418. </p>
  14419. </dd>
  14420. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  14421. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  14422. </p>
  14423. </dd>
  14424. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  14425. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  14426. </p>
  14427. </dd>
  14428. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  14429. <dd><p>time base of the input video
  14430. </p></dd>
  14431. </dl>
  14432. <a name="Examples-135"></a>
  14433. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-135">11.104.1 Examples</a></h3>
  14434. <ul>
  14435. <li>
  14436. Set the hue to 90 degrees and the saturation to 1.0:
  14437. <div class="example">
  14438. <pre class="example">hue=h=90:s=1
  14439. </pre></div>
  14440. </li><li>
  14441. Same command but expressing the hue in radians:
  14442. <div class="example">
  14443. <pre class="example">hue=H=PI/2:s=1
  14444. </pre></div>
  14445. </li><li>
  14446. Rotate hue and make the saturation swing between 0
  14447. and 2 over a period of 1 second:
  14448. <div class="example">
  14449. <pre class="example">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
  14450. </pre></div>
  14451. </li><li>
  14452. Apply a 3 seconds saturation fade-in effect starting at 0:
  14453. <div class="example">
  14454. <pre class="example">hue=&quot;s=min(t/3\,1)&quot;
  14455. </pre></div>
  14456. <p>The general fade-in expression can be written as:
  14457. </p><div class="example">
  14458. <pre class="example">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
  14459. </pre></div>
  14460. </li><li>
  14461. Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
  14462. <div class="example">
  14463. <pre class="example">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
  14464. </pre></div>
  14465. <p>The general fade-out expression can be written as:
  14466. </p><div class="example">
  14467. <pre class="example">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
  14468. </pre></div>
  14469. </li></ul>
  14470. <a name="Commands-9"></a>
  14471. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-9">11.104.2 Commands</a></h3>
  14472. <p>This filter supports the following commands:
  14473. </p><dl compact="compact">
  14474. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  14475. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  14476. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  14477. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  14478. <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
  14479. The command accepts the same syntax of the corresponding option.
  14480. </p>
  14481. <p>If the specified expression is not valid, it is kept at its current
  14482. value.
  14483. </p></dd>
  14484. </dl>
  14485. <a name="hysteresis"></a>
  14486. <h2 class="section"><a href="ffmpeg-filters.html#toc-hysteresis">11.105 hysteresis</a></h2>
  14487. <p>Grow first stream into second stream by connecting components.
  14488. This makes it possible to build more robust edge masks.
  14489. </p>
  14490. <p>This filter accepts the following options:
  14491. </p>
  14492. <dl compact="compact">
  14493. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  14494. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  14495. copied from first stream.
  14496. By default value 0xf, all planes will be processed.
  14497. </p>
  14498. </dd>
  14499. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  14500. <dd><p>Set threshold which is used in filtering. If pixel component value is higher than
  14501. this value filter algorithm for connecting components is activated.
  14502. By default value is 0.
  14503. </p></dd>
  14504. </dl>
  14505. <p>The <code>hysteresis</code> filter also supports the <a href="#framesync">framesync</a> options.
  14506. </p>
  14507. <a name="idet"></a>
  14508. <h2 class="section"><a href="ffmpeg-filters.html#toc-idet">11.106 idet</a></h2>
  14509. <p>Detect video interlacing type.
  14510. </p>
  14511. <p>This filter tries to detect if the input frames are interlaced, progressive,
  14512. top or bottom field first. It will also try to detect fields that are
  14513. repeated between adjacent frames (a sign of telecine).
  14514. </p>
  14515. <p>Single frame detection considers only immediately adjacent frames when classifying each frame.
  14516. Multiple frame detection incorporates the classification history of previous frames.
  14517. </p>
  14518. <p>The filter will log these metadata values:
  14519. </p>
  14520. <dl compact="compact">
  14521. <dt>&lsquo;<samp>single.current_frame</samp>&rsquo;</dt>
  14522. <dd><p>Detected type of current frame using single-frame detection. One of:
  14523. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  14524. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  14525. </p>
  14526. </dd>
  14527. <dt>&lsquo;<samp>single.tff</samp>&rsquo;</dt>
  14528. <dd><p>Cumulative number of frames detected as top field first using single-frame detection.
  14529. </p>
  14530. </dd>
  14531. <dt>&lsquo;<samp>multiple.tff</samp>&rsquo;</dt>
  14532. <dd><p>Cumulative number of frames detected as top field first using multiple-frame detection.
  14533. </p>
  14534. </dd>
  14535. <dt>&lsquo;<samp>single.bff</samp>&rsquo;</dt>
  14536. <dd><p>Cumulative number of frames detected as bottom field first using single-frame detection.
  14537. </p>
  14538. </dd>
  14539. <dt>&lsquo;<samp>multiple.current_frame</samp>&rsquo;</dt>
  14540. <dd><p>Detected type of current frame using multiple-frame detection. One of:
  14541. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  14542. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  14543. </p>
  14544. </dd>
  14545. <dt>&lsquo;<samp>multiple.bff</samp>&rsquo;</dt>
  14546. <dd><p>Cumulative number of frames detected as bottom field first using multiple-frame detection.
  14547. </p>
  14548. </dd>
  14549. <dt>&lsquo;<samp>single.progressive</samp>&rsquo;</dt>
  14550. <dd><p>Cumulative number of frames detected as progressive using single-frame detection.
  14551. </p>
  14552. </dd>
  14553. <dt>&lsquo;<samp>multiple.progressive</samp>&rsquo;</dt>
  14554. <dd><p>Cumulative number of frames detected as progressive using multiple-frame detection.
  14555. </p>
  14556. </dd>
  14557. <dt>&lsquo;<samp>single.undetermined</samp>&rsquo;</dt>
  14558. <dd><p>Cumulative number of frames that could not be classified using single-frame detection.
  14559. </p>
  14560. </dd>
  14561. <dt>&lsquo;<samp>multiple.undetermined</samp>&rsquo;</dt>
  14562. <dd><p>Cumulative number of frames that could not be classified using multiple-frame detection.
  14563. </p>
  14564. </dd>
  14565. <dt>&lsquo;<samp>repeated.current_frame</samp>&rsquo;</dt>
  14566. <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;.
  14567. </p>
  14568. </dd>
  14569. <dt>&lsquo;<samp>repeated.neither</samp>&rsquo;</dt>
  14570. <dd><p>Cumulative number of frames with no repeated field.
  14571. </p>
  14572. </dd>
  14573. <dt>&lsquo;<samp>repeated.top</samp>&rsquo;</dt>
  14574. <dd><p>Cumulative number of frames with the top field repeated from the previous frame&rsquo;s top field.
  14575. </p>
  14576. </dd>
  14577. <dt>&lsquo;<samp>repeated.bottom</samp>&rsquo;</dt>
  14578. <dd><p>Cumulative number of frames with the bottom field repeated from the previous frame&rsquo;s bottom field.
  14579. </p></dd>
  14580. </dl>
  14581. <p>The filter accepts the following options:
  14582. </p>
  14583. <dl compact="compact">
  14584. <dt>&lsquo;<samp>intl_thres</samp>&rsquo;</dt>
  14585. <dd><p>Set interlacing threshold.
  14586. </p></dd>
  14587. <dt>&lsquo;<samp>prog_thres</samp>&rsquo;</dt>
  14588. <dd><p>Set progressive threshold.
  14589. </p></dd>
  14590. <dt>&lsquo;<samp>rep_thres</samp>&rsquo;</dt>
  14591. <dd><p>Threshold for repeated field detection.
  14592. </p></dd>
  14593. <dt>&lsquo;<samp>half_life</samp>&rsquo;</dt>
  14594. <dd><p>Number of frames after which a given frame&rsquo;s contribution to the
  14595. statistics is halved (i.e., it contributes only 0.5 to its
  14596. classification). The default of 0 means that all frames seen are given
  14597. full weight of 1.0 forever.
  14598. </p></dd>
  14599. <dt>&lsquo;<samp>analyze_interlaced_flag</samp>&rsquo;</dt>
  14600. <dd><p>When this is not 0 then idet will use the specified number of frames to determine
  14601. if the interlaced flag is accurate, it will not count undetermined frames.
  14602. If the flag is found to be accurate it will be used without any further
  14603. computations, if it is found to be inaccurate it will be cleared without any
  14604. further computations. This allows inserting the idet filter as a low computational
  14605. method to clean up the interlaced flag
  14606. </p></dd>
  14607. </dl>
  14608. <a name="il"></a>
  14609. <h2 class="section"><a href="ffmpeg-filters.html#toc-il">11.107 il</a></h2>
  14610. <p>Deinterleave or interleave fields.
  14611. </p>
  14612. <p>This filter allows one to process interlaced images fields without
  14613. deinterlacing them. Deinterleaving splits the input frame into 2
  14614. fields (so called half pictures). Odd lines are moved to the top
  14615. half of the output image, even lines to the bottom half.
  14616. You can process (filter) them independently and then re-interleave them.
  14617. </p>
  14618. <p>The filter accepts the following options:
  14619. </p>
  14620. <dl compact="compact">
  14621. <dt>&lsquo;<samp>luma_mode, l</samp>&rsquo;</dt>
  14622. <dt>&lsquo;<samp>chroma_mode, c</samp>&rsquo;</dt>
  14623. <dt>&lsquo;<samp>alpha_mode, a</samp>&rsquo;</dt>
  14624. <dd><p>Available values for <var>luma_mode</var>, <var>chroma_mode</var> and
  14625. <var>alpha_mode</var> are:
  14626. </p>
  14627. <dl compact="compact">
  14628. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  14629. <dd><p>Do nothing.
  14630. </p>
  14631. </dd>
  14632. <dt>&lsquo;<samp>deinterleave, d</samp>&rsquo;</dt>
  14633. <dd><p>Deinterleave fields, placing one above the other.
  14634. </p>
  14635. </dd>
  14636. <dt>&lsquo;<samp>interleave, i</samp>&rsquo;</dt>
  14637. <dd><p>Interleave fields. Reverse the effect of deinterleaving.
  14638. </p></dd>
  14639. </dl>
  14640. <p>Default value is <code>none</code>.
  14641. </p>
  14642. </dd>
  14643. <dt>&lsquo;<samp>luma_swap, ls</samp>&rsquo;</dt>
  14644. <dt>&lsquo;<samp>chroma_swap, cs</samp>&rsquo;</dt>
  14645. <dt>&lsquo;<samp>alpha_swap, as</samp>&rsquo;</dt>
  14646. <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code>0</code>.
  14647. </p></dd>
  14648. </dl>
  14649. <a name="Commands-23"></a>
  14650. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-23">11.107.1 Commands</a></h3>
  14651. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  14652. </p>
  14653. <a name="inflate"></a>
  14654. <h2 class="section"><a href="ffmpeg-filters.html#toc-inflate">11.108 inflate</a></h2>
  14655. <p>Apply inflate effect to the video.
  14656. </p>
  14657. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  14658. only values higher than the pixel.
  14659. </p>
  14660. <p>It accepts the following options:
  14661. </p>
  14662. <dl compact="compact">
  14663. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  14664. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  14665. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  14666. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  14667. <dd><p>Limit the maximum change for each plane, default is 65535.
  14668. If 0, plane will remain unchanged.
  14669. </p></dd>
  14670. </dl>
  14671. <a name="Commands-36"></a>
  14672. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-36">11.108.1 Commands</a></h3>
  14673. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  14674. </p>
  14675. <a name="interlace"></a>
  14676. <h2 class="section"><a href="ffmpeg-filters.html#toc-interlace">11.109 interlace</a></h2>
  14677. <p>Simple interlacing filter from progressive contents. This interleaves upper (or
  14678. lower) lines from odd frames with lower (or upper) lines from even frames,
  14679. halving the frame rate and preserving image height.
  14680. </p>
  14681. <div class="example">
  14682. <pre class="example"> Original Original New Frame
  14683. Frame 'j' Frame 'j+1' (tff)
  14684. ========== =========== ==================
  14685. Line 0 --------------------&gt; Frame 'j' Line 0
  14686. Line 1 Line 1 ----&gt; Frame 'j+1' Line 1
  14687. Line 2 ---------------------&gt; Frame 'j' Line 2
  14688. Line 3 Line 3 ----&gt; Frame 'j+1' Line 3
  14689. ... ... ...
  14690. New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
  14691. </pre></div>
  14692. <p>It accepts the following optional parameters:
  14693. </p>
  14694. <dl compact="compact">
  14695. <dt>&lsquo;<samp>scan</samp>&rsquo;</dt>
  14696. <dd><p>This determines whether the interlaced frame is taken from the even
  14697. (tff - default) or odd (bff) lines of the progressive frame.
  14698. </p>
  14699. </dd>
  14700. <dt>&lsquo;<samp>lowpass</samp>&rsquo;</dt>
  14701. <dd><p>Vertical lowpass filter to avoid twitter interlacing and
  14702. reduce moire patterns.
  14703. </p>
  14704. <dl compact="compact">
  14705. <dt>&lsquo;<samp>0, off</samp>&rsquo;</dt>
  14706. <dd><p>Disable vertical lowpass filter
  14707. </p>
  14708. </dd>
  14709. <dt>&lsquo;<samp>1, linear</samp>&rsquo;</dt>
  14710. <dd><p>Enable linear filter (default)
  14711. </p>
  14712. </dd>
  14713. <dt>&lsquo;<samp>2, complex</samp>&rsquo;</dt>
  14714. <dd><p>Enable complex filter. This will slightly less reduce twitter and moire
  14715. but better retain detail and subjective sharpness impression.
  14716. </p>
  14717. </dd>
  14718. </dl>
  14719. </dd>
  14720. </dl>
  14721. <a name="kerndeint"></a>
  14722. <h2 class="section"><a href="ffmpeg-filters.html#toc-kerndeint">11.110 kerndeint</a></h2>
  14723. <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
  14724. deinterling. Work on interlaced parts of a video to produce
  14725. progressive frames.
  14726. </p>
  14727. <p>The description of the accepted parameters follows.
  14728. </p>
  14729. <dl compact="compact">
  14730. <dt>&lsquo;<samp>thresh</samp>&rsquo;</dt>
  14731. <dd><p>Set the threshold which affects the filter&rsquo;s tolerance when
  14732. determining if a pixel line must be processed. It must be an integer
  14733. in the range [0,255] and defaults to 10. A value of 0 will result in
  14734. applying the process on every pixels.
  14735. </p>
  14736. </dd>
  14737. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  14738. <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
  14739. Default is 0.
  14740. </p>
  14741. </dd>
  14742. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  14743. <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
  14744. 0. Default is 0.
  14745. </p>
  14746. </dd>
  14747. <dt>&lsquo;<samp>sharp</samp>&rsquo;</dt>
  14748. <dd><p>Enable additional sharpening if set to 1. Default is 0.
  14749. </p>
  14750. </dd>
  14751. <dt>&lsquo;<samp>twoway</samp>&rsquo;</dt>
  14752. <dd><p>Enable twoway sharpening if set to 1. Default is 0.
  14753. </p></dd>
  14754. </dl>
  14755. <a name="Examples-58"></a>
  14756. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-58">11.110.1 Examples</a></h3>
  14757. <ul>
  14758. <li>
  14759. Apply default values:
  14760. <div class="example">
  14761. <pre class="example">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
  14762. </pre></div>
  14763. </li><li>
  14764. Enable additional sharpening:
  14765. <div class="example">
  14766. <pre class="example">kerndeint=sharp=1
  14767. </pre></div>
  14768. </li><li>
  14769. Paint processed pixels in white:
  14770. <div class="example">
  14771. <pre class="example">kerndeint=map=1
  14772. </pre></div>
  14773. </li></ul>
  14774. <a name="lagfun"></a>
  14775. <h2 class="section"><a href="ffmpeg-filters.html#toc-lagfun">11.111 lagfun</a></h2>
  14776. <p>Slowly update darker pixels.
  14777. </p>
  14778. <p>This filter makes short flashes of light appear longer.
  14779. This filter accepts the following options:
  14780. </p>
  14781. <dl compact="compact">
  14782. <dt>&lsquo;<samp>decay</samp>&rsquo;</dt>
  14783. <dd><p>Set factor for decaying. Default is .95. Allowed range is from 0 to 1.
  14784. </p>
  14785. </dd>
  14786. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  14787. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  14788. </p></dd>
  14789. </dl>
  14790. <a name="lenscorrection"></a>
  14791. <h2 class="section"><a href="ffmpeg-filters.html#toc-lenscorrection">11.112 lenscorrection</a></h2>
  14792. <p>Correct radial lens distortion
  14793. </p>
  14794. <p>This filter can be used to correct for radial distortion as can result from the use
  14795. of wide angle lenses, and thereby re-rectify the image. To find the right parameters
  14796. one can use tools available for example as part of opencv or simply trial-and-error.
  14797. To use opencv use the calibration sample (under samples/cpp) from the opencv sources
  14798. and extract the k1 and k2 coefficients from the resulting matrix.
  14799. </p>
  14800. <p>Note that effectively the same filter is available in the open-source tools Krita and
  14801. Digikam from the KDE project.
  14802. </p>
  14803. <p>In contrast to the <a href="#vignette">vignette</a> filter, which can also be used to compensate lens errors,
  14804. this filter corrects the distortion of the image, whereas <a href="#vignette">vignette</a> corrects the
  14805. brightness distribution, so you may want to use both filters together in certain
  14806. cases, though you will have to take care of ordering, i.e. whether vignetting should
  14807. be applied before or after lens correction.
  14808. </p>
  14809. <a name="Options-1"></a>
  14810. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Options-1">11.112.1 Options</a></h3>
  14811. <p>The filter accepts the following options:
  14812. </p>
  14813. <dl compact="compact">
  14814. <dt>&lsquo;<samp>cx</samp>&rsquo;</dt>
  14815. <dd><p>Relative x-coordinate of the focal point of the image, and thereby the center of the
  14816. distortion. This value has a range [0,1] and is expressed as fractions of the image
  14817. width. Default is 0.5.
  14818. </p></dd>
  14819. <dt>&lsquo;<samp>cy</samp>&rsquo;</dt>
  14820. <dd><p>Relative y-coordinate of the focal point of the image, and thereby the center of the
  14821. distortion. This value has a range [0,1] and is expressed as fractions of the image
  14822. height. Default is 0.5.
  14823. </p></dd>
  14824. <dt>&lsquo;<samp>k1</samp>&rsquo;</dt>
  14825. <dd><p>Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means
  14826. no correction. Default is 0.
  14827. </p></dd>
  14828. <dt>&lsquo;<samp>k2</samp>&rsquo;</dt>
  14829. <dd><p>Coefficient of the double quadratic correction term. This value has a range [-1,1].
  14830. 0 means no correction. Default is 0.
  14831. </p></dd>
  14832. </dl>
  14833. <p>The formula that generates the correction is:
  14834. </p>
  14835. <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)
  14836. </p>
  14837. <p>where <var>r_0</var> is halve of the image diagonal and <var>r_src</var> and <var>r_tgt</var> are the
  14838. distances from the focal point in the source and target images, respectively.
  14839. </p>
  14840. <a name="lensfun"></a>
  14841. <h2 class="section"><a href="ffmpeg-filters.html#toc-lensfun">11.113 lensfun</a></h2>
  14842. <p>Apply lens correction via the lensfun library (<a href="http://lensfun.sourceforge.net/">http://lensfun.sourceforge.net/</a>).
  14843. </p>
  14844. <p>The <code>lensfun</code> filter requires the camera make, camera model, and lens model
  14845. to apply the lens correction. The filter will load the lensfun database and
  14846. query it to find the corresponding camera and lens entries in the database. As
  14847. long as these entries can be found with the given options, the filter can
  14848. perform corrections on frames. Note that incomplete strings will result in the
  14849. filter choosing the best match with the given options, and the filter will
  14850. output the chosen camera and lens models (logged with level &quot;info&quot;). You must
  14851. provide the make, camera model, and lens model as they are required.
  14852. </p>
  14853. <p>The filter accepts the following options:
  14854. </p>
  14855. <dl compact="compact">
  14856. <dt>&lsquo;<samp>make</samp>&rsquo;</dt>
  14857. <dd><p>The make of the camera (for example, &quot;Canon&quot;). This option is required.
  14858. </p>
  14859. </dd>
  14860. <dt>&lsquo;<samp>model</samp>&rsquo;</dt>
  14861. <dd><p>The model of the camera (for example, &quot;Canon EOS 100D&quot;). This option is
  14862. required.
  14863. </p>
  14864. </dd>
  14865. <dt>&lsquo;<samp>lens_model</samp>&rsquo;</dt>
  14866. <dd><p>The model of the lens (for example, &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;). This
  14867. option is required.
  14868. </p>
  14869. </dd>
  14870. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  14871. <dd><p>The type of correction to apply. The following values are valid options:
  14872. </p>
  14873. <dl compact="compact">
  14874. <dt>&lsquo;<samp>vignetting</samp>&rsquo;</dt>
  14875. <dd><p>Enables fixing lens vignetting.
  14876. </p>
  14877. </dd>
  14878. <dt>&lsquo;<samp>geometry</samp>&rsquo;</dt>
  14879. <dd><p>Enables fixing lens geometry. This is the default.
  14880. </p>
  14881. </dd>
  14882. <dt>&lsquo;<samp>subpixel</samp>&rsquo;</dt>
  14883. <dd><p>Enables fixing chromatic aberrations.
  14884. </p>
  14885. </dd>
  14886. <dt>&lsquo;<samp>vig_geo</samp>&rsquo;</dt>
  14887. <dd><p>Enables fixing lens vignetting and lens geometry.
  14888. </p>
  14889. </dd>
  14890. <dt>&lsquo;<samp>vig_subpixel</samp>&rsquo;</dt>
  14891. <dd><p>Enables fixing lens vignetting and chromatic aberrations.
  14892. </p>
  14893. </dd>
  14894. <dt>&lsquo;<samp>distortion</samp>&rsquo;</dt>
  14895. <dd><p>Enables fixing both lens geometry and chromatic aberrations.
  14896. </p>
  14897. </dd>
  14898. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  14899. <dd><p>Enables all possible corrections.
  14900. </p>
  14901. </dd>
  14902. </dl>
  14903. </dd>
  14904. <dt>&lsquo;<samp>focal_length</samp>&rsquo;</dt>
  14905. <dd><p>The focal length of the image/video (zoom; expected constant for video). For
  14906. example, a 18&ndash;55mm lens has focal length range of [18&ndash;55], so a value in that
  14907. range should be chosen when using that lens. Default 18.
  14908. </p>
  14909. </dd>
  14910. <dt>&lsquo;<samp>aperture</samp>&rsquo;</dt>
  14911. <dd><p>The aperture of the image/video (expected constant for video). Note that
  14912. aperture is only used for vignetting correction. Default 3.5.
  14913. </p>
  14914. </dd>
  14915. <dt>&lsquo;<samp>focus_distance</samp>&rsquo;</dt>
  14916. <dd><p>The focus distance of the image/video (expected constant for video). Note that
  14917. focus distance is only used for vignetting and only slightly affects the
  14918. vignetting correction process. If unknown, leave it at the default value (which
  14919. is 1000).
  14920. </p>
  14921. </dd>
  14922. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  14923. <dd><p>The scale factor which is applied after transformation. After correction the
  14924. video is no longer necessarily rectangular. This parameter controls how much of
  14925. the resulting image is visible. The value 0 means that a value will be chosen
  14926. automatically such that there is little or no unmapped area in the output
  14927. image. 1.0 means that no additional scaling is done. Lower values may result
  14928. in more of the corrected image being visible, while higher values may avoid
  14929. unmapped areas in the output.
  14930. </p>
  14931. </dd>
  14932. <dt>&lsquo;<samp>target_geometry</samp>&rsquo;</dt>
  14933. <dd><p>The target geometry of the output image/video. The following values are valid
  14934. options:
  14935. </p>
  14936. <dl compact="compact">
  14937. <dt>&lsquo;<samp>rectilinear (default)</samp>&rsquo;</dt>
  14938. <dt>&lsquo;<samp>fisheye</samp>&rsquo;</dt>
  14939. <dt>&lsquo;<samp>panoramic</samp>&rsquo;</dt>
  14940. <dt>&lsquo;<samp>equirectangular</samp>&rsquo;</dt>
  14941. <dt>&lsquo;<samp>fisheye_orthographic</samp>&rsquo;</dt>
  14942. <dt>&lsquo;<samp>fisheye_stereographic</samp>&rsquo;</dt>
  14943. <dt>&lsquo;<samp>fisheye_equisolid</samp>&rsquo;</dt>
  14944. <dt>&lsquo;<samp>fisheye_thoby</samp>&rsquo;</dt>
  14945. </dl>
  14946. </dd>
  14947. <dt>&lsquo;<samp>reverse</samp>&rsquo;</dt>
  14948. <dd><p>Apply the reverse of image correction (instead of correcting distortion, apply
  14949. it).
  14950. </p>
  14951. </dd>
  14952. <dt>&lsquo;<samp>interpolation</samp>&rsquo;</dt>
  14953. <dd><p>The type of interpolation used when correcting distortion. The following values
  14954. are valid options:
  14955. </p>
  14956. <dl compact="compact">
  14957. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  14958. <dt>&lsquo;<samp>linear (default)</samp>&rsquo;</dt>
  14959. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  14960. </dl>
  14961. </dd>
  14962. </dl>
  14963. <a name="Examples-18"></a>
  14964. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-18">11.113.1 Examples</a></h3>
  14965. <ul>
  14966. <li>
  14967. Apply lens correction with make &quot;Canon&quot;, camera model &quot;Canon EOS 100D&quot;, and lens
  14968. model &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot; with focal length of &quot;18&quot; and
  14969. aperture of &quot;8.0&quot;.
  14970. <div class="example">
  14971. <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
  14972. </pre></div>
  14973. </li><li>
  14974. Apply the same as before, but only for the first 5 seconds of video.
  14975. <div class="example">
  14976. <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
  14977. </pre></div>
  14978. </li></ul>
  14979. <a name="libvmaf"></a>
  14980. <h2 class="section"><a href="ffmpeg-filters.html#toc-libvmaf">11.114 libvmaf</a></h2>
  14981. <p>Obtain the VMAF (Video Multi-Method Assessment Fusion)
  14982. score between two input videos.
  14983. </p>
  14984. <p>The obtained VMAF score is printed through the logging system.
  14985. </p>
  14986. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  14987. After installing the library it can be enabled using:
  14988. <code>./configure --enable-libvmaf --enable-version3</code>.
  14989. If no model path is specified it uses the default model: <code>vmaf_v0.6.1.pkl</code>.
  14990. </p>
  14991. <p>The filter has following options:
  14992. </p>
  14993. <dl compact="compact">
  14994. <dt>&lsquo;<samp>model_path</samp>&rsquo;</dt>
  14995. <dd><p>Set the model path which is to be used for SVM.
  14996. Default value: <code>&quot;/usr/local/share/model/vmaf_v0.6.1.pkl&quot;</code>
  14997. </p>
  14998. </dd>
  14999. <dt>&lsquo;<samp>log_path</samp>&rsquo;</dt>
  15000. <dd><p>Set the file path to be used to store logs.
  15001. </p>
  15002. </dd>
  15003. <dt>&lsquo;<samp>log_fmt</samp>&rsquo;</dt>
  15004. <dd><p>Set the format of the log file (xml or json).
  15005. </p>
  15006. </dd>
  15007. <dt>&lsquo;<samp>enable_transform</samp>&rsquo;</dt>
  15008. <dd><p>This option can enable/disable the <code>score_transform</code> applied to the final predicted VMAF score,
  15009. if you have specified score_transform option in the input parameter file passed to <code>run_vmaf_training.py</code>
  15010. Default value: <code>false</code>
  15011. </p>
  15012. </dd>
  15013. <dt>&lsquo;<samp>phone_model</samp>&rsquo;</dt>
  15014. <dd><p>Invokes the phone model which will generate VMAF scores higher than in the
  15015. regular model, which is more suitable for laptop, TV, etc. viewing conditions.
  15016. Default value: <code>false</code>
  15017. </p>
  15018. </dd>
  15019. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  15020. <dd><p>Enables computing psnr along with vmaf.
  15021. Default value: <code>false</code>
  15022. </p>
  15023. </dd>
  15024. <dt>&lsquo;<samp>ssim</samp>&rsquo;</dt>
  15025. <dd><p>Enables computing ssim along with vmaf.
  15026. Default value: <code>false</code>
  15027. </p>
  15028. </dd>
  15029. <dt>&lsquo;<samp>ms_ssim</samp>&rsquo;</dt>
  15030. <dd><p>Enables computing ms_ssim along with vmaf.
  15031. Default value: <code>false</code>
  15032. </p>
  15033. </dd>
  15034. <dt>&lsquo;<samp>pool</samp>&rsquo;</dt>
  15035. <dd><p>Set the pool method to be used for computing vmaf.
  15036. Options are <code>min</code>, <code>harmonic_mean</code> or <code>mean</code> (default).
  15037. </p>
  15038. </dd>
  15039. <dt>&lsquo;<samp>n_threads</samp>&rsquo;</dt>
  15040. <dd><p>Set number of threads to be used when computing vmaf.
  15041. Default value: <code>0</code>, which makes use of all available logical processors.
  15042. </p>
  15043. </dd>
  15044. <dt>&lsquo;<samp>n_subsample</samp>&rsquo;</dt>
  15045. <dd><p>Set interval for frame subsampling used when computing vmaf.
  15046. Default value: <code>1</code>
  15047. </p>
  15048. </dd>
  15049. <dt>&lsquo;<samp>enable_conf_interval</samp>&rsquo;</dt>
  15050. <dd><p>Enables confidence interval.
  15051. Default value: <code>false</code>
  15052. </p></dd>
  15053. </dl>
  15054. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  15055. </p>
  15056. <a name="Examples-45"></a>
  15057. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-45">11.114.1 Examples</a></h3>
  15058. <ul>
  15059. <li>
  15060. On the below examples the input file &lsquo;<tt>main.mpg</tt>&rsquo; being processed is
  15061. compared with the reference file &lsquo;<tt>ref.mpg</tt>&rsquo;.
  15062. <div class="example">
  15063. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf -f null -
  15064. </pre></div>
  15065. </li><li>
  15066. Example with options:
  15067. <div class="example">
  15068. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf=&quot;psnr=1:log_fmt=json&quot; -f null -
  15069. </pre></div>
  15070. </li><li>
  15071. Example with options and different containers:
  15072. <div class="example">
  15073. <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 -
  15074. </pre></div>
  15075. </li></ul>
  15076. <a name="limiter"></a>
  15077. <h2 class="section"><a href="ffmpeg-filters.html#toc-limiter">11.115 limiter</a></h2>
  15078. <p>Limits the pixel components values to the specified range [min, max].
  15079. </p>
  15080. <p>The filter accepts the following options:
  15081. </p>
  15082. <dl compact="compact">
  15083. <dt>&lsquo;<samp>min</samp>&rsquo;</dt>
  15084. <dd><p>Lower bound. Defaults to the lowest allowed value for the input.
  15085. </p>
  15086. </dd>
  15087. <dt>&lsquo;<samp>max</samp>&rsquo;</dt>
  15088. <dd><p>Upper bound. Defaults to the highest allowed value for the input.
  15089. </p>
  15090. </dd>
  15091. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  15092. <dd><p>Specify which planes will be processed. Defaults to all available.
  15093. </p></dd>
  15094. </dl>
  15095. <a name="loop"></a>
  15096. <h2 class="section"><a href="ffmpeg-filters.html#toc-loop">11.116 loop</a></h2>
  15097. <p>Loop video frames.
  15098. </p>
  15099. <p>The filter accepts the following options:
  15100. </p>
  15101. <dl compact="compact">
  15102. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  15103. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  15104. Default is 0.
  15105. </p>
  15106. </dd>
  15107. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  15108. <dd><p>Set maximal size in number of frames. Default is 0.
  15109. </p>
  15110. </dd>
  15111. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  15112. <dd><p>Set first frame of loop. Default is 0.
  15113. </p></dd>
  15114. </dl>
  15115. <a name="Examples-21"></a>
  15116. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-21">11.116.1 Examples</a></h3>
  15117. <ul>
  15118. <li>
  15119. Loop single first frame infinitely:
  15120. <div class="example">
  15121. <pre class="example">loop=loop=-1:size=1:start=0
  15122. </pre></div>
  15123. </li><li>
  15124. Loop single first frame 10 times:
  15125. <div class="example">
  15126. <pre class="example">loop=loop=10:size=1:start=0
  15127. </pre></div>
  15128. </li><li>
  15129. Loop 10 first frames 5 times:
  15130. <div class="example">
  15131. <pre class="example">loop=loop=5:size=10:start=0
  15132. </pre></div>
  15133. </li></ul>
  15134. <a name="lut1d"></a>
  15135. <h2 class="section"><a href="ffmpeg-filters.html#toc-lut1d">11.117 lut1d</a></h2>
  15136. <p>Apply a 1D LUT to an input video.
  15137. </p>
  15138. <p>The filter accepts the following options:
  15139. </p>
  15140. <dl compact="compact">
  15141. <dt>&lsquo;<samp>file</samp>&rsquo;</dt>
  15142. <dd><p>Set the 1D LUT file name.
  15143. </p>
  15144. <p>Currently supported formats:
  15145. </p><dl compact="compact">
  15146. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  15147. <dd><p>Iridas
  15148. </p></dd>
  15149. <dt>&lsquo;<samp>csp</samp>&rsquo;</dt>
  15150. <dd><p>cineSpace
  15151. </p></dd>
  15152. </dl>
  15153. </dd>
  15154. <dt>&lsquo;<samp>interp</samp>&rsquo;</dt>
  15155. <dd><p>Select interpolation mode.
  15156. </p>
  15157. <p>Available values are:
  15158. </p>
  15159. <dl compact="compact">
  15160. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  15161. <dd><p>Use values from the nearest defined point.
  15162. </p></dd>
  15163. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  15164. <dd><p>Interpolate values using the linear interpolation.
  15165. </p></dd>
  15166. <dt>&lsquo;<samp>cosine</samp>&rsquo;</dt>
  15167. <dd><p>Interpolate values using the cosine interpolation.
  15168. </p></dd>
  15169. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  15170. <dd><p>Interpolate values using the cubic interpolation.
  15171. </p></dd>
  15172. <dt>&lsquo;<samp>spline</samp>&rsquo;</dt>
  15173. <dd><p>Interpolate values using the spline interpolation.
  15174. </p></dd>
  15175. </dl>
  15176. </dd>
  15177. </dl>
  15178. <p><a name="lut3d"></a>
  15179. </p><a name="lut3d-1"></a>
  15180. <h2 class="section"><a href="ffmpeg-filters.html#toc-lut3d-1">11.118 lut3d</a></h2>
  15181. <p>Apply a 3D LUT to an input video.
  15182. </p>
  15183. <p>The filter accepts the following options:
  15184. </p>
  15185. <dl compact="compact">
  15186. <dt>&lsquo;<samp>file</samp>&rsquo;</dt>
  15187. <dd><p>Set the 3D LUT file name.
  15188. </p>
  15189. <p>Currently supported formats:
  15190. </p><dl compact="compact">
  15191. <dt>&lsquo;<samp>3dl</samp>&rsquo;</dt>
  15192. <dd><p>AfterEffects
  15193. </p></dd>
  15194. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  15195. <dd><p>Iridas
  15196. </p></dd>
  15197. <dt>&lsquo;<samp>dat</samp>&rsquo;</dt>
  15198. <dd><p>DaVinci
  15199. </p></dd>
  15200. <dt>&lsquo;<samp>m3d</samp>&rsquo;</dt>
  15201. <dd><p>Pandora
  15202. </p></dd>
  15203. <dt>&lsquo;<samp>csp</samp>&rsquo;</dt>
  15204. <dd><p>cineSpace
  15205. </p></dd>
  15206. </dl>
  15207. </dd>
  15208. <dt>&lsquo;<samp>interp</samp>&rsquo;</dt>
  15209. <dd><p>Select interpolation mode.
  15210. </p>
  15211. <p>Available values are:
  15212. </p>
  15213. <dl compact="compact">
  15214. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  15215. <dd><p>Use values from the nearest defined point.
  15216. </p></dd>
  15217. <dt>&lsquo;<samp>trilinear</samp>&rsquo;</dt>
  15218. <dd><p>Interpolate values using the 8 points defining a cube.
  15219. </p></dd>
  15220. <dt>&lsquo;<samp>tetrahedral</samp>&rsquo;</dt>
  15221. <dd><p>Interpolate values using a tetrahedron.
  15222. </p></dd>
  15223. </dl>
  15224. </dd>
  15225. </dl>
  15226. <a name="lumakey"></a>
  15227. <h2 class="section"><a href="ffmpeg-filters.html#toc-lumakey">11.119 lumakey</a></h2>
  15228. <p>Turn certain luma values into transparency.
  15229. </p>
  15230. <p>The filter accepts the following options:
  15231. </p>
  15232. <dl compact="compact">
  15233. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  15234. <dd><p>Set the luma which will be used as base for transparency.
  15235. Default value is <code>0</code>.
  15236. </p>
  15237. </dd>
  15238. <dt>&lsquo;<samp>tolerance</samp>&rsquo;</dt>
  15239. <dd><p>Set the range of luma values to be keyed out.
  15240. Default value is <code>0.01</code>.
  15241. </p>
  15242. </dd>
  15243. <dt>&lsquo;<samp>softness</samp>&rsquo;</dt>
  15244. <dd><p>Set the range of softness. Default value is <code>0</code>.
  15245. Use this to control gradual transition from zero to full transparency.
  15246. </p></dd>
  15247. </dl>
  15248. <a name="Commands-5"></a>
  15249. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-5">11.119.1 Commands</a></h3>
  15250. <p>This filter supports same <a href="#commands">commands</a> as options.
  15251. The command accepts the same syntax of the corresponding option.
  15252. </p>
  15253. <p>If the specified expression is not valid, it is kept at its current
  15254. value.
  15255. </p>
  15256. <a name="lut_002c-lutrgb_002c-lutyuv"></a>
  15257. <h2 class="section"><a href="ffmpeg-filters.html#toc-lut_002c-lutrgb_002c-lutyuv">11.120 lut, lutrgb, lutyuv</a></h2>
  15258. <p>Compute a look-up table for binding each pixel component input value
  15259. to an output value, and apply it to the input video.
  15260. </p>
  15261. <p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
  15262. to an RGB input video.
  15263. </p>
  15264. <p>These filters accept the following parameters:
  15265. </p><dl compact="compact">
  15266. <dt>&lsquo;<samp>c0</samp>&rsquo;</dt>
  15267. <dd><p>set first pixel component expression
  15268. </p></dd>
  15269. <dt>&lsquo;<samp>c1</samp>&rsquo;</dt>
  15270. <dd><p>set second pixel component expression
  15271. </p></dd>
  15272. <dt>&lsquo;<samp>c2</samp>&rsquo;</dt>
  15273. <dd><p>set third pixel component expression
  15274. </p></dd>
  15275. <dt>&lsquo;<samp>c3</samp>&rsquo;</dt>
  15276. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  15277. </p>
  15278. </dd>
  15279. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  15280. <dd><p>set red component expression
  15281. </p></dd>
  15282. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  15283. <dd><p>set green component expression
  15284. </p></dd>
  15285. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  15286. <dd><p>set blue component expression
  15287. </p></dd>
  15288. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  15289. <dd><p>alpha component expression
  15290. </p>
  15291. </dd>
  15292. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  15293. <dd><p>set Y/luminance component expression
  15294. </p></dd>
  15295. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  15296. <dd><p>set U/Cb component expression
  15297. </p></dd>
  15298. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  15299. <dd><p>set V/Cr component expression
  15300. </p></dd>
  15301. </dl>
  15302. <p>Each of them specifies the expression to use for computing the lookup table for
  15303. the corresponding pixel component values.
  15304. </p>
  15305. <p>The exact component associated to each of the <var>c*</var> options depends on the
  15306. format in input.
  15307. </p>
  15308. <p>The <var>lut</var> filter requires either YUV or RGB pixel formats in input,
  15309. <var>lutrgb</var> requires RGB pixel formats in input, and <var>lutyuv</var> requires YUV.
  15310. </p>
  15311. <p>The expressions can contain the following constants and functions:
  15312. </p>
  15313. <dl compact="compact">
  15314. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  15315. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  15316. <dd><p>The input width and height.
  15317. </p>
  15318. </dd>
  15319. <dt>&lsquo;<samp>val</samp>&rsquo;</dt>
  15320. <dd><p>The input value for the pixel component.
  15321. </p>
  15322. </dd>
  15323. <dt>&lsquo;<samp>clipval</samp>&rsquo;</dt>
  15324. <dd><p>The input value, clipped to the <var>minval</var>-<var>maxval</var> range.
  15325. </p>
  15326. </dd>
  15327. <dt>&lsquo;<samp>maxval</samp>&rsquo;</dt>
  15328. <dd><p>The maximum value for the pixel component.
  15329. </p>
  15330. </dd>
  15331. <dt>&lsquo;<samp>minval</samp>&rsquo;</dt>
  15332. <dd><p>The minimum value for the pixel component.
  15333. </p>
  15334. </dd>
  15335. <dt>&lsquo;<samp>negval</samp>&rsquo;</dt>
  15336. <dd><p>The negated value for the pixel component value, clipped to the
  15337. <var>minval</var>-<var>maxval</var> range; it corresponds to the expression
  15338. &quot;maxval-clipval+minval&quot;.
  15339. </p>
  15340. </dd>
  15341. <dt>&lsquo;<samp>clip(val)</samp>&rsquo;</dt>
  15342. <dd><p>The computed value in <var>val</var>, clipped to the
  15343. <var>minval</var>-<var>maxval</var> range.
  15344. </p>
  15345. </dd>
  15346. <dt>&lsquo;<samp>gammaval(gamma)</samp>&rsquo;</dt>
  15347. <dd><p>The computed gamma correction value of the pixel component value,
  15348. clipped to the <var>minval</var>-<var>maxval</var> range. It corresponds to the
  15349. expression
  15350. &quot;pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval&quot;
  15351. </p>
  15352. </dd>
  15353. </dl>
  15354. <p>All expressions default to &quot;val&quot;.
  15355. </p>
  15356. <a name="Examples-143"></a>
  15357. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-143">11.120.1 Examples</a></h3>
  15358. <ul>
  15359. <li>
  15360. Negate input video:
  15361. <div class="example">
  15362. <pre class="example">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
  15363. lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
  15364. </pre></div>
  15365. <p>The above is the same as:
  15366. </p><div class="example">
  15367. <pre class="example">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
  15368. lutyuv=&quot;y=negval:u=negval:v=negval&quot;
  15369. </pre></div>
  15370. </li><li>
  15371. Negate luminance:
  15372. <div class="example">
  15373. <pre class="example">lutyuv=y=negval
  15374. </pre></div>
  15375. </li><li>
  15376. Remove chroma components, turning the video into a graytone image:
  15377. <div class="example">
  15378. <pre class="example">lutyuv=&quot;u=128:v=128&quot;
  15379. </pre></div>
  15380. </li><li>
  15381. Apply a luma burning effect:
  15382. <div class="example">
  15383. <pre class="example">lutyuv=&quot;y=2*val&quot;
  15384. </pre></div>
  15385. </li><li>
  15386. Remove green and blue components:
  15387. <div class="example">
  15388. <pre class="example">lutrgb=&quot;g=0:b=0&quot;
  15389. </pre></div>
  15390. </li><li>
  15391. Set a constant alpha channel value on input:
  15392. <div class="example">
  15393. <pre class="example">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
  15394. </pre></div>
  15395. </li><li>
  15396. Correct luminance gamma by a factor of 0.5:
  15397. <div class="example">
  15398. <pre class="example">lutyuv=y=gammaval(0.5)
  15399. </pre></div>
  15400. </li><li>
  15401. Discard least significant bits of luma:
  15402. <div class="example">
  15403. <pre class="example">lutyuv=y='bitand(val, 128+64+32)'
  15404. </pre></div>
  15405. </li><li>
  15406. Technicolor like effect:
  15407. <div class="example">
  15408. <pre class="example">lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
  15409. </pre></div>
  15410. </li></ul>
  15411. <a name="lut2_002c-tlut2"></a>
  15412. <h2 class="section"><a href="ffmpeg-filters.html#toc-lut2_002c-tlut2">11.121 lut2, tlut2</a></h2>
  15413. <p>The <code>lut2</code> filter takes two input streams and outputs one
  15414. stream.
  15415. </p>
  15416. <p>The <code>tlut2</code> (time lut2) filter takes two consecutive frames
  15417. from one single stream.
  15418. </p>
  15419. <p>This filter accepts the following parameters:
  15420. </p><dl compact="compact">
  15421. <dt>&lsquo;<samp>c0</samp>&rsquo;</dt>
  15422. <dd><p>set first pixel component expression
  15423. </p></dd>
  15424. <dt>&lsquo;<samp>c1</samp>&rsquo;</dt>
  15425. <dd><p>set second pixel component expression
  15426. </p></dd>
  15427. <dt>&lsquo;<samp>c2</samp>&rsquo;</dt>
  15428. <dd><p>set third pixel component expression
  15429. </p></dd>
  15430. <dt>&lsquo;<samp>c3</samp>&rsquo;</dt>
  15431. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  15432. </p>
  15433. </dd>
  15434. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  15435. <dd><p>set output bit depth, only available for <code>lut2</code> filter. By default is 0,
  15436. which means bit depth is automatically picked from first input format.
  15437. </p></dd>
  15438. </dl>
  15439. <p>The <code>lut2</code> filter also supports the <a href="#framesync">framesync</a> options.
  15440. </p>
  15441. <p>Each of them specifies the expression to use for computing the lookup table for
  15442. the corresponding pixel component values.
  15443. </p>
  15444. <p>The exact component associated to each of the <var>c*</var> options depends on the
  15445. format in inputs.
  15446. </p>
  15447. <p>The expressions can contain the following constants:
  15448. </p>
  15449. <dl compact="compact">
  15450. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  15451. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  15452. <dd><p>The input width and height.
  15453. </p>
  15454. </dd>
  15455. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  15456. <dd><p>The first input value for the pixel component.
  15457. </p>
  15458. </dd>
  15459. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  15460. <dd><p>The second input value for the pixel component.
  15461. </p>
  15462. </dd>
  15463. <dt>&lsquo;<samp>bdx</samp>&rsquo;</dt>
  15464. <dd><p>The first input video bit depth.
  15465. </p>
  15466. </dd>
  15467. <dt>&lsquo;<samp>bdy</samp>&rsquo;</dt>
  15468. <dd><p>The second input video bit depth.
  15469. </p></dd>
  15470. </dl>
  15471. <p>All expressions default to &quot;x&quot;.
  15472. </p>
  15473. <a name="Examples-20"></a>
  15474. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-20">11.121.1 Examples</a></h3>
  15475. <ul>
  15476. <li>
  15477. Highlight differences between two RGB video streams:
  15478. <div class="example">
  15479. <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)'
  15480. </pre></div>
  15481. </li><li>
  15482. Highlight differences between two YUV video streams:
  15483. <div class="example">
  15484. <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)'
  15485. </pre></div>
  15486. </li><li>
  15487. Show max difference between two video streams:
  15488. <div class="example">
  15489. <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)))'
  15490. </pre></div>
  15491. </li></ul>
  15492. <a name="maskedclamp"></a>
  15493. <h2 class="section"><a href="ffmpeg-filters.html#toc-maskedclamp">11.122 maskedclamp</a></h2>
  15494. <p>Clamp the first input stream with the second input and third input stream.
  15495. </p>
  15496. <p>Returns the value of first stream to be between second input
  15497. stream - <code>undershoot</code> and third input stream + <code>overshoot</code>.
  15498. </p>
  15499. <p>This filter accepts the following options:
  15500. </p><dl compact="compact">
  15501. <dt>&lsquo;<samp>undershoot</samp>&rsquo;</dt>
  15502. <dd><p>Default value is <code>0</code>.
  15503. </p>
  15504. </dd>
  15505. <dt>&lsquo;<samp>overshoot</samp>&rsquo;</dt>
  15506. <dd><p>Default value is <code>0</code>.
  15507. </p>
  15508. </dd>
  15509. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  15510. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  15511. copied from first stream.
  15512. By default value 0xf, all planes will be processed.
  15513. </p></dd>
  15514. </dl>
  15515. <a name="maskedmax"></a>
  15516. <h2 class="section"><a href="ffmpeg-filters.html#toc-maskedmax">11.123 maskedmax</a></h2>
  15517. <p>Merge the second and third input stream into output stream using absolute differences
  15518. between second input stream and first input stream and absolute difference between
  15519. third input stream and first input stream. The picked value will be from second input
  15520. stream if second absolute difference is greater than first one or from third input stream
  15521. otherwise.
  15522. </p>
  15523. <p>This filter accepts the following options:
  15524. </p><dl compact="compact">
  15525. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  15526. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  15527. copied from first stream.
  15528. By default value 0xf, all planes will be processed.
  15529. </p></dd>
  15530. </dl>
  15531. <a name="maskedmerge"></a>
  15532. <h2 class="section"><a href="ffmpeg-filters.html#toc-maskedmerge">11.124 maskedmerge</a></h2>
  15533. <p>Merge the first input stream with the second input stream using per pixel
  15534. weights in the third input stream.
  15535. </p>
  15536. <p>A value of 0 in the third stream pixel component means that pixel component
  15537. from first stream is returned unchanged, while maximum value (eg. 255 for
  15538. 8-bit videos) means that pixel component from second stream is returned
  15539. unchanged. Intermediate values define the amount of merging between both
  15540. input stream&rsquo;s pixel components.
  15541. </p>
  15542. <p>This filter accepts the following options:
  15543. </p><dl compact="compact">
  15544. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  15545. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  15546. copied from first stream.
  15547. By default value 0xf, all planes will be processed.
  15548. </p></dd>
  15549. </dl>
  15550. <a name="maskedmin"></a>
  15551. <h2 class="section"><a href="ffmpeg-filters.html#toc-maskedmin">11.125 maskedmin</a></h2>
  15552. <p>Merge the second and third input stream into output stream using absolute differences
  15553. between second input stream and first input stream and absolute difference between
  15554. third input stream and first input stream. The picked value will be from second input
  15555. stream if second absolute difference is less than first one or from third input stream
  15556. otherwise.
  15557. </p>
  15558. <p>This filter accepts the following options:
  15559. </p><dl compact="compact">
  15560. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  15561. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  15562. copied from first stream.
  15563. By default value 0xf, all planes will be processed.
  15564. </p></dd>
  15565. </dl>
  15566. <a name="maskedthreshold"></a>
  15567. <h2 class="section"><a href="ffmpeg-filters.html#toc-maskedthreshold">11.126 maskedthreshold</a></h2>
  15568. <p>Pick pixels comparing absolute difference of two video streams with fixed
  15569. threshold.
  15570. </p>
  15571. <p>If absolute difference between pixel component of first and second video
  15572. stream is equal or lower than user supplied threshold than pixel component
  15573. from first video stream is picked, otherwise pixel component from second
  15574. video stream is picked.
  15575. </p>
  15576. <p>This filter accepts the following options:
  15577. </p><dl compact="compact">
  15578. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  15579. <dd><p>Set threshold used when picking pixels from absolute difference from two input
  15580. video streams.
  15581. </p>
  15582. </dd>
  15583. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  15584. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  15585. copied from second stream.
  15586. By default value 0xf, all planes will be processed.
  15587. </p></dd>
  15588. </dl>
  15589. <a name="maskfun"></a>
  15590. <h2 class="section"><a href="ffmpeg-filters.html#toc-maskfun">11.127 maskfun</a></h2>
  15591. <p>Create mask from input video.
  15592. </p>
  15593. <p>For example it is useful to create motion masks after <code>tblend</code> filter.
  15594. </p>
  15595. <p>This filter accepts the following options:
  15596. </p>
  15597. <dl compact="compact">
  15598. <dt>&lsquo;<samp>low</samp>&rsquo;</dt>
  15599. <dd><p>Set low threshold. Any pixel component lower or exact than this value will be set to 0.
  15600. </p>
  15601. </dd>
  15602. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  15603. <dd><p>Set high threshold. Any pixel component higher than this value will be set to max value
  15604. allowed for current pixel format.
  15605. </p>
  15606. </dd>
  15607. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  15608. <dd><p>Set planes to filter, by default all available planes are filtered.
  15609. </p>
  15610. </dd>
  15611. <dt>&lsquo;<samp>fill</samp>&rsquo;</dt>
  15612. <dd><p>Fill all frame pixels with this value.
  15613. </p>
  15614. </dd>
  15615. <dt>&lsquo;<samp>sum</samp>&rsquo;</dt>
  15616. <dd><p>Set max average pixel value for frame. If sum of all pixel components is higher that this
  15617. average, output frame will be completely filled with value set by <var>fill</var> option.
  15618. Typically useful for scene changes when used in combination with <code>tblend</code> filter.
  15619. </p></dd>
  15620. </dl>
  15621. <a name="mcdeint"></a>
  15622. <h2 class="section"><a href="ffmpeg-filters.html#toc-mcdeint">11.128 mcdeint</a></h2>
  15623. <p>Apply motion-compensation deinterlacing.
  15624. </p>
  15625. <p>It needs one field per frame as input and must thus be used together
  15626. with yadif=1/3 or equivalent.
  15627. </p>
  15628. <p>This filter accepts the following options:
  15629. </p><dl compact="compact">
  15630. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  15631. <dd><p>Set the deinterlacing mode.
  15632. </p>
  15633. <p>It accepts one of the following values:
  15634. </p><dl compact="compact">
  15635. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  15636. <dt>&lsquo;<samp>medium</samp>&rsquo;</dt>
  15637. <dt>&lsquo;<samp>slow</samp>&rsquo;</dt>
  15638. <dd><p>use iterative motion estimation
  15639. </p></dd>
  15640. <dt>&lsquo;<samp>extra_slow</samp>&rsquo;</dt>
  15641. <dd><p>like &lsquo;<samp>slow</samp>&rsquo;, but use multiple reference frames.
  15642. </p></dd>
  15643. </dl>
  15644. <p>Default value is &lsquo;<samp>fast</samp>&rsquo;.
  15645. </p>
  15646. </dd>
  15647. <dt>&lsquo;<samp>parity</samp>&rsquo;</dt>
  15648. <dd><p>Set the picture field parity assumed for the input video. It must be
  15649. one of the following values:
  15650. </p>
  15651. <dl compact="compact">
  15652. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  15653. <dd><p>assume top field first
  15654. </p></dd>
  15655. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  15656. <dd><p>assume bottom field first
  15657. </p></dd>
  15658. </dl>
  15659. <p>Default value is &lsquo;<samp>bff</samp>&rsquo;.
  15660. </p>
  15661. </dd>
  15662. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  15663. <dd><p>Set per-block quantization parameter (QP) used by the internal
  15664. encoder.
  15665. </p>
  15666. <p>Higher values should result in a smoother motion vector field but less
  15667. optimal individual vectors. Default value is 1.
  15668. </p></dd>
  15669. </dl>
  15670. <a name="median"></a>
  15671. <h2 class="section"><a href="ffmpeg-filters.html#toc-median">11.129 median</a></h2>
  15672. <p>Pick median pixel from certain rectangle defined by radius.
  15673. </p>
  15674. <p>This filter accepts the following options:
  15675. </p>
  15676. <dl compact="compact">
  15677. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  15678. <dd><p>Set horizontal radius size. Default value is <code>1</code>.
  15679. Allowed range is integer from 1 to 127.
  15680. </p>
  15681. </dd>
  15682. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  15683. <dd><p>Set which planes to process. Default is <code>15</code>, which is all available planes.
  15684. </p>
  15685. </dd>
  15686. <dt>&lsquo;<samp>radiusV</samp>&rsquo;</dt>
  15687. <dd><p>Set vertical radius size. Default value is <code>0</code>.
  15688. Allowed range is integer from 0 to 127.
  15689. If it is 0, value will be picked from horizontal <code>radius</code> option.
  15690. </p>
  15691. </dd>
  15692. <dt>&lsquo;<samp>percentile</samp>&rsquo;</dt>
  15693. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  15694. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  15695. minimum values, and <code>1</code> maximum values.
  15696. </p></dd>
  15697. </dl>
  15698. <a name="Commands-58"></a>
  15699. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-58">11.129.1 Commands</a></h3>
  15700. <p>This filter supports same <a href="#commands">commands</a> as options.
  15701. The command accepts the same syntax of the corresponding option.
  15702. </p>
  15703. <p>If the specified expression is not valid, it is kept at its current
  15704. value.
  15705. </p>
  15706. <a name="mergeplanes"></a>
  15707. <h2 class="section"><a href="ffmpeg-filters.html#toc-mergeplanes">11.130 mergeplanes</a></h2>
  15708. <p>Merge color channel components from several video streams.
  15709. </p>
  15710. <p>The filter accepts up to 4 input streams, and merge selected input
  15711. planes to the output video.
  15712. </p>
  15713. <p>This filter accepts the following options:
  15714. </p><dl compact="compact">
  15715. <dt>&lsquo;<samp>mapping</samp>&rsquo;</dt>
  15716. <dd><p>Set input to output plane mapping. Default is <code>0</code>.
  15717. </p>
  15718. <p>The mappings is specified as a bitmap. It should be specified as a
  15719. hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. &rsquo;Aa&rsquo; describes the
  15720. mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
  15721. the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
  15722. corresponding input to use (from 0 to 3). The rest of the mappings is
  15723. similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
  15724. plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
  15725. &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
  15726. </p>
  15727. </dd>
  15728. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  15729. <dd><p>Set output pixel format. Default is <code>yuva444p</code>.
  15730. </p></dd>
  15731. </dl>
  15732. <a name="Examples-95"></a>
  15733. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-95">11.130.1 Examples</a></h3>
  15734. <ul>
  15735. <li>
  15736. Merge three gray video streams of same width and height into single video stream:
  15737. <div class="example">
  15738. <pre class="example">[a0][a1][a2]mergeplanes=0x001020:yuv444p
  15739. </pre></div>
  15740. </li><li>
  15741. Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
  15742. <div class="example">
  15743. <pre class="example">[a0][a1]mergeplanes=0x00010210:yuva444p
  15744. </pre></div>
  15745. </li><li>
  15746. Swap Y and A plane in yuva444p stream:
  15747. <div class="example">
  15748. <pre class="example">format=yuva444p,mergeplanes=0x03010200:yuva444p
  15749. </pre></div>
  15750. </li><li>
  15751. Swap U and V plane in yuv420p stream:
  15752. <div class="example">
  15753. <pre class="example">format=yuv420p,mergeplanes=0x000201:yuv420p
  15754. </pre></div>
  15755. </li><li>
  15756. Cast a rgb24 clip to yuv444p:
  15757. <div class="example">
  15758. <pre class="example">format=rgb24,mergeplanes=0x000102:yuv444p
  15759. </pre></div>
  15760. </li></ul>
  15761. <a name="mestimate"></a>
  15762. <h2 class="section"><a href="ffmpeg-filters.html#toc-mestimate">11.131 mestimate</a></h2>
  15763. <p>Estimate and export motion vectors using block matching algorithms.
  15764. Motion vectors are stored in frame side data to be used by other filters.
  15765. </p>
  15766. <p>This filter accepts the following options:
  15767. </p><dl compact="compact">
  15768. <dt>&lsquo;<samp>method</samp>&rsquo;</dt>
  15769. <dd><p>Specify the motion estimation method. Accepts one of the following values:
  15770. </p>
  15771. <dl compact="compact">
  15772. <dt>&lsquo;<samp>esa</samp>&rsquo;</dt>
  15773. <dd><p>Exhaustive search algorithm.
  15774. </p></dd>
  15775. <dt>&lsquo;<samp>tss</samp>&rsquo;</dt>
  15776. <dd><p>Three step search algorithm.
  15777. </p></dd>
  15778. <dt>&lsquo;<samp>tdls</samp>&rsquo;</dt>
  15779. <dd><p>Two dimensional logarithmic search algorithm.
  15780. </p></dd>
  15781. <dt>&lsquo;<samp>ntss</samp>&rsquo;</dt>
  15782. <dd><p>New three step search algorithm.
  15783. </p></dd>
  15784. <dt>&lsquo;<samp>fss</samp>&rsquo;</dt>
  15785. <dd><p>Four step search algorithm.
  15786. </p></dd>
  15787. <dt>&lsquo;<samp>ds</samp>&rsquo;</dt>
  15788. <dd><p>Diamond search algorithm.
  15789. </p></dd>
  15790. <dt>&lsquo;<samp>hexbs</samp>&rsquo;</dt>
  15791. <dd><p>Hexagon-based search algorithm.
  15792. </p></dd>
  15793. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  15794. <dd><p>Enhanced predictive zonal search algorithm.
  15795. </p></dd>
  15796. <dt>&lsquo;<samp>umh</samp>&rsquo;</dt>
  15797. <dd><p>Uneven multi-hexagon search algorithm.
  15798. </p></dd>
  15799. </dl>
  15800. <p>Default value is &lsquo;<samp>esa</samp>&rsquo;.
  15801. </p>
  15802. </dd>
  15803. <dt>&lsquo;<samp>mb_size</samp>&rsquo;</dt>
  15804. <dd><p>Macroblock size. Default <code>16</code>.
  15805. </p>
  15806. </dd>
  15807. <dt>&lsquo;<samp>search_param</samp>&rsquo;</dt>
  15808. <dd><p>Search parameter. Default <code>7</code>.
  15809. </p></dd>
  15810. </dl>
  15811. <a name="midequalizer"></a>
  15812. <h2 class="section"><a href="ffmpeg-filters.html#toc-midequalizer">11.132 midequalizer</a></h2>
  15813. <p>Apply Midway Image Equalization effect using two video streams.
  15814. </p>
  15815. <p>Midway Image Equalization adjusts a pair of images to have the same
  15816. histogram, while maintaining their dynamics as much as possible. It&rsquo;s
  15817. useful for e.g. matching exposures from a pair of stereo cameras.
  15818. </p>
  15819. <p>This filter has two inputs and one output, which must be of same pixel format, but
  15820. may be of different sizes. The output of filter is first input adjusted with
  15821. midway histogram of both inputs.
  15822. </p>
  15823. <p>This filter accepts the following option:
  15824. </p>
  15825. <dl compact="compact">
  15826. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  15827. <dd><p>Set which planes to process. Default is <code>15</code>, which is all available planes.
  15828. </p></dd>
  15829. </dl>
  15830. <a name="minterpolate"></a>
  15831. <h2 class="section"><a href="ffmpeg-filters.html#toc-minterpolate">11.133 minterpolate</a></h2>
  15832. <p>Convert the video to specified frame rate using motion interpolation.
  15833. </p>
  15834. <p>This filter accepts the following options:
  15835. </p><dl compact="compact">
  15836. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  15837. <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>.
  15838. </p>
  15839. </dd>
  15840. <dt>&lsquo;<samp>mi_mode</samp>&rsquo;</dt>
  15841. <dd><p>Motion interpolation mode. Following values are accepted:
  15842. </p><dl compact="compact">
  15843. <dt>&lsquo;<samp>dup</samp>&rsquo;</dt>
  15844. <dd><p>Duplicate previous or next frame for interpolating new ones.
  15845. </p></dd>
  15846. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  15847. <dd><p>Blend source frames. Interpolated frame is mean of previous and next frames.
  15848. </p></dd>
  15849. <dt>&lsquo;<samp>mci</samp>&rsquo;</dt>
  15850. <dd><p>Motion compensated interpolation. Following options are effective when this mode is selected:
  15851. </p>
  15852. <dl compact="compact">
  15853. <dt>&lsquo;<samp>mc_mode</samp>&rsquo;</dt>
  15854. <dd><p>Motion compensation mode. Following values are accepted:
  15855. </p><dl compact="compact">
  15856. <dt>&lsquo;<samp>obmc</samp>&rsquo;</dt>
  15857. <dd><p>Overlapped block motion compensation.
  15858. </p></dd>
  15859. <dt>&lsquo;<samp>aobmc</samp>&rsquo;</dt>
  15860. <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.
  15861. </p></dd>
  15862. </dl>
  15863. <p>Default mode is &lsquo;<samp>obmc</samp>&rsquo;.
  15864. </p>
  15865. </dd>
  15866. <dt>&lsquo;<samp>me_mode</samp>&rsquo;</dt>
  15867. <dd><p>Motion estimation mode. Following values are accepted:
  15868. </p><dl compact="compact">
  15869. <dt>&lsquo;<samp>bidir</samp>&rsquo;</dt>
  15870. <dd><p>Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions.
  15871. </p></dd>
  15872. <dt>&lsquo;<samp>bilat</samp>&rsquo;</dt>
  15873. <dd><p>Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame.
  15874. </p></dd>
  15875. </dl>
  15876. <p>Default mode is &lsquo;<samp>bilat</samp>&rsquo;.
  15877. </p>
  15878. </dd>
  15879. <dt>&lsquo;<samp>me</samp>&rsquo;</dt>
  15880. <dd><p>The algorithm to be used for motion estimation. Following values are accepted:
  15881. </p><dl compact="compact">
  15882. <dt>&lsquo;<samp>esa</samp>&rsquo;</dt>
  15883. <dd><p>Exhaustive search algorithm.
  15884. </p></dd>
  15885. <dt>&lsquo;<samp>tss</samp>&rsquo;</dt>
  15886. <dd><p>Three step search algorithm.
  15887. </p></dd>
  15888. <dt>&lsquo;<samp>tdls</samp>&rsquo;</dt>
  15889. <dd><p>Two dimensional logarithmic search algorithm.
  15890. </p></dd>
  15891. <dt>&lsquo;<samp>ntss</samp>&rsquo;</dt>
  15892. <dd><p>New three step search algorithm.
  15893. </p></dd>
  15894. <dt>&lsquo;<samp>fss</samp>&rsquo;</dt>
  15895. <dd><p>Four step search algorithm.
  15896. </p></dd>
  15897. <dt>&lsquo;<samp>ds</samp>&rsquo;</dt>
  15898. <dd><p>Diamond search algorithm.
  15899. </p></dd>
  15900. <dt>&lsquo;<samp>hexbs</samp>&rsquo;</dt>
  15901. <dd><p>Hexagon-based search algorithm.
  15902. </p></dd>
  15903. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  15904. <dd><p>Enhanced predictive zonal search algorithm.
  15905. </p></dd>
  15906. <dt>&lsquo;<samp>umh</samp>&rsquo;</dt>
  15907. <dd><p>Uneven multi-hexagon search algorithm.
  15908. </p></dd>
  15909. </dl>
  15910. <p>Default algorithm is &lsquo;<samp>epzs</samp>&rsquo;.
  15911. </p>
  15912. </dd>
  15913. <dt>&lsquo;<samp>mb_size</samp>&rsquo;</dt>
  15914. <dd><p>Macroblock size. Default <code>16</code>.
  15915. </p>
  15916. </dd>
  15917. <dt>&lsquo;<samp>search_param</samp>&rsquo;</dt>
  15918. <dd><p>Motion estimation search parameter. Default <code>32</code>.
  15919. </p>
  15920. </dd>
  15921. <dt>&lsquo;<samp>vsbmc</samp>&rsquo;</dt>
  15922. <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).
  15923. </p></dd>
  15924. </dl>
  15925. </dd>
  15926. </dl>
  15927. </dd>
  15928. <dt>&lsquo;<samp>scd</samp>&rsquo;</dt>
  15929. <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:
  15930. </p><dl compact="compact">
  15931. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  15932. <dd><p>Disable scene change detection.
  15933. </p></dd>
  15934. <dt>&lsquo;<samp>fdiff</samp>&rsquo;</dt>
  15935. <dd><p>Frame difference. Corresponding pixel values are compared and if it satisfies <var>scd_threshold</var> scene change is detected.
  15936. </p></dd>
  15937. </dl>
  15938. <p>Default method is &lsquo;<samp>fdiff</samp>&rsquo;.
  15939. </p>
  15940. </dd>
  15941. <dt>&lsquo;<samp>scd_threshold</samp>&rsquo;</dt>
  15942. <dd><p>Scene change detection threshold. Default is <code>10.</code>.
  15943. </p></dd>
  15944. </dl>
  15945. <a name="mix"></a>
  15946. <h2 class="section"><a href="ffmpeg-filters.html#toc-mix">11.134 mix</a></h2>
  15947. <p>Mix several video input streams into one video stream.
  15948. </p>
  15949. <p>A description of the accepted options follows.
  15950. </p>
  15951. <dl compact="compact">
  15952. <dt>&lsquo;<samp>nb_inputs</samp>&rsquo;</dt>
  15953. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  15954. </p>
  15955. </dd>
  15956. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  15957. <dd><p>Specify weight of each input video stream as sequence.
  15958. Each weight is separated by space. If number of weights
  15959. is smaller than number of <var>frames</var> last specified
  15960. weight will be used for all remaining unset weights.
  15961. </p>
  15962. </dd>
  15963. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  15964. <dd><p>Specify scale, if it is set it will be multiplied with sum
  15965. of each weight multiplied with pixel values to give final destination
  15966. pixel value. By default <var>scale</var> is auto scaled to sum of weights.
  15967. </p>
  15968. </dd>
  15969. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  15970. <dd><p>Specify how end of stream is determined.
  15971. </p><dl compact="compact">
  15972. <dt>&lsquo;<samp>longest</samp>&rsquo;</dt>
  15973. <dd><p>The duration of the longest input. (default)
  15974. </p>
  15975. </dd>
  15976. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  15977. <dd><p>The duration of the shortest input.
  15978. </p>
  15979. </dd>
  15980. <dt>&lsquo;<samp>first</samp>&rsquo;</dt>
  15981. <dd><p>The duration of the first input.
  15982. </p></dd>
  15983. </dl>
  15984. </dd>
  15985. </dl>
  15986. <a name="mpdecimate"></a>
  15987. <h2 class="section"><a href="ffmpeg-filters.html#toc-mpdecimate">11.135 mpdecimate</a></h2>
  15988. <p>Drop frames that do not differ greatly from the previous frame in
  15989. order to reduce frame rate.
  15990. </p>
  15991. <p>The main use of this filter is for very-low-bitrate encoding
  15992. (e.g. streaming over dialup modem), but it could in theory be used for
  15993. fixing movies that were inverse-telecined incorrectly.
  15994. </p>
  15995. <p>A description of the accepted options follows.
  15996. </p>
  15997. <dl compact="compact">
  15998. <dt>&lsquo;<samp>max</samp>&rsquo;</dt>
  15999. <dd><p>Set the maximum number of consecutive frames which can be dropped (if
  16000. positive), or the minimum interval between dropped frames (if
  16001. negative). If the value is 0, the frame is dropped disregarding the
  16002. number of previous sequentially dropped frames.
  16003. </p>
  16004. <p>Default value is 0.
  16005. </p>
  16006. </dd>
  16007. <dt>&lsquo;<samp>hi</samp>&rsquo;</dt>
  16008. <dt>&lsquo;<samp>lo</samp>&rsquo;</dt>
  16009. <dt>&lsquo;<samp>frac</samp>&rsquo;</dt>
  16010. <dd><p>Set the dropping threshold values.
  16011. </p>
  16012. <p>Values for &lsquo;<samp>hi</samp>&rsquo; and &lsquo;<samp>lo</samp>&rsquo; are for 8x8 pixel blocks and
  16013. represent actual pixel value differences, so a threshold of 64
  16014. corresponds to 1 unit of difference for each pixel, or the same spread
  16015. out differently over the block.
  16016. </p>
  16017. <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
  16018. than a threshold of &lsquo;<samp>hi</samp>&rsquo;, and if no more than &lsquo;<samp>frac</samp>&rsquo; blocks (1
  16019. meaning the whole image) differ by more than a threshold of &lsquo;<samp>lo</samp>&rsquo;.
  16020. </p>
  16021. <p>Default value for &lsquo;<samp>hi</samp>&rsquo; is 64*12, default value for &lsquo;<samp>lo</samp>&rsquo; is
  16022. 64*5, and default value for &lsquo;<samp>frac</samp>&rsquo; is 0.33.
  16023. </p></dd>
  16024. </dl>
  16025. <a name="negate"></a>
  16026. <h2 class="section"><a href="ffmpeg-filters.html#toc-negate">11.136 negate</a></h2>
  16027. <p>Negate (invert) the input video.
  16028. </p>
  16029. <p>It accepts the following option:
  16030. </p>
  16031. <dl compact="compact">
  16032. <dt>&lsquo;<samp>negate_alpha</samp>&rsquo;</dt>
  16033. <dd><p>With value 1, it negates the alpha component, if present. Default value is 0.
  16034. </p></dd>
  16035. </dl>
  16036. <p><a name="nlmeans"></a>
  16037. </p><a name="nlmeans-1"></a>
  16038. <h2 class="section"><a href="ffmpeg-filters.html#toc-nlmeans-1">11.137 nlmeans</a></h2>
  16039. <p>Denoise frames using Non-Local Means algorithm.
  16040. </p>
  16041. <p>Each pixel is adjusted by looking for other pixels with similar contexts. This
  16042. context similarity is defined by comparing their surrounding patches of size
  16043. &lsquo;<samp>p</samp>&rsquo;x&lsquo;<samp>p</samp>&rsquo;. Patches are searched in an area of &lsquo;<samp>r</samp>&rsquo;x&lsquo;<samp>r</samp>&rsquo;
  16044. around the pixel.
  16045. </p>
  16046. <p>Note that the research area defines centers for patches, which means some
  16047. patches will be made of pixels outside that research area.
  16048. </p>
  16049. <p>The filter accepts the following options.
  16050. </p>
  16051. <dl compact="compact">
  16052. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  16053. <dd><p>Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0].
  16054. </p>
  16055. </dd>
  16056. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  16057. <dd><p>Set patch size. Default is 7. Must be odd number in range [0, 99].
  16058. </p>
  16059. </dd>
  16060. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  16061. <dd><p>Same as &lsquo;<samp>p</samp>&rsquo; but for chroma planes.
  16062. </p>
  16063. <p>The default value is <var>0</var> and means automatic.
  16064. </p>
  16065. </dd>
  16066. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  16067. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  16068. </p>
  16069. </dd>
  16070. <dt>&lsquo;<samp>rc</samp>&rsquo;</dt>
  16071. <dd><p>Same as &lsquo;<samp>r</samp>&rsquo; but for chroma planes.
  16072. </p>
  16073. <p>The default value is <var>0</var> and means automatic.
  16074. </p></dd>
  16075. </dl>
  16076. <a name="nnedi"></a>
  16077. <h2 class="section"><a href="ffmpeg-filters.html#toc-nnedi">11.138 nnedi</a></h2>
  16078. <p>Deinterlace video using neural network edge directed interpolation.
  16079. </p>
  16080. <p>This filter accepts the following options:
  16081. </p>
  16082. <dl compact="compact">
  16083. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  16084. <dd><p>Mandatory option, without binary file filter can not work.
  16085. Currently file can be found here:
  16086. https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin
  16087. </p>
  16088. </dd>
  16089. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  16090. <dd><p>Set which frames to deinterlace, by default it is <code>all</code>.
  16091. Can be <code>all</code> or <code>interlaced</code>.
  16092. </p>
  16093. </dd>
  16094. <dt>&lsquo;<samp>field</samp>&rsquo;</dt>
  16095. <dd><p>Set mode of operation.
  16096. </p>
  16097. <p>Can be one of the following:
  16098. </p>
  16099. <dl compact="compact">
  16100. <dt>&lsquo;<samp>af</samp>&rsquo;</dt>
  16101. <dd><p>Use frame flags, both fields.
  16102. </p></dd>
  16103. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  16104. <dd><p>Use frame flags, single field.
  16105. </p></dd>
  16106. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  16107. <dd><p>Use top field only.
  16108. </p></dd>
  16109. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  16110. <dd><p>Use bottom field only.
  16111. </p></dd>
  16112. <dt>&lsquo;<samp>tf</samp>&rsquo;</dt>
  16113. <dd><p>Use both fields, top first.
  16114. </p></dd>
  16115. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  16116. <dd><p>Use both fields, bottom first.
  16117. </p></dd>
  16118. </dl>
  16119. </dd>
  16120. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  16121. <dd><p>Set which planes to process, by default filter process all frames.
  16122. </p>
  16123. </dd>
  16124. <dt>&lsquo;<samp>nsize</samp>&rsquo;</dt>
  16125. <dd><p>Set size of local neighborhood around each pixel, used by the predictor neural
  16126. network.
  16127. </p>
  16128. <p>Can be one of the following:
  16129. </p>
  16130. <dl compact="compact">
  16131. <dt>&lsquo;<samp>s8x6</samp>&rsquo;</dt>
  16132. <dt>&lsquo;<samp>s16x6</samp>&rsquo;</dt>
  16133. <dt>&lsquo;<samp>s32x6</samp>&rsquo;</dt>
  16134. <dt>&lsquo;<samp>s48x6</samp>&rsquo;</dt>
  16135. <dt>&lsquo;<samp>s8x4</samp>&rsquo;</dt>
  16136. <dt>&lsquo;<samp>s16x4</samp>&rsquo;</dt>
  16137. <dt>&lsquo;<samp>s32x4</samp>&rsquo;</dt>
  16138. </dl>
  16139. </dd>
  16140. <dt>&lsquo;<samp>nns</samp>&rsquo;</dt>
  16141. <dd><p>Set the number of neurons in predictor neural network.
  16142. Can be one of the following:
  16143. </p>
  16144. <dl compact="compact">
  16145. <dt>&lsquo;<samp>n16</samp>&rsquo;</dt>
  16146. <dt>&lsquo;<samp>n32</samp>&rsquo;</dt>
  16147. <dt>&lsquo;<samp>n64</samp>&rsquo;</dt>
  16148. <dt>&lsquo;<samp>n128</samp>&rsquo;</dt>
  16149. <dt>&lsquo;<samp>n256</samp>&rsquo;</dt>
  16150. </dl>
  16151. </dd>
  16152. <dt>&lsquo;<samp>qual</samp>&rsquo;</dt>
  16153. <dd><p>Controls the number of different neural network predictions that are blended
  16154. together to compute the final output value. Can be <code>fast</code>, default or
  16155. <code>slow</code>.
  16156. </p>
  16157. </dd>
  16158. <dt>&lsquo;<samp>etype</samp>&rsquo;</dt>
  16159. <dd><p>Set which set of weights to use in the predictor.
  16160. Can be one of the following:
  16161. </p>
  16162. <dl compact="compact">
  16163. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  16164. <dd><p>weights trained to minimize absolute error
  16165. </p></dd>
  16166. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  16167. <dd><p>weights trained to minimize squared error
  16168. </p></dd>
  16169. </dl>
  16170. </dd>
  16171. <dt>&lsquo;<samp>pscrn</samp>&rsquo;</dt>
  16172. <dd><p>Controls whether or not the prescreener neural network is used to decide
  16173. which pixels should be processed by the predictor neural network and which
  16174. can be handled by simple cubic interpolation.
  16175. The prescreener is trained to know whether cubic interpolation will be
  16176. sufficient for a pixel or whether it should be predicted by the predictor nn.
  16177. The computational complexity of the prescreener nn is much less than that of
  16178. the predictor nn. Since most pixels can be handled by cubic interpolation,
  16179. using the prescreener generally results in much faster processing.
  16180. The prescreener is pretty accurate, so the difference between using it and not
  16181. using it is almost always unnoticeable.
  16182. </p>
  16183. <p>Can be one of the following:
  16184. </p>
  16185. <dl compact="compact">
  16186. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  16187. <dt>&lsquo;<samp>original</samp>&rsquo;</dt>
  16188. <dt>&lsquo;<samp>new</samp>&rsquo;</dt>
  16189. </dl>
  16190. <p>Default is <code>new</code>.
  16191. </p>
  16192. </dd>
  16193. <dt>&lsquo;<samp>fapprox</samp>&rsquo;</dt>
  16194. <dd><p>Set various debugging flags.
  16195. </p></dd>
  16196. </dl>
  16197. <a name="noformat"></a>
  16198. <h2 class="section"><a href="ffmpeg-filters.html#toc-noformat">11.139 noformat</a></h2>
  16199. <p>Force libavfilter not to use any of the specified pixel formats for the
  16200. input to the next filter.
  16201. </p>
  16202. <p>It accepts the following parameters:
  16203. </p><dl compact="compact">
  16204. <dt>&lsquo;<samp>pix_fmts</samp>&rsquo;</dt>
  16205. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  16206. pix_fmts=yuv420p|monow|rgb24&quot;.
  16207. </p>
  16208. </dd>
  16209. </dl>
  16210. <a name="Examples-141"></a>
  16211. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-141">11.139.1 Examples</a></h3>
  16212. <ul>
  16213. <li>
  16214. Force libavfilter to use a format different from <var>yuv420p</var> for the
  16215. input to the vflip filter:
  16216. <div class="example">
  16217. <pre class="example">noformat=pix_fmts=yuv420p,vflip
  16218. </pre></div>
  16219. </li><li>
  16220. Convert the input video to any of the formats not contained in the list:
  16221. <div class="example">
  16222. <pre class="example">noformat=yuv420p|yuv444p|yuv410p
  16223. </pre></div>
  16224. </li></ul>
  16225. <a name="noise"></a>
  16226. <h2 class="section"><a href="ffmpeg-filters.html#toc-noise">11.140 noise</a></h2>
  16227. <p>Add noise on video input frame.
  16228. </p>
  16229. <p>The filter accepts the following options:
  16230. </p>
  16231. <dl compact="compact">
  16232. <dt>&lsquo;<samp>all_seed</samp>&rsquo;</dt>
  16233. <dt>&lsquo;<samp>c0_seed</samp>&rsquo;</dt>
  16234. <dt>&lsquo;<samp>c1_seed</samp>&rsquo;</dt>
  16235. <dt>&lsquo;<samp>c2_seed</samp>&rsquo;</dt>
  16236. <dt>&lsquo;<samp>c3_seed</samp>&rsquo;</dt>
  16237. <dd><p>Set noise seed for specific pixel component or all pixel components in case
  16238. of <var>all_seed</var>. Default value is <code>123457</code>.
  16239. </p>
  16240. </dd>
  16241. <dt>&lsquo;<samp>all_strength, alls</samp>&rsquo;</dt>
  16242. <dt>&lsquo;<samp>c0_strength, c0s</samp>&rsquo;</dt>
  16243. <dt>&lsquo;<samp>c1_strength, c1s</samp>&rsquo;</dt>
  16244. <dt>&lsquo;<samp>c2_strength, c2s</samp>&rsquo;</dt>
  16245. <dt>&lsquo;<samp>c3_strength, c3s</samp>&rsquo;</dt>
  16246. <dd><p>Set noise strength for specific pixel component or all pixel components in case
  16247. <var>all_strength</var>. Default value is <code>0</code>. Allowed range is [0, 100].
  16248. </p>
  16249. </dd>
  16250. <dt>&lsquo;<samp>all_flags, allf</samp>&rsquo;</dt>
  16251. <dt>&lsquo;<samp>c0_flags, c0f</samp>&rsquo;</dt>
  16252. <dt>&lsquo;<samp>c1_flags, c1f</samp>&rsquo;</dt>
  16253. <dt>&lsquo;<samp>c2_flags, c2f</samp>&rsquo;</dt>
  16254. <dt>&lsquo;<samp>c3_flags, c3f</samp>&rsquo;</dt>
  16255. <dd><p>Set pixel component flags or set flags for all components if <var>all_flags</var>.
  16256. Available values for component flags are:
  16257. </p><dl compact="compact">
  16258. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  16259. <dd><p>averaged temporal noise (smoother)
  16260. </p></dd>
  16261. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  16262. <dd><p>mix random noise with a (semi)regular pattern
  16263. </p></dd>
  16264. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  16265. <dd><p>temporal noise (noise pattern changes between frames)
  16266. </p></dd>
  16267. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  16268. <dd><p>uniform noise (gaussian otherwise)
  16269. </p></dd>
  16270. </dl>
  16271. </dd>
  16272. </dl>
  16273. <a name="Examples-73"></a>
  16274. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-73">11.140.1 Examples</a></h3>
  16275. <p>Add temporal and uniform noise to input video:
  16276. </p><div class="example">
  16277. <pre class="example">noise=alls=20:allf=t+u
  16278. </pre></div>
  16279. <a name="normalize"></a>
  16280. <h2 class="section"><a href="ffmpeg-filters.html#toc-normalize">11.141 normalize</a></h2>
  16281. <p>Normalize RGB video (aka histogram stretching, contrast stretching).
  16282. See: https://en.wikipedia.org/wiki/Normalization_(image_processing)
  16283. </p>
  16284. <p>For each channel of each frame, the filter computes the input range and maps
  16285. it linearly to the user-specified output range. The output range defaults
  16286. to the full dynamic range from pure black to pure white.
  16287. </p>
  16288. <p>Temporal smoothing can be used on the input range to reduce flickering (rapid
  16289. changes in brightness) caused when small dark or bright objects enter or leave
  16290. the scene. This is similar to the auto-exposure (automatic gain control) on a
  16291. video camera, and, like a video camera, it may cause a period of over- or
  16292. under-exposure of the video.
  16293. </p>
  16294. <p>The R,G,B channels can be normalized independently, which may cause some
  16295. color shifting, or linked together as a single channel, which prevents
  16296. color shifting. Linked normalization preserves hue. Independent normalization
  16297. does not, so it can be used to remove some color casts. Independent and linked
  16298. normalization can be combined in any ratio.
  16299. </p>
  16300. <p>The normalize filter accepts the following options:
  16301. </p>
  16302. <dl compact="compact">
  16303. <dt>&lsquo;<samp>blackpt</samp>&rsquo;</dt>
  16304. <dt>&lsquo;<samp>whitept</samp>&rsquo;</dt>
  16305. <dd><p>Colors which define the output range. The minimum input value is mapped to
  16306. the <var>blackpt</var>. The maximum input value is mapped to the <var>whitept</var>.
  16307. The defaults are black and white respectively. Specifying white for
  16308. <var>blackpt</var> and black for <var>whitept</var> will give color-inverted,
  16309. normalized video. Shades of grey can be used to reduce the dynamic range
  16310. (contrast). Specifying saturated colors here can create some interesting
  16311. effects.
  16312. </p>
  16313. </dd>
  16314. <dt>&lsquo;<samp>smoothing</samp>&rsquo;</dt>
  16315. <dd><p>The number of previous frames to use for temporal smoothing. The input range
  16316. of each channel is smoothed using a rolling average over the current frame
  16317. and the <var>smoothing</var> previous frames. The default is 0 (no temporal
  16318. smoothing).
  16319. </p>
  16320. </dd>
  16321. <dt>&lsquo;<samp>independence</samp>&rsquo;</dt>
  16322. <dd><p>Controls the ratio of independent (color shifting) channel normalization to
  16323. linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully
  16324. independent. Defaults to 1.0 (fully independent).
  16325. </p>
  16326. </dd>
  16327. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  16328. <dd><p>Overall strength of the filter. 1.0 is full strength. 0.0 is a rather
  16329. expensive no-op. Defaults to 1.0 (full strength).
  16330. </p>
  16331. </dd>
  16332. </dl>
  16333. <a name="Commands-20"></a>
  16334. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-20">11.141.1 Commands</a></h3>
  16335. <p>This filter supports same <a href="#commands">commands</a> as options, excluding <var>smoothing</var> option.
  16336. The command accepts the same syntax of the corresponding option.
  16337. </p>
  16338. <p>If the specified expression is not valid, it is kept at its current
  16339. value.
  16340. </p>
  16341. <a name="Examples-91"></a>
  16342. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-91">11.141.2 Examples</a></h3>
  16343. <p>Stretch video contrast to use the full dynamic range, with no temporal
  16344. smoothing; may flicker depending on the source content:
  16345. </p><div class="example">
  16346. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=0
  16347. </pre></div>
  16348. <p>As above, but with 50 frames of temporal smoothing; flicker should be
  16349. reduced, depending on the source content:
  16350. </p><div class="example">
  16351. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50
  16352. </pre></div>
  16353. <p>As above, but with hue-preserving linked channel normalization:
  16354. </p><div class="example">
  16355. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50:independence=0
  16356. </pre></div>
  16357. <p>As above, but with half strength:
  16358. </p><div class="example">
  16359. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
  16360. </pre></div>
  16361. <p>Map the darkest input color to red, the brightest input color to cyan:
  16362. </p><div class="example">
  16363. <pre class="example">normalize=blackpt=red:whitept=cyan
  16364. </pre></div>
  16365. <a name="null"></a>
  16366. <h2 class="section"><a href="ffmpeg-filters.html#toc-null">11.142 null</a></h2>
  16367. <p>Pass the video source unchanged to the output.
  16368. </p>
  16369. <a name="ocr"></a>
  16370. <h2 class="section"><a href="ffmpeg-filters.html#toc-ocr">11.143 ocr</a></h2>
  16371. <p>Optical Character Recognition
  16372. </p>
  16373. <p>This filter uses Tesseract for optical character recognition. To enable
  16374. compilation of this filter, you need to configure FFmpeg with
  16375. <code>--enable-libtesseract</code>.
  16376. </p>
  16377. <p>It accepts the following options:
  16378. </p>
  16379. <dl compact="compact">
  16380. <dt>&lsquo;<samp>datapath</samp>&rsquo;</dt>
  16381. <dd><p>Set datapath to tesseract data. Default is to use whatever was
  16382. set at installation.
  16383. </p>
  16384. </dd>
  16385. <dt>&lsquo;<samp>language</samp>&rsquo;</dt>
  16386. <dd><p>Set language, default is &quot;eng&quot;.
  16387. </p>
  16388. </dd>
  16389. <dt>&lsquo;<samp>whitelist</samp>&rsquo;</dt>
  16390. <dd><p>Set character whitelist.
  16391. </p>
  16392. </dd>
  16393. <dt>&lsquo;<samp>blacklist</samp>&rsquo;</dt>
  16394. <dd><p>Set character blacklist.
  16395. </p></dd>
  16396. </dl>
  16397. <p>The filter exports recognized text as the frame metadata <code>lavfi.ocr.text</code>.
  16398. The filter exports confidence of recognized words as the frame metadata <code>lavfi.ocr.confidence</code>.
  16399. </p>
  16400. <a name="ocv"></a>
  16401. <h2 class="section"><a href="ffmpeg-filters.html#toc-ocv">11.144 ocv</a></h2>
  16402. <p>Apply a video transform using libopencv.
  16403. </p>
  16404. <p>To enable this filter, install the libopencv library and headers and
  16405. configure FFmpeg with <code>--enable-libopencv</code>.
  16406. </p>
  16407. <p>It accepts the following parameters:
  16408. </p>
  16409. <dl compact="compact">
  16410. <dt>&lsquo;<samp>filter_name</samp>&rsquo;</dt>
  16411. <dd><p>The name of the libopencv filter to apply.
  16412. </p>
  16413. </dd>
  16414. <dt>&lsquo;<samp>filter_params</samp>&rsquo;</dt>
  16415. <dd><p>The parameters to pass to the libopencv filter. If not specified, the default
  16416. values are assumed.
  16417. </p>
  16418. </dd>
  16419. </dl>
  16420. <p>Refer to the official libopencv documentation for more precise
  16421. information:
  16422. <a href="http://docs.opencv.org/master/modules/imgproc/doc/filtering.html">http://docs.opencv.org/master/modules/imgproc/doc/filtering.html</a>
  16423. </p>
  16424. <p>Several libopencv filters are supported; see the following subsections.
  16425. </p>
  16426. <p><a name="dilate"></a>
  16427. </p><a name="dilate-1"></a>
  16428. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-dilate-1">11.144.1 dilate</a></h3>
  16429. <p>Dilate an image by using a specific structuring element.
  16430. It corresponds to the libopencv function <code>cvDilate</code>.
  16431. </p>
  16432. <p>It accepts the parameters: <var>struct_el</var>|<var>nb_iterations</var>.
  16433. </p>
  16434. <p><var>struct_el</var> represents a structuring element, and has the syntax:
  16435. <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
  16436. </p>
  16437. <p><var>cols</var> and <var>rows</var> represent the number of columns and rows of
  16438. the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
  16439. point, and <var>shape</var> the shape for the structuring element. <var>shape</var>
  16440. must be &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, or &quot;custom&quot;.
  16441. </p>
  16442. <p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
  16443. string of the form &quot;=<var>filename</var>&quot;. The file with name
  16444. <var>filename</var> is assumed to represent a binary image, with each
  16445. printable character corresponding to a bright pixel. When a custom
  16446. <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
  16447. or columns and rows of the read file are assumed instead.
  16448. </p>
  16449. <p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
  16450. </p>
  16451. <p><var>nb_iterations</var> specifies the number of times the transform is
  16452. applied to the image, and defaults to 1.
  16453. </p>
  16454. <p>Some examples:
  16455. </p><div class="example">
  16456. <pre class="example"># Use the default values
  16457. ocv=dilate
  16458. # Dilate using a structuring element with a 5x5 cross, iterating two times
  16459. ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
  16460. # Read the shape from the file diamond.shape, iterating two times.
  16461. # The file diamond.shape may contain a pattern of characters like this
  16462. # *
  16463. # ***
  16464. # *****
  16465. # ***
  16466. # *
  16467. # The specified columns and rows are ignored
  16468. # but the anchor point coordinates are not
  16469. ocv=dilate:0x0+2x2/custom=diamond.shape|2
  16470. </pre></div>
  16471. <a name="erode"></a>
  16472. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-erode">11.144.2 erode</a></h3>
  16473. <p>Erode an image by using a specific structuring element.
  16474. It corresponds to the libopencv function <code>cvErode</code>.
  16475. </p>
  16476. <p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
  16477. with the same syntax and semantics as the <a href="#dilate">dilate</a> filter.
  16478. </p>
  16479. <a name="smooth"></a>
  16480. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-smooth">11.144.3 smooth</a></h3>
  16481. <p>Smooth the input video.
  16482. </p>
  16483. <p>The filter takes the following parameters:
  16484. <var>type</var>|<var>param1</var>|<var>param2</var>|<var>param3</var>|<var>param4</var>.
  16485. </p>
  16486. <p><var>type</var> is the type of smooth filter to apply, and must be one of
  16487. the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
  16488. or &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
  16489. </p>
  16490. <p>The meaning of <var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var>
  16491. depends on the smooth type. <var>param1</var> and
  16492. <var>param2</var> accept integer positive values or 0. <var>param3</var> and
  16493. <var>param4</var> accept floating point values.
  16494. </p>
  16495. <p>The default value for <var>param1</var> is 3. The default value for the
  16496. other parameters is 0.
  16497. </p>
  16498. <p>These parameters correspond to the parameters assigned to the
  16499. libopencv function <code>cvSmooth</code>.
  16500. </p>
  16501. <a name="oscilloscope"></a>
  16502. <h2 class="section"><a href="ffmpeg-filters.html#toc-oscilloscope">11.145 oscilloscope</a></h2>
  16503. <p>2D Video Oscilloscope.
  16504. </p>
  16505. <p>Useful to measure spatial impulse, step responses, chroma delays, etc.
  16506. </p>
  16507. <p>It accepts the following parameters:
  16508. </p>
  16509. <dl compact="compact">
  16510. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  16511. <dd><p>Set scope center x position.
  16512. </p>
  16513. </dd>
  16514. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  16515. <dd><p>Set scope center y position.
  16516. </p>
  16517. </dd>
  16518. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  16519. <dd><p>Set scope size, relative to frame diagonal.
  16520. </p>
  16521. </dd>
  16522. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  16523. <dd><p>Set scope tilt/rotation.
  16524. </p>
  16525. </dd>
  16526. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  16527. <dd><p>Set trace opacity.
  16528. </p>
  16529. </dd>
  16530. <dt>&lsquo;<samp>tx</samp>&rsquo;</dt>
  16531. <dd><p>Set trace center x position.
  16532. </p>
  16533. </dd>
  16534. <dt>&lsquo;<samp>ty</samp>&rsquo;</dt>
  16535. <dd><p>Set trace center y position.
  16536. </p>
  16537. </dd>
  16538. <dt>&lsquo;<samp>tw</samp>&rsquo;</dt>
  16539. <dd><p>Set trace width, relative to width of frame.
  16540. </p>
  16541. </dd>
  16542. <dt>&lsquo;<samp>th</samp>&rsquo;</dt>
  16543. <dd><p>Set trace height, relative to height of frame.
  16544. </p>
  16545. </dd>
  16546. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  16547. <dd><p>Set which components to trace. By default it traces first three components.
  16548. </p>
  16549. </dd>
  16550. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  16551. <dd><p>Draw trace grid. By default is enabled.
  16552. </p>
  16553. </dd>
  16554. <dt>&lsquo;<samp>st</samp>&rsquo;</dt>
  16555. <dd><p>Draw some statistics. By default is enabled.
  16556. </p>
  16557. </dd>
  16558. <dt>&lsquo;<samp>sc</samp>&rsquo;</dt>
  16559. <dd><p>Draw scope. By default is enabled.
  16560. </p></dd>
  16561. </dl>
  16562. <a name="Commands-8"></a>
  16563. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-8">11.145.1 Commands</a></h3>
  16564. <p>This filter supports same <a href="#commands">commands</a> as options.
  16565. The command accepts the same syntax of the corresponding option.
  16566. </p>
  16567. <p>If the specified expression is not valid, it is kept at its current
  16568. value.
  16569. </p>
  16570. <a name="Examples-50"></a>
  16571. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-50">11.145.2 Examples</a></h3>
  16572. <ul>
  16573. <li>
  16574. Inspect full first row of video frame.
  16575. <div class="example">
  16576. <pre class="example">oscilloscope=x=0.5:y=0:s=1
  16577. </pre></div>
  16578. </li><li>
  16579. Inspect full last row of video frame.
  16580. <div class="example">
  16581. <pre class="example">oscilloscope=x=0.5:y=1:s=1
  16582. </pre></div>
  16583. </li><li>
  16584. Inspect full 5th line of video frame of height 1080.
  16585. <div class="example">
  16586. <pre class="example">oscilloscope=x=0.5:y=5/1080:s=1
  16587. </pre></div>
  16588. </li><li>
  16589. Inspect full last column of video frame.
  16590. <div class="example">
  16591. <pre class="example">oscilloscope=x=1:y=0.5:s=1:t=1
  16592. </pre></div>
  16593. </li></ul>
  16594. <p><a name="overlay"></a>
  16595. </p><a name="overlay-1"></a>
  16596. <h2 class="section"><a href="ffmpeg-filters.html#toc-overlay-1">11.146 overlay</a></h2>
  16597. <p>Overlay one video on top of another.
  16598. </p>
  16599. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  16600. video on which the second input is overlaid.
  16601. </p>
  16602. <p>It accepts the following parameters:
  16603. </p>
  16604. <p>A description of the accepted options follows.
  16605. </p>
  16606. <dl compact="compact">
  16607. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  16608. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  16609. <dd><p>Set the expression for the x and y coordinates of the overlaid video
  16610. on the main video. Default value is &quot;0&quot; for both expressions. In case
  16611. the expression is invalid, it is set to a huge value (meaning that the
  16612. overlay will not be displayed within the output visible area).
  16613. </p>
  16614. </dd>
  16615. <dt>&lsquo;<samp>eof_action</samp>&rsquo;</dt>
  16616. <dd><p>See <a href="#framesync">framesync</a>.
  16617. </p>
  16618. </dd>
  16619. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  16620. <dd><p>Set when the expressions for &lsquo;<samp>x</samp>&rsquo;, and &lsquo;<samp>y</samp>&rsquo; are evaluated.
  16621. </p>
  16622. <p>It accepts the following values:
  16623. </p><dl compact="compact">
  16624. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  16625. <dd><p>only evaluate expressions once during the filter initialization or
  16626. when a command is processed
  16627. </p>
  16628. </dd>
  16629. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  16630. <dd><p>evaluate expressions for each incoming frame
  16631. </p></dd>
  16632. </dl>
  16633. <p>Default value is &lsquo;<samp>frame</samp>&rsquo;.
  16634. </p>
  16635. </dd>
  16636. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  16637. <dd><p>See <a href="#framesync">framesync</a>.
  16638. </p>
  16639. </dd>
  16640. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  16641. <dd><p>Set the format for the output video.
  16642. </p>
  16643. <p>It accepts the following values:
  16644. </p><dl compact="compact">
  16645. <dt>&lsquo;<samp>yuv420</samp>&rsquo;</dt>
  16646. <dd><p>force YUV420 output
  16647. </p>
  16648. </dd>
  16649. <dt>&lsquo;<samp>yuv422</samp>&rsquo;</dt>
  16650. <dd><p>force YUV422 output
  16651. </p>
  16652. </dd>
  16653. <dt>&lsquo;<samp>yuv444</samp>&rsquo;</dt>
  16654. <dd><p>force YUV444 output
  16655. </p>
  16656. </dd>
  16657. <dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
  16658. <dd><p>force packed RGB output
  16659. </p>
  16660. </dd>
  16661. <dt>&lsquo;<samp>gbrp</samp>&rsquo;</dt>
  16662. <dd><p>force planar RGB output
  16663. </p>
  16664. </dd>
  16665. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  16666. <dd><p>automatically pick format
  16667. </p></dd>
  16668. </dl>
  16669. <p>Default value is &lsquo;<samp>yuv420</samp>&rsquo;.
  16670. </p>
  16671. </dd>
  16672. <dt>&lsquo;<samp>repeatlast</samp>&rsquo;</dt>
  16673. <dd><p>See <a href="#framesync">framesync</a>.
  16674. </p>
  16675. </dd>
  16676. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  16677. <dd><p>Set format of alpha of the overlaid video, it can be <var>straight</var> or
  16678. <var>premultiplied</var>. Default is <var>straight</var>.
  16679. </p></dd>
  16680. </dl>
  16681. <p>The &lsquo;<samp>x</samp>&rsquo;, and &lsquo;<samp>y</samp>&rsquo; expressions can contain the following
  16682. parameters.
  16683. </p>
  16684. <dl compact="compact">
  16685. <dt>&lsquo;<samp>main_w, W</samp>&rsquo;</dt>
  16686. <dt>&lsquo;<samp>main_h, H</samp>&rsquo;</dt>
  16687. <dd><p>The main input width and height.
  16688. </p>
  16689. </dd>
  16690. <dt>&lsquo;<samp>overlay_w, w</samp>&rsquo;</dt>
  16691. <dt>&lsquo;<samp>overlay_h, h</samp>&rsquo;</dt>
  16692. <dd><p>The overlay input width and height.
  16693. </p>
  16694. </dd>
  16695. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  16696. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  16697. <dd><p>The computed values for <var>x</var> and <var>y</var>. They are evaluated for
  16698. each new frame.
  16699. </p>
  16700. </dd>
  16701. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  16702. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  16703. <dd><p>horizontal and vertical chroma subsample values of the output
  16704. format. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and
  16705. <var>vsub</var> is 1.
  16706. </p>
  16707. </dd>
  16708. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  16709. <dd><p>the number of input frame, starting from 0
  16710. </p>
  16711. </dd>
  16712. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  16713. <dd><p>the position in the file of the input frame, NAN if unknown
  16714. </p>
  16715. </dd>
  16716. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  16717. <dd><p>The timestamp, expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  16718. </p>
  16719. </dd>
  16720. </dl>
  16721. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  16722. </p>
  16723. <p>Note that the <var>n</var>, <var>pos</var>, <var>t</var> variables are available only
  16724. when evaluation is done <em>per frame</em>, and will evaluate to NAN
  16725. when &lsquo;<samp>eval</samp>&rsquo; is set to &lsquo;<samp>init</samp>&rsquo;.
  16726. </p>
  16727. <p>Be aware that frames are taken from each input video in timestamp
  16728. order, hence, if their initial timestamps differ, it is a good idea
  16729. to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
  16730. have them begin in the same zero timestamp, as the example for
  16731. the <var>movie</var> filter does.
  16732. </p>
  16733. <p>You can chain together more overlays but you should test the
  16734. efficiency of such approach.
  16735. </p>
  16736. <a name="Commands-52"></a>
  16737. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-52">11.146.1 Commands</a></h3>
  16738. <p>This filter supports the following commands:
  16739. </p><dl compact="compact">
  16740. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  16741. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  16742. <dd><p>Modify the x and y of the overlay input.
  16743. The command accepts the same syntax of the corresponding option.
  16744. </p>
  16745. <p>If the specified expression is not valid, it is kept at its current
  16746. value.
  16747. </p></dd>
  16748. </dl>
  16749. <a name="Examples-1"></a>
  16750. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-1">11.146.2 Examples</a></h3>
  16751. <ul>
  16752. <li>
  16753. Draw the overlay at 10 pixels from the bottom right corner of the main
  16754. video:
  16755. <div class="example">
  16756. <pre class="example">overlay=main_w-overlay_w-10:main_h-overlay_h-10
  16757. </pre></div>
  16758. <p>Using named options the example above becomes:
  16759. </p><div class="example">
  16760. <pre class="example">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
  16761. </pre></div>
  16762. </li><li>
  16763. Insert a transparent PNG logo in the bottom left corner of the input,
  16764. using the <code>ffmpeg</code> tool with the <code>-filter_complex</code> option:
  16765. <div class="example">
  16766. <pre class="example">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
  16767. </pre></div>
  16768. </li><li>
  16769. Insert 2 different transparent PNG logos (second logo on bottom
  16770. right corner) using the <code>ffmpeg</code> tool:
  16771. <div class="example">
  16772. <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
  16773. </pre></div>
  16774. </li><li>
  16775. Add a transparent color layer on top of the main video; <code>WxH</code>
  16776. must specify the size of the main input to the overlay filter:
  16777. <div class="example">
  16778. <pre class="example">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
  16779. </pre></div>
  16780. </li><li>
  16781. Play an original video and a filtered version (here with the deshake
  16782. filter) side by side using the <code>ffplay</code> tool:
  16783. <div class="example">
  16784. <pre class="example">ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
  16785. </pre></div>
  16786. <p>The above command is the same as:
  16787. </p><div class="example">
  16788. <pre class="example">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
  16789. </pre></div>
  16790. </li><li>
  16791. Make a sliding overlay appearing from the left to the right top part of the
  16792. screen starting since time 2:
  16793. <div class="example">
  16794. <pre class="example">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
  16795. </pre></div>
  16796. </li><li>
  16797. Compose output by putting two input videos side to side:
  16798. <div class="example">
  16799. <pre class="example">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
  16800. nullsrc=size=200x100 [background];
  16801. [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
  16802. [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
  16803. [background][left] overlay=shortest=1 [background+left];
  16804. [background+left][right] overlay=shortest=1:x=100 [left+right]
  16805. &quot;
  16806. </pre></div>
  16807. </li><li>
  16808. Mask 10-20 seconds of a video by applying the delogo filter to a section
  16809. <div class="example">
  16810. <pre class="example">ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
  16811. -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]'
  16812. masked.avi
  16813. </pre></div>
  16814. </li><li>
  16815. Chain several overlays in cascade:
  16816. <div class="example">
  16817. <pre class="example">nullsrc=s=200x200 [bg];
  16818. testsrc=s=100x100, split=4 [in0][in1][in2][in3];
  16819. [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
  16820. [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
  16821. [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
  16822. [in3] null, [mid2] overlay=100:100 [out0]
  16823. </pre></div>
  16824. </li></ul>
  16825. <p><a name="overlay_005fcuda"></a>
  16826. </p><a name="overlay_005fcuda-1"></a>
  16827. <h2 class="section"><a href="ffmpeg-filters.html#toc-overlay_005fcuda-1">11.147 overlay_cuda</a></h2>
  16828. <p>Overlay one video on top of another.
  16829. </p>
  16830. <p>This is the CUDA cariant of the <a href="#overlay">overlay</a> filter.
  16831. It only accepts CUDA frames. The underlying input pixel formats have to match.
  16832. </p>
  16833. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  16834. video on which the second input is overlaid.
  16835. </p>
  16836. <p>It accepts the following parameters:
  16837. </p>
  16838. <dl compact="compact">
  16839. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  16840. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  16841. <dd><p>Set the x and y coordinates of the overlaid video on the main video.
  16842. Default value is &quot;0&quot; for both expressions.
  16843. </p>
  16844. </dd>
  16845. <dt>&lsquo;<samp>eof_action</samp>&rsquo;</dt>
  16846. <dd><p>See <a href="#framesync">framesync</a>.
  16847. </p>
  16848. </dd>
  16849. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  16850. <dd><p>See <a href="#framesync">framesync</a>.
  16851. </p>
  16852. </dd>
  16853. <dt>&lsquo;<samp>repeatlast</samp>&rsquo;</dt>
  16854. <dd><p>See <a href="#framesync">framesync</a>.
  16855. </p>
  16856. </dd>
  16857. </dl>
  16858. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  16859. </p>
  16860. <a name="owdenoise"></a>
  16861. <h2 class="section"><a href="ffmpeg-filters.html#toc-owdenoise">11.148 owdenoise</a></h2>
  16862. <p>Apply Overcomplete Wavelet denoiser.
  16863. </p>
  16864. <p>The filter accepts the following options:
  16865. </p>
  16866. <dl compact="compact">
  16867. <dt>&lsquo;<samp>depth</samp>&rsquo;</dt>
  16868. <dd><p>Set depth.
  16869. </p>
  16870. <p>Larger depth values will denoise lower frequency components more, but
  16871. slow down filtering.
  16872. </p>
  16873. <p>Must be an int in the range 8-16, default is <code>8</code>.
  16874. </p>
  16875. </dd>
  16876. <dt>&lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
  16877. <dd><p>Set luma strength.
  16878. </p>
  16879. <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
  16880. </p>
  16881. </dd>
  16882. <dt>&lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
  16883. <dd><p>Set chroma strength.
  16884. </p>
  16885. <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
  16886. </p></dd>
  16887. </dl>
  16888. <p><a name="pad"></a>
  16889. </p><a name="pad-1"></a>
  16890. <h2 class="section"><a href="ffmpeg-filters.html#toc-pad-1">11.149 pad</a></h2>
  16891. <p>Add paddings to the input image, and place the original input at the
  16892. provided <var>x</var>, <var>y</var> coordinates.
  16893. </p>
  16894. <p>It accepts the following parameters:
  16895. </p>
  16896. <dl compact="compact">
  16897. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  16898. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  16899. <dd><p>Specify an expression for the size of the output image with the
  16900. paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
  16901. corresponding input size is used for the output.
  16902. </p>
  16903. <p>The <var>width</var> expression can reference the value set by the
  16904. <var>height</var> expression, and vice versa.
  16905. </p>
  16906. <p>The default value of <var>width</var> and <var>height</var> is 0.
  16907. </p>
  16908. </dd>
  16909. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  16910. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  16911. <dd><p>Specify the offsets to place the input image at within the padded area,
  16912. with respect to the top/left border of the output image.
  16913. </p>
  16914. <p>The <var>x</var> expression can reference the value set by the <var>y</var>
  16915. expression, and vice versa.
  16916. </p>
  16917. <p>The default value of <var>x</var> and <var>y</var> is 0.
  16918. </p>
  16919. <p>If <var>x</var> or <var>y</var> evaluate to a negative number, they&rsquo;ll be changed
  16920. so the input image is centered on the padded area.
  16921. </p>
  16922. </dd>
  16923. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  16924. <dd><p>Specify the color of the padded area. For the syntax of this option,
  16925. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  16926. </p>
  16927. <p>The default value of <var>color</var> is &quot;black&quot;.
  16928. </p>
  16929. </dd>
  16930. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  16931. <dd><p>Specify when to evaluate <var>width</var>, <var>height</var>, <var>x</var> and <var>y</var> expression.
  16932. </p>
  16933. <p>It accepts the following values:
  16934. </p>
  16935. <dl compact="compact">
  16936. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  16937. <dd><p>Only evaluate expressions once during the filter initialization or when
  16938. a command is processed.
  16939. </p>
  16940. </dd>
  16941. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  16942. <dd><p>Evaluate expressions for each incoming frame.
  16943. </p>
  16944. </dd>
  16945. </dl>
  16946. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  16947. </p>
  16948. </dd>
  16949. <dt>&lsquo;<samp>aspect</samp>&rsquo;</dt>
  16950. <dd><p>Pad to aspect instead to a resolution.
  16951. </p>
  16952. </dd>
  16953. </dl>
  16954. <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
  16955. options are expressions containing the following constants:
  16956. </p>
  16957. <dl compact="compact">
  16958. <dt>&lsquo;<samp>in_w</samp>&rsquo;</dt>
  16959. <dt>&lsquo;<samp>in_h</samp>&rsquo;</dt>
  16960. <dd><p>The input video width and height.
  16961. </p>
  16962. </dd>
  16963. <dt>&lsquo;<samp>iw</samp>&rsquo;</dt>
  16964. <dt>&lsquo;<samp>ih</samp>&rsquo;</dt>
  16965. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  16966. </p>
  16967. </dd>
  16968. <dt>&lsquo;<samp>out_w</samp>&rsquo;</dt>
  16969. <dt>&lsquo;<samp>out_h</samp>&rsquo;</dt>
  16970. <dd><p>The output width and height (the size of the padded area), as
  16971. specified by the <var>width</var> and <var>height</var> expressions.
  16972. </p>
  16973. </dd>
  16974. <dt>&lsquo;<samp>ow</samp>&rsquo;</dt>
  16975. <dt>&lsquo;<samp>oh</samp>&rsquo;</dt>
  16976. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  16977. </p>
  16978. </dd>
  16979. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  16980. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  16981. <dd><p>The x and y offsets as specified by the <var>x</var> and <var>y</var>
  16982. expressions, or NAN if not yet specified.
  16983. </p>
  16984. </dd>
  16985. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  16986. <dd><p>same as <var>iw</var> / <var>ih</var>
  16987. </p>
  16988. </dd>
  16989. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  16990. <dd><p>input sample aspect ratio
  16991. </p>
  16992. </dd>
  16993. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  16994. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  16995. </p>
  16996. </dd>
  16997. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  16998. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  16999. <dd><p>The horizontal and vertical chroma subsample values. For example for the
  17000. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  17001. </p></dd>
  17002. </dl>
  17003. <a name="Examples-80"></a>
  17004. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-80">11.149.1 Examples</a></h3>
  17005. <ul>
  17006. <li>
  17007. Add paddings with the color &quot;violet&quot; to the input video. The output video
  17008. size is 640x480, and the top-left corner of the input video is placed at
  17009. column 0, row 40
  17010. <div class="example">
  17011. <pre class="example">pad=640:480:0:40:violet
  17012. </pre></div>
  17013. <p>The example above is equivalent to the following command:
  17014. </p><div class="example">
  17015. <pre class="example">pad=width=640:height=480:x=0:y=40:color=violet
  17016. </pre></div>
  17017. </li><li>
  17018. Pad the input to get an output with dimensions increased by 3/2,
  17019. and put the input video at the center of the padded area:
  17020. <div class="example">
  17021. <pre class="example">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
  17022. </pre></div>
  17023. </li><li>
  17024. Pad the input to get a squared output with size equal to the maximum
  17025. value between the input width and height, and put the input video at
  17026. the center of the padded area:
  17027. <div class="example">
  17028. <pre class="example">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
  17029. </pre></div>
  17030. </li><li>
  17031. Pad the input to get a final w/h ratio of 16:9:
  17032. <div class="example">
  17033. <pre class="example">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
  17034. </pre></div>
  17035. </li><li>
  17036. In case of anamorphic video, in order to set the output display aspect
  17037. correctly, it is necessary to use <var>sar</var> in the expression,
  17038. according to the relation:
  17039. <div class="example">
  17040. <pre class="example">(ih * X / ih) * sar = output_dar
  17041. X = output_dar / sar
  17042. </pre></div>
  17043. <p>Thus the previous example needs to be modified to:
  17044. </p><div class="example">
  17045. <pre class="example">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
  17046. </pre></div>
  17047. </li><li>
  17048. Double the output size and put the input video in the bottom-right
  17049. corner of the output padded area:
  17050. <div class="example">
  17051. <pre class="example">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
  17052. </pre></div>
  17053. </li></ul>
  17054. <p><a name="palettegen"></a>
  17055. </p><a name="palettegen-1"></a>
  17056. <h2 class="section"><a href="ffmpeg-filters.html#toc-palettegen-1">11.150 palettegen</a></h2>
  17057. <p>Generate one palette for a whole video stream.
  17058. </p>
  17059. <p>It accepts the following options:
  17060. </p>
  17061. <dl compact="compact">
  17062. <dt>&lsquo;<samp>max_colors</samp>&rsquo;</dt>
  17063. <dd><p>Set the maximum number of colors to quantize in the palette.
  17064. Note: the palette will still contain 256 colors; the unused palette entries
  17065. will be black.
  17066. </p>
  17067. </dd>
  17068. <dt>&lsquo;<samp>reserve_transparent</samp>&rsquo;</dt>
  17069. <dd><p>Create a palette of 255 colors maximum and reserve the last one for
  17070. transparency. Reserving the transparency color is useful for GIF optimization.
  17071. If not set, the maximum of colors in the palette will be 256. You probably want
  17072. to disable this option for a standalone image.
  17073. Set by default.
  17074. </p>
  17075. </dd>
  17076. <dt>&lsquo;<samp>transparency_color</samp>&rsquo;</dt>
  17077. <dd><p>Set the color that will be used as background for transparency.
  17078. </p>
  17079. </dd>
  17080. <dt>&lsquo;<samp>stats_mode</samp>&rsquo;</dt>
  17081. <dd><p>Set statistics mode.
  17082. </p>
  17083. <p>It accepts the following values:
  17084. </p><dl compact="compact">
  17085. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  17086. <dd><p>Compute full frame histograms.
  17087. </p></dd>
  17088. <dt>&lsquo;<samp>diff</samp>&rsquo;</dt>
  17089. <dd><p>Compute histograms only for the part that differs from previous frame. This
  17090. might be relevant to give more importance to the moving part of your input if
  17091. the background is static.
  17092. </p></dd>
  17093. <dt>&lsquo;<samp>single</samp>&rsquo;</dt>
  17094. <dd><p>Compute new histogram for each frame.
  17095. </p></dd>
  17096. </dl>
  17097. <p>Default value is <var>full</var>.
  17098. </p></dd>
  17099. </dl>
  17100. <p>The filter also exports the frame metadata <code>lavfi.color_quant_ratio</code>
  17101. (<code>nb_color_in / nb_color_out</code>) which you can use to evaluate the degree of
  17102. color quantization of the palette. This information is also visible at
  17103. <var>info</var> logging level.
  17104. </p>
  17105. <a name="Examples-118"></a>
  17106. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-118">11.150.1 Examples</a></h3>
  17107. <ul>
  17108. <li>
  17109. Generate a representative palette of a given video using <code>ffmpeg</code>:
  17110. <div class="example">
  17111. <pre class="example">ffmpeg -i input.mkv -vf palettegen palette.png
  17112. </pre></div>
  17113. </li></ul>
  17114. <a name="paletteuse"></a>
  17115. <h2 class="section"><a href="ffmpeg-filters.html#toc-paletteuse">11.151 paletteuse</a></h2>
  17116. <p>Use a palette to downsample an input video stream.
  17117. </p>
  17118. <p>The filter takes two inputs: one video stream and a palette. The palette must
  17119. be a 256 pixels image.
  17120. </p>
  17121. <p>It accepts the following options:
  17122. </p>
  17123. <dl compact="compact">
  17124. <dt>&lsquo;<samp>dither</samp>&rsquo;</dt>
  17125. <dd><p>Select dithering mode. Available algorithms are:
  17126. </p><dl compact="compact">
  17127. <dt>&lsquo;<samp>bayer</samp>&rsquo;</dt>
  17128. <dd><p>Ordered 8x8 bayer dithering (deterministic)
  17129. </p></dd>
  17130. <dt>&lsquo;<samp>heckbert</samp>&rsquo;</dt>
  17131. <dd><p>Dithering as defined by Paul Heckbert in 1982 (simple error diffusion).
  17132. Note: this dithering is sometimes considered &quot;wrong&quot; and is included as a
  17133. reference.
  17134. </p></dd>
  17135. <dt>&lsquo;<samp>floyd_steinberg</samp>&rsquo;</dt>
  17136. <dd><p>Floyd and Steingberg dithering (error diffusion)
  17137. </p></dd>
  17138. <dt>&lsquo;<samp>sierra2</samp>&rsquo;</dt>
  17139. <dd><p>Frankie Sierra dithering v2 (error diffusion)
  17140. </p></dd>
  17141. <dt>&lsquo;<samp>sierra2_4a</samp>&rsquo;</dt>
  17142. <dd><p>Frankie Sierra dithering v2 &quot;Lite&quot; (error diffusion)
  17143. </p></dd>
  17144. </dl>
  17145. <p>Default is <var>sierra2_4a</var>.
  17146. </p>
  17147. </dd>
  17148. <dt>&lsquo;<samp>bayer_scale</samp>&rsquo;</dt>
  17149. <dd><p>When <var>bayer</var> dithering is selected, this option defines the scale of the
  17150. pattern (how much the crosshatch pattern is visible). A low value means more
  17151. visible pattern for less banding, and higher value means less visible pattern
  17152. at the cost of more banding.
  17153. </p>
  17154. <p>The option must be an integer value in the range [0,5]. Default is <var>2</var>.
  17155. </p>
  17156. </dd>
  17157. <dt>&lsquo;<samp>diff_mode</samp>&rsquo;</dt>
  17158. <dd><p>If set, define the zone to process
  17159. </p>
  17160. <dl compact="compact">
  17161. <dt>&lsquo;<samp>rectangle</samp>&rsquo;</dt>
  17162. <dd><p>Only the changing rectangle will be reprocessed. This is similar to GIF
  17163. cropping/offsetting compression mechanism. This option can be useful for speed
  17164. if only a part of the image is changing, and has use cases such as limiting the
  17165. scope of the error diffusal &lsquo;<samp>dither</samp>&rsquo; to the rectangle that bounds the
  17166. moving scene (it leads to more deterministic output if the scene doesn&rsquo;t change
  17167. much, and as a result less moving noise and better GIF compression).
  17168. </p></dd>
  17169. </dl>
  17170. <p>Default is <var>none</var>.
  17171. </p>
  17172. </dd>
  17173. <dt>&lsquo;<samp>new</samp>&rsquo;</dt>
  17174. <dd><p>Take new palette for each output frame.
  17175. </p>
  17176. </dd>
  17177. <dt>&lsquo;<samp>alpha_threshold</samp>&rsquo;</dt>
  17178. <dd><p>Sets the alpha threshold for transparency. Alpha values above this threshold
  17179. will be treated as completely opaque, and values below this threshold will be
  17180. treated as completely transparent.
  17181. </p>
  17182. <p>The option must be an integer value in the range [0,255]. Default is <var>128</var>.
  17183. </p></dd>
  17184. </dl>
  17185. <a name="Examples-55"></a>
  17186. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-55">11.151.1 Examples</a></h3>
  17187. <ul>
  17188. <li>
  17189. Use a palette (generated for example with <a href="#palettegen">palettegen</a>) to encode a GIF
  17190. using <code>ffmpeg</code>:
  17191. <div class="example">
  17192. <pre class="example">ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
  17193. </pre></div>
  17194. </li></ul>
  17195. <a name="perspective"></a>
  17196. <h2 class="section"><a href="ffmpeg-filters.html#toc-perspective">11.152 perspective</a></h2>
  17197. <p>Correct perspective of video not recorded perpendicular to the screen.
  17198. </p>
  17199. <p>A description of the accepted parameters follows.
  17200. </p>
  17201. <dl compact="compact">
  17202. <dt>&lsquo;<samp>x0</samp>&rsquo;</dt>
  17203. <dt>&lsquo;<samp>y0</samp>&rsquo;</dt>
  17204. <dt>&lsquo;<samp>x1</samp>&rsquo;</dt>
  17205. <dt>&lsquo;<samp>y1</samp>&rsquo;</dt>
  17206. <dt>&lsquo;<samp>x2</samp>&rsquo;</dt>
  17207. <dt>&lsquo;<samp>y2</samp>&rsquo;</dt>
  17208. <dt>&lsquo;<samp>x3</samp>&rsquo;</dt>
  17209. <dt>&lsquo;<samp>y3</samp>&rsquo;</dt>
  17210. <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
  17211. Default values are <code>0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
  17212. If the <code>sense</code> option is set to <code>source</code>, then the specified points will be sent
  17213. to the corners of the destination. If the <code>sense</code> option is set to <code>destination</code>,
  17214. then the corners of the source will be sent to the specified coordinates.
  17215. </p>
  17216. <p>The expressions can use the following variables:
  17217. </p>
  17218. <dl compact="compact">
  17219. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  17220. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  17221. <dd><p>the width and height of video frame.
  17222. </p></dd>
  17223. <dt>&lsquo;<samp>in</samp>&rsquo;</dt>
  17224. <dd><p>Input frame count.
  17225. </p></dd>
  17226. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  17227. <dd><p>Output frame count.
  17228. </p></dd>
  17229. </dl>
  17230. </dd>
  17231. <dt>&lsquo;<samp>interpolation</samp>&rsquo;</dt>
  17232. <dd><p>Set interpolation for perspective correction.
  17233. </p>
  17234. <p>It accepts the following values:
  17235. </p><dl compact="compact">
  17236. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  17237. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  17238. </dl>
  17239. <p>Default value is &lsquo;<samp>linear</samp>&rsquo;.
  17240. </p>
  17241. </dd>
  17242. <dt>&lsquo;<samp>sense</samp>&rsquo;</dt>
  17243. <dd><p>Set interpretation of coordinate options.
  17244. </p>
  17245. <p>It accepts the following values:
  17246. </p><dl compact="compact">
  17247. <dt>&lsquo;<samp>0, source</samp>&rsquo;</dt>
  17248. <dd>
  17249. <p>Send point in the source specified by the given coordinates to
  17250. the corners of the destination.
  17251. </p>
  17252. </dd>
  17253. <dt>&lsquo;<samp>1, destination</samp>&rsquo;</dt>
  17254. <dd>
  17255. <p>Send the corners of the source to the point in the destination specified
  17256. by the given coordinates.
  17257. </p>
  17258. <p>Default value is &lsquo;<samp>source</samp>&rsquo;.
  17259. </p></dd>
  17260. </dl>
  17261. </dd>
  17262. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  17263. <dd><p>Set when the expressions for coordinates &lsquo;<samp>x0,y0,...x3,y3</samp>&rsquo; are evaluated.
  17264. </p>
  17265. <p>It accepts the following values:
  17266. </p><dl compact="compact">
  17267. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  17268. <dd><p>only evaluate expressions once during the filter initialization or
  17269. when a command is processed
  17270. </p>
  17271. </dd>
  17272. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  17273. <dd><p>evaluate expressions for each incoming frame
  17274. </p></dd>
  17275. </dl>
  17276. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  17277. </p></dd>
  17278. </dl>
  17279. <a name="phase"></a>
  17280. <h2 class="section"><a href="ffmpeg-filters.html#toc-phase">11.153 phase</a></h2>
  17281. <p>Delay interlaced video by one field time so that the field order changes.
  17282. </p>
  17283. <p>The intended use is to fix PAL movies that have been captured with the
  17284. opposite field order to the film-to-video transfer.
  17285. </p>
  17286. <p>A description of the accepted parameters follows.
  17287. </p>
  17288. <dl compact="compact">
  17289. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  17290. <dd><p>Set phase mode.
  17291. </p>
  17292. <p>It accepts the following values:
  17293. </p><dl compact="compact">
  17294. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  17295. <dd><p>Capture field order top-first, transfer bottom-first.
  17296. Filter will delay the bottom field.
  17297. </p>
  17298. </dd>
  17299. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  17300. <dd><p>Capture field order bottom-first, transfer top-first.
  17301. Filter will delay the top field.
  17302. </p>
  17303. </dd>
  17304. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  17305. <dd><p>Capture and transfer with the same field order. This mode only exists
  17306. for the documentation of the other options to refer to, but if you
  17307. actually select it, the filter will faithfully do nothing.
  17308. </p>
  17309. </dd>
  17310. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  17311. <dd><p>Capture field order determined automatically by field flags, transfer
  17312. opposite.
  17313. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; modes on a frame by frame
  17314. basis using field flags. If no field information is available,
  17315. then this works just like &lsquo;<samp>u</samp>&rsquo;.
  17316. </p>
  17317. </dd>
  17318. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  17319. <dd><p>Capture unknown or varying, transfer opposite.
  17320. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; on a frame by frame basis by
  17321. analyzing the images and selecting the alternative that produces best
  17322. match between the fields.
  17323. </p>
  17324. </dd>
  17325. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  17326. <dd><p>Capture top-first, transfer unknown or varying.
  17327. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
  17328. </p>
  17329. </dd>
  17330. <dt>&lsquo;<samp>B</samp>&rsquo;</dt>
  17331. <dd><p>Capture bottom-first, transfer unknown or varying.
  17332. Filter selects among &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
  17333. </p>
  17334. </dd>
  17335. <dt>&lsquo;<samp>A</samp>&rsquo;</dt>
  17336. <dd><p>Capture determined by field flags, transfer unknown or varying.
  17337. Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using field flags and
  17338. image analysis. If no field information is available, then this works just
  17339. like &lsquo;<samp>U</samp>&rsquo;. This is the default mode.
  17340. </p>
  17341. </dd>
  17342. <dt>&lsquo;<samp>U</samp>&rsquo;</dt>
  17343. <dd><p>Both capture and transfer unknown or varying.
  17344. Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis only.
  17345. </p></dd>
  17346. </dl>
  17347. </dd>
  17348. </dl>
  17349. <a name="photosensitivity"></a>
  17350. <h2 class="section"><a href="ffmpeg-filters.html#toc-photosensitivity">11.154 photosensitivity</a></h2>
  17351. <p>Reduce various flashes in video, so to help users with epilepsy.
  17352. </p>
  17353. <p>It accepts the following options:
  17354. </p><dl compact="compact">
  17355. <dt>&lsquo;<samp>frames, f</samp>&rsquo;</dt>
  17356. <dd><p>Set how many frames to use when filtering. Default is 30.
  17357. </p>
  17358. </dd>
  17359. <dt>&lsquo;<samp>threshold, t</samp>&rsquo;</dt>
  17360. <dd><p>Set detection threshold factor. Default is 1.
  17361. Lower is stricter.
  17362. </p>
  17363. </dd>
  17364. <dt>&lsquo;<samp>skip</samp>&rsquo;</dt>
  17365. <dd><p>Set how many pixels to skip when sampling frames. Default is 1.
  17366. Allowed range is from 1 to 1024.
  17367. </p>
  17368. </dd>
  17369. <dt>&lsquo;<samp>bypass</samp>&rsquo;</dt>
  17370. <dd><p>Leave frames unchanged. Default is disabled.
  17371. </p></dd>
  17372. </dl>
  17373. <a name="pixdesctest"></a>
  17374. <h2 class="section"><a href="ffmpeg-filters.html#toc-pixdesctest">11.155 pixdesctest</a></h2>
  17375. <p>Pixel format descriptor test filter, mainly useful for internal
  17376. testing. The output video should be equal to the input video.
  17377. </p>
  17378. <p>For example:
  17379. </p><div class="example">
  17380. <pre class="example">format=monow, pixdesctest
  17381. </pre></div>
  17382. <p>can be used to test the monowhite pixel format descriptor definition.
  17383. </p>
  17384. <a name="pixscope"></a>
  17385. <h2 class="section"><a href="ffmpeg-filters.html#toc-pixscope">11.156 pixscope</a></h2>
  17386. <p>Display sample values of color channels. Mainly useful for checking color
  17387. and levels. Minimum supported resolution is 640x480.
  17388. </p>
  17389. <p>The filters accept the following options:
  17390. </p>
  17391. <dl compact="compact">
  17392. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  17393. <dd><p>Set scope X position, relative offset on X axis.
  17394. </p>
  17395. </dd>
  17396. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  17397. <dd><p>Set scope Y position, relative offset on Y axis.
  17398. </p>
  17399. </dd>
  17400. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  17401. <dd><p>Set scope width.
  17402. </p>
  17403. </dd>
  17404. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  17405. <dd><p>Set scope height.
  17406. </p>
  17407. </dd>
  17408. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  17409. <dd><p>Set window opacity. This window also holds statistics about pixel area.
  17410. </p>
  17411. </dd>
  17412. <dt>&lsquo;<samp>wx</samp>&rsquo;</dt>
  17413. <dd><p>Set window X position, relative offset on X axis.
  17414. </p>
  17415. </dd>
  17416. <dt>&lsquo;<samp>wy</samp>&rsquo;</dt>
  17417. <dd><p>Set window Y position, relative offset on Y axis.
  17418. </p></dd>
  17419. </dl>
  17420. <a name="pp"></a>
  17421. <h2 class="section"><a href="ffmpeg-filters.html#toc-pp">11.157 pp</a></h2>
  17422. <p>Enable the specified chain of postprocessing subfilters using libpostproc. This
  17423. library should be automatically selected with a GPL build (<code>--enable-gpl</code>).
  17424. Subfilters must be separated by &rsquo;/&rsquo; and can be disabled by prepending a &rsquo;-&rsquo;.
  17425. Each subfilter and some options have a short and a long name that can be used
  17426. interchangeably, i.e. dr/dering are the same.
  17427. </p>
  17428. <p>The filters accept the following options:
  17429. </p>
  17430. <dl compact="compact">
  17431. <dt>&lsquo;<samp>subfilters</samp>&rsquo;</dt>
  17432. <dd><p>Set postprocessing subfilters string.
  17433. </p></dd>
  17434. </dl>
  17435. <p>All subfilters share common options to determine their scope:
  17436. </p>
  17437. <dl compact="compact">
  17438. <dt>&lsquo;<samp>a/autoq</samp>&rsquo;</dt>
  17439. <dd><p>Honor the quality commands for this subfilter.
  17440. </p>
  17441. </dd>
  17442. <dt>&lsquo;<samp>c/chrom</samp>&rsquo;</dt>
  17443. <dd><p>Do chrominance filtering, too (default).
  17444. </p>
  17445. </dd>
  17446. <dt>&lsquo;<samp>y/nochrom</samp>&rsquo;</dt>
  17447. <dd><p>Do luminance filtering only (no chrominance).
  17448. </p>
  17449. </dd>
  17450. <dt>&lsquo;<samp>n/noluma</samp>&rsquo;</dt>
  17451. <dd><p>Do chrominance filtering only (no luminance).
  17452. </p></dd>
  17453. </dl>
  17454. <p>These options can be appended after the subfilter name, separated by a &rsquo;|&rsquo;.
  17455. </p>
  17456. <p>Available subfilters are:
  17457. </p>
  17458. <dl compact="compact">
  17459. <dt>&lsquo;<samp>hb/hdeblock[|difference[|flatness]]</samp>&rsquo;</dt>
  17460. <dd><p>Horizontal deblocking filter
  17461. </p><dl compact="compact">
  17462. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  17463. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  17464. </p></dd>
  17465. <dt>&lsquo;<samp>flatness</samp>&rsquo;</dt>
  17466. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  17467. </p></dd>
  17468. </dl>
  17469. </dd>
  17470. <dt>&lsquo;<samp>vb/vdeblock[|difference[|flatness]]</samp>&rsquo;</dt>
  17471. <dd><p>Vertical deblocking filter
  17472. </p><dl compact="compact">
  17473. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  17474. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  17475. </p></dd>
  17476. <dt>&lsquo;<samp>flatness</samp>&rsquo;</dt>
  17477. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  17478. </p></dd>
  17479. </dl>
  17480. </dd>
  17481. <dt>&lsquo;<samp>ha/hadeblock[|difference[|flatness]]</samp>&rsquo;</dt>
  17482. <dd><p>Accurate horizontal deblocking filter
  17483. </p><dl compact="compact">
  17484. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  17485. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  17486. </p></dd>
  17487. <dt>&lsquo;<samp>flatness</samp>&rsquo;</dt>
  17488. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  17489. </p></dd>
  17490. </dl>
  17491. </dd>
  17492. <dt>&lsquo;<samp>va/vadeblock[|difference[|flatness]]</samp>&rsquo;</dt>
  17493. <dd><p>Accurate vertical deblocking filter
  17494. </p><dl compact="compact">
  17495. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  17496. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  17497. </p></dd>
  17498. <dt>&lsquo;<samp>flatness</samp>&rsquo;</dt>
  17499. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  17500. </p></dd>
  17501. </dl>
  17502. </dd>
  17503. </dl>
  17504. <p>The horizontal and vertical deblocking filters share the difference and
  17505. flatness values so you cannot set different horizontal and vertical
  17506. thresholds.
  17507. </p>
  17508. <dl compact="compact">
  17509. <dt>&lsquo;<samp>h1/x1hdeblock</samp>&rsquo;</dt>
  17510. <dd><p>Experimental horizontal deblocking filter
  17511. </p>
  17512. </dd>
  17513. <dt>&lsquo;<samp>v1/x1vdeblock</samp>&rsquo;</dt>
  17514. <dd><p>Experimental vertical deblocking filter
  17515. </p>
  17516. </dd>
  17517. <dt>&lsquo;<samp>dr/dering</samp>&rsquo;</dt>
  17518. <dd><p>Deringing filter
  17519. </p>
  17520. </dd>
  17521. <dt>&lsquo;<samp>tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer</samp>&rsquo;</dt>
  17522. <dd><dl compact="compact">
  17523. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  17524. <dd><p>larger -&gt; stronger filtering
  17525. </p></dd>
  17526. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  17527. <dd><p>larger -&gt; stronger filtering
  17528. </p></dd>
  17529. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  17530. <dd><p>larger -&gt; stronger filtering
  17531. </p></dd>
  17532. </dl>
  17533. </dd>
  17534. <dt>&lsquo;<samp>al/autolevels[:f/fullyrange], automatic brightness / contrast correction</samp>&rsquo;</dt>
  17535. <dd><dl compact="compact">
  17536. <dt>&lsquo;<samp>f/fullyrange</samp>&rsquo;</dt>
  17537. <dd><p>Stretch luminance to <code>0-255</code>.
  17538. </p></dd>
  17539. </dl>
  17540. </dd>
  17541. <dt>&lsquo;<samp>lb/linblenddeint</samp>&rsquo;</dt>
  17542. <dd><p>Linear blend deinterlacing filter that deinterlaces the given block by
  17543. filtering all lines with a <code>(1 2 1)</code> filter.
  17544. </p>
  17545. </dd>
  17546. <dt>&lsquo;<samp>li/linipoldeint</samp>&rsquo;</dt>
  17547. <dd><p>Linear interpolating deinterlacing filter that deinterlaces the given block by
  17548. linearly interpolating every second line.
  17549. </p>
  17550. </dd>
  17551. <dt>&lsquo;<samp>ci/cubicipoldeint</samp>&rsquo;</dt>
  17552. <dd><p>Cubic interpolating deinterlacing filter deinterlaces the given block by
  17553. cubically interpolating every second line.
  17554. </p>
  17555. </dd>
  17556. <dt>&lsquo;<samp>md/mediandeint</samp>&rsquo;</dt>
  17557. <dd><p>Median deinterlacing filter that deinterlaces the given block by applying a
  17558. median filter to every second line.
  17559. </p>
  17560. </dd>
  17561. <dt>&lsquo;<samp>fd/ffmpegdeint</samp>&rsquo;</dt>
  17562. <dd><p>FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
  17563. second line with a <code>(-1 4 2 4 -1)</code> filter.
  17564. </p>
  17565. </dd>
  17566. <dt>&lsquo;<samp>l5/lowpass5</samp>&rsquo;</dt>
  17567. <dd><p>Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
  17568. block by filtering all lines with a <code>(-1 2 6 2 -1)</code> filter.
  17569. </p>
  17570. </dd>
  17571. <dt>&lsquo;<samp>fq/forceQuant[|quantizer]</samp>&rsquo;</dt>
  17572. <dd><p>Overrides the quantizer table from the input with the constant quantizer you
  17573. specify.
  17574. </p><dl compact="compact">
  17575. <dt>&lsquo;<samp>quantizer</samp>&rsquo;</dt>
  17576. <dd><p>Quantizer to use
  17577. </p></dd>
  17578. </dl>
  17579. </dd>
  17580. <dt>&lsquo;<samp>de/default</samp>&rsquo;</dt>
  17581. <dd><p>Default pp filter combination (<code>hb|a,vb|a,dr|a</code>)
  17582. </p>
  17583. </dd>
  17584. <dt>&lsquo;<samp>fa/fast</samp>&rsquo;</dt>
  17585. <dd><p>Fast pp filter combination (<code>h1|a,v1|a,dr|a</code>)
  17586. </p>
  17587. </dd>
  17588. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  17589. <dd><p>High quality pp filter combination (<code>ha|a|128|7,va|a,dr|a</code>)
  17590. </p></dd>
  17591. </dl>
  17592. <a name="Examples-70"></a>
  17593. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-70">11.157.1 Examples</a></h3>
  17594. <ul>
  17595. <li>
  17596. Apply horizontal and vertical deblocking, deringing and automatic
  17597. brightness/contrast:
  17598. <div class="example">
  17599. <pre class="example">pp=hb/vb/dr/al
  17600. </pre></div>
  17601. </li><li>
  17602. Apply default filters without brightness/contrast correction:
  17603. <div class="example">
  17604. <pre class="example">pp=de/-al
  17605. </pre></div>
  17606. </li><li>
  17607. Apply default filters and temporal denoiser:
  17608. <div class="example">
  17609. <pre class="example">pp=default/tmpnoise|1|2|3
  17610. </pre></div>
  17611. </li><li>
  17612. Apply deblocking on luminance only, and switch vertical deblocking on or off
  17613. automatically depending on available CPU time:
  17614. <div class="example">
  17615. <pre class="example">pp=hb|y/vb|a
  17616. </pre></div>
  17617. </li></ul>
  17618. <a name="pp7"></a>
  17619. <h2 class="section"><a href="ffmpeg-filters.html#toc-pp7">11.158 pp7</a></h2>
  17620. <p>Apply Postprocessing filter 7. It is variant of the <a href="#spp">spp</a> filter,
  17621. similar to spp = 6 with 7 point DCT, where only the center sample is
  17622. used after IDCT.
  17623. </p>
  17624. <p>The filter accepts the following options:
  17625. </p>
  17626. <dl compact="compact">
  17627. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  17628. <dd><p>Force a constant quantization parameter. It accepts an integer in range
  17629. 0 to 63. If not set, the filter will use the QP from the video stream
  17630. (if available).
  17631. </p>
  17632. </dd>
  17633. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  17634. <dd><p>Set thresholding mode. Available modes are:
  17635. </p>
  17636. <dl compact="compact">
  17637. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  17638. <dd><p>Set hard thresholding.
  17639. </p></dd>
  17640. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  17641. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  17642. </p></dd>
  17643. <dt>&lsquo;<samp>medium</samp>&rsquo;</dt>
  17644. <dd><p>Set medium thresholding (good results, default).
  17645. </p></dd>
  17646. </dl>
  17647. </dd>
  17648. </dl>
  17649. <a name="premultiply"></a>
  17650. <h2 class="section"><a href="ffmpeg-filters.html#toc-premultiply">11.159 premultiply</a></h2>
  17651. <p>Apply alpha premultiply effect to input video stream using first plane
  17652. of second stream as alpha.
  17653. </p>
  17654. <p>Both streams must have same dimensions and same pixel format.
  17655. </p>
  17656. <p>The filter accepts the following option:
  17657. </p>
  17658. <dl compact="compact">
  17659. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  17660. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  17661. By default value 0xf, all planes will be processed.
  17662. </p>
  17663. </dd>
  17664. <dt>&lsquo;<samp>inplace</samp>&rsquo;</dt>
  17665. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  17666. </p></dd>
  17667. </dl>
  17668. <a name="prewitt"></a>
  17669. <h2 class="section"><a href="ffmpeg-filters.html#toc-prewitt">11.160 prewitt</a></h2>
  17670. <p>Apply prewitt operator to input video stream.
  17671. </p>
  17672. <p>The filter accepts the following option:
  17673. </p>
  17674. <dl compact="compact">
  17675. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  17676. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  17677. By default value 0xf, all planes will be processed.
  17678. </p>
  17679. </dd>
  17680. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  17681. <dd><p>Set value which will be multiplied with filtered result.
  17682. </p>
  17683. </dd>
  17684. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  17685. <dd><p>Set value which will be added to filtered result.
  17686. </p></dd>
  17687. </dl>
  17688. <a name="pseudocolor"></a>
  17689. <h2 class="section"><a href="ffmpeg-filters.html#toc-pseudocolor">11.161 pseudocolor</a></h2>
  17690. <p>Alter frame colors in video with pseudocolors.
  17691. </p>
  17692. <p>This filter accepts the following options:
  17693. </p>
  17694. <dl compact="compact">
  17695. <dt>&lsquo;<samp>c0</samp>&rsquo;</dt>
  17696. <dd><p>set pixel first component expression
  17697. </p>
  17698. </dd>
  17699. <dt>&lsquo;<samp>c1</samp>&rsquo;</dt>
  17700. <dd><p>set pixel second component expression
  17701. </p>
  17702. </dd>
  17703. <dt>&lsquo;<samp>c2</samp>&rsquo;</dt>
  17704. <dd><p>set pixel third component expression
  17705. </p>
  17706. </dd>
  17707. <dt>&lsquo;<samp>c3</samp>&rsquo;</dt>
  17708. <dd><p>set pixel fourth component expression, corresponds to the alpha component
  17709. </p>
  17710. </dd>
  17711. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  17712. <dd><p>set component to use as base for altering colors
  17713. </p></dd>
  17714. </dl>
  17715. <p>Each of them specifies the expression to use for computing the lookup table for
  17716. the corresponding pixel component values.
  17717. </p>
  17718. <p>The expressions can contain the following constants and functions:
  17719. </p>
  17720. <dl compact="compact">
  17721. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  17722. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  17723. <dd><p>The input width and height.
  17724. </p>
  17725. </dd>
  17726. <dt>&lsquo;<samp>val</samp>&rsquo;</dt>
  17727. <dd><p>The input value for the pixel component.
  17728. </p>
  17729. </dd>
  17730. <dt>&lsquo;<samp>ymin, umin, vmin, amin</samp>&rsquo;</dt>
  17731. <dd><p>The minimum allowed component value.
  17732. </p>
  17733. </dd>
  17734. <dt>&lsquo;<samp>ymax, umax, vmax, amax</samp>&rsquo;</dt>
  17735. <dd><p>The maximum allowed component value.
  17736. </p></dd>
  17737. </dl>
  17738. <p>All expressions default to &quot;val&quot;.
  17739. </p>
  17740. <a name="Examples-54"></a>
  17741. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-54">11.161.1 Examples</a></h3>
  17742. <ul>
  17743. <li>
  17744. Change too high luma values to gradient:
  17745. <div class="example">
  17746. <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;
  17747. </pre></div>
  17748. </li></ul>
  17749. <a name="psnr"></a>
  17750. <h2 class="section"><a href="ffmpeg-filters.html#toc-psnr">11.162 psnr</a></h2>
  17751. <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
  17752. Ratio) between two input videos.
  17753. </p>
  17754. <p>This filter takes in input two input videos, the first input is
  17755. considered the &quot;main&quot; source and is passed unchanged to the
  17756. output. The second input is used as a &quot;reference&quot; video for computing
  17757. the PSNR.
  17758. </p>
  17759. <p>Both video inputs must have the same resolution and pixel format for
  17760. this filter to work correctly. Also it assumes that both inputs
  17761. have the same number of frames, which are compared one by one.
  17762. </p>
  17763. <p>The obtained average PSNR is printed through the logging system.
  17764. </p>
  17765. <p>The filter stores the accumulated MSE (mean squared error) of each
  17766. frame, and at the end of the processing it is averaged across all frames
  17767. equally, and the following formula is applied to obtain the PSNR:
  17768. </p>
  17769. <div class="example">
  17770. <pre class="example">PSNR = 10*log10(MAX^2/MSE)
  17771. </pre></div>
  17772. <p>Where MAX is the average of the maximum values of each component of the
  17773. image.
  17774. </p>
  17775. <p>The description of the accepted parameters follows.
  17776. </p>
  17777. <dl compact="compact">
  17778. <dt>&lsquo;<samp>stats_file, f</samp>&rsquo;</dt>
  17779. <dd><p>If specified the filter will use the named file to save the PSNR of
  17780. each individual frame. When filename equals &quot;-&quot; the data is sent to
  17781. standard output.
  17782. </p>
  17783. </dd>
  17784. <dt>&lsquo;<samp>stats_version</samp>&rsquo;</dt>
  17785. <dd><p>Specifies which version of the stats file format to use. Details of
  17786. each format are written below.
  17787. Default value is 1.
  17788. </p>
  17789. </dd>
  17790. <dt>&lsquo;<samp>stats_add_max</samp>&rsquo;</dt>
  17791. <dd><p>Determines whether the max value is output to the stats log.
  17792. Default value is 0.
  17793. Requires stats_version &gt;= 2. If this is set and stats_version &lt; 2,
  17794. the filter will return an error.
  17795. </p></dd>
  17796. </dl>
  17797. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  17798. </p>
  17799. <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
  17800. key/value pairs of the form <var>key</var>:<var>value</var> for each compared
  17801. couple of frames.
  17802. </p>
  17803. <p>If a <var>stats_version</var> greater than 1 is specified, a header line precedes
  17804. the list of per-frame-pair stats, with key value pairs following the frame
  17805. format with the following parameters:
  17806. </p>
  17807. <dl compact="compact">
  17808. <dt>&lsquo;<samp>psnr_log_version</samp>&rsquo;</dt>
  17809. <dd><p>The version of the log file format. Will match <var>stats_version</var>.
  17810. </p>
  17811. </dd>
  17812. <dt>&lsquo;<samp>fields</samp>&rsquo;</dt>
  17813. <dd><p>A comma separated list of the per-frame-pair parameters included in
  17814. the log.
  17815. </p></dd>
  17816. </dl>
  17817. <p>A description of each shown per-frame-pair parameter follows:
  17818. </p>
  17819. <dl compact="compact">
  17820. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  17821. <dd><p>sequential number of the input frame, starting from 1
  17822. </p>
  17823. </dd>
  17824. <dt>&lsquo;<samp>mse_avg</samp>&rsquo;</dt>
  17825. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  17826. frames, averaged over all the image components.
  17827. </p>
  17828. </dd>
  17829. <dt>&lsquo;<samp>mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a</samp>&rsquo;</dt>
  17830. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  17831. frames for the component specified by the suffix.
  17832. </p>
  17833. </dd>
  17834. <dt>&lsquo;<samp>psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp>&rsquo;</dt>
  17835. <dd><p>Peak Signal to Noise ratio of the compared frames for the component
  17836. specified by the suffix.
  17837. </p>
  17838. </dd>
  17839. <dt>&lsquo;<samp>max_avg, max_y, max_u, max_v</samp>&rsquo;</dt>
  17840. <dd><p>Maximum allowed value for each channel, and average over all
  17841. channels.
  17842. </p></dd>
  17843. </dl>
  17844. <a name="Examples-51"></a>
  17845. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-51">11.162.1 Examples</a></h3>
  17846. <ul>
  17847. <li>
  17848. For example:
  17849. <div class="example">
  17850. <pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  17851. [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
  17852. </pre></div>
  17853. <p>On this example the input file being processed is compared with the
  17854. reference file &lsquo;<tt>ref_movie.mpg</tt>&rsquo;. The PSNR of each individual frame
  17855. is stored in &lsquo;<tt>stats.log</tt>&rsquo;.
  17856. </p>
  17857. </li><li>
  17858. Another example with different containers:
  17859. <div class="example">
  17860. <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 -
  17861. </pre></div>
  17862. </li></ul>
  17863. <p><a name="pullup"></a>
  17864. </p><a name="pullup-1"></a>
  17865. <h2 class="section"><a href="ffmpeg-filters.html#toc-pullup-1">11.163 pullup</a></h2>
  17866. <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
  17867. hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
  17868. content.
  17869. </p>
  17870. <p>The pullup filter is designed to take advantage of future context in making
  17871. its decisions. This filter is stateless in the sense that it does not lock
  17872. onto a pattern to follow, but it instead looks forward to the following
  17873. fields in order to identify matches and rebuild progressive frames.
  17874. </p>
  17875. <p>To produce content with an even framerate, insert the fps filter after
  17876. pullup, use <code>fps=24000/1001</code> if the input frame rate is 29.97fps,
  17877. <code>fps=24</code> for 30fps and the (rare) telecined 25fps input.
  17878. </p>
  17879. <p>The filter accepts the following options:
  17880. </p>
  17881. <dl compact="compact">
  17882. <dt>&lsquo;<samp>jl</samp>&rsquo;</dt>
  17883. <dt>&lsquo;<samp>jr</samp>&rsquo;</dt>
  17884. <dt>&lsquo;<samp>jt</samp>&rsquo;</dt>
  17885. <dt>&lsquo;<samp>jb</samp>&rsquo;</dt>
  17886. <dd><p>These options set the amount of &quot;junk&quot; to ignore at the left, right, top, and
  17887. bottom of the image, respectively. Left and right are in units of 8 pixels,
  17888. while top and bottom are in units of 2 lines.
  17889. The default is 8 pixels on each side.
  17890. </p>
  17891. </dd>
  17892. <dt>&lsquo;<samp>sb</samp>&rsquo;</dt>
  17893. <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
  17894. filter generating an occasional mismatched frame, but it may also cause an
  17895. excessive number of frames to be dropped during high motion sequences.
  17896. Conversely, setting it to -1 will make filter match fields more easily.
  17897. This may help processing of video where there is slight blurring between
  17898. the fields, but may also cause there to be interlaced frames in the output.
  17899. Default value is <code>0</code>.
  17900. </p>
  17901. </dd>
  17902. <dt>&lsquo;<samp>mp</samp>&rsquo;</dt>
  17903. <dd><p>Set the metric plane to use. It accepts the following values:
  17904. </p><dl compact="compact">
  17905. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  17906. <dd><p>Use luma plane.
  17907. </p>
  17908. </dd>
  17909. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  17910. <dd><p>Use chroma blue plane.
  17911. </p>
  17912. </dd>
  17913. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  17914. <dd><p>Use chroma red plane.
  17915. </p></dd>
  17916. </dl>
  17917. <p>This option may be set to use chroma plane instead of the default luma plane
  17918. for doing filter&rsquo;s computations. This may improve accuracy on very clean
  17919. source material, but more likely will decrease accuracy, especially if there
  17920. is chroma noise (rainbow effect) or any grayscale video.
  17921. The main purpose of setting &lsquo;<samp>mp</samp>&rsquo; to a chroma plane is to reduce CPU
  17922. load and make pullup usable in realtime on slow machines.
  17923. </p></dd>
  17924. </dl>
  17925. <p>For best results (without duplicated frames in the output file) it is
  17926. necessary to change the output frame rate. For example, to inverse
  17927. telecine NTSC input:
  17928. </p><div class="example">
  17929. <pre class="example">ffmpeg -i input -vf pullup -r 24000/1001 ...
  17930. </pre></div>
  17931. <a name="qp"></a>
  17932. <h2 class="section"><a href="ffmpeg-filters.html#toc-qp">11.164 qp</a></h2>
  17933. <p>Change video quantization parameters (QP).
  17934. </p>
  17935. <p>The filter accepts the following option:
  17936. </p>
  17937. <dl compact="compact">
  17938. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  17939. <dd><p>Set expression for quantization parameter.
  17940. </p></dd>
  17941. </dl>
  17942. <p>The expression is evaluated through the eval API and can contain, among others,
  17943. the following constants:
  17944. </p>
  17945. <dl compact="compact">
  17946. <dt><var>known</var></dt>
  17947. <dd><p>1 if index is not 129, 0 otherwise.
  17948. </p>
  17949. </dd>
  17950. <dt><var>qp</var></dt>
  17951. <dd><p>Sequential index starting from -129 to 128.
  17952. </p></dd>
  17953. </dl>
  17954. <a name="Examples-14"></a>
  17955. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-14">11.164.1 Examples</a></h3>
  17956. <ul>
  17957. <li>
  17958. Some equation like:
  17959. <div class="example">
  17960. <pre class="example">qp=2+2*sin(PI*qp)
  17961. </pre></div>
  17962. </li></ul>
  17963. <a name="random"></a>
  17964. <h2 class="section"><a href="ffmpeg-filters.html#toc-random">11.165 random</a></h2>
  17965. <p>Flush video frames from internal cache of frames into a random order.
  17966. No frame is discarded.
  17967. Inspired by <a href="#frei0r">frei0r</a> nervous filter.
  17968. </p>
  17969. <dl compact="compact">
  17970. <dt>&lsquo;<samp>frames</samp>&rsquo;</dt>
  17971. <dd><p>Set size in number of frames of internal cache, in range from <code>2</code> to
  17972. <code>512</code>. Default is <code>30</code>.
  17973. </p>
  17974. </dd>
  17975. <dt>&lsquo;<samp>seed</samp>&rsquo;</dt>
  17976. <dd><p>Set seed for random number generator, must be an integer included between
  17977. <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
  17978. less than <code>0</code>, the filter will try to use a good random seed on a
  17979. best effort basis.
  17980. </p></dd>
  17981. </dl>
  17982. <a name="readeia608"></a>
  17983. <h2 class="section"><a href="ffmpeg-filters.html#toc-readeia608">11.166 readeia608</a></h2>
  17984. <p>Read closed captioning (EIA-608) information from the top lines of a video frame.
  17985. </p>
  17986. <p>This filter adds frame metadata for <code>lavfi.readeia608.X.cc</code> and
  17987. <code>lavfi.readeia608.X.line</code>, where <code>X</code> is the number of the identified line
  17988. with EIA-608 data (starting from 0). A description of each metadata value follows:
  17989. </p>
  17990. <dl compact="compact">
  17991. <dt>&lsquo;<samp>lavfi.readeia608.X.cc</samp>&rsquo;</dt>
  17992. <dd><p>The two bytes stored as EIA-608 data (printed in hexadecimal).
  17993. </p>
  17994. </dd>
  17995. <dt>&lsquo;<samp>lavfi.readeia608.X.line</samp>&rsquo;</dt>
  17996. <dd><p>The number of the line on which the EIA-608 data was identified and read.
  17997. </p></dd>
  17998. </dl>
  17999. <p>This filter accepts the following options:
  18000. </p>
  18001. <dl compact="compact">
  18002. <dt>&lsquo;<samp>scan_min</samp>&rsquo;</dt>
  18003. <dd><p>Set the line to start scanning for EIA-608 data. Default is <code>0</code>.
  18004. </p>
  18005. </dd>
  18006. <dt>&lsquo;<samp>scan_max</samp>&rsquo;</dt>
  18007. <dd><p>Set the line to end scanning for EIA-608 data. Default is <code>29</code>.
  18008. </p>
  18009. </dd>
  18010. <dt>&lsquo;<samp>spw</samp>&rsquo;</dt>
  18011. <dd><p>Set the ratio of width reserved for sync code detection.
  18012. Default is <code>0.27</code>. Allowed range is <code>[0.1 - 0.7]</code>.
  18013. </p>
  18014. </dd>
  18015. <dt>&lsquo;<samp>chp</samp>&rsquo;</dt>
  18016. <dd><p>Enable checking the parity bit. In the event of a parity error, the filter will output
  18017. <code>0x00</code> for that character. Default is false.
  18018. </p>
  18019. </dd>
  18020. <dt>&lsquo;<samp>lp</samp>&rsquo;</dt>
  18021. <dd><p>Lowpass lines prior to further processing. Default is enabled.
  18022. </p></dd>
  18023. </dl>
  18024. <a name="Examples-132"></a>
  18025. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-132">11.166.1 Examples</a></h3>
  18026. <ul>
  18027. <li>
  18028. Output a csv with presentation time and the first two lines of identified EIA-608 captioning data.
  18029. <div class="example">
  18030. <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
  18031. </pre></div>
  18032. </li></ul>
  18033. <a name="readvitc"></a>
  18034. <h2 class="section"><a href="ffmpeg-filters.html#toc-readvitc">11.167 readvitc</a></h2>
  18035. <p>Read vertical interval timecode (VITC) information from the top lines of a
  18036. video frame.
  18037. </p>
  18038. <p>The filter adds frame metadata key <code>lavfi.readvitc.tc_str</code> with the
  18039. timecode value, if a valid timecode has been detected. Further metadata key
  18040. <code>lavfi.readvitc.found</code> is set to 0/1 depending on whether
  18041. timecode data has been found or not.
  18042. </p>
  18043. <p>This filter accepts the following options:
  18044. </p>
  18045. <dl compact="compact">
  18046. <dt>&lsquo;<samp>scan_max</samp>&rsquo;</dt>
  18047. <dd><p>Set the maximum number of lines to scan for VITC data. If the value is set to
  18048. <code>-1</code> the full video frame is scanned. Default is <code>45</code>.
  18049. </p>
  18050. </dd>
  18051. <dt>&lsquo;<samp>thr_b</samp>&rsquo;</dt>
  18052. <dd><p>Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0],
  18053. default value is <code>0.2</code>. The value must be equal or less than <code>thr_w</code>.
  18054. </p>
  18055. </dd>
  18056. <dt>&lsquo;<samp>thr_w</samp>&rsquo;</dt>
  18057. <dd><p>Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0],
  18058. default value is <code>0.6</code>. The value must be equal or greater than <code>thr_b</code>.
  18059. </p></dd>
  18060. </dl>
  18061. <a name="Examples-39"></a>
  18062. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-39">11.167.1 Examples</a></h3>
  18063. <ul>
  18064. <li>
  18065. Detect and draw VITC data onto the video frame; if no valid VITC is detected,
  18066. draw <code>--:--:--:--</code> as a placeholder:
  18067. <div class="example">
  18068. <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'
  18069. </pre></div>
  18070. </li></ul>
  18071. <a name="remap"></a>
  18072. <h2 class="section"><a href="ffmpeg-filters.html#toc-remap">11.168 remap</a></h2>
  18073. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  18074. </p>
  18075. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  18076. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  18077. value for pixel will be used for destination pixel.
  18078. </p>
  18079. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  18080. will have Xmap/Ymap video stream dimensions.
  18081. Xmap and Ymap input video streams are 16bit depth, single channel.
  18082. </p>
  18083. <dl compact="compact">
  18084. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  18085. <dd><p>Specify pixel format of output from this filter. Can be <code>color</code> or <code>gray</code>.
  18086. Default is <code>color</code>.
  18087. </p>
  18088. </dd>
  18089. <dt>&lsquo;<samp>fill</samp>&rsquo;</dt>
  18090. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  18091. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>. Default color is <code>black</code>.
  18092. </p></dd>
  18093. </dl>
  18094. <a name="removegrain"></a>
  18095. <h2 class="section"><a href="ffmpeg-filters.html#toc-removegrain">11.169 removegrain</a></h2>
  18096. <p>The removegrain filter is a spatial denoiser for progressive video.
  18097. </p>
  18098. <dl compact="compact">
  18099. <dt>&lsquo;<samp>m0</samp>&rsquo;</dt>
  18100. <dd><p>Set mode for the first plane.
  18101. </p>
  18102. </dd>
  18103. <dt>&lsquo;<samp>m1</samp>&rsquo;</dt>
  18104. <dd><p>Set mode for the second plane.
  18105. </p>
  18106. </dd>
  18107. <dt>&lsquo;<samp>m2</samp>&rsquo;</dt>
  18108. <dd><p>Set mode for the third plane.
  18109. </p>
  18110. </dd>
  18111. <dt>&lsquo;<samp>m3</samp>&rsquo;</dt>
  18112. <dd><p>Set mode for the fourth plane.
  18113. </p></dd>
  18114. </dl>
  18115. <p>Range of mode is from 0 to 24. Description of each mode follows:
  18116. </p>
  18117. <dl compact="compact">
  18118. <dt><var>0</var></dt>
  18119. <dd><p>Leave input plane unchanged. Default.
  18120. </p>
  18121. </dd>
  18122. <dt><var>1</var></dt>
  18123. <dd><p>Clips the pixel with the minimum and maximum of the 8 neighbour pixels.
  18124. </p>
  18125. </dd>
  18126. <dt><var>2</var></dt>
  18127. <dd><p>Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.
  18128. </p>
  18129. </dd>
  18130. <dt><var>3</var></dt>
  18131. <dd><p>Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.
  18132. </p>
  18133. </dd>
  18134. <dt><var>4</var></dt>
  18135. <dd><p>Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels.
  18136. This is equivalent to a median filter.
  18137. </p>
  18138. </dd>
  18139. <dt><var>5</var></dt>
  18140. <dd><p>Line-sensitive clipping giving the minimal change.
  18141. </p>
  18142. </dd>
  18143. <dt><var>6</var></dt>
  18144. <dd><p>Line-sensitive clipping, intermediate.
  18145. </p>
  18146. </dd>
  18147. <dt><var>7</var></dt>
  18148. <dd><p>Line-sensitive clipping, intermediate.
  18149. </p>
  18150. </dd>
  18151. <dt><var>8</var></dt>
  18152. <dd><p>Line-sensitive clipping, intermediate.
  18153. </p>
  18154. </dd>
  18155. <dt><var>9</var></dt>
  18156. <dd><p>Line-sensitive clipping on a line where the neighbours pixels are the closest.
  18157. </p>
  18158. </dd>
  18159. <dt><var>10</var></dt>
  18160. <dd><p>Replaces the target pixel with the closest neighbour.
  18161. </p>
  18162. </dd>
  18163. <dt><var>11</var></dt>
  18164. <dd><p>[1 2 1] horizontal and vertical kernel blur.
  18165. </p>
  18166. </dd>
  18167. <dt><var>12</var></dt>
  18168. <dd><p>Same as mode 11.
  18169. </p>
  18170. </dd>
  18171. <dt><var>13</var></dt>
  18172. <dd><p>Bob mode, interpolates top field from the line where the neighbours
  18173. pixels are the closest.
  18174. </p>
  18175. </dd>
  18176. <dt><var>14</var></dt>
  18177. <dd><p>Bob mode, interpolates bottom field from the line where the neighbours
  18178. pixels are the closest.
  18179. </p>
  18180. </dd>
  18181. <dt><var>15</var></dt>
  18182. <dd><p>Bob mode, interpolates top field. Same as 13 but with a more complicated
  18183. interpolation formula.
  18184. </p>
  18185. </dd>
  18186. <dt><var>16</var></dt>
  18187. <dd><p>Bob mode, interpolates bottom field. Same as 14 but with a more complicated
  18188. interpolation formula.
  18189. </p>
  18190. </dd>
  18191. <dt><var>17</var></dt>
  18192. <dd><p>Clips the pixel with the minimum and maximum of respectively the maximum and
  18193. minimum of each pair of opposite neighbour pixels.
  18194. </p>
  18195. </dd>
  18196. <dt><var>18</var></dt>
  18197. <dd><p>Line-sensitive clipping using opposite neighbours whose greatest distance from
  18198. the current pixel is minimal.
  18199. </p>
  18200. </dd>
  18201. <dt><var>19</var></dt>
  18202. <dd><p>Replaces the pixel with the average of its 8 neighbours.
  18203. </p>
  18204. </dd>
  18205. <dt><var>20</var></dt>
  18206. <dd><p>Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
  18207. </p>
  18208. </dd>
  18209. <dt><var>21</var></dt>
  18210. <dd><p>Clips pixels using the averages of opposite neighbour.
  18211. </p>
  18212. </dd>
  18213. <dt><var>22</var></dt>
  18214. <dd><p>Same as mode 21 but simpler and faster.
  18215. </p>
  18216. </dd>
  18217. <dt><var>23</var></dt>
  18218. <dd><p>Small edge and halo removal, but reputed useless.
  18219. </p>
  18220. </dd>
  18221. <dt><var>24</var></dt>
  18222. <dd><p>Similar as 23.
  18223. </p></dd>
  18224. </dl>
  18225. <a name="removelogo"></a>
  18226. <h2 class="section"><a href="ffmpeg-filters.html#toc-removelogo">11.170 removelogo</a></h2>
  18227. <p>Suppress a TV station logo, using an image file to determine which
  18228. pixels comprise the logo. It works by filling in the pixels that
  18229. comprise the logo with neighboring pixels.
  18230. </p>
  18231. <p>The filter accepts the following options:
  18232. </p>
  18233. <dl compact="compact">
  18234. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  18235. <dd><p>Set the filter bitmap file, which can be any image format supported by
  18236. libavformat. The width and height of the image file must match those of the
  18237. video stream being processed.
  18238. </p></dd>
  18239. </dl>
  18240. <p>Pixels in the provided bitmap image with a value of zero are not
  18241. considered part of the logo, non-zero pixels are considered part of
  18242. the logo. If you use white (255) for the logo and black (0) for the
  18243. rest, you will be safe. For making the filter bitmap, it is
  18244. recommended to take a screen capture of a black frame with the logo
  18245. visible, and then using a threshold filter followed by the erode
  18246. filter once or twice.
  18247. </p>
  18248. <p>If needed, little splotches can be fixed manually. Remember that if
  18249. logo pixels are not covered, the filter quality will be much
  18250. reduced. Marking too many pixels as part of the logo does not hurt as
  18251. much, but it will increase the amount of blurring needed to cover over
  18252. the image and will destroy more information than necessary, and extra
  18253. pixels will slow things down on a large logo.
  18254. </p>
  18255. <a name="repeatfields"></a>
  18256. <h2 class="section"><a href="ffmpeg-filters.html#toc-repeatfields">11.171 repeatfields</a></h2>
  18257. <p>This filter uses the repeat_field flag from the Video ES headers and hard repeats
  18258. fields based on its value.
  18259. </p>
  18260. <a name="reverse"></a>
  18261. <h2 class="section"><a href="ffmpeg-filters.html#toc-reverse">11.172 reverse</a></h2>
  18262. <p>Reverse a video clip.
  18263. </p>
  18264. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  18265. is suggested.
  18266. </p>
  18267. <a name="Examples-9"></a>
  18268. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-9">11.172.1 Examples</a></h3>
  18269. <ul>
  18270. <li>
  18271. Take the first 5 seconds of a clip, and reverse it.
  18272. <div class="example">
  18273. <pre class="example">trim=end=5,reverse
  18274. </pre></div>
  18275. </li></ul>
  18276. <a name="rgbashift"></a>
  18277. <h2 class="section"><a href="ffmpeg-filters.html#toc-rgbashift">11.173 rgbashift</a></h2>
  18278. <p>Shift R/G/B/A pixels horizontally and/or vertically.
  18279. </p>
  18280. <p>The filter accepts the following options:
  18281. </p><dl compact="compact">
  18282. <dt>&lsquo;<samp>rh</samp>&rsquo;</dt>
  18283. <dd><p>Set amount to shift red horizontally.
  18284. </p></dd>
  18285. <dt>&lsquo;<samp>rv</samp>&rsquo;</dt>
  18286. <dd><p>Set amount to shift red vertically.
  18287. </p></dd>
  18288. <dt>&lsquo;<samp>gh</samp>&rsquo;</dt>
  18289. <dd><p>Set amount to shift green horizontally.
  18290. </p></dd>
  18291. <dt>&lsquo;<samp>gv</samp>&rsquo;</dt>
  18292. <dd><p>Set amount to shift green vertically.
  18293. </p></dd>
  18294. <dt>&lsquo;<samp>bh</samp>&rsquo;</dt>
  18295. <dd><p>Set amount to shift blue horizontally.
  18296. </p></dd>
  18297. <dt>&lsquo;<samp>bv</samp>&rsquo;</dt>
  18298. <dd><p>Set amount to shift blue vertically.
  18299. </p></dd>
  18300. <dt>&lsquo;<samp>ah</samp>&rsquo;</dt>
  18301. <dd><p>Set amount to shift alpha horizontally.
  18302. </p></dd>
  18303. <dt>&lsquo;<samp>av</samp>&rsquo;</dt>
  18304. <dd><p>Set amount to shift alpha vertically.
  18305. </p></dd>
  18306. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  18307. <dd><p>Set edge mode, can be <var>smear</var>, default, or <var>warp</var>.
  18308. </p></dd>
  18309. </dl>
  18310. <a name="Commands-10"></a>
  18311. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-10">11.173.1 Commands</a></h3>
  18312. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  18313. </p>
  18314. <a name="roberts"></a>
  18315. <h2 class="section"><a href="ffmpeg-filters.html#toc-roberts">11.174 roberts</a></h2>
  18316. <p>Apply roberts cross operator to input video stream.
  18317. </p>
  18318. <p>The filter accepts the following option:
  18319. </p>
  18320. <dl compact="compact">
  18321. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  18322. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  18323. By default value 0xf, all planes will be processed.
  18324. </p>
  18325. </dd>
  18326. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  18327. <dd><p>Set value which will be multiplied with filtered result.
  18328. </p>
  18329. </dd>
  18330. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  18331. <dd><p>Set value which will be added to filtered result.
  18332. </p></dd>
  18333. </dl>
  18334. <a name="rotate"></a>
  18335. <h2 class="section"><a href="ffmpeg-filters.html#toc-rotate">11.175 rotate</a></h2>
  18336. <p>Rotate video by an arbitrary angle expressed in radians.
  18337. </p>
  18338. <p>The filter accepts the following options:
  18339. </p>
  18340. <p>A description of the optional parameters follows.
  18341. </p><dl compact="compact">
  18342. <dt>&lsquo;<samp>angle, a</samp>&rsquo;</dt>
  18343. <dd><p>Set an expression for the angle by which to rotate the input video
  18344. clockwise, expressed as a number of radians. A negative value will
  18345. result in a counter-clockwise rotation. By default it is set to &quot;0&quot;.
  18346. </p>
  18347. <p>This expression is evaluated for each frame.
  18348. </p>
  18349. </dd>
  18350. <dt>&lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
  18351. <dd><p>Set the output width expression, default value is &quot;iw&quot;.
  18352. This expression is evaluated just once during configuration.
  18353. </p>
  18354. </dd>
  18355. <dt>&lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
  18356. <dd><p>Set the output height expression, default value is &quot;ih&quot;.
  18357. This expression is evaluated just once during configuration.
  18358. </p>
  18359. </dd>
  18360. <dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
  18361. <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
  18362. it. Default value is 1.
  18363. </p>
  18364. </dd>
  18365. <dt>&lsquo;<samp>fillcolor, c</samp>&rsquo;</dt>
  18366. <dd><p>Set the color used to fill the output area not covered by the rotated
  18367. image. For the general syntax of this option, check the
  18368. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  18369. If the special value &quot;none&quot; is selected then no
  18370. background is printed (useful for example if the background is never shown).
  18371. </p>
  18372. <p>Default value is &quot;black&quot;.
  18373. </p></dd>
  18374. </dl>
  18375. <p>The expressions for the angle and the output size can contain the
  18376. following constants and functions:
  18377. </p>
  18378. <dl compact="compact">
  18379. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  18380. <dd><p>sequential number of the input frame, starting from 0. It is always NAN
  18381. before the first frame is filtered.
  18382. </p>
  18383. </dd>
  18384. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  18385. <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
  18386. configured. It is always NAN before the first frame is filtered.
  18387. </p>
  18388. </dd>
  18389. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  18390. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  18391. <dd><p>horizontal and vertical chroma subsample values. For example for the
  18392. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  18393. </p>
  18394. </dd>
  18395. <dt>&lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
  18396. <dt>&lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
  18397. <dd><p>the input video width and height
  18398. </p>
  18399. </dd>
  18400. <dt>&lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
  18401. <dt>&lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
  18402. <dd><p>the output width and height, that is the size of the padded area as
  18403. specified by the <var>width</var> and <var>height</var> expressions
  18404. </p>
  18405. </dd>
  18406. <dt>&lsquo;<samp>rotw(a)</samp>&rsquo;</dt>
  18407. <dt>&lsquo;<samp>roth(a)</samp>&rsquo;</dt>
  18408. <dd><p>the minimal width/height required for completely containing the input
  18409. video rotated by <var>a</var> radians.
  18410. </p>
  18411. <p>These are only available when computing the &lsquo;<samp>out_w</samp>&rsquo; and
  18412. &lsquo;<samp>out_h</samp>&rsquo; expressions.
  18413. </p></dd>
  18414. </dl>
  18415. <a name="Examples-152"></a>
  18416. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-152">11.175.1 Examples</a></h3>
  18417. <ul>
  18418. <li>
  18419. Rotate the input by PI/6 radians clockwise:
  18420. <div class="example">
  18421. <pre class="example">rotate=PI/6
  18422. </pre></div>
  18423. </li><li>
  18424. Rotate the input by PI/6 radians counter-clockwise:
  18425. <div class="example">
  18426. <pre class="example">rotate=-PI/6
  18427. </pre></div>
  18428. </li><li>
  18429. Rotate the input by 45 degrees clockwise:
  18430. <div class="example">
  18431. <pre class="example">rotate=45*PI/180
  18432. </pre></div>
  18433. </li><li>
  18434. Apply a constant rotation with period T, starting from an angle of PI/3:
  18435. <div class="example">
  18436. <pre class="example">rotate=PI/3+2*PI*t/T
  18437. </pre></div>
  18438. </li><li>
  18439. Make the input video rotation oscillating with a period of T
  18440. seconds and an amplitude of A radians:
  18441. <div class="example">
  18442. <pre class="example">rotate=A*sin(2*PI/T*t)
  18443. </pre></div>
  18444. </li><li>
  18445. Rotate the video, output size is chosen so that the whole rotating
  18446. input video is always completely contained in the output:
  18447. <div class="example">
  18448. <pre class="example">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
  18449. </pre></div>
  18450. </li><li>
  18451. Rotate the video, reduce the output size so that no background is ever
  18452. shown:
  18453. <div class="example">
  18454. <pre class="example">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
  18455. </pre></div>
  18456. </li></ul>
  18457. <a name="Commands-59"></a>
  18458. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-59">11.175.2 Commands</a></h3>
  18459. <p>The filter supports the following commands:
  18460. </p>
  18461. <dl compact="compact">
  18462. <dt>&lsquo;<samp>a, angle</samp>&rsquo;</dt>
  18463. <dd><p>Set the angle expression.
  18464. The command accepts the same syntax of the corresponding option.
  18465. </p>
  18466. <p>If the specified expression is not valid, it is kept at its current
  18467. value.
  18468. </p></dd>
  18469. </dl>
  18470. <a name="sab"></a>
  18471. <h2 class="section"><a href="ffmpeg-filters.html#toc-sab">11.176 sab</a></h2>
  18472. <p>Apply Shape Adaptive Blur.
  18473. </p>
  18474. <p>The filter accepts the following options:
  18475. </p>
  18476. <dl compact="compact">
  18477. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  18478. <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
  18479. value is 1.0. A greater value will result in a more blurred image, and
  18480. in slower processing.
  18481. </p>
  18482. </dd>
  18483. <dt>&lsquo;<samp>luma_pre_filter_radius, lpfr</samp>&rsquo;</dt>
  18484. <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
  18485. value is 1.0.
  18486. </p>
  18487. </dd>
  18488. <dt>&lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
  18489. <dd><p>Set luma maximum difference between pixels to still be considered, must
  18490. be a value in the 0.1-100.0 range, default value is 1.0.
  18491. </p>
  18492. </dd>
  18493. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  18494. <dd><p>Set chroma blur filter strength, must be a value in range -0.9-4.0. A
  18495. greater value will result in a more blurred image, and in slower
  18496. processing.
  18497. </p>
  18498. </dd>
  18499. <dt>&lsquo;<samp>chroma_pre_filter_radius, cpfr</samp>&rsquo;</dt>
  18500. <dd><p>Set chroma pre-filter radius, must be a value in the -0.9-2.0 range.
  18501. </p>
  18502. </dd>
  18503. <dt>&lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
  18504. <dd><p>Set chroma maximum difference between pixels to still be considered,
  18505. must be a value in the -0.9-100.0 range.
  18506. </p></dd>
  18507. </dl>
  18508. <p>Each chroma option value, if not explicitly specified, is set to the
  18509. corresponding luma option value.
  18510. </p>
  18511. <p><a name="scale"></a>
  18512. </p><a name="scale-1"></a>
  18513. <h2 class="section"><a href="ffmpeg-filters.html#toc-scale-1">11.177 scale</a></h2>
  18514. <p>Scale (resize) the input video, using the libswscale library.
  18515. </p>
  18516. <p>The scale filter forces the output display aspect ratio to be the same
  18517. of the input, by changing the output sample aspect ratio.
  18518. </p>
  18519. <p>If the input image format is different from the format requested by
  18520. the next filter, the scale filter will convert the input to the
  18521. requested format.
  18522. </p>
  18523. <a name="Options-2"></a>
  18524. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Options-2">11.177.1 Options</a></h3>
  18525. <p>The filter accepts the following options, or any of the options
  18526. supported by the libswscale scaler.
  18527. </p>
  18528. <p>See <a href="ffmpeg-scaler.html#scaler_005foptions">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for
  18529. the complete list of scaler options.
  18530. </p>
  18531. <dl compact="compact">
  18532. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  18533. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  18534. <dd><p>Set the output video dimension expression. Default value is the input
  18535. dimension.
  18536. </p>
  18537. <p>If the <var>width</var> or <var>w</var> value is 0, the input width is used for
  18538. the output. If the <var>height</var> or <var>h</var> value is 0, the input height
  18539. is used for the output.
  18540. </p>
  18541. <p>If one and only one of the values is -n with n &gt;= 1, the scale filter
  18542. will use a value that maintains the aspect ratio of the input image,
  18543. calculated from the other specified dimension. After that it will,
  18544. however, make sure that the calculated dimension is divisible by n and
  18545. adjust the value if necessary.
  18546. </p>
  18547. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  18548. both values being set to 0 as previously detailed.
  18549. </p>
  18550. <p>See below for the list of accepted constants for use in the dimension
  18551. expression.
  18552. </p>
  18553. </dd>
  18554. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  18555. <dd><p>Specify when to evaluate <var>width</var> and <var>height</var> expression. It accepts the following values:
  18556. </p>
  18557. <dl compact="compact">
  18558. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  18559. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  18560. </p>
  18561. </dd>
  18562. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  18563. <dd><p>Evaluate expressions for each incoming frame.
  18564. </p>
  18565. </dd>
  18566. </dl>
  18567. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  18568. </p>
  18569. </dd>
  18570. <dt>&lsquo;<samp>interl</samp>&rsquo;</dt>
  18571. <dd><p>Set the interlacing mode. It accepts the following values:
  18572. </p>
  18573. <dl compact="compact">
  18574. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  18575. <dd><p>Force interlaced aware scaling.
  18576. </p>
  18577. </dd>
  18578. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  18579. <dd><p>Do not apply interlaced scaling.
  18580. </p>
  18581. </dd>
  18582. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  18583. <dd><p>Select interlaced aware scaling depending on whether the source frames
  18584. are flagged as interlaced or not.
  18585. </p></dd>
  18586. </dl>
  18587. <p>Default value is &lsquo;<samp>0</samp>&rsquo;.
  18588. </p>
  18589. </dd>
  18590. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  18591. <dd><p>Set libswscale scaling flags. See
  18592. <a href="ffmpeg-scaler.html#sws_005fflags">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for the
  18593. complete list of values. If not explicitly specified the filter applies
  18594. the default flags.
  18595. </p>
  18596. </dd>
  18597. <dt>&lsquo;<samp>param0, param1</samp>&rsquo;</dt>
  18598. <dd><p>Set libswscale input parameters for scaling algorithms that need them. See
  18599. <a href="ffmpeg-scaler.html#sws_005fparams">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for the
  18600. complete documentation. If not explicitly specified the filter applies
  18601. empty parameters.
  18602. </p>
  18603. </dd>
  18604. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  18605. <dd><p>Set the video size. For the syntax of this option, check the
  18606. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  18607. </p>
  18608. </dd>
  18609. <dt>&lsquo;<samp>in_color_matrix</samp>&rsquo;</dt>
  18610. <dt>&lsquo;<samp>out_color_matrix</samp>&rsquo;</dt>
  18611. <dd><p>Set in/output YCbCr color space type.
  18612. </p>
  18613. <p>This allows the autodetected value to be overridden as well as allows forcing
  18614. a specific value used for the output and encoder.
  18615. </p>
  18616. <p>If not specified, the color space type depends on the pixel format.
  18617. </p>
  18618. <p>Possible values:
  18619. </p>
  18620. <dl compact="compact">
  18621. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  18622. <dd><p>Choose automatically.
  18623. </p>
  18624. </dd>
  18625. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  18626. <dd><p>Format conforming to International Telecommunication Union (ITU)
  18627. Recommendation BT.709.
  18628. </p>
  18629. </dd>
  18630. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  18631. <dd><p>Set color space conforming to the United States Federal Communications
  18632. Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
  18633. </p>
  18634. </dd>
  18635. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  18636. <dt>&lsquo;<samp>bt470</samp>&rsquo;</dt>
  18637. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  18638. <dd><p>Set color space conforming to:
  18639. </p>
  18640. <ul>
  18641. <li>
  18642. ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
  18643. </li><li>
  18644. ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
  18645. </li><li>
  18646. Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
  18647. </li></ul>
  18648. </dd>
  18649. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  18650. <dd><p>Set color space conforming to SMPTE ST 240:1999.
  18651. </p>
  18652. </dd>
  18653. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  18654. <dd><p>Set color space conforming to ITU-R BT.2020 non-constant luminance system.
  18655. </p></dd>
  18656. </dl>
  18657. </dd>
  18658. <dt>&lsquo;<samp>in_range</samp>&rsquo;</dt>
  18659. <dt>&lsquo;<samp>out_range</samp>&rsquo;</dt>
  18660. <dd><p>Set in/output YCbCr sample range.
  18661. </p>
  18662. <p>This allows the autodetected value to be overridden as well as allows forcing
  18663. a specific value used for the output and encoder. If not specified, the
  18664. range depends on the pixel format. Possible values:
  18665. </p>
  18666. <dl compact="compact">
  18667. <dt>&lsquo;<samp>auto/unknown</samp>&rsquo;</dt>
  18668. <dd><p>Choose automatically.
  18669. </p>
  18670. </dd>
  18671. <dt>&lsquo;<samp>jpeg/full/pc</samp>&rsquo;</dt>
  18672. <dd><p>Set full range (0-255 in case of 8-bit luma).
  18673. </p>
  18674. </dd>
  18675. <dt>&lsquo;<samp>mpeg/limited/tv</samp>&rsquo;</dt>
  18676. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  18677. </p></dd>
  18678. </dl>
  18679. </dd>
  18680. <dt>&lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;</dt>
  18681. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  18682. keep the original aspect ratio. Possible values:
  18683. </p>
  18684. <dl compact="compact">
  18685. <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
  18686. <dd><p>Scale the video as specified and disable this feature.
  18687. </p>
  18688. </dd>
  18689. <dt>&lsquo;<samp>decrease</samp>&rsquo;</dt>
  18690. <dd><p>The output video dimensions will automatically be decreased if needed.
  18691. </p>
  18692. </dd>
  18693. <dt>&lsquo;<samp>increase</samp>&rsquo;</dt>
  18694. <dd><p>The output video dimensions will automatically be increased if needed.
  18695. </p>
  18696. </dd>
  18697. </dl>
  18698. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  18699. maximum allowed resolution, you can use this to limit the output video to
  18700. that, while retaining the aspect ratio. For example, device A allows
  18701. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  18702. decrease) and specifying 1280x720 to the command line makes the output
  18703. 1280x533.
  18704. </p>
  18705. <p>Please note that this is a different thing than specifying -1 for &lsquo;<samp>w</samp>&rsquo;
  18706. or &lsquo;<samp>h</samp>&rsquo;, you still need to specify the output resolution for this option
  18707. to work.
  18708. </p>
  18709. </dd>
  18710. <dt>&lsquo;<samp>force_divisible_by</samp>&rsquo;</dt>
  18711. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  18712. given integer when used together with &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;. This
  18713. works similar to using <code>-n</code> in the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options.
  18714. </p>
  18715. <p>This option respects the value set for &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;,
  18716. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  18717. may be slightly modified.
  18718. </p>
  18719. <p>This option can be handy if you need to have a video fit within or exceed
  18720. a defined resolution using &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo; but also have
  18721. encoder restrictions on width or height divisibility.
  18722. </p>
  18723. </dd>
  18724. </dl>
  18725. <p>The values of the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options are expressions
  18726. containing the following constants:
  18727. </p>
  18728. <dl compact="compact">
  18729. <dt><var>in_w</var></dt>
  18730. <dt><var>in_h</var></dt>
  18731. <dd><p>The input width and height
  18732. </p>
  18733. </dd>
  18734. <dt><var>iw</var></dt>
  18735. <dt><var>ih</var></dt>
  18736. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  18737. </p>
  18738. </dd>
  18739. <dt><var>out_w</var></dt>
  18740. <dt><var>out_h</var></dt>
  18741. <dd><p>The output (scaled) width and height
  18742. </p>
  18743. </dd>
  18744. <dt><var>ow</var></dt>
  18745. <dt><var>oh</var></dt>
  18746. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>
  18747. </p>
  18748. </dd>
  18749. <dt><var>a</var></dt>
  18750. <dd><p>The same as <var>iw</var> / <var>ih</var>
  18751. </p>
  18752. </dd>
  18753. <dt><var>sar</var></dt>
  18754. <dd><p>input sample aspect ratio
  18755. </p>
  18756. </dd>
  18757. <dt><var>dar</var></dt>
  18758. <dd><p>The input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
  18759. </p>
  18760. </dd>
  18761. <dt><var>hsub</var></dt>
  18762. <dt><var>vsub</var></dt>
  18763. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  18764. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  18765. </p>
  18766. </dd>
  18767. <dt><var>ohsub</var></dt>
  18768. <dt><var>ovsub</var></dt>
  18769. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  18770. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  18771. </p>
  18772. </dd>
  18773. <dt><var>n</var></dt>
  18774. <dd><p>The (sequential) number of the input frame, starting from 0.
  18775. Only available with <code>eval=frame</code>.
  18776. </p>
  18777. </dd>
  18778. <dt><var>t</var></dt>
  18779. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  18780. seconds. Only available with <code>eval=frame</code>.
  18781. </p>
  18782. </dd>
  18783. <dt><var>pos</var></dt>
  18784. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  18785. this information is unavailable and/or meaningless (for example in case of synthetic video).
  18786. Only available with <code>eval=frame</code>.
  18787. </p></dd>
  18788. </dl>
  18789. <a name="Examples-43"></a>
  18790. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-43">11.177.2 Examples</a></h3>
  18791. <ul>
  18792. <li>
  18793. Scale the input video to a size of 200x100
  18794. <div class="example">
  18795. <pre class="example">scale=w=200:h=100
  18796. </pre></div>
  18797. <p>This is equivalent to:
  18798. </p><div class="example">
  18799. <pre class="example">scale=200:100
  18800. </pre></div>
  18801. <p>or:
  18802. </p><div class="example">
  18803. <pre class="example">scale=200x100
  18804. </pre></div>
  18805. </li><li>
  18806. Specify a size abbreviation for the output size:
  18807. <div class="example">
  18808. <pre class="example">scale=qcif
  18809. </pre></div>
  18810. <p>which can also be written as:
  18811. </p><div class="example">
  18812. <pre class="example">scale=size=qcif
  18813. </pre></div>
  18814. </li><li>
  18815. Scale the input to 2x:
  18816. <div class="example">
  18817. <pre class="example">scale=w=2*iw:h=2*ih
  18818. </pre></div>
  18819. </li><li>
  18820. The above is the same as:
  18821. <div class="example">
  18822. <pre class="example">scale=2*in_w:2*in_h
  18823. </pre></div>
  18824. </li><li>
  18825. Scale the input to 2x with forced interlaced scaling:
  18826. <div class="example">
  18827. <pre class="example">scale=2*iw:2*ih:interl=1
  18828. </pre></div>
  18829. </li><li>
  18830. Scale the input to half size:
  18831. <div class="example">
  18832. <pre class="example">scale=w=iw/2:h=ih/2
  18833. </pre></div>
  18834. </li><li>
  18835. Increase the width, and set the height to the same size:
  18836. <div class="example">
  18837. <pre class="example">scale=3/2*iw:ow
  18838. </pre></div>
  18839. </li><li>
  18840. Seek Greek harmony:
  18841. <div class="example">
  18842. <pre class="example">scale=iw:1/PHI*iw
  18843. scale=ih*PHI:ih
  18844. </pre></div>
  18845. </li><li>
  18846. Increase the height, and set the width to 3/2 of the height:
  18847. <div class="example">
  18848. <pre class="example">scale=w=3/2*oh:h=3/5*ih
  18849. </pre></div>
  18850. </li><li>
  18851. Increase the size, making the size a multiple of the chroma
  18852. subsample values:
  18853. <div class="example">
  18854. <pre class="example">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
  18855. </pre></div>
  18856. </li><li>
  18857. Increase the width to a maximum of 500 pixels,
  18858. keeping the same aspect ratio as the input:
  18859. <div class="example">
  18860. <pre class="example">scale=w='min(500\, iw*3/2):h=-1'
  18861. </pre></div>
  18862. </li><li>
  18863. Make pixels square by combining scale and setsar:
  18864. <div class="example">
  18865. <pre class="example">scale='trunc(ih*dar):ih',setsar=1/1
  18866. </pre></div>
  18867. </li><li>
  18868. Make pixels square by combining scale and setsar,
  18869. making sure the resulting resolution is even (required by some codecs):
  18870. <div class="example">
  18871. <pre class="example">scale='trunc(ih*dar/2)*2:trunc(ih/2)*2',setsar=1/1
  18872. </pre></div>
  18873. </li></ul>
  18874. <a name="Commands-51"></a>
  18875. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-51">11.177.3 Commands</a></h3>
  18876. <p>This filter supports the following commands:
  18877. </p><dl compact="compact">
  18878. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  18879. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  18880. <dd><p>Set the output video dimension expression.
  18881. The command accepts the same syntax of the corresponding option.
  18882. </p>
  18883. <p>If the specified expression is not valid, it is kept at its current
  18884. value.
  18885. </p></dd>
  18886. </dl>
  18887. <a name="scale_005fnpp"></a>
  18888. <h2 class="section"><a href="ffmpeg-filters.html#toc-scale_005fnpp">11.178 scale_npp</a></h2>
  18889. <p>Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel
  18890. format conversion on CUDA video frames. Setting the output width and height
  18891. works in the same way as for the <var>scale</var> filter.
  18892. </p>
  18893. <p>The following additional options are accepted:
  18894. </p><dl compact="compact">
  18895. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  18896. <dd><p>The pixel format of the output CUDA frames. If set to the string &quot;same&quot; (the
  18897. default), the input format will be kept. Note that automatic format negotiation
  18898. and conversion is not yet supported for hardware frames
  18899. </p>
  18900. </dd>
  18901. <dt>&lsquo;<samp>interp_algo</samp>&rsquo;</dt>
  18902. <dd><p>The interpolation algorithm used for resizing. One of the following:
  18903. </p><dl compact="compact">
  18904. <dt>&lsquo;<samp>nn</samp>&rsquo;</dt>
  18905. <dd><p>Nearest neighbour.
  18906. </p>
  18907. </dd>
  18908. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  18909. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  18910. <dt>&lsquo;<samp>cubic2p_bspline</samp>&rsquo;</dt>
  18911. <dd><p>2-parameter cubic (B=1, C=0)
  18912. </p>
  18913. </dd>
  18914. <dt>&lsquo;<samp>cubic2p_catmullrom</samp>&rsquo;</dt>
  18915. <dd><p>2-parameter cubic (B=0, C=1/2)
  18916. </p>
  18917. </dd>
  18918. <dt>&lsquo;<samp>cubic2p_b05c03</samp>&rsquo;</dt>
  18919. <dd><p>2-parameter cubic (B=1/2, C=3/10)
  18920. </p>
  18921. </dd>
  18922. <dt>&lsquo;<samp>super</samp>&rsquo;</dt>
  18923. <dd><p>Supersampling
  18924. </p>
  18925. </dd>
  18926. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  18927. </dl>
  18928. </dd>
  18929. <dt>&lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;</dt>
  18930. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  18931. keep the original aspect ratio. Possible values:
  18932. </p>
  18933. <dl compact="compact">
  18934. <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
  18935. <dd><p>Scale the video as specified and disable this feature.
  18936. </p>
  18937. </dd>
  18938. <dt>&lsquo;<samp>decrease</samp>&rsquo;</dt>
  18939. <dd><p>The output video dimensions will automatically be decreased if needed.
  18940. </p>
  18941. </dd>
  18942. <dt>&lsquo;<samp>increase</samp>&rsquo;</dt>
  18943. <dd><p>The output video dimensions will automatically be increased if needed.
  18944. </p>
  18945. </dd>
  18946. </dl>
  18947. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  18948. maximum allowed resolution, you can use this to limit the output video to
  18949. that, while retaining the aspect ratio. For example, device A allows
  18950. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  18951. decrease) and specifying 1280x720 to the command line makes the output
  18952. 1280x533.
  18953. </p>
  18954. <p>Please note that this is a different thing than specifying -1 for &lsquo;<samp>w</samp>&rsquo;
  18955. or &lsquo;<samp>h</samp>&rsquo;, you still need to specify the output resolution for this option
  18956. to work.
  18957. </p>
  18958. </dd>
  18959. <dt>&lsquo;<samp>force_divisible_by</samp>&rsquo;</dt>
  18960. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  18961. given integer when used together with &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;. This
  18962. works similar to using <code>-n</code> in the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options.
  18963. </p>
  18964. <p>This option respects the value set for &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;,
  18965. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  18966. may be slightly modified.
  18967. </p>
  18968. <p>This option can be handy if you need to have a video fit within or exceed
  18969. a defined resolution using &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo; but also have
  18970. encoder restrictions on width or height divisibility.
  18971. </p>
  18972. </dd>
  18973. </dl>
  18974. <a name="scale2ref"></a>
  18975. <h2 class="section"><a href="ffmpeg-filters.html#toc-scale2ref">11.179 scale2ref</a></h2>
  18976. <p>Scale (resize) the input video, based on a reference video.
  18977. </p>
  18978. <p>See the scale filter for available options, scale2ref supports the same but
  18979. uses the reference video instead of the main input as basis. scale2ref also
  18980. supports the following additional constants for the &lsquo;<samp>w</samp>&rsquo; and
  18981. &lsquo;<samp>h</samp>&rsquo; options:
  18982. </p>
  18983. <dl compact="compact">
  18984. <dt><var>main_w</var></dt>
  18985. <dt><var>main_h</var></dt>
  18986. <dd><p>The main input video&rsquo;s width and height
  18987. </p>
  18988. </dd>
  18989. <dt><var>main_a</var></dt>
  18990. <dd><p>The same as <var>main_w</var> / <var>main_h</var>
  18991. </p>
  18992. </dd>
  18993. <dt><var>main_sar</var></dt>
  18994. <dd><p>The main input video&rsquo;s sample aspect ratio
  18995. </p>
  18996. </dd>
  18997. <dt><var>main_dar, mdar</var></dt>
  18998. <dd><p>The main input video&rsquo;s display aspect ratio. Calculated from
  18999. <code>(main_w / main_h) * main_sar</code>.
  19000. </p>
  19001. </dd>
  19002. <dt><var>main_hsub</var></dt>
  19003. <dt><var>main_vsub</var></dt>
  19004. <dd><p>The main input video&rsquo;s horizontal and vertical chroma subsample values.
  19005. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var>
  19006. is 1.
  19007. </p>
  19008. </dd>
  19009. <dt><var>main_n</var></dt>
  19010. <dd><p>The (sequential) number of the main input frame, starting from 0.
  19011. Only available with <code>eval=frame</code>.
  19012. </p>
  19013. </dd>
  19014. <dt><var>main_t</var></dt>
  19015. <dd><p>The presentation timestamp of the main input frame, expressed as a number of
  19016. seconds. Only available with <code>eval=frame</code>.
  19017. </p>
  19018. </dd>
  19019. <dt><var>main_pos</var></dt>
  19020. <dd><p>The position (byte offset) of the frame in the main input stream, or NaN if
  19021. this information is unavailable and/or meaningless (for example in case of synthetic video).
  19022. Only available with <code>eval=frame</code>.
  19023. </p></dd>
  19024. </dl>
  19025. <a name="Examples-63"></a>
  19026. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-63">11.179.1 Examples</a></h3>
  19027. <ul>
  19028. <li>
  19029. Scale a subtitle stream (b) to match the main video (a) in size before overlaying
  19030. <div class="example">
  19031. <pre class="example">'scale2ref[b][a];[a][b]overlay'
  19032. </pre></div>
  19033. </li><li>
  19034. Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
  19035. <div class="example">
  19036. <pre class="example">[logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
  19037. </pre></div>
  19038. </li></ul>
  19039. <a name="Commands-68"></a>
  19040. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-68">11.179.2 Commands</a></h3>
  19041. <p>This filter supports the following commands:
  19042. </p><dl compact="compact">
  19043. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  19044. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  19045. <dd><p>Set the output video dimension expression.
  19046. The command accepts the same syntax of the corresponding option.
  19047. </p>
  19048. <p>If the specified expression is not valid, it is kept at its current
  19049. value.
  19050. </p></dd>
  19051. </dl>
  19052. <a name="scroll"></a>
  19053. <h2 class="section"><a href="ffmpeg-filters.html#toc-scroll">11.180 scroll</a></h2>
  19054. <p>Scroll input video horizontally and/or vertically by constant speed.
  19055. </p>
  19056. <p>The filter accepts the following options:
  19057. </p><dl compact="compact">
  19058. <dt>&lsquo;<samp>horizontal, h</samp>&rsquo;</dt>
  19059. <dd><p>Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1.
  19060. Negative values changes scrolling direction.
  19061. </p>
  19062. </dd>
  19063. <dt>&lsquo;<samp>vertical, v</samp>&rsquo;</dt>
  19064. <dd><p>Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1.
  19065. Negative values changes scrolling direction.
  19066. </p>
  19067. </dd>
  19068. <dt>&lsquo;<samp>hpos</samp>&rsquo;</dt>
  19069. <dd><p>Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1.
  19070. </p>
  19071. </dd>
  19072. <dt>&lsquo;<samp>vpos</samp>&rsquo;</dt>
  19073. <dd><p>Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1.
  19074. </p></dd>
  19075. </dl>
  19076. <a name="Commands-55"></a>
  19077. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-55">11.180.1 Commands</a></h3>
  19078. <p>This filter supports the following <a href="#commands">commands</a>:
  19079. </p><dl compact="compact">
  19080. <dt>&lsquo;<samp>horizontal, h</samp>&rsquo;</dt>
  19081. <dd><p>Set the horizontal scrolling speed.
  19082. </p></dd>
  19083. <dt>&lsquo;<samp>vertical, v</samp>&rsquo;</dt>
  19084. <dd><p>Set the vertical scrolling speed.
  19085. </p></dd>
  19086. </dl>
  19087. <p><a name="scdet"></a>
  19088. </p><a name="scdet-1"></a>
  19089. <h2 class="section"><a href="ffmpeg-filters.html#toc-scdet-1">11.181 scdet</a></h2>
  19090. <p>Detect video scene change.
  19091. </p>
  19092. <p>This filter sets frame metadata with mafd between frame, the scene score, and
  19093. forward the frame to the next filter, so they can use these metadata to detect
  19094. scene change or others.
  19095. </p>
  19096. <p>In addition, this filter logs a message and sets frame metadata when it detects
  19097. a scene change by &lsquo;<samp>threshold</samp>&rsquo;.
  19098. </p>
  19099. <p><code>lavfi.scd.mafd</code> metadata keys are set with mafd for every frame.
  19100. </p>
  19101. <p><code>lavfi.scd.score</code> metadata keys are set with scene change score for every frame
  19102. to detect scene change.
  19103. </p>
  19104. <p><code>lavfi.scd.time</code> metadata keys are set with current filtered frame time which
  19105. detect scene change with &lsquo;<samp>threshold</samp>&rsquo;.
  19106. </p>
  19107. <p>The filter accepts the following options:
  19108. </p>
  19109. <dl compact="compact">
  19110. <dt>&lsquo;<samp>threshold, t</samp>&rsquo;</dt>
  19111. <dd><p>Set the scene change detection threshold as a percentage of maximum change. Good
  19112. values are in the <code>[8.0, 14.0]</code> range. The range for &lsquo;<samp>threshold</samp>&rsquo; is
  19113. <code>[0., 100.]</code>.
  19114. </p>
  19115. <p>Default value is <code>10.</code>.
  19116. </p>
  19117. </dd>
  19118. <dt>&lsquo;<samp>sc_pass, s</samp>&rsquo;</dt>
  19119. <dd><p>Set the flag to pass scene change frames to the next filter. Default value is <code>0</code>
  19120. You can enable it if you want to get snapshot of scene change frames only.
  19121. </p></dd>
  19122. </dl>
  19123. <p><a name="selectivecolor"></a>
  19124. </p><a name="selectivecolor-1"></a>
  19125. <h2 class="section"><a href="ffmpeg-filters.html#toc-selectivecolor-1">11.182 selectivecolor</a></h2>
  19126. <p>Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such
  19127. as &quot;reds&quot;, &quot;yellows&quot;, &quot;greens&quot;, &quot;cyans&quot;, ...). The adjustment range is defined
  19128. by the &quot;purity&quot; of the color (that is, how saturated it already is).
  19129. </p>
  19130. <p>This filter is similar to the Adobe Photoshop Selective Color tool.
  19131. </p>
  19132. <p>The filter accepts the following options:
  19133. </p>
  19134. <dl compact="compact">
  19135. <dt>&lsquo;<samp>correction_method</samp>&rsquo;</dt>
  19136. <dd><p>Select color correction method.
  19137. </p>
  19138. <p>Available values are:
  19139. </p><dl compact="compact">
  19140. <dt>&lsquo;<samp>absolute</samp>&rsquo;</dt>
  19141. <dd><p>Specified adjustments are applied &quot;as-is&quot; (added/subtracted to original pixel
  19142. component value).
  19143. </p></dd>
  19144. <dt>&lsquo;<samp>relative</samp>&rsquo;</dt>
  19145. <dd><p>Specified adjustments are relative to the original component value.
  19146. </p></dd>
  19147. </dl>
  19148. <p>Default is <code>absolute</code>.
  19149. </p></dd>
  19150. <dt>&lsquo;<samp>reds</samp>&rsquo;</dt>
  19151. <dd><p>Adjustments for red pixels (pixels where the red component is the maximum)
  19152. </p></dd>
  19153. <dt>&lsquo;<samp>yellows</samp>&rsquo;</dt>
  19154. <dd><p>Adjustments for yellow pixels (pixels where the blue component is the minimum)
  19155. </p></dd>
  19156. <dt>&lsquo;<samp>greens</samp>&rsquo;</dt>
  19157. <dd><p>Adjustments for green pixels (pixels where the green component is the maximum)
  19158. </p></dd>
  19159. <dt>&lsquo;<samp>cyans</samp>&rsquo;</dt>
  19160. <dd><p>Adjustments for cyan pixels (pixels where the red component is the minimum)
  19161. </p></dd>
  19162. <dt>&lsquo;<samp>blues</samp>&rsquo;</dt>
  19163. <dd><p>Adjustments for blue pixels (pixels where the blue component is the maximum)
  19164. </p></dd>
  19165. <dt>&lsquo;<samp>magentas</samp>&rsquo;</dt>
  19166. <dd><p>Adjustments for magenta pixels (pixels where the green component is the minimum)
  19167. </p></dd>
  19168. <dt>&lsquo;<samp>whites</samp>&rsquo;</dt>
  19169. <dd><p>Adjustments for white pixels (pixels where all components are greater than 128)
  19170. </p></dd>
  19171. <dt>&lsquo;<samp>neutrals</samp>&rsquo;</dt>
  19172. <dd><p>Adjustments for all pixels except pure black and pure white
  19173. </p></dd>
  19174. <dt>&lsquo;<samp>blacks</samp>&rsquo;</dt>
  19175. <dd><p>Adjustments for black pixels (pixels where all components are lesser than 128)
  19176. </p></dd>
  19177. <dt>&lsquo;<samp>psfile</samp>&rsquo;</dt>
  19178. <dd><p>Specify a Photoshop selective color file (<code>.asv</code>) to import the settings from.
  19179. </p></dd>
  19180. </dl>
  19181. <p>All the adjustment settings (&lsquo;<samp>reds</samp>&rsquo;, &lsquo;<samp>yellows</samp>&rsquo;, ...) accept up to
  19182. 4 space separated floating point adjustment values in the [-1,1] range,
  19183. respectively to adjust the amount of cyan, magenta, yellow and black for the
  19184. pixels of its range.
  19185. </p>
  19186. <a name="Examples-76"></a>
  19187. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-76">11.182.1 Examples</a></h3>
  19188. <ul>
  19189. <li>
  19190. Increase cyan by 50% and reduce yellow by 33% in every green areas, and
  19191. increase magenta by 27% in blue areas:
  19192. <div class="example">
  19193. <pre class="example">selectivecolor=greens=.5 0 -.33 0:blues=0 .27
  19194. </pre></div>
  19195. </li><li>
  19196. Use a Photoshop selective color preset:
  19197. <div class="example">
  19198. <pre class="example">selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
  19199. </pre></div>
  19200. </li></ul>
  19201. <p><a name="separatefields"></a>
  19202. </p><a name="separatefields-1"></a>
  19203. <h2 class="section"><a href="ffmpeg-filters.html#toc-separatefields-1">11.183 separatefields</a></h2>
  19204. <p>The <code>separatefields</code> takes a frame-based video input and splits
  19205. each frame into its components fields, producing a new half height clip
  19206. with twice the frame rate and twice the frame count.
  19207. </p>
  19208. <p>This filter use field-dominance information in frame to decide which
  19209. of each pair of fields to place first in the output.
  19210. If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>separatefields</code> filter.
  19211. </p>
  19212. <a name="setdar_002c-setsar"></a>
  19213. <h2 class="section"><a href="ffmpeg-filters.html#toc-setdar_002c-setsar">11.184 setdar, setsar</a></h2>
  19214. <p>The <code>setdar</code> filter sets the Display Aspect Ratio for the filter
  19215. output video.
  19216. </p>
  19217. <p>This is done by changing the specified Sample (aka Pixel) Aspect
  19218. Ratio, according to the following equation:
  19219. </p><div class="example">
  19220. <pre class="example"><var>DAR</var> = <var>HORIZONTAL_RESOLUTION</var> / <var>VERTICAL_RESOLUTION</var> * <var>SAR</var>
  19221. </pre></div>
  19222. <p>Keep in mind that the <code>setdar</code> filter does not modify the pixel
  19223. dimensions of the video frame. Also, the display aspect ratio set by
  19224. this filter may be changed by later filters in the filterchain,
  19225. e.g. in case of scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is
  19226. applied.
  19227. </p>
  19228. <p>The <code>setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
  19229. the filter output video.
  19230. </p>
  19231. <p>Note that as a consequence of the application of this filter, the
  19232. output display aspect ratio will change according to the equation
  19233. above.
  19234. </p>
  19235. <p>Keep in mind that the sample aspect ratio set by the <code>setsar</code>
  19236. filter may be changed by later filters in the filterchain, e.g. if
  19237. another &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
  19238. </p>
  19239. <p>It accepts the following parameters:
  19240. </p>
  19241. <dl compact="compact">
  19242. <dt>&lsquo;<samp>r, ratio, dar (<code>setdar</code> only), sar (<code>setsar</code> only)</samp>&rsquo;</dt>
  19243. <dd><p>Set the aspect ratio used by the filter.
  19244. </p>
  19245. <p>The parameter can be a floating point number string, an expression, or
  19246. a string of the form <var>num</var>:<var>den</var>, where <var>num</var> and
  19247. <var>den</var> are the numerator and denominator of the aspect ratio. If
  19248. the parameter is not specified, it is assumed the value &quot;0&quot;.
  19249. In case the form &quot;<var>num</var>:<var>den</var>&quot; is used, the <code>:</code> character
  19250. should be escaped.
  19251. </p>
  19252. </dd>
  19253. <dt>&lsquo;<samp>max</samp>&rsquo;</dt>
  19254. <dd><p>Set the maximum integer value to use for expressing numerator and
  19255. denominator when reducing the expressed aspect ratio to a rational.
  19256. Default value is <code>100</code>.
  19257. </p>
  19258. </dd>
  19259. </dl>
  19260. <p>The parameter <var>sar</var> is an expression containing
  19261. the following constants:
  19262. </p>
  19263. <dl compact="compact">
  19264. <dt>&lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
  19265. <dd><p>These are approximated values for the mathematical constants e
  19266. (Euler&rsquo;s number), pi (Greek pi), and phi (the golden ratio).
  19267. </p>
  19268. </dd>
  19269. <dt>&lsquo;<samp>w, h</samp>&rsquo;</dt>
  19270. <dd><p>The input width and height.
  19271. </p>
  19272. </dd>
  19273. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  19274. <dd><p>These are the same as <var>w</var> / <var>h</var>.
  19275. </p>
  19276. </dd>
  19277. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  19278. <dd><p>The input sample aspect ratio.
  19279. </p>
  19280. </dd>
  19281. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  19282. <dd><p>The input display aspect ratio. It is the same as
  19283. (<var>w</var> / <var>h</var>) * <var>sar</var>.
  19284. </p>
  19285. </dd>
  19286. <dt>&lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
  19287. <dd><p>Horizontal and vertical chroma subsample values. For example, for the
  19288. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  19289. </p></dd>
  19290. </dl>
  19291. <a name="Examples-74"></a>
  19292. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-74">11.184.1 Examples</a></h3>
  19293. <ul>
  19294. <li>
  19295. To change the display aspect ratio to 16:9, specify one of the following:
  19296. <div class="example">
  19297. <pre class="example">setdar=dar=1.77777
  19298. setdar=dar=16/9
  19299. </pre></div>
  19300. </li><li>
  19301. To change the sample aspect ratio to 10:11, specify:
  19302. <div class="example">
  19303. <pre class="example">setsar=sar=10/11
  19304. </pre></div>
  19305. </li><li>
  19306. To set a display aspect ratio of 16:9, and specify a maximum integer value of
  19307. 1000 in the aspect ratio reduction, use the command:
  19308. <div class="example">
  19309. <pre class="example">setdar=ratio=16/9:max=1000
  19310. </pre></div>
  19311. </li></ul>
  19312. <p><a name="setfield"></a>
  19313. </p><a name="setfield-1"></a>
  19314. <h2 class="section"><a href="ffmpeg-filters.html#toc-setfield-1">11.185 setfield</a></h2>
  19315. <p>Force field for the output video frame.
  19316. </p>
  19317. <p>The <code>setfield</code> filter marks the interlace type field for the
  19318. output frames. It does not change the input frame, but only sets the
  19319. corresponding property, which affects how the frame is treated by
  19320. following filters (e.g. <code>fieldorder</code> or <code>yadif</code>).
  19321. </p>
  19322. <p>The filter accepts the following options:
  19323. </p>
  19324. <dl compact="compact">
  19325. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  19326. <dd><p>Available values are:
  19327. </p>
  19328. <dl compact="compact">
  19329. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  19330. <dd><p>Keep the same field property.
  19331. </p>
  19332. </dd>
  19333. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  19334. <dd><p>Mark the frame as bottom-field-first.
  19335. </p>
  19336. </dd>
  19337. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  19338. <dd><p>Mark the frame as top-field-first.
  19339. </p>
  19340. </dd>
  19341. <dt>&lsquo;<samp>prog</samp>&rsquo;</dt>
  19342. <dd><p>Mark the frame as progressive.
  19343. </p></dd>
  19344. </dl>
  19345. </dd>
  19346. </dl>
  19347. <p><a name="setparams"></a>
  19348. </p><a name="setparams-1"></a>
  19349. <h2 class="section"><a href="ffmpeg-filters.html#toc-setparams-1">11.186 setparams</a></h2>
  19350. <p>Force frame parameter for the output video frame.
  19351. </p>
  19352. <p>The <code>setparams</code> filter marks interlace and color range for the
  19353. output frames. It does not change the input frame, but only sets the
  19354. corresponding property, which affects how the frame is treated by
  19355. filters/encoders.
  19356. </p>
  19357. <dl compact="compact">
  19358. <dt>&lsquo;<samp>field_mode</samp>&rsquo;</dt>
  19359. <dd><p>Available values are:
  19360. </p>
  19361. <dl compact="compact">
  19362. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  19363. <dd><p>Keep the same field property (default).
  19364. </p>
  19365. </dd>
  19366. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  19367. <dd><p>Mark the frame as bottom-field-first.
  19368. </p>
  19369. </dd>
  19370. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  19371. <dd><p>Mark the frame as top-field-first.
  19372. </p>
  19373. </dd>
  19374. <dt>&lsquo;<samp>prog</samp>&rsquo;</dt>
  19375. <dd><p>Mark the frame as progressive.
  19376. </p></dd>
  19377. </dl>
  19378. </dd>
  19379. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  19380. <dd><p>Available values are:
  19381. </p>
  19382. <dl compact="compact">
  19383. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  19384. <dd><p>Keep the same color range property (default).
  19385. </p>
  19386. </dd>
  19387. <dt>&lsquo;<samp>unspecified, unknown</samp>&rsquo;</dt>
  19388. <dd><p>Mark the frame as unspecified color range.
  19389. </p>
  19390. </dd>
  19391. <dt>&lsquo;<samp>limited, tv, mpeg</samp>&rsquo;</dt>
  19392. <dd><p>Mark the frame as limited range.
  19393. </p>
  19394. </dd>
  19395. <dt>&lsquo;<samp>full, pc, jpeg</samp>&rsquo;</dt>
  19396. <dd><p>Mark the frame as full range.
  19397. </p></dd>
  19398. </dl>
  19399. </dd>
  19400. <dt>&lsquo;<samp>color_primaries</samp>&rsquo;</dt>
  19401. <dd><p>Set the color primaries.
  19402. Available values are:
  19403. </p>
  19404. <dl compact="compact">
  19405. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  19406. <dd><p>Keep the same color primaries property (default).
  19407. </p>
  19408. </dd>
  19409. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  19410. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  19411. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  19412. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  19413. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  19414. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  19415. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  19416. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  19417. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  19418. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  19419. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  19420. <dt>&lsquo;<samp>jedec-p22</samp>&rsquo;</dt>
  19421. </dl>
  19422. </dd>
  19423. <dt>&lsquo;<samp>color_trc</samp>&rsquo;</dt>
  19424. <dd><p>Set the color transfer.
  19425. Available values are:
  19426. </p>
  19427. <dl compact="compact">
  19428. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  19429. <dd><p>Keep the same color trc property (default).
  19430. </p>
  19431. </dd>
  19432. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  19433. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  19434. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  19435. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  19436. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  19437. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  19438. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  19439. <dt>&lsquo;<samp>log100</samp>&rsquo;</dt>
  19440. <dt>&lsquo;<samp>log316</samp>&rsquo;</dt>
  19441. <dt>&lsquo;<samp>iec61966-2-4</samp>&rsquo;</dt>
  19442. <dt>&lsquo;<samp>bt1361e</samp>&rsquo;</dt>
  19443. <dt>&lsquo;<samp>iec61966-2-1</samp>&rsquo;</dt>
  19444. <dt>&lsquo;<samp>bt2020-10</samp>&rsquo;</dt>
  19445. <dt>&lsquo;<samp>bt2020-12</samp>&rsquo;</dt>
  19446. <dt>&lsquo;<samp>smpte2084</samp>&rsquo;</dt>
  19447. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  19448. <dt>&lsquo;<samp>arib-std-b67</samp>&rsquo;</dt>
  19449. </dl>
  19450. </dd>
  19451. <dt>&lsquo;<samp>colorspace</samp>&rsquo;</dt>
  19452. <dd><p>Set the colorspace.
  19453. Available values are:
  19454. </p>
  19455. <dl compact="compact">
  19456. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  19457. <dd><p>Keep the same colorspace property (default).
  19458. </p>
  19459. </dd>
  19460. <dt>&lsquo;<samp>gbr</samp>&rsquo;</dt>
  19461. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  19462. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  19463. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  19464. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  19465. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  19466. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  19467. <dt>&lsquo;<samp>ycgco</samp>&rsquo;</dt>
  19468. <dt>&lsquo;<samp>bt2020nc</samp>&rsquo;</dt>
  19469. <dt>&lsquo;<samp>bt2020c</samp>&rsquo;</dt>
  19470. <dt>&lsquo;<samp>smpte2085</samp>&rsquo;</dt>
  19471. <dt>&lsquo;<samp>chroma-derived-nc</samp>&rsquo;</dt>
  19472. <dt>&lsquo;<samp>chroma-derived-c</samp>&rsquo;</dt>
  19473. <dt>&lsquo;<samp>ictcp</samp>&rsquo;</dt>
  19474. </dl>
  19475. </dd>
  19476. </dl>
  19477. <a name="showinfo"></a>
  19478. <h2 class="section"><a href="ffmpeg-filters.html#toc-showinfo">11.187 showinfo</a></h2>
  19479. <p>Show a line containing various information for each input video frame.
  19480. The input video is not modified.
  19481. </p>
  19482. <p>This filter supports the following options:
  19483. </p>
  19484. <dl compact="compact">
  19485. <dt>&lsquo;<samp>checksum</samp>&rsquo;</dt>
  19486. <dd><p>Calculate checksums of each plane. By default enabled.
  19487. </p></dd>
  19488. </dl>
  19489. <p>The shown line contains a sequence of key/value pairs of the form
  19490. <var>key</var>:<var>value</var>.
  19491. </p>
  19492. <p>The following values are shown in the output:
  19493. </p>
  19494. <dl compact="compact">
  19495. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  19496. <dd><p>The (sequential) number of the input frame, starting from 0.
  19497. </p>
  19498. </dd>
  19499. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  19500. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  19501. time base units. The time base unit depends on the filter input pad.
  19502. </p>
  19503. </dd>
  19504. <dt>&lsquo;<samp>pts_time</samp>&rsquo;</dt>
  19505. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  19506. seconds.
  19507. </p>
  19508. </dd>
  19509. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  19510. <dd><p>The position of the frame in the input stream, or -1 if this information is
  19511. unavailable and/or meaningless (for example in case of synthetic video).
  19512. </p>
  19513. </dd>
  19514. <dt>&lsquo;<samp>fmt</samp>&rsquo;</dt>
  19515. <dd><p>The pixel format name.
  19516. </p>
  19517. </dd>
  19518. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  19519. <dd><p>The sample aspect ratio of the input frame, expressed in the form
  19520. <var>num</var>/<var>den</var>.
  19521. </p>
  19522. </dd>
  19523. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  19524. <dd><p>The size of the input frame. For the syntax of this option, check the
  19525. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  19526. </p>
  19527. </dd>
  19528. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  19529. <dd><p>The type of interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
  19530. for bottom field first).
  19531. </p>
  19532. </dd>
  19533. <dt>&lsquo;<samp>iskey</samp>&rsquo;</dt>
  19534. <dd><p>This is 1 if the frame is a key frame, 0 otherwise.
  19535. </p>
  19536. </dd>
  19537. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  19538. <dd><p>The picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
  19539. P-frame, &quot;B&quot; for a B-frame, or &quot;?&quot; for an unknown type).
  19540. Also refer to the documentation of the <code>AVPictureType</code> enum and of
  19541. the <code>av_get_picture_type_char</code> function defined in
  19542. &lsquo;<tt>libavutil/avutil.h</tt>&rsquo;.
  19543. </p>
  19544. </dd>
  19545. <dt>&lsquo;<samp>checksum</samp>&rsquo;</dt>
  19546. <dd><p>The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame.
  19547. </p>
  19548. </dd>
  19549. <dt>&lsquo;<samp>plane_checksum</samp>&rsquo;</dt>
  19550. <dd><p>The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
  19551. expressed in the form &quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;.
  19552. </p>
  19553. </dd>
  19554. <dt>&lsquo;<samp>mean</samp>&rsquo;</dt>
  19555. <dd><p>The mean value of pixels in each plane of the input frame, expressed in the form
  19556. &quot;[<var>mean0</var> <var>mean1</var> <var>mean2</var> <var>mean3</var>]&quot;.
  19557. </p>
  19558. </dd>
  19559. <dt>&lsquo;<samp>stdev</samp>&rsquo;</dt>
  19560. <dd><p>The standard deviation of pixel values in each plane of the input frame, expressed
  19561. in the form &quot;[<var>stdev0</var> <var>stdev1</var> <var>stdev2</var> <var>stdev3</var>]&quot;.
  19562. </p>
  19563. </dd>
  19564. </dl>
  19565. <a name="showpalette"></a>
  19566. <h2 class="section"><a href="ffmpeg-filters.html#toc-showpalette">11.188 showpalette</a></h2>
  19567. <p>Displays the 256 colors palette of each frame. This filter is only relevant for
  19568. <var>pal8</var> pixel format frames.
  19569. </p>
  19570. <p>It accepts the following option:
  19571. </p>
  19572. <dl compact="compact">
  19573. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  19574. <dd><p>Set the size of the box used to represent one palette color entry. Default is
  19575. <code>30</code> (for a <code>30x30</code> pixel box).
  19576. </p></dd>
  19577. </dl>
  19578. <a name="shuffleframes"></a>
  19579. <h2 class="section"><a href="ffmpeg-filters.html#toc-shuffleframes">11.189 shuffleframes</a></h2>
  19580. <p>Reorder and/or duplicate and/or drop video frames.
  19581. </p>
  19582. <p>It accepts the following parameters:
  19583. </p>
  19584. <dl compact="compact">
  19585. <dt>&lsquo;<samp>mapping</samp>&rsquo;</dt>
  19586. <dd><p>Set the destination indexes of input frames.
  19587. This is space or &rsquo;|&rsquo; separated list of indexes that maps input frames to output
  19588. frames. Number of indexes also sets maximal value that each index may have.
  19589. &rsquo;-1&rsquo; index have special meaning and that is to drop frame.
  19590. </p></dd>
  19591. </dl>
  19592. <p>The first frame has the index 0. The default is to keep the input unchanged.
  19593. </p>
  19594. <a name="Examples-122"></a>
  19595. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-122">11.189.1 Examples</a></h3>
  19596. <ul>
  19597. <li>
  19598. Swap second and third frame of every three frames of the input:
  19599. <div class="example">
  19600. <pre class="example">ffmpeg -i INPUT -vf &quot;shuffleframes=0 2 1&quot; OUTPUT
  19601. </pre></div>
  19602. </li><li>
  19603. Swap 10th and 1st frame of every ten frames of the input:
  19604. <div class="example">
  19605. <pre class="example">ffmpeg -i INPUT -vf &quot;shuffleframes=9 1 2 3 4 5 6 7 8 0&quot; OUTPUT
  19606. </pre></div>
  19607. </li></ul>
  19608. <a name="shuffleplanes"></a>
  19609. <h2 class="section"><a href="ffmpeg-filters.html#toc-shuffleplanes">11.190 shuffleplanes</a></h2>
  19610. <p>Reorder and/or duplicate video planes.
  19611. </p>
  19612. <p>It accepts the following parameters:
  19613. </p>
  19614. <dl compact="compact">
  19615. <dt>&lsquo;<samp>map0</samp>&rsquo;</dt>
  19616. <dd><p>The index of the input plane to be used as the first output plane.
  19617. </p>
  19618. </dd>
  19619. <dt>&lsquo;<samp>map1</samp>&rsquo;</dt>
  19620. <dd><p>The index of the input plane to be used as the second output plane.
  19621. </p>
  19622. </dd>
  19623. <dt>&lsquo;<samp>map2</samp>&rsquo;</dt>
  19624. <dd><p>The index of the input plane to be used as the third output plane.
  19625. </p>
  19626. </dd>
  19627. <dt>&lsquo;<samp>map3</samp>&rsquo;</dt>
  19628. <dd><p>The index of the input plane to be used as the fourth output plane.
  19629. </p>
  19630. </dd>
  19631. </dl>
  19632. <p>The first plane has the index 0. The default is to keep the input unchanged.
  19633. </p>
  19634. <a name="Examples-71"></a>
  19635. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-71">11.190.1 Examples</a></h3>
  19636. <ul>
  19637. <li>
  19638. Swap the second and third planes of the input:
  19639. <div class="example">
  19640. <pre class="example">ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
  19641. </pre></div>
  19642. </li></ul>
  19643. <p><a name="signalstats"></a>
  19644. </p><a name="signalstats-1"></a>
  19645. <h2 class="section"><a href="ffmpeg-filters.html#toc-signalstats-1">11.191 signalstats</a></h2>
  19646. <p>Evaluate various visual metrics that assist in determining issues associated
  19647. with the digitization of analog video media.
  19648. </p>
  19649. <p>By default the filter will log these metadata values:
  19650. </p>
  19651. <dl compact="compact">
  19652. <dt>&lsquo;<samp>YMIN</samp>&rsquo;</dt>
  19653. <dd><p>Display the minimal Y value contained within the input frame. Expressed in
  19654. range of [0-255].
  19655. </p>
  19656. </dd>
  19657. <dt>&lsquo;<samp>YLOW</samp>&rsquo;</dt>
  19658. <dd><p>Display the Y value at the 10% percentile within the input frame. Expressed in
  19659. range of [0-255].
  19660. </p>
  19661. </dd>
  19662. <dt>&lsquo;<samp>YAVG</samp>&rsquo;</dt>
  19663. <dd><p>Display the average Y value within the input frame. Expressed in range of
  19664. [0-255].
  19665. </p>
  19666. </dd>
  19667. <dt>&lsquo;<samp>YHIGH</samp>&rsquo;</dt>
  19668. <dd><p>Display the Y value at the 90% percentile within the input frame. Expressed in
  19669. range of [0-255].
  19670. </p>
  19671. </dd>
  19672. <dt>&lsquo;<samp>YMAX</samp>&rsquo;</dt>
  19673. <dd><p>Display the maximum Y value contained within the input frame. Expressed in
  19674. range of [0-255].
  19675. </p>
  19676. </dd>
  19677. <dt>&lsquo;<samp>UMIN</samp>&rsquo;</dt>
  19678. <dd><p>Display the minimal U value contained within the input frame. Expressed in
  19679. range of [0-255].
  19680. </p>
  19681. </dd>
  19682. <dt>&lsquo;<samp>ULOW</samp>&rsquo;</dt>
  19683. <dd><p>Display the U value at the 10% percentile within the input frame. Expressed in
  19684. range of [0-255].
  19685. </p>
  19686. </dd>
  19687. <dt>&lsquo;<samp>UAVG</samp>&rsquo;</dt>
  19688. <dd><p>Display the average U value within the input frame. Expressed in range of
  19689. [0-255].
  19690. </p>
  19691. </dd>
  19692. <dt>&lsquo;<samp>UHIGH</samp>&rsquo;</dt>
  19693. <dd><p>Display the U value at the 90% percentile within the input frame. Expressed in
  19694. range of [0-255].
  19695. </p>
  19696. </dd>
  19697. <dt>&lsquo;<samp>UMAX</samp>&rsquo;</dt>
  19698. <dd><p>Display the maximum U value contained within the input frame. Expressed in
  19699. range of [0-255].
  19700. </p>
  19701. </dd>
  19702. <dt>&lsquo;<samp>VMIN</samp>&rsquo;</dt>
  19703. <dd><p>Display the minimal V value contained within the input frame. Expressed in
  19704. range of [0-255].
  19705. </p>
  19706. </dd>
  19707. <dt>&lsquo;<samp>VLOW</samp>&rsquo;</dt>
  19708. <dd><p>Display the V value at the 10% percentile within the input frame. Expressed in
  19709. range of [0-255].
  19710. </p>
  19711. </dd>
  19712. <dt>&lsquo;<samp>VAVG</samp>&rsquo;</dt>
  19713. <dd><p>Display the average V value within the input frame. Expressed in range of
  19714. [0-255].
  19715. </p>
  19716. </dd>
  19717. <dt>&lsquo;<samp>VHIGH</samp>&rsquo;</dt>
  19718. <dd><p>Display the V value at the 90% percentile within the input frame. Expressed in
  19719. range of [0-255].
  19720. </p>
  19721. </dd>
  19722. <dt>&lsquo;<samp>VMAX</samp>&rsquo;</dt>
  19723. <dd><p>Display the maximum V value contained within the input frame. Expressed in
  19724. range of [0-255].
  19725. </p>
  19726. </dd>
  19727. <dt>&lsquo;<samp>SATMIN</samp>&rsquo;</dt>
  19728. <dd><p>Display the minimal saturation value contained within the input frame.
  19729. Expressed in range of [0-~181.02].
  19730. </p>
  19731. </dd>
  19732. <dt>&lsquo;<samp>SATLOW</samp>&rsquo;</dt>
  19733. <dd><p>Display the saturation value at the 10% percentile within the input frame.
  19734. Expressed in range of [0-~181.02].
  19735. </p>
  19736. </dd>
  19737. <dt>&lsquo;<samp>SATAVG</samp>&rsquo;</dt>
  19738. <dd><p>Display the average saturation value within the input frame. Expressed in range
  19739. of [0-~181.02].
  19740. </p>
  19741. </dd>
  19742. <dt>&lsquo;<samp>SATHIGH</samp>&rsquo;</dt>
  19743. <dd><p>Display the saturation value at the 90% percentile within the input frame.
  19744. Expressed in range of [0-~181.02].
  19745. </p>
  19746. </dd>
  19747. <dt>&lsquo;<samp>SATMAX</samp>&rsquo;</dt>
  19748. <dd><p>Display the maximum saturation value contained within the input frame.
  19749. Expressed in range of [0-~181.02].
  19750. </p>
  19751. </dd>
  19752. <dt>&lsquo;<samp>HUEMED</samp>&rsquo;</dt>
  19753. <dd><p>Display the median value for hue within the input frame. Expressed in range of
  19754. [0-360].
  19755. </p>
  19756. </dd>
  19757. <dt>&lsquo;<samp>HUEAVG</samp>&rsquo;</dt>
  19758. <dd><p>Display the average value for hue within the input frame. Expressed in range of
  19759. [0-360].
  19760. </p>
  19761. </dd>
  19762. <dt>&lsquo;<samp>YDIF</samp>&rsquo;</dt>
  19763. <dd><p>Display the average of sample value difference between all values of the Y
  19764. plane in the current frame and corresponding values of the previous input frame.
  19765. Expressed in range of [0-255].
  19766. </p>
  19767. </dd>
  19768. <dt>&lsquo;<samp>UDIF</samp>&rsquo;</dt>
  19769. <dd><p>Display the average of sample value difference between all values of the U
  19770. plane in the current frame and corresponding values of the previous input frame.
  19771. Expressed in range of [0-255].
  19772. </p>
  19773. </dd>
  19774. <dt>&lsquo;<samp>VDIF</samp>&rsquo;</dt>
  19775. <dd><p>Display the average of sample value difference between all values of the V
  19776. plane in the current frame and corresponding values of the previous input frame.
  19777. Expressed in range of [0-255].
  19778. </p>
  19779. </dd>
  19780. <dt>&lsquo;<samp>YBITDEPTH</samp>&rsquo;</dt>
  19781. <dd><p>Display bit depth of Y plane in current frame.
  19782. Expressed in range of [0-16].
  19783. </p>
  19784. </dd>
  19785. <dt>&lsquo;<samp>UBITDEPTH</samp>&rsquo;</dt>
  19786. <dd><p>Display bit depth of U plane in current frame.
  19787. Expressed in range of [0-16].
  19788. </p>
  19789. </dd>
  19790. <dt>&lsquo;<samp>VBITDEPTH</samp>&rsquo;</dt>
  19791. <dd><p>Display bit depth of V plane in current frame.
  19792. Expressed in range of [0-16].
  19793. </p></dd>
  19794. </dl>
  19795. <p>The filter accepts the following options:
  19796. </p>
  19797. <dl compact="compact">
  19798. <dt>&lsquo;<samp>stat</samp>&rsquo;</dt>
  19799. <dt>&lsquo;<samp>out</samp>&rsquo;</dt>
  19800. <dd>
  19801. <p>&lsquo;<samp>stat</samp>&rsquo; specify an additional form of image analysis.
  19802. &lsquo;<samp>out</samp>&rsquo; output video with the specified type of pixel highlighted.
  19803. </p>
  19804. <p>Both options accept the following values:
  19805. </p>
  19806. <dl compact="compact">
  19807. <dt>&lsquo;<samp>tout</samp>&rsquo;</dt>
  19808. <dd><p>Identify <var>temporal outliers</var> pixels. A <var>temporal outlier</var> is a pixel
  19809. unlike the neighboring pixels of the same field. Examples of temporal outliers
  19810. include the results of video dropouts, head clogs, or tape tracking issues.
  19811. </p>
  19812. </dd>
  19813. <dt>&lsquo;<samp>vrep</samp>&rsquo;</dt>
  19814. <dd><p>Identify <var>vertical line repetition</var>. Vertical line repetition includes
  19815. similar rows of pixels within a frame. In born-digital video vertical line
  19816. repetition is common, but this pattern is uncommon in video digitized from an
  19817. analog source. When it occurs in video that results from the digitization of an
  19818. analog source it can indicate concealment from a dropout compensator.
  19819. </p>
  19820. </dd>
  19821. <dt>&lsquo;<samp>brng</samp>&rsquo;</dt>
  19822. <dd><p>Identify pixels that fall outside of legal broadcast range.
  19823. </p></dd>
  19824. </dl>
  19825. </dd>
  19826. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  19827. <dd><p>Set the highlight color for the &lsquo;<samp>out</samp>&rsquo; option. The default color is
  19828. yellow.
  19829. </p></dd>
  19830. </dl>
  19831. <a name="Examples-93"></a>
  19832. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-93">11.191.1 Examples</a></h3>
  19833. <ul>
  19834. <li>
  19835. Output data of various video metrics:
  19836. <div class="example">
  19837. <pre class="example">ffprobe -f lavfi movie=example.mov,signalstats=&quot;stat=tout+vrep+brng&quot; -show_frames
  19838. </pre></div>
  19839. </li><li>
  19840. Output specific data about the minimum and maximum values of the Y plane per frame:
  19841. <div class="example">
  19842. <pre class="example">ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
  19843. </pre></div>
  19844. </li><li>
  19845. Playback video while highlighting pixels that are outside of broadcast range in red.
  19846. <div class="example">
  19847. <pre class="example">ffplay example.mov -vf signalstats=&quot;out=brng:color=red&quot;
  19848. </pre></div>
  19849. </li><li>
  19850. Playback video with signalstats metadata drawn over the frame.
  19851. <div class="example">
  19852. <pre class="example">ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
  19853. </pre></div>
  19854. <p>The contents of signalstat_drawtext.txt used in the command are:
  19855. </p><div class="example">
  19856. <pre class="example">time %{pts:hms}
  19857. Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
  19858. U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
  19859. V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
  19860. saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
  19861. </pre></div>
  19862. </li></ul>
  19863. <p><a name="signature"></a>
  19864. </p><a name="signature-1"></a>
  19865. <h2 class="section"><a href="ffmpeg-filters.html#toc-signature-1">11.192 signature</a></h2>
  19866. <p>Calculates the MPEG-7 Video Signature. The filter can handle more than one
  19867. input. In this case the matching between the inputs can be calculated additionally.
  19868. The filter always passes through the first input. The signature of each stream can
  19869. be written into a file.
  19870. </p>
  19871. <p>It accepts the following options:
  19872. </p>
  19873. <dl compact="compact">
  19874. <dt>&lsquo;<samp>detectmode</samp>&rsquo;</dt>
  19875. <dd><p>Enable or disable the matching process.
  19876. </p>
  19877. <p>Available values are:
  19878. </p>
  19879. <dl compact="compact">
  19880. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  19881. <dd><p>Disable the calculation of a matching (default).
  19882. </p></dd>
  19883. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  19884. <dd><p>Calculate the matching for the whole video and output whether the whole video
  19885. matches or only parts.
  19886. </p></dd>
  19887. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  19888. <dd><p>Calculate only until a matching is found or the video ends. Should be faster in
  19889. some cases.
  19890. </p></dd>
  19891. </dl>
  19892. </dd>
  19893. <dt>&lsquo;<samp>nb_inputs</samp>&rsquo;</dt>
  19894. <dd><p>Set the number of inputs. The option value must be a non negative integer.
  19895. Default value is 1.
  19896. </p>
  19897. </dd>
  19898. <dt>&lsquo;<samp>filename</samp>&rsquo;</dt>
  19899. <dd><p>Set the path to which the output is written. If there is more than one input,
  19900. the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive
  19901. integer), that will be replaced with the input number. If no filename is
  19902. specified, no output will be written. This is the default.
  19903. </p>
  19904. </dd>
  19905. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  19906. <dd><p>Choose the output format.
  19907. </p>
  19908. <p>Available values are:
  19909. </p>
  19910. <dl compact="compact">
  19911. <dt>&lsquo;<samp>binary</samp>&rsquo;</dt>
  19912. <dd><p>Use the specified binary representation (default).
  19913. </p></dd>
  19914. <dt>&lsquo;<samp>xml</samp>&rsquo;</dt>
  19915. <dd><p>Use the specified xml representation.
  19916. </p></dd>
  19917. </dl>
  19918. </dd>
  19919. <dt>&lsquo;<samp>th_d</samp>&rsquo;</dt>
  19920. <dd><p>Set threshold to detect one word as similar. The option value must be an integer
  19921. greater than zero. The default value is 9000.
  19922. </p>
  19923. </dd>
  19924. <dt>&lsquo;<samp>th_dc</samp>&rsquo;</dt>
  19925. <dd><p>Set threshold to detect all words as similar. The option value must be an integer
  19926. greater than zero. The default value is 60000.
  19927. </p>
  19928. </dd>
  19929. <dt>&lsquo;<samp>th_xh</samp>&rsquo;</dt>
  19930. <dd><p>Set threshold to detect frames as similar. The option value must be an integer
  19931. greater than zero. The default value is 116.
  19932. </p>
  19933. </dd>
  19934. <dt>&lsquo;<samp>th_di</samp>&rsquo;</dt>
  19935. <dd><p>Set the minimum length of a sequence in frames to recognize it as matching
  19936. sequence. The option value must be a non negative integer value.
  19937. The default value is 0.
  19938. </p>
  19939. </dd>
  19940. <dt>&lsquo;<samp>th_it</samp>&rsquo;</dt>
  19941. <dd><p>Set the minimum relation, that matching frames to all frames must have.
  19942. The option value must be a double value between 0 and 1. The default value is 0.5.
  19943. </p></dd>
  19944. </dl>
  19945. <a name="Examples-30"></a>
  19946. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-30">11.192.1 Examples</a></h3>
  19947. <ul>
  19948. <li>
  19949. To calculate the signature of an input video and store it in signature.bin:
  19950. <div class="example">
  19951. <pre class="example">ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
  19952. </pre></div>
  19953. </li><li>
  19954. To detect whether two videos match and store the signatures in XML format in
  19955. signature0.xml and signature1.xml:
  19956. <div class="example">
  19957. <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 -
  19958. </pre></div>
  19959. </li></ul>
  19960. <p><a name="smartblur"></a>
  19961. </p><a name="smartblur-1"></a>
  19962. <h2 class="section"><a href="ffmpeg-filters.html#toc-smartblur-1">11.193 smartblur</a></h2>
  19963. <p>Blur the input video without impacting the outlines.
  19964. </p>
  19965. <p>It accepts the following options:
  19966. </p>
  19967. <dl compact="compact">
  19968. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  19969. <dd><p>Set the luma radius. The option value must be a float number in
  19970. the range [0.1,5.0] that specifies the variance of the gaussian filter
  19971. used to blur the image (slower if larger). Default value is 1.0.
  19972. </p>
  19973. </dd>
  19974. <dt>&lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
  19975. <dd><p>Set the luma strength. The option value must be a float number
  19976. in the range [-1.0,1.0] that configures the blurring. A value included
  19977. in [0.0,1.0] will blur the image whereas a value included in
  19978. [-1.0,0.0] will sharpen the image. Default value is 1.0.
  19979. </p>
  19980. </dd>
  19981. <dt>&lsquo;<samp>luma_threshold, lt</samp>&rsquo;</dt>
  19982. <dd><p>Set the luma threshold used as a coefficient to determine
  19983. whether a pixel should be blurred or not. The option value must be an
  19984. integer in the range [-30,30]. A value of 0 will filter all the image,
  19985. a value included in [0,30] will filter flat areas and a value included
  19986. in [-30,0] will filter edges. Default value is 0.
  19987. </p>
  19988. </dd>
  19989. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  19990. <dd><p>Set the chroma radius. The option value must be a float number in
  19991. the range [0.1,5.0] that specifies the variance of the gaussian filter
  19992. used to blur the image (slower if larger). Default value is &lsquo;<samp>luma_radius</samp>&rsquo;.
  19993. </p>
  19994. </dd>
  19995. <dt>&lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
  19996. <dd><p>Set the chroma strength. The option value must be a float number
  19997. in the range [-1.0,1.0] that configures the blurring. A value included
  19998. in [0.0,1.0] will blur the image whereas a value included in
  19999. [-1.0,0.0] will sharpen the image. Default value is &lsquo;<samp>luma_strength</samp>&rsquo;.
  20000. </p>
  20001. </dd>
  20002. <dt>&lsquo;<samp>chroma_threshold, ct</samp>&rsquo;</dt>
  20003. <dd><p>Set the chroma threshold used as a coefficient to determine
  20004. whether a pixel should be blurred or not. The option value must be an
  20005. integer in the range [-30,30]. A value of 0 will filter all the image,
  20006. a value included in [0,30] will filter flat areas and a value included
  20007. in [-30,0] will filter edges. Default value is &lsquo;<samp>luma_threshold</samp>&rsquo;.
  20008. </p></dd>
  20009. </dl>
  20010. <p>If a chroma option is not explicitly set, the corresponding luma value
  20011. is set.
  20012. </p>
  20013. <a name="sobel"></a>
  20014. <h2 class="section"><a href="ffmpeg-filters.html#toc-sobel">11.194 sobel</a></h2>
  20015. <p>Apply sobel operator to input video stream.
  20016. </p>
  20017. <p>The filter accepts the following option:
  20018. </p>
  20019. <dl compact="compact">
  20020. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  20021. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  20022. By default value 0xf, all planes will be processed.
  20023. </p>
  20024. </dd>
  20025. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  20026. <dd><p>Set value which will be multiplied with filtered result.
  20027. </p>
  20028. </dd>
  20029. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  20030. <dd><p>Set value which will be added to filtered result.
  20031. </p></dd>
  20032. </dl>
  20033. <p><a name="spp"></a>
  20034. </p><a name="spp-1"></a>
  20035. <h2 class="section"><a href="ffmpeg-filters.html#toc-spp-1">11.195 spp</a></h2>
  20036. <p>Apply a simple postprocessing filter that compresses and decompresses the image
  20037. at several (or - in the case of &lsquo;<samp>quality</samp>&rsquo; level <code>6</code> - all) shifts
  20038. and average the results.
  20039. </p>
  20040. <p>The filter accepts the following options:
  20041. </p>
  20042. <dl compact="compact">
  20043. <dt>&lsquo;<samp>quality</samp>&rsquo;</dt>
  20044. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  20045. an integer in the range 0-6. If set to <code>0</code>, the filter will have no
  20046. effect. A value of <code>6</code> means the higher quality. For each increment of
  20047. that value the speed drops by a factor of approximately 2. Default value is
  20048. <code>3</code>.
  20049. </p>
  20050. </dd>
  20051. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  20052. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  20053. from the video stream (if available).
  20054. </p>
  20055. </dd>
  20056. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  20057. <dd><p>Set thresholding mode. Available modes are:
  20058. </p>
  20059. <dl compact="compact">
  20060. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  20061. <dd><p>Set hard thresholding (default).
  20062. </p></dd>
  20063. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  20064. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  20065. </p></dd>
  20066. </dl>
  20067. </dd>
  20068. <dt>&lsquo;<samp>use_bframe_qp</samp>&rsquo;</dt>
  20069. <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
  20070. option may cause flicker since the B-Frames have often larger QP. Default is
  20071. <code>0</code> (not enabled).
  20072. </p></dd>
  20073. </dl>
  20074. <a name="Commands-18"></a>
  20075. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-18">11.195.1 Commands</a></h3>
  20076. <p>This filter supports the following commands:
  20077. </p><dl compact="compact">
  20078. <dt>&lsquo;<samp>quality, level</samp>&rsquo;</dt>
  20079. <dd><p>Set quality level. The value <code>max</code> can be used to set the maximum level,
  20080. currently <code>6</code>.
  20081. </p></dd>
  20082. </dl>
  20083. <p><a name="sr"></a>
  20084. </p><a name="sr-1"></a>
  20085. <h2 class="section"><a href="ffmpeg-filters.html#toc-sr-1">11.196 sr</a></h2>
  20086. <p>Scale the input by applying one of the super-resolution methods based on
  20087. convolutional neural networks. Supported models:
  20088. </p>
  20089. <ul>
  20090. <li>
  20091. Super-Resolution Convolutional Neural Network model (SRCNN).
  20092. See <a href="https://arxiv.org/abs/1501.00092">https://arxiv.org/abs/1501.00092</a>.
  20093. </li><li>
  20094. Efficient Sub-Pixel Convolutional Neural Network model (ESPCN).
  20095. See <a href="https://arxiv.org/abs/1609.05158">https://arxiv.org/abs/1609.05158</a>.
  20096. </li></ul>
  20097. <p>Training scripts as well as scripts for model file (.pb) saving can be found at
  20098. <a href="https://github.com/XueweiMeng/sr/tree/sr_dnn_native">https://github.com/XueweiMeng/sr/tree/sr_dnn_native</a>. Original repository
  20099. is at <a href="https://github.com/HighVoltageRocknRoll/sr.git">https://github.com/HighVoltageRocknRoll/sr.git</a>.
  20100. </p>
  20101. <p>Native model files (.model) can be generated from TensorFlow model
  20102. files (.pb) by using tools/python/convert.py
  20103. </p>
  20104. <p>The filter accepts the following options:
  20105. </p>
  20106. <dl compact="compact">
  20107. <dt>&lsquo;<samp>dnn_backend</samp>&rsquo;</dt>
  20108. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  20109. the following values:
  20110. </p>
  20111. <dl compact="compact">
  20112. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  20113. <dd><p>Native implementation of DNN loading and execution.
  20114. </p>
  20115. </dd>
  20116. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  20117. <dd><p>TensorFlow backend. To enable this backend you
  20118. need to install the TensorFlow for C library (see
  20119. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  20120. <code>--enable-libtensorflow</code>
  20121. </p></dd>
  20122. </dl>
  20123. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  20124. </p>
  20125. </dd>
  20126. <dt>&lsquo;<samp>model</samp>&rsquo;</dt>
  20127. <dd><p>Set path to model file specifying network architecture and its parameters.
  20128. Note that different backends use different file formats. TensorFlow backend
  20129. can load files for both formats, while native backend can load files for only
  20130. its format.
  20131. </p>
  20132. </dd>
  20133. <dt>&lsquo;<samp>scale_factor</samp>&rsquo;</dt>
  20134. <dd><p>Set scale factor for SRCNN model. Allowed values are <code>2</code>, <code>3</code> and <code>4</code>.
  20135. Default value is <code>2</code>. Scale factor is necessary for SRCNN model, because it accepts
  20136. input upscaled using bicubic upscaling with proper scale factor.
  20137. </p></dd>
  20138. </dl>
  20139. <p>This feature can also be finished with <a href="#dnn_005fprocessing">dnn_processing</a> filter.
  20140. </p>
  20141. <a name="ssim"></a>
  20142. <h2 class="section"><a href="ffmpeg-filters.html#toc-ssim">11.197 ssim</a></h2>
  20143. <p>Obtain the SSIM (Structural SImilarity Metric) between two input videos.
  20144. </p>
  20145. <p>This filter takes in input two input videos, the first input is
  20146. considered the &quot;main&quot; source and is passed unchanged to the
  20147. output. The second input is used as a &quot;reference&quot; video for computing
  20148. the SSIM.
  20149. </p>
  20150. <p>Both video inputs must have the same resolution and pixel format for
  20151. this filter to work correctly. Also it assumes that both inputs
  20152. have the same number of frames, which are compared one by one.
  20153. </p>
  20154. <p>The filter stores the calculated SSIM of each frame.
  20155. </p>
  20156. <p>The description of the accepted parameters follows.
  20157. </p>
  20158. <dl compact="compact">
  20159. <dt>&lsquo;<samp>stats_file, f</samp>&rsquo;</dt>
  20160. <dd><p>If specified the filter will use the named file to save the SSIM of
  20161. each individual frame. When filename equals &quot;-&quot; the data is sent to
  20162. standard output.
  20163. </p></dd>
  20164. </dl>
  20165. <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
  20166. key/value pairs of the form <var>key</var>:<var>value</var> for each compared
  20167. couple of frames.
  20168. </p>
  20169. <p>A description of each shown parameter follows:
  20170. </p>
  20171. <dl compact="compact">
  20172. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  20173. <dd><p>sequential number of the input frame, starting from 1
  20174. </p>
  20175. </dd>
  20176. <dt>&lsquo;<samp>Y, U, V, R, G, B</samp>&rsquo;</dt>
  20177. <dd><p>SSIM of the compared frames for the component specified by the suffix.
  20178. </p>
  20179. </dd>
  20180. <dt>&lsquo;<samp>All</samp>&rsquo;</dt>
  20181. <dd><p>SSIM of the compared frames for the whole frame.
  20182. </p>
  20183. </dd>
  20184. <dt>&lsquo;<samp>dB</samp>&rsquo;</dt>
  20185. <dd><p>Same as above but in dB representation.
  20186. </p></dd>
  20187. </dl>
  20188. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  20189. </p>
  20190. <a name="Examples-127"></a>
  20191. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-127">11.197.1 Examples</a></h3>
  20192. <ul>
  20193. <li>
  20194. For example:
  20195. <div class="example">
  20196. <pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  20197. [main][ref] ssim=&quot;stats_file=stats.log&quot; [out]
  20198. </pre></div>
  20199. <p>On this example the input file being processed is compared with the
  20200. reference file &lsquo;<tt>ref_movie.mpg</tt>&rsquo;. The SSIM of each individual frame
  20201. is stored in &lsquo;<tt>stats.log</tt>&rsquo;.
  20202. </p>
  20203. </li><li>
  20204. Another example with both psnr and ssim at same time:
  20205. <div class="example">
  20206. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi &quot;ssim;[0:v][1:v]psnr&quot; -f null -
  20207. </pre></div>
  20208. </li><li>
  20209. Another example with different containers:
  20210. <div class="example">
  20211. <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 -
  20212. </pre></div>
  20213. </li></ul>
  20214. <a name="stereo3d"></a>
  20215. <h2 class="section"><a href="ffmpeg-filters.html#toc-stereo3d">11.198 stereo3d</a></h2>
  20216. <p>Convert between different stereoscopic image formats.
  20217. </p>
  20218. <p>The filters accept the following options:
  20219. </p>
  20220. <dl compact="compact">
  20221. <dt>&lsquo;<samp>in</samp>&rsquo;</dt>
  20222. <dd><p>Set stereoscopic image format of input.
  20223. </p>
  20224. <p>Available values for input image formats are:
  20225. </p><dl compact="compact">
  20226. <dt>&lsquo;<samp>sbsl</samp>&rsquo;</dt>
  20227. <dd><p>side by side parallel (left eye left, right eye right)
  20228. </p>
  20229. </dd>
  20230. <dt>&lsquo;<samp>sbsr</samp>&rsquo;</dt>
  20231. <dd><p>side by side crosseye (right eye left, left eye right)
  20232. </p>
  20233. </dd>
  20234. <dt>&lsquo;<samp>sbs2l</samp>&rsquo;</dt>
  20235. <dd><p>side by side parallel with half width resolution
  20236. (left eye left, right eye right)
  20237. </p>
  20238. </dd>
  20239. <dt>&lsquo;<samp>sbs2r</samp>&rsquo;</dt>
  20240. <dd><p>side by side crosseye with half width resolution
  20241. (right eye left, left eye right)
  20242. </p>
  20243. </dd>
  20244. <dt>&lsquo;<samp>abl</samp>&rsquo;</dt>
  20245. <dt>&lsquo;<samp>tbl</samp>&rsquo;</dt>
  20246. <dd><p>above-below (left eye above, right eye below)
  20247. </p>
  20248. </dd>
  20249. <dt>&lsquo;<samp>abr</samp>&rsquo;</dt>
  20250. <dt>&lsquo;<samp>tbr</samp>&rsquo;</dt>
  20251. <dd><p>above-below (right eye above, left eye below)
  20252. </p>
  20253. </dd>
  20254. <dt>&lsquo;<samp>ab2l</samp>&rsquo;</dt>
  20255. <dt>&lsquo;<samp>tb2l</samp>&rsquo;</dt>
  20256. <dd><p>above-below with half height resolution
  20257. (left eye above, right eye below)
  20258. </p>
  20259. </dd>
  20260. <dt>&lsquo;<samp>ab2r</samp>&rsquo;</dt>
  20261. <dt>&lsquo;<samp>tb2r</samp>&rsquo;</dt>
  20262. <dd><p>above-below with half height resolution
  20263. (right eye above, left eye below)
  20264. </p>
  20265. </dd>
  20266. <dt>&lsquo;<samp>al</samp>&rsquo;</dt>
  20267. <dd><p>alternating frames (left eye first, right eye second)
  20268. </p>
  20269. </dd>
  20270. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  20271. <dd><p>alternating frames (right eye first, left eye second)
  20272. </p>
  20273. </dd>
  20274. <dt>&lsquo;<samp>irl</samp>&rsquo;</dt>
  20275. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  20276. </p>
  20277. </dd>
  20278. <dt>&lsquo;<samp>irr</samp>&rsquo;</dt>
  20279. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  20280. </p>
  20281. </dd>
  20282. <dt>&lsquo;<samp>icl</samp>&rsquo;</dt>
  20283. <dd><p>interleaved columns, left eye first
  20284. </p>
  20285. </dd>
  20286. <dt>&lsquo;<samp>icr</samp>&rsquo;</dt>
  20287. <dd><p>interleaved columns, right eye first
  20288. </p>
  20289. <p>Default value is &lsquo;<samp>sbsl</samp>&rsquo;.
  20290. </p></dd>
  20291. </dl>
  20292. </dd>
  20293. <dt>&lsquo;<samp>out</samp>&rsquo;</dt>
  20294. <dd><p>Set stereoscopic image format of output.
  20295. </p>
  20296. <dl compact="compact">
  20297. <dt>&lsquo;<samp>sbsl</samp>&rsquo;</dt>
  20298. <dd><p>side by side parallel (left eye left, right eye right)
  20299. </p>
  20300. </dd>
  20301. <dt>&lsquo;<samp>sbsr</samp>&rsquo;</dt>
  20302. <dd><p>side by side crosseye (right eye left, left eye right)
  20303. </p>
  20304. </dd>
  20305. <dt>&lsquo;<samp>sbs2l</samp>&rsquo;</dt>
  20306. <dd><p>side by side parallel with half width resolution
  20307. (left eye left, right eye right)
  20308. </p>
  20309. </dd>
  20310. <dt>&lsquo;<samp>sbs2r</samp>&rsquo;</dt>
  20311. <dd><p>side by side crosseye with half width resolution
  20312. (right eye left, left eye right)
  20313. </p>
  20314. </dd>
  20315. <dt>&lsquo;<samp>abl</samp>&rsquo;</dt>
  20316. <dt>&lsquo;<samp>tbl</samp>&rsquo;</dt>
  20317. <dd><p>above-below (left eye above, right eye below)
  20318. </p>
  20319. </dd>
  20320. <dt>&lsquo;<samp>abr</samp>&rsquo;</dt>
  20321. <dt>&lsquo;<samp>tbr</samp>&rsquo;</dt>
  20322. <dd><p>above-below (right eye above, left eye below)
  20323. </p>
  20324. </dd>
  20325. <dt>&lsquo;<samp>ab2l</samp>&rsquo;</dt>
  20326. <dt>&lsquo;<samp>tb2l</samp>&rsquo;</dt>
  20327. <dd><p>above-below with half height resolution
  20328. (left eye above, right eye below)
  20329. </p>
  20330. </dd>
  20331. <dt>&lsquo;<samp>ab2r</samp>&rsquo;</dt>
  20332. <dt>&lsquo;<samp>tb2r</samp>&rsquo;</dt>
  20333. <dd><p>above-below with half height resolution
  20334. (right eye above, left eye below)
  20335. </p>
  20336. </dd>
  20337. <dt>&lsquo;<samp>al</samp>&rsquo;</dt>
  20338. <dd><p>alternating frames (left eye first, right eye second)
  20339. </p>
  20340. </dd>
  20341. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  20342. <dd><p>alternating frames (right eye first, left eye second)
  20343. </p>
  20344. </dd>
  20345. <dt>&lsquo;<samp>irl</samp>&rsquo;</dt>
  20346. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  20347. </p>
  20348. </dd>
  20349. <dt>&lsquo;<samp>irr</samp>&rsquo;</dt>
  20350. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  20351. </p>
  20352. </dd>
  20353. <dt>&lsquo;<samp>arbg</samp>&rsquo;</dt>
  20354. <dd><p>anaglyph red/blue gray
  20355. (red filter on left eye, blue filter on right eye)
  20356. </p>
  20357. </dd>
  20358. <dt>&lsquo;<samp>argg</samp>&rsquo;</dt>
  20359. <dd><p>anaglyph red/green gray
  20360. (red filter on left eye, green filter on right eye)
  20361. </p>
  20362. </dd>
  20363. <dt>&lsquo;<samp>arcg</samp>&rsquo;</dt>
  20364. <dd><p>anaglyph red/cyan gray
  20365. (red filter on left eye, cyan filter on right eye)
  20366. </p>
  20367. </dd>
  20368. <dt>&lsquo;<samp>arch</samp>&rsquo;</dt>
  20369. <dd><p>anaglyph red/cyan half colored
  20370. (red filter on left eye, cyan filter on right eye)
  20371. </p>
  20372. </dd>
  20373. <dt>&lsquo;<samp>arcc</samp>&rsquo;</dt>
  20374. <dd><p>anaglyph red/cyan color
  20375. (red filter on left eye, cyan filter on right eye)
  20376. </p>
  20377. </dd>
  20378. <dt>&lsquo;<samp>arcd</samp>&rsquo;</dt>
  20379. <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
  20380. (red filter on left eye, cyan filter on right eye)
  20381. </p>
  20382. </dd>
  20383. <dt>&lsquo;<samp>agmg</samp>&rsquo;</dt>
  20384. <dd><p>anaglyph green/magenta gray
  20385. (green filter on left eye, magenta filter on right eye)
  20386. </p>
  20387. </dd>
  20388. <dt>&lsquo;<samp>agmh</samp>&rsquo;</dt>
  20389. <dd><p>anaglyph green/magenta half colored
  20390. (green filter on left eye, magenta filter on right eye)
  20391. </p>
  20392. </dd>
  20393. <dt>&lsquo;<samp>agmc</samp>&rsquo;</dt>
  20394. <dd><p>anaglyph green/magenta colored
  20395. (green filter on left eye, magenta filter on right eye)
  20396. </p>
  20397. </dd>
  20398. <dt>&lsquo;<samp>agmd</samp>&rsquo;</dt>
  20399. <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
  20400. (green filter on left eye, magenta filter on right eye)
  20401. </p>
  20402. </dd>
  20403. <dt>&lsquo;<samp>aybg</samp>&rsquo;</dt>
  20404. <dd><p>anaglyph yellow/blue gray
  20405. (yellow filter on left eye, blue filter on right eye)
  20406. </p>
  20407. </dd>
  20408. <dt>&lsquo;<samp>aybh</samp>&rsquo;</dt>
  20409. <dd><p>anaglyph yellow/blue half colored
  20410. (yellow filter on left eye, blue filter on right eye)
  20411. </p>
  20412. </dd>
  20413. <dt>&lsquo;<samp>aybc</samp>&rsquo;</dt>
  20414. <dd><p>anaglyph yellow/blue colored
  20415. (yellow filter on left eye, blue filter on right eye)
  20416. </p>
  20417. </dd>
  20418. <dt>&lsquo;<samp>aybd</samp>&rsquo;</dt>
  20419. <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
  20420. (yellow filter on left eye, blue filter on right eye)
  20421. </p>
  20422. </dd>
  20423. <dt>&lsquo;<samp>ml</samp>&rsquo;</dt>
  20424. <dd><p>mono output (left eye only)
  20425. </p>
  20426. </dd>
  20427. <dt>&lsquo;<samp>mr</samp>&rsquo;</dt>
  20428. <dd><p>mono output (right eye only)
  20429. </p>
  20430. </dd>
  20431. <dt>&lsquo;<samp>chl</samp>&rsquo;</dt>
  20432. <dd><p>checkerboard, left eye first
  20433. </p>
  20434. </dd>
  20435. <dt>&lsquo;<samp>chr</samp>&rsquo;</dt>
  20436. <dd><p>checkerboard, right eye first
  20437. </p>
  20438. </dd>
  20439. <dt>&lsquo;<samp>icl</samp>&rsquo;</dt>
  20440. <dd><p>interleaved columns, left eye first
  20441. </p>
  20442. </dd>
  20443. <dt>&lsquo;<samp>icr</samp>&rsquo;</dt>
  20444. <dd><p>interleaved columns, right eye first
  20445. </p>
  20446. </dd>
  20447. <dt>&lsquo;<samp>hdmi</samp>&rsquo;</dt>
  20448. <dd><p>HDMI frame pack
  20449. </p></dd>
  20450. </dl>
  20451. <p>Default value is &lsquo;<samp>arcd</samp>&rsquo;.
  20452. </p></dd>
  20453. </dl>
  20454. <a name="Examples-69"></a>
  20455. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-69">11.198.1 Examples</a></h3>
  20456. <ul>
  20457. <li>
  20458. Convert input video from side by side parallel to anaglyph yellow/blue dubois:
  20459. <div class="example">
  20460. <pre class="example">stereo3d=sbsl:aybd
  20461. </pre></div>
  20462. </li><li>
  20463. Convert input video from above below (left eye above, right eye below) to side by side crosseye.
  20464. <div class="example">
  20465. <pre class="example">stereo3d=abl:sbsr
  20466. </pre></div>
  20467. </li></ul>
  20468. <a name="streamselect_002c-astreamselect"></a>
  20469. <h2 class="section"><a href="ffmpeg-filters.html#toc-streamselect_002c-astreamselect">11.199 streamselect, astreamselect</a></h2>
  20470. <p>Select video or audio streams.
  20471. </p>
  20472. <p>The filter accepts the following options:
  20473. </p>
  20474. <dl compact="compact">
  20475. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  20476. <dd><p>Set number of inputs. Default is 2.
  20477. </p>
  20478. </dd>
  20479. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  20480. <dd><p>Set input indexes to remap to outputs.
  20481. </p></dd>
  20482. </dl>
  20483. <a name="Commands-32"></a>
  20484. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-32">11.199.1 Commands</a></h3>
  20485. <p>The <code>streamselect</code> and <code>astreamselect</code> filter supports the following
  20486. commands:
  20487. </p>
  20488. <dl compact="compact">
  20489. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  20490. <dd><p>Set input indexes to remap to outputs.
  20491. </p></dd>
  20492. </dl>
  20493. <a name="Examples-109"></a>
  20494. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-109">11.199.2 Examples</a></h3>
  20495. <ul>
  20496. <li>
  20497. Select first 5 seconds 1st stream and rest of time 2nd stream:
  20498. <div class="example">
  20499. <pre class="example">sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
  20500. </pre></div>
  20501. </li><li>
  20502. Same as above, but for audio:
  20503. <div class="example">
  20504. <pre class="example">asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
  20505. </pre></div>
  20506. </li></ul>
  20507. <p><a name="subtitles"></a>
  20508. </p><a name="subtitles-1"></a>
  20509. <h2 class="section"><a href="ffmpeg-filters.html#toc-subtitles-1">11.200 subtitles</a></h2>
  20510. <p>Draw subtitles on top of input video using the libass library.
  20511. </p>
  20512. <p>To enable compilation of this filter you need to configure FFmpeg with
  20513. <code>--enable-libass</code>. This filter also requires a build with libavcodec and
  20514. libavformat to convert the passed subtitles file to ASS (Advanced Substation
  20515. Alpha) subtitles format.
  20516. </p>
  20517. <p>The filter accepts the following options:
  20518. </p>
  20519. <dl compact="compact">
  20520. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  20521. <dd><p>Set the filename of the subtitle file to read. It must be specified.
  20522. </p>
  20523. </dd>
  20524. <dt>&lsquo;<samp>original_size</samp>&rsquo;</dt>
  20525. <dd><p>Specify the size of the original video, the video for which the ASS file
  20526. was composed. For the syntax of this option, check the
  20527. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  20528. Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to
  20529. correctly scale the fonts if the aspect ratio has been changed.
  20530. </p>
  20531. </dd>
  20532. <dt>&lsquo;<samp>fontsdir</samp>&rsquo;</dt>
  20533. <dd><p>Set a directory path containing fonts that can be used by the filter.
  20534. These fonts will be used in addition to whatever the font provider uses.
  20535. </p>
  20536. </dd>
  20537. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  20538. <dd><p>Process alpha channel, by default alpha channel is untouched.
  20539. </p>
  20540. </dd>
  20541. <dt>&lsquo;<samp>charenc</samp>&rsquo;</dt>
  20542. <dd><p>Set subtitles input character encoding. <code>subtitles</code> filter only. Only
  20543. useful if not UTF-8.
  20544. </p>
  20545. </dd>
  20546. <dt>&lsquo;<samp>stream_index, si</samp>&rsquo;</dt>
  20547. <dd><p>Set subtitles stream index. <code>subtitles</code> filter only.
  20548. </p>
  20549. </dd>
  20550. <dt>&lsquo;<samp>force_style</samp>&rsquo;</dt>
  20551. <dd><p>Override default style or script info parameters of the subtitles. It accepts a
  20552. string containing ASS style format <code>KEY=VALUE</code> couples separated by &quot;,&quot;.
  20553. </p></dd>
  20554. </dl>
  20555. <p>If the first key is not specified, it is assumed that the first value
  20556. specifies the &lsquo;<samp>filename</samp>&rsquo;.
  20557. </p>
  20558. <p>For example, to render the file &lsquo;<tt>sub.srt</tt>&rsquo; on top of the input
  20559. video, use the command:
  20560. </p><div class="example">
  20561. <pre class="example">subtitles=sub.srt
  20562. </pre></div>
  20563. <p>which is equivalent to:
  20564. </p><div class="example">
  20565. <pre class="example">subtitles=filename=sub.srt
  20566. </pre></div>
  20567. <p>To render the default subtitles stream from file &lsquo;<tt>video.mkv</tt>&rsquo;, use:
  20568. </p><div class="example">
  20569. <pre class="example">subtitles=video.mkv
  20570. </pre></div>
  20571. <p>To render the second subtitles stream from that file, use:
  20572. </p><div class="example">
  20573. <pre class="example">subtitles=video.mkv:si=1
  20574. </pre></div>
  20575. <p>To make the subtitles stream from &lsquo;<tt>sub.srt</tt>&rsquo; appear in 80% transparent blue
  20576. <code>DejaVu Serif</code>, use:
  20577. </p><div class="example">
  20578. <pre class="example">subtitles=sub.srt:force_style='FontName=DejaVu Serif,PrimaryColour=&amp;HCCFF0000'
  20579. </pre></div>
  20580. <a name="super2xsai"></a>
  20581. <h2 class="section"><a href="ffmpeg-filters.html#toc-super2xsai">11.201 super2xsai</a></h2>
  20582. <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
  20583. Interpolate) pixel art scaling algorithm.
  20584. </p>
  20585. <p>Useful for enlarging pixel art images without reducing sharpness.
  20586. </p>
  20587. <a name="swaprect"></a>
  20588. <h2 class="section"><a href="ffmpeg-filters.html#toc-swaprect">11.202 swaprect</a></h2>
  20589. <p>Swap two rectangular objects in video.
  20590. </p>
  20591. <p>This filter accepts the following options:
  20592. </p>
  20593. <dl compact="compact">
  20594. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  20595. <dd><p>Set object width.
  20596. </p>
  20597. </dd>
  20598. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  20599. <dd><p>Set object height.
  20600. </p>
  20601. </dd>
  20602. <dt>&lsquo;<samp>x1</samp>&rsquo;</dt>
  20603. <dd><p>Set 1st rect x coordinate.
  20604. </p>
  20605. </dd>
  20606. <dt>&lsquo;<samp>y1</samp>&rsquo;</dt>
  20607. <dd><p>Set 1st rect y coordinate.
  20608. </p>
  20609. </dd>
  20610. <dt>&lsquo;<samp>x2</samp>&rsquo;</dt>
  20611. <dd><p>Set 2nd rect x coordinate.
  20612. </p>
  20613. </dd>
  20614. <dt>&lsquo;<samp>y2</samp>&rsquo;</dt>
  20615. <dd><p>Set 2nd rect y coordinate.
  20616. </p>
  20617. <p>All expressions are evaluated once for each frame.
  20618. </p></dd>
  20619. </dl>
  20620. <p>The all options are expressions containing the following constants:
  20621. </p>
  20622. <dl compact="compact">
  20623. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  20624. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  20625. <dd><p>The input width and height.
  20626. </p>
  20627. </dd>
  20628. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  20629. <dd><p>same as <var>w</var> / <var>h</var>
  20630. </p>
  20631. </dd>
  20632. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  20633. <dd><p>input sample aspect ratio
  20634. </p>
  20635. </dd>
  20636. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  20637. <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
  20638. </p>
  20639. </dd>
  20640. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  20641. <dd><p>The number of the input frame, starting from 0.
  20642. </p>
  20643. </dd>
  20644. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  20645. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  20646. </p>
  20647. </dd>
  20648. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  20649. <dd><p>the position in the file of the input frame, NAN if unknown
  20650. </p></dd>
  20651. </dl>
  20652. <a name="swapuv"></a>
  20653. <h2 class="section"><a href="ffmpeg-filters.html#toc-swapuv">11.203 swapuv</a></h2>
  20654. <p>Swap U &amp; V plane.
  20655. </p>
  20656. <a name="tblend"></a>
  20657. <h2 class="section"><a href="ffmpeg-filters.html#toc-tblend">11.204 tblend</a></h2>
  20658. <p>Blend successive video frames.
  20659. </p>
  20660. <p>See <a href="#blend">blend</a>
  20661. </p>
  20662. <a name="telecine"></a>
  20663. <h2 class="section"><a href="ffmpeg-filters.html#toc-telecine">11.205 telecine</a></h2>
  20664. <p>Apply telecine process to the video.
  20665. </p>
  20666. <p>This filter accepts the following options:
  20667. </p>
  20668. <dl compact="compact">
  20669. <dt>&lsquo;<samp>first_field</samp>&rsquo;</dt>
  20670. <dd><dl compact="compact">
  20671. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  20672. <dd><p>top field first
  20673. </p></dd>
  20674. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  20675. <dd><p>bottom field first
  20676. The default value is <code>top</code>.
  20677. </p></dd>
  20678. </dl>
  20679. </dd>
  20680. <dt>&lsquo;<samp>pattern</samp>&rsquo;</dt>
  20681. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  20682. The default value is <code>23</code>.
  20683. </p></dd>
  20684. </dl>
  20685. <div class="example">
  20686. <pre class="example">Some typical patterns:
  20687. NTSC output (30i):
  20688. 27.5p: 32222
  20689. 24p: 23 (classic)
  20690. 24p: 2332 (preferred)
  20691. 20p: 33
  20692. 18p: 334
  20693. 16p: 3444
  20694. PAL output (25i):
  20695. 27.5p: 12222
  20696. 24p: 222222222223 (&quot;Euro pulldown&quot;)
  20697. 16.67p: 33
  20698. 16p: 33333334
  20699. </pre></div>
  20700. <a name="thistogram"></a>
  20701. <h2 class="section"><a href="ffmpeg-filters.html#toc-thistogram">11.206 thistogram</a></h2>
  20702. <p>Compute and draw a color distribution histogram for the input video across time.
  20703. </p>
  20704. <p>Unlike <a href="#histogram">histogram</a> video filter which only shows histogram of single input frame
  20705. at certain time, this filter shows also past histograms of number of frames defined
  20706. by <code>width</code> option.
  20707. </p>
  20708. <p>The computed histogram is a representation of the color component
  20709. distribution in an image.
  20710. </p>
  20711. <p>The filter accepts the following options:
  20712. </p>
  20713. <dl compact="compact">
  20714. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  20715. <dd><p>Set width of single color component output. Default value is <code>0</code>.
  20716. Value of <code>0</code> means width will be picked from input video.
  20717. This also set number of passed histograms to keep.
  20718. Allowed range is [0, 8192].
  20719. </p>
  20720. </dd>
  20721. <dt>&lsquo;<samp>display_mode, d</samp>&rsquo;</dt>
  20722. <dd><p>Set display mode.
  20723. It accepts the following values:
  20724. </p><dl compact="compact">
  20725. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  20726. <dd><p>Per color component graphs are placed below each other.
  20727. </p>
  20728. </dd>
  20729. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  20730. <dd><p>Per color component graphs are placed side by side.
  20731. </p>
  20732. </dd>
  20733. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  20734. <dd><p>Presents information identical to that in the <code>parade</code>, except
  20735. that the graphs representing color components are superimposed directly
  20736. over one another.
  20737. </p></dd>
  20738. </dl>
  20739. <p>Default is <code>stack</code>.
  20740. </p>
  20741. </dd>
  20742. <dt>&lsquo;<samp>levels_mode, m</samp>&rsquo;</dt>
  20743. <dd><p>Set mode. Can be either <code>linear</code>, or <code>logarithmic</code>.
  20744. Default is <code>linear</code>.
  20745. </p>
  20746. </dd>
  20747. <dt>&lsquo;<samp>components, c</samp>&rsquo;</dt>
  20748. <dd><p>Set what color components to display.
  20749. Default is <code>7</code>.
  20750. </p>
  20751. </dd>
  20752. <dt>&lsquo;<samp>bgopacity, b</samp>&rsquo;</dt>
  20753. <dd><p>Set background opacity. Default is <code>0.9</code>.
  20754. </p>
  20755. </dd>
  20756. <dt>&lsquo;<samp>envelope, e</samp>&rsquo;</dt>
  20757. <dd><p>Show envelope. Default is disabled.
  20758. </p>
  20759. </dd>
  20760. <dt>&lsquo;<samp>ecolor, ec</samp>&rsquo;</dt>
  20761. <dd><p>Set envelope color. Default is <code>gold</code>.
  20762. </p></dd>
  20763. </dl>
  20764. <a name="threshold"></a>
  20765. <h2 class="section"><a href="ffmpeg-filters.html#toc-threshold">11.207 threshold</a></h2>
  20766. <p>Apply threshold effect to video stream.
  20767. </p>
  20768. <p>This filter needs four video streams to perform thresholding.
  20769. First stream is stream we are filtering.
  20770. Second stream is holding threshold values, third stream is holding min values,
  20771. and last, fourth stream is holding max values.
  20772. </p>
  20773. <p>The filter accepts the following option:
  20774. </p>
  20775. <dl compact="compact">
  20776. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  20777. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  20778. By default value 0xf, all planes will be processed.
  20779. </p></dd>
  20780. </dl>
  20781. <p>For example if first stream pixel&rsquo;s component value is less then threshold value
  20782. of pixel component from 2nd threshold stream, third stream value will picked,
  20783. otherwise fourth stream pixel component value will be picked.
  20784. </p>
  20785. <p>Using color source filter one can perform various types of thresholding:
  20786. </p>
  20787. <a name="Examples-67"></a>
  20788. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-67">11.207.1 Examples</a></h3>
  20789. <ul>
  20790. <li>
  20791. Binary threshold, using gray color as threshold:
  20792. <div class="example">
  20793. <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
  20794. </pre></div>
  20795. </li><li>
  20796. Inverted binary threshold, using gray color as threshold:
  20797. <div class="example">
  20798. <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
  20799. </pre></div>
  20800. </li><li>
  20801. Truncate binary threshold, using gray color as threshold:
  20802. <div class="example">
  20803. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=gray -lavfi threshold output.avi
  20804. </pre></div>
  20805. </li><li>
  20806. Threshold to zero, using gray color as threshold:
  20807. <div class="example">
  20808. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -i 320x240.avi -lavfi threshold output.avi
  20809. </pre></div>
  20810. </li><li>
  20811. Inverted threshold to zero, using gray color as threshold:
  20812. <div class="example">
  20813. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=white -lavfi threshold output.avi
  20814. </pre></div>
  20815. </li></ul>
  20816. <a name="thumbnail"></a>
  20817. <h2 class="section"><a href="ffmpeg-filters.html#toc-thumbnail">11.208 thumbnail</a></h2>
  20818. <p>Select the most representative frame in a given sequence of consecutive frames.
  20819. </p>
  20820. <p>The filter accepts the following options:
  20821. </p>
  20822. <dl compact="compact">
  20823. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  20824. <dd><p>Set the frames batch size to analyze; in a set of <var>n</var> frames, the filter
  20825. will pick one of them, and then handle the next batch of <var>n</var> frames until
  20826. the end. Default is <code>100</code>.
  20827. </p></dd>
  20828. </dl>
  20829. <p>Since the filter keeps track of the whole frames sequence, a bigger <var>n</var>
  20830. value will result in a higher memory usage, so a high value is not recommended.
  20831. </p>
  20832. <a name="Examples-94"></a>
  20833. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-94">11.208.1 Examples</a></h3>
  20834. <ul>
  20835. <li>
  20836. Extract one picture each 50 frames:
  20837. <div class="example">
  20838. <pre class="example">thumbnail=50
  20839. </pre></div>
  20840. </li><li>
  20841. Complete example of a thumbnail creation with <code>ffmpeg</code>:
  20842. <div class="example">
  20843. <pre class="example">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
  20844. </pre></div>
  20845. </li></ul>
  20846. <p><a name="tile"></a>
  20847. </p><a name="tile-1"></a>
  20848. <h2 class="section"><a href="ffmpeg-filters.html#toc-tile-1">11.209 tile</a></h2>
  20849. <p>Tile several successive frames together.
  20850. </p>
  20851. <p>The <a href="#untile">untile</a> filter can do the reverse.
  20852. </p>
  20853. <p>The filter accepts the following options:
  20854. </p>
  20855. <dl compact="compact">
  20856. <dt>&lsquo;<samp>layout</samp>&rsquo;</dt>
  20857. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  20858. this option, check the
  20859. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  20860. </p>
  20861. </dd>
  20862. <dt>&lsquo;<samp>nb_frames</samp>&rsquo;</dt>
  20863. <dd><p>Set the maximum number of frames to render in the given area. It must be less
  20864. than or equal to <var>w</var>x<var>h</var>. The default value is <code>0</code>, meaning all
  20865. the area will be used.
  20866. </p>
  20867. </dd>
  20868. <dt>&lsquo;<samp>margin</samp>&rsquo;</dt>
  20869. <dd><p>Set the outer border margin in pixels.
  20870. </p>
  20871. </dd>
  20872. <dt>&lsquo;<samp>padding</samp>&rsquo;</dt>
  20873. <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
  20874. more advanced padding options (such as having different values for the edges),
  20875. refer to the pad video filter.
  20876. </p>
  20877. </dd>
  20878. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  20879. <dd><p>Specify the color of the unused area. For the syntax of this option, check the
  20880. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  20881. The default value of <var>color</var> is &quot;black&quot;.
  20882. </p>
  20883. </dd>
  20884. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  20885. <dd><p>Set the number of frames to overlap when tiling several successive frames together.
  20886. The value must be between <code>0</code> and <var>nb_frames - 1</var>.
  20887. </p>
  20888. </dd>
  20889. <dt>&lsquo;<samp>init_padding</samp>&rsquo;</dt>
  20890. <dd><p>Set the number of frames to initially be empty before displaying first output frame.
  20891. This controls how soon will one get first output frame.
  20892. The value must be between <code>0</code> and <var>nb_frames - 1</var>.
  20893. </p></dd>
  20894. </dl>
  20895. <a name="Examples-105"></a>
  20896. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-105">11.209.1 Examples</a></h3>
  20897. <ul>
  20898. <li>
  20899. Produce 8x8 PNG tiles of all keyframes (&lsquo;<samp>-skip_frame nokey</samp>&rsquo;) in a movie:
  20900. <div class="example">
  20901. <pre class="example">ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
  20902. </pre></div>
  20903. <p>The &lsquo;<samp>-vsync 0</samp>&rsquo; is necessary to prevent <code>ffmpeg</code> from
  20904. duplicating each output frame to accommodate the originally detected frame
  20905. rate.
  20906. </p>
  20907. </li><li>
  20908. Display <code>5</code> pictures in an area of <code>3x2</code> frames,
  20909. with <code>7</code> pixels between them, and <code>2</code> pixels of initial margin, using
  20910. mixed flat and named options:
  20911. <div class="example">
  20912. <pre class="example">tile=3x2:nb_frames=5:padding=7:margin=2
  20913. </pre></div>
  20914. </li></ul>
  20915. <a name="tinterlace"></a>
  20916. <h2 class="section"><a href="ffmpeg-filters.html#toc-tinterlace">11.210 tinterlace</a></h2>
  20917. <p>Perform various types of temporal field interlacing.
  20918. </p>
  20919. <p>Frames are counted starting from 1, so the first input frame is
  20920. considered odd.
  20921. </p>
  20922. <p>The filter accepts the following options:
  20923. </p>
  20924. <dl compact="compact">
  20925. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  20926. <dd><p>Specify the mode of the interlacing. This option can also be specified
  20927. as a value alone. See below for a list of values for this option.
  20928. </p>
  20929. <p>Available values are:
  20930. </p>
  20931. <dl compact="compact">
  20932. <dt>&lsquo;<samp>merge, 0</samp>&rsquo;</dt>
  20933. <dd><p>Move odd frames into the upper field, even into the lower field,
  20934. generating a double height frame at half frame rate.
  20935. </p><div class="example">
  20936. <pre class="example"> ------&gt; time
  20937. Input:
  20938. Frame 1 Frame 2 Frame 3 Frame 4
  20939. 11111 22222 33333 44444
  20940. 11111 22222 33333 44444
  20941. 11111 22222 33333 44444
  20942. 11111 22222 33333 44444
  20943. Output:
  20944. 11111 33333
  20945. 22222 44444
  20946. 11111 33333
  20947. 22222 44444
  20948. 11111 33333
  20949. 22222 44444
  20950. 11111 33333
  20951. 22222 44444
  20952. </pre></div>
  20953. </dd>
  20954. <dt>&lsquo;<samp>drop_even, 1</samp>&rsquo;</dt>
  20955. <dd><p>Only output odd frames, even frames are dropped, generating a frame with
  20956. unchanged height at half frame rate.
  20957. </p>
  20958. <div class="example">
  20959. <pre class="example"> ------&gt; time
  20960. Input:
  20961. Frame 1 Frame 2 Frame 3 Frame 4
  20962. 11111 22222 33333 44444
  20963. 11111 22222 33333 44444
  20964. 11111 22222 33333 44444
  20965. 11111 22222 33333 44444
  20966. Output:
  20967. 11111 33333
  20968. 11111 33333
  20969. 11111 33333
  20970. 11111 33333
  20971. </pre></div>
  20972. </dd>
  20973. <dt>&lsquo;<samp>drop_odd, 2</samp>&rsquo;</dt>
  20974. <dd><p>Only output even frames, odd frames are dropped, generating a frame with
  20975. unchanged height at half frame rate.
  20976. </p>
  20977. <div class="example">
  20978. <pre class="example"> ------&gt; time
  20979. Input:
  20980. Frame 1 Frame 2 Frame 3 Frame 4
  20981. 11111 22222 33333 44444
  20982. 11111 22222 33333 44444
  20983. 11111 22222 33333 44444
  20984. 11111 22222 33333 44444
  20985. Output:
  20986. 22222 44444
  20987. 22222 44444
  20988. 22222 44444
  20989. 22222 44444
  20990. </pre></div>
  20991. </dd>
  20992. <dt>&lsquo;<samp>pad, 3</samp>&rsquo;</dt>
  20993. <dd><p>Expand each frame to full height, but pad alternate lines with black,
  20994. generating a frame with double height at the same input frame rate.
  20995. </p>
  20996. <div class="example">
  20997. <pre class="example"> ------&gt; time
  20998. Input:
  20999. Frame 1 Frame 2 Frame 3 Frame 4
  21000. 11111 22222 33333 44444
  21001. 11111 22222 33333 44444
  21002. 11111 22222 33333 44444
  21003. 11111 22222 33333 44444
  21004. Output:
  21005. 11111 ..... 33333 .....
  21006. ..... 22222 ..... 44444
  21007. 11111 ..... 33333 .....
  21008. ..... 22222 ..... 44444
  21009. 11111 ..... 33333 .....
  21010. ..... 22222 ..... 44444
  21011. 11111 ..... 33333 .....
  21012. ..... 22222 ..... 44444
  21013. </pre></div>
  21014. </dd>
  21015. <dt>&lsquo;<samp>interleave_top, 4</samp>&rsquo;</dt>
  21016. <dd><p>Interleave the upper field from odd frames with the lower field from
  21017. even frames, generating a frame with unchanged height at half frame rate.
  21018. </p>
  21019. <div class="example">
  21020. <pre class="example"> ------&gt; time
  21021. Input:
  21022. Frame 1 Frame 2 Frame 3 Frame 4
  21023. 11111&lt;- 22222 33333&lt;- 44444
  21024. 11111 22222&lt;- 33333 44444&lt;-
  21025. 11111&lt;- 22222 33333&lt;- 44444
  21026. 11111 22222&lt;- 33333 44444&lt;-
  21027. Output:
  21028. 11111 33333
  21029. 22222 44444
  21030. 11111 33333
  21031. 22222 44444
  21032. </pre></div>
  21033. </dd>
  21034. <dt>&lsquo;<samp>interleave_bottom, 5</samp>&rsquo;</dt>
  21035. <dd><p>Interleave the lower field from odd frames with the upper field from
  21036. even frames, generating a frame with unchanged height at half frame rate.
  21037. </p>
  21038. <div class="example">
  21039. <pre class="example"> ------&gt; time
  21040. Input:
  21041. Frame 1 Frame 2 Frame 3 Frame 4
  21042. 11111 22222&lt;- 33333 44444&lt;-
  21043. 11111&lt;- 22222 33333&lt;- 44444
  21044. 11111 22222&lt;- 33333 44444&lt;-
  21045. 11111&lt;- 22222 33333&lt;- 44444
  21046. Output:
  21047. 22222 44444
  21048. 11111 33333
  21049. 22222 44444
  21050. 11111 33333
  21051. </pre></div>
  21052. </dd>
  21053. <dt>&lsquo;<samp>interlacex2, 6</samp>&rsquo;</dt>
  21054. <dd><p>Double frame rate with unchanged height. Frames are inserted each
  21055. containing the second temporal field from the previous input frame and
  21056. the first temporal field from the next input frame. This mode relies on
  21057. the top_field_first flag. Useful for interlaced video displays with no
  21058. field synchronisation.
  21059. </p>
  21060. <div class="example">
  21061. <pre class="example"> ------&gt; time
  21062. Input:
  21063. Frame 1 Frame 2 Frame 3 Frame 4
  21064. 11111 22222 33333 44444
  21065. 11111 22222 33333 44444
  21066. 11111 22222 33333 44444
  21067. 11111 22222 33333 44444
  21068. Output:
  21069. 11111 22222 22222 33333 33333 44444 44444
  21070. 11111 11111 22222 22222 33333 33333 44444
  21071. 11111 22222 22222 33333 33333 44444 44444
  21072. 11111 11111 22222 22222 33333 33333 44444
  21073. </pre></div>
  21074. </dd>
  21075. <dt>&lsquo;<samp>mergex2, 7</samp>&rsquo;</dt>
  21076. <dd><p>Move odd frames into the upper field, even into the lower field,
  21077. generating a double height frame at same frame rate.
  21078. </p>
  21079. <div class="example">
  21080. <pre class="example"> ------&gt; time
  21081. Input:
  21082. Frame 1 Frame 2 Frame 3 Frame 4
  21083. 11111 22222 33333 44444
  21084. 11111 22222 33333 44444
  21085. 11111 22222 33333 44444
  21086. 11111 22222 33333 44444
  21087. Output:
  21088. 11111 33333 33333 55555
  21089. 22222 22222 44444 44444
  21090. 11111 33333 33333 55555
  21091. 22222 22222 44444 44444
  21092. 11111 33333 33333 55555
  21093. 22222 22222 44444 44444
  21094. 11111 33333 33333 55555
  21095. 22222 22222 44444 44444
  21096. </pre></div>
  21097. </dd>
  21098. </dl>
  21099. <p>Numeric values are deprecated but are accepted for backward
  21100. compatibility reasons.
  21101. </p>
  21102. <p>Default mode is <code>merge</code>.
  21103. </p>
  21104. </dd>
  21105. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  21106. <dd><p>Specify flags influencing the filter process.
  21107. </p>
  21108. <p>Available value for <var>flags</var> is:
  21109. </p>
  21110. <dl compact="compact">
  21111. <dt>&lsquo;<samp>low_pass_filter, vlpf</samp>&rsquo;</dt>
  21112. <dd><p>Enable linear vertical low-pass filtering in the filter.
  21113. Vertical low-pass filtering is required when creating an interlaced
  21114. destination from a progressive source which contains high-frequency
  21115. vertical detail. Filtering will reduce interlace &rsquo;twitter&rsquo; and Moire
  21116. patterning.
  21117. </p>
  21118. </dd>
  21119. <dt>&lsquo;<samp>complex_filter, cvlpf</samp>&rsquo;</dt>
  21120. <dd><p>Enable complex vertical low-pass filtering.
  21121. This will slightly less reduce interlace &rsquo;twitter&rsquo; and Moire
  21122. patterning but better retain detail and subjective sharpness impression.
  21123. </p>
  21124. </dd>
  21125. <dt>&lsquo;<samp>bypass_il</samp>&rsquo;</dt>
  21126. <dd><p>Bypass already interlaced frames, only adjust the frame rate.
  21127. </p></dd>
  21128. </dl>
  21129. <p>Vertical low-pass filtering and bypassing already interlaced frames can only be
  21130. enabled for &lsquo;<samp>mode</samp>&rsquo; <var>interleave_top</var> and <var>interleave_bottom</var>.
  21131. </p>
  21132. </dd>
  21133. </dl>
  21134. <a name="tmedian"></a>
  21135. <h2 class="section"><a href="ffmpeg-filters.html#toc-tmedian">11.211 tmedian</a></h2>
  21136. <p>Pick median pixels from several successive input video frames.
  21137. </p>
  21138. <p>The filter accepts the following options:
  21139. </p>
  21140. <dl compact="compact">
  21141. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  21142. <dd><p>Set radius of median filter.
  21143. Default is 1. Allowed range is from 1 to 127.
  21144. </p>
  21145. </dd>
  21146. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  21147. <dd><p>Set which planes to filter. Default value is <code>15</code>, by which all planes are processed.
  21148. </p>
  21149. </dd>
  21150. <dt>&lsquo;<samp>percentile</samp>&rsquo;</dt>
  21151. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  21152. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  21153. minimum values, and <code>1</code> maximum values.
  21154. </p></dd>
  21155. </dl>
  21156. <a name="tmix"></a>
  21157. <h2 class="section"><a href="ffmpeg-filters.html#toc-tmix">11.212 tmix</a></h2>
  21158. <p>Mix successive video frames.
  21159. </p>
  21160. <p>A description of the accepted options follows.
  21161. </p>
  21162. <dl compact="compact">
  21163. <dt>&lsquo;<samp>frames</samp>&rsquo;</dt>
  21164. <dd><p>The number of successive frames to mix. If unspecified, it defaults to 3.
  21165. </p>
  21166. </dd>
  21167. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  21168. <dd><p>Specify weight of each input video frame.
  21169. Each weight is separated by space. If number of weights is smaller than
  21170. number of <var>frames</var> last specified weight will be used for all remaining
  21171. unset weights.
  21172. </p>
  21173. </dd>
  21174. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  21175. <dd><p>Specify scale, if it is set it will be multiplied with sum
  21176. of each weight multiplied with pixel values to give final destination
  21177. pixel value. By default <var>scale</var> is auto scaled to sum of weights.
  21178. </p></dd>
  21179. </dl>
  21180. <a name="Examples-83"></a>
  21181. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-83">11.212.1 Examples</a></h3>
  21182. <ul>
  21183. <li>
  21184. Average 7 successive frames:
  21185. <div class="example">
  21186. <pre class="example">tmix=frames=7:weights=&quot;1 1 1 1 1 1 1&quot;
  21187. </pre></div>
  21188. </li><li>
  21189. Apply simple temporal convolution:
  21190. <div class="example">
  21191. <pre class="example">tmix=frames=3:weights=&quot;-1 3 -1&quot;
  21192. </pre></div>
  21193. </li><li>
  21194. Similar as above but only showing temporal differences:
  21195. <div class="example">
  21196. <pre class="example">tmix=frames=3:weights=&quot;-1 2 -1&quot;:scale=1
  21197. </pre></div>
  21198. </li></ul>
  21199. <p><a name="tonemap"></a>
  21200. </p><a name="tonemap-1"></a>
  21201. <h2 class="section"><a href="ffmpeg-filters.html#toc-tonemap-1">11.213 tonemap</a></h2>
  21202. <p>Tone map colors from different dynamic ranges.
  21203. </p>
  21204. <p>This filter expects data in single precision floating point, as it needs to
  21205. operate on (and can output) out-of-range values. Another filter, such as
  21206. <a href="#zscale">zscale</a>, is needed to convert the resulting frame to a usable format.
  21207. </p>
  21208. <p>The tonemapping algorithms implemented only work on linear light, so input
  21209. data should be linearized beforehand (and possibly correctly tagged).
  21210. </p>
  21211. <div class="example">
  21212. <pre class="example">ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
  21213. </pre></div>
  21214. <a name="Options"></a>
  21215. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Options">11.213.1 Options</a></h3>
  21216. <p>The filter accepts the following options.
  21217. </p>
  21218. <dl compact="compact">
  21219. <dt>&lsquo;<samp>tonemap</samp>&rsquo;</dt>
  21220. <dd><p>Set the tone map algorithm to use.
  21221. </p>
  21222. <p>Possible values are:
  21223. </p><dl compact="compact">
  21224. <dt><var>none</var></dt>
  21225. <dd><p>Do not apply any tone map, only desaturate overbright pixels.
  21226. </p>
  21227. </dd>
  21228. <dt><var>clip</var></dt>
  21229. <dd><p>Hard-clip any out-of-range values. Use it for perfect color accuracy for
  21230. in-range values, while distorting out-of-range values.
  21231. </p>
  21232. </dd>
  21233. <dt><var>linear</var></dt>
  21234. <dd><p>Stretch the entire reference gamut to a linear multiple of the display.
  21235. </p>
  21236. </dd>
  21237. <dt><var>gamma</var></dt>
  21238. <dd><p>Fit a logarithmic transfer between the tone curves.
  21239. </p>
  21240. </dd>
  21241. <dt><var>reinhard</var></dt>
  21242. <dd><p>Preserve overall image brightness with a simple curve, using nonlinear
  21243. contrast, which results in flattening details and degrading color accuracy.
  21244. </p>
  21245. </dd>
  21246. <dt><var>hable</var></dt>
  21247. <dd><p>Preserve both dark and bright details better than <var>reinhard</var>, at the cost
  21248. of slightly darkening everything. Use it when detail preservation is more
  21249. important than color and brightness accuracy.
  21250. </p>
  21251. </dd>
  21252. <dt><var>mobius</var></dt>
  21253. <dd><p>Smoothly map out-of-range values, while retaining contrast and colors for
  21254. in-range material as much as possible. Use it when color accuracy is more
  21255. important than detail preservation.
  21256. </p></dd>
  21257. </dl>
  21258. <p>Default is none.
  21259. </p>
  21260. </dd>
  21261. <dt>&lsquo;<samp>param</samp>&rsquo;</dt>
  21262. <dd><p>Tune the tone mapping algorithm.
  21263. </p>
  21264. <p>This affects the following algorithms:
  21265. </p><dl compact="compact">
  21266. <dt><var>none</var></dt>
  21267. <dd><p>Ignored.
  21268. </p>
  21269. </dd>
  21270. <dt><var>linear</var></dt>
  21271. <dd><p>Specifies the scale factor to use while stretching.
  21272. Default to 1.0.
  21273. </p>
  21274. </dd>
  21275. <dt><var>gamma</var></dt>
  21276. <dd><p>Specifies the exponent of the function.
  21277. Default to 1.8.
  21278. </p>
  21279. </dd>
  21280. <dt><var>clip</var></dt>
  21281. <dd><p>Specify an extra linear coefficient to multiply into the signal before clipping.
  21282. Default to 1.0.
  21283. </p>
  21284. </dd>
  21285. <dt><var>reinhard</var></dt>
  21286. <dd><p>Specify the local contrast coefficient at the display peak.
  21287. Default to 0.5, which means that in-gamut values will be about half as bright
  21288. as when clipping.
  21289. </p>
  21290. </dd>
  21291. <dt><var>hable</var></dt>
  21292. <dd><p>Ignored.
  21293. </p>
  21294. </dd>
  21295. <dt><var>mobius</var></dt>
  21296. <dd><p>Specify the transition point from linear to mobius transform. Every value
  21297. below this point is guaranteed to be mapped 1:1. The higher the value, the
  21298. more accurate the result will be, at the cost of losing bright details.
  21299. Default to 0.3, which due to the steep initial slope still preserves in-range
  21300. colors fairly accurately.
  21301. </p></dd>
  21302. </dl>
  21303. </dd>
  21304. <dt>&lsquo;<samp>desat</samp>&rsquo;</dt>
  21305. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  21306. higher the parameter, the more color information will be preserved. This
  21307. setting helps prevent unnaturally blown-out colors for super-highlights, by
  21308. (smoothly) turning into white instead. This makes images feel more natural,
  21309. at the cost of reducing information about out-of-range colors.
  21310. </p>
  21311. <p>The default of 2.0 is somewhat conservative and will mostly just apply to
  21312. skies or directly sunlit surfaces. A setting of 0.0 disables this option.
  21313. </p>
  21314. <p>This option works only if the input frame has a supported color tag.
  21315. </p>
  21316. </dd>
  21317. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  21318. <dd><p>Override signal/nominal/reference peak with this value. Useful when the
  21319. embedded peak information in display metadata is not reliable or when tone
  21320. mapping from a lower range to a higher range.
  21321. </p></dd>
  21322. </dl>
  21323. <a name="tpad"></a>
  21324. <h2 class="section"><a href="ffmpeg-filters.html#toc-tpad">11.214 tpad</a></h2>
  21325. <p>Temporarily pad video frames.
  21326. </p>
  21327. <p>The filter accepts the following options:
  21328. </p>
  21329. <dl compact="compact">
  21330. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  21331. <dd><p>Specify number of delay frames before input video stream. Default is 0.
  21332. </p>
  21333. </dd>
  21334. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  21335. <dd><p>Specify number of padding frames after input video stream.
  21336. Set to -1 to pad indefinitely. Default is 0.
  21337. </p>
  21338. </dd>
  21339. <dt>&lsquo;<samp>start_mode</samp>&rsquo;</dt>
  21340. <dd><p>Set kind of frames added to beginning of stream.
  21341. Can be either <var>add</var> or <var>clone</var>.
  21342. With <var>add</var> frames of solid-color are added.
  21343. With <var>clone</var> frames are clones of first frame.
  21344. Default is <var>add</var>.
  21345. </p>
  21346. </dd>
  21347. <dt>&lsquo;<samp>stop_mode</samp>&rsquo;</dt>
  21348. <dd><p>Set kind of frames added to end of stream.
  21349. Can be either <var>add</var> or <var>clone</var>.
  21350. With <var>add</var> frames of solid-color are added.
  21351. With <var>clone</var> frames are clones of last frame.
  21352. Default is <var>add</var>.
  21353. </p>
  21354. </dd>
  21355. <dt>&lsquo;<samp>start_duration, stop_duration</samp>&rsquo;</dt>
  21356. <dd><p>Specify the duration of the start/stop delay. See
  21357. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  21358. for the accepted syntax.
  21359. These options override <var>start</var> and <var>stop</var>. Default is 0.
  21360. </p>
  21361. </dd>
  21362. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  21363. <dd><p>Specify the color of the padded area. For the syntax of this option,
  21364. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  21365. </p>
  21366. <p>The default value of <var>color</var> is &quot;black&quot;.
  21367. </p></dd>
  21368. </dl>
  21369. <p><a name="transpose"></a>
  21370. </p><a name="transpose-1"></a>
  21371. <h2 class="section"><a href="ffmpeg-filters.html#toc-transpose-1">11.215 transpose</a></h2>
  21372. <p>Transpose rows with columns in the input video and optionally flip it.
  21373. </p>
  21374. <p>It accepts the following parameters:
  21375. </p>
  21376. <dl compact="compact">
  21377. <dt>&lsquo;<samp>dir</samp>&rsquo;</dt>
  21378. <dd><p>Specify the transposition direction.
  21379. </p>
  21380. <p>Can assume the following values:
  21381. </p><dl compact="compact">
  21382. <dt>&lsquo;<samp>0, 4, cclock_flip</samp>&rsquo;</dt>
  21383. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
  21384. </p><div class="example">
  21385. <pre class="example">L.R L.l
  21386. . . -&gt; . .
  21387. l.r R.r
  21388. </pre></div>
  21389. </dd>
  21390. <dt>&lsquo;<samp>1, 5, clock</samp>&rsquo;</dt>
  21391. <dd><p>Rotate by 90 degrees clockwise, that is:
  21392. </p><div class="example">
  21393. <pre class="example">L.R l.L
  21394. . . -&gt; . .
  21395. l.r r.R
  21396. </pre></div>
  21397. </dd>
  21398. <dt>&lsquo;<samp>2, 6, cclock</samp>&rsquo;</dt>
  21399. <dd><p>Rotate by 90 degrees counterclockwise, that is:
  21400. </p><div class="example">
  21401. <pre class="example">L.R R.r
  21402. . . -&gt; . .
  21403. l.r L.l
  21404. </pre></div>
  21405. </dd>
  21406. <dt>&lsquo;<samp>3, 7, clock_flip</samp>&rsquo;</dt>
  21407. <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
  21408. </p><div class="example">
  21409. <pre class="example">L.R r.R
  21410. . . -&gt; . .
  21411. l.r l.L
  21412. </pre></div>
  21413. </dd>
  21414. </dl>
  21415. <p>For values between 4-7, the transposition is only done if the input
  21416. video geometry is portrait and not landscape. These values are
  21417. deprecated, the <code>passthrough</code> option should be used instead.
  21418. </p>
  21419. <p>Numerical values are deprecated, and should be dropped in favor of
  21420. symbolic constants.
  21421. </p>
  21422. </dd>
  21423. <dt>&lsquo;<samp>passthrough</samp>&rsquo;</dt>
  21424. <dd><p>Do not apply the transposition if the input geometry matches the one
  21425. specified by the specified value. It accepts the following values:
  21426. </p><dl compact="compact">
  21427. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  21428. <dd><p>Always apply transposition.
  21429. </p></dd>
  21430. <dt>&lsquo;<samp>portrait</samp>&rsquo;</dt>
  21431. <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
  21432. </p></dd>
  21433. <dt>&lsquo;<samp>landscape</samp>&rsquo;</dt>
  21434. <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
  21435. </p></dd>
  21436. </dl>
  21437. <p>Default value is <code>none</code>.
  21438. </p></dd>
  21439. </dl>
  21440. <p>For example to rotate by 90 degrees clockwise and preserve portrait
  21441. layout:
  21442. </p><div class="example">
  21443. <pre class="example">transpose=dir=1:passthrough=portrait
  21444. </pre></div>
  21445. <p>The command above can also be specified as:
  21446. </p><div class="example">
  21447. <pre class="example">transpose=1:portrait
  21448. </pre></div>
  21449. <a name="transpose_005fnpp"></a>
  21450. <h2 class="section"><a href="ffmpeg-filters.html#toc-transpose_005fnpp">11.216 transpose_npp</a></h2>
  21451. <p>Transpose rows with columns in the input video and optionally flip it.
  21452. For more in depth examples see the <a href="#transpose">transpose</a> video filter, which shares mostly the same options.
  21453. </p>
  21454. <p>It accepts the following parameters:
  21455. </p>
  21456. <dl compact="compact">
  21457. <dt>&lsquo;<samp>dir</samp>&rsquo;</dt>
  21458. <dd><p>Specify the transposition direction.
  21459. </p>
  21460. <p>Can assume the following values:
  21461. </p><dl compact="compact">
  21462. <dt>&lsquo;<samp>cclock_flip</samp>&rsquo;</dt>
  21463. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  21464. </p>
  21465. </dd>
  21466. <dt>&lsquo;<samp>clock</samp>&rsquo;</dt>
  21467. <dd><p>Rotate by 90 degrees clockwise.
  21468. </p>
  21469. </dd>
  21470. <dt>&lsquo;<samp>cclock</samp>&rsquo;</dt>
  21471. <dd><p>Rotate by 90 degrees counterclockwise.
  21472. </p>
  21473. </dd>
  21474. <dt>&lsquo;<samp>clock_flip</samp>&rsquo;</dt>
  21475. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  21476. </p></dd>
  21477. </dl>
  21478. </dd>
  21479. <dt>&lsquo;<samp>passthrough</samp>&rsquo;</dt>
  21480. <dd><p>Do not apply the transposition if the input geometry matches the one
  21481. specified by the specified value. It accepts the following values:
  21482. </p><dl compact="compact">
  21483. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  21484. <dd><p>Always apply transposition. (default)
  21485. </p></dd>
  21486. <dt>&lsquo;<samp>portrait</samp>&rsquo;</dt>
  21487. <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
  21488. </p></dd>
  21489. <dt>&lsquo;<samp>landscape</samp>&rsquo;</dt>
  21490. <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
  21491. </p></dd>
  21492. </dl>
  21493. </dd>
  21494. </dl>
  21495. <a name="trim"></a>
  21496. <h2 class="section"><a href="ffmpeg-filters.html#toc-trim">11.217 trim</a></h2>
  21497. <p>Trim the input so that the output contains one continuous subpart of the input.
  21498. </p>
  21499. <p>It accepts the following parameters:
  21500. </p><dl compact="compact">
  21501. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  21502. <dd><p>Specify the time of the start of the kept section, i.e. the frame with the
  21503. timestamp <var>start</var> will be the first frame in the output.
  21504. </p>
  21505. </dd>
  21506. <dt>&lsquo;<samp>end</samp>&rsquo;</dt>
  21507. <dd><p>Specify the time of the first frame that will be dropped, i.e. the frame
  21508. immediately preceding the one with the timestamp <var>end</var> will be the last
  21509. frame in the output.
  21510. </p>
  21511. </dd>
  21512. <dt>&lsquo;<samp>start_pts</samp>&rsquo;</dt>
  21513. <dd><p>This is the same as <var>start</var>, except this option sets the start timestamp
  21514. in timebase units instead of seconds.
  21515. </p>
  21516. </dd>
  21517. <dt>&lsquo;<samp>end_pts</samp>&rsquo;</dt>
  21518. <dd><p>This is the same as <var>end</var>, except this option sets the end timestamp
  21519. in timebase units instead of seconds.
  21520. </p>
  21521. </dd>
  21522. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  21523. <dd><p>The maximum duration of the output in seconds.
  21524. </p>
  21525. </dd>
  21526. <dt>&lsquo;<samp>start_frame</samp>&rsquo;</dt>
  21527. <dd><p>The number of the first frame that should be passed to the output.
  21528. </p>
  21529. </dd>
  21530. <dt>&lsquo;<samp>end_frame</samp>&rsquo;</dt>
  21531. <dd><p>The number of the first frame that should be dropped.
  21532. </p></dd>
  21533. </dl>
  21534. <p>&lsquo;<samp>start</samp>&rsquo;, &lsquo;<samp>end</samp>&rsquo;, and &lsquo;<samp>duration</samp>&rsquo; are expressed as time
  21535. duration specifications; see
  21536. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  21537. for the accepted syntax.
  21538. </p>
  21539. <p>Note that the first two sets of the start/end options and the &lsquo;<samp>duration</samp>&rsquo;
  21540. option look at the frame timestamp, while the _frame variants simply count the
  21541. frames that pass through the filter. Also note that this filter does not modify
  21542. the timestamps. If you wish for the output timestamps to start at zero, insert a
  21543. setpts filter after the trim filter.
  21544. </p>
  21545. <p>If multiple start or end options are set, this filter tries to be greedy and
  21546. keep all the frames that match at least one of the specified constraints. To keep
  21547. only the part that matches all the constraints at once, chain multiple trim
  21548. filters.
  21549. </p>
  21550. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  21551. just the end values to keep everything before the specified time.
  21552. </p>
  21553. <p>Examples:
  21554. </p><ul>
  21555. <li>
  21556. Drop everything except the second minute of input:
  21557. <div class="example">
  21558. <pre class="example">ffmpeg -i INPUT -vf trim=60:120
  21559. </pre></div>
  21560. </li><li>
  21561. Keep only the first second:
  21562. <div class="example">
  21563. <pre class="example">ffmpeg -i INPUT -vf trim=duration=1
  21564. </pre></div>
  21565. </li></ul>
  21566. <a name="unpremultiply"></a>
  21567. <h2 class="section"><a href="ffmpeg-filters.html#toc-unpremultiply">11.218 unpremultiply</a></h2>
  21568. <p>Apply alpha unpremultiply effect to input video stream using first plane
  21569. of second stream as alpha.
  21570. </p>
  21571. <p>Both streams must have same dimensions and same pixel format.
  21572. </p>
  21573. <p>The filter accepts the following option:
  21574. </p>
  21575. <dl compact="compact">
  21576. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  21577. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  21578. By default value 0xf, all planes will be processed.
  21579. </p>
  21580. <p>If the format has 1 or 2 components, then luma is bit 0.
  21581. If the format has 3 or 4 components:
  21582. for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red;
  21583. for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V.
  21584. If present, the alpha channel is always the last bit.
  21585. </p>
  21586. </dd>
  21587. <dt>&lsquo;<samp>inplace</samp>&rsquo;</dt>
  21588. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  21589. </p></dd>
  21590. </dl>
  21591. <p><a name="unsharp"></a>
  21592. </p><a name="unsharp-1"></a>
  21593. <h2 class="section"><a href="ffmpeg-filters.html#toc-unsharp-1">11.219 unsharp</a></h2>
  21594. <p>Sharpen or blur the input video.
  21595. </p>
  21596. <p>It accepts the following parameters:
  21597. </p>
  21598. <dl compact="compact">
  21599. <dt>&lsquo;<samp>luma_msize_x, lx</samp>&rsquo;</dt>
  21600. <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
  21601. 3 and 23. The default value is 5.
  21602. </p>
  21603. </dd>
  21604. <dt>&lsquo;<samp>luma_msize_y, ly</samp>&rsquo;</dt>
  21605. <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
  21606. and 23. The default value is 5.
  21607. </p>
  21608. </dd>
  21609. <dt>&lsquo;<samp>luma_amount, la</samp>&rsquo;</dt>
  21610. <dd><p>Set the luma effect strength. It must be a floating point number, reasonable
  21611. values lay between -1.5 and 1.5.
  21612. </p>
  21613. <p>Negative values will blur the input video, while positive values will
  21614. sharpen it, a value of zero will disable the effect.
  21615. </p>
  21616. <p>Default value is 1.0.
  21617. </p>
  21618. </dd>
  21619. <dt>&lsquo;<samp>chroma_msize_x, cx</samp>&rsquo;</dt>
  21620. <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
  21621. between 3 and 23. The default value is 5.
  21622. </p>
  21623. </dd>
  21624. <dt>&lsquo;<samp>chroma_msize_y, cy</samp>&rsquo;</dt>
  21625. <dd><p>Set the chroma matrix vertical size. It must be an odd integer
  21626. between 3 and 23. The default value is 5.
  21627. </p>
  21628. </dd>
  21629. <dt>&lsquo;<samp>chroma_amount, ca</samp>&rsquo;</dt>
  21630. <dd><p>Set the chroma effect strength. It must be a floating point number, reasonable
  21631. values lay between -1.5 and 1.5.
  21632. </p>
  21633. <p>Negative values will blur the input video, while positive values will
  21634. sharpen it, a value of zero will disable the effect.
  21635. </p>
  21636. <p>Default value is 0.0.
  21637. </p>
  21638. </dd>
  21639. </dl>
  21640. <p>All parameters are optional and default to the equivalent of the
  21641. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  21642. </p>
  21643. <a name="Examples-126"></a>
  21644. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-126">11.219.1 Examples</a></h3>
  21645. <ul>
  21646. <li>
  21647. Apply strong luma sharpen effect:
  21648. <div class="example">
  21649. <pre class="example">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
  21650. </pre></div>
  21651. </li><li>
  21652. Apply a strong blur of both luma and chroma parameters:
  21653. <div class="example">
  21654. <pre class="example">unsharp=7:7:-2:7:7:-2
  21655. </pre></div>
  21656. </li></ul>
  21657. <p><a name="untile"></a>
  21658. </p><a name="untile-1"></a>
  21659. <h2 class="section"><a href="ffmpeg-filters.html#toc-untile-1">11.220 untile</a></h2>
  21660. <p>Decompose a video made of tiled images into the individual images.
  21661. </p>
  21662. <p>The frame rate of the output video is the frame rate of the input video
  21663. multiplied by the number of tiles.
  21664. </p>
  21665. <p>This filter does the reverse of <a href="#tile">tile</a>.
  21666. </p>
  21667. <p>The filter accepts the following options:
  21668. </p>
  21669. <dl compact="compact">
  21670. <dt>&lsquo;<samp>layout</samp>&rsquo;</dt>
  21671. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  21672. this option, check the
  21673. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  21674. </p></dd>
  21675. </dl>
  21676. <a name="Examples-112"></a>
  21677. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-112">11.220.1 Examples</a></h3>
  21678. <ul>
  21679. <li>
  21680. Produce a 1-second video from a still image file made of 25 frames stacked
  21681. vertically, like an analogic film reel:
  21682. <div class="example">
  21683. <pre class="example">ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
  21684. </pre></div>
  21685. </li></ul>
  21686. <a name="uspp"></a>
  21687. <h2 class="section"><a href="ffmpeg-filters.html#toc-uspp">11.221 uspp</a></h2>
  21688. <p>Apply ultra slow/simple postprocessing filter that compresses and decompresses
  21689. the image at several (or - in the case of &lsquo;<samp>quality</samp>&rsquo; level <code>8</code> - all)
  21690. shifts and average the results.
  21691. </p>
  21692. <p>The way this differs from the behavior of spp is that uspp actually encodes &amp;
  21693. decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8
  21694. DCT similar to MJPEG.
  21695. </p>
  21696. <p>The filter accepts the following options:
  21697. </p>
  21698. <dl compact="compact">
  21699. <dt>&lsquo;<samp>quality</samp>&rsquo;</dt>
  21700. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  21701. an integer in the range 0-8. If set to <code>0</code>, the filter will have no
  21702. effect. A value of <code>8</code> means the higher quality. For each increment of
  21703. that value the speed drops by a factor of approximately 2. Default value is
  21704. <code>3</code>.
  21705. </p>
  21706. </dd>
  21707. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  21708. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  21709. from the video stream (if available).
  21710. </p></dd>
  21711. </dl>
  21712. <a name="v360"></a>
  21713. <h2 class="section"><a href="ffmpeg-filters.html#toc-v360">11.222 v360</a></h2>
  21714. <p>Convert 360 videos between various formats.
  21715. </p>
  21716. <p>The filter accepts the following options:
  21717. </p>
  21718. <dl compact="compact">
  21719. <dt>&lsquo;<samp>input</samp>&rsquo;</dt>
  21720. <dt>&lsquo;<samp>output</samp>&rsquo;</dt>
  21721. <dd><p>Set format of the input/output video.
  21722. </p>
  21723. <p>Available formats:
  21724. </p>
  21725. <dl compact="compact">
  21726. <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
  21727. <dt>&lsquo;<samp>equirect</samp>&rsquo;</dt>
  21728. <dd><p>Equirectangular projection.
  21729. </p>
  21730. </dd>
  21731. <dt>&lsquo;<samp>c3x2</samp>&rsquo;</dt>
  21732. <dt>&lsquo;<samp>c6x1</samp>&rsquo;</dt>
  21733. <dt>&lsquo;<samp>c1x6</samp>&rsquo;</dt>
  21734. <dd><p>Cubemap with 3x2/6x1/1x6 layout.
  21735. </p>
  21736. <p>Format specific options:
  21737. </p>
  21738. <dl compact="compact">
  21739. <dt>&lsquo;<samp>in_pad</samp>&rsquo;</dt>
  21740. <dt>&lsquo;<samp>out_pad</samp>&rsquo;</dt>
  21741. <dd><p>Set padding proportion for the input/output cubemap. Values in decimals.
  21742. </p>
  21743. <p>Example values:
  21744. </p><dl compact="compact">
  21745. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  21746. <dd><p>No padding.
  21747. </p></dd>
  21748. <dt>&lsquo;<samp>0.01</samp>&rsquo;</dt>
  21749. <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)
  21750. </p></dd>
  21751. </dl>
  21752. <p>Default value is <b>&lsquo;<samp>0</samp>&rsquo;</b>.
  21753. Maximum value is <b>&lsquo;<samp>0.1</samp>&rsquo;</b>.
  21754. </p>
  21755. </dd>
  21756. <dt>&lsquo;<samp>fin_pad</samp>&rsquo;</dt>
  21757. <dt>&lsquo;<samp>fout_pad</samp>&rsquo;</dt>
  21758. <dd><p>Set fixed padding for the input/output cubemap. Values in pixels.
  21759. </p>
  21760. <p>Default value is <b>&lsquo;<samp>0</samp>&rsquo;</b>. If greater than zero it overrides other padding options.
  21761. </p>
  21762. </dd>
  21763. <dt>&lsquo;<samp>in_forder</samp>&rsquo;</dt>
  21764. <dt>&lsquo;<samp>out_forder</samp>&rsquo;</dt>
  21765. <dd><p>Set order of faces for the input/output cubemap. Choose one direction for each position.
  21766. </p>
  21767. <p>Designation of directions:
  21768. </p><dl compact="compact">
  21769. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  21770. <dd><p>right
  21771. </p></dd>
  21772. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  21773. <dd><p>left
  21774. </p></dd>
  21775. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  21776. <dd><p>up
  21777. </p></dd>
  21778. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  21779. <dd><p>down
  21780. </p></dd>
  21781. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  21782. <dd><p>forward
  21783. </p></dd>
  21784. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  21785. <dd><p>back
  21786. </p></dd>
  21787. </dl>
  21788. <p>Default value is <b>&lsquo;<samp>rludfb</samp>&rsquo;</b>.
  21789. </p>
  21790. </dd>
  21791. <dt>&lsquo;<samp>in_frot</samp>&rsquo;</dt>
  21792. <dt>&lsquo;<samp>out_frot</samp>&rsquo;</dt>
  21793. <dd><p>Set rotation of faces for the input/output cubemap. Choose one angle for each position.
  21794. </p>
  21795. <p>Designation of angles:
  21796. </p><dl compact="compact">
  21797. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  21798. <dd><p>0 degrees clockwise
  21799. </p></dd>
  21800. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  21801. <dd><p>90 degrees clockwise
  21802. </p></dd>
  21803. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  21804. <dd><p>180 degrees clockwise
  21805. </p></dd>
  21806. <dt>&lsquo;<samp>3</samp>&rsquo;</dt>
  21807. <dd><p>270 degrees clockwise
  21808. </p></dd>
  21809. </dl>
  21810. <p>Default value is <b>&lsquo;<samp>000000</samp>&rsquo;</b>.
  21811. </p></dd>
  21812. </dl>
  21813. </dd>
  21814. <dt>&lsquo;<samp>eac</samp>&rsquo;</dt>
  21815. <dd><p>Equi-Angular Cubemap.
  21816. </p>
  21817. </dd>
  21818. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  21819. <dt>&lsquo;<samp>gnomonic</samp>&rsquo;</dt>
  21820. <dt>&lsquo;<samp>rectilinear</samp>&rsquo;</dt>
  21821. <dd><p>Regular video.
  21822. </p>
  21823. <p>Format specific options:
  21824. </p><dl compact="compact">
  21825. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  21826. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  21827. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  21828. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  21829. </p>
  21830. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  21831. </p>
  21832. </dd>
  21833. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  21834. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  21835. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  21836. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  21837. </p>
  21838. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  21839. </p></dd>
  21840. </dl>
  21841. </dd>
  21842. <dt>&lsquo;<samp>dfisheye</samp>&rsquo;</dt>
  21843. <dd><p>Dual fisheye.
  21844. </p>
  21845. <p>Format specific options:
  21846. </p><dl compact="compact">
  21847. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  21848. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  21849. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  21850. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  21851. </p>
  21852. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  21853. </p>
  21854. </dd>
  21855. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  21856. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  21857. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  21858. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  21859. </p>
  21860. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  21861. </p></dd>
  21862. </dl>
  21863. </dd>
  21864. <dt>&lsquo;<samp>barrel</samp>&rsquo;</dt>
  21865. <dt>&lsquo;<samp>fb</samp>&rsquo;</dt>
  21866. <dt>&lsquo;<samp>barrelsplit</samp>&rsquo;</dt>
  21867. <dd><p>Facebook&rsquo;s 360 formats.
  21868. </p>
  21869. </dd>
  21870. <dt>&lsquo;<samp>sg</samp>&rsquo;</dt>
  21871. <dd><p>Stereographic format.
  21872. </p>
  21873. <p>Format specific options:
  21874. </p><dl compact="compact">
  21875. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  21876. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  21877. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  21878. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  21879. </p>
  21880. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  21881. </p>
  21882. </dd>
  21883. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  21884. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  21885. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  21886. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  21887. </p>
  21888. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  21889. </p></dd>
  21890. </dl>
  21891. </dd>
  21892. <dt>&lsquo;<samp>mercator</samp>&rsquo;</dt>
  21893. <dd><p>Mercator format.
  21894. </p>
  21895. </dd>
  21896. <dt>&lsquo;<samp>ball</samp>&rsquo;</dt>
  21897. <dd><p>Ball format, gives significant distortion toward the back.
  21898. </p>
  21899. </dd>
  21900. <dt>&lsquo;<samp>hammer</samp>&rsquo;</dt>
  21901. <dd><p>Hammer-Aitoff map projection format.
  21902. </p>
  21903. </dd>
  21904. <dt>&lsquo;<samp>sinusoidal</samp>&rsquo;</dt>
  21905. <dd><p>Sinusoidal map projection format.
  21906. </p>
  21907. </dd>
  21908. <dt>&lsquo;<samp>fisheye</samp>&rsquo;</dt>
  21909. <dd><p>Fisheye projection.
  21910. </p>
  21911. <p>Format specific options:
  21912. </p><dl compact="compact">
  21913. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  21914. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  21915. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  21916. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  21917. </p>
  21918. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  21919. </p>
  21920. </dd>
  21921. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  21922. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  21923. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  21924. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  21925. </p>
  21926. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  21927. </p></dd>
  21928. </dl>
  21929. </dd>
  21930. <dt>&lsquo;<samp>pannini</samp>&rsquo;</dt>
  21931. <dd><p>Pannini projection.
  21932. </p>
  21933. <p>Format specific options:
  21934. </p><dl compact="compact">
  21935. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  21936. <dd><p>Set output pannini parameter.
  21937. </p>
  21938. </dd>
  21939. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  21940. <dd><p>Set input pannini parameter.
  21941. </p></dd>
  21942. </dl>
  21943. </dd>
  21944. <dt>&lsquo;<samp>cylindrical</samp>&rsquo;</dt>
  21945. <dd><p>Cylindrical projection.
  21946. </p>
  21947. <p>Format specific options:
  21948. </p><dl compact="compact">
  21949. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  21950. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  21951. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  21952. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  21953. </p>
  21954. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  21955. </p>
  21956. </dd>
  21957. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  21958. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  21959. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  21960. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  21961. </p>
  21962. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  21963. </p></dd>
  21964. </dl>
  21965. </dd>
  21966. <dt>&lsquo;<samp>perspective</samp>&rsquo;</dt>
  21967. <dd><p>Perspective projection. <i>(output only)</i>
  21968. </p>
  21969. <p>Format specific options:
  21970. </p><dl compact="compact">
  21971. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  21972. <dd><p>Set perspective parameter.
  21973. </p></dd>
  21974. </dl>
  21975. </dd>
  21976. <dt>&lsquo;<samp>tetrahedron</samp>&rsquo;</dt>
  21977. <dd><p>Tetrahedron projection.
  21978. </p>
  21979. </dd>
  21980. <dt>&lsquo;<samp>tsp</samp>&rsquo;</dt>
  21981. <dd><p>Truncated square pyramid projection.
  21982. </p>
  21983. </dd>
  21984. <dt>&lsquo;<samp>he</samp>&rsquo;</dt>
  21985. <dt>&lsquo;<samp>hequirect</samp>&rsquo;</dt>
  21986. <dd><p>Half equirectangular projection.
  21987. </p></dd>
  21988. </dl>
  21989. </dd>
  21990. <dt>&lsquo;<samp>interp</samp>&rsquo;</dt>
  21991. <dd><p>Set interpolation method.<br>
  21992. <i>Note: more complex interpolation methods require much more memory to run.</i>
  21993. </p>
  21994. <p>Available methods:
  21995. </p>
  21996. <dl compact="compact">
  21997. <dt>&lsquo;<samp>near</samp>&rsquo;</dt>
  21998. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  21999. <dd><p>Nearest neighbour.
  22000. </p></dd>
  22001. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  22002. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  22003. <dd><p>Bilinear interpolation.
  22004. </p></dd>
  22005. <dt>&lsquo;<samp>lagrange9</samp>&rsquo;</dt>
  22006. <dd><p>Lagrange9 interpolation.
  22007. </p></dd>
  22008. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  22009. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  22010. <dd><p>Bicubic interpolation.
  22011. </p></dd>
  22012. <dt>&lsquo;<samp>lanc</samp>&rsquo;</dt>
  22013. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  22014. <dd><p>Lanczos interpolation.
  22015. </p></dd>
  22016. <dt>&lsquo;<samp>sp16</samp>&rsquo;</dt>
  22017. <dt>&lsquo;<samp>spline16</samp>&rsquo;</dt>
  22018. <dd><p>Spline16 interpolation.
  22019. </p></dd>
  22020. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  22021. <dt>&lsquo;<samp>gaussian</samp>&rsquo;</dt>
  22022. <dd><p>Gaussian interpolation.
  22023. </p></dd>
  22024. </dl>
  22025. <p>Default value is <b>&lsquo;<samp>line</samp>&rsquo;</b>.
  22026. </p>
  22027. </dd>
  22028. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  22029. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  22030. <dd><p>Set the output video resolution.
  22031. </p>
  22032. <p>Default resolution depends on formats.
  22033. </p>
  22034. </dd>
  22035. <dt>&lsquo;<samp>in_stereo</samp>&rsquo;</dt>
  22036. <dt>&lsquo;<samp>out_stereo</samp>&rsquo;</dt>
  22037. <dd><p>Set the input/output stereo format.
  22038. </p>
  22039. <dl compact="compact">
  22040. <dt>&lsquo;<samp>2d</samp>&rsquo;</dt>
  22041. <dd><p>2D mono
  22042. </p></dd>
  22043. <dt>&lsquo;<samp>sbs</samp>&rsquo;</dt>
  22044. <dd><p>Side by side
  22045. </p></dd>
  22046. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  22047. <dd><p>Top bottom
  22048. </p></dd>
  22049. </dl>
  22050. <p>Default value is <b>&lsquo;<samp>2d</samp>&rsquo;</b> for input and output format.
  22051. </p>
  22052. </dd>
  22053. <dt>&lsquo;<samp>yaw</samp>&rsquo;</dt>
  22054. <dt>&lsquo;<samp>pitch</samp>&rsquo;</dt>
  22055. <dt>&lsquo;<samp>roll</samp>&rsquo;</dt>
  22056. <dd><p>Set rotation for the output video. Values in degrees.
  22057. </p>
  22058. </dd>
  22059. <dt>&lsquo;<samp>rorder</samp>&rsquo;</dt>
  22060. <dd><p>Set rotation order for the output video. Choose one item for each position.
  22061. </p>
  22062. <dl compact="compact">
  22063. <dt>&lsquo;<samp>y, Y</samp>&rsquo;</dt>
  22064. <dd><p>yaw
  22065. </p></dd>
  22066. <dt>&lsquo;<samp>p, P</samp>&rsquo;</dt>
  22067. <dd><p>pitch
  22068. </p></dd>
  22069. <dt>&lsquo;<samp>r, R</samp>&rsquo;</dt>
  22070. <dd><p>roll
  22071. </p></dd>
  22072. </dl>
  22073. <p>Default value is <b>&lsquo;<samp>ypr</samp>&rsquo;</b>.
  22074. </p>
  22075. </dd>
  22076. <dt>&lsquo;<samp>h_flip</samp>&rsquo;</dt>
  22077. <dt>&lsquo;<samp>v_flip</samp>&rsquo;</dt>
  22078. <dt>&lsquo;<samp>d_flip</samp>&rsquo;</dt>
  22079. <dd><p>Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values.
  22080. </p>
  22081. </dd>
  22082. <dt>&lsquo;<samp>ih_flip</samp>&rsquo;</dt>
  22083. <dt>&lsquo;<samp>iv_flip</samp>&rsquo;</dt>
  22084. <dd><p>Set if input video is flipped horizontally/vertically. Boolean values.
  22085. </p>
  22086. </dd>
  22087. <dt>&lsquo;<samp>in_trans</samp>&rsquo;</dt>
  22088. <dd><p>Set if input video is transposed. Boolean value, by default disabled.
  22089. </p>
  22090. </dd>
  22091. <dt>&lsquo;<samp>out_trans</samp>&rsquo;</dt>
  22092. <dd><p>Set if output video needs to be transposed. Boolean value, by default disabled.
  22093. </p>
  22094. </dd>
  22095. <dt>&lsquo;<samp>alpha_mask</samp>&rsquo;</dt>
  22096. <dd><p>Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled.
  22097. </p></dd>
  22098. </dl>
  22099. <a name="Examples-8"></a>
  22100. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-8">11.222.1 Examples</a></h3>
  22101. <ul>
  22102. <li>
  22103. Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation:
  22104. <div class="example">
  22105. <pre class="example">ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
  22106. </pre></div>
  22107. </li><li>
  22108. Extract back view of Equi-Angular Cubemap:
  22109. <div class="example">
  22110. <pre class="example">ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
  22111. </pre></div>
  22112. </li><li>
  22113. Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format:
  22114. <div class="example">
  22115. <pre class="example">v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
  22116. </pre></div>
  22117. </li></ul>
  22118. <a name="Commands-34"></a>
  22119. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-34">11.222.2 Commands</a></h3>
  22120. <p>This filter supports subset of above options as <a href="#commands">commands</a>.
  22121. </p>
  22122. <a name="vaguedenoiser"></a>
  22123. <h2 class="section"><a href="ffmpeg-filters.html#toc-vaguedenoiser">11.223 vaguedenoiser</a></h2>
  22124. <p>Apply a wavelet based denoiser.
  22125. </p>
  22126. <p>It transforms each frame from the video input into the wavelet domain,
  22127. using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to
  22128. the obtained coefficients. It does an inverse wavelet transform after.
  22129. Due to wavelet properties, it should give a nice smoothed result, and
  22130. reduced noise, without blurring picture features.
  22131. </p>
  22132. <p>This filter accepts the following options:
  22133. </p>
  22134. <dl compact="compact">
  22135. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  22136. <dd><p>The filtering strength. The higher, the more filtered the video will be.
  22137. Hard thresholding can use a higher threshold than soft thresholding
  22138. before the video looks overfiltered. Default value is 2.
  22139. </p>
  22140. </dd>
  22141. <dt>&lsquo;<samp>method</samp>&rsquo;</dt>
  22142. <dd><p>The filtering method the filter will use.
  22143. </p>
  22144. <p>It accepts the following values:
  22145. </p><dl compact="compact">
  22146. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  22147. <dd><p>All values under the threshold will be zeroed.
  22148. </p>
  22149. </dd>
  22150. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  22151. <dd><p>All values under the threshold will be zeroed. All values above will be
  22152. reduced by the threshold.
  22153. </p>
  22154. </dd>
  22155. <dt>&lsquo;<samp>garrote</samp>&rsquo;</dt>
  22156. <dd><p>Scales or nullifies coefficients - intermediary between (more) soft and
  22157. (less) hard thresholding.
  22158. </p></dd>
  22159. </dl>
  22160. <p>Default is garrote.
  22161. </p>
  22162. </dd>
  22163. <dt>&lsquo;<samp>nsteps</samp>&rsquo;</dt>
  22164. <dd><p>Number of times, the wavelet will decompose the picture. Picture can&rsquo;t
  22165. be decomposed beyond a particular point (typically, 8 for a 640x480
  22166. frame - as 2^9 = 512 &gt; 480). Valid values are integers between 1 and 32. Default value is 6.
  22167. </p>
  22168. </dd>
  22169. <dt>&lsquo;<samp>percent</samp>&rsquo;</dt>
  22170. <dd><p>Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85.
  22171. </p>
  22172. </dd>
  22173. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  22174. <dd><p>A list of the planes to process. By default all planes are processed.
  22175. </p>
  22176. </dd>
  22177. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  22178. <dd><p>The threshold type the filter will use.
  22179. </p>
  22180. <p>It accepts the following values:
  22181. </p><dl compact="compact">
  22182. <dt>&lsquo;<samp>universal</samp>&rsquo;</dt>
  22183. <dd><p>Threshold used is same for all decompositions.
  22184. </p>
  22185. </dd>
  22186. <dt>&lsquo;<samp>bayes</samp>&rsquo;</dt>
  22187. <dd><p>Threshold used depends also on each decomposition coefficients.
  22188. </p></dd>
  22189. </dl>
  22190. <p>Default is universal.
  22191. </p></dd>
  22192. </dl>
  22193. <a name="vectorscope"></a>
  22194. <h2 class="section"><a href="ffmpeg-filters.html#toc-vectorscope">11.224 vectorscope</a></h2>
  22195. <p>Display 2 color component values in the two dimensional graph (which is called
  22196. a vectorscope).
  22197. </p>
  22198. <p>This filter accepts the following options:
  22199. </p>
  22200. <dl compact="compact">
  22201. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  22202. <dd><p>Set vectorscope mode.
  22203. </p>
  22204. <p>It accepts the following values:
  22205. </p><dl compact="compact">
  22206. <dt>&lsquo;<samp>gray</samp>&rsquo;</dt>
  22207. <dt>&lsquo;<samp>tint</samp>&rsquo;</dt>
  22208. <dd><p>Gray values are displayed on graph, higher brightness means more pixels have
  22209. same component color value on location in graph. This is the default mode.
  22210. </p>
  22211. </dd>
  22212. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  22213. <dd><p>Gray values are displayed on graph. Surrounding pixels values which are not
  22214. present in video frame are drawn in gradient of 2 color components which are
  22215. set by option <code>x</code> and <code>y</code>. The 3rd color component is static.
  22216. </p>
  22217. </dd>
  22218. <dt>&lsquo;<samp>color2</samp>&rsquo;</dt>
  22219. <dd><p>Actual color components values present in video frame are displayed on graph.
  22220. </p>
  22221. </dd>
  22222. <dt>&lsquo;<samp>color3</samp>&rsquo;</dt>
  22223. <dd><p>Similar as color2 but higher frequency of same values <code>x</code> and <code>y</code>
  22224. on graph increases value of another color component, which is luminance by
  22225. default values of <code>x</code> and <code>y</code>.
  22226. </p>
  22227. </dd>
  22228. <dt>&lsquo;<samp>color4</samp>&rsquo;</dt>
  22229. <dd><p>Actual colors present in video frame are displayed on graph. If two different
  22230. colors map to same position on graph then color with higher value of component
  22231. not present in graph is picked.
  22232. </p>
  22233. </dd>
  22234. <dt>&lsquo;<samp>color5</samp>&rsquo;</dt>
  22235. <dd><p>Gray values are displayed on graph. Similar to <code>color</code> but with 3rd color
  22236. component picked from radial gradient.
  22237. </p></dd>
  22238. </dl>
  22239. </dd>
  22240. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  22241. <dd><p>Set which color component will be represented on X-axis. Default is <code>1</code>.
  22242. </p>
  22243. </dd>
  22244. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  22245. <dd><p>Set which color component will be represented on Y-axis. Default is <code>2</code>.
  22246. </p>
  22247. </dd>
  22248. <dt>&lsquo;<samp>intensity, i</samp>&rsquo;</dt>
  22249. <dd><p>Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness
  22250. of color component which represents frequency of (X, Y) location in graph.
  22251. </p>
  22252. </dd>
  22253. <dt>&lsquo;<samp>envelope, e</samp>&rsquo;</dt>
  22254. <dd><dl compact="compact">
  22255. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  22256. <dd><p>No envelope, this is default.
  22257. </p>
  22258. </dd>
  22259. <dt>&lsquo;<samp>instant</samp>&rsquo;</dt>
  22260. <dd><p>Instant envelope, even darkest single pixel will be clearly highlighted.
  22261. </p>
  22262. </dd>
  22263. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  22264. <dd><p>Hold maximum and minimum values presented in graph over time. This way you
  22265. can still spot out of range values without constantly looking at vectorscope.
  22266. </p>
  22267. </dd>
  22268. <dt>&lsquo;<samp>peak+instant</samp>&rsquo;</dt>
  22269. <dd><p>Peak and instant envelope combined together.
  22270. </p></dd>
  22271. </dl>
  22272. </dd>
  22273. <dt>&lsquo;<samp>graticule, g</samp>&rsquo;</dt>
  22274. <dd><p>Set what kind of graticule to draw.
  22275. </p><dl compact="compact">
  22276. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  22277. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  22278. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  22279. <dt>&lsquo;<samp>invert</samp>&rsquo;</dt>
  22280. </dl>
  22281. </dd>
  22282. <dt>&lsquo;<samp>opacity, o</samp>&rsquo;</dt>
  22283. <dd><p>Set graticule opacity.
  22284. </p>
  22285. </dd>
  22286. <dt>&lsquo;<samp>flags, f</samp>&rsquo;</dt>
  22287. <dd><p>Set graticule flags.
  22288. </p>
  22289. <dl compact="compact">
  22290. <dt>&lsquo;<samp>white</samp>&rsquo;</dt>
  22291. <dd><p>Draw graticule for white point.
  22292. </p>
  22293. </dd>
  22294. <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
  22295. <dd><p>Draw graticule for black point.
  22296. </p>
  22297. </dd>
  22298. <dt>&lsquo;<samp>name</samp>&rsquo;</dt>
  22299. <dd><p>Draw color points short names.
  22300. </p></dd>
  22301. </dl>
  22302. </dd>
  22303. <dt>&lsquo;<samp>bgopacity, b</samp>&rsquo;</dt>
  22304. <dd><p>Set background opacity.
  22305. </p>
  22306. </dd>
  22307. <dt>&lsquo;<samp>lthreshold, l</samp>&rsquo;</dt>
  22308. <dd><p>Set low threshold for color component not represented on X or Y axis.
  22309. Values lower than this value will be ignored. Default is 0.
  22310. Note this value is multiplied with actual max possible value one pixel component
  22311. can have. So for 8-bit input and low threshold value of 0.1 actual threshold
  22312. is 0.1 * 255 = 25.
  22313. </p>
  22314. </dd>
  22315. <dt>&lsquo;<samp>hthreshold, h</samp>&rsquo;</dt>
  22316. <dd><p>Set high threshold for color component not represented on X or Y axis.
  22317. Values higher than this value will be ignored. Default is 1.
  22318. Note this value is multiplied with actual max possible value one pixel component
  22319. can have. So for 8-bit input and high threshold value of 0.9 actual threshold
  22320. is 0.9 * 255 = 230.
  22321. </p>
  22322. </dd>
  22323. <dt>&lsquo;<samp>colorspace, c</samp>&rsquo;</dt>
  22324. <dd><p>Set what kind of colorspace to use when drawing graticule.
  22325. </p><dl compact="compact">
  22326. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  22327. <dt>&lsquo;<samp>601</samp>&rsquo;</dt>
  22328. <dt>&lsquo;<samp>709</samp>&rsquo;</dt>
  22329. </dl>
  22330. <p>Default is auto.
  22331. </p>
  22332. </dd>
  22333. <dt>&lsquo;<samp>tint0, t0</samp>&rsquo;</dt>
  22334. <dt>&lsquo;<samp>tint1, t1</samp>&rsquo;</dt>
  22335. <dd><p>Set color tint for gray/tint vectorscope mode. By default both options are zero.
  22336. This means no tint, and output will remain gray.
  22337. </p></dd>
  22338. </dl>
  22339. <p><a name="vidstabdetect"></a>
  22340. </p><a name="vidstabdetect-1"></a>
  22341. <h2 class="section"><a href="ffmpeg-filters.html#toc-vidstabdetect-1">11.225 vidstabdetect</a></h2>
  22342. <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
  22343. <a href="#vidstabtransform">vidstabtransform</a> for pass 2.
  22344. </p>
  22345. <p>This filter generates a file with relative translation and rotation
  22346. transform information about subsequent frames, which is then used by
  22347. the <a href="#vidstabtransform">vidstabtransform</a> filter.
  22348. </p>
  22349. <p>To enable compilation of this filter you need to configure FFmpeg with
  22350. <code>--enable-libvidstab</code>.
  22351. </p>
  22352. <p>This filter accepts the following options:
  22353. </p>
  22354. <dl compact="compact">
  22355. <dt>&lsquo;<samp>result</samp>&rsquo;</dt>
  22356. <dd><p>Set the path to the file used to write the transforms information.
  22357. Default value is &lsquo;<tt>transforms.trf</tt>&rsquo;.
  22358. </p>
  22359. </dd>
  22360. <dt>&lsquo;<samp>shakiness</samp>&rsquo;</dt>
  22361. <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
  22362. integer in the range 1-10, a value of 1 means little shakiness, a
  22363. value of 10 means strong shakiness. Default value is 5.
  22364. </p>
  22365. </dd>
  22366. <dt>&lsquo;<samp>accuracy</samp>&rsquo;</dt>
  22367. <dd><p>Set the accuracy of the detection process. It must be a value in the
  22368. range 1-15. A value of 1 means low accuracy, a value of 15 means high
  22369. accuracy. Default value is 15.
  22370. </p>
  22371. </dd>
  22372. <dt>&lsquo;<samp>stepsize</samp>&rsquo;</dt>
  22373. <dd><p>Set stepsize of the search process. The region around minimum is
  22374. scanned with 1 pixel resolution. Default value is 6.
  22375. </p>
  22376. </dd>
  22377. <dt>&lsquo;<samp>mincontrast</samp>&rsquo;</dt>
  22378. <dd><p>Set minimum contrast. Below this value a local measurement field is
  22379. discarded. Must be a floating point value in the range 0-1. Default
  22380. value is 0.3.
  22381. </p>
  22382. </dd>
  22383. <dt>&lsquo;<samp>tripod</samp>&rsquo;</dt>
  22384. <dd><p>Set reference frame number for tripod mode.
  22385. </p>
  22386. <p>If enabled, the motion of the frames is compared to a reference frame
  22387. in the filtered stream, identified by the specified number. The idea
  22388. is to compensate all movements in a more-or-less static scene and keep
  22389. the camera view absolutely still.
  22390. </p>
  22391. <p>If set to 0, it is disabled. The frames are counted starting from 1.
  22392. </p>
  22393. </dd>
  22394. <dt>&lsquo;<samp>show</samp>&rsquo;</dt>
  22395. <dd><p>Show fields and transforms in the resulting frames. It accepts an
  22396. integer in the range 0-2. Default value is 0, which disables any
  22397. visualization.
  22398. </p></dd>
  22399. </dl>
  22400. <a name="Examples-7"></a>
  22401. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-7">11.225.1 Examples</a></h3>
  22402. <ul>
  22403. <li>
  22404. Use default values:
  22405. <div class="example">
  22406. <pre class="example">vidstabdetect
  22407. </pre></div>
  22408. </li><li>
  22409. Analyze strongly shaky movie and put the results in file
  22410. &lsquo;<tt>mytransforms.trf</tt>&rsquo;:
  22411. <div class="example">
  22412. <pre class="example">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
  22413. </pre></div>
  22414. </li><li>
  22415. Visualize the result of internal transformations in the resulting
  22416. video:
  22417. <div class="example">
  22418. <pre class="example">vidstabdetect=show=1
  22419. </pre></div>
  22420. </li><li>
  22421. Analyze a video with medium shakiness using <code>ffmpeg</code>:
  22422. <div class="example">
  22423. <pre class="example">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
  22424. </pre></div>
  22425. </li></ul>
  22426. <p><a name="vidstabtransform"></a>
  22427. </p><a name="vidstabtransform-1"></a>
  22428. <h2 class="section"><a href="ffmpeg-filters.html#toc-vidstabtransform-1">11.226 vidstabtransform</a></h2>
  22429. <p>Video stabilization/deshaking: pass 2 of 2,
  22430. see <a href="#vidstabdetect">vidstabdetect</a> for pass 1.
  22431. </p>
  22432. <p>Read a file with transform information for each frame and
  22433. apply/compensate them. Together with the <a href="#vidstabdetect">vidstabdetect</a>
  22434. filter this can be used to deshake videos. See also
  22435. <a href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
  22436. the <a href="#unsharp">unsharp</a> filter, see below.
  22437. </p>
  22438. <p>To enable compilation of this filter you need to configure FFmpeg with
  22439. <code>--enable-libvidstab</code>.
  22440. </p>
  22441. <a name="Options-4"></a>
  22442. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Options-4">11.226.1 Options</a></h3>
  22443. <dl compact="compact">
  22444. <dt>&lsquo;<samp>input</samp>&rsquo;</dt>
  22445. <dd><p>Set path to the file used to read the transforms. Default value is
  22446. &lsquo;<tt>transforms.trf</tt>&rsquo;.
  22447. </p>
  22448. </dd>
  22449. <dt>&lsquo;<samp>smoothing</samp>&rsquo;</dt>
  22450. <dd><p>Set the number of frames (value*2 + 1) used for lowpass filtering the
  22451. camera movements. Default value is 10.
  22452. </p>
  22453. <p>For example a number of 10 means that 21 frames are used (10 in the
  22454. past and 10 in the future) to smoothen the motion in the video. A
  22455. larger value leads to a smoother video, but limits the acceleration of
  22456. the camera (pan/tilt movements). 0 is a special case where a static
  22457. camera is simulated.
  22458. </p>
  22459. </dd>
  22460. <dt>&lsquo;<samp>optalgo</samp>&rsquo;</dt>
  22461. <dd><p>Set the camera path optimization algorithm.
  22462. </p>
  22463. <p>Accepted values are:
  22464. </p><dl compact="compact">
  22465. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  22466. <dd><p>gaussian kernel low-pass filter on camera motion (default)
  22467. </p></dd>
  22468. <dt>&lsquo;<samp>avg</samp>&rsquo;</dt>
  22469. <dd><p>averaging on transformations
  22470. </p></dd>
  22471. </dl>
  22472. </dd>
  22473. <dt>&lsquo;<samp>maxshift</samp>&rsquo;</dt>
  22474. <dd><p>Set maximal number of pixels to translate frames. Default value is -1,
  22475. meaning no limit.
  22476. </p>
  22477. </dd>
  22478. <dt>&lsquo;<samp>maxangle</samp>&rsquo;</dt>
  22479. <dd><p>Set maximal angle in radians (degree*PI/180) to rotate frames. Default
  22480. value is -1, meaning no limit.
  22481. </p>
  22482. </dd>
  22483. <dt>&lsquo;<samp>crop</samp>&rsquo;</dt>
  22484. <dd><p>Specify how to deal with borders that may be visible due to movement
  22485. compensation.
  22486. </p>
  22487. <p>Available values are:
  22488. </p><dl compact="compact">
  22489. <dt>&lsquo;<samp>keep</samp>&rsquo;</dt>
  22490. <dd><p>keep image information from previous frame (default)
  22491. </p></dd>
  22492. <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
  22493. <dd><p>fill the border black
  22494. </p></dd>
  22495. </dl>
  22496. </dd>
  22497. <dt>&lsquo;<samp>invert</samp>&rsquo;</dt>
  22498. <dd><p>Invert transforms if set to 1. Default value is 0.
  22499. </p>
  22500. </dd>
  22501. <dt>&lsquo;<samp>relative</samp>&rsquo;</dt>
  22502. <dd><p>Consider transforms as relative to previous frame if set to 1,
  22503. absolute if set to 0. Default value is 0.
  22504. </p>
  22505. </dd>
  22506. <dt>&lsquo;<samp>zoom</samp>&rsquo;</dt>
  22507. <dd><p>Set percentage to zoom. A positive value will result in a zoom-in
  22508. effect, a negative value in a zoom-out effect. Default value is 0 (no
  22509. zoom).
  22510. </p>
  22511. </dd>
  22512. <dt>&lsquo;<samp>optzoom</samp>&rsquo;</dt>
  22513. <dd><p>Set optimal zooming to avoid borders.
  22514. </p>
  22515. <p>Accepted values are:
  22516. </p><dl compact="compact">
  22517. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  22518. <dd><p>disabled
  22519. </p></dd>
  22520. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  22521. <dd><p>optimal static zoom value is determined (only very strong movements
  22522. will lead to visible borders) (default)
  22523. </p></dd>
  22524. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  22525. <dd><p>optimal adaptive zoom value is determined (no borders will be
  22526. visible), see &lsquo;<samp>zoomspeed</samp>&rsquo;
  22527. </p></dd>
  22528. </dl>
  22529. <p>Note that the value given at zoom is added to the one calculated here.
  22530. </p>
  22531. </dd>
  22532. <dt>&lsquo;<samp>zoomspeed</samp>&rsquo;</dt>
  22533. <dd><p>Set percent to zoom maximally each frame (enabled when
  22534. &lsquo;<samp>optzoom</samp>&rsquo; is set to 2). Range is from 0 to 5, default value is
  22535. 0.25.
  22536. </p>
  22537. </dd>
  22538. <dt>&lsquo;<samp>interpol</samp>&rsquo;</dt>
  22539. <dd><p>Specify type of interpolation.
  22540. </p>
  22541. <p>Available values are:
  22542. </p><dl compact="compact">
  22543. <dt>&lsquo;<samp>no</samp>&rsquo;</dt>
  22544. <dd><p>no interpolation
  22545. </p></dd>
  22546. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  22547. <dd><p>linear only horizontal
  22548. </p></dd>
  22549. <dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
  22550. <dd><p>linear in both directions (default)
  22551. </p></dd>
  22552. <dt>&lsquo;<samp>bicubic</samp>&rsquo;</dt>
  22553. <dd><p>cubic in both directions (slow)
  22554. </p></dd>
  22555. </dl>
  22556. </dd>
  22557. <dt>&lsquo;<samp>tripod</samp>&rsquo;</dt>
  22558. <dd><p>Enable virtual tripod mode if set to 1, which is equivalent to
  22559. <code>relative=0:smoothing=0</code>. Default value is 0.
  22560. </p>
  22561. <p>Use also <code>tripod</code> option of <a href="#vidstabdetect">vidstabdetect</a>.
  22562. </p>
  22563. </dd>
  22564. <dt>&lsquo;<samp>debug</samp>&rsquo;</dt>
  22565. <dd><p>Increase log verbosity if set to 1. Also the detected global motions
  22566. are written to the temporary file &lsquo;<tt>global_motions.trf</tt>&rsquo;. Default
  22567. value is 0.
  22568. </p></dd>
  22569. </dl>
  22570. <a name="Examples-138"></a>
  22571. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-138">11.226.2 Examples</a></h3>
  22572. <ul>
  22573. <li>
  22574. Use <code>ffmpeg</code> for a typical stabilization with default values:
  22575. <div class="example">
  22576. <pre class="example">ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
  22577. </pre></div>
  22578. <p>Note the use of the <a href="#unsharp">unsharp</a> filter which is always recommended.
  22579. </p>
  22580. </li><li>
  22581. Zoom in a bit more and load transform data from a given file:
  22582. <div class="example">
  22583. <pre class="example">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
  22584. </pre></div>
  22585. </li><li>
  22586. Smoothen the video even more:
  22587. <div class="example">
  22588. <pre class="example">vidstabtransform=smoothing=30
  22589. </pre></div>
  22590. </li></ul>
  22591. <a name="vflip"></a>
  22592. <h2 class="section"><a href="ffmpeg-filters.html#toc-vflip">11.227 vflip</a></h2>
  22593. <p>Flip the input video vertically.
  22594. </p>
  22595. <p>For example, to vertically flip a video with <code>ffmpeg</code>:
  22596. </p><div class="example">
  22597. <pre class="example">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
  22598. </pre></div>
  22599. <a name="vfrdet"></a>
  22600. <h2 class="section"><a href="ffmpeg-filters.html#toc-vfrdet">11.228 vfrdet</a></h2>
  22601. <p>Detect variable frame rate video.
  22602. </p>
  22603. <p>This filter tries to detect if the input is variable or constant frame rate.
  22604. </p>
  22605. <p>At end it will output number of frames detected as having variable delta pts,
  22606. and ones with constant delta pts.
  22607. If there was frames with variable delta, than it will also show min, max and
  22608. average delta encountered.
  22609. </p>
  22610. <a name="vibrance"></a>
  22611. <h2 class="section"><a href="ffmpeg-filters.html#toc-vibrance">11.229 vibrance</a></h2>
  22612. <p>Boost or alter saturation.
  22613. </p>
  22614. <p>The filter accepts the following options:
  22615. </p><dl compact="compact">
  22616. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  22617. <dd><p>Set strength of boost if positive value or strength of alter if negative value.
  22618. Default is 0. Allowed range is from -2 to 2.
  22619. </p>
  22620. </dd>
  22621. <dt>&lsquo;<samp>rbal</samp>&rsquo;</dt>
  22622. <dd><p>Set the red balance. Default is 1. Allowed range is from -10 to 10.
  22623. </p>
  22624. </dd>
  22625. <dt>&lsquo;<samp>gbal</samp>&rsquo;</dt>
  22626. <dd><p>Set the green balance. Default is 1. Allowed range is from -10 to 10.
  22627. </p>
  22628. </dd>
  22629. <dt>&lsquo;<samp>bbal</samp>&rsquo;</dt>
  22630. <dd><p>Set the blue balance. Default is 1. Allowed range is from -10 to 10.
  22631. </p>
  22632. </dd>
  22633. <dt>&lsquo;<samp>rlum</samp>&rsquo;</dt>
  22634. <dd><p>Set the red luma coefficient.
  22635. </p>
  22636. </dd>
  22637. <dt>&lsquo;<samp>glum</samp>&rsquo;</dt>
  22638. <dd><p>Set the green luma coefficient.
  22639. </p>
  22640. </dd>
  22641. <dt>&lsquo;<samp>blum</samp>&rsquo;</dt>
  22642. <dd><p>Set the blue luma coefficient.
  22643. </p>
  22644. </dd>
  22645. <dt>&lsquo;<samp>alternate</samp>&rsquo;</dt>
  22646. <dd><p>If <code>intensity</code> is negative and this is set to 1, colors will change,
  22647. otherwise colors will be less saturated, more towards gray.
  22648. </p></dd>
  22649. </dl>
  22650. <a name="Commands-12"></a>
  22651. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-12">11.229.1 Commands</a></h3>
  22652. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  22653. </p>
  22654. <p><a name="vignette"></a>
  22655. </p><a name="vignette-1"></a>
  22656. <h2 class="section"><a href="ffmpeg-filters.html#toc-vignette-1">11.230 vignette</a></h2>
  22657. <p>Make or reverse a natural vignetting effect.
  22658. </p>
  22659. <p>The filter accepts the following options:
  22660. </p>
  22661. <dl compact="compact">
  22662. <dt>&lsquo;<samp>angle, a</samp>&rsquo;</dt>
  22663. <dd><p>Set lens angle expression as a number of radians.
  22664. </p>
  22665. <p>The value is clipped in the <code>[0,PI/2]</code> range.
  22666. </p>
  22667. <p>Default value: <code>&quot;PI/5&quot;</code>
  22668. </p>
  22669. </dd>
  22670. <dt>&lsquo;<samp>x0</samp>&rsquo;</dt>
  22671. <dt>&lsquo;<samp>y0</samp>&rsquo;</dt>
  22672. <dd><p>Set center coordinates expressions. Respectively <code>&quot;w/2&quot;</code> and <code>&quot;h/2&quot;</code>
  22673. by default.
  22674. </p>
  22675. </dd>
  22676. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  22677. <dd><p>Set forward/backward mode.
  22678. </p>
  22679. <p>Available modes are:
  22680. </p><dl compact="compact">
  22681. <dt>&lsquo;<samp>forward</samp>&rsquo;</dt>
  22682. <dd><p>The larger the distance from the central point, the darker the image becomes.
  22683. </p>
  22684. </dd>
  22685. <dt>&lsquo;<samp>backward</samp>&rsquo;</dt>
  22686. <dd><p>The larger the distance from the central point, the brighter the image becomes.
  22687. This can be used to reverse a vignette effect, though there is no automatic
  22688. detection to extract the lens &lsquo;<samp>angle</samp>&rsquo; and other settings (yet). It can
  22689. also be used to create a burning effect.
  22690. </p></dd>
  22691. </dl>
  22692. <p>Default value is &lsquo;<samp>forward</samp>&rsquo;.
  22693. </p>
  22694. </dd>
  22695. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  22696. <dd><p>Set evaluation mode for the expressions (&lsquo;<samp>angle</samp>&rsquo;, &lsquo;<samp>x0</samp>&rsquo;, &lsquo;<samp>y0</samp>&rsquo;).
  22697. </p>
  22698. <p>It accepts the following values:
  22699. </p><dl compact="compact">
  22700. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  22701. <dd><p>Evaluate expressions only once during the filter initialization.
  22702. </p>
  22703. </dd>
  22704. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  22705. <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
  22706. &lsquo;<samp>init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
  22707. allows advanced dynamic expressions.
  22708. </p></dd>
  22709. </dl>
  22710. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  22711. </p>
  22712. </dd>
  22713. <dt>&lsquo;<samp>dither</samp>&rsquo;</dt>
  22714. <dd><p>Set dithering to reduce the circular banding effects. Default is <code>1</code>
  22715. (enabled).
  22716. </p>
  22717. </dd>
  22718. <dt>&lsquo;<samp>aspect</samp>&rsquo;</dt>
  22719. <dd><p>Set vignette aspect. This setting allows one to adjust the shape of the vignette.
  22720. Setting this value to the SAR of the input will make a rectangular vignetting
  22721. following the dimensions of the video.
  22722. </p>
  22723. <p>Default is <code>1/1</code>.
  22724. </p></dd>
  22725. </dl>
  22726. <a name="Expressions"></a>
  22727. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Expressions">11.230.1 Expressions</a></h3>
  22728. <p>The &lsquo;<samp>alpha</samp>&rsquo;, &lsquo;<samp>x0</samp>&rsquo; and &lsquo;<samp>y0</samp>&rsquo; expressions can contain the
  22729. following parameters.
  22730. </p>
  22731. <dl compact="compact">
  22732. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  22733. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  22734. <dd><p>input width and height
  22735. </p>
  22736. </dd>
  22737. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  22738. <dd><p>the number of input frame, starting from 0
  22739. </p>
  22740. </dd>
  22741. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  22742. <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
  22743. <var>TB</var> units, NAN if undefined
  22744. </p>
  22745. </dd>
  22746. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  22747. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  22748. </p>
  22749. </dd>
  22750. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  22751. <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
  22752. expressed in seconds, NAN if undefined
  22753. </p>
  22754. </dd>
  22755. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  22756. <dd><p>time base of the input video
  22757. </p></dd>
  22758. </dl>
  22759. <a name="Examples-37"></a>
  22760. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-37">11.230.2 Examples</a></h3>
  22761. <ul>
  22762. <li>
  22763. Apply simple strong vignetting effect:
  22764. <div class="example">
  22765. <pre class="example">vignette=PI/4
  22766. </pre></div>
  22767. </li><li>
  22768. Make a flickering vignetting:
  22769. <div class="example">
  22770. <pre class="example">vignette='PI/4+random(1)*PI/50':eval=frame
  22771. </pre></div>
  22772. </li></ul>
  22773. <a name="vmafmotion"></a>
  22774. <h2 class="section"><a href="ffmpeg-filters.html#toc-vmafmotion">11.231 vmafmotion</a></h2>
  22775. <p>Obtain the average VMAF motion score of a video.
  22776. It is one of the component metrics of VMAF.
  22777. </p>
  22778. <p>The obtained average motion score is printed through the logging system.
  22779. </p>
  22780. <p>The filter accepts the following options:
  22781. </p>
  22782. <dl compact="compact">
  22783. <dt>&lsquo;<samp>stats_file</samp>&rsquo;</dt>
  22784. <dd><p>If specified, the filter will use the named file to save the motion score of
  22785. each frame with respect to the previous frame.
  22786. When filename equals &quot;-&quot; the data is sent to standard output.
  22787. </p></dd>
  22788. </dl>
  22789. <p>Example:
  22790. </p><div class="example">
  22791. <pre class="example">ffmpeg -i ref.mpg -vf vmafmotion -f null -
  22792. </pre></div>
  22793. <a name="vstack"></a>
  22794. <h2 class="section"><a href="ffmpeg-filters.html#toc-vstack">11.232 vstack</a></h2>
  22795. <p>Stack input videos vertically.
  22796. </p>
  22797. <p>All streams must be of same pixel format and of same width.
  22798. </p>
  22799. <p>Note that this filter is faster than using <a href="#overlay">overlay</a> and <a href="#pad">pad</a> filter
  22800. to create same output.
  22801. </p>
  22802. <p>The filter accepts the following options:
  22803. </p>
  22804. <dl compact="compact">
  22805. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  22806. <dd><p>Set number of input streams. Default is 2.
  22807. </p>
  22808. </dd>
  22809. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  22810. <dd><p>If set to 1, force the output to terminate when the shortest input
  22811. terminates. Default value is 0.
  22812. </p></dd>
  22813. </dl>
  22814. <a name="w3fdif"></a>
  22815. <h2 class="section"><a href="ffmpeg-filters.html#toc-w3fdif">11.233 w3fdif</a></h2>
  22816. <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
  22817. Deinterlacing Filter&quot;).
  22818. </p>
  22819. <p>Based on the process described by Martin Weston for BBC R&amp;D, and
  22820. implemented based on the de-interlace algorithm written by Jim
  22821. Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
  22822. uses filter coefficients calculated by BBC R&amp;D.
  22823. </p>
  22824. <p>This filter uses field-dominance information in frame to decide which
  22825. of each pair of fields to place first in the output.
  22826. If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>w3fdif</code> filter.
  22827. </p>
  22828. <p>There are two sets of filter coefficients, so called &quot;simple&quot;
  22829. and &quot;complex&quot;. Which set of filter coefficients is used can
  22830. be set by passing an optional parameter:
  22831. </p>
  22832. <dl compact="compact">
  22833. <dt>&lsquo;<samp>filter</samp>&rsquo;</dt>
  22834. <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
  22835. </p>
  22836. <dl compact="compact">
  22837. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  22838. <dd><p>Simple filter coefficient set.
  22839. </p></dd>
  22840. <dt>&lsquo;<samp>complex</samp>&rsquo;</dt>
  22841. <dd><p>More-complex filter coefficient set.
  22842. </p></dd>
  22843. </dl>
  22844. <p>Default value is &lsquo;<samp>complex</samp>&rsquo;.
  22845. </p>
  22846. </dd>
  22847. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  22848. <dd><p>Specify which frames to deinterlace. Accepts one of the following values:
  22849. </p>
  22850. <dl compact="compact">
  22851. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  22852. <dd><p>Deinterlace all frames,
  22853. </p></dd>
  22854. <dt>&lsquo;<samp>interlaced</samp>&rsquo;</dt>
  22855. <dd><p>Only deinterlace frames marked as interlaced.
  22856. </p></dd>
  22857. </dl>
  22858. <p>Default value is &lsquo;<samp>all</samp>&rsquo;.
  22859. </p></dd>
  22860. </dl>
  22861. <a name="waveform"></a>
  22862. <h2 class="section"><a href="ffmpeg-filters.html#toc-waveform">11.234 waveform</a></h2>
  22863. <p>Video waveform monitor.
  22864. </p>
  22865. <p>The waveform monitor plots color component intensity. By default luminance
  22866. only. Each column of the waveform corresponds to a column of pixels in the
  22867. source video.
  22868. </p>
  22869. <p>It accepts the following options:
  22870. </p>
  22871. <dl compact="compact">
  22872. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  22873. <dd><p>Can be either <code>row</code>, or <code>column</code>. Default is <code>column</code>.
  22874. In row mode, the graph on the left side represents color component value 0 and
  22875. the right side represents value = 255. In column mode, the top side represents
  22876. color component value = 0 and bottom side represents value = 255.
  22877. </p>
  22878. </dd>
  22879. <dt>&lsquo;<samp>intensity, i</samp>&rsquo;</dt>
  22880. <dd><p>Set intensity. Smaller values are useful to find out how many values of the same
  22881. luminance are distributed across input rows/columns.
  22882. Default value is <code>0.04</code>. Allowed range is [0, 1].
  22883. </p>
  22884. </dd>
  22885. <dt>&lsquo;<samp>mirror, r</samp>&rsquo;</dt>
  22886. <dd><p>Set mirroring mode. <code>0</code> means unmirrored, <code>1</code> means mirrored.
  22887. In mirrored mode, higher values will be represented on the left
  22888. side for <code>row</code> mode and at the top for <code>column</code> mode. Default is
  22889. <code>1</code> (mirrored).
  22890. </p>
  22891. </dd>
  22892. <dt>&lsquo;<samp>display, d</samp>&rsquo;</dt>
  22893. <dd><p>Set display mode.
  22894. It accepts the following values:
  22895. </p><dl compact="compact">
  22896. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  22897. <dd><p>Presents information identical to that in the <code>parade</code>, except
  22898. that the graphs representing color components are superimposed directly
  22899. over one another.
  22900. </p>
  22901. <p>This display mode makes it easier to spot relative differences or similarities
  22902. in overlapping areas of the color components that are supposed to be identical,
  22903. such as neutral whites, grays, or blacks.
  22904. </p>
  22905. </dd>
  22906. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  22907. <dd><p>Display separate graph for the color components side by side in
  22908. <code>row</code> mode or one below the other in <code>column</code> mode.
  22909. </p>
  22910. </dd>
  22911. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  22912. <dd><p>Display separate graph for the color components side by side in
  22913. <code>column</code> mode or one below the other in <code>row</code> mode.
  22914. </p>
  22915. <p>Using this display mode makes it easy to spot color casts in the highlights
  22916. and shadows of an image, by comparing the contours of the top and the bottom
  22917. graphs of each waveform. Since whites, grays, and blacks are characterized
  22918. by exactly equal amounts of red, green, and blue, neutral areas of the picture
  22919. should display three waveforms of roughly equal width/height. If not, the
  22920. correction is easy to perform by making level adjustments the three waveforms.
  22921. </p></dd>
  22922. </dl>
  22923. <p>Default is <code>stack</code>.
  22924. </p>
  22925. </dd>
  22926. <dt>&lsquo;<samp>components, c</samp>&rsquo;</dt>
  22927. <dd><p>Set which color components to display. Default is 1, which means only luminance
  22928. or red color component if input is in RGB colorspace. If is set for example to
  22929. 7 it will display all 3 (if) available color components.
  22930. </p>
  22931. </dd>
  22932. <dt>&lsquo;<samp>envelope, e</samp>&rsquo;</dt>
  22933. <dd><dl compact="compact">
  22934. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  22935. <dd><p>No envelope, this is default.
  22936. </p>
  22937. </dd>
  22938. <dt>&lsquo;<samp>instant</samp>&rsquo;</dt>
  22939. <dd><p>Instant envelope, minimum and maximum values presented in graph will be easily
  22940. visible even with small <code>step</code> value.
  22941. </p>
  22942. </dd>
  22943. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  22944. <dd><p>Hold minimum and maximum values presented in graph across time. This way you
  22945. can still spot out of range values without constantly looking at waveforms.
  22946. </p>
  22947. </dd>
  22948. <dt>&lsquo;<samp>peak+instant</samp>&rsquo;</dt>
  22949. <dd><p>Peak and instant envelope combined together.
  22950. </p></dd>
  22951. </dl>
  22952. </dd>
  22953. <dt>&lsquo;<samp>filter, f</samp>&rsquo;</dt>
  22954. <dd><dl compact="compact">
  22955. <dt>&lsquo;<samp>lowpass</samp>&rsquo;</dt>
  22956. <dd><p>No filtering, this is default.
  22957. </p>
  22958. </dd>
  22959. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  22960. <dd><p>Luma and chroma combined together.
  22961. </p>
  22962. </dd>
  22963. <dt>&lsquo;<samp>aflat</samp>&rsquo;</dt>
  22964. <dd><p>Similar as above, but shows difference between blue and red chroma.
  22965. </p>
  22966. </dd>
  22967. <dt>&lsquo;<samp>xflat</samp>&rsquo;</dt>
  22968. <dd><p>Similar as above, but use different colors.
  22969. </p>
  22970. </dd>
  22971. <dt>&lsquo;<samp>yflat</samp>&rsquo;</dt>
  22972. <dd><p>Similar as above, but again with different colors.
  22973. </p>
  22974. </dd>
  22975. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  22976. <dd><p>Displays only chroma.
  22977. </p>
  22978. </dd>
  22979. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  22980. <dd><p>Displays actual color value on waveform.
  22981. </p>
  22982. </dd>
  22983. <dt>&lsquo;<samp>acolor</samp>&rsquo;</dt>
  22984. <dd><p>Similar as above, but with luma showing frequency of chroma values.
  22985. </p></dd>
  22986. </dl>
  22987. </dd>
  22988. <dt>&lsquo;<samp>graticule, g</samp>&rsquo;</dt>
  22989. <dd><p>Set which graticule to display.
  22990. </p>
  22991. <dl compact="compact">
  22992. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  22993. <dd><p>Do not display graticule.
  22994. </p>
  22995. </dd>
  22996. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  22997. <dd><p>Display green graticule showing legal broadcast ranges.
  22998. </p>
  22999. </dd>
  23000. <dt>&lsquo;<samp>orange</samp>&rsquo;</dt>
  23001. <dd><p>Display orange graticule showing legal broadcast ranges.
  23002. </p>
  23003. </dd>
  23004. <dt>&lsquo;<samp>invert</samp>&rsquo;</dt>
  23005. <dd><p>Display invert graticule showing legal broadcast ranges.
  23006. </p></dd>
  23007. </dl>
  23008. </dd>
  23009. <dt>&lsquo;<samp>opacity, o</samp>&rsquo;</dt>
  23010. <dd><p>Set graticule opacity.
  23011. </p>
  23012. </dd>
  23013. <dt>&lsquo;<samp>flags, fl</samp>&rsquo;</dt>
  23014. <dd><p>Set graticule flags.
  23015. </p>
  23016. <dl compact="compact">
  23017. <dt>&lsquo;<samp>numbers</samp>&rsquo;</dt>
  23018. <dd><p>Draw numbers above lines. By default enabled.
  23019. </p>
  23020. </dd>
  23021. <dt>&lsquo;<samp>dots</samp>&rsquo;</dt>
  23022. <dd><p>Draw dots instead of lines.
  23023. </p></dd>
  23024. </dl>
  23025. </dd>
  23026. <dt>&lsquo;<samp>scale, s</samp>&rsquo;</dt>
  23027. <dd><p>Set scale used for displaying graticule.
  23028. </p>
  23029. <dl compact="compact">
  23030. <dt>&lsquo;<samp>digital</samp>&rsquo;</dt>
  23031. <dt>&lsquo;<samp>millivolts</samp>&rsquo;</dt>
  23032. <dt>&lsquo;<samp>ire</samp>&rsquo;</dt>
  23033. </dl>
  23034. <p>Default is digital.
  23035. </p>
  23036. </dd>
  23037. <dt>&lsquo;<samp>bgopacity, b</samp>&rsquo;</dt>
  23038. <dd><p>Set background opacity.
  23039. </p>
  23040. </dd>
  23041. <dt>&lsquo;<samp>tint0, t0</samp>&rsquo;</dt>
  23042. <dt>&lsquo;<samp>tint1, t1</samp>&rsquo;</dt>
  23043. <dd><p>Set tint for output.
  23044. Only used with lowpass filter and when display is not overlay and input
  23045. pixel formats are not RGB.
  23046. </p></dd>
  23047. </dl>
  23048. <a name="weave_002c-doubleweave"></a>
  23049. <h2 class="section"><a href="ffmpeg-filters.html#toc-weave_002c-doubleweave">11.235 weave, doubleweave</a></h2>
  23050. <p>The <code>weave</code> takes a field-based video input and join
  23051. each two sequential fields into single frame, producing a new double
  23052. height clip with half the frame rate and half the frame count.
  23053. </p>
  23054. <p>The <code>doubleweave</code> works same as <code>weave</code> but without
  23055. halving frame rate and frame count.
  23056. </p>
  23057. <p>It accepts the following option:
  23058. </p>
  23059. <dl compact="compact">
  23060. <dt>&lsquo;<samp>first_field</samp>&rsquo;</dt>
  23061. <dd><p>Set first field. Available values are:
  23062. </p>
  23063. <dl compact="compact">
  23064. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  23065. <dd><p>Set the frame as top-field-first.
  23066. </p>
  23067. </dd>
  23068. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  23069. <dd><p>Set the frame as bottom-field-first.
  23070. </p></dd>
  23071. </dl>
  23072. </dd>
  23073. </dl>
  23074. <a name="Examples-81"></a>
  23075. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-81">11.235.1 Examples</a></h3>
  23076. <ul>
  23077. <li>
  23078. Interlace video using <a href="#select">select</a> and <a href="#separatefields">separatefields</a> filter:
  23079. <div class="example">
  23080. <pre class="example">separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
  23081. </pre></div>
  23082. </li></ul>
  23083. <a name="xbr"></a>
  23084. <h2 class="section"><a href="ffmpeg-filters.html#toc-xbr">11.236 xbr</a></h2>
  23085. <p>Apply the xBR high-quality magnification filter which is designed for pixel
  23086. art. It follows a set of edge-detection rules, see
  23087. <a href="https://forums.libretro.com/t/xbr-algorithm-tutorial/123">https://forums.libretro.com/t/xbr-algorithm-tutorial/123</a>.
  23088. </p>
  23089. <p>It accepts the following option:
  23090. </p>
  23091. <dl compact="compact">
  23092. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  23093. <dd><p>Set the scaling dimension: <code>2</code> for <code>2xBR</code>, <code>3</code> for
  23094. <code>3xBR</code> and <code>4</code> for <code>4xBR</code>.
  23095. Default is <code>3</code>.
  23096. </p></dd>
  23097. </dl>
  23098. <a name="xfade"></a>
  23099. <h2 class="section"><a href="ffmpeg-filters.html#toc-xfade">11.237 xfade</a></h2>
  23100. <p>Apply cross fade from one input video stream to another input video stream.
  23101. The cross fade is applied for specified duration.
  23102. </p>
  23103. <p>The filter accepts the following options:
  23104. </p>
  23105. <dl compact="compact">
  23106. <dt>&lsquo;<samp>transition</samp>&rsquo;</dt>
  23107. <dd><p>Set one of available transition effects:
  23108. </p>
  23109. <dl compact="compact">
  23110. <dt>&lsquo;<samp>custom</samp>&rsquo;</dt>
  23111. <dt>&lsquo;<samp>fade</samp>&rsquo;</dt>
  23112. <dt>&lsquo;<samp>wipeleft</samp>&rsquo;</dt>
  23113. <dt>&lsquo;<samp>wiperight</samp>&rsquo;</dt>
  23114. <dt>&lsquo;<samp>wipeup</samp>&rsquo;</dt>
  23115. <dt>&lsquo;<samp>wipedown</samp>&rsquo;</dt>
  23116. <dt>&lsquo;<samp>slideleft</samp>&rsquo;</dt>
  23117. <dt>&lsquo;<samp>slideright</samp>&rsquo;</dt>
  23118. <dt>&lsquo;<samp>slideup</samp>&rsquo;</dt>
  23119. <dt>&lsquo;<samp>slidedown</samp>&rsquo;</dt>
  23120. <dt>&lsquo;<samp>circlecrop</samp>&rsquo;</dt>
  23121. <dt>&lsquo;<samp>rectcrop</samp>&rsquo;</dt>
  23122. <dt>&lsquo;<samp>distance</samp>&rsquo;</dt>
  23123. <dt>&lsquo;<samp>fadeblack</samp>&rsquo;</dt>
  23124. <dt>&lsquo;<samp>fadewhite</samp>&rsquo;</dt>
  23125. <dt>&lsquo;<samp>radial</samp>&rsquo;</dt>
  23126. <dt>&lsquo;<samp>smoothleft</samp>&rsquo;</dt>
  23127. <dt>&lsquo;<samp>smoothright</samp>&rsquo;</dt>
  23128. <dt>&lsquo;<samp>smoothup</samp>&rsquo;</dt>
  23129. <dt>&lsquo;<samp>smoothdown</samp>&rsquo;</dt>
  23130. <dt>&lsquo;<samp>circleopen</samp>&rsquo;</dt>
  23131. <dt>&lsquo;<samp>circleclose</samp>&rsquo;</dt>
  23132. <dt>&lsquo;<samp>vertopen</samp>&rsquo;</dt>
  23133. <dt>&lsquo;<samp>vertclose</samp>&rsquo;</dt>
  23134. <dt>&lsquo;<samp>horzopen</samp>&rsquo;</dt>
  23135. <dt>&lsquo;<samp>horzclose</samp>&rsquo;</dt>
  23136. <dt>&lsquo;<samp>dissolve</samp>&rsquo;</dt>
  23137. <dt>&lsquo;<samp>pixelize</samp>&rsquo;</dt>
  23138. <dt>&lsquo;<samp>diagtl</samp>&rsquo;</dt>
  23139. <dt>&lsquo;<samp>diagtr</samp>&rsquo;</dt>
  23140. <dt>&lsquo;<samp>diagbl</samp>&rsquo;</dt>
  23141. <dt>&lsquo;<samp>diagbr</samp>&rsquo;</dt>
  23142. <dt>&lsquo;<samp>hlslice</samp>&rsquo;</dt>
  23143. <dt>&lsquo;<samp>hrslice</samp>&rsquo;</dt>
  23144. <dt>&lsquo;<samp>vuslice</samp>&rsquo;</dt>
  23145. <dt>&lsquo;<samp>vdslice</samp>&rsquo;</dt>
  23146. </dl>
  23147. <p>Default transition effect is fade.
  23148. </p>
  23149. </dd>
  23150. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  23151. <dd><p>Set cross fade duration in seconds.
  23152. Default duration is 1 second.
  23153. </p>
  23154. </dd>
  23155. <dt>&lsquo;<samp>offset</samp>&rsquo;</dt>
  23156. <dd><p>Set cross fade start relative to first input stream in seconds.
  23157. Default offset is 0.
  23158. </p>
  23159. </dd>
  23160. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  23161. <dd><p>Set expression for custom transition effect.
  23162. </p>
  23163. <p>The expressions can use the following variables and functions:
  23164. </p>
  23165. <dl compact="compact">
  23166. <dt>&lsquo;<samp>X</samp>&rsquo;</dt>
  23167. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  23168. <dd><p>The coordinates of the current sample.
  23169. </p>
  23170. </dd>
  23171. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  23172. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  23173. <dd><p>The width and height of the image.
  23174. </p>
  23175. </dd>
  23176. <dt>&lsquo;<samp>P</samp>&rsquo;</dt>
  23177. <dd><p>Progress of transition effect.
  23178. </p>
  23179. </dd>
  23180. <dt>&lsquo;<samp>PLANE</samp>&rsquo;</dt>
  23181. <dd><p>Currently processed plane.
  23182. </p>
  23183. </dd>
  23184. <dt>&lsquo;<samp>A</samp>&rsquo;</dt>
  23185. <dd><p>Return value of first input at current location and plane.
  23186. </p>
  23187. </dd>
  23188. <dt>&lsquo;<samp>B</samp>&rsquo;</dt>
  23189. <dd><p>Return value of second input at current location and plane.
  23190. </p>
  23191. </dd>
  23192. <dt>&lsquo;<samp>a0(x, y)</samp>&rsquo;</dt>
  23193. <dt>&lsquo;<samp>a1(x, y)</samp>&rsquo;</dt>
  23194. <dt>&lsquo;<samp>a2(x, y)</samp>&rsquo;</dt>
  23195. <dt>&lsquo;<samp>a3(x, y)</samp>&rsquo;</dt>
  23196. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  23197. first/second/third/fourth component of first input.
  23198. </p>
  23199. </dd>
  23200. <dt>&lsquo;<samp>b0(x, y)</samp>&rsquo;</dt>
  23201. <dt>&lsquo;<samp>b1(x, y)</samp>&rsquo;</dt>
  23202. <dt>&lsquo;<samp>b2(x, y)</samp>&rsquo;</dt>
  23203. <dt>&lsquo;<samp>b3(x, y)</samp>&rsquo;</dt>
  23204. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  23205. first/second/third/fourth component of second input.
  23206. </p></dd>
  23207. </dl>
  23208. </dd>
  23209. </dl>
  23210. <a name="Examples-12"></a>
  23211. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-12">11.237.1 Examples</a></h3>
  23212. <ul>
  23213. <li>
  23214. Cross fade from one input video to another input video, with fade transition and duration of transition
  23215. of 2 seconds starting at offset of 5 seconds:
  23216. <div class="example">
  23217. <pre class="example">ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
  23218. </pre></div>
  23219. </li></ul>
  23220. <a name="xmedian"></a>
  23221. <h2 class="section"><a href="ffmpeg-filters.html#toc-xmedian">11.238 xmedian</a></h2>
  23222. <p>Pick median pixels from several input videos.
  23223. </p>
  23224. <p>The filter accepts the following options:
  23225. </p>
  23226. <dl compact="compact">
  23227. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  23228. <dd><p>Set number of inputs.
  23229. Default is 3. Allowed range is from 3 to 255.
  23230. If number of inputs is even number, than result will be mean value between two median values.
  23231. </p>
  23232. </dd>
  23233. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  23234. <dd><p>Set which planes to filter. Default value is <code>15</code>, by which all planes are processed.
  23235. </p>
  23236. </dd>
  23237. <dt>&lsquo;<samp>percentile</samp>&rsquo;</dt>
  23238. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  23239. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  23240. minimum values, and <code>1</code> maximum values.
  23241. </p></dd>
  23242. </dl>
  23243. <a name="xstack"></a>
  23244. <h2 class="section"><a href="ffmpeg-filters.html#toc-xstack">11.239 xstack</a></h2>
  23245. <p>Stack video inputs into custom layout.
  23246. </p>
  23247. <p>All streams must be of same pixel format.
  23248. </p>
  23249. <p>The filter accepts the following options:
  23250. </p>
  23251. <dl compact="compact">
  23252. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  23253. <dd><p>Set number of input streams. Default is 2.
  23254. </p>
  23255. </dd>
  23256. <dt>&lsquo;<samp>layout</samp>&rsquo;</dt>
  23257. <dd><p>Specify layout of inputs.
  23258. This option requires the desired layout configuration to be explicitly set by the user.
  23259. This sets position of each video input in output. Each input
  23260. is separated by &rsquo;|&rsquo;.
  23261. The first number represents the column, and the second number represents the row.
  23262. Numbers start at 0 and are separated by &rsquo;_&rsquo;. Optionally one can use wX and hX,
  23263. where X is video input from which to take width or height.
  23264. Multiple values can be used when separated by &rsquo;+&rsquo;. In such
  23265. case values are summed together.
  23266. </p>
  23267. <p>Note that if inputs are of different sizes gaps may appear, as not all of
  23268. the output video frame will be filled. Similarly, videos can overlap each
  23269. other if their position doesn&rsquo;t leave enough space for the full frame of
  23270. adjoining videos.
  23271. </p>
  23272. <p>For 2 inputs, a default layout of <code>0_0|w0_0</code> is set. In all other cases,
  23273. a layout must be set by the user.
  23274. </p>
  23275. </dd>
  23276. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  23277. <dd><p>If set to 1, force the output to terminate when the shortest input
  23278. terminates. Default value is 0.
  23279. </p>
  23280. </dd>
  23281. <dt>&lsquo;<samp>fill</samp>&rsquo;</dt>
  23282. <dd><p>If set to valid color, all unused pixels will be filled with that color.
  23283. By default fill is set to none, so it is disabled.
  23284. </p></dd>
  23285. </dl>
  23286. <a name="Examples-89"></a>
  23287. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-89">11.239.1 Examples</a></h3>
  23288. <ul>
  23289. <li>
  23290. Display 4 inputs into 2x2 grid.
  23291. <p>Layout:
  23292. </p><div class="example">
  23293. <pre class="example">input1(0, 0) | input3(w0, 0)
  23294. input2(0, h0) | input4(w0, h0)
  23295. </pre></div>
  23296. <div class="example">
  23297. <pre class="example">xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
  23298. </pre></div>
  23299. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  23300. </p>
  23301. </li><li>
  23302. Display 4 inputs into 1x4 grid.
  23303. <p>Layout:
  23304. </p><div class="example">
  23305. <pre class="example">input1(0, 0)
  23306. input2(0, h0)
  23307. input3(0, h0+h1)
  23308. input4(0, h0+h1+h2)
  23309. </pre></div>
  23310. <div class="example">
  23311. <pre class="example">xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
  23312. </pre></div>
  23313. <p>Note that if inputs are of different widths, unused space will appear.
  23314. </p>
  23315. </li><li>
  23316. Display 9 inputs into 3x3 grid.
  23317. <p>Layout:
  23318. </p><div class="example">
  23319. <pre class="example">input1(0, 0) | input4(w0, 0) | input7(w0+w3, 0)
  23320. input2(0, h0) | input5(w0, h0) | input8(w0+w3, h0)
  23321. input3(0, h0+h1) | input6(w0, h0+h1) | input9(w0+w3, h0+h1)
  23322. </pre></div>
  23323. <div class="example">
  23324. <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
  23325. </pre></div>
  23326. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  23327. </p>
  23328. </li><li>
  23329. Display 16 inputs into 4x4 grid.
  23330. <p>Layout:
  23331. </p><div class="example">
  23332. <pre class="example">input1(0, 0) | input5(w0, 0) | input9 (w0+w4, 0) | input13(w0+w4+w8, 0)
  23333. input2(0, h0) | input6(w0, h0) | input10(w0+w4, h0) | input14(w0+w4+w8, h0)
  23334. input3(0, h0+h1) | input7(w0, h0+h1) | input11(w0+w4, h0+h1) | input15(w0+w4+w8, h0+h1)
  23335. input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
  23336. </pre></div>
  23337. <div class="example">
  23338. <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|
  23339. 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
  23340. </pre></div>
  23341. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  23342. </p>
  23343. </li></ul>
  23344. <p><a name="yadif"></a>
  23345. </p><a name="yadif-1"></a>
  23346. <h2 class="section"><a href="ffmpeg-filters.html#toc-yadif-1">11.240 yadif</a></h2>
  23347. <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
  23348. filter&quot;).
  23349. </p>
  23350. <p>It accepts the following parameters:
  23351. </p>
  23352. <dl compact="compact">
  23353. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  23354. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  23355. </p>
  23356. <dl compact="compact">
  23357. <dt>&lsquo;<samp>0, send_frame</samp>&rsquo;</dt>
  23358. <dd><p>Output one frame for each frame.
  23359. </p></dd>
  23360. <dt>&lsquo;<samp>1, send_field</samp>&rsquo;</dt>
  23361. <dd><p>Output one frame for each field.
  23362. </p></dd>
  23363. <dt>&lsquo;<samp>2, send_frame_nospatial</samp>&rsquo;</dt>
  23364. <dd><p>Like <code>send_frame</code>, but it skips the spatial interlacing check.
  23365. </p></dd>
  23366. <dt>&lsquo;<samp>3, send_field_nospatial</samp>&rsquo;</dt>
  23367. <dd><p>Like <code>send_field</code>, but it skips the spatial interlacing check.
  23368. </p></dd>
  23369. </dl>
  23370. <p>The default value is <code>send_frame</code>.
  23371. </p>
  23372. </dd>
  23373. <dt>&lsquo;<samp>parity</samp>&rsquo;</dt>
  23374. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  23375. of the following values:
  23376. </p>
  23377. <dl compact="compact">
  23378. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  23379. <dd><p>Assume the top field is first.
  23380. </p></dd>
  23381. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  23382. <dd><p>Assume the bottom field is first.
  23383. </p></dd>
  23384. <dt>&lsquo;<samp>-1, auto</samp>&rsquo;</dt>
  23385. <dd><p>Enable automatic detection of field parity.
  23386. </p></dd>
  23387. </dl>
  23388. <p>The default value is <code>auto</code>.
  23389. If the interlacing is unknown or the decoder does not export this information,
  23390. top field first will be assumed.
  23391. </p>
  23392. </dd>
  23393. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  23394. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  23395. values:
  23396. </p>
  23397. <dl compact="compact">
  23398. <dt>&lsquo;<samp>0, all</samp>&rsquo;</dt>
  23399. <dd><p>Deinterlace all frames.
  23400. </p></dd>
  23401. <dt>&lsquo;<samp>1, interlaced</samp>&rsquo;</dt>
  23402. <dd><p>Only deinterlace frames marked as interlaced.
  23403. </p></dd>
  23404. </dl>
  23405. <p>The default value is <code>all</code>.
  23406. </p></dd>
  23407. </dl>
  23408. <a name="yadif_005fcuda"></a>
  23409. <h2 class="section"><a href="ffmpeg-filters.html#toc-yadif_005fcuda">11.241 yadif_cuda</a></h2>
  23410. <p>Deinterlace the input video using the <a href="#yadif">yadif</a> algorithm, but implemented
  23411. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  23412. and/or nvenc.
  23413. </p>
  23414. <p>It accepts the following parameters:
  23415. </p>
  23416. <dl compact="compact">
  23417. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  23418. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  23419. </p>
  23420. <dl compact="compact">
  23421. <dt>&lsquo;<samp>0, send_frame</samp>&rsquo;</dt>
  23422. <dd><p>Output one frame for each frame.
  23423. </p></dd>
  23424. <dt>&lsquo;<samp>1, send_field</samp>&rsquo;</dt>
  23425. <dd><p>Output one frame for each field.
  23426. </p></dd>
  23427. <dt>&lsquo;<samp>2, send_frame_nospatial</samp>&rsquo;</dt>
  23428. <dd><p>Like <code>send_frame</code>, but it skips the spatial interlacing check.
  23429. </p></dd>
  23430. <dt>&lsquo;<samp>3, send_field_nospatial</samp>&rsquo;</dt>
  23431. <dd><p>Like <code>send_field</code>, but it skips the spatial interlacing check.
  23432. </p></dd>
  23433. </dl>
  23434. <p>The default value is <code>send_frame</code>.
  23435. </p>
  23436. </dd>
  23437. <dt>&lsquo;<samp>parity</samp>&rsquo;</dt>
  23438. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  23439. of the following values:
  23440. </p>
  23441. <dl compact="compact">
  23442. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  23443. <dd><p>Assume the top field is first.
  23444. </p></dd>
  23445. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  23446. <dd><p>Assume the bottom field is first.
  23447. </p></dd>
  23448. <dt>&lsquo;<samp>-1, auto</samp>&rsquo;</dt>
  23449. <dd><p>Enable automatic detection of field parity.
  23450. </p></dd>
  23451. </dl>
  23452. <p>The default value is <code>auto</code>.
  23453. If the interlacing is unknown or the decoder does not export this information,
  23454. top field first will be assumed.
  23455. </p>
  23456. </dd>
  23457. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  23458. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  23459. values:
  23460. </p>
  23461. <dl compact="compact">
  23462. <dt>&lsquo;<samp>0, all</samp>&rsquo;</dt>
  23463. <dd><p>Deinterlace all frames.
  23464. </p></dd>
  23465. <dt>&lsquo;<samp>1, interlaced</samp>&rsquo;</dt>
  23466. <dd><p>Only deinterlace frames marked as interlaced.
  23467. </p></dd>
  23468. </dl>
  23469. <p>The default value is <code>all</code>.
  23470. </p></dd>
  23471. </dl>
  23472. <a name="yaepblur"></a>
  23473. <h2 class="section"><a href="ffmpeg-filters.html#toc-yaepblur">11.242 yaepblur</a></h2>
  23474. <p>Apply blur filter while preserving edges (&quot;yaepblur&quot; means &quot;yet another edge preserving blur filter&quot;).
  23475. The algorithm is described in
  23476. &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;
  23477. </p>
  23478. <p>It accepts the following parameters:
  23479. </p>
  23480. <dl compact="compact">
  23481. <dt>&lsquo;<samp>radius, r</samp>&rsquo;</dt>
  23482. <dd><p>Set the window radius. Default value is 3.
  23483. </p>
  23484. </dd>
  23485. <dt>&lsquo;<samp>planes, p</samp>&rsquo;</dt>
  23486. <dd><p>Set which planes to filter. Default is only the first plane.
  23487. </p>
  23488. </dd>
  23489. <dt>&lsquo;<samp>sigma, s</samp>&rsquo;</dt>
  23490. <dd><p>Set blur strength. Default value is 128.
  23491. </p></dd>
  23492. </dl>
  23493. <a name="Commands-33"></a>
  23494. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-33">11.242.1 Commands</a></h3>
  23495. <p>This filter supports same <a href="#commands">commands</a> as options.
  23496. </p>
  23497. <a name="zoompan"></a>
  23498. <h2 class="section"><a href="ffmpeg-filters.html#toc-zoompan">11.243 zoompan</a></h2>
  23499. <p>Apply Zoom &amp; Pan effect.
  23500. </p>
  23501. <p>This filter accepts the following options:
  23502. </p>
  23503. <dl compact="compact">
  23504. <dt>&lsquo;<samp>zoom, z</samp>&rsquo;</dt>
  23505. <dd><p>Set the zoom expression. Range is 1-10. Default is 1.
  23506. </p>
  23507. </dd>
  23508. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  23509. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  23510. <dd><p>Set the x and y expression. Default is 0.
  23511. </p>
  23512. </dd>
  23513. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  23514. <dd><p>Set the duration expression in number of frames.
  23515. This sets for how many number of frames effect will last for
  23516. single input image.
  23517. </p>
  23518. </dd>
  23519. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  23520. <dd><p>Set the output image size, default is &rsquo;hd720&rsquo;.
  23521. </p>
  23522. </dd>
  23523. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  23524. <dd><p>Set the output frame rate, default is &rsquo;25&rsquo;.
  23525. </p></dd>
  23526. </dl>
  23527. <p>Each expression can contain the following constants:
  23528. </p>
  23529. <dl compact="compact">
  23530. <dt>&lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
  23531. <dd><p>Input width.
  23532. </p>
  23533. </dd>
  23534. <dt>&lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
  23535. <dd><p>Input height.
  23536. </p>
  23537. </dd>
  23538. <dt>&lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
  23539. <dd><p>Output width.
  23540. </p>
  23541. </dd>
  23542. <dt>&lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
  23543. <dd><p>Output height.
  23544. </p>
  23545. </dd>
  23546. <dt>&lsquo;<samp>in</samp>&rsquo;</dt>
  23547. <dd><p>Input frame count.
  23548. </p>
  23549. </dd>
  23550. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  23551. <dd><p>Output frame count.
  23552. </p>
  23553. </dd>
  23554. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  23555. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  23556. <dd><p>Last calculated &rsquo;x&rsquo; and &rsquo;y&rsquo; position from &rsquo;x&rsquo; and &rsquo;y&rsquo; expression
  23557. for current input frame.
  23558. </p>
  23559. </dd>
  23560. <dt>&lsquo;<samp>px</samp>&rsquo;</dt>
  23561. <dt>&lsquo;<samp>py</samp>&rsquo;</dt>
  23562. <dd><p>&rsquo;x&rsquo; and &rsquo;y&rsquo; of last output frame of previous input frame or 0 when there was
  23563. not yet such frame (first input frame).
  23564. </p>
  23565. </dd>
  23566. <dt>&lsquo;<samp>zoom</samp>&rsquo;</dt>
  23567. <dd><p>Last calculated zoom from &rsquo;z&rsquo; expression for current input frame.
  23568. </p>
  23569. </dd>
  23570. <dt>&lsquo;<samp>pzoom</samp>&rsquo;</dt>
  23571. <dd><p>Last calculated zoom of last output frame of previous input frame.
  23572. </p>
  23573. </dd>
  23574. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  23575. <dd><p>Number of output frames for current input frame. Calculated from &rsquo;d&rsquo; expression
  23576. for each input frame.
  23577. </p>
  23578. </dd>
  23579. <dt>&lsquo;<samp>pduration</samp>&rsquo;</dt>
  23580. <dd><p>number of output frames created for previous input frame
  23581. </p>
  23582. </dd>
  23583. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  23584. <dd><p>Rational number: input width / input height
  23585. </p>
  23586. </dd>
  23587. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  23588. <dd><p>sample aspect ratio
  23589. </p>
  23590. </dd>
  23591. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  23592. <dd><p>display aspect ratio
  23593. </p>
  23594. </dd>
  23595. </dl>
  23596. <a name="Examples-75"></a>
  23597. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-75">11.243.1 Examples</a></h3>
  23598. <ul>
  23599. <li>
  23600. Zoom-in up to 1.5 and pan at same time to some spot near center of picture:
  23601. <div class="example">
  23602. <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
  23603. </pre></div>
  23604. </li><li>
  23605. Zoom-in up to 1.5 and pan always at center of picture:
  23606. <div class="example">
  23607. <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)'
  23608. </pre></div>
  23609. </li><li>
  23610. Same as above but without pausing:
  23611. <div class="example">
  23612. <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)'
  23613. </pre></div>
  23614. </li></ul>
  23615. <p><a name="zscale"></a>
  23616. </p><a name="zscale-1"></a>
  23617. <h2 class="section"><a href="ffmpeg-filters.html#toc-zscale-1">11.244 zscale</a></h2>
  23618. <p>Scale (resize) the input video, using the z.lib library:
  23619. <a href="https://github.com/sekrit-twc/zimg">https://github.com/sekrit-twc/zimg</a>. To enable compilation of this
  23620. filter, you need to configure FFmpeg with <code>--enable-libzimg</code>.
  23621. </p>
  23622. <p>The zscale filter forces the output display aspect ratio to be the same
  23623. as the input, by changing the output sample aspect ratio.
  23624. </p>
  23625. <p>If the input image format is different from the format requested by
  23626. the next filter, the zscale filter will convert the input to the
  23627. requested format.
  23628. </p>
  23629. <a name="Options-3"></a>
  23630. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Options-3">11.244.1 Options</a></h3>
  23631. <p>The filter accepts the following options.
  23632. </p>
  23633. <dl compact="compact">
  23634. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23635. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  23636. <dd><p>Set the output video dimension expression. Default value is the input
  23637. dimension.
  23638. </p>
  23639. <p>If the <var>width</var> or <var>w</var> value is 0, the input width is used for
  23640. the output. If the <var>height</var> or <var>h</var> value is 0, the input height
  23641. is used for the output.
  23642. </p>
  23643. <p>If one and only one of the values is -n with n &gt;= 1, the zscale filter
  23644. will use a value that maintains the aspect ratio of the input image,
  23645. calculated from the other specified dimension. After that it will,
  23646. however, make sure that the calculated dimension is divisible by n and
  23647. adjust the value if necessary.
  23648. </p>
  23649. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  23650. both values being set to 0 as previously detailed.
  23651. </p>
  23652. <p>See below for the list of accepted constants for use in the dimension
  23653. expression.
  23654. </p>
  23655. </dd>
  23656. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  23657. <dd><p>Set the video size. For the syntax of this option, check the
  23658. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  23659. </p>
  23660. </dd>
  23661. <dt>&lsquo;<samp>dither, d</samp>&rsquo;</dt>
  23662. <dd><p>Set the dither type.
  23663. </p>
  23664. <p>Possible values are:
  23665. </p><dl compact="compact">
  23666. <dt><var>none</var></dt>
  23667. <dt><var>ordered</var></dt>
  23668. <dt><var>random</var></dt>
  23669. <dt><var>error_diffusion</var></dt>
  23670. </dl>
  23671. <p>Default is none.
  23672. </p>
  23673. </dd>
  23674. <dt>&lsquo;<samp>filter, f</samp>&rsquo;</dt>
  23675. <dd><p>Set the resize filter type.
  23676. </p>
  23677. <p>Possible values are:
  23678. </p><dl compact="compact">
  23679. <dt><var>point</var></dt>
  23680. <dt><var>bilinear</var></dt>
  23681. <dt><var>bicubic</var></dt>
  23682. <dt><var>spline16</var></dt>
  23683. <dt><var>spline36</var></dt>
  23684. <dt><var>lanczos</var></dt>
  23685. </dl>
  23686. <p>Default is bilinear.
  23687. </p>
  23688. </dd>
  23689. <dt>&lsquo;<samp>range, r</samp>&rsquo;</dt>
  23690. <dd><p>Set the color range.
  23691. </p>
  23692. <p>Possible values are:
  23693. </p><dl compact="compact">
  23694. <dt><var>input</var></dt>
  23695. <dt><var>limited</var></dt>
  23696. <dt><var>full</var></dt>
  23697. </dl>
  23698. <p>Default is same as input.
  23699. </p>
  23700. </dd>
  23701. <dt>&lsquo;<samp>primaries, p</samp>&rsquo;</dt>
  23702. <dd><p>Set the color primaries.
  23703. </p>
  23704. <p>Possible values are:
  23705. </p><dl compact="compact">
  23706. <dt><var>input</var></dt>
  23707. <dt><var>709</var></dt>
  23708. <dt><var>unspecified</var></dt>
  23709. <dt><var>170m</var></dt>
  23710. <dt><var>240m</var></dt>
  23711. <dt><var>2020</var></dt>
  23712. </dl>
  23713. <p>Default is same as input.
  23714. </p>
  23715. </dd>
  23716. <dt>&lsquo;<samp>transfer, t</samp>&rsquo;</dt>
  23717. <dd><p>Set the transfer characteristics.
  23718. </p>
  23719. <p>Possible values are:
  23720. </p><dl compact="compact">
  23721. <dt><var>input</var></dt>
  23722. <dt><var>709</var></dt>
  23723. <dt><var>unspecified</var></dt>
  23724. <dt><var>601</var></dt>
  23725. <dt><var>linear</var></dt>
  23726. <dt><var>2020_10</var></dt>
  23727. <dt><var>2020_12</var></dt>
  23728. <dt><var>smpte2084</var></dt>
  23729. <dt><var>iec61966-2-1</var></dt>
  23730. <dt><var>arib-std-b67</var></dt>
  23731. </dl>
  23732. <p>Default is same as input.
  23733. </p>
  23734. </dd>
  23735. <dt>&lsquo;<samp>matrix, m</samp>&rsquo;</dt>
  23736. <dd><p>Set the colorspace matrix.
  23737. </p>
  23738. <p>Possible value are:
  23739. </p><dl compact="compact">
  23740. <dt><var>input</var></dt>
  23741. <dt><var>709</var></dt>
  23742. <dt><var>unspecified</var></dt>
  23743. <dt><var>470bg</var></dt>
  23744. <dt><var>170m</var></dt>
  23745. <dt><var>2020_ncl</var></dt>
  23746. <dt><var>2020_cl</var></dt>
  23747. </dl>
  23748. <p>Default is same as input.
  23749. </p>
  23750. </dd>
  23751. <dt>&lsquo;<samp>rangein, rin</samp>&rsquo;</dt>
  23752. <dd><p>Set the input color range.
  23753. </p>
  23754. <p>Possible values are:
  23755. </p><dl compact="compact">
  23756. <dt><var>input</var></dt>
  23757. <dt><var>limited</var></dt>
  23758. <dt><var>full</var></dt>
  23759. </dl>
  23760. <p>Default is same as input.
  23761. </p>
  23762. </dd>
  23763. <dt>&lsquo;<samp>primariesin, pin</samp>&rsquo;</dt>
  23764. <dd><p>Set the input color primaries.
  23765. </p>
  23766. <p>Possible values are:
  23767. </p><dl compact="compact">
  23768. <dt><var>input</var></dt>
  23769. <dt><var>709</var></dt>
  23770. <dt><var>unspecified</var></dt>
  23771. <dt><var>170m</var></dt>
  23772. <dt><var>240m</var></dt>
  23773. <dt><var>2020</var></dt>
  23774. </dl>
  23775. <p>Default is same as input.
  23776. </p>
  23777. </dd>
  23778. <dt>&lsquo;<samp>transferin, tin</samp>&rsquo;</dt>
  23779. <dd><p>Set the input transfer characteristics.
  23780. </p>
  23781. <p>Possible values are:
  23782. </p><dl compact="compact">
  23783. <dt><var>input</var></dt>
  23784. <dt><var>709</var></dt>
  23785. <dt><var>unspecified</var></dt>
  23786. <dt><var>601</var></dt>
  23787. <dt><var>linear</var></dt>
  23788. <dt><var>2020_10</var></dt>
  23789. <dt><var>2020_12</var></dt>
  23790. </dl>
  23791. <p>Default is same as input.
  23792. </p>
  23793. </dd>
  23794. <dt>&lsquo;<samp>matrixin, min</samp>&rsquo;</dt>
  23795. <dd><p>Set the input colorspace matrix.
  23796. </p>
  23797. <p>Possible value are:
  23798. </p><dl compact="compact">
  23799. <dt><var>input</var></dt>
  23800. <dt><var>709</var></dt>
  23801. <dt><var>unspecified</var></dt>
  23802. <dt><var>470bg</var></dt>
  23803. <dt><var>170m</var></dt>
  23804. <dt><var>2020_ncl</var></dt>
  23805. <dt><var>2020_cl</var></dt>
  23806. </dl>
  23807. </dd>
  23808. <dt>&lsquo;<samp>chromal, c</samp>&rsquo;</dt>
  23809. <dd><p>Set the output chroma location.
  23810. </p>
  23811. <p>Possible values are:
  23812. </p><dl compact="compact">
  23813. <dt><var>input</var></dt>
  23814. <dt><var>left</var></dt>
  23815. <dt><var>center</var></dt>
  23816. <dt><var>topleft</var></dt>
  23817. <dt><var>top</var></dt>
  23818. <dt><var>bottomleft</var></dt>
  23819. <dt><var>bottom</var></dt>
  23820. </dl>
  23821. </dd>
  23822. <dt>&lsquo;<samp>chromalin, cin</samp>&rsquo;</dt>
  23823. <dd><p>Set the input chroma location.
  23824. </p>
  23825. <p>Possible values are:
  23826. </p><dl compact="compact">
  23827. <dt><var>input</var></dt>
  23828. <dt><var>left</var></dt>
  23829. <dt><var>center</var></dt>
  23830. <dt><var>topleft</var></dt>
  23831. <dt><var>top</var></dt>
  23832. <dt><var>bottomleft</var></dt>
  23833. <dt><var>bottom</var></dt>
  23834. </dl>
  23835. </dd>
  23836. <dt>&lsquo;<samp>npl</samp>&rsquo;</dt>
  23837. <dd><p>Set the nominal peak luminance.
  23838. </p></dd>
  23839. </dl>
  23840. <p>The values of the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options are expressions
  23841. containing the following constants:
  23842. </p>
  23843. <dl compact="compact">
  23844. <dt><var>in_w</var></dt>
  23845. <dt><var>in_h</var></dt>
  23846. <dd><p>The input width and height
  23847. </p>
  23848. </dd>
  23849. <dt><var>iw</var></dt>
  23850. <dt><var>ih</var></dt>
  23851. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  23852. </p>
  23853. </dd>
  23854. <dt><var>out_w</var></dt>
  23855. <dt><var>out_h</var></dt>
  23856. <dd><p>The output (scaled) width and height
  23857. </p>
  23858. </dd>
  23859. <dt><var>ow</var></dt>
  23860. <dt><var>oh</var></dt>
  23861. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>
  23862. </p>
  23863. </dd>
  23864. <dt><var>a</var></dt>
  23865. <dd><p>The same as <var>iw</var> / <var>ih</var>
  23866. </p>
  23867. </dd>
  23868. <dt><var>sar</var></dt>
  23869. <dd><p>input sample aspect ratio
  23870. </p>
  23871. </dd>
  23872. <dt><var>dar</var></dt>
  23873. <dd><p>The input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
  23874. </p>
  23875. </dd>
  23876. <dt><var>hsub</var></dt>
  23877. <dt><var>vsub</var></dt>
  23878. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  23879. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  23880. </p>
  23881. </dd>
  23882. <dt><var>ohsub</var></dt>
  23883. <dt><var>ovsub</var></dt>
  23884. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  23885. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  23886. </p></dd>
  23887. </dl>
  23888. <a name="Commands-22"></a>
  23889. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-22">11.244.2 Commands</a></h3>
  23890. <p>This filter supports the following commands:
  23891. </p><dl compact="compact">
  23892. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23893. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  23894. <dd><p>Set the output video dimension expression.
  23895. The command accepts the same syntax of the corresponding option.
  23896. </p>
  23897. <p>If the specified expression is not valid, it is kept at its current
  23898. value.
  23899. </p></dd>
  23900. </dl>
  23901. <a name="OpenCL-Video-Filters"></a>
  23902. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-OpenCL-Video-Filters">12 OpenCL Video Filters</a></h1>
  23903. <p>Below is a description of the currently available OpenCL video filters.
  23904. </p>
  23905. <p>To enable compilation of these filters you need to configure FFmpeg with
  23906. <code>--enable-opencl</code>.
  23907. </p>
  23908. <p>Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  23909. </p><dl compact="compact">
  23910. <dt>&lsquo;<samp>-init_hw_device opencl[=<var>name</var>][:<var>device</var>[,<var>key=value</var>...]]</samp>&rsquo;</dt>
  23911. <dd><p>Initialise a new hardware device of type <var>opencl</var> called <var>name</var>, using the
  23912. given device parameters.
  23913. </p>
  23914. </dd>
  23915. <dt>&lsquo;<samp>-filter_hw_device <var>name</var></samp>&rsquo;</dt>
  23916. <dd><p>Pass the hardware device called <var>name</var> to all filters in any filter graph.
  23917. </p>
  23918. </dd>
  23919. </dl>
  23920. <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>
  23921. </p>
  23922. <ul>
  23923. <li>
  23924. Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it.
  23925. <div class="example">
  23926. <pre class="example">-init_hw_device opencl=gpu:1.0 -filter_hw_device gpu -i INPUT -vf &quot;hwupload, avgblur_opencl, hwdownload&quot; OUTPUT
  23927. </pre></div>
  23928. </li></ul>
  23929. <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.
  23930. </p>
  23931. <a name="avgblur_005fopencl"></a>
  23932. <h2 class="section"><a href="ffmpeg-filters.html#toc-avgblur_005fopencl">12.1 avgblur_opencl</a></h2>
  23933. <p>Apply average blur filter.
  23934. </p>
  23935. <p>The filter accepts the following options:
  23936. </p>
  23937. <dl compact="compact">
  23938. <dt>&lsquo;<samp>sizeX</samp>&rsquo;</dt>
  23939. <dd><p>Set horizontal radius size.
  23940. Range is <code>[1, 1024]</code> and default value is <code>1</code>.
  23941. </p>
  23942. </dd>
  23943. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  23944. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  23945. </p>
  23946. </dd>
  23947. <dt>&lsquo;<samp>sizeY</samp>&rsquo;</dt>
  23948. <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.
  23949. </p></dd>
  23950. </dl>
  23951. <a name="Example-1"></a>
  23952. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Example-1">12.1.1 Example</a></h3>
  23953. <ul>
  23954. <li>
  23955. 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.
  23956. <div class="example">
  23957. <pre class="example">-i INPUT -vf &quot;hwupload, avgblur_opencl=3, hwdownload&quot; OUTPUT
  23958. </pre></div>
  23959. </li></ul>
  23960. <a name="boxblur_005fopencl"></a>
  23961. <h2 class="section"><a href="ffmpeg-filters.html#toc-boxblur_005fopencl">12.2 boxblur_opencl</a></h2>
  23962. <p>Apply a boxblur algorithm to the input video.
  23963. </p>
  23964. <p>It accepts the following parameters:
  23965. </p>
  23966. <dl compact="compact">
  23967. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  23968. <dt>&lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
  23969. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  23970. <dt>&lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
  23971. <dt>&lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
  23972. <dt>&lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
  23973. </dl>
  23974. <p>A description of the accepted options follows.
  23975. </p>
  23976. <dl compact="compact">
  23977. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  23978. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  23979. <dt>&lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
  23980. <dd><p>Set an expression for the box radius in pixels used for blurring the
  23981. corresponding input plane.
  23982. </p>
  23983. <p>The radius value must be a non-negative number, and must not be
  23984. greater than the value of the expression <code>min(w,h)/2</code> for the
  23985. luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
  23986. planes.
  23987. </p>
  23988. <p>Default value for &lsquo;<samp>luma_radius</samp>&rsquo; is &quot;2&quot;. If not specified,
  23989. &lsquo;<samp>chroma_radius</samp>&rsquo; and &lsquo;<samp>alpha_radius</samp>&rsquo; default to the
  23990. corresponding value set for &lsquo;<samp>luma_radius</samp>&rsquo;.
  23991. </p>
  23992. <p>The expressions can contain the following constants:
  23993. </p><dl compact="compact">
  23994. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  23995. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  23996. <dd><p>The input width and height in pixels.
  23997. </p>
  23998. </dd>
  23999. <dt>&lsquo;<samp>cw</samp>&rsquo;</dt>
  24000. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  24001. <dd><p>The input chroma image width and height in pixels.
  24002. </p>
  24003. </dd>
  24004. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  24005. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  24006. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  24007. pixel format &quot;yuv422p&quot;, <var>hsub</var> is 2 and <var>vsub</var> is 1.
  24008. </p></dd>
  24009. </dl>
  24010. </dd>
  24011. <dt>&lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
  24012. <dt>&lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
  24013. <dt>&lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
  24014. <dd><p>Specify how many times the boxblur filter is applied to the
  24015. corresponding plane.
  24016. </p>
  24017. <p>Default value for &lsquo;<samp>luma_power</samp>&rsquo; is 2. If not specified,
  24018. &lsquo;<samp>chroma_power</samp>&rsquo; and &lsquo;<samp>alpha_power</samp>&rsquo; default to the
  24019. corresponding value set for &lsquo;<samp>luma_power</samp>&rsquo;.
  24020. </p>
  24021. <p>A value of 0 will disable the effect.
  24022. </p></dd>
  24023. </dl>
  24024. <a name="Examples-117"></a>
  24025. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-117">12.2.1 Examples</a></h3>
  24026. <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.
  24027. </p>
  24028. <ul>
  24029. <li>
  24030. Apply a boxblur filter with the luma, chroma, and alpha radius
  24031. 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.
  24032. <div class="example">
  24033. <pre class="example">-i INPUT -vf &quot;hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload&quot; OUTPUT
  24034. -i INPUT -vf &quot;hwupload, boxblur_opencl=2:3, hwdownload&quot; OUTPUT
  24035. </pre></div>
  24036. </li><li>
  24037. 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.
  24038. <p>For the luma plane, a 2x2 box radius will be run once.
  24039. </p>
  24040. <p>For the chroma plane, a 4x4 box radius will be run 5 times.
  24041. </p>
  24042. <p>For the alpha plane, a 3x3 box radius will be run 7 times.
  24043. </p><div class="example">
  24044. <pre class="example">-i INPUT -vf &quot;hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload&quot; OUTPUT
  24045. </pre></div>
  24046. </li></ul>
  24047. <a name="colorkey_005fopencl"></a>
  24048. <h2 class="section"><a href="ffmpeg-filters.html#toc-colorkey_005fopencl">12.3 colorkey_opencl</a></h2>
  24049. <p>RGB colorspace color keying.
  24050. </p>
  24051. <p>The filter accepts the following options:
  24052. </p>
  24053. <dl compact="compact">
  24054. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  24055. <dd><p>The color which will be replaced with transparency.
  24056. </p>
  24057. </dd>
  24058. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  24059. <dd><p>Similarity percentage with the key color.
  24060. </p>
  24061. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  24062. </p>
  24063. </dd>
  24064. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  24065. <dd><p>Blend percentage.
  24066. </p>
  24067. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  24068. </p>
  24069. <p>Higher values result in semi-transparent pixels, with a higher transparency
  24070. the more similar the pixels color is to the key color.
  24071. </p></dd>
  24072. </dl>
  24073. <a name="Examples-10"></a>
  24074. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-10">12.3.1 Examples</a></h3>
  24075. <ul>
  24076. <li>
  24077. Make every semi-green pixel in the input transparent with some slight blending:
  24078. <div class="example">
  24079. <pre class="example">-i INPUT -vf &quot;hwupload, colorkey_opencl=green:0.3:0.1, hwdownload&quot; OUTPUT
  24080. </pre></div>
  24081. </li></ul>
  24082. <a name="convolution_005fopencl"></a>
  24083. <h2 class="section"><a href="ffmpeg-filters.html#toc-convolution_005fopencl">12.4 convolution_opencl</a></h2>
  24084. <p>Apply convolution of 3x3, 5x5, 7x7 matrix.
  24085. </p>
  24086. <p>The filter accepts the following options:
  24087. </p>
  24088. <dl compact="compact">
  24089. <dt>&lsquo;<samp>0m</samp>&rsquo;</dt>
  24090. <dt>&lsquo;<samp>1m</samp>&rsquo;</dt>
  24091. <dt>&lsquo;<samp>2m</samp>&rsquo;</dt>
  24092. <dt>&lsquo;<samp>3m</samp>&rsquo;</dt>
  24093. <dd><p>Set matrix for each plane.
  24094. Matrix is sequence of 9, 25 or 49 signed numbers.
  24095. Default value for each plane is <code>0 0 0 0 1 0 0 0 0</code>.
  24096. </p>
  24097. </dd>
  24098. <dt>&lsquo;<samp>0rdiv</samp>&rsquo;</dt>
  24099. <dt>&lsquo;<samp>1rdiv</samp>&rsquo;</dt>
  24100. <dt>&lsquo;<samp>2rdiv</samp>&rsquo;</dt>
  24101. <dt>&lsquo;<samp>3rdiv</samp>&rsquo;</dt>
  24102. <dd><p>Set multiplier for calculated value for each plane.
  24103. If unset or 0, it will be sum of all matrix elements.
  24104. The option value must be a float number greater or equal to <code>0.0</code>. Default value is <code>1.0</code>.
  24105. </p>
  24106. </dd>
  24107. <dt>&lsquo;<samp>0bias</samp>&rsquo;</dt>
  24108. <dt>&lsquo;<samp>1bias</samp>&rsquo;</dt>
  24109. <dt>&lsquo;<samp>2bias</samp>&rsquo;</dt>
  24110. <dt>&lsquo;<samp>3bias</samp>&rsquo;</dt>
  24111. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  24112. Useful for making the overall image brighter or darker.
  24113. The option value must be a float number greater or equal to <code>0.0</code>. Default value is <code>0.0</code>.
  24114. </p>
  24115. </dd>
  24116. </dl>
  24117. <a name="Examples-115"></a>
  24118. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-115">12.4.1 Examples</a></h3>
  24119. <ul>
  24120. <li>
  24121. Apply sharpen:
  24122. <div class="example">
  24123. <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
  24124. </pre></div>
  24125. </li><li>
  24126. Apply blur:
  24127. <div class="example">
  24128. <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
  24129. </pre></div>
  24130. </li><li>
  24131. Apply edge enhance:
  24132. <div class="example">
  24133. <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
  24134. </pre></div>
  24135. </li><li>
  24136. Apply edge detect:
  24137. <div class="example">
  24138. <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
  24139. </pre></div>
  24140. </li><li>
  24141. Apply laplacian edge detector which includes diagonals:
  24142. <div class="example">
  24143. <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
  24144. </pre></div>
  24145. </li><li>
  24146. Apply emboss:
  24147. <div class="example">
  24148. <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
  24149. </pre></div>
  24150. </li></ul>
  24151. <a name="erosion_005fopencl"></a>
  24152. <h2 class="section"><a href="ffmpeg-filters.html#toc-erosion_005fopencl">12.5 erosion_opencl</a></h2>
  24153. <p>Apply erosion effect to the video.
  24154. </p>
  24155. <p>This filter replaces the pixel by the local(3x3) minimum.
  24156. </p>
  24157. <p>It accepts the following options:
  24158. </p>
  24159. <dl compact="compact">
  24160. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  24161. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  24162. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  24163. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  24164. <dd><p>Limit the maximum change for each plane. Range is <code>[0, 65535]</code> and default value is <code>65535</code>.
  24165. If <code>0</code>, plane will remain unchanged.
  24166. </p>
  24167. </dd>
  24168. <dt>&lsquo;<samp>coordinates</samp>&rsquo;</dt>
  24169. <dd><p>Flag which specifies the pixel to refer to.
  24170. Range is <code>[0, 255]</code> and default value is <code>255</code>, i.e. all eight pixels are used.
  24171. </p>
  24172. <p>Flags to local 3x3 coordinates region centered on <code>x</code>:
  24173. </p>
  24174. <p> 1 2 3
  24175. </p>
  24176. <p> 4 x 5
  24177. </p>
  24178. <p> 6 7 8
  24179. </p></dd>
  24180. </dl>
  24181. <a name="Example-5"></a>
  24182. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Example-5">12.5.1 Example</a></h3>
  24183. <ul>
  24184. <li>
  24185. 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.
  24186. <div class="example">
  24187. <pre class="example">-i INPUT -vf &quot;hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  24188. </pre></div>
  24189. </li></ul>
  24190. <a name="deshake_005fopencl"></a>
  24191. <h2 class="section"><a href="ffmpeg-filters.html#toc-deshake_005fopencl">12.6 deshake_opencl</a></h2>
  24192. <p>Feature-point based video stabilization filter.
  24193. </p>
  24194. <p>The filter accepts the following options:
  24195. </p>
  24196. <dl compact="compact">
  24197. <dt>&lsquo;<samp>tripod</samp>&rsquo;</dt>
  24198. <dd><p>Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to <code>0</code>.
  24199. </p>
  24200. </dd>
  24201. <dt>&lsquo;<samp>debug</samp>&rsquo;</dt>
  24202. <dd><p>Whether or not additional debug info should be displayed, both in the processed output and in the console.
  24203. </p>
  24204. <p>Note that in order to see console debug output you will also need to pass <code>-v verbose</code> to ffmpeg.
  24205. </p>
  24206. <p>Viewing point matches in the output video is only supported for RGB input.
  24207. </p>
  24208. <p>Defaults to <code>0</code>.
  24209. </p>
  24210. </dd>
  24211. <dt>&lsquo;<samp>adaptive_crop</samp>&rsquo;</dt>
  24212. <dd><p>Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels.
  24213. </p>
  24214. <p>Defaults to <code>1</code>.
  24215. </p>
  24216. </dd>
  24217. <dt>&lsquo;<samp>refine_features</samp>&rsquo;</dt>
  24218. <dd><p>Whether or not feature points should be refined at a sub-pixel level.
  24219. </p>
  24220. <p>This can be turned off for a slight performance gain at the cost of precision.
  24221. </p>
  24222. <p>Defaults to <code>1</code>.
  24223. </p>
  24224. </dd>
  24225. <dt>&lsquo;<samp>smooth_strength</samp>&rsquo;</dt>
  24226. <dd><p>The strength of the smoothing applied to the camera path from <code>0.0</code> to <code>1.0</code>.
  24227. </p>
  24228. <p><code>1.0</code> is the maximum smoothing strength while values less than that result in less smoothing.
  24229. </p>
  24230. <p><code>0.0</code> causes the filter to adaptively choose a smoothing strength on a per-frame basis.
  24231. </p>
  24232. <p>Defaults to <code>0.0</code>.
  24233. </p>
  24234. </dd>
  24235. <dt>&lsquo;<samp>smooth_window_multiplier</samp>&rsquo;</dt>
  24236. <dd><p>Controls the size of the smoothing window (the number of frames buffered to determine motion information from).
  24237. </p>
  24238. <p>The size of the smoothing window is determined by multiplying the framerate of the video by this number.
  24239. </p>
  24240. <p>Acceptable values range from <code>0.1</code> to <code>10.0</code>.
  24241. </p>
  24242. <p>Larger values increase the amount of motion data available for determining how to smooth the camera path,
  24243. potentially improving smoothness, but also increase latency and memory usage.
  24244. </p>
  24245. <p>Defaults to <code>2.0</code>.
  24246. </p>
  24247. </dd>
  24248. </dl>
  24249. <a name="Examples-65"></a>
  24250. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-65">12.6.1 Examples</a></h3>
  24251. <ul>
  24252. <li>
  24253. Stabilize a video with a fixed, medium smoothing strength:
  24254. <div class="example">
  24255. <pre class="example">-i INPUT -vf &quot;hwupload, deshake_opencl=smooth_strength=0.5, hwdownload&quot; OUTPUT
  24256. </pre></div>
  24257. </li><li>
  24258. Stabilize a video with debugging (both in console and in rendered video):
  24259. <div class="example">
  24260. <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
  24261. </pre></div>
  24262. </li></ul>
  24263. <a name="dilation_005fopencl"></a>
  24264. <h2 class="section"><a href="ffmpeg-filters.html#toc-dilation_005fopencl">12.7 dilation_opencl</a></h2>
  24265. <p>Apply dilation effect to the video.
  24266. </p>
  24267. <p>This filter replaces the pixel by the local(3x3) maximum.
  24268. </p>
  24269. <p>It accepts the following options:
  24270. </p>
  24271. <dl compact="compact">
  24272. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  24273. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  24274. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  24275. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  24276. <dd><p>Limit the maximum change for each plane. Range is <code>[0, 65535]</code> and default value is <code>65535</code>.
  24277. If <code>0</code>, plane will remain unchanged.
  24278. </p>
  24279. </dd>
  24280. <dt>&lsquo;<samp>coordinates</samp>&rsquo;</dt>
  24281. <dd><p>Flag which specifies the pixel to refer to.
  24282. Range is <code>[0, 255]</code> and default value is <code>255</code>, i.e. all eight pixels are used.
  24283. </p>
  24284. <p>Flags to local 3x3 coordinates region centered on <code>x</code>:
  24285. </p>
  24286. <p> 1 2 3
  24287. </p>
  24288. <p> 4 x 5
  24289. </p>
  24290. <p> 6 7 8
  24291. </p></dd>
  24292. </dl>
  24293. <a name="Example-3"></a>
  24294. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Example-3">12.7.1 Example</a></h3>
  24295. <ul>
  24296. <li>
  24297. 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.
  24298. <div class="example">
  24299. <pre class="example">-i INPUT -vf &quot;hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  24300. </pre></div>
  24301. </li></ul>
  24302. <a name="nlmeans_005fopencl"></a>
  24303. <h2 class="section"><a href="ffmpeg-filters.html#toc-nlmeans_005fopencl">12.8 nlmeans_opencl</a></h2>
  24304. <p>Non-local Means denoise filter through OpenCL, this filter accepts same options as <a href="#nlmeans">nlmeans</a>.
  24305. </p>
  24306. <a name="overlay_005fopencl"></a>
  24307. <h2 class="section"><a href="ffmpeg-filters.html#toc-overlay_005fopencl">12.9 overlay_opencl</a></h2>
  24308. <p>Overlay one video on top of another.
  24309. </p>
  24310. <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.
  24311. This filter requires same memory layout for all the inputs. So, format conversion may be needed.
  24312. </p>
  24313. <p>The filter accepts the following options:
  24314. </p>
  24315. <dl compact="compact">
  24316. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  24317. <dd><p>Set the x coordinate of the overlaid video on the main video.
  24318. Default value is <code>0</code>.
  24319. </p>
  24320. </dd>
  24321. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  24322. <dd><p>Set the y coordinate of the overlaid video on the main video.
  24323. Default value is <code>0</code>.
  24324. </p>
  24325. </dd>
  24326. </dl>
  24327. <a name="Examples-119"></a>
  24328. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-119">12.9.1 Examples</a></h3>
  24329. <ul>
  24330. <li>
  24331. Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format.
  24332. <div class="example">
  24333. <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
  24334. </pre></div>
  24335. </li><li>
  24336. The inputs have same memory layout for color channels , the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p.
  24337. <div class="example">
  24338. <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
  24339. </pre></div>
  24340. </li></ul>
  24341. <a name="pad_005fopencl"></a>
  24342. <h2 class="section"><a href="ffmpeg-filters.html#toc-pad_005fopencl">12.10 pad_opencl</a></h2>
  24343. <p>Add paddings to the input image, and place the original input at the
  24344. provided <var>x</var>, <var>y</var> coordinates.
  24345. </p>
  24346. <p>It accepts the following options:
  24347. </p>
  24348. <dl compact="compact">
  24349. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  24350. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  24351. <dd><p>Specify an expression for the size of the output image with the
  24352. paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
  24353. corresponding input size is used for the output.
  24354. </p>
  24355. <p>The <var>width</var> expression can reference the value set by the
  24356. <var>height</var> expression, and vice versa.
  24357. </p>
  24358. <p>The default value of <var>width</var> and <var>height</var> is 0.
  24359. </p>
  24360. </dd>
  24361. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  24362. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  24363. <dd><p>Specify the offsets to place the input image at within the padded area,
  24364. with respect to the top/left border of the output image.
  24365. </p>
  24366. <p>The <var>x</var> expression can reference the value set by the <var>y</var>
  24367. expression, and vice versa.
  24368. </p>
  24369. <p>The default value of <var>x</var> and <var>y</var> is 0.
  24370. </p>
  24371. <p>If <var>x</var> or <var>y</var> evaluate to a negative number, they&rsquo;ll be changed
  24372. so the input image is centered on the padded area.
  24373. </p>
  24374. </dd>
  24375. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  24376. <dd><p>Specify the color of the padded area. For the syntax of this option,
  24377. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  24378. </p>
  24379. </dd>
  24380. <dt>&lsquo;<samp>aspect</samp>&rsquo;</dt>
  24381. <dd><p>Pad to an aspect instead to a resolution.
  24382. </p></dd>
  24383. </dl>
  24384. <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
  24385. options are expressions containing the following constants:
  24386. </p>
  24387. <dl compact="compact">
  24388. <dt>&lsquo;<samp>in_w</samp>&rsquo;</dt>
  24389. <dt>&lsquo;<samp>in_h</samp>&rsquo;</dt>
  24390. <dd><p>The input video width and height.
  24391. </p>
  24392. </dd>
  24393. <dt>&lsquo;<samp>iw</samp>&rsquo;</dt>
  24394. <dt>&lsquo;<samp>ih</samp>&rsquo;</dt>
  24395. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  24396. </p>
  24397. </dd>
  24398. <dt>&lsquo;<samp>out_w</samp>&rsquo;</dt>
  24399. <dt>&lsquo;<samp>out_h</samp>&rsquo;</dt>
  24400. <dd><p>The output width and height (the size of the padded area), as
  24401. specified by the <var>width</var> and <var>height</var> expressions.
  24402. </p>
  24403. </dd>
  24404. <dt>&lsquo;<samp>ow</samp>&rsquo;</dt>
  24405. <dt>&lsquo;<samp>oh</samp>&rsquo;</dt>
  24406. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  24407. </p>
  24408. </dd>
  24409. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  24410. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  24411. <dd><p>The x and y offsets as specified by the <var>x</var> and <var>y</var>
  24412. expressions, or NAN if not yet specified.
  24413. </p>
  24414. </dd>
  24415. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  24416. <dd><p>same as <var>iw</var> / <var>ih</var>
  24417. </p>
  24418. </dd>
  24419. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  24420. <dd><p>input sample aspect ratio
  24421. </p>
  24422. </dd>
  24423. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  24424. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  24425. </p></dd>
  24426. </dl>
  24427. <a name="prewitt_005fopencl"></a>
  24428. <h2 class="section"><a href="ffmpeg-filters.html#toc-prewitt_005fopencl">12.11 prewitt_opencl</a></h2>
  24429. <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.
  24430. </p>
  24431. <p>The filter accepts the following option:
  24432. </p>
  24433. <dl compact="compact">
  24434. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  24435. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  24436. </p>
  24437. </dd>
  24438. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  24439. <dd><p>Set value which will be multiplied with filtered result.
  24440. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  24441. </p>
  24442. </dd>
  24443. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  24444. <dd><p>Set value which will be added to filtered result.
  24445. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  24446. </p></dd>
  24447. </dl>
  24448. <a name="Example-6"></a>
  24449. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Example-6">12.11.1 Example</a></h3>
  24450. <ul>
  24451. <li>
  24452. Apply the Prewitt operator with scale set to 2 and delta set to 10.
  24453. <div class="example">
  24454. <pre class="example">-i INPUT -vf &quot;hwupload, prewitt_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  24455. </pre></div>
  24456. </li></ul>
  24457. <p><a name="program_005fopencl"></a>
  24458. </p><a name="program_005fopencl-1"></a>
  24459. <h2 class="section"><a href="ffmpeg-filters.html#toc-program_005fopencl-1">12.12 program_opencl</a></h2>
  24460. <p>Filter video using an OpenCL program.
  24461. </p>
  24462. <dl compact="compact">
  24463. <dt>&lsquo;<samp>source</samp>&rsquo;</dt>
  24464. <dd><p>OpenCL program source file.
  24465. </p>
  24466. </dd>
  24467. <dt>&lsquo;<samp>kernel</samp>&rsquo;</dt>
  24468. <dd><p>Kernel name in program.
  24469. </p>
  24470. </dd>
  24471. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  24472. <dd><p>Number of inputs to the filter. Defaults to 1.
  24473. </p>
  24474. </dd>
  24475. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  24476. <dd><p>Size of output frames. Defaults to the same as the first input.
  24477. </p>
  24478. </dd>
  24479. </dl>
  24480. <p>The <code>program_opencl</code> filter also supports the <a href="#framesync">framesync</a> options.
  24481. </p>
  24482. <p>The program source file must contain a kernel function with the given name,
  24483. which will be run once for each plane of the output. Each run on a plane
  24484. gets enqueued as a separate 2D global NDRange with one work-item for each
  24485. pixel to be generated. The global ID offset for each work-item is therefore
  24486. the coordinates of a pixel in the destination image.
  24487. </p>
  24488. <p>The kernel function needs to take the following arguments:
  24489. </p><ul>
  24490. <li>
  24491. Destination image, <var>__write_only image2d_t</var>.
  24492. <p>This image will become the output; the kernel should write all of it.
  24493. </p></li><li>
  24494. Frame index, <var>unsigned int</var>.
  24495. <p>This is a counter starting from zero and increasing by one for each frame.
  24496. </p></li><li>
  24497. Source images, <var>__read_only image2d_t</var>.
  24498. <p>These are the most recent images on each input. The kernel may read from
  24499. them to generate the output, but they can&rsquo;t be written to.
  24500. </p></li></ul>
  24501. <p>Example programs:
  24502. </p>
  24503. <ul>
  24504. <li>
  24505. Copy the input to the output (output must be the same size as the input).
  24506. <pre class="verbatim">__kernel void copy(__write_only image2d_t destination,
  24507. unsigned int index,
  24508. __read_only image2d_t source)
  24509. {
  24510. const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
  24511. int2 location = (int2)(get_global_id(0), get_global_id(1));
  24512. float4 value = read_imagef(source, sampler, location);
  24513. write_imagef(destination, location, value);
  24514. }
  24515. </pre>
  24516. </li><li>
  24517. Apply a simple transformation, rotating the input by an amount increasing
  24518. with the index counter. Pixel values are linearly interpolated by the
  24519. sampler, and the output need not have the same dimensions as the input.
  24520. <pre class="verbatim">__kernel void rotate_image(__write_only image2d_t dst,
  24521. unsigned int index,
  24522. __read_only image2d_t src)
  24523. {
  24524. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  24525. CLK_FILTER_LINEAR);
  24526. float angle = (float)index / 100.0f;
  24527. float2 dst_dim = convert_float2(get_image_dim(dst));
  24528. float2 src_dim = convert_float2(get_image_dim(src));
  24529. float2 dst_cen = dst_dim / 2.0f;
  24530. float2 src_cen = src_dim / 2.0f;
  24531. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  24532. float2 dst_pos = convert_float2(dst_loc) - dst_cen;
  24533. float2 src_pos = {
  24534. cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
  24535. sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
  24536. };
  24537. src_pos = src_pos * src_dim / dst_dim;
  24538. float2 src_loc = src_pos + src_cen;
  24539. if (src_loc.x &lt; 0.0f || src_loc.y &lt; 0.0f ||
  24540. src_loc.x &gt; src_dim.x || src_loc.y &gt; src_dim.y)
  24541. write_imagef(dst, dst_loc, 0.5f);
  24542. else
  24543. write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
  24544. }
  24545. </pre>
  24546. </li><li>
  24547. Blend two inputs together, with the amount of each input used varying
  24548. with the index counter.
  24549. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  24550. unsigned int index,
  24551. __read_only image2d_t src1,
  24552. __read_only image2d_t src2)
  24553. {
  24554. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  24555. CLK_FILTER_LINEAR);
  24556. float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
  24557. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  24558. int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
  24559. int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
  24560. float4 val1 = read_imagef(src1, sampler, src1_loc);
  24561. float4 val2 = read_imagef(src2, sampler, src2_loc);
  24562. write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
  24563. }
  24564. </pre>
  24565. </li></ul>
  24566. <a name="roberts_005fopencl"></a>
  24567. <h2 class="section"><a href="ffmpeg-filters.html#toc-roberts_005fopencl">12.13 roberts_opencl</a></h2>
  24568. <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.
  24569. </p>
  24570. <p>The filter accepts the following option:
  24571. </p>
  24572. <dl compact="compact">
  24573. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  24574. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  24575. </p>
  24576. </dd>
  24577. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  24578. <dd><p>Set value which will be multiplied with filtered result.
  24579. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  24580. </p>
  24581. </dd>
  24582. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  24583. <dd><p>Set value which will be added to filtered result.
  24584. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  24585. </p></dd>
  24586. </dl>
  24587. <a name="Example"></a>
  24588. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Example">12.13.1 Example</a></h3>
  24589. <ul>
  24590. <li>
  24591. Apply the Roberts cross operator with scale set to 2 and delta set to 10
  24592. <div class="example">
  24593. <pre class="example">-i INPUT -vf &quot;hwupload, roberts_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  24594. </pre></div>
  24595. </li></ul>
  24596. <a name="sobel_005fopencl"></a>
  24597. <h2 class="section"><a href="ffmpeg-filters.html#toc-sobel_005fopencl">12.14 sobel_opencl</a></h2>
  24598. <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.
  24599. </p>
  24600. <p>The filter accepts the following option:
  24601. </p>
  24602. <dl compact="compact">
  24603. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  24604. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  24605. </p>
  24606. </dd>
  24607. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  24608. <dd><p>Set value which will be multiplied with filtered result.
  24609. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  24610. </p>
  24611. </dd>
  24612. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  24613. <dd><p>Set value which will be added to filtered result.
  24614. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  24615. </p></dd>
  24616. </dl>
  24617. <a name="Example-4"></a>
  24618. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Example-4">12.14.1 Example</a></h3>
  24619. <ul>
  24620. <li>
  24621. Apply sobel operator with scale set to 2 and delta set to 10
  24622. <div class="example">
  24623. <pre class="example">-i INPUT -vf &quot;hwupload, sobel_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  24624. </pre></div>
  24625. </li></ul>
  24626. <a name="tonemap_005fopencl"></a>
  24627. <h2 class="section"><a href="ffmpeg-filters.html#toc-tonemap_005fopencl">12.15 tonemap_opencl</a></h2>
  24628. <p>Perform HDR(PQ/HLG) to SDR conversion with tone-mapping.
  24629. </p>
  24630. <p>It accepts the following parameters:
  24631. </p>
  24632. <dl compact="compact">
  24633. <dt>&lsquo;<samp>tonemap</samp>&rsquo;</dt>
  24634. <dd><p>Specify the tone-mapping operator to be used. Same as tonemap option in <a href="#tonemap">tonemap</a>.
  24635. </p>
  24636. </dd>
  24637. <dt>&lsquo;<samp>param</samp>&rsquo;</dt>
  24638. <dd><p>Tune the tone mapping algorithm. same as param option in <a href="#tonemap">tonemap</a>.
  24639. </p>
  24640. </dd>
  24641. <dt>&lsquo;<samp>desat</samp>&rsquo;</dt>
  24642. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  24643. higher the parameter, the more color information will be preserved. This
  24644. setting helps prevent unnaturally blown-out colors for super-highlights, by
  24645. (smoothly) turning into white instead. This makes images feel more natural,
  24646. at the cost of reducing information about out-of-range colors.
  24647. </p>
  24648. <p>The default value is 0.5, and the algorithm here is a little different from
  24649. the cpu version tonemap currently. A setting of 0.0 disables this option.
  24650. </p>
  24651. </dd>
  24652. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  24653. <dd><p>The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold
  24654. is used to detect whether the scene has changed or not. If the distance between
  24655. the current frame average brightness and the current running average exceeds
  24656. a threshold value, we would re-calculate scene average and peak brightness.
  24657. The default value is 0.2.
  24658. </p>
  24659. </dd>
  24660. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  24661. <dd><p>Specify the output pixel format.
  24662. </p>
  24663. <p>Currently supported formats are:
  24664. </p><dl compact="compact">
  24665. <dt><var>p010</var></dt>
  24666. <dt><var>nv12</var></dt>
  24667. </dl>
  24668. </dd>
  24669. <dt>&lsquo;<samp>range, r</samp>&rsquo;</dt>
  24670. <dd><p>Set the output color range.
  24671. </p>
  24672. <p>Possible values are:
  24673. </p><dl compact="compact">
  24674. <dt><var>tv/mpeg</var></dt>
  24675. <dt><var>pc/jpeg</var></dt>
  24676. </dl>
  24677. <p>Default is same as input.
  24678. </p>
  24679. </dd>
  24680. <dt>&lsquo;<samp>primaries, p</samp>&rsquo;</dt>
  24681. <dd><p>Set the output color primaries.
  24682. </p>
  24683. <p>Possible values are:
  24684. </p><dl compact="compact">
  24685. <dt><var>bt709</var></dt>
  24686. <dt><var>bt2020</var></dt>
  24687. </dl>
  24688. <p>Default is same as input.
  24689. </p>
  24690. </dd>
  24691. <dt>&lsquo;<samp>transfer, t</samp>&rsquo;</dt>
  24692. <dd><p>Set the output transfer characteristics.
  24693. </p>
  24694. <p>Possible values are:
  24695. </p><dl compact="compact">
  24696. <dt><var>bt709</var></dt>
  24697. <dt><var>bt2020</var></dt>
  24698. </dl>
  24699. <p>Default is bt709.
  24700. </p>
  24701. </dd>
  24702. <dt>&lsquo;<samp>matrix, m</samp>&rsquo;</dt>
  24703. <dd><p>Set the output colorspace matrix.
  24704. </p>
  24705. <p>Possible value are:
  24706. </p><dl compact="compact">
  24707. <dt><var>bt709</var></dt>
  24708. <dt><var>bt2020</var></dt>
  24709. </dl>
  24710. <p>Default is same as input.
  24711. </p>
  24712. </dd>
  24713. </dl>
  24714. <a name="Example-2"></a>
  24715. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Example-2">12.15.1 Example</a></h3>
  24716. <ul>
  24717. <li>
  24718. Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator.
  24719. <div class="example">
  24720. <pre class="example">-i INPUT -vf &quot;format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010&quot; OUTPUT
  24721. </pre></div>
  24722. </li></ul>
  24723. <a name="unsharp_005fopencl"></a>
  24724. <h2 class="section"><a href="ffmpeg-filters.html#toc-unsharp_005fopencl">12.16 unsharp_opencl</a></h2>
  24725. <p>Sharpen or blur the input video.
  24726. </p>
  24727. <p>It accepts the following parameters:
  24728. </p>
  24729. <dl compact="compact">
  24730. <dt>&lsquo;<samp>luma_msize_x, lx</samp>&rsquo;</dt>
  24731. <dd><p>Set the luma matrix horizontal size.
  24732. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  24733. </p>
  24734. </dd>
  24735. <dt>&lsquo;<samp>luma_msize_y, ly</samp>&rsquo;</dt>
  24736. <dd><p>Set the luma matrix vertical size.
  24737. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  24738. </p>
  24739. </dd>
  24740. <dt>&lsquo;<samp>luma_amount, la</samp>&rsquo;</dt>
  24741. <dd><p>Set the luma effect strength.
  24742. Range is <code>[-10, 10]</code> and default value is <code>1.0</code>.
  24743. </p>
  24744. <p>Negative values will blur the input video, while positive values will
  24745. sharpen it, a value of zero will disable the effect.
  24746. </p>
  24747. </dd>
  24748. <dt>&lsquo;<samp>chroma_msize_x, cx</samp>&rsquo;</dt>
  24749. <dd><p>Set the chroma matrix horizontal size.
  24750. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  24751. </p>
  24752. </dd>
  24753. <dt>&lsquo;<samp>chroma_msize_y, cy</samp>&rsquo;</dt>
  24754. <dd><p>Set the chroma matrix vertical size.
  24755. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  24756. </p>
  24757. </dd>
  24758. <dt>&lsquo;<samp>chroma_amount, ca</samp>&rsquo;</dt>
  24759. <dd><p>Set the chroma effect strength.
  24760. Range is <code>[-10, 10]</code> and default value is <code>0.0</code>.
  24761. </p>
  24762. <p>Negative values will blur the input video, while positive values will
  24763. sharpen it, a value of zero will disable the effect.
  24764. </p>
  24765. </dd>
  24766. </dl>
  24767. <p>All parameters are optional and default to the equivalent of the
  24768. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  24769. </p>
  24770. <a name="Examples-136"></a>
  24771. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-136">12.16.1 Examples</a></h3>
  24772. <ul>
  24773. <li>
  24774. Apply strong luma sharpen effect:
  24775. <div class="example">
  24776. <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
  24777. </pre></div>
  24778. </li><li>
  24779. Apply a strong blur of both luma and chroma parameters:
  24780. <div class="example">
  24781. <pre class="example">-i INPUT -vf &quot;hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload&quot; OUTPUT
  24782. </pre></div>
  24783. </li></ul>
  24784. <a name="xfade_005fopencl"></a>
  24785. <h2 class="section"><a href="ffmpeg-filters.html#toc-xfade_005fopencl">12.17 xfade_opencl</a></h2>
  24786. <p>Cross fade two videos with custom transition effect by using OpenCL.
  24787. </p>
  24788. <p>It accepts the following options:
  24789. </p>
  24790. <dl compact="compact">
  24791. <dt>&lsquo;<samp>transition</samp>&rsquo;</dt>
  24792. <dd><p>Set one of possible transition effects.
  24793. </p>
  24794. <dl compact="compact">
  24795. <dt>&lsquo;<samp>custom</samp>&rsquo;</dt>
  24796. <dd><p>Select custom transition effect, the actual transition description
  24797. will be picked from source and kernel options.
  24798. </p>
  24799. </dd>
  24800. <dt>&lsquo;<samp>fade</samp>&rsquo;</dt>
  24801. <dt>&lsquo;<samp>wipeleft</samp>&rsquo;</dt>
  24802. <dt>&lsquo;<samp>wiperight</samp>&rsquo;</dt>
  24803. <dt>&lsquo;<samp>wipeup</samp>&rsquo;</dt>
  24804. <dt>&lsquo;<samp>wipedown</samp>&rsquo;</dt>
  24805. <dt>&lsquo;<samp>slideleft</samp>&rsquo;</dt>
  24806. <dt>&lsquo;<samp>slideright</samp>&rsquo;</dt>
  24807. <dt>&lsquo;<samp>slideup</samp>&rsquo;</dt>
  24808. <dt>&lsquo;<samp>slidedown</samp>&rsquo;</dt>
  24809. <dd>
  24810. <p>Default transition is fade.
  24811. </p></dd>
  24812. </dl>
  24813. </dd>
  24814. <dt>&lsquo;<samp>source</samp>&rsquo;</dt>
  24815. <dd><p>OpenCL program source file for custom transition.
  24816. </p>
  24817. </dd>
  24818. <dt>&lsquo;<samp>kernel</samp>&rsquo;</dt>
  24819. <dd><p>Set name of kernel to use for custom transition from program source file.
  24820. </p>
  24821. </dd>
  24822. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  24823. <dd><p>Set duration of video transition.
  24824. </p>
  24825. </dd>
  24826. <dt>&lsquo;<samp>offset</samp>&rsquo;</dt>
  24827. <dd><p>Set time of start of transition relative to first video.
  24828. </p></dd>
  24829. </dl>
  24830. <p>The program source file must contain a kernel function with the given name,
  24831. which will be run once for each plane of the output. Each run on a plane
  24832. gets enqueued as a separate 2D global NDRange with one work-item for each
  24833. pixel to be generated. The global ID offset for each work-item is therefore
  24834. the coordinates of a pixel in the destination image.
  24835. </p>
  24836. <p>The kernel function needs to take the following arguments:
  24837. </p><ul>
  24838. <li>
  24839. Destination image, <var>__write_only image2d_t</var>.
  24840. <p>This image will become the output; the kernel should write all of it.
  24841. </p>
  24842. </li><li>
  24843. First Source image, <var>__read_only image2d_t</var>.
  24844. Second Source image, <var>__read_only image2d_t</var>.
  24845. <p>These are the most recent images on each input. The kernel may read from
  24846. them to generate the output, but they can&rsquo;t be written to.
  24847. </p>
  24848. </li><li>
  24849. Transition progress, <var>float</var>. This value is always between 0 and 1 inclusive.
  24850. </li></ul>
  24851. <p>Example programs:
  24852. </p>
  24853. <ul>
  24854. <li>
  24855. Apply dots curtain transition effect:
  24856. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  24857. __read_only image2d_t src1,
  24858. __read_only image2d_t src2,
  24859. float progress)
  24860. {
  24861. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  24862. CLK_FILTER_LINEAR);
  24863. int2 p = (int2)(get_global_id(0), get_global_id(1));
  24864. float2 rp = (float2)(get_global_id(0), get_global_id(1));
  24865. float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
  24866. rp = rp / dim;
  24867. float2 dots = (float2)(20.0, 20.0);
  24868. float2 center = (float2)(0,0);
  24869. float2 unused;
  24870. float4 val1 = read_imagef(src1, sampler, p);
  24871. float4 val2 = read_imagef(src2, sampler, p);
  24872. bool next = distance(fract(rp * dots, &amp;unused), (float2)(0.5, 0.5)) &lt; (progress / distance(rp, center));
  24873. write_imagef(dst, p, next ? val1 : val2);
  24874. }
  24875. </pre>
  24876. </li></ul>
  24877. <a name="VAAPI-Video-Filters"></a>
  24878. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-VAAPI-Video-Filters">13 VAAPI Video Filters</a></h1>
  24879. <p>VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters.
  24880. </p>
  24881. <p>To enable compilation of these filters you need to configure FFmpeg with
  24882. <code>--enable-vaapi</code>.
  24883. </p>
  24884. <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>
  24885. </p>
  24886. <a name="tonemap_005fvaapi"></a>
  24887. <h2 class="section"><a href="ffmpeg-filters.html#toc-tonemap_005fvaapi">13.1 tonemap_vaapi</a></h2>
  24888. <p>Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping.
  24889. It maps the dynamic range of HDR10 content to the SDR content.
  24890. It currently only accepts HDR10 as input.
  24891. </p>
  24892. <p>It accepts the following parameters:
  24893. </p>
  24894. <dl compact="compact">
  24895. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  24896. <dd><p>Specify the output pixel format.
  24897. </p>
  24898. <p>Currently supported formats are:
  24899. </p><dl compact="compact">
  24900. <dt><var>p010</var></dt>
  24901. <dt><var>nv12</var></dt>
  24902. </dl>
  24903. <p>Default is nv12.
  24904. </p>
  24905. </dd>
  24906. <dt>&lsquo;<samp>primaries, p</samp>&rsquo;</dt>
  24907. <dd><p>Set the output color primaries.
  24908. </p>
  24909. <p>Default is same as input.
  24910. </p>
  24911. </dd>
  24912. <dt>&lsquo;<samp>transfer, t</samp>&rsquo;</dt>
  24913. <dd><p>Set the output transfer characteristics.
  24914. </p>
  24915. <p>Default is bt709.
  24916. </p>
  24917. </dd>
  24918. <dt>&lsquo;<samp>matrix, m</samp>&rsquo;</dt>
  24919. <dd><p>Set the output colorspace matrix.
  24920. </p>
  24921. <p>Default is same as input.
  24922. </p>
  24923. </dd>
  24924. </dl>
  24925. <a name="Example-7"></a>
  24926. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Example-7">13.1.1 Example</a></h3>
  24927. <ul>
  24928. <li>
  24929. Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format
  24930. <div class="example">
  24931. <pre class="example">tonemap_vaapi=format=p010:t=bt2020-10
  24932. </pre></div>
  24933. </li></ul>
  24934. <a name="Video-Sources"></a>
  24935. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Video-Sources">14 Video Sources</a></h1>
  24936. <p>Below is a description of the currently available video sources.
  24937. </p>
  24938. <a name="buffer"></a>
  24939. <h2 class="section"><a href="ffmpeg-filters.html#toc-buffer">14.1 buffer</a></h2>
  24940. <p>Buffer video frames, and make them available to the filter chain.
  24941. </p>
  24942. <p>This source is mainly intended for a programmatic use, in particular
  24943. through the interface defined in &lsquo;<tt>libavfilter/vsrc_buffer.h</tt>&rsquo;.
  24944. </p>
  24945. <p>It accepts the following parameters:
  24946. </p>
  24947. <dl compact="compact">
  24948. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  24949. <dd><p>Specify the size (width and height) of the buffered video frames. For the
  24950. syntax of this option, check the
  24951. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  24952. </p>
  24953. </dd>
  24954. <dt>&lsquo;<samp>width</samp>&rsquo;</dt>
  24955. <dd><p>The input video width.
  24956. </p>
  24957. </dd>
  24958. <dt>&lsquo;<samp>height</samp>&rsquo;</dt>
  24959. <dd><p>The input video height.
  24960. </p>
  24961. </dd>
  24962. <dt>&lsquo;<samp>pix_fmt</samp>&rsquo;</dt>
  24963. <dd><p>A string representing the pixel format of the buffered video frames.
  24964. It may be a number corresponding to a pixel format, or a pixel format
  24965. name.
  24966. </p>
  24967. </dd>
  24968. <dt>&lsquo;<samp>time_base</samp>&rsquo;</dt>
  24969. <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
  24970. </p>
  24971. </dd>
  24972. <dt>&lsquo;<samp>frame_rate</samp>&rsquo;</dt>
  24973. <dd><p>Specify the frame rate expected for the video stream.
  24974. </p>
  24975. </dd>
  24976. <dt>&lsquo;<samp>pixel_aspect, sar</samp>&rsquo;</dt>
  24977. <dd><p>The sample (pixel) aspect ratio of the input video.
  24978. </p>
  24979. </dd>
  24980. <dt>&lsquo;<samp>sws_param</samp>&rsquo;</dt>
  24981. <dd><p>This option is deprecated and ignored. Prepend <code>sws_flags=<var>flags</var>;</code>
  24982. to the filtergraph description to specify swscale flags for automatically
  24983. inserted scalers. See <a href="#Filtergraph-syntax">Filtergraph syntax</a>.
  24984. </p>
  24985. </dd>
  24986. <dt>&lsquo;<samp>hw_frames_ctx</samp>&rsquo;</dt>
  24987. <dd><p>When using a hardware pixel format, this should be a reference to an
  24988. AVHWFramesContext describing input frames.
  24989. </p></dd>
  24990. </dl>
  24991. <p>For example:
  24992. </p><div class="example">
  24993. <pre class="example">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
  24994. </pre></div>
  24995. <p>will instruct the source to accept video frames with size 320x240 and
  24996. with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
  24997. square pixels (1:1 sample aspect ratio).
  24998. Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
  24999. (check the enum AVPixelFormat definition in &lsquo;<tt>libavutil/pixfmt.h</tt>&rsquo;),
  25000. this example corresponds to:
  25001. </p><div class="example">
  25002. <pre class="example">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
  25003. </pre></div>
  25004. <p>Alternatively, the options can be specified as a flat string, but this
  25005. syntax is deprecated:
  25006. </p>
  25007. <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>
  25008. </p>
  25009. <a name="cellauto"></a>
  25010. <h2 class="section"><a href="ffmpeg-filters.html#toc-cellauto">14.2 cellauto</a></h2>
  25011. <p>Create a pattern generated by an elementary cellular automaton.
  25012. </p>
  25013. <p>The initial state of the cellular automaton can be defined through the
  25014. &lsquo;<samp>filename</samp>&rsquo; and &lsquo;<samp>pattern</samp>&rsquo; options. If such options are
  25015. not specified an initial state is created randomly.
  25016. </p>
  25017. <p>At each new frame a new row in the video is filled with the result of
  25018. the cellular automaton next generation. The behavior when the whole
  25019. frame is filled is defined by the &lsquo;<samp>scroll</samp>&rsquo; option.
  25020. </p>
  25021. <p>This source accepts the following options:
  25022. </p>
  25023. <dl compact="compact">
  25024. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  25025. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  25026. the specified file.
  25027. In the file, each non-whitespace character is considered an alive
  25028. cell, a newline will terminate the row, and further characters in the
  25029. file will be ignored.
  25030. </p>
  25031. </dd>
  25032. <dt>&lsquo;<samp>pattern, p</samp>&rsquo;</dt>
  25033. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  25034. the specified string.
  25035. </p>
  25036. <p>Each non-whitespace character in the string is considered an alive
  25037. cell, a newline will terminate the row, and further characters in the
  25038. string will be ignored.
  25039. </p>
  25040. </dd>
  25041. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  25042. <dd><p>Set the video rate, that is the number of frames generated per second.
  25043. Default is 25.
  25044. </p>
  25045. </dd>
  25046. <dt>&lsquo;<samp>random_fill_ratio, ratio</samp>&rsquo;</dt>
  25047. <dd><p>Set the random fill ratio for the initial cellular automaton row. It
  25048. is a floating point number value ranging from 0 to 1, defaults to
  25049. 1/PHI.
  25050. </p>
  25051. <p>This option is ignored when a file or a pattern is specified.
  25052. </p>
  25053. </dd>
  25054. <dt>&lsquo;<samp>random_seed, seed</samp>&rsquo;</dt>
  25055. <dd><p>Set the seed for filling randomly the initial row, must be an integer
  25056. included between 0 and UINT32_MAX. If not specified, or if explicitly
  25057. set to -1, the filter will try to use a good random seed on a best
  25058. effort basis.
  25059. </p>
  25060. </dd>
  25061. <dt>&lsquo;<samp>rule</samp>&rsquo;</dt>
  25062. <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
  25063. Default value is 110.
  25064. </p>
  25065. </dd>
  25066. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  25067. <dd><p>Set the size of the output video. For the syntax of this option, check the
  25068. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  25069. </p>
  25070. <p>If &lsquo;<samp>filename</samp>&rsquo; or &lsquo;<samp>pattern</samp>&rsquo; is specified, the size is set
  25071. by default to the width of the specified initial state row, and the
  25072. height is set to <var>width</var> * PHI.
  25073. </p>
  25074. <p>If &lsquo;<samp>size</samp>&rsquo; is set, it must contain the width of the specified
  25075. pattern string, and the specified pattern will be centered in the
  25076. larger row.
  25077. </p>
  25078. <p>If a filename or a pattern string is not specified, the size value
  25079. defaults to &quot;320x518&quot; (used for a randomly generated initial state).
  25080. </p>
  25081. </dd>
  25082. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  25083. <dd><p>If set to 1, scroll the output upward when all the rows in the output
  25084. have been already filled. If set to 0, the new generated row will be
  25085. written over the top row just after the bottom row is filled.
  25086. Defaults to 1.
  25087. </p>
  25088. </dd>
  25089. <dt>&lsquo;<samp>start_full, full</samp>&rsquo;</dt>
  25090. <dd><p>If set to 1, completely fill the output with generated rows before
  25091. outputting the first frame.
  25092. This is the default behavior, for disabling set the value to 0.
  25093. </p>
  25094. </dd>
  25095. <dt>&lsquo;<samp>stitch</samp>&rsquo;</dt>
  25096. <dd><p>If set to 1, stitch the left and right row edges together.
  25097. This is the default behavior, for disabling set the value to 0.
  25098. </p></dd>
  25099. </dl>
  25100. <a name="Examples-131"></a>
  25101. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-131">14.2.1 Examples</a></h3>
  25102. <ul>
  25103. <li>
  25104. Read the initial state from &lsquo;<tt>pattern</tt>&rsquo;, and specify an output of
  25105. size 200x400.
  25106. <div class="example">
  25107. <pre class="example">cellauto=f=pattern:s=200x400
  25108. </pre></div>
  25109. </li><li>
  25110. Generate a random initial row with a width of 200 cells, with a fill
  25111. ratio of 2/3:
  25112. <div class="example">
  25113. <pre class="example">cellauto=ratio=2/3:s=200x200
  25114. </pre></div>
  25115. </li><li>
  25116. Create a pattern generated by rule 18 starting by a single alive cell
  25117. centered on an initial row with width 100:
  25118. <div class="example">
  25119. <pre class="example">cellauto=p=@:s=100x400:full=0:rule=18
  25120. </pre></div>
  25121. </li><li>
  25122. Specify a more elaborated initial pattern:
  25123. <div class="example">
  25124. <pre class="example">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
  25125. </pre></div>
  25126. </li></ul>
  25127. <p><a name="coreimagesrc"></a>
  25128. </p><a name="coreimagesrc-1"></a>
  25129. <h2 class="section"><a href="ffmpeg-filters.html#toc-coreimagesrc-1">14.3 coreimagesrc</a></h2>
  25130. <p>Video source generated on GPU using Apple&rsquo;s CoreImage API on OSX.
  25131. </p>
  25132. <p>This video source is a specialized version of the <a href="#coreimage">coreimage</a> video filter.
  25133. Use a core image generator at the beginning of the applied filterchain to
  25134. generate the content.
  25135. </p>
  25136. <p>The coreimagesrc video source accepts the following options:
  25137. </p><dl compact="compact">
  25138. <dt>&lsquo;<samp>list_generators</samp>&rsquo;</dt>
  25139. <dd><p>List all available generators along with all their respective options as well as
  25140. possible minimum and maximum values along with the default values.
  25141. </p><div class="example">
  25142. <pre class="example">list_generators=true
  25143. </pre></div>
  25144. </dd>
  25145. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  25146. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  25147. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  25148. The default value is <code>320x240</code>.
  25149. </p>
  25150. </dd>
  25151. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  25152. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  25153. generated per second. It has to be a string in the format
  25154. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  25155. number or a valid video frame rate abbreviation. The default value is
  25156. &quot;25&quot;.
  25157. </p>
  25158. </dd>
  25159. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  25160. <dd><p>Set the sample aspect ratio of the sourced video.
  25161. </p>
  25162. </dd>
  25163. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  25164. <dd><p>Set the duration of the sourced video. See
  25165. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  25166. for the accepted syntax.
  25167. </p>
  25168. <p>If not specified, or the expressed duration is negative, the video is
  25169. supposed to be generated forever.
  25170. </p></dd>
  25171. </dl>
  25172. <p>Additionally, all options of the <a href="#coreimage">coreimage</a> video filter are accepted.
  25173. A complete filterchain can be used for further processing of the
  25174. generated input without CPU-HOST transfer. See <a href="#coreimage">coreimage</a> documentation
  25175. and examples for details.
  25176. </p>
  25177. <a name="Examples-62"></a>
  25178. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-62">14.3.1 Examples</a></h3>
  25179. <ul>
  25180. <li>
  25181. Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  25182. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  25183. <div class="example">
  25184. <pre class="example">ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  25185. </pre></div>
  25186. <p>This example is equivalent to the QRCode example of <a href="#coreimage">coreimage</a> without the
  25187. need for a nullsrc video source.
  25188. </p></li></ul>
  25189. <a name="gradients"></a>
  25190. <h2 class="section"><a href="ffmpeg-filters.html#toc-gradients">14.4 gradients</a></h2>
  25191. <p>Generate several gradients.
  25192. </p>
  25193. <dl compact="compact">
  25194. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  25195. <dd><p>Set frame size. For the syntax of this option, check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  25196. </p>
  25197. </dd>
  25198. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  25199. <dd><p>Set frame rate, expressed as number of frames per second. Default
  25200. value is &quot;25&quot;.
  25201. </p>
  25202. </dd>
  25203. <dt>&lsquo;<samp>c0, c1, c2, c3, c4, c5, c6, c7</samp>&rsquo;</dt>
  25204. <dd><p>Set 8 colors. Default values for colors is to pick random one.
  25205. </p>
  25206. </dd>
  25207. <dt>&lsquo;<samp>x0, y0, y0, y1</samp>&rsquo;</dt>
  25208. <dd><p>Set gradient line source and destination points. If negative or out of range, random ones
  25209. are picked.
  25210. </p>
  25211. </dd>
  25212. <dt>&lsquo;<samp>nb_colors, n</samp>&rsquo;</dt>
  25213. <dd><p>Set number of colors to use at once. Allowed range is from 2 to 8. Default value is 2.
  25214. </p>
  25215. </dd>
  25216. <dt>&lsquo;<samp>seed</samp>&rsquo;</dt>
  25217. <dd><p>Set seed for picking gradient line points.
  25218. </p></dd>
  25219. </dl>
  25220. <a name="mandelbrot"></a>
  25221. <h2 class="section"><a href="ffmpeg-filters.html#toc-mandelbrot">14.5 mandelbrot</a></h2>
  25222. <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
  25223. point specified with <var>start_x</var> and <var>start_y</var>.
  25224. </p>
  25225. <p>This source accepts the following options:
  25226. </p>
  25227. <dl compact="compact">
  25228. <dt>&lsquo;<samp>end_pts</samp>&rsquo;</dt>
  25229. <dd><p>Set the terminal pts value. Default value is 400.
  25230. </p>
  25231. </dd>
  25232. <dt>&lsquo;<samp>end_scale</samp>&rsquo;</dt>
  25233. <dd><p>Set the terminal scale value.
  25234. Must be a floating point value. Default value is 0.3.
  25235. </p>
  25236. </dd>
  25237. <dt>&lsquo;<samp>inner</samp>&rsquo;</dt>
  25238. <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
  25239. Mandelbrot fractal internal region.
  25240. </p>
  25241. <p>It shall assume one of the following values:
  25242. </p><dl compact="compact">
  25243. <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
  25244. <dd><p>Set black mode.
  25245. </p></dd>
  25246. <dt>&lsquo;<samp>convergence</samp>&rsquo;</dt>
  25247. <dd><p>Show time until convergence.
  25248. </p></dd>
  25249. <dt>&lsquo;<samp>mincol</samp>&rsquo;</dt>
  25250. <dd><p>Set color based on point closest to the origin of the iterations.
  25251. </p></dd>
  25252. <dt>&lsquo;<samp>period</samp>&rsquo;</dt>
  25253. <dd><p>Set period mode.
  25254. </p></dd>
  25255. </dl>
  25256. <p>Default value is <var>mincol</var>.
  25257. </p>
  25258. </dd>
  25259. <dt>&lsquo;<samp>bailout</samp>&rsquo;</dt>
  25260. <dd><p>Set the bailout value. Default value is 10.0.
  25261. </p>
  25262. </dd>
  25263. <dt>&lsquo;<samp>maxiter</samp>&rsquo;</dt>
  25264. <dd><p>Set the maximum of iterations performed by the rendering
  25265. algorithm. Default value is 7189.
  25266. </p>
  25267. </dd>
  25268. <dt>&lsquo;<samp>outer</samp>&rsquo;</dt>
  25269. <dd><p>Set outer coloring mode.
  25270. It shall assume one of following values:
  25271. </p><dl compact="compact">
  25272. <dt>&lsquo;<samp>iteration_count</samp>&rsquo;</dt>
  25273. <dd><p>Set iteration count mode.
  25274. </p></dd>
  25275. <dt>&lsquo;<samp>normalized_iteration_count</samp>&rsquo;</dt>
  25276. <dd><p>set normalized iteration count mode.
  25277. </p></dd>
  25278. </dl>
  25279. <p>Default value is <var>normalized_iteration_count</var>.
  25280. </p>
  25281. </dd>
  25282. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  25283. <dd><p>Set frame rate, expressed as number of frames per second. Default
  25284. value is &quot;25&quot;.
  25285. </p>
  25286. </dd>
  25287. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  25288. <dd><p>Set frame size. For the syntax of this option, check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  25289. </p>
  25290. </dd>
  25291. <dt>&lsquo;<samp>start_scale</samp>&rsquo;</dt>
  25292. <dd><p>Set the initial scale value. Default value is 3.0.
  25293. </p>
  25294. </dd>
  25295. <dt>&lsquo;<samp>start_x</samp>&rsquo;</dt>
  25296. <dd><p>Set the initial x position. Must be a floating point value between
  25297. -100 and 100. Default value is -0.743643887037158704752191506114774.
  25298. </p>
  25299. </dd>
  25300. <dt>&lsquo;<samp>start_y</samp>&rsquo;</dt>
  25301. <dd><p>Set the initial y position. Must be a floating point value between
  25302. -100 and 100. Default value is -0.131825904205311970493132056385139.
  25303. </p></dd>
  25304. </dl>
  25305. <a name="mptestsrc"></a>
  25306. <h2 class="section"><a href="ffmpeg-filters.html#toc-mptestsrc">14.6 mptestsrc</a></h2>
  25307. <p>Generate various test patterns, as generated by the MPlayer test filter.
  25308. </p>
  25309. <p>The size of the generated video is fixed, and is 256x256.
  25310. This source is useful in particular for testing encoding features.
  25311. </p>
  25312. <p>This source accepts the following options:
  25313. </p>
  25314. <dl compact="compact">
  25315. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  25316. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  25317. generated per second. It has to be a string in the format
  25318. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  25319. number or a valid video frame rate abbreviation. The default value is
  25320. &quot;25&quot;.
  25321. </p>
  25322. </dd>
  25323. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  25324. <dd><p>Set the duration of the sourced video. See
  25325. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  25326. for the accepted syntax.
  25327. </p>
  25328. <p>If not specified, or the expressed duration is negative, the video is
  25329. supposed to be generated forever.
  25330. </p>
  25331. </dd>
  25332. <dt>&lsquo;<samp>test, t</samp>&rsquo;</dt>
  25333. <dd>
  25334. <p>Set the number or the name of the test to perform. Supported tests are:
  25335. </p><dl compact="compact">
  25336. <dt>&lsquo;<samp>dc_luma</samp>&rsquo;</dt>
  25337. <dt>&lsquo;<samp>dc_chroma</samp>&rsquo;</dt>
  25338. <dt>&lsquo;<samp>freq_luma</samp>&rsquo;</dt>
  25339. <dt>&lsquo;<samp>freq_chroma</samp>&rsquo;</dt>
  25340. <dt>&lsquo;<samp>amp_luma</samp>&rsquo;</dt>
  25341. <dt>&lsquo;<samp>amp_chroma</samp>&rsquo;</dt>
  25342. <dt>&lsquo;<samp>cbp</samp>&rsquo;</dt>
  25343. <dt>&lsquo;<samp>mv</samp>&rsquo;</dt>
  25344. <dt>&lsquo;<samp>ring1</samp>&rsquo;</dt>
  25345. <dt>&lsquo;<samp>ring2</samp>&rsquo;</dt>
  25346. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  25347. <dt>&lsquo;<samp>max_frames, m</samp>&rsquo;</dt>
  25348. <dd><p>Set the maximum number of frames generated for each test, default value is 30.
  25349. </p>
  25350. </dd>
  25351. </dl>
  25352. <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
  25353. </p></dd>
  25354. </dl>
  25355. <p>Some examples:
  25356. </p><div class="example">
  25357. <pre class="example">mptestsrc=t=dc_luma
  25358. </pre></div>
  25359. <p>will generate a &quot;dc_luma&quot; test pattern.
  25360. </p>
  25361. <a name="frei0r_005fsrc"></a>
  25362. <h2 class="section"><a href="ffmpeg-filters.html#toc-frei0r_005fsrc">14.7 frei0r_src</a></h2>
  25363. <p>Provide a frei0r source.
  25364. </p>
  25365. <p>To enable compilation of this filter you need to install the frei0r
  25366. header and configure FFmpeg with <code>--enable-frei0r</code>.
  25367. </p>
  25368. <p>This source accepts the following parameters:
  25369. </p>
  25370. <dl compact="compact">
  25371. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  25372. <dd><p>The size of the video to generate. For the syntax of this option, check the
  25373. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  25374. </p>
  25375. </dd>
  25376. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  25377. <dd><p>The framerate of the generated video. It may be a string of the form
  25378. <var>num</var>/<var>den</var> or a frame rate abbreviation.
  25379. </p>
  25380. </dd>
  25381. <dt>&lsquo;<samp>filter_name</samp>&rsquo;</dt>
  25382. <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
  25383. how to set the parameters, read the <a href="#frei0r">frei0r</a> section in the video filters
  25384. documentation.
  25385. </p>
  25386. </dd>
  25387. <dt>&lsquo;<samp>filter_params</samp>&rsquo;</dt>
  25388. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
  25389. </p>
  25390. </dd>
  25391. </dl>
  25392. <p>For example, to generate a frei0r partik0l source with size 200x200
  25393. and frame rate 10 which is overlaid on the overlay filter main input:
  25394. </p><div class="example">
  25395. <pre class="example">frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
  25396. </pre></div>
  25397. <a name="life"></a>
  25398. <h2 class="section"><a href="ffmpeg-filters.html#toc-life">14.8 life</a></h2>
  25399. <p>Generate a life pattern.
  25400. </p>
  25401. <p>This source is based on a generalization of John Conway&rsquo;s life game.
  25402. </p>
  25403. <p>The sourced input represents a life grid, each pixel represents a cell
  25404. which can be in one of two possible states, alive or dead. Every cell
  25405. interacts with its eight neighbours, which are the cells that are
  25406. horizontally, vertically, or diagonally adjacent.
  25407. </p>
  25408. <p>At each interaction the grid evolves according to the adopted rule,
  25409. which specifies the number of neighbor alive cells which will make a
  25410. cell stay alive or born. The &lsquo;<samp>rule</samp>&rsquo; option allows one to specify
  25411. the rule to adopt.
  25412. </p>
  25413. <p>This source accepts the following options:
  25414. </p>
  25415. <dl compact="compact">
  25416. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  25417. <dd><p>Set the file from which to read the initial grid state. In the file,
  25418. each non-whitespace character is considered an alive cell, and newline
  25419. is used to delimit the end of each row.
  25420. </p>
  25421. <p>If this option is not specified, the initial grid is generated
  25422. randomly.
  25423. </p>
  25424. </dd>
  25425. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  25426. <dd><p>Set the video rate, that is the number of frames generated per second.
  25427. Default is 25.
  25428. </p>
  25429. </dd>
  25430. <dt>&lsquo;<samp>random_fill_ratio, ratio</samp>&rsquo;</dt>
  25431. <dd><p>Set the random fill ratio for the initial random grid. It is a
  25432. floating point number value ranging from 0 to 1, defaults to 1/PHI.
  25433. It is ignored when a file is specified.
  25434. </p>
  25435. </dd>
  25436. <dt>&lsquo;<samp>random_seed, seed</samp>&rsquo;</dt>
  25437. <dd><p>Set the seed for filling the initial random grid, must be an integer
  25438. included between 0 and UINT32_MAX. If not specified, or if explicitly
  25439. set to -1, the filter will try to use a good random seed on a best
  25440. effort basis.
  25441. </p>
  25442. </dd>
  25443. <dt>&lsquo;<samp>rule</samp>&rsquo;</dt>
  25444. <dd><p>Set the life rule.
  25445. </p>
  25446. <p>A rule can be specified with a code of the kind &quot;S<var>NS</var>/B<var>NB</var>&quot;,
  25447. where <var>NS</var> and <var>NB</var> are sequences of numbers in the range 0-8,
  25448. <var>NS</var> specifies the number of alive neighbor cells which make a
  25449. live cell stay alive, and <var>NB</var> the number of alive neighbor cells
  25450. which make a dead cell to become alive (i.e. to &quot;born&quot;).
  25451. &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
  25452. </p>
  25453. <p>Alternatively a rule can be specified by an 18-bits integer. The 9
  25454. high order bits are used to encode the next cell state if it is alive
  25455. for each number of neighbor alive cells, the low order bits specify
  25456. the rule for &quot;borning&quot; new cells. Higher order bits encode for an
  25457. higher number of neighbor cells.
  25458. For example the number 6153 = <code>(12&lt;&lt;9)+9</code> specifies a stay alive
  25459. rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
  25460. </p>
  25461. <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;s game of life
  25462. rule, and will keep a cell alive if it has 2 or 3 neighbor alive
  25463. cells, and will born a new cell if there are three alive cells around
  25464. a dead cell.
  25465. </p>
  25466. </dd>
  25467. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  25468. <dd><p>Set the size of the output video. For the syntax of this option, check the
  25469. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  25470. </p>
  25471. <p>If &lsquo;<samp>filename</samp>&rsquo; is specified, the size is set by default to the
  25472. same size of the input file. If &lsquo;<samp>size</samp>&rsquo; is set, it must contain
  25473. the size specified in the input file, and the initial grid defined in
  25474. that file is centered in the larger resulting area.
  25475. </p>
  25476. <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
  25477. (used for a randomly generated initial grid).
  25478. </p>
  25479. </dd>
  25480. <dt>&lsquo;<samp>stitch</samp>&rsquo;</dt>
  25481. <dd><p>If set to 1, stitch the left and right grid edges together, and the
  25482. top and bottom edges also. Defaults to 1.
  25483. </p>
  25484. </dd>
  25485. <dt>&lsquo;<samp>mold</samp>&rsquo;</dt>
  25486. <dd><p>Set cell mold speed. If set, a dead cell will go from &lsquo;<samp>death_color</samp>&rsquo; to
  25487. &lsquo;<samp>mold_color</samp>&rsquo; with a step of &lsquo;<samp>mold</samp>&rsquo;. &lsquo;<samp>mold</samp>&rsquo; can have a
  25488. value from 0 to 255.
  25489. </p>
  25490. </dd>
  25491. <dt>&lsquo;<samp>life_color</samp>&rsquo;</dt>
  25492. <dd><p>Set the color of living (or new born) cells.
  25493. </p>
  25494. </dd>
  25495. <dt>&lsquo;<samp>death_color</samp>&rsquo;</dt>
  25496. <dd><p>Set the color of dead cells. If &lsquo;<samp>mold</samp>&rsquo; is set, this is the first color
  25497. used to represent a dead cell.
  25498. </p>
  25499. </dd>
  25500. <dt>&lsquo;<samp>mold_color</samp>&rsquo;</dt>
  25501. <dd><p>Set mold color, for definitely dead and moldy cells.
  25502. </p>
  25503. <p>For the syntax of these 3 color options, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  25504. </p></dd>
  25505. </dl>
  25506. <a name="Examples-38"></a>
  25507. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-38">14.8.1 Examples</a></h3>
  25508. <ul>
  25509. <li>
  25510. Read a grid from &lsquo;<tt>pattern</tt>&rsquo;, and center it on a grid of size
  25511. 300x300 pixels:
  25512. <div class="example">
  25513. <pre class="example">life=f=pattern:s=300x300
  25514. </pre></div>
  25515. </li><li>
  25516. Generate a random grid of size 200x200, with a fill ratio of 2/3:
  25517. <div class="example">
  25518. <pre class="example">life=ratio=2/3:s=200x200
  25519. </pre></div>
  25520. </li><li>
  25521. Specify a custom rule for evolving a randomly generated grid:
  25522. <div class="example">
  25523. <pre class="example">life=rule=S14/B34
  25524. </pre></div>
  25525. </li><li>
  25526. Full example with slow death effect (mold) using <code>ffplay</code>:
  25527. <div class="example">
  25528. <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
  25529. </pre></div>
  25530. </li></ul>
  25531. <p><a name="allrgb"></a>
  25532. <a name="allyuv"></a>
  25533. <a name="color"></a>
  25534. <a name="haldclutsrc"></a>
  25535. <a name="nullsrc"></a>
  25536. <a name="pal75bars"></a>
  25537. <a name="pal100bars"></a>
  25538. <a name="rgbtestsrc"></a>
  25539. <a name="smptebars"></a>
  25540. <a name="smptehdbars"></a>
  25541. <a name="testsrc"></a>
  25542. <a name="testsrc2"></a>
  25543. <a name="yuvtestsrc"></a>
  25544. </p><a name="allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc"></a>
  25545. <h2 class="section"><a href="ffmpeg-filters.html#toc-allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc">14.9 allrgb, allyuv, color, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a></h2>
  25546. <p>The <code>allrgb</code> source returns frames of size 4096x4096 of all rgb colors.
  25547. </p>
  25548. <p>The <code>allyuv</code> source returns frames of size 4096x4096 of all yuv colors.
  25549. </p>
  25550. <p>The <code>color</code> source provides an uniformly colored input.
  25551. </p>
  25552. <p>The <code>haldclutsrc</code> source provides an identity Hald CLUT. See also
  25553. <a href="#haldclut">haldclut</a> filter.
  25554. </p>
  25555. <p>The <code>nullsrc</code> source returns unprocessed video frames. It is
  25556. mainly useful to be employed in analysis / debugging tools, or as the
  25557. source for filters which ignore the input data.
  25558. </p>
  25559. <p>The <code>pal75bars</code> source generates a color bars pattern, based on
  25560. EBU PAL recommendations with 75% color levels.
  25561. </p>
  25562. <p>The <code>pal100bars</code> source generates a color bars pattern, based on
  25563. EBU PAL recommendations with 100% color levels.
  25564. </p>
  25565. <p>The <code>rgbtestsrc</code> source generates an RGB test pattern useful for
  25566. detecting RGB vs BGR issues. You should see a red, green and blue
  25567. stripe from top to bottom.
  25568. </p>
  25569. <p>The <code>smptebars</code> source generates a color bars pattern, based on
  25570. the SMPTE Engineering Guideline EG 1-1990.
  25571. </p>
  25572. <p>The <code>smptehdbars</code> source generates a color bars pattern, based on
  25573. the SMPTE RP 219-2002.
  25574. </p>
  25575. <p>The <code>testsrc</code> source generates a test video pattern, showing a
  25576. color pattern, a scrolling gradient and a timestamp. This is mainly
  25577. intended for testing purposes.
  25578. </p>
  25579. <p>The <code>testsrc2</code> source is similar to testsrc, but supports more
  25580. pixel formats instead of just <code>rgb24</code>. This allows using it as an
  25581. input for other tests without requiring a format conversion.
  25582. </p>
  25583. <p>The <code>yuvtestsrc</code> source generates an YUV test pattern. You should
  25584. see a y, cb and cr stripe from top to bottom.
  25585. </p>
  25586. <p>The sources accept the following parameters:
  25587. </p>
  25588. <dl compact="compact">
  25589. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  25590. <dd><p>Specify the level of the Hald CLUT, only available in the <code>haldclutsrc</code>
  25591. source. A level of <code>N</code> generates a picture of <code>N*N*N</code> by <code>N*N*N</code>
  25592. pixels to be used as identity matrix for 3D lookup tables. Each component is
  25593. coded on a <code>1/(N*N)</code> scale.
  25594. </p>
  25595. </dd>
  25596. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  25597. <dd><p>Specify the color of the source, only available in the <code>color</code>
  25598. source. For the syntax of this option, check the
  25599. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  25600. </p>
  25601. </dd>
  25602. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  25603. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  25604. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  25605. The default value is <code>320x240</code>.
  25606. </p>
  25607. <p>This option is not available with the <code>allrgb</code>, <code>allyuv</code>, and
  25608. <code>haldclutsrc</code> filters.
  25609. </p>
  25610. </dd>
  25611. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  25612. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  25613. generated per second. It has to be a string in the format
  25614. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  25615. number or a valid video frame rate abbreviation. The default value is
  25616. &quot;25&quot;.
  25617. </p>
  25618. </dd>
  25619. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  25620. <dd><p>Set the duration of the sourced video. See
  25621. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  25622. for the accepted syntax.
  25623. </p>
  25624. <p>If not specified, or the expressed duration is negative, the video is
  25625. supposed to be generated forever.
  25626. </p>
  25627. </dd>
  25628. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  25629. <dd><p>Set the sample aspect ratio of the sourced video.
  25630. </p>
  25631. </dd>
  25632. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  25633. <dd><p>Specify the alpha (opacity) of the background, only available in the
  25634. <code>testsrc2</code> source. The value must be between 0 (fully transparent) and
  25635. 255 (fully opaque, the default).
  25636. </p>
  25637. </dd>
  25638. <dt>&lsquo;<samp>decimals, n</samp>&rsquo;</dt>
  25639. <dd><p>Set the number of decimals to show in the timestamp, only available in the
  25640. <code>testsrc</code> source.
  25641. </p>
  25642. <p>The displayed timestamp value will correspond to the original
  25643. timestamp value multiplied by the power of 10 of the specified
  25644. value. Default value is 0.
  25645. </p></dd>
  25646. </dl>
  25647. <a name="Examples-24"></a>
  25648. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-24">14.9.1 Examples</a></h3>
  25649. <ul>
  25650. <li>
  25651. Generate a video with a duration of 5.3 seconds, with size
  25652. 176x144 and a frame rate of 10 frames per second:
  25653. <div class="example">
  25654. <pre class="example">testsrc=duration=5.3:size=qcif:rate=10
  25655. </pre></div>
  25656. </li><li>
  25657. The following graph description will generate a red source
  25658. with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
  25659. frames per second:
  25660. <div class="example">
  25661. <pre class="example">color=c=red@0.2:s=qcif:r=10
  25662. </pre></div>
  25663. </li><li>
  25664. If the input content is to be ignored, <code>nullsrc</code> can be used. The
  25665. following command generates noise in the luminance plane by employing
  25666. the <code>geq</code> filter:
  25667. <div class="example">
  25668. <pre class="example">nullsrc=s=256x256, geq=random(1)*255:128:128
  25669. </pre></div>
  25670. </li></ul>
  25671. <a name="Commands-25"></a>
  25672. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-25">14.9.2 Commands</a></h3>
  25673. <p>The <code>color</code> source supports the following commands:
  25674. </p>
  25675. <dl compact="compact">
  25676. <dt>&lsquo;<samp>c, color</samp>&rsquo;</dt>
  25677. <dd><p>Set the color of the created image. Accepts the same syntax of the
  25678. corresponding &lsquo;<samp>color</samp>&rsquo; option.
  25679. </p></dd>
  25680. </dl>
  25681. <a name="openclsrc"></a>
  25682. <h2 class="section"><a href="ffmpeg-filters.html#toc-openclsrc">14.10 openclsrc</a></h2>
  25683. <p>Generate video using an OpenCL program.
  25684. </p>
  25685. <dl compact="compact">
  25686. <dt>&lsquo;<samp>source</samp>&rsquo;</dt>
  25687. <dd><p>OpenCL program source file.
  25688. </p>
  25689. </dd>
  25690. <dt>&lsquo;<samp>kernel</samp>&rsquo;</dt>
  25691. <dd><p>Kernel name in program.
  25692. </p>
  25693. </dd>
  25694. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  25695. <dd><p>Size of frames to generate. This must be set.
  25696. </p>
  25697. </dd>
  25698. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  25699. <dd><p>Pixel format to use for the generated frames. This must be set.
  25700. </p>
  25701. </dd>
  25702. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  25703. <dd><p>Number of frames generated every second. Default value is &rsquo;25&rsquo;.
  25704. </p>
  25705. </dd>
  25706. </dl>
  25707. <p>For details of how the program loading works, see the <a href="#program_005fopencl">program_opencl</a>
  25708. filter.
  25709. </p>
  25710. <p>Example programs:
  25711. </p>
  25712. <ul>
  25713. <li>
  25714. Generate a colour ramp by setting pixel values from the position of the pixel
  25715. in the output image. (Note that this will work with all pixel formats, but
  25716. the generated output will not be the same.)
  25717. <pre class="verbatim">__kernel void ramp(__write_only image2d_t dst,
  25718. unsigned int index)
  25719. {
  25720. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  25721. float4 val;
  25722. val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
  25723. write_imagef(dst, loc, val);
  25724. }
  25725. </pre>
  25726. </li><li>
  25727. Generate a Sierpinski carpet pattern, panning by a single pixel each frame.
  25728. <pre class="verbatim">__kernel void sierpinski_carpet(__write_only image2d_t dst,
  25729. unsigned int index)
  25730. {
  25731. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  25732. float4 value = 0.0f;
  25733. int x = loc.x + index;
  25734. int y = loc.y + index;
  25735. while (x &gt; 0 || y &gt; 0) {
  25736. if (x % 3 == 1 &amp;&amp; y % 3 == 1) {
  25737. value = 1.0f;
  25738. break;
  25739. }
  25740. x /= 3;
  25741. y /= 3;
  25742. }
  25743. write_imagef(dst, loc, value);
  25744. }
  25745. </pre>
  25746. </li></ul>
  25747. <a name="sierpinski"></a>
  25748. <h2 class="section"><a href="ffmpeg-filters.html#toc-sierpinski">14.11 sierpinski</a></h2>
  25749. <p>Generate a Sierpinski carpet/triangle fractal, and randomly pan around.
  25750. </p>
  25751. <p>This source accepts the following options:
  25752. </p>
  25753. <dl compact="compact">
  25754. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  25755. <dd><p>Set frame size. For the syntax of this option, check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  25756. </p>
  25757. </dd>
  25758. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  25759. <dd><p>Set frame rate, expressed as number of frames per second. Default
  25760. value is &quot;25&quot;.
  25761. </p>
  25762. </dd>
  25763. <dt>&lsquo;<samp>seed</samp>&rsquo;</dt>
  25764. <dd><p>Set seed which is used for random panning.
  25765. </p>
  25766. </dd>
  25767. <dt>&lsquo;<samp>jump</samp>&rsquo;</dt>
  25768. <dd><p>Set max jump for single pan destination. Allowed range is from 1 to 10000.
  25769. </p>
  25770. </dd>
  25771. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  25772. <dd><p>Set fractal type, can be default <code>carpet</code> or <code>triangle</code>.
  25773. </p></dd>
  25774. </dl>
  25775. <a name="Video-Sinks"></a>
  25776. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Video-Sinks">15 Video Sinks</a></h1>
  25777. <p>Below is a description of the currently available video sinks.
  25778. </p>
  25779. <a name="buffersink"></a>
  25780. <h2 class="section"><a href="ffmpeg-filters.html#toc-buffersink">15.1 buffersink</a></h2>
  25781. <p>Buffer video frames, and make them available to the end of the filter
  25782. graph.
  25783. </p>
  25784. <p>This sink is mainly intended for programmatic use, in particular
  25785. through the interface defined in &lsquo;<tt>libavfilter/buffersink.h</tt>&rsquo;
  25786. or the options system.
  25787. </p>
  25788. <p>It accepts a pointer to an AVBufferSinkContext structure, which
  25789. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  25790. parameter to <code>avfilter_init_filter</code> for initialization.
  25791. </p>
  25792. <a name="nullsink"></a>
  25793. <h2 class="section"><a href="ffmpeg-filters.html#toc-nullsink">15.2 nullsink</a></h2>
  25794. <p>Null video sink: do absolutely nothing with the input video. It is
  25795. mainly useful as a template and for use in analysis / debugging
  25796. tools.
  25797. </p>
  25798. <a name="Multimedia-Filters"></a>
  25799. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Multimedia-Filters">16 Multimedia Filters</a></h1>
  25800. <p>Below is a description of the currently available multimedia filters.
  25801. </p>
  25802. <a name="abitscope"></a>
  25803. <h2 class="section"><a href="ffmpeg-filters.html#toc-abitscope">16.1 abitscope</a></h2>
  25804. <p>Convert input audio to a video output, displaying the audio bit scope.
  25805. </p>
  25806. <p>The filter accepts the following options:
  25807. </p>
  25808. <dl compact="compact">
  25809. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  25810. <dd><p>Set frame rate, expressed as number of frames per second. Default
  25811. value is &quot;25&quot;.
  25812. </p>
  25813. </dd>
  25814. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  25815. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  25816. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  25817. Default value is <code>1024x256</code>.
  25818. </p>
  25819. </dd>
  25820. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  25821. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  25822. draw channels. Unrecognized or missing colors will be replaced
  25823. by white color.
  25824. </p></dd>
  25825. </dl>
  25826. <a name="adrawgraph"></a>
  25827. <h2 class="section"><a href="ffmpeg-filters.html#toc-adrawgraph">16.2 adrawgraph</a></h2>
  25828. <p>Draw a graph using input audio metadata.
  25829. </p>
  25830. <p>See <a href="#drawgraph">drawgraph</a>
  25831. </p>
  25832. <a name="agraphmonitor"></a>
  25833. <h2 class="section"><a href="ffmpeg-filters.html#toc-agraphmonitor">16.3 agraphmonitor</a></h2>
  25834. <p>See <a href="#graphmonitor">graphmonitor</a>.
  25835. </p>
  25836. <a name="ahistogram"></a>
  25837. <h2 class="section"><a href="ffmpeg-filters.html#toc-ahistogram">16.4 ahistogram</a></h2>
  25838. <p>Convert input audio to a video output, displaying the volume histogram.
  25839. </p>
  25840. <p>The filter accepts the following options:
  25841. </p>
  25842. <dl compact="compact">
  25843. <dt>&lsquo;<samp>dmode</samp>&rsquo;</dt>
  25844. <dd><p>Specify how histogram is calculated.
  25845. </p>
  25846. <p>It accepts the following values:
  25847. </p><dl compact="compact">
  25848. <dt>&lsquo;<samp>single</samp>&rsquo;</dt>
  25849. <dd><p>Use single histogram for all channels.
  25850. </p></dd>
  25851. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  25852. <dd><p>Use separate histogram for each channel.
  25853. </p></dd>
  25854. </dl>
  25855. <p>Default is <code>single</code>.
  25856. </p>
  25857. </dd>
  25858. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  25859. <dd><p>Set frame rate, expressed as number of frames per second. Default
  25860. value is &quot;25&quot;.
  25861. </p>
  25862. </dd>
  25863. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  25864. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  25865. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  25866. Default value is <code>hd720</code>.
  25867. </p>
  25868. </dd>
  25869. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  25870. <dd><p>Set display scale.
  25871. </p>
  25872. <p>It accepts the following values:
  25873. </p><dl compact="compact">
  25874. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  25875. <dd><p>logarithmic
  25876. </p></dd>
  25877. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  25878. <dd><p>square root
  25879. </p></dd>
  25880. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  25881. <dd><p>cubic root
  25882. </p></dd>
  25883. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  25884. <dd><p>linear
  25885. </p></dd>
  25886. <dt>&lsquo;<samp>rlog</samp>&rsquo;</dt>
  25887. <dd><p>reverse logarithmic
  25888. </p></dd>
  25889. </dl>
  25890. <p>Default is <code>log</code>.
  25891. </p>
  25892. </dd>
  25893. <dt>&lsquo;<samp>ascale</samp>&rsquo;</dt>
  25894. <dd><p>Set amplitude scale.
  25895. </p>
  25896. <p>It accepts the following values:
  25897. </p><dl compact="compact">
  25898. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  25899. <dd><p>logarithmic
  25900. </p></dd>
  25901. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  25902. <dd><p>linear
  25903. </p></dd>
  25904. </dl>
  25905. <p>Default is <code>log</code>.
  25906. </p>
  25907. </dd>
  25908. <dt>&lsquo;<samp>acount</samp>&rsquo;</dt>
  25909. <dd><p>Set how much frames to accumulate in histogram.
  25910. Default is 1. Setting this to -1 accumulates all frames.
  25911. </p>
  25912. </dd>
  25913. <dt>&lsquo;<samp>rheight</samp>&rsquo;</dt>
  25914. <dd><p>Set histogram ratio of window height.
  25915. </p>
  25916. </dd>
  25917. <dt>&lsquo;<samp>slide</samp>&rsquo;</dt>
  25918. <dd><p>Set sonogram sliding.
  25919. </p>
  25920. <p>It accepts the following values:
  25921. </p><dl compact="compact">
  25922. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  25923. <dd><p>replace old rows with new ones.
  25924. </p></dd>
  25925. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  25926. <dd><p>scroll from top to bottom.
  25927. </p></dd>
  25928. </dl>
  25929. <p>Default is <code>replace</code>.
  25930. </p></dd>
  25931. </dl>
  25932. <a name="aphasemeter"></a>
  25933. <h2 class="section"><a href="ffmpeg-filters.html#toc-aphasemeter">16.5 aphasemeter</a></h2>
  25934. <p>Measures phase of input audio, which is exported as metadata <code>lavfi.aphasemeter.phase</code>,
  25935. representing mean phase of current audio frame. A video output can also be produced and is
  25936. enabled by default. The audio is passed through as first output.
  25937. </p>
  25938. <p>Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in
  25939. range <code>[-1, 1]</code> where <code>-1</code> means left and right channels are completely out of phase
  25940. and <code>1</code> means channels are in phase.
  25941. </p>
  25942. <p>The filter accepts the following options, all related to its video output:
  25943. </p>
  25944. <dl compact="compact">
  25945. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  25946. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  25947. </p>
  25948. </dd>
  25949. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  25950. <dd><p>Set the video size for the output. For the syntax of this option, check the
  25951. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  25952. Default value is <code>800x400</code>.
  25953. </p>
  25954. </dd>
  25955. <dt>&lsquo;<samp>rc</samp>&rsquo;</dt>
  25956. <dt>&lsquo;<samp>gc</samp>&rsquo;</dt>
  25957. <dt>&lsquo;<samp>bc</samp>&rsquo;</dt>
  25958. <dd><p>Specify the red, green, blue contrast. Default values are <code>2</code>,
  25959. <code>7</code> and <code>1</code>.
  25960. Allowed range is <code>[0, 255]</code>.
  25961. </p>
  25962. </dd>
  25963. <dt>&lsquo;<samp>mpc</samp>&rsquo;</dt>
  25964. <dd><p>Set color which will be used for drawing median phase. If color is
  25965. <code>none</code> which is default, no median phase value will be drawn.
  25966. </p>
  25967. </dd>
  25968. <dt>&lsquo;<samp>video</samp>&rsquo;</dt>
  25969. <dd><p>Enable video output. Default is enabled.
  25970. </p></dd>
  25971. </dl>
  25972. <a name="avectorscope"></a>
  25973. <h2 class="section"><a href="ffmpeg-filters.html#toc-avectorscope">16.6 avectorscope</a></h2>
  25974. <p>Convert input audio to a video output, representing the audio vector
  25975. scope.
  25976. </p>
  25977. <p>The filter is used to measure the difference between channels of stereo
  25978. audio stream. A monaural signal, consisting of identical left and right
  25979. signal, results in straight vertical line. Any stereo separation is visible
  25980. as a deviation from this line, creating a Lissajous figure.
  25981. If the straight (or deviation from it) but horizontal line appears this
  25982. indicates that the left and right channels are out of phase.
  25983. </p>
  25984. <p>The filter accepts the following options:
  25985. </p>
  25986. <dl compact="compact">
  25987. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  25988. <dd><p>Set the vectorscope mode.
  25989. </p>
  25990. <p>Available values are:
  25991. </p><dl compact="compact">
  25992. <dt>&lsquo;<samp>lissajous</samp>&rsquo;</dt>
  25993. <dd><p>Lissajous rotated by 45 degrees.
  25994. </p>
  25995. </dd>
  25996. <dt>&lsquo;<samp>lissajous_xy</samp>&rsquo;</dt>
  25997. <dd><p>Same as above but not rotated.
  25998. </p>
  25999. </dd>
  26000. <dt>&lsquo;<samp>polar</samp>&rsquo;</dt>
  26001. <dd><p>Shape resembling half of circle.
  26002. </p></dd>
  26003. </dl>
  26004. <p>Default value is &lsquo;<samp>lissajous</samp>&rsquo;.
  26005. </p>
  26006. </dd>
  26007. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  26008. <dd><p>Set the video size for the output. For the syntax of this option, check the
  26009. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  26010. Default value is <code>400x400</code>.
  26011. </p>
  26012. </dd>
  26013. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  26014. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  26015. </p>
  26016. </dd>
  26017. <dt>&lsquo;<samp>rc</samp>&rsquo;</dt>
  26018. <dt>&lsquo;<samp>gc</samp>&rsquo;</dt>
  26019. <dt>&lsquo;<samp>bc</samp>&rsquo;</dt>
  26020. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  26021. <dd><p>Specify the red, green, blue and alpha contrast. Default values are <code>40</code>,
  26022. <code>160</code>, <code>80</code> and <code>255</code>.
  26023. Allowed range is <code>[0, 255]</code>.
  26024. </p>
  26025. </dd>
  26026. <dt>&lsquo;<samp>rf</samp>&rsquo;</dt>
  26027. <dt>&lsquo;<samp>gf</samp>&rsquo;</dt>
  26028. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  26029. <dt>&lsquo;<samp>af</samp>&rsquo;</dt>
  26030. <dd><p>Specify the red, green, blue and alpha fade. Default values are <code>15</code>,
  26031. <code>10</code>, <code>5</code> and <code>5</code>.
  26032. Allowed range is <code>[0, 255]</code>.
  26033. </p>
  26034. </dd>
  26035. <dt>&lsquo;<samp>zoom</samp>&rsquo;</dt>
  26036. <dd><p>Set the zoom factor. Default value is <code>1</code>. Allowed range is <code>[0, 10]</code>.
  26037. Values lower than <var>1</var> will auto adjust zoom factor to maximal possible value.
  26038. </p>
  26039. </dd>
  26040. <dt>&lsquo;<samp>draw</samp>&rsquo;</dt>
  26041. <dd><p>Set the vectorscope drawing mode.
  26042. </p>
  26043. <p>Available values are:
  26044. </p><dl compact="compact">
  26045. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  26046. <dd><p>Draw dot for each sample.
  26047. </p>
  26048. </dd>
  26049. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  26050. <dd><p>Draw line between previous and current sample.
  26051. </p></dd>
  26052. </dl>
  26053. <p>Default value is &lsquo;<samp>dot</samp>&rsquo;.
  26054. </p>
  26055. </dd>
  26056. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  26057. <dd><p>Specify amplitude scale of audio samples.
  26058. </p>
  26059. <p>Available values are:
  26060. </p><dl compact="compact">
  26061. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  26062. <dd><p>Linear.
  26063. </p>
  26064. </dd>
  26065. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  26066. <dd><p>Square root.
  26067. </p>
  26068. </dd>
  26069. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  26070. <dd><p>Cubic root.
  26071. </p>
  26072. </dd>
  26073. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  26074. <dd><p>Logarithmic.
  26075. </p></dd>
  26076. </dl>
  26077. </dd>
  26078. <dt>&lsquo;<samp>swap</samp>&rsquo;</dt>
  26079. <dd><p>Swap left channel axis with right channel axis.
  26080. </p>
  26081. </dd>
  26082. <dt>&lsquo;<samp>mirror</samp>&rsquo;</dt>
  26083. <dd><p>Mirror axis.
  26084. </p>
  26085. <dl compact="compact">
  26086. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  26087. <dd><p>No mirror.
  26088. </p>
  26089. </dd>
  26090. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  26091. <dd><p>Mirror only x axis.
  26092. </p>
  26093. </dd>
  26094. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  26095. <dd><p>Mirror only y axis.
  26096. </p>
  26097. </dd>
  26098. <dt>&lsquo;<samp>xy</samp>&rsquo;</dt>
  26099. <dd><p>Mirror both axis.
  26100. </p></dd>
  26101. </dl>
  26102. </dd>
  26103. </dl>
  26104. <a name="Examples-99"></a>
  26105. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-99">16.6.1 Examples</a></h3>
  26106. <ul>
  26107. <li>
  26108. Complete example using <code>ffplay</code>:
  26109. <div class="example">
  26110. <pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  26111. [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
  26112. </pre></div>
  26113. </li></ul>
  26114. <a name="bench_002c-abench"></a>
  26115. <h2 class="section"><a href="ffmpeg-filters.html#toc-bench_002c-abench">16.7 bench, abench</a></h2>
  26116. <p>Benchmark part of a filtergraph.
  26117. </p>
  26118. <p>The filter accepts the following options:
  26119. </p>
  26120. <dl compact="compact">
  26121. <dt>&lsquo;<samp>action</samp>&rsquo;</dt>
  26122. <dd><p>Start or stop a timer.
  26123. </p>
  26124. <p>Available values are:
  26125. </p><dl compact="compact">
  26126. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  26127. <dd><p>Get the current time, set it as frame metadata (using the key
  26128. <code>lavfi.bench.start_time</code>), and forward the frame to the next filter.
  26129. </p>
  26130. </dd>
  26131. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  26132. <dd><p>Get the current time and fetch the <code>lavfi.bench.start_time</code> metadata from
  26133. the input frame metadata to get the time difference. Time difference, average,
  26134. maximum and minimum time (respectively <code>t</code>, <code>avg</code>, <code>max</code> and
  26135. <code>min</code>) are then printed. The timestamps are expressed in seconds.
  26136. </p></dd>
  26137. </dl>
  26138. </dd>
  26139. </dl>
  26140. <a name="Examples-142"></a>
  26141. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-142">16.7.1 Examples</a></h3>
  26142. <ul>
  26143. <li>
  26144. Benchmark <a href="#selectivecolor">selectivecolor</a> filter:
  26145. <div class="example">
  26146. <pre class="example">bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
  26147. </pre></div>
  26148. </li></ul>
  26149. <a name="concat"></a>
  26150. <h2 class="section"><a href="ffmpeg-filters.html#toc-concat">16.8 concat</a></h2>
  26151. <p>Concatenate audio and video streams, joining them together one after the
  26152. other.
  26153. </p>
  26154. <p>The filter works on segments of synchronized video and audio streams. All
  26155. segments must have the same number of streams of each type, and that will
  26156. also be the number of streams at output.
  26157. </p>
  26158. <p>The filter accepts the following options:
  26159. </p>
  26160. <dl compact="compact">
  26161. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  26162. <dd><p>Set the number of segments. Default is 2.
  26163. </p>
  26164. </dd>
  26165. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  26166. <dd><p>Set the number of output video streams, that is also the number of video
  26167. streams in each segment. Default is 1.
  26168. </p>
  26169. </dd>
  26170. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  26171. <dd><p>Set the number of output audio streams, that is also the number of audio
  26172. streams in each segment. Default is 0.
  26173. </p>
  26174. </dd>
  26175. <dt>&lsquo;<samp>unsafe</samp>&rsquo;</dt>
  26176. <dd><p>Activate unsafe mode: do not fail if segments have a different format.
  26177. </p>
  26178. </dd>
  26179. </dl>
  26180. <p>The filter has <var>v</var>+<var>a</var> outputs: first <var>v</var> video outputs, then
  26181. <var>a</var> audio outputs.
  26182. </p>
  26183. <p>There are <var>n</var>x(<var>v</var>+<var>a</var>) inputs: first the inputs for the first
  26184. segment, in the same order as the outputs, then the inputs for the second
  26185. segment, etc.
  26186. </p>
  26187. <p>Related streams do not always have exactly the same duration, for various
  26188. reasons including codec frame size or sloppy authoring. For that reason,
  26189. related synchronized streams (e.g. a video and its audio track) should be
  26190. concatenated at once. The concat filter will use the duration of the longest
  26191. stream in each segment (except the last one), and if necessary pad shorter
  26192. audio streams with silence.
  26193. </p>
  26194. <p>For this filter to work correctly, all segments must start at timestamp 0.
  26195. </p>
  26196. <p>All corresponding streams must have the same parameters in all segments; the
  26197. filtering system will automatically select a common pixel format for video
  26198. streams, and a common sample format, sample rate and channel layout for
  26199. audio streams, but other settings, such as resolution, must be converted
  26200. explicitly by the user.
  26201. </p>
  26202. <p>Different frame rates are acceptable but will result in variable frame rate
  26203. at output; be sure to configure the output file to handle it.
  26204. </p>
  26205. <a name="Examples-144"></a>
  26206. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-144">16.8.1 Examples</a></h3>
  26207. <ul>
  26208. <li>
  26209. Concatenate an opening, an episode and an ending, all in bilingual version
  26210. (video in stream 0, audio in streams 1 and 2):
  26211. <div class="example">
  26212. <pre class="example">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
  26213. '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
  26214. concat=n=3:v=1:a=2 [v] [a1] [a2]' \
  26215. -map '[v]' -map '[a1]' -map '[a2]' output.mkv
  26216. </pre></div>
  26217. </li><li>
  26218. Concatenate two parts, handling audio and video separately, using the
  26219. (a)movie sources, and adjusting the resolution:
  26220. <div class="example">
  26221. <pre class="example">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
  26222. movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
  26223. [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
  26224. </pre></div>
  26225. <p>Note that a desync will happen at the stitch if the audio and video streams
  26226. do not have exactly the same duration in the first file.
  26227. </p>
  26228. </li></ul>
  26229. <a name="Commands-24"></a>
  26230. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-24">16.8.2 Commands</a></h3>
  26231. <p>This filter supports the following commands:
  26232. </p><dl compact="compact">
  26233. <dt>&lsquo;<samp>next</samp>&rsquo;</dt>
  26234. <dd><p>Close the current segment and step to the next one
  26235. </p></dd>
  26236. </dl>
  26237. <p><a name="ebur128"></a>
  26238. </p><a name="ebur128-1"></a>
  26239. <h2 class="section"><a href="ffmpeg-filters.html#toc-ebur128-1">16.9 ebur128</a></h2>
  26240. <p>EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness
  26241. level. By default, it logs a message at a frequency of 10Hz with the
  26242. Momentary loudness (identified by <code>M</code>), Short-term loudness (<code>S</code>),
  26243. Integrated loudness (<code>I</code>) and Loudness Range (<code>LRA</code>).
  26244. </p>
  26245. <p>The filter can only analyze streams which have a sampling rate of 48000 Hz and whose
  26246. sample format is double-precision floating point. The input stream will be converted to
  26247. this specification, if needed. Users may need to insert aformat and/or aresample filters
  26248. after this filter to obtain the original parameters.
  26249. </p>
  26250. <p>The filter also has a video output (see the <var>video</var> option) with a real
  26251. time graph to observe the loudness evolution. The graphic contains the logged
  26252. message mentioned above, so it is not printed anymore when this option is set,
  26253. unless the verbose logging is set. The main graphing area contains the
  26254. short-term loudness (3 seconds of analysis), and the gauge on the right is for
  26255. the momentary loudness (400 milliseconds), but can optionally be configured
  26256. to instead display short-term loudness (see <var>gauge</var>).
  26257. </p>
  26258. <p>The green area marks a +/- 1LU target range around the target loudness
  26259. (-23LUFS by default, unless modified through <var>target</var>).
  26260. </p>
  26261. <p>More information about the Loudness Recommendation EBU R128 on
  26262. <a href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
  26263. </p>
  26264. <p>The filter accepts the following options:
  26265. </p>
  26266. <dl compact="compact">
  26267. <dt>&lsquo;<samp>video</samp>&rsquo;</dt>
  26268. <dd><p>Activate the video output. The audio stream is passed unchanged whether this
  26269. option is set or no. The video stream will be the first output stream if
  26270. activated. Default is <code>0</code>.
  26271. </p>
  26272. </dd>
  26273. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  26274. <dd><p>Set the video size. This option is for video only. For the syntax of this
  26275. option, check the
  26276. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  26277. Default and minimum resolution is <code>640x480</code>.
  26278. </p>
  26279. </dd>
  26280. <dt>&lsquo;<samp>meter</samp>&rsquo;</dt>
  26281. <dd><p>Set the EBU scale meter. Default is <code>9</code>. Common values are <code>9</code> and
  26282. <code>18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
  26283. other integer value between this range is allowed.
  26284. </p>
  26285. </dd>
  26286. <dt>&lsquo;<samp>metadata</samp>&rsquo;</dt>
  26287. <dd><p>Set metadata injection. If set to <code>1</code>, the audio input will be segmented
  26288. into 100ms output frames, each of them containing various loudness information
  26289. in metadata. All the metadata keys are prefixed with <code>lavfi.r128.</code>.
  26290. </p>
  26291. <p>Default is <code>0</code>.
  26292. </p>
  26293. </dd>
  26294. <dt>&lsquo;<samp>framelog</samp>&rsquo;</dt>
  26295. <dd><p>Force the frame logging level.
  26296. </p>
  26297. <p>Available values are:
  26298. </p><dl compact="compact">
  26299. <dt>&lsquo;<samp>info</samp>&rsquo;</dt>
  26300. <dd><p>information logging level
  26301. </p></dd>
  26302. <dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
  26303. <dd><p>verbose logging level
  26304. </p></dd>
  26305. </dl>
  26306. <p>By default, the logging level is set to <var>info</var>. If the &lsquo;<samp>video</samp>&rsquo; or
  26307. the &lsquo;<samp>metadata</samp>&rsquo; options are set, it switches to <var>verbose</var>.
  26308. </p>
  26309. </dd>
  26310. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  26311. <dd><p>Set peak mode(s).
  26312. </p>
  26313. <p>Available modes can be cumulated (the option is a <code>flag</code> type). Possible
  26314. values are:
  26315. </p><dl compact="compact">
  26316. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  26317. <dd><p>Disable any peak mode (default).
  26318. </p></dd>
  26319. <dt>&lsquo;<samp>sample</samp>&rsquo;</dt>
  26320. <dd><p>Enable sample-peak mode.
  26321. </p>
  26322. <p>Simple peak mode looking for the higher sample value. It logs a message
  26323. for sample-peak (identified by <code>SPK</code>).
  26324. </p></dd>
  26325. <dt>&lsquo;<samp>true</samp>&rsquo;</dt>
  26326. <dd><p>Enable true-peak mode.
  26327. </p>
  26328. <p>If enabled, the peak lookup is done on an over-sampled version of the input
  26329. stream for better peak accuracy. It logs a message for true-peak.
  26330. (identified by <code>TPK</code>) and true-peak per frame (identified by <code>FTPK</code>).
  26331. This mode requires a build with <code>libswresample</code>.
  26332. </p></dd>
  26333. </dl>
  26334. </dd>
  26335. <dt>&lsquo;<samp>dualmono</samp>&rsquo;</dt>
  26336. <dd><p>Treat mono input files as &quot;dual mono&quot;. If a mono file is intended for playback
  26337. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  26338. If set to <code>true</code>, this option will compensate for this effect.
  26339. Multi-channel input files are not affected by this option.
  26340. </p>
  26341. </dd>
  26342. <dt>&lsquo;<samp>panlaw</samp>&rsquo;</dt>
  26343. <dd><p>Set a specific pan law to be used for the measurement of dual mono files.
  26344. This parameter is optional, and has a default value of -3.01dB.
  26345. </p>
  26346. </dd>
  26347. <dt>&lsquo;<samp>target</samp>&rsquo;</dt>
  26348. <dd><p>Set a specific target level (in LUFS) used as relative zero in the visualization.
  26349. This parameter is optional and has a default value of -23LUFS as specified
  26350. by EBU R128. However, material published online may prefer a level of -16LUFS
  26351. (e.g. for use with podcasts or video platforms).
  26352. </p>
  26353. </dd>
  26354. <dt>&lsquo;<samp>gauge</samp>&rsquo;</dt>
  26355. <dd><p>Set the value displayed by the gauge. Valid values are <code>momentary</code> and s
  26356. <code>shortterm</code>. By default the momentary value will be used, but in certain
  26357. scenarios it may be more useful to observe the short term value instead (e.g.
  26358. live mixing).
  26359. </p>
  26360. </dd>
  26361. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  26362. <dd><p>Sets the display scale for the loudness. Valid parameters are <code>absolute</code>
  26363. (in LUFS) or <code>relative</code> (LU) relative to the target. This only affects the
  26364. video output, not the summary or continuous log output.
  26365. </p></dd>
  26366. </dl>
  26367. <a name="Examples-4"></a>
  26368. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-4">16.9.1 Examples</a></h3>
  26369. <ul>
  26370. <li>
  26371. Real-time graph using <code>ffplay</code>, with a EBU scale meter +18:
  26372. <div class="example">
  26373. <pre class="example">ffplay -f lavfi -i &quot;amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]&quot;
  26374. </pre></div>
  26375. </li><li>
  26376. Run an analysis with <code>ffmpeg</code>:
  26377. <div class="example">
  26378. <pre class="example">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
  26379. </pre></div>
  26380. </li></ul>
  26381. <a name="interleave_002c-ainterleave"></a>
  26382. <h2 class="section"><a href="ffmpeg-filters.html#toc-interleave_002c-ainterleave">16.10 interleave, ainterleave</a></h2>
  26383. <p>Temporally interleave frames from several inputs.
  26384. </p>
  26385. <p><code>interleave</code> works with video inputs, <code>ainterleave</code> with audio.
  26386. </p>
  26387. <p>These filters read frames from several inputs and send the oldest
  26388. queued frame to the output.
  26389. </p>
  26390. <p>Input streams must have well defined, monotonically increasing frame
  26391. timestamp values.
  26392. </p>
  26393. <p>In order to submit one frame to output, these filters need to enqueue
  26394. at least one frame for each input, so they cannot work in case one
  26395. input is not yet terminated and will not receive incoming frames.
  26396. </p>
  26397. <p>For example consider the case when one input is a <code>select</code> filter
  26398. which always drops input frames. The <code>interleave</code> filter will keep
  26399. reading from that input, but it will never be able to send new frames
  26400. to output until the input sends an end-of-stream signal.
  26401. </p>
  26402. <p>Also, depending on inputs synchronization, the filters will drop
  26403. frames in case one input receives more frames than the other ones, and
  26404. the queue is already filled.
  26405. </p>
  26406. <p>These filters accept the following options:
  26407. </p>
  26408. <dl compact="compact">
  26409. <dt>&lsquo;<samp>nb_inputs, n</samp>&rsquo;</dt>
  26410. <dd><p>Set the number of different inputs, it is 2 by default.
  26411. </p>
  26412. </dd>
  26413. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  26414. <dd><p>How to determine the end-of-stream.
  26415. </p>
  26416. <dl compact="compact">
  26417. <dt>&lsquo;<samp>longest</samp>&rsquo;</dt>
  26418. <dd><p>The duration of the longest input. (default)
  26419. </p>
  26420. </dd>
  26421. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  26422. <dd><p>The duration of the shortest input.
  26423. </p>
  26424. </dd>
  26425. <dt>&lsquo;<samp>first</samp>&rsquo;</dt>
  26426. <dd><p>The duration of the first input.
  26427. </p></dd>
  26428. </dl>
  26429. </dd>
  26430. </dl>
  26431. <a name="Examples-134"></a>
  26432. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-134">16.10.1 Examples</a></h3>
  26433. <ul>
  26434. <li>
  26435. Interleave frames belonging to different streams using <code>ffmpeg</code>:
  26436. <div class="example">
  26437. <pre class="example">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex &quot;[0:v][1:v] interleave&quot; out.avi
  26438. </pre></div>
  26439. </li><li>
  26440. Add flickering blur effect:
  26441. <div class="example">
  26442. <pre class="example">select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
  26443. </pre></div>
  26444. </li></ul>
  26445. <a name="metadata_002c-ametadata"></a>
  26446. <h2 class="section"><a href="ffmpeg-filters.html#toc-metadata_002c-ametadata">16.11 metadata, ametadata</a></h2>
  26447. <p>Manipulate frame metadata.
  26448. </p>
  26449. <p>This filter accepts the following options:
  26450. </p>
  26451. <dl compact="compact">
  26452. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  26453. <dd><p>Set mode of operation of the filter.
  26454. </p>
  26455. <p>Can be one of the following:
  26456. </p>
  26457. <dl compact="compact">
  26458. <dt>&lsquo;<samp>select</samp>&rsquo;</dt>
  26459. <dd><p>If both <code>value</code> and <code>key</code> is set, select frames
  26460. which have such metadata. If only <code>key</code> is set, select
  26461. every frame that has such key in metadata.
  26462. </p>
  26463. </dd>
  26464. <dt>&lsquo;<samp>add</samp>&rsquo;</dt>
  26465. <dd><p>Add new metadata <code>key</code> and <code>value</code>. If key is already available
  26466. do nothing.
  26467. </p>
  26468. </dd>
  26469. <dt>&lsquo;<samp>modify</samp>&rsquo;</dt>
  26470. <dd><p>Modify value of already present key.
  26471. </p>
  26472. </dd>
  26473. <dt>&lsquo;<samp>delete</samp>&rsquo;</dt>
  26474. <dd><p>If <code>value</code> is set, delete only keys that have such value.
  26475. Otherwise, delete key. If <code>key</code> is not set, delete all metadata values in
  26476. the frame.
  26477. </p>
  26478. </dd>
  26479. <dt>&lsquo;<samp>print</samp>&rsquo;</dt>
  26480. <dd><p>Print key and its value if metadata was found. If <code>key</code> is not set print all
  26481. metadata values available in frame.
  26482. </p></dd>
  26483. </dl>
  26484. </dd>
  26485. <dt>&lsquo;<samp>key</samp>&rsquo;</dt>
  26486. <dd><p>Set key used with all modes. Must be set for all modes except <code>print</code> and <code>delete</code>.
  26487. </p>
  26488. </dd>
  26489. <dt>&lsquo;<samp>value</samp>&rsquo;</dt>
  26490. <dd><p>Set metadata value which will be used. This option is mandatory for
  26491. <code>modify</code> and <code>add</code> mode.
  26492. </p>
  26493. </dd>
  26494. <dt>&lsquo;<samp>function</samp>&rsquo;</dt>
  26495. <dd><p>Which function to use when comparing metadata value and <code>value</code>.
  26496. </p>
  26497. <p>Can be one of following:
  26498. </p>
  26499. <dl compact="compact">
  26500. <dt>&lsquo;<samp>same_str</samp>&rsquo;</dt>
  26501. <dd><p>Values are interpreted as strings, returns true if metadata value is same as <code>value</code>.
  26502. </p>
  26503. </dd>
  26504. <dt>&lsquo;<samp>starts_with</samp>&rsquo;</dt>
  26505. <dd><p>Values are interpreted as strings, returns true if metadata value starts with
  26506. the <code>value</code> option string.
  26507. </p>
  26508. </dd>
  26509. <dt>&lsquo;<samp>less</samp>&rsquo;</dt>
  26510. <dd><p>Values are interpreted as floats, returns true if metadata value is less than <code>value</code>.
  26511. </p>
  26512. </dd>
  26513. <dt>&lsquo;<samp>equal</samp>&rsquo;</dt>
  26514. <dd><p>Values are interpreted as floats, returns true if <code>value</code> is equal with metadata value.
  26515. </p>
  26516. </dd>
  26517. <dt>&lsquo;<samp>greater</samp>&rsquo;</dt>
  26518. <dd><p>Values are interpreted as floats, returns true if metadata value is greater than <code>value</code>.
  26519. </p>
  26520. </dd>
  26521. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  26522. <dd><p>Values are interpreted as floats, returns true if expression from option <code>expr</code>
  26523. evaluates to true.
  26524. </p>
  26525. </dd>
  26526. <dt>&lsquo;<samp>ends_with</samp>&rsquo;</dt>
  26527. <dd><p>Values are interpreted as strings, returns true if metadata value ends with
  26528. the <code>value</code> option string.
  26529. </p></dd>
  26530. </dl>
  26531. </dd>
  26532. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  26533. <dd><p>Set expression which is used when <code>function</code> is set to <code>expr</code>.
  26534. The expression is evaluated through the eval API and can contain the following
  26535. constants:
  26536. </p>
  26537. <dl compact="compact">
  26538. <dt>&lsquo;<samp>VALUE1</samp>&rsquo;</dt>
  26539. <dd><p>Float representation of <code>value</code> from metadata key.
  26540. </p>
  26541. </dd>
  26542. <dt>&lsquo;<samp>VALUE2</samp>&rsquo;</dt>
  26543. <dd><p>Float representation of <code>value</code> as supplied by user in <code>value</code> option.
  26544. </p></dd>
  26545. </dl>
  26546. </dd>
  26547. <dt>&lsquo;<samp>file</samp>&rsquo;</dt>
  26548. <dd><p>If specified in <code>print</code> mode, output is written to the named file. Instead of
  26549. plain filename any writable url can be specified. Filename &ldquo;-&rdquo; is a shorthand
  26550. for standard output. If <code>file</code> option is not set, output is written to the log
  26551. with AV_LOG_INFO loglevel.
  26552. </p>
  26553. </dd>
  26554. <dt>&lsquo;<samp>direct</samp>&rsquo;</dt>
  26555. <dd><p>Reduces buffering in print mode when output is written to a URL set using <var>file</var>.
  26556. </p>
  26557. </dd>
  26558. </dl>
  26559. <a name="Examples-104"></a>
  26560. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-104">16.11.1 Examples</a></h3>
  26561. <ul>
  26562. <li>
  26563. Print all metadata values for frames with key <code>lavfi.signalstats.YDIF</code> with values
  26564. between 0 and 1.
  26565. <div class="example">
  26566. <pre class="example">signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
  26567. </pre></div>
  26568. </li><li>
  26569. Print silencedetect output to file &lsquo;<tt>metadata.txt</tt>&rsquo;.
  26570. <div class="example">
  26571. <pre class="example">silencedetect,ametadata=mode=print:file=metadata.txt
  26572. </pre></div>
  26573. </li><li>
  26574. Direct all metadata to a pipe with file descriptor 4.
  26575. <div class="example">
  26576. <pre class="example">metadata=mode=print:file='pipe\:4'
  26577. </pre></div>
  26578. </li></ul>
  26579. <a name="perms_002c-aperms"></a>
  26580. <h2 class="section"><a href="ffmpeg-filters.html#toc-perms_002c-aperms">16.12 perms, aperms</a></h2>
  26581. <p>Set read/write permissions for the output frames.
  26582. </p>
  26583. <p>These filters are mainly aimed at developers to test direct path in the
  26584. following filter in the filtergraph.
  26585. </p>
  26586. <p>The filters accept the following options:
  26587. </p>
  26588. <dl compact="compact">
  26589. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  26590. <dd><p>Select the permissions mode.
  26591. </p>
  26592. <p>It accepts the following values:
  26593. </p><dl compact="compact">
  26594. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  26595. <dd><p>Do nothing. This is the default.
  26596. </p></dd>
  26597. <dt>&lsquo;<samp>ro</samp>&rsquo;</dt>
  26598. <dd><p>Set all the output frames read-only.
  26599. </p></dd>
  26600. <dt>&lsquo;<samp>rw</samp>&rsquo;</dt>
  26601. <dd><p>Set all the output frames directly writable.
  26602. </p></dd>
  26603. <dt>&lsquo;<samp>toggle</samp>&rsquo;</dt>
  26604. <dd><p>Make the frame read-only if writable, and writable if read-only.
  26605. </p></dd>
  26606. <dt>&lsquo;<samp>random</samp>&rsquo;</dt>
  26607. <dd><p>Set each output frame read-only or writable randomly.
  26608. </p></dd>
  26609. </dl>
  26610. </dd>
  26611. <dt>&lsquo;<samp>seed</samp>&rsquo;</dt>
  26612. <dd><p>Set the seed for the <var>random</var> mode, must be an integer included between
  26613. <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
  26614. <code>-1</code>, the filter will try to use a good random seed on a best effort
  26615. basis.
  26616. </p></dd>
  26617. </dl>
  26618. <p>Note: in case of auto-inserted filter between the permission filter and the
  26619. following one, the permission might not be received as expected in that
  26620. following filter. Inserting a <a href="#format">format</a> or <a href="#aformat">aformat</a> filter before the
  26621. perms/aperms filter can avoid this problem.
  26622. </p>
  26623. <a name="realtime_002c-arealtime"></a>
  26624. <h2 class="section"><a href="ffmpeg-filters.html#toc-realtime_002c-arealtime">16.13 realtime, arealtime</a></h2>
  26625. <p>Slow down filtering to match real time approximately.
  26626. </p>
  26627. <p>These filters will pause the filtering for a variable amount of time to
  26628. match the output rate with the input timestamps.
  26629. They are similar to the &lsquo;<samp>re</samp>&rsquo; option to <code>ffmpeg</code>.
  26630. </p>
  26631. <p>They accept the following options:
  26632. </p>
  26633. <dl compact="compact">
  26634. <dt>&lsquo;<samp>limit</samp>&rsquo;</dt>
  26635. <dd><p>Time limit for the pauses. Any pause longer than that will be considered
  26636. a timestamp discontinuity and reset the timer. Default is 2 seconds.
  26637. </p></dd>
  26638. <dt>&lsquo;<samp>speed</samp>&rsquo;</dt>
  26639. <dd><p>Speed factor for processing. The value must be a float larger than zero.
  26640. Values larger than 1.0 will result in faster than realtime processing,
  26641. smaller will slow processing down. The <var>limit</var> is automatically adapted
  26642. accordingly. Default is 1.0.
  26643. </p>
  26644. <p>A processing speed faster than what is possible without these filters cannot
  26645. be achieved.
  26646. </p></dd>
  26647. </dl>
  26648. <p><a name="select"></a>
  26649. </p><a name="select_002c-aselect"></a>
  26650. <h2 class="section"><a href="ffmpeg-filters.html#toc-select_002c-aselect">16.14 select, aselect</a></h2>
  26651. <p>Select frames to pass in output.
  26652. </p>
  26653. <p>This filter accepts the following options:
  26654. </p>
  26655. <dl compact="compact">
  26656. <dt>&lsquo;<samp>expr, e</samp>&rsquo;</dt>
  26657. <dd><p>Set expression, which is evaluated for each input frame.
  26658. </p>
  26659. <p>If the expression is evaluated to zero, the frame is discarded.
  26660. </p>
  26661. <p>If the evaluation result is negative or NaN, the frame is sent to the
  26662. first output; otherwise it is sent to the output with index
  26663. <code>ceil(val)-1</code>, assuming that the input index starts from 0.
  26664. </p>
  26665. <p>For example a value of <code>1.2</code> corresponds to the output with index
  26666. <code>ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
  26667. </p>
  26668. </dd>
  26669. <dt>&lsquo;<samp>outputs, n</samp>&rsquo;</dt>
  26670. <dd><p>Set the number of outputs. The output to which to send the selected
  26671. frame is based on the result of the evaluation. Default value is 1.
  26672. </p></dd>
  26673. </dl>
  26674. <p>The expression can contain the following constants:
  26675. </p>
  26676. <dl compact="compact">
  26677. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  26678. <dd><p>The (sequential) number of the filtered frame, starting from 0.
  26679. </p>
  26680. </dd>
  26681. <dt>&lsquo;<samp>selected_n</samp>&rsquo;</dt>
  26682. <dd><p>The (sequential) number of the selected frame, starting from 0.
  26683. </p>
  26684. </dd>
  26685. <dt>&lsquo;<samp>prev_selected_n</samp>&rsquo;</dt>
  26686. <dd><p>The sequential number of the last selected frame. It&rsquo;s NAN if undefined.
  26687. </p>
  26688. </dd>
  26689. <dt>&lsquo;<samp>TB</samp>&rsquo;</dt>
  26690. <dd><p>The timebase of the input timestamps.
  26691. </p>
  26692. </dd>
  26693. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  26694. <dd><p>The PTS (Presentation TimeStamp) of the filtered video frame,
  26695. expressed in <var>TB</var> units. It&rsquo;s NAN if undefined.
  26696. </p>
  26697. </dd>
  26698. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  26699. <dd><p>The PTS of the filtered video frame,
  26700. expressed in seconds. It&rsquo;s NAN if undefined.
  26701. </p>
  26702. </dd>
  26703. <dt>&lsquo;<samp>prev_pts</samp>&rsquo;</dt>
  26704. <dd><p>The PTS of the previously filtered video frame. It&rsquo;s NAN if undefined.
  26705. </p>
  26706. </dd>
  26707. <dt>&lsquo;<samp>prev_selected_pts</samp>&rsquo;</dt>
  26708. <dd><p>The PTS of the last previously filtered video frame. It&rsquo;s NAN if undefined.
  26709. </p>
  26710. </dd>
  26711. <dt>&lsquo;<samp>prev_selected_t</samp>&rsquo;</dt>
  26712. <dd><p>The PTS of the last previously selected video frame, expressed in seconds. It&rsquo;s NAN if undefined.
  26713. </p>
  26714. </dd>
  26715. <dt>&lsquo;<samp>start_pts</samp>&rsquo;</dt>
  26716. <dd><p>The PTS of the first video frame in the video. It&rsquo;s NAN if undefined.
  26717. </p>
  26718. </dd>
  26719. <dt>&lsquo;<samp>start_t</samp>&rsquo;</dt>
  26720. <dd><p>The time of the first video frame in the video. It&rsquo;s NAN if undefined.
  26721. </p>
  26722. </dd>
  26723. <dt>&lsquo;<samp>pict_type <em>(video only)</em></samp>&rsquo;</dt>
  26724. <dd><p>The type of the filtered frame. It can assume one of the following
  26725. values:
  26726. </p><dl compact="compact">
  26727. <dt>&lsquo;<samp>I</samp>&rsquo;</dt>
  26728. <dt>&lsquo;<samp>P</samp>&rsquo;</dt>
  26729. <dt>&lsquo;<samp>B</samp>&rsquo;</dt>
  26730. <dt>&lsquo;<samp>S</samp>&rsquo;</dt>
  26731. <dt>&lsquo;<samp>SI</samp>&rsquo;</dt>
  26732. <dt>&lsquo;<samp>SP</samp>&rsquo;</dt>
  26733. <dt>&lsquo;<samp>BI</samp>&rsquo;</dt>
  26734. </dl>
  26735. </dd>
  26736. <dt>&lsquo;<samp>interlace_type <em>(video only)</em></samp>&rsquo;</dt>
  26737. <dd><p>The frame interlace type. It can assume one of the following values:
  26738. </p><dl compact="compact">
  26739. <dt>&lsquo;<samp>PROGRESSIVE</samp>&rsquo;</dt>
  26740. <dd><p>The frame is progressive (not interlaced).
  26741. </p></dd>
  26742. <dt>&lsquo;<samp>TOPFIRST</samp>&rsquo;</dt>
  26743. <dd><p>The frame is top-field-first.
  26744. </p></dd>
  26745. <dt>&lsquo;<samp>BOTTOMFIRST</samp>&rsquo;</dt>
  26746. <dd><p>The frame is bottom-field-first.
  26747. </p></dd>
  26748. </dl>
  26749. </dd>
  26750. <dt>&lsquo;<samp>consumed_sample_n <em>(audio only)</em></samp>&rsquo;</dt>
  26751. <dd><p>the number of selected samples before the current frame
  26752. </p>
  26753. </dd>
  26754. <dt>&lsquo;<samp>samples_n <em>(audio only)</em></samp>&rsquo;</dt>
  26755. <dd><p>the number of samples in the current frame
  26756. </p>
  26757. </dd>
  26758. <dt>&lsquo;<samp>sample_rate <em>(audio only)</em></samp>&rsquo;</dt>
  26759. <dd><p>the input sample rate
  26760. </p>
  26761. </dd>
  26762. <dt>&lsquo;<samp>key</samp>&rsquo;</dt>
  26763. <dd><p>This is 1 if the filtered frame is a key-frame, 0 otherwise.
  26764. </p>
  26765. </dd>
  26766. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  26767. <dd><p>the position in the file of the filtered frame, -1 if the information
  26768. is not available (e.g. for synthetic video)
  26769. </p>
  26770. </dd>
  26771. <dt>&lsquo;<samp>scene <em>(video only)</em></samp>&rsquo;</dt>
  26772. <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
  26773. probability for the current frame to introduce a new scene, while a higher
  26774. value means the current frame is more likely to be one (see the example below)
  26775. </p>
  26776. </dd>
  26777. <dt>&lsquo;<samp>concatdec_select</samp>&rsquo;</dt>
  26778. <dd><p>The concat demuxer can select only part of a concat input file by setting an
  26779. inpoint and an outpoint, but the output packets may not be entirely contained
  26780. in the selected interval. By using this variable, it is possible to skip frames
  26781. generated by the concat demuxer which are not exactly contained in the selected
  26782. interval.
  26783. </p>
  26784. <p>This works by comparing the frame pts against the <var>lavf.concat.start_time</var>
  26785. and the <var>lavf.concat.duration</var> packet metadata values which are also
  26786. present in the decoded frames.
  26787. </p>
  26788. <p>The <var>concatdec_select</var> variable is -1 if the frame pts is at least
  26789. start_time and either the duration metadata is missing or the frame pts is less
  26790. than start_time + duration, 0 otherwise, and NaN if the start_time metadata is
  26791. missing.
  26792. </p>
  26793. <p>That basically means that an input frame is selected if its pts is within the
  26794. interval set by the concat demuxer.
  26795. </p>
  26796. </dd>
  26797. </dl>
  26798. <p>The default value of the select expression is &quot;1&quot;.
  26799. </p>
  26800. <a name="Examples-113"></a>
  26801. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-113">16.14.1 Examples</a></h3>
  26802. <ul>
  26803. <li>
  26804. Select all frames in input:
  26805. <div class="example">
  26806. <pre class="example">select
  26807. </pre></div>
  26808. <p>The example above is the same as:
  26809. </p><div class="example">
  26810. <pre class="example">select=1
  26811. </pre></div>
  26812. </li><li>
  26813. Skip all frames:
  26814. <div class="example">
  26815. <pre class="example">select=0
  26816. </pre></div>
  26817. </li><li>
  26818. Select only I-frames:
  26819. <div class="example">
  26820. <pre class="example">select='eq(pict_type\,I)'
  26821. </pre></div>
  26822. </li><li>
  26823. Select one frame every 100:
  26824. <div class="example">
  26825. <pre class="example">select='not(mod(n\,100))'
  26826. </pre></div>
  26827. </li><li>
  26828. Select only frames contained in the 10-20 time interval:
  26829. <div class="example">
  26830. <pre class="example">select=between(t\,10\,20)
  26831. </pre></div>
  26832. </li><li>
  26833. Select only I-frames contained in the 10-20 time interval:
  26834. <div class="example">
  26835. <pre class="example">select=between(t\,10\,20)*eq(pict_type\,I)
  26836. </pre></div>
  26837. </li><li>
  26838. Select frames with a minimum distance of 10 seconds:
  26839. <div class="example">
  26840. <pre class="example">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
  26841. </pre></div>
  26842. </li><li>
  26843. Use aselect to select only audio frames with samples number &gt; 100:
  26844. <div class="example">
  26845. <pre class="example">aselect='gt(samples_n\,100)'
  26846. </pre></div>
  26847. </li><li>
  26848. Create a mosaic of the first scenes:
  26849. <div class="example">
  26850. <pre class="example">ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
  26851. </pre></div>
  26852. <p>Comparing <var>scene</var> against a value between 0.3 and 0.5 is generally a sane
  26853. choice.
  26854. </p>
  26855. </li><li>
  26856. Send even and odd frames to separate outputs, and compose them:
  26857. <div class="example">
  26858. <pre class="example">select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
  26859. </pre></div>
  26860. </li><li>
  26861. Select useful frames from an ffconcat file which is using inpoints and
  26862. outpoints but where the source files are not intra frame only.
  26863. <div class="example">
  26864. <pre class="example">ffmpeg -copyts -vsync 0 -segment_time_metadata 1 -i input.ffconcat -vf select=concatdec_select -af aselect=concatdec_select output.avi
  26865. </pre></div>
  26866. </li></ul>
  26867. <a name="sendcmd_002c-asendcmd"></a>
  26868. <h2 class="section"><a href="ffmpeg-filters.html#toc-sendcmd_002c-asendcmd">16.15 sendcmd, asendcmd</a></h2>
  26869. <p>Send commands to filters in the filtergraph.
  26870. </p>
  26871. <p>These filters read commands to be sent to other filters in the
  26872. filtergraph.
  26873. </p>
  26874. <p><code>sendcmd</code> must be inserted between two video filters,
  26875. <code>asendcmd</code> must be inserted between two audio filters, but apart
  26876. from that they act the same way.
  26877. </p>
  26878. <p>The specification of commands can be provided in the filter arguments
  26879. with the <var>commands</var> option, or in a file specified by the
  26880. <var>filename</var> option.
  26881. </p>
  26882. <p>These filters accept the following options:
  26883. </p><dl compact="compact">
  26884. <dt>&lsquo;<samp>commands, c</samp>&rsquo;</dt>
  26885. <dd><p>Set the commands to be read and sent to the other filters.
  26886. </p></dd>
  26887. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  26888. <dd><p>Set the filename of the commands to be read and sent to the other
  26889. filters.
  26890. </p></dd>
  26891. </dl>
  26892. <a name="Commands-syntax"></a>
  26893. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-syntax">16.15.1 Commands syntax</a></h3>
  26894. <p>A commands description consists of a sequence of interval
  26895. specifications, comprising a list of commands to be executed when a
  26896. particular event related to that interval occurs. The occurring event
  26897. is typically the current frame time entering or leaving a given time
  26898. interval.
  26899. </p>
  26900. <p>An interval is specified by the following syntax:
  26901. </p><div class="example">
  26902. <pre class="example"><var>START</var>[-<var>END</var>] <var>COMMANDS</var>;
  26903. </pre></div>
  26904. <p>The time interval is specified by the <var>START</var> and <var>END</var> times.
  26905. <var>END</var> is optional and defaults to the maximum time.
  26906. </p>
  26907. <p>The current frame time is considered within the specified interval if
  26908. it is included in the interval [<var>START</var>, <var>END</var>), that is when
  26909. the time is greater or equal to <var>START</var> and is lesser than
  26910. <var>END</var>.
  26911. </p>
  26912. <p><var>COMMANDS</var> consists of a sequence of one or more command
  26913. specifications, separated by &quot;,&quot;, relating to that interval. The
  26914. syntax of a command specification is given by:
  26915. </p><div class="example">
  26916. <pre class="example">[<var>FLAGS</var>] <var>TARGET</var> <var>COMMAND</var> <var>ARG</var>
  26917. </pre></div>
  26918. <p><var>FLAGS</var> is optional and specifies the type of events relating to
  26919. the time interval which enable sending the specified command, and must
  26920. be a non-null sequence of identifier flags separated by &quot;+&quot; or &quot;|&quot; and
  26921. enclosed between &quot;[&quot; and &quot;]&quot;.
  26922. </p>
  26923. <p>The following flags are recognized:
  26924. </p><dl compact="compact">
  26925. <dt>&lsquo;<samp>enter</samp>&rsquo;</dt>
  26926. <dd><p>The command is sent when the current frame timestamp enters the
  26927. specified interval. In other words, the command is sent when the
  26928. previous frame timestamp was not in the given interval, and the
  26929. current is.
  26930. </p>
  26931. </dd>
  26932. <dt>&lsquo;<samp>leave</samp>&rsquo;</dt>
  26933. <dd><p>The command is sent when the current frame timestamp leaves the
  26934. specified interval. In other words, the command is sent when the
  26935. previous frame timestamp was in the given interval, and the
  26936. current is not.
  26937. </p>
  26938. </dd>
  26939. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  26940. <dd><p>The command <var>ARG</var> is interpreted as expression and result of
  26941. expression is passed as <var>ARG</var>.
  26942. </p>
  26943. <p>The expression is evaluated through the eval API and can contain the following
  26944. constants:
  26945. </p>
  26946. <dl compact="compact">
  26947. <dt>&lsquo;<samp>POS</samp>&rsquo;</dt>
  26948. <dd><p>Original position in the file of the frame, or undefined if undefined
  26949. for the current frame.
  26950. </p>
  26951. </dd>
  26952. <dt>&lsquo;<samp>PTS</samp>&rsquo;</dt>
  26953. <dd><p>The presentation timestamp in input.
  26954. </p>
  26955. </dd>
  26956. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  26957. <dd><p>The count of the input frame for video or audio, starting from 0.
  26958. </p>
  26959. </dd>
  26960. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  26961. <dd><p>The time in seconds of the current frame.
  26962. </p>
  26963. </dd>
  26964. <dt>&lsquo;<samp>TS</samp>&rsquo;</dt>
  26965. <dd><p>The start time in seconds of the current command interval.
  26966. </p>
  26967. </dd>
  26968. <dt>&lsquo;<samp>TE</samp>&rsquo;</dt>
  26969. <dd><p>The end time in seconds of the current command interval.
  26970. </p>
  26971. </dd>
  26972. <dt>&lsquo;<samp>TI</samp>&rsquo;</dt>
  26973. <dd><p>The interpolated time of the current command interval, TI = (T - TS) / (TE - TS).
  26974. </p></dd>
  26975. </dl>
  26976. </dd>
  26977. </dl>
  26978. <p>If <var>FLAGS</var> is not specified, a default value of <code>[enter]</code> is
  26979. assumed.
  26980. </p>
  26981. <p><var>TARGET</var> specifies the target of the command, usually the name of
  26982. the filter class or a specific filter instance name.
  26983. </p>
  26984. <p><var>COMMAND</var> specifies the name of the command for the target filter.
  26985. </p>
  26986. <p><var>ARG</var> is optional and specifies the optional list of argument for
  26987. the given <var>COMMAND</var>.
  26988. </p>
  26989. <p>Between one interval specification and another, whitespaces, or
  26990. sequences of characters starting with <code>#</code> until the end of line,
  26991. are ignored and can be used to annotate comments.
  26992. </p>
  26993. <p>A simplified BNF description of the commands specification syntax
  26994. follows:
  26995. </p><div class="example">
  26996. <pre class="example"><var>COMMAND_FLAG</var> ::= &quot;enter&quot; | &quot;leave&quot;
  26997. <var>COMMAND_FLAGS</var> ::= <var>COMMAND_FLAG</var> [(+|&quot;|&quot;)<var>COMMAND_FLAG</var>]
  26998. <var>COMMAND</var> ::= [&quot;[&quot; <var>COMMAND_FLAGS</var> &quot;]&quot;] <var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
  26999. <var>COMMANDS</var> ::= <var>COMMAND</var> [,<var>COMMANDS</var>]
  27000. <var>INTERVAL</var> ::= <var>START</var>[-<var>END</var>] <var>COMMANDS</var>
  27001. <var>INTERVALS</var> ::= <var>INTERVAL</var>[;<var>INTERVALS</var>]
  27002. </pre></div>
  27003. <a name="Examples-103"></a>
  27004. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-103">16.15.2 Examples</a></h3>
  27005. <ul>
  27006. <li>
  27007. Specify audio tempo change at second 4:
  27008. <div class="example">
  27009. <pre class="example">asendcmd=c='4.0 atempo tempo 1.5',atempo
  27010. </pre></div>
  27011. </li><li>
  27012. Target a specific filter instance:
  27013. <div class="example">
  27014. <pre class="example">asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
  27015. </pre></div>
  27016. </li><li>
  27017. Specify a list of drawtext and hue commands in a file.
  27018. <div class="example">
  27019. <pre class="example"># show text in the interval 5-10
  27020. 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
  27021. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
  27022. # desaturate the image in the interval 15-20
  27023. 15.0-20.0 [enter] hue s 0,
  27024. [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
  27025. [leave] hue s 1,
  27026. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
  27027. # apply an exponential saturation fade-out effect, starting from time 25
  27028. 25 [enter] hue s exp(25-t)
  27029. </pre></div>
  27030. <p>A filtergraph allowing to read and process the above command list
  27031. stored in a file &lsquo;<tt>test.cmd</tt>&rsquo;, can be specified with:
  27032. </p><div class="example">
  27033. <pre class="example">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
  27034. </pre></div>
  27035. </li></ul>
  27036. <p><a name="setpts"></a>
  27037. </p><a name="setpts_002c-asetpts"></a>
  27038. <h2 class="section"><a href="ffmpeg-filters.html#toc-setpts_002c-asetpts">16.16 setpts, asetpts</a></h2>
  27039. <p>Change the PTS (presentation timestamp) of the input frames.
  27040. </p>
  27041. <p><code>setpts</code> works on video frames, <code>asetpts</code> on audio frames.
  27042. </p>
  27043. <p>This filter accepts the following options:
  27044. </p>
  27045. <dl compact="compact">
  27046. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  27047. <dd><p>The expression which is evaluated for each frame to construct its timestamp.
  27048. </p>
  27049. </dd>
  27050. </dl>
  27051. <p>The expression is evaluated through the eval API and can contain the following
  27052. constants:
  27053. </p>
  27054. <dl compact="compact">
  27055. <dt>&lsquo;<samp>FRAME_RATE, FR</samp>&rsquo;</dt>
  27056. <dd><p>frame rate, only defined for constant frame-rate video
  27057. </p>
  27058. </dd>
  27059. <dt>&lsquo;<samp>PTS</samp>&rsquo;</dt>
  27060. <dd><p>The presentation timestamp in input
  27061. </p>
  27062. </dd>
  27063. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  27064. <dd><p>The count of the input frame for video or the number of consumed samples,
  27065. not including the current frame for audio, starting from 0.
  27066. </p>
  27067. </dd>
  27068. <dt>&lsquo;<samp>NB_CONSUMED_SAMPLES</samp>&rsquo;</dt>
  27069. <dd><p>The number of consumed samples, not including the current frame (only
  27070. audio)
  27071. </p>
  27072. </dd>
  27073. <dt>&lsquo;<samp>NB_SAMPLES, S</samp>&rsquo;</dt>
  27074. <dd><p>The number of samples in the current frame (only audio)
  27075. </p>
  27076. </dd>
  27077. <dt>&lsquo;<samp>SAMPLE_RATE, SR</samp>&rsquo;</dt>
  27078. <dd><p>The audio sample rate.
  27079. </p>
  27080. </dd>
  27081. <dt>&lsquo;<samp>STARTPTS</samp>&rsquo;</dt>
  27082. <dd><p>The PTS of the first frame.
  27083. </p>
  27084. </dd>
  27085. <dt>&lsquo;<samp>STARTT</samp>&rsquo;</dt>
  27086. <dd><p>the time in seconds of the first frame
  27087. </p>
  27088. </dd>
  27089. <dt>&lsquo;<samp>INTERLACED</samp>&rsquo;</dt>
  27090. <dd><p>State whether the current frame is interlaced.
  27091. </p>
  27092. </dd>
  27093. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  27094. <dd><p>the time in seconds of the current frame
  27095. </p>
  27096. </dd>
  27097. <dt>&lsquo;<samp>POS</samp>&rsquo;</dt>
  27098. <dd><p>original position in the file of the frame, or undefined if undefined
  27099. for the current frame
  27100. </p>
  27101. </dd>
  27102. <dt>&lsquo;<samp>PREV_INPTS</samp>&rsquo;</dt>
  27103. <dd><p>The previous input PTS.
  27104. </p>
  27105. </dd>
  27106. <dt>&lsquo;<samp>PREV_INT</samp>&rsquo;</dt>
  27107. <dd><p>previous input time in seconds
  27108. </p>
  27109. </dd>
  27110. <dt>&lsquo;<samp>PREV_OUTPTS</samp>&rsquo;</dt>
  27111. <dd><p>The previous output PTS.
  27112. </p>
  27113. </dd>
  27114. <dt>&lsquo;<samp>PREV_OUTT</samp>&rsquo;</dt>
  27115. <dd><p>previous output time in seconds
  27116. </p>
  27117. </dd>
  27118. <dt>&lsquo;<samp>RTCTIME</samp>&rsquo;</dt>
  27119. <dd><p>The wallclock (RTC) time in microseconds. This is deprecated, use time(0)
  27120. instead.
  27121. </p>
  27122. </dd>
  27123. <dt>&lsquo;<samp>RTCSTART</samp>&rsquo;</dt>
  27124. <dd><p>The wallclock (RTC) time at the start of the movie in microseconds.
  27125. </p>
  27126. </dd>
  27127. <dt>&lsquo;<samp>TB</samp>&rsquo;</dt>
  27128. <dd><p>The timebase of the input timestamps.
  27129. </p>
  27130. </dd>
  27131. </dl>
  27132. <a name="Examples-61"></a>
  27133. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-61">16.16.1 Examples</a></h3>
  27134. <ul>
  27135. <li>
  27136. Start counting PTS from zero
  27137. <div class="example">
  27138. <pre class="example">setpts=PTS-STARTPTS
  27139. </pre></div>
  27140. </li><li>
  27141. Apply fast motion effect:
  27142. <div class="example">
  27143. <pre class="example">setpts=0.5*PTS
  27144. </pre></div>
  27145. </li><li>
  27146. Apply slow motion effect:
  27147. <div class="example">
  27148. <pre class="example">setpts=2.0*PTS
  27149. </pre></div>
  27150. </li><li>
  27151. Set fixed rate of 25 frames per second:
  27152. <div class="example">
  27153. <pre class="example">setpts=N/(25*TB)
  27154. </pre></div>
  27155. </li><li>
  27156. Set fixed rate 25 fps with some jitter:
  27157. <div class="example">
  27158. <pre class="example">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
  27159. </pre></div>
  27160. </li><li>
  27161. Apply an offset of 10 seconds to the input PTS:
  27162. <div class="example">
  27163. <pre class="example">setpts=PTS+10/TB
  27164. </pre></div>
  27165. </li><li>
  27166. Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
  27167. <div class="example">
  27168. <pre class="example">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
  27169. </pre></div>
  27170. </li><li>
  27171. Generate timestamps by counting samples:
  27172. <div class="example">
  27173. <pre class="example">asetpts=N/SR/TB
  27174. </pre></div>
  27175. </li></ul>
  27176. <a name="setrange"></a>
  27177. <h2 class="section"><a href="ffmpeg-filters.html#toc-setrange">16.17 setrange</a></h2>
  27178. <p>Force color range for the output video frame.
  27179. </p>
  27180. <p>The <code>setrange</code> filter marks the color range property for the
  27181. output frames. It does not change the input frame, but only sets the
  27182. corresponding property, which affects how the frame is treated by
  27183. following filters.
  27184. </p>
  27185. <p>The filter accepts the following options:
  27186. </p>
  27187. <dl compact="compact">
  27188. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  27189. <dd><p>Available values are:
  27190. </p>
  27191. <dl compact="compact">
  27192. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  27193. <dd><p>Keep the same color range property.
  27194. </p>
  27195. </dd>
  27196. <dt>&lsquo;<samp>unspecified, unknown</samp>&rsquo;</dt>
  27197. <dd><p>Set the color range as unspecified.
  27198. </p>
  27199. </dd>
  27200. <dt>&lsquo;<samp>limited, tv, mpeg</samp>&rsquo;</dt>
  27201. <dd><p>Set the color range as limited.
  27202. </p>
  27203. </dd>
  27204. <dt>&lsquo;<samp>full, pc, jpeg</samp>&rsquo;</dt>
  27205. <dd><p>Set the color range as full.
  27206. </p></dd>
  27207. </dl>
  27208. </dd>
  27209. </dl>
  27210. <a name="settb_002c-asettb"></a>
  27211. <h2 class="section"><a href="ffmpeg-filters.html#toc-settb_002c-asettb">16.18 settb, asettb</a></h2>
  27212. <p>Set the timebase to use for the output frames timestamps.
  27213. It is mainly useful for testing timebase configuration.
  27214. </p>
  27215. <p>It accepts the following parameters:
  27216. </p>
  27217. <dl compact="compact">
  27218. <dt>&lsquo;<samp>expr, tb</samp>&rsquo;</dt>
  27219. <dd><p>The expression which is evaluated into the output timebase.
  27220. </p>
  27221. </dd>
  27222. </dl>
  27223. <p>The value for &lsquo;<samp>tb</samp>&rsquo; is an arithmetic expression representing a
  27224. rational. The expression can contain the constants &quot;AVTB&quot; (the default
  27225. timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
  27226. audio only). Default value is &quot;intb&quot;.
  27227. </p>
  27228. <a name="Examples-147"></a>
  27229. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-147">16.18.1 Examples</a></h3>
  27230. <ul>
  27231. <li>
  27232. Set the timebase to 1/25:
  27233. <div class="example">
  27234. <pre class="example">settb=expr=1/25
  27235. </pre></div>
  27236. </li><li>
  27237. Set the timebase to 1/10:
  27238. <div class="example">
  27239. <pre class="example">settb=expr=0.1
  27240. </pre></div>
  27241. </li><li>
  27242. Set the timebase to 1001/1000:
  27243. <div class="example">
  27244. <pre class="example">settb=1+0.001
  27245. </pre></div>
  27246. </li><li>
  27247. Set the timebase to 2*intb:
  27248. <div class="example">
  27249. <pre class="example">settb=2*intb
  27250. </pre></div>
  27251. </li><li>
  27252. Set the default timebase value:
  27253. <div class="example">
  27254. <pre class="example">settb=AVTB
  27255. </pre></div>
  27256. </li></ul>
  27257. <a name="showcqt"></a>
  27258. <h2 class="section"><a href="ffmpeg-filters.html#toc-showcqt">16.19 showcqt</a></h2>
  27259. <p>Convert input audio to a video output representing frequency spectrum
  27260. logarithmically using Brown-Puckette constant Q transform algorithm with
  27261. direct frequency domain coefficient calculation (but the transform itself
  27262. is not really constant Q, instead the Q factor is actually variable/clamped),
  27263. with musical tone scale, from E0 to D#10.
  27264. </p>
  27265. <p>The filter accepts the following options:
  27266. </p>
  27267. <dl compact="compact">
  27268. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  27269. <dd><p>Specify the video size for the output. It must be even. For the syntax of this option,
  27270. check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  27271. Default value is <code>1920x1080</code>.
  27272. </p>
  27273. </dd>
  27274. <dt>&lsquo;<samp>fps, rate, r</samp>&rsquo;</dt>
  27275. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  27276. </p>
  27277. </dd>
  27278. <dt>&lsquo;<samp>bar_h</samp>&rsquo;</dt>
  27279. <dd><p>Set the bargraph height. It must be even. Default value is <code>-1</code> which
  27280. computes the bargraph height automatically.
  27281. </p>
  27282. </dd>
  27283. <dt>&lsquo;<samp>axis_h</samp>&rsquo;</dt>
  27284. <dd><p>Set the axis height. It must be even. Default value is <code>-1</code> which computes
  27285. the axis height automatically.
  27286. </p>
  27287. </dd>
  27288. <dt>&lsquo;<samp>sono_h</samp>&rsquo;</dt>
  27289. <dd><p>Set the sonogram height. It must be even. Default value is <code>-1</code> which
  27290. computes the sonogram height automatically.
  27291. </p>
  27292. </dd>
  27293. <dt>&lsquo;<samp>fullhd</samp>&rsquo;</dt>
  27294. <dd><p>Set the fullhd resolution. This option is deprecated, use <var>size</var>, <var>s</var>
  27295. instead. Default value is <code>1</code>.
  27296. </p>
  27297. </dd>
  27298. <dt>&lsquo;<samp>sono_v, volume</samp>&rsquo;</dt>
  27299. <dd><p>Specify the sonogram volume expression. It can contain variables:
  27300. </p><dl compact="compact">
  27301. <dt>&lsquo;<samp>bar_v</samp>&rsquo;</dt>
  27302. <dd><p>the <var>bar_v</var> evaluated expression
  27303. </p></dd>
  27304. <dt>&lsquo;<samp>frequency, freq, f</samp>&rsquo;</dt>
  27305. <dd><p>the frequency where it is evaluated
  27306. </p></dd>
  27307. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  27308. <dd><p>the value of <var>timeclamp</var> option
  27309. </p></dd>
  27310. </dl>
  27311. <p>and functions:
  27312. </p><dl compact="compact">
  27313. <dt>&lsquo;<samp>a_weighting(f)</samp>&rsquo;</dt>
  27314. <dd><p>A-weighting of equal loudness
  27315. </p></dd>
  27316. <dt>&lsquo;<samp>b_weighting(f)</samp>&rsquo;</dt>
  27317. <dd><p>B-weighting of equal loudness
  27318. </p></dd>
  27319. <dt>&lsquo;<samp>c_weighting(f)</samp>&rsquo;</dt>
  27320. <dd><p>C-weighting of equal loudness.
  27321. </p></dd>
  27322. </dl>
  27323. <p>Default value is <code>16</code>.
  27324. </p>
  27325. </dd>
  27326. <dt>&lsquo;<samp>bar_v, volume2</samp>&rsquo;</dt>
  27327. <dd><p>Specify the bargraph volume expression. It can contain variables:
  27328. </p><dl compact="compact">
  27329. <dt>&lsquo;<samp>sono_v</samp>&rsquo;</dt>
  27330. <dd><p>the <var>sono_v</var> evaluated expression
  27331. </p></dd>
  27332. <dt>&lsquo;<samp>frequency, freq, f</samp>&rsquo;</dt>
  27333. <dd><p>the frequency where it is evaluated
  27334. </p></dd>
  27335. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  27336. <dd><p>the value of <var>timeclamp</var> option
  27337. </p></dd>
  27338. </dl>
  27339. <p>and functions:
  27340. </p><dl compact="compact">
  27341. <dt>&lsquo;<samp>a_weighting(f)</samp>&rsquo;</dt>
  27342. <dd><p>A-weighting of equal loudness
  27343. </p></dd>
  27344. <dt>&lsquo;<samp>b_weighting(f)</samp>&rsquo;</dt>
  27345. <dd><p>B-weighting of equal loudness
  27346. </p></dd>
  27347. <dt>&lsquo;<samp>c_weighting(f)</samp>&rsquo;</dt>
  27348. <dd><p>C-weighting of equal loudness.
  27349. </p></dd>
  27350. </dl>
  27351. <p>Default value is <code>sono_v</code>.
  27352. </p>
  27353. </dd>
  27354. <dt>&lsquo;<samp>sono_g, gamma</samp>&rsquo;</dt>
  27355. <dd><p>Specify the sonogram gamma. Lower gamma makes the spectrum more contrast,
  27356. higher gamma makes the spectrum having more range. Default value is <code>3</code>.
  27357. Acceptable range is <code>[1, 7]</code>.
  27358. </p>
  27359. </dd>
  27360. <dt>&lsquo;<samp>bar_g, gamma2</samp>&rsquo;</dt>
  27361. <dd><p>Specify the bargraph gamma. Default value is <code>1</code>. Acceptable range is
  27362. <code>[1, 7]</code>.
  27363. </p>
  27364. </dd>
  27365. <dt>&lsquo;<samp>bar_t</samp>&rsquo;</dt>
  27366. <dd><p>Specify the bargraph transparency level. Lower value makes the bargraph sharper.
  27367. Default value is <code>1</code>. Acceptable range is <code>[0, 1]</code>.
  27368. </p>
  27369. </dd>
  27370. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  27371. <dd><p>Specify the transform timeclamp. At low frequency, there is trade-off between
  27372. accuracy in time domain and frequency domain. If timeclamp is lower,
  27373. event in time domain is represented more accurately (such as fast bass drum),
  27374. otherwise event in frequency domain is represented more accurately
  27375. (such as bass guitar). Acceptable range is <code>[0.002, 1]</code>. Default value is <code>0.17</code>.
  27376. </p>
  27377. </dd>
  27378. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  27379. <dd><p>Set attack time in seconds. The default is <code>0</code> (disabled). Otherwise, it
  27380. limits future samples by applying asymmetric windowing in time domain, useful
  27381. when low latency is required. Accepted range is <code>[0, 1]</code>.
  27382. </p>
  27383. </dd>
  27384. <dt>&lsquo;<samp>basefreq</samp>&rsquo;</dt>
  27385. <dd><p>Specify the transform base frequency. Default value is <code>20.01523126408007475</code>,
  27386. which is frequency 50 cents below E0. Acceptable range is <code>[10, 100000]</code>.
  27387. </p>
  27388. </dd>
  27389. <dt>&lsquo;<samp>endfreq</samp>&rsquo;</dt>
  27390. <dd><p>Specify the transform end frequency. Default value is <code>20495.59681441799654</code>,
  27391. which is frequency 50 cents above D#10. Acceptable range is <code>[10, 100000]</code>.
  27392. </p>
  27393. </dd>
  27394. <dt>&lsquo;<samp>coeffclamp</samp>&rsquo;</dt>
  27395. <dd><p>This option is deprecated and ignored.
  27396. </p>
  27397. </dd>
  27398. <dt>&lsquo;<samp>tlength</samp>&rsquo;</dt>
  27399. <dd><p>Specify the transform length in time domain. Use this option to control accuracy
  27400. trade-off between time domain and frequency domain at every frequency sample.
  27401. It can contain variables:
  27402. </p><dl compact="compact">
  27403. <dt>&lsquo;<samp>frequency, freq, f</samp>&rsquo;</dt>
  27404. <dd><p>the frequency where it is evaluated
  27405. </p></dd>
  27406. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  27407. <dd><p>the value of <var>timeclamp</var> option.
  27408. </p></dd>
  27409. </dl>
  27410. <p>Default value is <code>384*tc/(384+tc*f)</code>.
  27411. </p>
  27412. </dd>
  27413. <dt>&lsquo;<samp>count</samp>&rsquo;</dt>
  27414. <dd><p>Specify the transform count for every video frame. Default value is <code>6</code>.
  27415. Acceptable range is <code>[1, 30]</code>.
  27416. </p>
  27417. </dd>
  27418. <dt>&lsquo;<samp>fcount</samp>&rsquo;</dt>
  27419. <dd><p>Specify the transform count for every single pixel. Default value is <code>0</code>,
  27420. which makes it computed automatically. Acceptable range is <code>[0, 10]</code>.
  27421. </p>
  27422. </dd>
  27423. <dt>&lsquo;<samp>fontfile</samp>&rsquo;</dt>
  27424. <dd><p>Specify font file for use with freetype to draw the axis. If not specified,
  27425. use embedded font. Note that drawing with font file or embedded font is not
  27426. implemented with custom <var>basefreq</var> and <var>endfreq</var>, use <var>axisfile</var>
  27427. option instead.
  27428. </p>
  27429. </dd>
  27430. <dt>&lsquo;<samp>font</samp>&rsquo;</dt>
  27431. <dd><p>Specify fontconfig pattern. This has lower priority than <var>fontfile</var>. The
  27432. <code>:</code> in the pattern may be replaced by <code>|</code> to avoid unnecessary
  27433. escaping.
  27434. </p>
  27435. </dd>
  27436. <dt>&lsquo;<samp>fontcolor</samp>&rsquo;</dt>
  27437. <dd><p>Specify font color expression. This is arithmetic expression that should return
  27438. integer value 0xRRGGBB. It can contain variables:
  27439. </p><dl compact="compact">
  27440. <dt>&lsquo;<samp>frequency, freq, f</samp>&rsquo;</dt>
  27441. <dd><p>the frequency where it is evaluated
  27442. </p></dd>
  27443. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  27444. <dd><p>the value of <var>timeclamp</var> option
  27445. </p></dd>
  27446. </dl>
  27447. <p>and functions:
  27448. </p><dl compact="compact">
  27449. <dt>&lsquo;<samp>midi(f)</samp>&rsquo;</dt>
  27450. <dd><p>midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
  27451. </p></dd>
  27452. <dt>&lsquo;<samp>r(x), g(x), b(x)</samp>&rsquo;</dt>
  27453. <dd><p>red, green, and blue value of intensity x.
  27454. </p></dd>
  27455. </dl>
  27456. <p>Default value is <code>st(0, (midi(f)-59.5)/12);
  27457. st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));
  27458. r(1-ld(1)) + b(ld(1))</code>.
  27459. </p>
  27460. </dd>
  27461. <dt>&lsquo;<samp>axisfile</samp>&rsquo;</dt>
  27462. <dd><p>Specify image file to draw the axis. This option override <var>fontfile</var> and
  27463. <var>fontcolor</var> option.
  27464. </p>
  27465. </dd>
  27466. <dt>&lsquo;<samp>axis, text</samp>&rsquo;</dt>
  27467. <dd><p>Enable/disable drawing text to the axis. If it is set to <code>0</code>, drawing to
  27468. the axis is disabled, ignoring <var>fontfile</var> and <var>axisfile</var> option.
  27469. Default value is <code>1</code>.
  27470. </p>
  27471. </dd>
  27472. <dt>&lsquo;<samp>csp</samp>&rsquo;</dt>
  27473. <dd><p>Set colorspace. The accepted values are:
  27474. </p><dl compact="compact">
  27475. <dt>&lsquo;<samp>unspecified</samp>&rsquo;</dt>
  27476. <dd><p>Unspecified (default)
  27477. </p>
  27478. </dd>
  27479. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  27480. <dd><p>BT.709
  27481. </p>
  27482. </dd>
  27483. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  27484. <dd><p>FCC
  27485. </p>
  27486. </dd>
  27487. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  27488. <dd><p>BT.470BG or BT.601-6 625
  27489. </p>
  27490. </dd>
  27491. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  27492. <dd><p>SMPTE-170M or BT.601-6 525
  27493. </p>
  27494. </dd>
  27495. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  27496. <dd><p>SMPTE-240M
  27497. </p>
  27498. </dd>
  27499. <dt>&lsquo;<samp>bt2020ncl</samp>&rsquo;</dt>
  27500. <dd><p>BT.2020 with non-constant luminance
  27501. </p>
  27502. </dd>
  27503. </dl>
  27504. </dd>
  27505. <dt>&lsquo;<samp>cscheme</samp>&rsquo;</dt>
  27506. <dd><p>Set spectrogram color scheme. This is list of floating point values with format
  27507. <code>left_r|left_g|left_b|right_r|right_g|right_b</code>.
  27508. The default is <code>1|0.5|0|0|0.5|1</code>.
  27509. </p>
  27510. </dd>
  27511. </dl>
  27512. <a name="Examples-85"></a>
  27513. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-85">16.19.1 Examples</a></h3>
  27514. <ul>
  27515. <li>
  27516. Playing audio while showing the spectrum:
  27517. <div class="example">
  27518. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
  27519. </pre></div>
  27520. </li><li>
  27521. Same as above, but with frame rate 30 fps:
  27522. <div class="example">
  27523. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
  27524. </pre></div>
  27525. </li><li>
  27526. Playing at 1280x720:
  27527. <div class="example">
  27528. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
  27529. </pre></div>
  27530. </li><li>
  27531. Disable sonogram display:
  27532. <div class="example">
  27533. <pre class="example">sono_h=0
  27534. </pre></div>
  27535. </li><li>
  27536. A1 and its harmonics: A1, A2, (near)E3, A3:
  27537. <div class="example">
  27538. <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),
  27539. asplit[a][out1]; [a] showcqt [out0]'
  27540. </pre></div>
  27541. </li><li>
  27542. Same as above, but with more accuracy in frequency domain:
  27543. <div class="example">
  27544. <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),
  27545. asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
  27546. </pre></div>
  27547. </li><li>
  27548. Custom volume:
  27549. <div class="example">
  27550. <pre class="example">bar_v=10:sono_v=bar_v*a_weighting(f)
  27551. </pre></div>
  27552. </li><li>
  27553. Custom gamma, now spectrum is linear to the amplitude.
  27554. <div class="example">
  27555. <pre class="example">bar_g=2:sono_g=2
  27556. </pre></div>
  27557. </li><li>
  27558. Custom tlength equation:
  27559. <div class="example">
  27560. <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)))'
  27561. </pre></div>
  27562. </li><li>
  27563. Custom fontcolor and fontfile, C-note is colored green, others are colored blue:
  27564. <div class="example">
  27565. <pre class="example">fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
  27566. </pre></div>
  27567. </li><li>
  27568. Custom font using fontconfig:
  27569. <div class="example">
  27570. <pre class="example">font='Courier New,Monospace,mono|bold'
  27571. </pre></div>
  27572. </li><li>
  27573. Custom frequency range with custom axis using image file:
  27574. <div class="example">
  27575. <pre class="example">axisfile=myaxis.png:basefreq=40:endfreq=10000
  27576. </pre></div>
  27577. </li></ul>
  27578. <a name="showfreqs"></a>
  27579. <h2 class="section"><a href="ffmpeg-filters.html#toc-showfreqs">16.20 showfreqs</a></h2>
  27580. <p>Convert input audio to video output representing the audio power spectrum.
  27581. Audio amplitude is on Y-axis while frequency is on X-axis.
  27582. </p>
  27583. <p>The filter accepts the following options:
  27584. </p>
  27585. <dl compact="compact">
  27586. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  27587. <dd><p>Specify size of video. For the syntax of this option, check the
  27588. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  27589. Default is <code>1024x512</code>.
  27590. </p>
  27591. </dd>
  27592. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  27593. <dd><p>Set display mode.
  27594. This set how each frequency bin will be represented.
  27595. </p>
  27596. <p>It accepts the following values:
  27597. </p><dl compact="compact">
  27598. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  27599. <dt>&lsquo;<samp>bar</samp>&rsquo;</dt>
  27600. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  27601. </dl>
  27602. <p>Default is <code>bar</code>.
  27603. </p>
  27604. </dd>
  27605. <dt>&lsquo;<samp>ascale</samp>&rsquo;</dt>
  27606. <dd><p>Set amplitude scale.
  27607. </p>
  27608. <p>It accepts the following values:
  27609. </p><dl compact="compact">
  27610. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  27611. <dd><p>Linear scale.
  27612. </p>
  27613. </dd>
  27614. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  27615. <dd><p>Square root scale.
  27616. </p>
  27617. </dd>
  27618. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  27619. <dd><p>Cubic root scale.
  27620. </p>
  27621. </dd>
  27622. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  27623. <dd><p>Logarithmic scale.
  27624. </p></dd>
  27625. </dl>
  27626. <p>Default is <code>log</code>.
  27627. </p>
  27628. </dd>
  27629. <dt>&lsquo;<samp>fscale</samp>&rsquo;</dt>
  27630. <dd><p>Set frequency scale.
  27631. </p>
  27632. <p>It accepts the following values:
  27633. </p><dl compact="compact">
  27634. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  27635. <dd><p>Linear scale.
  27636. </p>
  27637. </dd>
  27638. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  27639. <dd><p>Logarithmic scale.
  27640. </p>
  27641. </dd>
  27642. <dt>&lsquo;<samp>rlog</samp>&rsquo;</dt>
  27643. <dd><p>Reverse logarithmic scale.
  27644. </p></dd>
  27645. </dl>
  27646. <p>Default is <code>lin</code>.
  27647. </p>
  27648. </dd>
  27649. <dt>&lsquo;<samp>win_size</samp>&rsquo;</dt>
  27650. <dd><p>Set window size. Allowed range is from 16 to 65536.
  27651. </p>
  27652. <p>Default is <code>2048</code>
  27653. </p>
  27654. </dd>
  27655. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  27656. <dd><p>Set windowing function.
  27657. </p>
  27658. <p>It accepts the following values:
  27659. </p><dl compact="compact">
  27660. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  27661. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  27662. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  27663. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  27664. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  27665. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  27666. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  27667. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  27668. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  27669. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  27670. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  27671. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  27672. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  27673. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  27674. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  27675. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  27676. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  27677. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  27678. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  27679. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  27680. </dl>
  27681. <p>Default is <code>hanning</code>.
  27682. </p>
  27683. </dd>
  27684. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  27685. <dd><p>Set window overlap. In range <code>[0, 1]</code>. Default is <code>1</code>,
  27686. which means optimal overlap for selected window function will be picked.
  27687. </p>
  27688. </dd>
  27689. <dt>&lsquo;<samp>averaging</samp>&rsquo;</dt>
  27690. <dd><p>Set time averaging. Setting this to 0 will display current maximal peaks.
  27691. Default is <code>1</code>, which means time averaging is disabled.
  27692. </p>
  27693. </dd>
  27694. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  27695. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  27696. draw channel frequencies. Unrecognized or missing colors will be replaced
  27697. by white color.
  27698. </p>
  27699. </dd>
  27700. <dt>&lsquo;<samp>cmode</samp>&rsquo;</dt>
  27701. <dd><p>Set channel display mode.
  27702. </p>
  27703. <p>It accepts the following values:
  27704. </p><dl compact="compact">
  27705. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  27706. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  27707. </dl>
  27708. <p>Default is <code>combined</code>.
  27709. </p>
  27710. </dd>
  27711. <dt>&lsquo;<samp>minamp</samp>&rsquo;</dt>
  27712. <dd><p>Set minimum amplitude used in <code>log</code> amplitude scaler.
  27713. </p>
  27714. </dd>
  27715. </dl>
  27716. <a name="showspatial"></a>
  27717. <h2 class="section"><a href="ffmpeg-filters.html#toc-showspatial">16.21 showspatial</a></h2>
  27718. <p>Convert stereo input audio to a video output, representing the spatial relationship
  27719. between two channels.
  27720. </p>
  27721. <p>The filter accepts the following options:
  27722. </p>
  27723. <dl compact="compact">
  27724. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  27725. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  27726. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  27727. Default value is <code>512x512</code>.
  27728. </p>
  27729. </dd>
  27730. <dt>&lsquo;<samp>win_size</samp>&rsquo;</dt>
  27731. <dd><p>Set window size. Allowed range is from <var>1024</var> to <var>65536</var>. Default size is <var>4096</var>.
  27732. </p>
  27733. </dd>
  27734. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  27735. <dd><p>Set window function.
  27736. </p>
  27737. <p>It accepts the following values:
  27738. </p><dl compact="compact">
  27739. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  27740. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  27741. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  27742. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  27743. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  27744. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  27745. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  27746. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  27747. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  27748. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  27749. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  27750. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  27751. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  27752. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  27753. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  27754. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  27755. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  27756. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  27757. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  27758. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  27759. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  27760. </dl>
  27761. <p>Default value is <code>hann</code>.
  27762. </p>
  27763. </dd>
  27764. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  27765. <dd><p>Set ratio of overlap window. Default value is <code>0.5</code>.
  27766. When value is <code>1</code> overlap is set to recommended size for specific
  27767. window function currently used.
  27768. </p></dd>
  27769. </dl>
  27770. <p><a name="showspectrum"></a>
  27771. </p><a name="showspectrum-1"></a>
  27772. <h2 class="section"><a href="ffmpeg-filters.html#toc-showspectrum-1">16.22 showspectrum</a></h2>
  27773. <p>Convert input audio to a video output, representing the audio frequency
  27774. spectrum.
  27775. </p>
  27776. <p>The filter accepts the following options:
  27777. </p>
  27778. <dl compact="compact">
  27779. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  27780. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  27781. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  27782. Default value is <code>640x512</code>.
  27783. </p>
  27784. </dd>
  27785. <dt>&lsquo;<samp>slide</samp>&rsquo;</dt>
  27786. <dd><p>Specify how the spectrum should slide along the window.
  27787. </p>
  27788. <p>It accepts the following values:
  27789. </p><dl compact="compact">
  27790. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  27791. <dd><p>the samples start again on the left when they reach the right
  27792. </p></dd>
  27793. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  27794. <dd><p>the samples scroll from right to left
  27795. </p></dd>
  27796. <dt>&lsquo;<samp>fullframe</samp>&rsquo;</dt>
  27797. <dd><p>frames are only produced when the samples reach the right
  27798. </p></dd>
  27799. <dt>&lsquo;<samp>rscroll</samp>&rsquo;</dt>
  27800. <dd><p>the samples scroll from left to right
  27801. </p></dd>
  27802. </dl>
  27803. <p>Default value is <code>replace</code>.
  27804. </p>
  27805. </dd>
  27806. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  27807. <dd><p>Specify display mode.
  27808. </p>
  27809. <p>It accepts the following values:
  27810. </p><dl compact="compact">
  27811. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  27812. <dd><p>all channels are displayed in the same row
  27813. </p></dd>
  27814. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  27815. <dd><p>all channels are displayed in separate rows
  27816. </p></dd>
  27817. </dl>
  27818. <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
  27819. </p>
  27820. </dd>
  27821. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  27822. <dd><p>Specify display color mode.
  27823. </p>
  27824. <p>It accepts the following values:
  27825. </p><dl compact="compact">
  27826. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  27827. <dd><p>each channel is displayed in a separate color
  27828. </p></dd>
  27829. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  27830. <dd><p>each channel is displayed using the same color scheme
  27831. </p></dd>
  27832. <dt>&lsquo;<samp>rainbow</samp>&rsquo;</dt>
  27833. <dd><p>each channel is displayed using the rainbow color scheme
  27834. </p></dd>
  27835. <dt>&lsquo;<samp>moreland</samp>&rsquo;</dt>
  27836. <dd><p>each channel is displayed using the moreland color scheme
  27837. </p></dd>
  27838. <dt>&lsquo;<samp>nebulae</samp>&rsquo;</dt>
  27839. <dd><p>each channel is displayed using the nebulae color scheme
  27840. </p></dd>
  27841. <dt>&lsquo;<samp>fire</samp>&rsquo;</dt>
  27842. <dd><p>each channel is displayed using the fire color scheme
  27843. </p></dd>
  27844. <dt>&lsquo;<samp>fiery</samp>&rsquo;</dt>
  27845. <dd><p>each channel is displayed using the fiery color scheme
  27846. </p></dd>
  27847. <dt>&lsquo;<samp>fruit</samp>&rsquo;</dt>
  27848. <dd><p>each channel is displayed using the fruit color scheme
  27849. </p></dd>
  27850. <dt>&lsquo;<samp>cool</samp>&rsquo;</dt>
  27851. <dd><p>each channel is displayed using the cool color scheme
  27852. </p></dd>
  27853. <dt>&lsquo;<samp>magma</samp>&rsquo;</dt>
  27854. <dd><p>each channel is displayed using the magma color scheme
  27855. </p></dd>
  27856. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  27857. <dd><p>each channel is displayed using the green color scheme
  27858. </p></dd>
  27859. <dt>&lsquo;<samp>viridis</samp>&rsquo;</dt>
  27860. <dd><p>each channel is displayed using the viridis color scheme
  27861. </p></dd>
  27862. <dt>&lsquo;<samp>plasma</samp>&rsquo;</dt>
  27863. <dd><p>each channel is displayed using the plasma color scheme
  27864. </p></dd>
  27865. <dt>&lsquo;<samp>cividis</samp>&rsquo;</dt>
  27866. <dd><p>each channel is displayed using the cividis color scheme
  27867. </p></dd>
  27868. <dt>&lsquo;<samp>terrain</samp>&rsquo;</dt>
  27869. <dd><p>each channel is displayed using the terrain color scheme
  27870. </p></dd>
  27871. </dl>
  27872. <p>Default value is &lsquo;<samp>channel</samp>&rsquo;.
  27873. </p>
  27874. </dd>
  27875. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  27876. <dd><p>Specify scale used for calculating intensity color values.
  27877. </p>
  27878. <p>It accepts the following values:
  27879. </p><dl compact="compact">
  27880. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  27881. <dd><p>linear
  27882. </p></dd>
  27883. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  27884. <dd><p>square root, default
  27885. </p></dd>
  27886. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  27887. <dd><p>cubic root
  27888. </p></dd>
  27889. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  27890. <dd><p>logarithmic
  27891. </p></dd>
  27892. <dt>&lsquo;<samp>4thrt</samp>&rsquo;</dt>
  27893. <dd><p>4th root
  27894. </p></dd>
  27895. <dt>&lsquo;<samp>5thrt</samp>&rsquo;</dt>
  27896. <dd><p>5th root
  27897. </p></dd>
  27898. </dl>
  27899. <p>Default value is &lsquo;<samp>sqrt</samp>&rsquo;.
  27900. </p>
  27901. </dd>
  27902. <dt>&lsquo;<samp>fscale</samp>&rsquo;</dt>
  27903. <dd><p>Specify frequency scale.
  27904. </p>
  27905. <p>It accepts the following values:
  27906. </p><dl compact="compact">
  27907. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  27908. <dd><p>linear
  27909. </p></dd>
  27910. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  27911. <dd><p>logarithmic
  27912. </p></dd>
  27913. </dl>
  27914. <p>Default value is &lsquo;<samp>lin</samp>&rsquo;.
  27915. </p>
  27916. </dd>
  27917. <dt>&lsquo;<samp>saturation</samp>&rsquo;</dt>
  27918. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  27919. alternative color scheme. <code>0</code> is no saturation at all.
  27920. Saturation must be in [-10.0, 10.0] range.
  27921. Default value is <code>1</code>.
  27922. </p>
  27923. </dd>
  27924. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  27925. <dd><p>Set window function.
  27926. </p>
  27927. <p>It accepts the following values:
  27928. </p><dl compact="compact">
  27929. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  27930. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  27931. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  27932. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  27933. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  27934. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  27935. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  27936. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  27937. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  27938. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  27939. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  27940. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  27941. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  27942. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  27943. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  27944. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  27945. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  27946. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  27947. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  27948. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  27949. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  27950. </dl>
  27951. <p>Default value is <code>hann</code>.
  27952. </p>
  27953. </dd>
  27954. <dt>&lsquo;<samp>orientation</samp>&rsquo;</dt>
  27955. <dd><p>Set orientation of time vs frequency axis. Can be <code>vertical</code> or
  27956. <code>horizontal</code>. Default is <code>vertical</code>.
  27957. </p>
  27958. </dd>
  27959. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  27960. <dd><p>Set ratio of overlap window. Default value is <code>0</code>.
  27961. When value is <code>1</code> overlap is set to recommended size for specific
  27962. window function currently used.
  27963. </p>
  27964. </dd>
  27965. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  27966. <dd><p>Set scale gain for calculating intensity color values.
  27967. Default value is <code>1</code>.
  27968. </p>
  27969. </dd>
  27970. <dt>&lsquo;<samp>data</samp>&rsquo;</dt>
  27971. <dd><p>Set which data to display. Can be <code>magnitude</code>, default or <code>phase</code>.
  27972. </p>
  27973. </dd>
  27974. <dt>&lsquo;<samp>rotation</samp>&rsquo;</dt>
  27975. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  27976. Default value is <code>0</code>.
  27977. </p>
  27978. </dd>
  27979. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  27980. <dd><p>Set start frequency from which to display spectrogram. Default is <code>0</code>.
  27981. </p>
  27982. </dd>
  27983. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  27984. <dd><p>Set stop frequency to which to display spectrogram. Default is <code>0</code>.
  27985. </p>
  27986. </dd>
  27987. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  27988. <dd><p>Set upper frame rate limit. Default is <code>auto</code>, unlimited.
  27989. </p>
  27990. </dd>
  27991. <dt>&lsquo;<samp>legend</samp>&rsquo;</dt>
  27992. <dd><p>Draw time and frequency axes and legends. Default is disabled.
  27993. </p></dd>
  27994. </dl>
  27995. <p>The usage is very similar to the showwaves filter; see the examples in that
  27996. section.
  27997. </p>
  27998. <a name="Examples-87"></a>
  27999. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-87">16.22.1 Examples</a></h3>
  28000. <ul>
  28001. <li>
  28002. Large window with logarithmic color scaling:
  28003. <div class="example">
  28004. <pre class="example">showspectrum=s=1280x480:scale=log
  28005. </pre></div>
  28006. </li><li>
  28007. Complete example for a colored and sliding spectrum per channel using <code>ffplay</code>:
  28008. <div class="example">
  28009. <pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  28010. [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
  28011. </pre></div>
  28012. </li></ul>
  28013. <a name="showspectrumpic"></a>
  28014. <h2 class="section"><a href="ffmpeg-filters.html#toc-showspectrumpic">16.23 showspectrumpic</a></h2>
  28015. <p>Convert input audio to a single video frame, representing the audio frequency
  28016. spectrum.
  28017. </p>
  28018. <p>The filter accepts the following options:
  28019. </p>
  28020. <dl compact="compact">
  28021. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  28022. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  28023. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  28024. Default value is <code>4096x2048</code>.
  28025. </p>
  28026. </dd>
  28027. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  28028. <dd><p>Specify display mode.
  28029. </p>
  28030. <p>It accepts the following values:
  28031. </p><dl compact="compact">
  28032. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  28033. <dd><p>all channels are displayed in the same row
  28034. </p></dd>
  28035. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  28036. <dd><p>all channels are displayed in separate rows
  28037. </p></dd>
  28038. </dl>
  28039. <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
  28040. </p>
  28041. </dd>
  28042. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  28043. <dd><p>Specify display color mode.
  28044. </p>
  28045. <p>It accepts the following values:
  28046. </p><dl compact="compact">
  28047. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  28048. <dd><p>each channel is displayed in a separate color
  28049. </p></dd>
  28050. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  28051. <dd><p>each channel is displayed using the same color scheme
  28052. </p></dd>
  28053. <dt>&lsquo;<samp>rainbow</samp>&rsquo;</dt>
  28054. <dd><p>each channel is displayed using the rainbow color scheme
  28055. </p></dd>
  28056. <dt>&lsquo;<samp>moreland</samp>&rsquo;</dt>
  28057. <dd><p>each channel is displayed using the moreland color scheme
  28058. </p></dd>
  28059. <dt>&lsquo;<samp>nebulae</samp>&rsquo;</dt>
  28060. <dd><p>each channel is displayed using the nebulae color scheme
  28061. </p></dd>
  28062. <dt>&lsquo;<samp>fire</samp>&rsquo;</dt>
  28063. <dd><p>each channel is displayed using the fire color scheme
  28064. </p></dd>
  28065. <dt>&lsquo;<samp>fiery</samp>&rsquo;</dt>
  28066. <dd><p>each channel is displayed using the fiery color scheme
  28067. </p></dd>
  28068. <dt>&lsquo;<samp>fruit</samp>&rsquo;</dt>
  28069. <dd><p>each channel is displayed using the fruit color scheme
  28070. </p></dd>
  28071. <dt>&lsquo;<samp>cool</samp>&rsquo;</dt>
  28072. <dd><p>each channel is displayed using the cool color scheme
  28073. </p></dd>
  28074. <dt>&lsquo;<samp>magma</samp>&rsquo;</dt>
  28075. <dd><p>each channel is displayed using the magma color scheme
  28076. </p></dd>
  28077. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  28078. <dd><p>each channel is displayed using the green color scheme
  28079. </p></dd>
  28080. <dt>&lsquo;<samp>viridis</samp>&rsquo;</dt>
  28081. <dd><p>each channel is displayed using the viridis color scheme
  28082. </p></dd>
  28083. <dt>&lsquo;<samp>plasma</samp>&rsquo;</dt>
  28084. <dd><p>each channel is displayed using the plasma color scheme
  28085. </p></dd>
  28086. <dt>&lsquo;<samp>cividis</samp>&rsquo;</dt>
  28087. <dd><p>each channel is displayed using the cividis color scheme
  28088. </p></dd>
  28089. <dt>&lsquo;<samp>terrain</samp>&rsquo;</dt>
  28090. <dd><p>each channel is displayed using the terrain color scheme
  28091. </p></dd>
  28092. </dl>
  28093. <p>Default value is &lsquo;<samp>intensity</samp>&rsquo;.
  28094. </p>
  28095. </dd>
  28096. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  28097. <dd><p>Specify scale used for calculating intensity color values.
  28098. </p>
  28099. <p>It accepts the following values:
  28100. </p><dl compact="compact">
  28101. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  28102. <dd><p>linear
  28103. </p></dd>
  28104. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  28105. <dd><p>square root, default
  28106. </p></dd>
  28107. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  28108. <dd><p>cubic root
  28109. </p></dd>
  28110. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  28111. <dd><p>logarithmic
  28112. </p></dd>
  28113. <dt>&lsquo;<samp>4thrt</samp>&rsquo;</dt>
  28114. <dd><p>4th root
  28115. </p></dd>
  28116. <dt>&lsquo;<samp>5thrt</samp>&rsquo;</dt>
  28117. <dd><p>5th root
  28118. </p></dd>
  28119. </dl>
  28120. <p>Default value is &lsquo;<samp>log</samp>&rsquo;.
  28121. </p>
  28122. </dd>
  28123. <dt>&lsquo;<samp>fscale</samp>&rsquo;</dt>
  28124. <dd><p>Specify frequency scale.
  28125. </p>
  28126. <p>It accepts the following values:
  28127. </p><dl compact="compact">
  28128. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  28129. <dd><p>linear
  28130. </p></dd>
  28131. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  28132. <dd><p>logarithmic
  28133. </p></dd>
  28134. </dl>
  28135. <p>Default value is &lsquo;<samp>lin</samp>&rsquo;.
  28136. </p>
  28137. </dd>
  28138. <dt>&lsquo;<samp>saturation</samp>&rsquo;</dt>
  28139. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  28140. alternative color scheme. <code>0</code> is no saturation at all.
  28141. Saturation must be in [-10.0, 10.0] range.
  28142. Default value is <code>1</code>.
  28143. </p>
  28144. </dd>
  28145. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  28146. <dd><p>Set window function.
  28147. </p>
  28148. <p>It accepts the following values:
  28149. </p><dl compact="compact">
  28150. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  28151. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  28152. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  28153. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  28154. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  28155. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  28156. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  28157. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  28158. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  28159. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  28160. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  28161. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  28162. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  28163. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  28164. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  28165. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  28166. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  28167. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  28168. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  28169. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  28170. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  28171. </dl>
  28172. <p>Default value is <code>hann</code>.
  28173. </p>
  28174. </dd>
  28175. <dt>&lsquo;<samp>orientation</samp>&rsquo;</dt>
  28176. <dd><p>Set orientation of time vs frequency axis. Can be <code>vertical</code> or
  28177. <code>horizontal</code>. Default is <code>vertical</code>.
  28178. </p>
  28179. </dd>
  28180. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  28181. <dd><p>Set scale gain for calculating intensity color values.
  28182. Default value is <code>1</code>.
  28183. </p>
  28184. </dd>
  28185. <dt>&lsquo;<samp>legend</samp>&rsquo;</dt>
  28186. <dd><p>Draw time and frequency axes and legends. Default is enabled.
  28187. </p>
  28188. </dd>
  28189. <dt>&lsquo;<samp>rotation</samp>&rsquo;</dt>
  28190. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  28191. Default value is <code>0</code>.
  28192. </p>
  28193. </dd>
  28194. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  28195. <dd><p>Set start frequency from which to display spectrogram. Default is <code>0</code>.
  28196. </p>
  28197. </dd>
  28198. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  28199. <dd><p>Set stop frequency to which to display spectrogram. Default is <code>0</code>.
  28200. </p></dd>
  28201. </dl>
  28202. <a name="Examples-52"></a>
  28203. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-52">16.23.1 Examples</a></h3>
  28204. <ul>
  28205. <li>
  28206. Extract an audio spectrogram of a whole audio track
  28207. in a 1024x1024 picture using <code>ffmpeg</code>:
  28208. <div class="example">
  28209. <pre class="example">ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
  28210. </pre></div>
  28211. </li></ul>
  28212. <a name="showvolume"></a>
  28213. <h2 class="section"><a href="ffmpeg-filters.html#toc-showvolume">16.24 showvolume</a></h2>
  28214. <p>Convert input audio volume to a video output.
  28215. </p>
  28216. <p>The filter accepts the following options:
  28217. </p>
  28218. <dl compact="compact">
  28219. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  28220. <dd><p>Set video rate.
  28221. </p>
  28222. </dd>
  28223. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  28224. <dd><p>Set border width, allowed range is [0, 5]. Default is 1.
  28225. </p>
  28226. </dd>
  28227. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  28228. <dd><p>Set channel width, allowed range is [80, 8192]. Default is 400.
  28229. </p>
  28230. </dd>
  28231. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  28232. <dd><p>Set channel height, allowed range is [1, 900]. Default is 20.
  28233. </p>
  28234. </dd>
  28235. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  28236. <dd><p>Set fade, allowed range is [0, 1]. Default is 0.95.
  28237. </p>
  28238. </dd>
  28239. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  28240. <dd><p>Set volume color expression.
  28241. </p>
  28242. <p>The expression can use the following variables:
  28243. </p>
  28244. <dl compact="compact">
  28245. <dt>&lsquo;<samp>VOLUME</samp>&rsquo;</dt>
  28246. <dd><p>Current max volume of channel in dB.
  28247. </p>
  28248. </dd>
  28249. <dt>&lsquo;<samp>PEAK</samp>&rsquo;</dt>
  28250. <dd><p>Current peak.
  28251. </p>
  28252. </dd>
  28253. <dt>&lsquo;<samp>CHANNEL</samp>&rsquo;</dt>
  28254. <dd><p>Current channel number, starting from 0.
  28255. </p></dd>
  28256. </dl>
  28257. </dd>
  28258. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  28259. <dd><p>If set, displays channel names. Default is enabled.
  28260. </p>
  28261. </dd>
  28262. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  28263. <dd><p>If set, displays volume values. Default is enabled.
  28264. </p>
  28265. </dd>
  28266. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  28267. <dd><p>Set orientation, can be horizontal: <code>h</code> or vertical: <code>v</code>,
  28268. default is <code>h</code>.
  28269. </p>
  28270. </dd>
  28271. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  28272. <dd><p>Set step size, allowed range is [0, 5]. Default is 0, which means
  28273. step is disabled.
  28274. </p>
  28275. </dd>
  28276. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  28277. <dd><p>Set background opacity, allowed range is [0, 1]. Default is 0.
  28278. </p>
  28279. </dd>
  28280. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  28281. <dd><p>Set metering mode, can be peak: <code>p</code> or rms: <code>r</code>,
  28282. default is <code>p</code>.
  28283. </p>
  28284. </dd>
  28285. <dt>&lsquo;<samp>ds</samp>&rsquo;</dt>
  28286. <dd><p>Set display scale, can be linear: <code>lin</code> or log: <code>log</code>,
  28287. default is <code>lin</code>.
  28288. </p>
  28289. </dd>
  28290. <dt>&lsquo;<samp>dm</samp>&rsquo;</dt>
  28291. <dd><p>In second.
  28292. If set to &gt; 0., display a line for the max level
  28293. in the previous seconds.
  28294. default is disabled: <code>0.</code>
  28295. </p>
  28296. </dd>
  28297. <dt>&lsquo;<samp>dmc</samp>&rsquo;</dt>
  28298. <dd><p>The color of the max line. Use when <code>dm</code> option is set to &gt; 0.
  28299. default is: <code>orange</code>
  28300. </p></dd>
  28301. </dl>
  28302. <a name="showwaves"></a>
  28303. <h2 class="section"><a href="ffmpeg-filters.html#toc-showwaves">16.25 showwaves</a></h2>
  28304. <p>Convert input audio to a video output, representing the samples waves.
  28305. </p>
  28306. <p>The filter accepts the following options:
  28307. </p>
  28308. <dl compact="compact">
  28309. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  28310. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  28311. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  28312. Default value is <code>600x240</code>.
  28313. </p>
  28314. </dd>
  28315. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  28316. <dd><p>Set display mode.
  28317. </p>
  28318. <p>Available values are:
  28319. </p><dl compact="compact">
  28320. <dt>&lsquo;<samp>point</samp>&rsquo;</dt>
  28321. <dd><p>Draw a point for each sample.
  28322. </p>
  28323. </dd>
  28324. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  28325. <dd><p>Draw a vertical line for each sample.
  28326. </p>
  28327. </dd>
  28328. <dt>&lsquo;<samp>p2p</samp>&rsquo;</dt>
  28329. <dd><p>Draw a point for each sample and a line between them.
  28330. </p>
  28331. </dd>
  28332. <dt>&lsquo;<samp>cline</samp>&rsquo;</dt>
  28333. <dd><p>Draw a centered vertical line for each sample.
  28334. </p></dd>
  28335. </dl>
  28336. <p>Default value is <code>point</code>.
  28337. </p>
  28338. </dd>
  28339. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  28340. <dd><p>Set the number of samples which are printed on the same column. A
  28341. larger value will decrease the frame rate. Must be a positive
  28342. integer. This option can be set only if the value for <var>rate</var>
  28343. is not explicitly specified.
  28344. </p>
  28345. </dd>
  28346. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  28347. <dd><p>Set the (approximate) output frame rate. This is done by setting the
  28348. option <var>n</var>. Default value is &quot;25&quot;.
  28349. </p>
  28350. </dd>
  28351. <dt>&lsquo;<samp>split_channels</samp>&rsquo;</dt>
  28352. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  28353. </p>
  28354. </dd>
  28355. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  28356. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  28357. </p>
  28358. </dd>
  28359. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  28360. <dd><p>Set amplitude scale.
  28361. </p>
  28362. <p>Available values are:
  28363. </p><dl compact="compact">
  28364. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  28365. <dd><p>Linear.
  28366. </p>
  28367. </dd>
  28368. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  28369. <dd><p>Logarithmic.
  28370. </p>
  28371. </dd>
  28372. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  28373. <dd><p>Square root.
  28374. </p>
  28375. </dd>
  28376. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  28377. <dd><p>Cubic root.
  28378. </p></dd>
  28379. </dl>
  28380. <p>Default is linear.
  28381. </p>
  28382. </dd>
  28383. <dt>&lsquo;<samp>draw</samp>&rsquo;</dt>
  28384. <dd><p>Set the draw mode. This is mostly useful to set for high <var>n</var>.
  28385. </p>
  28386. <p>Available values are:
  28387. </p><dl compact="compact">
  28388. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  28389. <dd><p>Scale pixel values for each drawn sample.
  28390. </p>
  28391. </dd>
  28392. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  28393. <dd><p>Draw every sample directly.
  28394. </p></dd>
  28395. </dl>
  28396. <p>Default value is <code>scale</code>.
  28397. </p></dd>
  28398. </dl>
  28399. <a name="Examples-41"></a>
  28400. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-41">16.25.1 Examples</a></h3>
  28401. <ul>
  28402. <li>
  28403. Output the input file audio and the corresponding video representation
  28404. at the same time:
  28405. <div class="example">
  28406. <pre class="example">amovie=a.mp3,asplit[out0],showwaves[out1]
  28407. </pre></div>
  28408. </li><li>
  28409. Create a synthetic signal and show it with showwaves, forcing a
  28410. frame rate of 30 frames per second:
  28411. <div class="example">
  28412. <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]
  28413. </pre></div>
  28414. </li></ul>
  28415. <a name="showwavespic"></a>
  28416. <h2 class="section"><a href="ffmpeg-filters.html#toc-showwavespic">16.26 showwavespic</a></h2>
  28417. <p>Convert input audio to a single video frame, representing the samples waves.
  28418. </p>
  28419. <p>The filter accepts the following options:
  28420. </p>
  28421. <dl compact="compact">
  28422. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  28423. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  28424. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  28425. Default value is <code>600x240</code>.
  28426. </p>
  28427. </dd>
  28428. <dt>&lsquo;<samp>split_channels</samp>&rsquo;</dt>
  28429. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  28430. </p>
  28431. </dd>
  28432. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  28433. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  28434. </p>
  28435. </dd>
  28436. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  28437. <dd><p>Set amplitude scale.
  28438. </p>
  28439. <p>Available values are:
  28440. </p><dl compact="compact">
  28441. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  28442. <dd><p>Linear.
  28443. </p>
  28444. </dd>
  28445. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  28446. <dd><p>Logarithmic.
  28447. </p>
  28448. </dd>
  28449. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  28450. <dd><p>Square root.
  28451. </p>
  28452. </dd>
  28453. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  28454. <dd><p>Cubic root.
  28455. </p></dd>
  28456. </dl>
  28457. <p>Default is linear.
  28458. </p>
  28459. </dd>
  28460. <dt>&lsquo;<samp>draw</samp>&rsquo;</dt>
  28461. <dd><p>Set the draw mode.
  28462. </p>
  28463. <p>Available values are:
  28464. </p><dl compact="compact">
  28465. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  28466. <dd><p>Scale pixel values for each drawn sample.
  28467. </p>
  28468. </dd>
  28469. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  28470. <dd><p>Draw every sample directly.
  28471. </p></dd>
  28472. </dl>
  28473. <p>Default value is <code>scale</code>.
  28474. </p></dd>
  28475. </dl>
  28476. <a name="Examples-125"></a>
  28477. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-125">16.26.1 Examples</a></h3>
  28478. <ul>
  28479. <li>
  28480. Extract a channel split representation of the wave form of a whole audio track
  28481. in a 1024x800 picture using <code>ffmpeg</code>:
  28482. <div class="example">
  28483. <pre class="example">ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
  28484. </pre></div>
  28485. </li></ul>
  28486. <a name="sidedata_002c-asidedata"></a>
  28487. <h2 class="section"><a href="ffmpeg-filters.html#toc-sidedata_002c-asidedata">16.27 sidedata, asidedata</a></h2>
  28488. <p>Delete frame side data, or select frames based on it.
  28489. </p>
  28490. <p>This filter accepts the following options:
  28491. </p>
  28492. <dl compact="compact">
  28493. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  28494. <dd><p>Set mode of operation of the filter.
  28495. </p>
  28496. <p>Can be one of the following:
  28497. </p>
  28498. <dl compact="compact">
  28499. <dt>&lsquo;<samp>select</samp>&rsquo;</dt>
  28500. <dd><p>Select every frame with side data of <code>type</code>.
  28501. </p>
  28502. </dd>
  28503. <dt>&lsquo;<samp>delete</samp>&rsquo;</dt>
  28504. <dd><p>Delete side data of <code>type</code>. If <code>type</code> is not set, delete all side
  28505. data in the frame.
  28506. </p>
  28507. </dd>
  28508. </dl>
  28509. </dd>
  28510. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  28511. <dd><p>Set side data type used with all modes. Must be set for <code>select</code> mode. For
  28512. the list of frame side data types, refer to the <code>AVFrameSideDataType</code> enum
  28513. in &lsquo;<tt>libavutil/frame.h</tt>&rsquo;. For example, to choose
  28514. <code>AV_FRAME_DATA_PANSCAN</code> side data, you must specify <code>PANSCAN</code>.
  28515. </p>
  28516. </dd>
  28517. </dl>
  28518. <a name="spectrumsynth"></a>
  28519. <h2 class="section"><a href="ffmpeg-filters.html#toc-spectrumsynth">16.28 spectrumsynth</a></h2>
  28520. <p>Synthesize audio from 2 input video spectrums, first input stream represents
  28521. magnitude across time and second represents phase across time.
  28522. The filter will transform from frequency domain as displayed in videos back
  28523. to time domain as presented in audio output.
  28524. </p>
  28525. <p>This filter is primarily created for reversing processed <a href="#showspectrum">showspectrum</a>
  28526. filter outputs, but can synthesize sound from other spectrograms too.
  28527. But in such case results are going to be poor if the phase data is not
  28528. available, because in such cases phase data need to be recreated, usually
  28529. it&rsquo;s just recreated from random noise.
  28530. For best results use gray only output (<code>channel</code> color mode in
  28531. <a href="#showspectrum">showspectrum</a> filter) and <code>log</code> scale for magnitude video and
  28532. <code>lin</code> scale for phase video. To produce phase, for 2nd video, use
  28533. <code>data</code> option. Inputs videos should generally use <code>fullframe</code>
  28534. slide mode as that saves resources needed for decoding video.
  28535. </p>
  28536. <p>The filter accepts the following options:
  28537. </p>
  28538. <dl compact="compact">
  28539. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  28540. <dd><p>Specify sample rate of output audio, the sample rate of audio from which
  28541. spectrum was generated may differ.
  28542. </p>
  28543. </dd>
  28544. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  28545. <dd><p>Set number of channels represented in input video spectrums.
  28546. </p>
  28547. </dd>
  28548. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  28549. <dd><p>Set scale which was used when generating magnitude input spectrum.
  28550. Can be <code>lin</code> or <code>log</code>. Default is <code>log</code>.
  28551. </p>
  28552. </dd>
  28553. <dt>&lsquo;<samp>slide</samp>&rsquo;</dt>
  28554. <dd><p>Set slide which was used when generating inputs spectrums.
  28555. Can be <code>replace</code>, <code>scroll</code>, <code>fullframe</code> or <code>rscroll</code>.
  28556. Default is <code>fullframe</code>.
  28557. </p>
  28558. </dd>
  28559. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  28560. <dd><p>Set window function used for resynthesis.
  28561. </p>
  28562. </dd>
  28563. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  28564. <dd><p>Set window overlap. In range <code>[0, 1]</code>. Default is <code>1</code>,
  28565. which means optimal overlap for selected window function will be picked.
  28566. </p>
  28567. </dd>
  28568. <dt>&lsquo;<samp>orientation</samp>&rsquo;</dt>
  28569. <dd><p>Set orientation of input videos. Can be <code>vertical</code> or <code>horizontal</code>.
  28570. Default is <code>vertical</code>.
  28571. </p></dd>
  28572. </dl>
  28573. <a name="Examples-49"></a>
  28574. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-49">16.28.1 Examples</a></h3>
  28575. <ul>
  28576. <li>
  28577. First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate,
  28578. then resynthesize videos back to audio with spectrumsynth:
  28579. <div class="example">
  28580. <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
  28581. 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
  28582. ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
  28583. </pre></div>
  28584. </li></ul>
  28585. <a name="split_002c-asplit"></a>
  28586. <h2 class="section"><a href="ffmpeg-filters.html#toc-split_002c-asplit">16.29 split, asplit</a></h2>
  28587. <p>Split input into several identical outputs.
  28588. </p>
  28589. <p><code>asplit</code> works with audio input, <code>split</code> with video.
  28590. </p>
  28591. <p>The filter accepts a single parameter which specifies the number of outputs. If
  28592. unspecified, it defaults to 2.
  28593. </p>
  28594. <a name="Examples-151"></a>
  28595. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-151">16.29.1 Examples</a></h3>
  28596. <ul>
  28597. <li>
  28598. Create two separate outputs from the same input:
  28599. <div class="example">
  28600. <pre class="example">[in] split [out0][out1]
  28601. </pre></div>
  28602. </li><li>
  28603. To create 3 or more outputs, you need to specify the number of
  28604. outputs, like in:
  28605. <div class="example">
  28606. <pre class="example">[in] asplit=3 [out0][out1][out2]
  28607. </pre></div>
  28608. </li><li>
  28609. Create two separate outputs from the same input, one cropped and
  28610. one padded:
  28611. <div class="example">
  28612. <pre class="example">[in] split [splitout1][splitout2];
  28613. [splitout1] crop=100:100:0:0 [cropout];
  28614. [splitout2] pad=200:200:100:100 [padout];
  28615. </pre></div>
  28616. </li><li>
  28617. Create 5 copies of the input audio with <code>ffmpeg</code>:
  28618. <div class="example">
  28619. <pre class="example">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
  28620. </pre></div>
  28621. </li></ul>
  28622. <a name="zmq_002c-azmq"></a>
  28623. <h2 class="section"><a href="ffmpeg-filters.html#toc-zmq_002c-azmq">16.30 zmq, azmq</a></h2>
  28624. <p>Receive commands sent through a libzmq client, and forward them to
  28625. filters in the filtergraph.
  28626. </p>
  28627. <p><code>zmq</code> and <code>azmq</code> work as a pass-through filters. <code>zmq</code>
  28628. must be inserted between two video filters, <code>azmq</code> between two
  28629. audio filters. Both are capable to send messages to any filter type.
  28630. </p>
  28631. <p>To enable these filters you need to install the libzmq library and
  28632. headers and configure FFmpeg with <code>--enable-libzmq</code>.
  28633. </p>
  28634. <p>For more information about libzmq see:
  28635. <a href="http://www.zeromq.org/">http://www.zeromq.org/</a>
  28636. </p>
  28637. <p>The <code>zmq</code> and <code>azmq</code> filters work as a libzmq server, which
  28638. receives messages sent through a network interface defined by the
  28639. &lsquo;<samp>bind_address</samp>&rsquo; (or the abbreviation &quot;&lsquo;<samp>b</samp>&rsquo;&quot;) option.
  28640. Default value of this option is &lsquo;<tt>tcp://localhost:5555</tt>&rsquo;. You may
  28641. want to alter this value to your needs, but do not forget to escape any
  28642. &rsquo;:&rsquo; signs (see <a href="#filtergraph-escaping">filtergraph escaping</a>).
  28643. </p>
  28644. <p>The received message must be in the form:
  28645. </p><div class="example">
  28646. <pre class="example"><var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
  28647. </pre></div>
  28648. <p><var>TARGET</var> specifies the target of the command, usually the name of
  28649. the filter class or a specific filter instance name. The default
  28650. filter instance name uses the pattern &lsquo;<samp>Parsed_&lt;filter_name&gt;_&lt;index&gt;</samp>&rsquo;,
  28651. but you can override this by using the &lsquo;<samp>filter_name@id</samp>&rsquo; syntax
  28652. (see <a href="#Filtergraph-syntax">Filtergraph syntax</a>).
  28653. </p>
  28654. <p><var>COMMAND</var> specifies the name of the command for the target filter.
  28655. </p>
  28656. <p><var>ARG</var> is optional and specifies the optional argument list for the
  28657. given <var>COMMAND</var>.
  28658. </p>
  28659. <p>Upon reception, the message is processed and the corresponding command
  28660. is injected into the filtergraph. Depending on the result, the filter
  28661. will send a reply to the client, adopting the format:
  28662. </p><div class="example">
  28663. <pre class="example"><var>ERROR_CODE</var> <var>ERROR_REASON</var>
  28664. <var>MESSAGE</var>
  28665. </pre></div>
  28666. <p><var>MESSAGE</var> is optional.
  28667. </p>
  28668. <a name="Examples-145"></a>
  28669. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-145">16.30.1 Examples</a></h3>
  28670. <p>Look at &lsquo;<tt>tools/zmqsend</tt>&rsquo; for an example of a zmq client which can
  28671. be used to send commands processed by these filters.
  28672. </p>
  28673. <p>Consider the following filtergraph generated by <code>ffplay</code>.
  28674. In this example the last overlay filter has an instance name. All other
  28675. filters will have default instance names.
  28676. </p>
  28677. <div class="example">
  28678. <pre class="example">ffplay -dumpgraph 1 -f lavfi &quot;
  28679. color=s=100x100:c=red [l];
  28680. color=s=100x100:c=blue [r];
  28681. nullsrc=s=200x100, zmq [bg];
  28682. [bg][l] overlay [bg+l];
  28683. [bg+l][r] overlay@my=x=100 &quot;
  28684. </pre></div>
  28685. <p>To change the color of the left side of the video, the following
  28686. command can be used:
  28687. </p><div class="example">
  28688. <pre class="example">echo Parsed_color_0 c yellow | tools/zmqsend
  28689. </pre></div>
  28690. <p>To change the right side:
  28691. </p><div class="example">
  28692. <pre class="example">echo Parsed_color_1 c pink | tools/zmqsend
  28693. </pre></div>
  28694. <p>To change the position of the right side:
  28695. </p><div class="example">
  28696. <pre class="example">echo overlay@my x 150 | tools/zmqsend
  28697. </pre></div>
  28698. <a name="Multimedia-Sources"></a>
  28699. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Multimedia-Sources">17 Multimedia Sources</a></h1>
  28700. <p>Below is a description of the currently available multimedia sources.
  28701. </p>
  28702. <a name="amovie"></a>
  28703. <h2 class="section"><a href="ffmpeg-filters.html#toc-amovie">17.1 amovie</a></h2>
  28704. <p>This is the same as <a href="#movie">movie</a> source, except it selects an audio
  28705. stream by default.
  28706. </p>
  28707. <p><a name="movie"></a>
  28708. </p><a name="movie-1"></a>
  28709. <h2 class="section"><a href="ffmpeg-filters.html#toc-movie-1">17.2 movie</a></h2>
  28710. <p>Read audio and/or video stream(s) from a movie container.
  28711. </p>
  28712. <p>It accepts the following parameters:
  28713. </p>
  28714. <dl compact="compact">
  28715. <dt>&lsquo;<samp>filename</samp>&rsquo;</dt>
  28716. <dd><p>The name of the resource to read (not necessarily a file; it can also be a
  28717. device or a stream accessed through some protocol).
  28718. </p>
  28719. </dd>
  28720. <dt>&lsquo;<samp>format_name, f</samp>&rsquo;</dt>
  28721. <dd><p>Specifies the format assumed for the movie to read, and can be either
  28722. the name of a container or an input device. If not specified, the
  28723. format is guessed from <var>movie_name</var> or by probing.
  28724. </p>
  28725. </dd>
  28726. <dt>&lsquo;<samp>seek_point, sp</samp>&rsquo;</dt>
  28727. <dd><p>Specifies the seek point in seconds. The frames will be output
  28728. starting from this seek point. The parameter is evaluated with
  28729. <code>av_strtod</code>, so the numerical value may be suffixed by an IS
  28730. postfix. The default value is &quot;0&quot;.
  28731. </p>
  28732. </dd>
  28733. <dt>&lsquo;<samp>streams, s</samp>&rsquo;</dt>
  28734. <dd><p>Specifies the streams to read. Several streams can be specified,
  28735. separated by &quot;+&quot;. The source will then have as many outputs, in the
  28736. same order. The syntax is explained in the <a href="ffmpeg.html#Stream-specifiers">(ffmpeg)&quot;Stream specifiers&quot; section in the ffmpeg manual</a>. Two special names, &quot;dv&quot; and &quot;da&quot; specify
  28737. respectively the default (best suited) video and audio stream. Default
  28738. is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
  28739. </p>
  28740. </dd>
  28741. <dt>&lsquo;<samp>stream_index, si</samp>&rsquo;</dt>
  28742. <dd><p>Specifies the index of the video stream to read. If the value is -1,
  28743. the most suitable video stream will be automatically selected. The default
  28744. value is &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
  28745. audio instead of video.
  28746. </p>
  28747. </dd>
  28748. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  28749. <dd><p>Specifies how many times to read the stream in sequence.
  28750. If the value is 0, the stream will be looped infinitely.
  28751. Default value is &quot;1&quot;.
  28752. </p>
  28753. <p>Note that when the movie is looped the source timestamps are not
  28754. changed, so it will generate non monotonically increasing timestamps.
  28755. </p>
  28756. </dd>
  28757. <dt>&lsquo;<samp>discontinuity</samp>&rsquo;</dt>
  28758. <dd><p>Specifies the time difference between frames above which the point is
  28759. considered a timestamp discontinuity which is removed by adjusting the later
  28760. timestamps.
  28761. </p></dd>
  28762. </dl>
  28763. <p>It allows overlaying a second video on top of the main input of
  28764. a filtergraph, as shown in this graph:
  28765. </p><div class="example">
  28766. <pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
  28767. ^
  28768. |
  28769. movie --&gt; scale--&gt; deltapts1 -------+
  28770. </pre></div>
  28771. <a name="Examples-11"></a>
  28772. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Examples-11">17.2.1 Examples</a></h3>
  28773. <ul>
  28774. <li>
  28775. Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it
  28776. on top of the input labelled &quot;in&quot;:
  28777. <div class="example">
  28778. <pre class="example">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
  28779. [in] setpts=PTS-STARTPTS [main];
  28780. [main][over] overlay=16:16 [out]
  28781. </pre></div>
  28782. </li><li>
  28783. Read from a video4linux2 device, and overlay it on top of the input
  28784. labelled &quot;in&quot;:
  28785. <div class="example">
  28786. <pre class="example">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
  28787. [in] setpts=PTS-STARTPTS [main];
  28788. [main][over] overlay=16:16 [out]
  28789. </pre></div>
  28790. </li><li>
  28791. Read the first video stream and the audio stream with id 0x81 from
  28792. dvd.vob; the video is connected to the pad named &quot;video&quot; and the audio is
  28793. connected to the pad named &quot;audio&quot;:
  28794. <div class="example">
  28795. <pre class="example">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
  28796. </pre></div>
  28797. </li></ul>
  28798. <a name="Commands-17"></a>
  28799. <h3 class="subsection"><a href="ffmpeg-filters.html#toc-Commands-17">17.2.2 Commands</a></h3>
  28800. <p>Both movie and amovie support the following commands:
  28801. </p><dl compact="compact">
  28802. <dt>&lsquo;<samp>seek</samp>&rsquo;</dt>
  28803. <dd><p>Perform seek using &quot;av_seek_frame&quot;.
  28804. The syntax is: seek <var>stream_index</var>|<var>timestamp</var>|<var>flags</var>
  28805. </p><ul>
  28806. <li>
  28807. <var>stream_index</var>: If stream_index is -1, a default
  28808. stream is selected, and <var>timestamp</var> is automatically converted
  28809. from AV_TIME_BASE units to the stream specific time_base.
  28810. </li><li>
  28811. <var>timestamp</var>: Timestamp in AVStream.time_base units
  28812. or, if no stream is specified, in AV_TIME_BASE units.
  28813. </li><li>
  28814. <var>flags</var>: Flags which select direction and seeking mode.
  28815. </li></ul>
  28816. </dd>
  28817. <dt>&lsquo;<samp>get_duration</samp>&rsquo;</dt>
  28818. <dd><p>Get movie duration in AV_TIME_BASE units.
  28819. </p>
  28820. </dd>
  28821. </dl>
  28822. <a name="See-Also"></a>
  28823. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-See-Also">18 See Also</a></h1>
  28824. <p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
  28825. <a href="libavfilter.html">libavfilter</a>
  28826. </p>
  28827. <a name="Authors"></a>
  28828. <h1 class="chapter"><a href="ffmpeg-filters.html#toc-Authors">19 Authors</a></h1>
  28829. <p>The FFmpeg developers.
  28830. </p>
  28831. <p>For details about the authorship, see the Git history of the project
  28832. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  28833. <code>git log</code> in the FFmpeg source directory, or browsing the
  28834. online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
  28835. </p>
  28836. <p>Maintainers for the specific components are listed in the file
  28837. &lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
  28838. </p>
  28839. </div>
  28840. </body>
  28841. </html>