ffprobe-all.html 2.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by , GNU Texinfo 7.1.1 -->
  4. <head>
  5. <meta charset="utf-8">
  6. <title>
  7. ffprobe Documentation
  8. </title>
  9. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  10. <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
  11. <link rel="stylesheet" type="text/css" href="style.min.css">
  12. </head>
  13. <body>
  14. <div class="container">
  15. <h1>
  16. ffprobe Documentation
  17. </h1>
  18. <a name="SEC_Top"></a>
  19. <div class="element-contents" id="SEC_Contents">
  20. <h2 class="contents-heading">Table of Contents</h2>
  21. <div class="contents">
  22. <ul class="toc-numbered-mark">
  23. <li><a id="toc-Synopsis" href="#Synopsis">1 Synopsis</a></li>
  24. <li><a id="toc-Description" href="#Description">2 Description</a></li>
  25. <li><a id="toc-Options" href="#Options">3 Options</a>
  26. <ul class="toc-numbered-mark">
  27. <li><a id="toc-Stream-specifiers-1" href="#Stream-specifiers-1">3.1 Stream specifiers</a></li>
  28. <li><a id="toc-Generic-options" href="#Generic-options">3.2 Generic options</a></li>
  29. <li><a id="toc-AVOptions" href="#AVOptions">3.3 AVOptions</a></li>
  30. <li><a id="toc-Main-options" href="#Main-options">3.4 Main options</a></li>
  31. </ul></li>
  32. <li><a id="toc-Writers" href="#Writers">4 Writers</a>
  33. <ul class="toc-numbered-mark">
  34. <li><a id="toc-default" href="#default">4.1 default</a></li>
  35. <li><a id="toc-compact_002c-csv" href="#compact_002c-csv">4.2 compact, csv</a></li>
  36. <li><a id="toc-flat" href="#flat">4.3 flat</a></li>
  37. <li><a id="toc-ini" href="#ini">4.4 ini</a></li>
  38. <li><a id="toc-json" href="#json">4.5 json</a></li>
  39. <li><a id="toc-xml" href="#xml">4.6 xml</a></li>
  40. </ul></li>
  41. <li><a id="toc-Timecode" href="#Timecode">5 Timecode</a></li>
  42. <li><a id="toc-Syntax" href="#Syntax">6 Syntax</a>
  43. <ul class="toc-numbered-mark">
  44. <li><a id="toc-Quoting-and-escaping" href="#Quoting-and-escaping">6.1 Quoting and escaping</a>
  45. <ul class="toc-numbered-mark">
  46. <li><a id="toc-Examples" href="#Examples">6.1.1 Examples</a></li>
  47. </ul></li>
  48. <li><a id="toc-Date" href="#Date">6.2 Date</a></li>
  49. <li><a id="toc-Time-duration" href="#Time-duration">6.3 Time duration</a>
  50. <ul class="toc-numbered-mark">
  51. <li><a id="toc-Examples-1" href="#Examples-1">6.3.1 Examples</a></li>
  52. </ul></li>
  53. <li><a id="toc-Video-size" href="#Video-size">6.4 Video size</a></li>
  54. <li><a id="toc-Video-rate" href="#Video-rate">6.5 Video rate</a></li>
  55. <li><a id="toc-Ratio" href="#Ratio">6.6 Ratio</a></li>
  56. <li><a id="toc-Color" href="#Color">6.7 Color</a></li>
  57. <li><a id="toc-Channel-Layout" href="#Channel-Layout">6.8 Channel Layout</a></li>
  58. </ul></li>
  59. <li><a id="toc-Expression-Evaluation" href="#Expression-Evaluation">7 Expression Evaluation</a></li>
  60. <li><a id="toc-Codec-Options" href="#Codec-Options">8 Codec Options</a></li>
  61. <li><a id="toc-Decoders" href="#Decoders">9 Decoders</a></li>
  62. <li><a id="toc-Video-Decoders" href="#Video-Decoders">10 Video Decoders</a>
  63. <ul class="toc-numbered-mark">
  64. <li><a id="toc-av1" href="#av1">10.1 av1</a>
  65. <ul class="toc-numbered-mark">
  66. <li><a id="toc-Options-1" href="#Options-1">10.1.1 Options</a></li>
  67. </ul></li>
  68. <li><a id="toc-hevc" href="#hevc">10.2 hevc</a>
  69. <ul class="toc-numbered-mark">
  70. <li><a id="toc-Options-2" href="#Options-2">10.2.1 Options</a></li>
  71. </ul></li>
  72. <li><a id="toc-rawvideo" href="#rawvideo">10.3 rawvideo</a>
  73. <ul class="toc-numbered-mark">
  74. <li><a id="toc-Options-3" href="#Options-3">10.3.1 Options</a></li>
  75. </ul></li>
  76. <li><a id="toc-libdav1d" href="#libdav1d">10.4 libdav1d</a>
  77. <ul class="toc-numbered-mark">
  78. <li><a id="toc-Options-4" href="#Options-4">10.4.1 Options</a></li>
  79. </ul></li>
  80. <li><a id="toc-libdavs2" href="#libdavs2">10.5 libdavs2</a></li>
  81. <li><a id="toc-libuavs3d" href="#libuavs3d">10.6 libuavs3d</a>
  82. <ul class="toc-numbered-mark">
  83. <li><a id="toc-Options-5" href="#Options-5">10.6.1 Options</a></li>
  84. </ul></li>
  85. <li><a id="toc-libxevd" href="#libxevd">10.7 libxevd</a>
  86. <ul class="toc-numbered-mark">
  87. <li><a id="toc-Options-6" href="#Options-6">10.7.1 Options</a></li>
  88. </ul></li>
  89. <li><a id="toc-QSV-Decoders" href="#QSV-Decoders">10.8 QSV Decoders</a>
  90. <ul class="toc-numbered-mark">
  91. <li><a id="toc-Common-Options" href="#Common-Options">10.8.1 Common Options</a></li>
  92. <li><a id="toc-HEVC-Options" href="#HEVC-Options">10.8.2 HEVC Options</a></li>
  93. </ul></li>
  94. <li><a id="toc-v210" href="#v210">10.9 v210</a>
  95. <ul class="toc-numbered-mark">
  96. <li><a id="toc-Options-7" href="#Options-7">10.9.1 Options</a></li>
  97. </ul></li>
  98. </ul></li>
  99. <li><a id="toc-Audio-Decoders" href="#Audio-Decoders">11 Audio Decoders</a>
  100. <ul class="toc-numbered-mark">
  101. <li><a id="toc-ac3" href="#ac3">11.1 ac3</a>
  102. <ul class="toc-numbered-mark">
  103. <li><a id="toc-AC_002d3-Decoder-Options" href="#AC_002d3-Decoder-Options">11.1.1 AC-3 Decoder Options</a></li>
  104. </ul></li>
  105. <li><a id="toc-flac" href="#flac">11.2 flac</a>
  106. <ul class="toc-numbered-mark">
  107. <li><a id="toc-FLAC-Decoder-options" href="#FLAC-Decoder-options">11.2.1 FLAC Decoder options</a></li>
  108. </ul></li>
  109. <li><a id="toc-ffwavesynth" href="#ffwavesynth">11.3 ffwavesynth</a></li>
  110. <li><a id="toc-libcelt" href="#libcelt">11.4 libcelt</a></li>
  111. <li><a id="toc-libgsm" href="#libgsm">11.5 libgsm</a></li>
  112. <li><a id="toc-libilbc" href="#libilbc">11.6 libilbc</a>
  113. <ul class="toc-numbered-mark">
  114. <li><a id="toc-Options-8" href="#Options-8">11.6.1 Options</a></li>
  115. </ul></li>
  116. <li><a id="toc-libmpeghdec" href="#libmpeghdec">11.7 libmpeghdec</a></li>
  117. <li><a id="toc-libopencore_002damrnb" href="#libopencore_002damrnb">11.8 libopencore-amrnb</a></li>
  118. <li><a id="toc-libopencore_002damrwb" href="#libopencore_002damrwb">11.9 libopencore-amrwb</a></li>
  119. <li><a id="toc-libopus" href="#libopus">11.10 libopus</a></li>
  120. </ul></li>
  121. <li><a id="toc-Subtitles-Decoders" href="#Subtitles-Decoders">12 Subtitles Decoders</a>
  122. <ul class="toc-numbered-mark">
  123. <li><a id="toc-libaribb24" href="#libaribb24">12.1 libaribb24</a>
  124. <ul class="toc-numbered-mark">
  125. <li><a id="toc-libaribb24-Decoder-Options" href="#libaribb24-Decoder-Options">12.1.1 libaribb24 Decoder Options</a></li>
  126. </ul></li>
  127. <li><a id="toc-libaribcaption" href="#libaribcaption">12.2 libaribcaption</a>
  128. <ul class="toc-numbered-mark">
  129. <li><a id="toc-libaribcaption-Decoder-Options" href="#libaribcaption-Decoder-Options">12.2.1 libaribcaption Decoder Options</a></li>
  130. <li><a id="toc-libaribcaption-decoder-usage-examples" href="#libaribcaption-decoder-usage-examples">12.2.2 libaribcaption decoder usage examples</a></li>
  131. </ul></li>
  132. <li><a id="toc-dvbsub" href="#dvbsub">12.3 dvbsub</a>
  133. <ul class="toc-numbered-mark">
  134. <li><a id="toc-Options-9" href="#Options-9">12.3.1 Options</a></li>
  135. </ul></li>
  136. <li><a id="toc-dvdsub" href="#dvdsub">12.4 dvdsub</a>
  137. <ul class="toc-numbered-mark">
  138. <li><a id="toc-Options-10" href="#Options-10">12.4.1 Options</a></li>
  139. </ul></li>
  140. <li><a id="toc-libzvbi_002dteletext" href="#libzvbi_002dteletext">12.5 libzvbi-teletext</a>
  141. <ul class="toc-numbered-mark">
  142. <li><a id="toc-Options-11" href="#Options-11">12.5.1 Options</a></li>
  143. </ul></li>
  144. </ul></li>
  145. <li><a id="toc-Bitstream-Filters" href="#Bitstream-Filters">13 Bitstream Filters</a>
  146. <ul class="toc-numbered-mark">
  147. <li><a id="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">13.1 aac_adtstoasc</a></li>
  148. <li><a id="toc-av1_005fmetadata" href="#av1_005fmetadata">13.2 av1_metadata</a></li>
  149. <li><a id="toc-chomp" href="#chomp">13.3 chomp</a></li>
  150. <li><a id="toc-dca_005fcore" href="#dca_005fcore">13.4 dca_core</a></li>
  151. <li><a id="toc-dovi_005frpu" href="#dovi_005frpu">13.5 dovi_rpu</a></li>
  152. <li><a id="toc-dump_005fextra" href="#dump_005fextra">13.6 dump_extra</a></li>
  153. <li><a id="toc-dv_005ferror_005fmarker" href="#dv_005ferror_005fmarker">13.7 dv_error_marker</a></li>
  154. <li><a id="toc-eac3_005fcore" href="#eac3_005fcore">13.8 eac3_core</a></li>
  155. <li><a id="toc-eia608_005fto_005fsmpte436m" href="#eia608_005fto_005fsmpte436m">13.9 eia608_to_smpte436m</a></li>
  156. <li><a id="toc-extract_005fextradata" href="#extract_005fextradata">13.10 extract_extradata</a></li>
  157. <li><a id="toc-filter_005funits" href="#filter_005funits">13.11 filter_units</a></li>
  158. <li><a id="toc-hapqa_005fextract" href="#hapqa_005fextract">13.12 hapqa_extract</a></li>
  159. <li><a id="toc-h264_005fmetadata" href="#h264_005fmetadata">13.13 h264_metadata</a></li>
  160. <li><a id="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">13.14 h264_mp4toannexb</a></li>
  161. <li><a id="toc-h264_005fredundant_005fpps" href="#h264_005fredundant_005fpps">13.15 h264_redundant_pps</a></li>
  162. <li><a id="toc-hevc_005fmetadata" href="#hevc_005fmetadata">13.16 hevc_metadata</a></li>
  163. <li><a id="toc-hevc_005fmp4toannexb" href="#hevc_005fmp4toannexb">13.17 hevc_mp4toannexb</a></li>
  164. <li><a id="toc-imxdump" href="#imxdump">13.18 imxdump</a></li>
  165. <li><a id="toc-mjpeg2jpeg" href="#mjpeg2jpeg">13.19 mjpeg2jpeg</a></li>
  166. <li><a id="toc-mjpegadump" href="#mjpegadump">13.20 mjpegadump</a></li>
  167. <li><a id="toc-mov2textsub-1" href="#mov2textsub-1">13.21 mov2textsub</a></li>
  168. <li><a id="toc-mpeg2_005fmetadata" href="#mpeg2_005fmetadata">13.22 mpeg2_metadata</a></li>
  169. <li><a id="toc-mpeg4_005funpack_005fbframes" href="#mpeg4_005funpack_005fbframes">13.23 mpeg4_unpack_bframes</a></li>
  170. <li><a id="toc-noise" href="#noise">13.24 noise</a>
  171. <ul class="toc-numbered-mark">
  172. <li><a id="toc-Examples-2" href="#Examples-2">13.24.1 Examples</a></li>
  173. </ul></li>
  174. <li><a id="toc-null" href="#null">13.25 null</a></li>
  175. <li><a id="toc-pcm_005frechunk" href="#pcm_005frechunk">13.26 pcm_rechunk</a></li>
  176. <li><a id="toc-pgs_005fframe_005fmerge" href="#pgs_005fframe_005fmerge">13.27 pgs_frame_merge</a></li>
  177. <li><a id="toc-prores_005fmetadata" href="#prores_005fmetadata">13.28 prores_metadata</a></li>
  178. <li><a id="toc-remove_005fextra" href="#remove_005fextra">13.29 remove_extra</a></li>
  179. <li><a id="toc-setts" href="#setts">13.30 setts</a></li>
  180. <li><a id="toc-showinfo" href="#showinfo">13.31 showinfo</a></li>
  181. <li><a id="toc-smpte436m_005fto_005feia608" href="#smpte436m_005fto_005feia608">13.32 smpte436m_to_eia608</a></li>
  182. <li><a id="toc-text2movsub-1" href="#text2movsub-1">13.33 text2movsub</a></li>
  183. <li><a id="toc-trace_005fheaders" href="#trace_005fheaders">13.34 trace_headers</a></li>
  184. <li><a id="toc-truehd_005fcore" href="#truehd_005fcore">13.35 truehd_core</a></li>
  185. <li><a id="toc-vp9_005fmetadata" href="#vp9_005fmetadata">13.36 vp9_metadata</a></li>
  186. <li><a id="toc-vp9_005fsuperframe" href="#vp9_005fsuperframe">13.37 vp9_superframe</a></li>
  187. <li><a id="toc-vp9_005fsuperframe_005fsplit" href="#vp9_005fsuperframe_005fsplit">13.38 vp9_superframe_split</a></li>
  188. <li><a id="toc-vp9_005fraw_005freorder" href="#vp9_005fraw_005freorder">13.39 vp9_raw_reorder</a></li>
  189. </ul></li>
  190. <li><a id="toc-Format-Options" href="#Format-Options">14 Format Options</a>
  191. <ul class="toc-numbered-mark">
  192. <li><a id="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">14.1 Format stream specifiers</a></li>
  193. </ul></li>
  194. <li><a id="toc-Demuxers" href="#Demuxers">15 Demuxers</a>
  195. <ul class="toc-numbered-mark">
  196. <li><a id="toc-aa" href="#aa">15.1 aa</a></li>
  197. <li><a id="toc-aac" href="#aac">15.2 aac</a></li>
  198. <li><a id="toc-apng" href="#apng">15.3 apng</a></li>
  199. <li><a id="toc-asf" href="#asf">15.4 asf</a></li>
  200. <li><a id="toc-concat-1" href="#concat-1">15.5 concat</a>
  201. <ul class="toc-numbered-mark">
  202. <li><a id="toc-Syntax-1" href="#Syntax-1">15.5.1 Syntax</a></li>
  203. <li><a id="toc-Options-12" href="#Options-12">15.5.2 Options</a></li>
  204. <li><a id="toc-Examples-3" href="#Examples-3">15.5.3 Examples</a></li>
  205. </ul></li>
  206. <li><a id="toc-dash" href="#dash">15.6 dash</a>
  207. <ul class="toc-numbered-mark">
  208. <li><a id="toc-Options-13" href="#Options-13">15.6.1 Options</a></li>
  209. </ul></li>
  210. <li><a id="toc-dvdvideo" href="#dvdvideo">15.7 dvdvideo</a>
  211. <ul class="toc-numbered-mark">
  212. <li><a id="toc-Background" href="#Background">15.7.1 Background</a></li>
  213. <li><a id="toc-Options-14" href="#Options-14">15.7.2 Options</a></li>
  214. <li><a id="toc-Examples-4" href="#Examples-4">15.7.3 Examples</a></li>
  215. </ul></li>
  216. <li><a id="toc-ea" href="#ea">15.8 ea</a>
  217. <ul class="toc-numbered-mark">
  218. <li><a id="toc-Options-15" href="#Options-15">15.8.1 Options</a></li>
  219. </ul></li>
  220. <li><a id="toc-imf" href="#imf">15.9 imf</a></li>
  221. <li><a id="toc-flv_002c-live_005fflv_002c-kux" href="#flv_002c-live_005fflv_002c-kux">15.10 flv, live_flv, kux</a></li>
  222. <li><a id="toc-gif" href="#gif">15.11 gif</a></li>
  223. <li><a id="toc-hls" href="#hls">15.12 hls</a></li>
  224. <li><a id="toc-image2" href="#image2">15.13 image2</a>
  225. <ul class="toc-numbered-mark">
  226. <li><a id="toc-Examples-5" href="#Examples-5">15.13.1 Examples</a></li>
  227. </ul></li>
  228. <li><a id="toc-libgme" href="#libgme">15.14 libgme</a></li>
  229. <li><a id="toc-libmodplug" href="#libmodplug">15.15 libmodplug</a></li>
  230. <li><a id="toc-libopenmpt" href="#libopenmpt">15.16 libopenmpt</a></li>
  231. <li><a id="toc-mcc" href="#mcc">15.17 mcc</a>
  232. <ul class="toc-numbered-mark">
  233. <li><a id="toc-Examples-6" href="#Examples-6">15.17.1 Examples</a></li>
  234. </ul></li>
  235. <li><a id="toc-mov_002fmp4_002f3gp" href="#mov_002fmp4_002f3gp">15.18 mov/mp4/3gp</a>
  236. <ul class="toc-numbered-mark">
  237. <li><a id="toc-Options-16" href="#Options-16">15.18.1 Options</a></li>
  238. <li><a id="toc-Audible-AAX" href="#Audible-AAX">15.18.2 Audible AAX</a></li>
  239. </ul></li>
  240. <li><a id="toc-mpegts" href="#mpegts">15.19 mpegts</a></li>
  241. <li><a id="toc-mpjpeg" href="#mpjpeg">15.20 mpjpeg</a></li>
  242. <li><a id="toc-rawvideo-1" href="#rawvideo-1">15.21 rawvideo</a></li>
  243. <li><a id="toc-rcwt" href="#rcwt">15.22 rcwt</a>
  244. <ul class="toc-numbered-mark">
  245. <li><a id="toc-Examples-7" href="#Examples-7">15.22.1 Examples</a></li>
  246. </ul></li>
  247. <li><a id="toc-sbg" href="#sbg">15.23 sbg</a></li>
  248. <li><a id="toc-tedcaptions" href="#tedcaptions">15.24 tedcaptions</a></li>
  249. <li><a id="toc-vapoursynth" href="#vapoursynth">15.25 vapoursynth</a></li>
  250. <li><a id="toc-w64" href="#w64">15.26 w64</a></li>
  251. <li><a id="toc-wav-1" href="#wav-1">15.27 wav</a></li>
  252. </ul></li>
  253. <li><a id="toc-Metadata" href="#Metadata">16 Metadata</a></li>
  254. <li><a id="toc-Protocol-Options" href="#Protocol-Options">17 Protocol Options</a></li>
  255. <li><a id="toc-Protocols" href="#Protocols">18 Protocols</a>
  256. <ul class="toc-numbered-mark">
  257. <li><a id="toc-amqp" href="#amqp">18.1 amqp</a></li>
  258. <li><a id="toc-async" href="#async">18.2 async</a></li>
  259. <li><a id="toc-bluray" href="#bluray">18.3 bluray</a></li>
  260. <li><a id="toc-cache" href="#cache">18.4 cache</a></li>
  261. <li><a id="toc-concat-2" href="#concat-2">18.5 concat</a></li>
  262. <li><a id="toc-concatf" href="#concatf">18.6 concatf</a></li>
  263. <li><a id="toc-crypto" href="#crypto">18.7 crypto</a></li>
  264. <li><a id="toc-data" href="#data">18.8 data</a></li>
  265. <li><a id="toc-fd" href="#fd">18.9 fd</a></li>
  266. <li><a id="toc-file" href="#file">18.10 file</a></li>
  267. <li><a id="toc-ftp" href="#ftp">18.11 ftp</a></li>
  268. <li><a id="toc-gopher" href="#gopher">18.12 gopher</a></li>
  269. <li><a id="toc-gophers" href="#gophers">18.13 gophers</a></li>
  270. <li><a id="toc-hls-1" href="#hls-1">18.14 hls</a></li>
  271. <li><a id="toc-http" href="#http">18.15 http</a>
  272. <ul class="toc-numbered-mark">
  273. <li><a id="toc-HTTP-Cookies" href="#HTTP-Cookies">18.15.1 HTTP Cookies</a></li>
  274. </ul></li>
  275. <li><a id="toc-Icecast" href="#Icecast">18.16 Icecast</a></li>
  276. <li><a id="toc-ipfs" href="#ipfs">18.17 ipfs</a></li>
  277. <li><a id="toc-mmst" href="#mmst">18.18 mmst</a></li>
  278. <li><a id="toc-mmsh" href="#mmsh">18.19 mmsh</a></li>
  279. <li><a id="toc-md5" href="#md5">18.20 md5</a></li>
  280. <li><a id="toc-pipe" href="#pipe">18.21 pipe</a></li>
  281. <li><a id="toc-prompeg" href="#prompeg">18.22 prompeg</a></li>
  282. <li><a id="toc-rist" href="#rist">18.23 rist</a></li>
  283. <li><a id="toc-rtmp" href="#rtmp">18.24 rtmp</a></li>
  284. <li><a id="toc-rtmpe" href="#rtmpe">18.25 rtmpe</a></li>
  285. <li><a id="toc-rtmps" href="#rtmps">18.26 rtmps</a></li>
  286. <li><a id="toc-rtmpt" href="#rtmpt">18.27 rtmpt</a></li>
  287. <li><a id="toc-rtmpte" href="#rtmpte">18.28 rtmpte</a></li>
  288. <li><a id="toc-rtmpts" href="#rtmpts">18.29 rtmpts</a></li>
  289. <li><a id="toc-libsmbclient" href="#libsmbclient">18.30 libsmbclient</a></li>
  290. <li><a id="toc-libssh" href="#libssh">18.31 libssh</a></li>
  291. <li><a id="toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">18.32 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
  292. <li><a id="toc-rtp" href="#rtp">18.33 rtp</a></li>
  293. <li><a id="toc-rtsp" href="#rtsp">18.34 rtsp</a>
  294. <ul class="toc-numbered-mark">
  295. <li><a id="toc-Muxer" href="#Muxer">18.34.1 Muxer</a></li>
  296. <li><a id="toc-Demuxer" href="#Demuxer">18.34.2 Demuxer</a></li>
  297. <li><a id="toc-Examples-8" href="#Examples-8">18.34.3 Examples</a></li>
  298. </ul></li>
  299. <li><a id="toc-sap" href="#sap">18.35 sap</a>
  300. <ul class="toc-numbered-mark">
  301. <li><a id="toc-Muxer-1" href="#Muxer-1">18.35.1 Muxer</a></li>
  302. <li><a id="toc-Demuxer-1" href="#Demuxer-1">18.35.2 Demuxer</a></li>
  303. </ul></li>
  304. <li><a id="toc-sctp" href="#sctp">18.36 sctp</a></li>
  305. <li><a id="toc-srt" href="#srt">18.37 srt</a></li>
  306. <li><a id="toc-srtp" href="#srtp">18.38 srtp</a></li>
  307. <li><a id="toc-subfile" href="#subfile">18.39 subfile</a></li>
  308. <li><a id="toc-tee" href="#tee">18.40 tee</a></li>
  309. <li><a id="toc-tcp" href="#tcp">18.41 tcp</a></li>
  310. <li><a id="toc-tls" href="#tls">18.42 tls</a></li>
  311. <li><a id="toc-dtls" href="#dtls">18.43 dtls</a></li>
  312. <li><a id="toc-udp" href="#udp">18.44 udp</a>
  313. <ul class="toc-numbered-mark">
  314. <li><a id="toc-Examples-9" href="#Examples-9">18.44.1 Examples</a></li>
  315. </ul></li>
  316. <li><a id="toc-unix" href="#unix">18.45 unix</a></li>
  317. <li><a id="toc-zmq" href="#zmq">18.46 zmq</a></li>
  318. </ul></li>
  319. <li><a id="toc-Device-Options" href="#Device-Options">19 Device Options</a></li>
  320. <li><a id="toc-Input-Devices" href="#Input-Devices">20 Input Devices</a>
  321. <ul class="toc-numbered-mark">
  322. <li><a id="toc-alsa" href="#alsa">20.1 alsa</a>
  323. <ul class="toc-numbered-mark">
  324. <li><a id="toc-Options-17" href="#Options-17">20.1.1 Options</a></li>
  325. </ul></li>
  326. <li><a id="toc-android_005fcamera" href="#android_005fcamera">20.2 android_camera</a>
  327. <ul class="toc-numbered-mark">
  328. <li><a id="toc-Options-18" href="#Options-18">20.2.1 Options</a></li>
  329. </ul></li>
  330. <li><a id="toc-avfoundation" href="#avfoundation">20.3 avfoundation</a>
  331. <ul class="toc-numbered-mark">
  332. <li><a id="toc-Options-19" href="#Options-19">20.3.1 Options</a></li>
  333. <li><a id="toc-Examples-10" href="#Examples-10">20.3.2 Examples</a></li>
  334. </ul></li>
  335. <li><a id="toc-decklink" href="#decklink">20.4 decklink</a>
  336. <ul class="toc-numbered-mark">
  337. <li><a id="toc-Options-20" href="#Options-20">20.4.1 Options</a></li>
  338. <li><a id="toc-Examples-11" href="#Examples-11">20.4.2 Examples</a></li>
  339. </ul></li>
  340. <li><a id="toc-dshow" href="#dshow">20.5 dshow</a>
  341. <ul class="toc-numbered-mark">
  342. <li><a id="toc-Options-21" href="#Options-21">20.5.1 Options</a></li>
  343. <li><a id="toc-Examples-12" href="#Examples-12">20.5.2 Examples</a></li>
  344. </ul></li>
  345. <li><a id="toc-fbdev" href="#fbdev">20.6 fbdev</a>
  346. <ul class="toc-numbered-mark">
  347. <li><a id="toc-Options-22" href="#Options-22">20.6.1 Options</a></li>
  348. </ul></li>
  349. <li><a id="toc-gdigrab" href="#gdigrab">20.7 gdigrab</a>
  350. <ul class="toc-numbered-mark">
  351. <li><a id="toc-Options-23" href="#Options-23">20.7.1 Options</a></li>
  352. </ul></li>
  353. <li><a id="toc-iec61883" href="#iec61883">20.8 iec61883</a>
  354. <ul class="toc-numbered-mark">
  355. <li><a id="toc-Options-24" href="#Options-24">20.8.1 Options</a></li>
  356. <li><a id="toc-Examples-13" href="#Examples-13">20.8.2 Examples</a></li>
  357. </ul></li>
  358. <li><a id="toc-jack" href="#jack">20.9 jack</a>
  359. <ul class="toc-numbered-mark">
  360. <li><a id="toc-Options-25" href="#Options-25">20.9.1 Options</a></li>
  361. </ul></li>
  362. <li><a id="toc-kmsgrab" href="#kmsgrab">20.10 kmsgrab</a>
  363. <ul class="toc-numbered-mark">
  364. <li><a id="toc-Options-26" href="#Options-26">20.10.1 Options</a></li>
  365. <li><a id="toc-Examples-14" href="#Examples-14">20.10.2 Examples</a></li>
  366. </ul></li>
  367. <li><a id="toc-lavfi" href="#lavfi">20.11 lavfi</a>
  368. <ul class="toc-numbered-mark">
  369. <li><a id="toc-Options-27" href="#Options-27">20.11.1 Options</a></li>
  370. <li><a id="toc-Examples-15" href="#Examples-15">20.11.2 Examples</a></li>
  371. </ul></li>
  372. <li><a id="toc-libcdio" href="#libcdio">20.12 libcdio</a>
  373. <ul class="toc-numbered-mark">
  374. <li><a id="toc-Options-28" href="#Options-28">20.12.1 Options</a></li>
  375. </ul></li>
  376. <li><a id="toc-libdc1394" href="#libdc1394">20.13 libdc1394</a>
  377. <ul class="toc-numbered-mark">
  378. <li><a id="toc-Options-29" href="#Options-29">20.13.1 Options</a></li>
  379. </ul></li>
  380. <li><a id="toc-openal" href="#openal">20.14 openal</a>
  381. <ul class="toc-numbered-mark">
  382. <li><a id="toc-Options-30" href="#Options-30">20.14.1 Options</a></li>
  383. <li><a id="toc-Examples-16" href="#Examples-16">20.14.2 Examples</a></li>
  384. </ul></li>
  385. <li><a id="toc-oss" href="#oss">20.15 oss</a>
  386. <ul class="toc-numbered-mark">
  387. <li><a id="toc-Options-31" href="#Options-31">20.15.1 Options</a></li>
  388. </ul></li>
  389. <li><a id="toc-pulse" href="#pulse">20.16 pulse</a>
  390. <ul class="toc-numbered-mark">
  391. <li><a id="toc-Options-32" href="#Options-32">20.16.1 Options</a></li>
  392. <li><a id="toc-Examples-17" href="#Examples-17">20.16.2 Examples</a></li>
  393. </ul></li>
  394. <li><a id="toc-sndio" href="#sndio">20.17 sndio</a>
  395. <ul class="toc-numbered-mark">
  396. <li><a id="toc-Options-33" href="#Options-33">20.17.1 Options</a></li>
  397. </ul></li>
  398. <li><a id="toc-video4linux2_002c-v4l2" href="#video4linux2_002c-v4l2">20.18 video4linux2, v4l2</a>
  399. <ul class="toc-numbered-mark">
  400. <li><a id="toc-Options-34" href="#Options-34">20.18.1 Options</a></li>
  401. </ul></li>
  402. <li><a id="toc-vfwcap" href="#vfwcap">20.19 vfwcap</a>
  403. <ul class="toc-numbered-mark">
  404. <li><a id="toc-Options-35" href="#Options-35">20.19.1 Options</a></li>
  405. </ul></li>
  406. <li><a id="toc-x11grab" href="#x11grab">20.20 x11grab</a>
  407. <ul class="toc-numbered-mark">
  408. <li><a id="toc-Options-36" href="#Options-36">20.20.1 Options</a></li>
  409. </ul></li>
  410. </ul></li>
  411. <li><a id="toc-Resampler-Options" href="#Resampler-Options">21 Resampler Options</a></li>
  412. <li><a id="toc-Scaler-Options" href="#Scaler-Options">22 Scaler Options</a></li>
  413. <li><a id="toc-Filtering-Introduction" href="#Filtering-Introduction">23 Filtering Introduction</a></li>
  414. <li><a id="toc-graph2dot" href="#graph2dot">24 graph2dot</a></li>
  415. <li><a id="toc-Filtergraph-description" href="#Filtergraph-description">25 Filtergraph description</a>
  416. <ul class="toc-numbered-mark">
  417. <li><a id="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">25.1 Filtergraph syntax</a></li>
  418. <li><a id="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">25.2 Notes on filtergraph escaping</a></li>
  419. </ul></li>
  420. <li><a id="toc-Timeline-editing" href="#Timeline-editing">26 Timeline editing</a></li>
  421. <li><a id="toc-Changing-options-at-runtime-with-a-command" href="#Changing-options-at-runtime-with-a-command">27 Changing options at runtime with a command</a></li>
  422. <li><a id="toc-Options-for-filters-with-several-inputs-_0028framesync_0029" href="#Options-for-filters-with-several-inputs-_0028framesync_0029">28 Options for filters with several inputs (framesync)</a></li>
  423. <li><a id="toc-Audio-Filters" href="#Audio-Filters">29 Audio Filters</a>
  424. <ul class="toc-numbered-mark">
  425. <li><a id="toc-aap" href="#aap">29.1 aap</a></li>
  426. <li><a id="toc-acompressor" href="#acompressor">29.2 acompressor</a>
  427. <ul class="toc-numbered-mark">
  428. <li><a id="toc-Commands" href="#Commands">29.2.1 Commands</a></li>
  429. </ul></li>
  430. <li><a id="toc-acontrast" href="#acontrast">29.3 acontrast</a></li>
  431. <li><a id="toc-acopy" href="#acopy">29.4 acopy</a></li>
  432. <li><a id="toc-acrossfade" href="#acrossfade">29.5 acrossfade</a>
  433. <ul class="toc-numbered-mark">
  434. <li><a id="toc-Examples-18" href="#Examples-18">29.5.1 Examples</a></li>
  435. </ul></li>
  436. <li><a id="toc-acrossover" href="#acrossover">29.6 acrossover</a>
  437. <ul class="toc-numbered-mark">
  438. <li><a id="toc-Examples-19" href="#Examples-19">29.6.1 Examples</a></li>
  439. </ul></li>
  440. <li><a id="toc-acrusher" href="#acrusher">29.7 acrusher</a>
  441. <ul class="toc-numbered-mark">
  442. <li><a id="toc-Commands-1" href="#Commands-1">29.7.1 Commands</a></li>
  443. </ul></li>
  444. <li><a id="toc-acue" href="#acue">29.8 acue</a></li>
  445. <li><a id="toc-adeclick" href="#adeclick">29.9 adeclick</a></li>
  446. <li><a id="toc-adeclip" href="#adeclip">29.10 adeclip</a></li>
  447. <li><a id="toc-adecorrelate" href="#adecorrelate">29.11 adecorrelate</a></li>
  448. <li><a id="toc-adelay" href="#adelay">29.12 adelay</a>
  449. <ul class="toc-numbered-mark">
  450. <li><a id="toc-Examples-20" href="#Examples-20">29.12.1 Examples</a></li>
  451. </ul></li>
  452. <li><a id="toc-adenorm" href="#adenorm">29.13 adenorm</a>
  453. <ul class="toc-numbered-mark">
  454. <li><a id="toc-Commands-2" href="#Commands-2">29.13.1 Commands</a></li>
  455. </ul></li>
  456. <li><a id="toc-aderivative_002c-aintegral" href="#aderivative_002c-aintegral">29.14 aderivative, aintegral</a></li>
  457. <li><a id="toc-adrc" href="#adrc">29.15 adrc</a>
  458. <ul class="toc-numbered-mark">
  459. <li><a id="toc-Commands-3" href="#Commands-3">29.15.1 Commands</a></li>
  460. <li><a id="toc-Examples-21" href="#Examples-21">29.15.2 Examples</a></li>
  461. </ul></li>
  462. <li><a id="toc-adynamicequalizer" href="#adynamicequalizer">29.16 adynamicequalizer</a>
  463. <ul class="toc-numbered-mark">
  464. <li><a id="toc-Commands-4" href="#Commands-4">29.16.1 Commands</a></li>
  465. </ul></li>
  466. <li><a id="toc-adynamicsmooth" href="#adynamicsmooth">29.17 adynamicsmooth</a>
  467. <ul class="toc-numbered-mark">
  468. <li><a id="toc-Commands-5" href="#Commands-5">29.17.1 Commands</a></li>
  469. </ul></li>
  470. <li><a id="toc-aecho" href="#aecho">29.18 aecho</a>
  471. <ul class="toc-numbered-mark">
  472. <li><a id="toc-Examples-22" href="#Examples-22">29.18.1 Examples</a></li>
  473. </ul></li>
  474. <li><a id="toc-aemphasis" href="#aemphasis">29.19 aemphasis</a>
  475. <ul class="toc-numbered-mark">
  476. <li><a id="toc-Commands-6" href="#Commands-6">29.19.1 Commands</a></li>
  477. </ul></li>
  478. <li><a id="toc-aeval" href="#aeval">29.20 aeval</a>
  479. <ul class="toc-numbered-mark">
  480. <li><a id="toc-Examples-23" href="#Examples-23">29.20.1 Examples</a></li>
  481. </ul></li>
  482. <li><a id="toc-aexciter" href="#aexciter">29.21 aexciter</a>
  483. <ul class="toc-numbered-mark">
  484. <li><a id="toc-Commands-7" href="#Commands-7">29.21.1 Commands</a></li>
  485. </ul></li>
  486. <li><a id="toc-afade-1" href="#afade-1">29.22 afade</a>
  487. <ul class="toc-numbered-mark">
  488. <li><a id="toc-Commands-8" href="#Commands-8">29.22.1 Commands</a></li>
  489. <li><a id="toc-Examples-24" href="#Examples-24">29.22.2 Examples</a></li>
  490. </ul></li>
  491. <li><a id="toc-afftdn" href="#afftdn">29.23 afftdn</a>
  492. <ul class="toc-numbered-mark">
  493. <li><a id="toc-Commands-9" href="#Commands-9">29.23.1 Commands</a></li>
  494. <li><a id="toc-Examples-25" href="#Examples-25">29.23.2 Examples</a></li>
  495. </ul></li>
  496. <li><a id="toc-afftfilt" href="#afftfilt">29.24 afftfilt</a>
  497. <ul class="toc-numbered-mark">
  498. <li><a id="toc-Examples-26" href="#Examples-26">29.24.1 Examples</a></li>
  499. </ul></li>
  500. <li><a id="toc-afir-1" href="#afir-1">29.25 afir</a>
  501. <ul class="toc-numbered-mark">
  502. <li><a id="toc-Examples-27" href="#Examples-27">29.25.1 Examples</a></li>
  503. </ul></li>
  504. <li><a id="toc-aformat-1" href="#aformat-1">29.26 aformat</a></li>
  505. <li><a id="toc-afreqshift" href="#afreqshift">29.27 afreqshift</a>
  506. <ul class="toc-numbered-mark">
  507. <li><a id="toc-Commands-10" href="#Commands-10">29.27.1 Commands</a></li>
  508. </ul></li>
  509. <li><a id="toc-afwtdn" href="#afwtdn">29.28 afwtdn</a>
  510. <ul class="toc-numbered-mark">
  511. <li><a id="toc-Commands-11" href="#Commands-11">29.28.1 Commands</a></li>
  512. </ul></li>
  513. <li><a id="toc-agate" href="#agate">29.29 agate</a>
  514. <ul class="toc-numbered-mark">
  515. <li><a id="toc-Commands-12" href="#Commands-12">29.29.1 Commands</a></li>
  516. </ul></li>
  517. <li><a id="toc-aiir" href="#aiir">29.30 aiir</a>
  518. <ul class="toc-numbered-mark">
  519. <li><a id="toc-Examples-28" href="#Examples-28">29.30.1 Examples</a></li>
  520. </ul></li>
  521. <li><a id="toc-alimiter" href="#alimiter">29.31 alimiter</a></li>
  522. <li><a id="toc-allpass" href="#allpass">29.32 allpass</a>
  523. <ul class="toc-numbered-mark">
  524. <li><a id="toc-Commands-13" href="#Commands-13">29.32.1 Commands</a></li>
  525. </ul></li>
  526. <li><a id="toc-aloop" href="#aloop">29.33 aloop</a></li>
  527. <li><a id="toc-amerge-1" href="#amerge-1">29.34 amerge</a>
  528. <ul class="toc-numbered-mark">
  529. <li><a id="toc-Examples-29" href="#Examples-29">29.34.1 Examples</a></li>
  530. </ul></li>
  531. <li><a id="toc-amix" href="#amix">29.35 amix</a>
  532. <ul class="toc-numbered-mark">
  533. <li><a id="toc-Examples-30" href="#Examples-30">29.35.1 Examples</a></li>
  534. <li><a id="toc-Commands-14" href="#Commands-14">29.35.2 Commands</a></li>
  535. </ul></li>
  536. <li><a id="toc-amultiply" href="#amultiply">29.36 amultiply</a></li>
  537. <li><a id="toc-anequalizer" href="#anequalizer">29.37 anequalizer</a>
  538. <ul class="toc-numbered-mark">
  539. <li><a id="toc-Examples-31" href="#Examples-31">29.37.1 Examples</a></li>
  540. <li><a id="toc-Commands-15" href="#Commands-15">29.37.2 Commands</a></li>
  541. </ul></li>
  542. <li><a id="toc-anlmdn" href="#anlmdn">29.38 anlmdn</a>
  543. <ul class="toc-numbered-mark">
  544. <li><a id="toc-Commands-16" href="#Commands-16">29.38.1 Commands</a></li>
  545. </ul></li>
  546. <li><a id="toc-anlmf_002c-anlms" href="#anlmf_002c-anlms">29.39 anlmf, anlms</a>
  547. <ul class="toc-numbered-mark">
  548. <li><a id="toc-Examples-32" href="#Examples-32">29.39.1 Examples</a></li>
  549. <li><a id="toc-Commands-17" href="#Commands-17">29.39.2 Commands</a></li>
  550. </ul></li>
  551. <li><a id="toc-anull" href="#anull">29.40 anull</a></li>
  552. <li><a id="toc-apad" href="#apad">29.41 apad</a>
  553. <ul class="toc-numbered-mark">
  554. <li><a id="toc-Examples-33" href="#Examples-33">29.41.1 Examples</a></li>
  555. </ul></li>
  556. <li><a id="toc-aphaser" href="#aphaser">29.42 aphaser</a></li>
  557. <li><a id="toc-aphaseshift" href="#aphaseshift">29.43 aphaseshift</a>
  558. <ul class="toc-numbered-mark">
  559. <li><a id="toc-Commands-18" href="#Commands-18">29.43.1 Commands</a></li>
  560. </ul></li>
  561. <li><a id="toc-apsnr" href="#apsnr">29.44 apsnr</a></li>
  562. <li><a id="toc-apsyclip" href="#apsyclip">29.45 apsyclip</a>
  563. <ul class="toc-numbered-mark">
  564. <li><a id="toc-Commands-19" href="#Commands-19">29.45.1 Commands</a></li>
  565. </ul></li>
  566. <li><a id="toc-apulsator" href="#apulsator">29.46 apulsator</a></li>
  567. <li><a id="toc-aresample-1" href="#aresample-1">29.47 aresample</a>
  568. <ul class="toc-numbered-mark">
  569. <li><a id="toc-Examples-34" href="#Examples-34">29.47.1 Examples</a></li>
  570. </ul></li>
  571. <li><a id="toc-areverse" href="#areverse">29.48 areverse</a>
  572. <ul class="toc-numbered-mark">
  573. <li><a id="toc-Examples-35" href="#Examples-35">29.48.1 Examples</a></li>
  574. </ul></li>
  575. <li><a id="toc-arls" href="#arls">29.49 arls</a></li>
  576. <li><a id="toc-arnndn" href="#arnndn">29.50 arnndn</a>
  577. <ul class="toc-numbered-mark">
  578. <li><a id="toc-Commands-20" href="#Commands-20">29.50.1 Commands</a></li>
  579. </ul></li>
  580. <li><a id="toc-asdr" href="#asdr">29.51 asdr</a></li>
  581. <li><a id="toc-asetnsamples" href="#asetnsamples">29.52 asetnsamples</a></li>
  582. <li><a id="toc-asetrate" href="#asetrate">29.53 asetrate</a></li>
  583. <li><a id="toc-ashowinfo" href="#ashowinfo">29.54 ashowinfo</a></li>
  584. <li><a id="toc-asisdr" href="#asisdr">29.55 asisdr</a></li>
  585. <li><a id="toc-asoftclip" href="#asoftclip">29.56 asoftclip</a>
  586. <ul class="toc-numbered-mark">
  587. <li><a id="toc-Commands-21" href="#Commands-21">29.56.1 Commands</a></li>
  588. </ul></li>
  589. <li><a id="toc-aspectralstats" href="#aspectralstats">29.57 aspectralstats</a></li>
  590. <li><a id="toc-asr" href="#asr">29.58 asr</a></li>
  591. <li><a id="toc-astats-1" href="#astats-1">29.59 astats</a></li>
  592. <li><a id="toc-asubboost" href="#asubboost">29.60 asubboost</a>
  593. <ul class="toc-numbered-mark">
  594. <li><a id="toc-Commands-22" href="#Commands-22">29.60.1 Commands</a></li>
  595. </ul></li>
  596. <li><a id="toc-asubcut" href="#asubcut">29.61 asubcut</a>
  597. <ul class="toc-numbered-mark">
  598. <li><a id="toc-Commands-23" href="#Commands-23">29.61.1 Commands</a></li>
  599. </ul></li>
  600. <li><a id="toc-asupercut" href="#asupercut">29.62 asupercut</a>
  601. <ul class="toc-numbered-mark">
  602. <li><a id="toc-Commands-24" href="#Commands-24">29.62.1 Commands</a></li>
  603. </ul></li>
  604. <li><a id="toc-asuperpass" href="#asuperpass">29.63 asuperpass</a>
  605. <ul class="toc-numbered-mark">
  606. <li><a id="toc-Commands-25" href="#Commands-25">29.63.1 Commands</a></li>
  607. </ul></li>
  608. <li><a id="toc-asuperstop" href="#asuperstop">29.64 asuperstop</a>
  609. <ul class="toc-numbered-mark">
  610. <li><a id="toc-Commands-26" href="#Commands-26">29.64.1 Commands</a></li>
  611. </ul></li>
  612. <li><a id="toc-atempo" href="#atempo">29.65 atempo</a>
  613. <ul class="toc-numbered-mark">
  614. <li><a id="toc-Examples-36" href="#Examples-36">29.65.1 Examples</a></li>
  615. <li><a id="toc-Commands-27" href="#Commands-27">29.65.2 Commands</a></li>
  616. </ul></li>
  617. <li><a id="toc-atilt" href="#atilt">29.66 atilt</a>
  618. <ul class="toc-numbered-mark">
  619. <li><a id="toc-Commands-28" href="#Commands-28">29.66.1 Commands</a></li>
  620. </ul></li>
  621. <li><a id="toc-atrim" href="#atrim">29.67 atrim</a></li>
  622. <li><a id="toc-axcorrelate" href="#axcorrelate">29.68 axcorrelate</a>
  623. <ul class="toc-numbered-mark">
  624. <li><a id="toc-Examples-37" href="#Examples-37">29.68.1 Examples</a></li>
  625. </ul></li>
  626. <li><a id="toc-bandpass" href="#bandpass">29.69 bandpass</a>
  627. <ul class="toc-numbered-mark">
  628. <li><a id="toc-Commands-29" href="#Commands-29">29.69.1 Commands</a></li>
  629. </ul></li>
  630. <li><a id="toc-bandreject" href="#bandreject">29.70 bandreject</a>
  631. <ul class="toc-numbered-mark">
  632. <li><a id="toc-Commands-30" href="#Commands-30">29.70.1 Commands</a></li>
  633. </ul></li>
  634. <li><a id="toc-bass_002c-lowshelf" href="#bass_002c-lowshelf">29.71 bass, lowshelf</a>
  635. <ul class="toc-numbered-mark">
  636. <li><a id="toc-Commands-31" href="#Commands-31">29.71.1 Commands</a></li>
  637. </ul></li>
  638. <li><a id="toc-biquad" href="#biquad">29.72 biquad</a>
  639. <ul class="toc-numbered-mark">
  640. <li><a id="toc-Commands-32" href="#Commands-32">29.72.1 Commands</a></li>
  641. </ul></li>
  642. <li><a id="toc-bs2b" href="#bs2b">29.73 bs2b</a></li>
  643. <li><a id="toc-channelmap" href="#channelmap">29.74 channelmap</a>
  644. <ul class="toc-numbered-mark">
  645. <li><a id="toc-Examples-38" href="#Examples-38">29.74.1 Examples</a></li>
  646. </ul></li>
  647. <li><a id="toc-channelsplit" href="#channelsplit">29.75 channelsplit</a>
  648. <ul class="toc-numbered-mark">
  649. <li><a id="toc-Examples-39" href="#Examples-39">29.75.1 Examples</a></li>
  650. </ul></li>
  651. <li><a id="toc-chorus" href="#chorus">29.76 chorus</a>
  652. <ul class="toc-numbered-mark">
  653. <li><a id="toc-Examples-40" href="#Examples-40">29.76.1 Examples</a></li>
  654. </ul></li>
  655. <li><a id="toc-compand" href="#compand">29.77 compand</a>
  656. <ul class="toc-numbered-mark">
  657. <li><a id="toc-Examples-41" href="#Examples-41">29.77.1 Examples</a></li>
  658. </ul></li>
  659. <li><a id="toc-compensationdelay" href="#compensationdelay">29.78 compensationdelay</a>
  660. <ul class="toc-numbered-mark">
  661. <li><a id="toc-Commands-33" href="#Commands-33">29.78.1 Commands</a></li>
  662. </ul></li>
  663. <li><a id="toc-crossfeed" href="#crossfeed">29.79 crossfeed</a>
  664. <ul class="toc-numbered-mark">
  665. <li><a id="toc-Commands-34" href="#Commands-34">29.79.1 Commands</a></li>
  666. </ul></li>
  667. <li><a id="toc-crystalizer" href="#crystalizer">29.80 crystalizer</a>
  668. <ul class="toc-numbered-mark">
  669. <li><a id="toc-Commands-35" href="#Commands-35">29.80.1 Commands</a></li>
  670. </ul></li>
  671. <li><a id="toc-dcshift" href="#dcshift">29.81 dcshift</a></li>
  672. <li><a id="toc-deesser" href="#deesser">29.82 deesser</a></li>
  673. <li><a id="toc-dialoguenhance" href="#dialoguenhance">29.83 dialoguenhance</a>
  674. <ul class="toc-numbered-mark">
  675. <li><a id="toc-Commands-36" href="#Commands-36">29.83.1 Commands</a></li>
  676. </ul></li>
  677. <li><a id="toc-drmeter" href="#drmeter">29.84 drmeter</a></li>
  678. <li><a id="toc-dynaudnorm" href="#dynaudnorm">29.85 dynaudnorm</a>
  679. <ul class="toc-numbered-mark">
  680. <li><a id="toc-Commands-37" href="#Commands-37">29.85.1 Commands</a></li>
  681. </ul></li>
  682. <li><a id="toc-earwax" href="#earwax">29.86 earwax</a></li>
  683. <li><a id="toc-equalizer" href="#equalizer">29.87 equalizer</a>
  684. <ul class="toc-numbered-mark">
  685. <li><a id="toc-Examples-42" href="#Examples-42">29.87.1 Examples</a></li>
  686. <li><a id="toc-Commands-38" href="#Commands-38">29.87.2 Commands</a></li>
  687. </ul></li>
  688. <li><a id="toc-extrastereo" href="#extrastereo">29.88 extrastereo</a>
  689. <ul class="toc-numbered-mark">
  690. <li><a id="toc-Commands-39" href="#Commands-39">29.88.1 Commands</a></li>
  691. </ul></li>
  692. <li><a id="toc-firequalizer" href="#firequalizer">29.89 firequalizer</a>
  693. <ul class="toc-numbered-mark">
  694. <li><a id="toc-Examples-43" href="#Examples-43">29.89.1 Examples</a></li>
  695. </ul></li>
  696. <li><a id="toc-flanger" href="#flanger">29.90 flanger</a></li>
  697. <li><a id="toc-haas" href="#haas">29.91 haas</a></li>
  698. <li><a id="toc-hdcd" href="#hdcd">29.92 hdcd</a></li>
  699. <li><a id="toc-headphone" href="#headphone">29.93 headphone</a>
  700. <ul class="toc-numbered-mark">
  701. <li><a id="toc-Examples-44" href="#Examples-44">29.93.1 Examples</a></li>
  702. </ul></li>
  703. <li><a id="toc-highpass" href="#highpass">29.94 highpass</a>
  704. <ul class="toc-numbered-mark">
  705. <li><a id="toc-Commands-40" href="#Commands-40">29.94.1 Commands</a></li>
  706. </ul></li>
  707. <li><a id="toc-join" href="#join">29.95 join</a></li>
  708. <li><a id="toc-ladspa" href="#ladspa">29.96 ladspa</a>
  709. <ul class="toc-numbered-mark">
  710. <li><a id="toc-Examples-45" href="#Examples-45">29.96.1 Examples</a></li>
  711. <li><a id="toc-Commands-41" href="#Commands-41">29.96.2 Commands</a></li>
  712. </ul></li>
  713. <li><a id="toc-loudnorm" href="#loudnorm">29.97 loudnorm</a></li>
  714. <li><a id="toc-lowpass" href="#lowpass">29.98 lowpass</a>
  715. <ul class="toc-numbered-mark">
  716. <li><a id="toc-Examples-46" href="#Examples-46">29.98.1 Examples</a></li>
  717. <li><a id="toc-Commands-42" href="#Commands-42">29.98.2 Commands</a></li>
  718. </ul></li>
  719. <li><a id="toc-lv2" href="#lv2">29.99 lv2</a>
  720. <ul class="toc-numbered-mark">
  721. <li><a id="toc-Examples-47" href="#Examples-47">29.99.1 Examples</a></li>
  722. <li><a id="toc-Commands-43" href="#Commands-43">29.99.2 Commands</a></li>
  723. </ul></li>
  724. <li><a id="toc-mcompand" href="#mcompand">29.100 mcompand</a></li>
  725. <li><a id="toc-pan-1" href="#pan-1">29.101 pan</a>
  726. <ul class="toc-numbered-mark">
  727. <li><a id="toc-Mixing-examples" href="#Mixing-examples">29.101.1 Mixing examples</a></li>
  728. <li><a id="toc-Remapping-examples" href="#Remapping-examples">29.101.2 Remapping examples</a></li>
  729. </ul></li>
  730. <li><a id="toc-replaygain" href="#replaygain">29.102 replaygain</a></li>
  731. <li><a id="toc-resample" href="#resample">29.103 resample</a></li>
  732. <li><a id="toc-rubberband" href="#rubberband">29.104 rubberband</a>
  733. <ul class="toc-numbered-mark">
  734. <li><a id="toc-Commands-44" href="#Commands-44">29.104.1 Commands</a></li>
  735. </ul></li>
  736. <li><a id="toc-sidechaincompress" href="#sidechaincompress">29.105 sidechaincompress</a>
  737. <ul class="toc-numbered-mark">
  738. <li><a id="toc-Commands-45" href="#Commands-45">29.105.1 Commands</a></li>
  739. <li><a id="toc-Examples-48" href="#Examples-48">29.105.2 Examples</a></li>
  740. </ul></li>
  741. <li><a id="toc-sidechaingate" href="#sidechaingate">29.106 sidechaingate</a>
  742. <ul class="toc-numbered-mark">
  743. <li><a id="toc-Commands-46" href="#Commands-46">29.106.1 Commands</a></li>
  744. </ul></li>
  745. <li><a id="toc-silencedetect" href="#silencedetect">29.107 silencedetect</a>
  746. <ul class="toc-numbered-mark">
  747. <li><a id="toc-Examples-49" href="#Examples-49">29.107.1 Examples</a></li>
  748. </ul></li>
  749. <li><a id="toc-silenceremove" href="#silenceremove">29.108 silenceremove</a>
  750. <ul class="toc-numbered-mark">
  751. <li><a id="toc-Examples-50" href="#Examples-50">29.108.1 Examples</a></li>
  752. <li><a id="toc-Commands-47" href="#Commands-47">29.108.2 Commands</a></li>
  753. </ul></li>
  754. <li><a id="toc-sofalizer" href="#sofalizer">29.109 sofalizer</a>
  755. <ul class="toc-numbered-mark">
  756. <li><a id="toc-Examples-51" href="#Examples-51">29.109.1 Examples</a></li>
  757. </ul></li>
  758. <li><a id="toc-speechnorm" href="#speechnorm">29.110 speechnorm</a>
  759. <ul class="toc-numbered-mark">
  760. <li><a id="toc-Commands-48" href="#Commands-48">29.110.1 Commands</a></li>
  761. <li><a id="toc-Examples-52" href="#Examples-52">29.110.2 Examples</a></li>
  762. </ul></li>
  763. <li><a id="toc-stereotools" href="#stereotools">29.111 stereotools</a>
  764. <ul class="toc-numbered-mark">
  765. <li><a id="toc-Commands-49" href="#Commands-49">29.111.1 Commands</a></li>
  766. <li><a id="toc-Examples-53" href="#Examples-53">29.111.2 Examples</a></li>
  767. </ul></li>
  768. <li><a id="toc-stereowiden" href="#stereowiden">29.112 stereowiden</a>
  769. <ul class="toc-numbered-mark">
  770. <li><a id="toc-Commands-50" href="#Commands-50">29.112.1 Commands</a></li>
  771. </ul></li>
  772. <li><a id="toc-superequalizer" href="#superequalizer">29.113 superequalizer</a></li>
  773. <li><a id="toc-surround" href="#surround">29.114 surround</a></li>
  774. <li><a id="toc-tiltshelf" href="#tiltshelf">29.115 tiltshelf</a>
  775. <ul class="toc-numbered-mark">
  776. <li><a id="toc-Commands-51" href="#Commands-51">29.115.1 Commands</a></li>
  777. </ul></li>
  778. <li><a id="toc-treble_002c-highshelf" href="#treble_002c-highshelf">29.116 treble, highshelf</a>
  779. <ul class="toc-numbered-mark">
  780. <li><a id="toc-Commands-52" href="#Commands-52">29.116.1 Commands</a></li>
  781. </ul></li>
  782. <li><a id="toc-tremolo" href="#tremolo">29.117 tremolo</a></li>
  783. <li><a id="toc-vibrato" href="#vibrato">29.118 vibrato</a></li>
  784. <li><a id="toc-virtualbass" href="#virtualbass">29.119 virtualbass</a></li>
  785. <li><a id="toc-volume" href="#volume">29.120 volume</a>
  786. <ul class="toc-numbered-mark">
  787. <li><a id="toc-Commands-53" href="#Commands-53">29.120.1 Commands</a></li>
  788. <li><a id="toc-Examples-54" href="#Examples-54">29.120.2 Examples</a></li>
  789. </ul></li>
  790. <li><a id="toc-volumedetect" href="#volumedetect">29.121 volumedetect</a>
  791. <ul class="toc-numbered-mark">
  792. <li><a id="toc-Examples-55" href="#Examples-55">29.121.1 Examples</a></li>
  793. </ul></li>
  794. <li><a id="toc-whisper-1" href="#whisper-1">29.122 whisper</a>
  795. <ul class="toc-numbered-mark">
  796. <li><a id="toc-Examples-56" href="#Examples-56">29.122.1 Examples</a></li>
  797. </ul></li>
  798. </ul></li>
  799. <li><a id="toc-Audio-Sources" href="#Audio-Sources">30 Audio Sources</a>
  800. <ul class="toc-numbered-mark">
  801. <li><a id="toc-abuffer" href="#abuffer">30.1 abuffer</a>
  802. <ul class="toc-numbered-mark">
  803. <li><a id="toc-Examples-57" href="#Examples-57">30.1.1 Examples</a></li>
  804. </ul></li>
  805. <li><a id="toc-aevalsrc" href="#aevalsrc">30.2 aevalsrc</a>
  806. <ul class="toc-numbered-mark">
  807. <li><a id="toc-Examples-58" href="#Examples-58">30.2.1 Examples</a></li>
  808. </ul></li>
  809. <li><a id="toc-afdelaysrc" href="#afdelaysrc">30.3 afdelaysrc</a></li>
  810. <li><a id="toc-afireqsrc" href="#afireqsrc">30.4 afireqsrc</a></li>
  811. <li><a id="toc-afirsrc" href="#afirsrc">30.5 afirsrc</a></li>
  812. <li><a id="toc-anullsrc" href="#anullsrc">30.6 anullsrc</a>
  813. <ul class="toc-numbered-mark">
  814. <li><a id="toc-Examples-59" href="#Examples-59">30.6.1 Examples</a></li>
  815. </ul></li>
  816. <li><a id="toc-flite" href="#flite">30.7 flite</a>
  817. <ul class="toc-numbered-mark">
  818. <li><a id="toc-Examples-60" href="#Examples-60">30.7.1 Examples</a></li>
  819. </ul></li>
  820. <li><a id="toc-anoisesrc" href="#anoisesrc">30.8 anoisesrc</a>
  821. <ul class="toc-numbered-mark">
  822. <li><a id="toc-Examples-61" href="#Examples-61">30.8.1 Examples</a></li>
  823. </ul></li>
  824. <li><a id="toc-hilbert" href="#hilbert">30.9 hilbert</a></li>
  825. <li><a id="toc-sinc" href="#sinc">30.10 sinc</a></li>
  826. <li><a id="toc-sine" href="#sine">30.11 sine</a>
  827. <ul class="toc-numbered-mark">
  828. <li><a id="toc-Examples-62" href="#Examples-62">30.11.1 Examples</a></li>
  829. </ul></li>
  830. </ul></li>
  831. <li><a id="toc-Audio-Sinks" href="#Audio-Sinks">31 Audio Sinks</a>
  832. <ul class="toc-numbered-mark">
  833. <li><a id="toc-abuffersink" href="#abuffersink">31.1 abuffersink</a></li>
  834. <li><a id="toc-anullsink" href="#anullsink">31.2 anullsink</a></li>
  835. </ul></li>
  836. <li><a id="toc-Video-Filters" href="#Video-Filters">32 Video Filters</a>
  837. <ul class="toc-numbered-mark">
  838. <li><a id="toc-addroi" href="#addroi">32.1 addroi</a>
  839. <ul class="toc-numbered-mark">
  840. <li><a id="toc-Examples-63" href="#Examples-63">32.1.1 Examples</a></li>
  841. </ul></li>
  842. <li><a id="toc-alphaextract" href="#alphaextract">32.2 alphaextract</a></li>
  843. <li><a id="toc-alphamerge" href="#alphamerge">32.3 alphamerge</a></li>
  844. <li><a id="toc-amplify" href="#amplify">32.4 amplify</a>
  845. <ul class="toc-numbered-mark">
  846. <li><a id="toc-Commands-54" href="#Commands-54">32.4.1 Commands</a></li>
  847. </ul></li>
  848. <li><a id="toc-ass" href="#ass">32.5 ass</a></li>
  849. <li><a id="toc-atadenoise" href="#atadenoise">32.6 atadenoise</a>
  850. <ul class="toc-numbered-mark">
  851. <li><a id="toc-Commands-55" href="#Commands-55">32.6.1 Commands</a></li>
  852. </ul></li>
  853. <li><a id="toc-avgblur" href="#avgblur">32.7 avgblur</a>
  854. <ul class="toc-numbered-mark">
  855. <li><a id="toc-Commands-56" href="#Commands-56">32.7.1 Commands</a></li>
  856. </ul></li>
  857. <li><a id="toc-backgroundkey" href="#backgroundkey">32.8 backgroundkey</a>
  858. <ul class="toc-numbered-mark">
  859. <li><a id="toc-Commands-57" href="#Commands-57">32.8.1 Commands</a></li>
  860. </ul></li>
  861. <li><a id="toc-bbox" href="#bbox">32.9 bbox</a>
  862. <ul class="toc-numbered-mark">
  863. <li><a id="toc-Commands-58" href="#Commands-58">32.9.1 Commands</a></li>
  864. </ul></li>
  865. <li><a id="toc-bilateral" href="#bilateral">32.10 bilateral</a>
  866. <ul class="toc-numbered-mark">
  867. <li><a id="toc-Commands-59" href="#Commands-59">32.10.1 Commands</a></li>
  868. </ul></li>
  869. <li><a id="toc-bitplanenoise" href="#bitplanenoise">32.11 bitplanenoise</a></li>
  870. <li><a id="toc-blackdetect_002c-blackdetect_005fvulkan" href="#blackdetect_002c-blackdetect_005fvulkan">32.12 blackdetect, blackdetect_vulkan</a></li>
  871. <li><a id="toc-blackframe" href="#blackframe">32.13 blackframe</a></li>
  872. <li><a id="toc-blend-1" href="#blend-1">32.14 blend</a>
  873. <ul class="toc-numbered-mark">
  874. <li><a id="toc-Examples-64" href="#Examples-64">32.14.1 Examples</a></li>
  875. <li><a id="toc-Commands-60" href="#Commands-60">32.14.2 Commands</a></li>
  876. </ul></li>
  877. <li><a id="toc-blockdetect-1" href="#blockdetect-1">32.15 blockdetect</a>
  878. <ul class="toc-numbered-mark">
  879. <li><a id="toc-Examples-65" href="#Examples-65">32.15.1 Examples</a></li>
  880. </ul></li>
  881. <li><a id="toc-blurdetect-1" href="#blurdetect-1">32.16 blurdetect</a>
  882. <ul class="toc-numbered-mark">
  883. <li><a id="toc-Examples-66" href="#Examples-66">32.16.1 Examples</a></li>
  884. </ul></li>
  885. <li><a id="toc-bm3d" href="#bm3d">32.17 bm3d</a>
  886. <ul class="toc-numbered-mark">
  887. <li><a id="toc-Examples-67" href="#Examples-67">32.17.1 Examples</a></li>
  888. </ul></li>
  889. <li><a id="toc-boxblur" href="#boxblur">32.18 boxblur</a>
  890. <ul class="toc-numbered-mark">
  891. <li><a id="toc-Examples-68" href="#Examples-68">32.18.1 Examples</a></li>
  892. </ul></li>
  893. <li><a id="toc-bwdif-1" href="#bwdif-1">32.19 bwdif</a></li>
  894. <li><a id="toc-ccrepack" href="#ccrepack">32.20 ccrepack</a></li>
  895. <li><a id="toc-cas" href="#cas">32.21 cas</a>
  896. <ul class="toc-numbered-mark">
  897. <li><a id="toc-Commands-61" href="#Commands-61">32.21.1 Commands</a></li>
  898. </ul></li>
  899. <li><a id="toc-chromahold" href="#chromahold">32.22 chromahold</a>
  900. <ul class="toc-numbered-mark">
  901. <li><a id="toc-Commands-62" href="#Commands-62">32.22.1 Commands</a></li>
  902. </ul></li>
  903. <li><a id="toc-chromakey-1" href="#chromakey-1">32.23 chromakey</a>
  904. <ul class="toc-numbered-mark">
  905. <li><a id="toc-Commands-63" href="#Commands-63">32.23.1 Commands</a></li>
  906. <li><a id="toc-Examples-69" href="#Examples-69">32.23.2 Examples</a></li>
  907. </ul></li>
  908. <li><a id="toc-chromanr" href="#chromanr">32.24 chromanr</a>
  909. <ul class="toc-numbered-mark">
  910. <li><a id="toc-Commands-64" href="#Commands-64">32.24.1 Commands</a></li>
  911. </ul></li>
  912. <li><a id="toc-chromashift" href="#chromashift">32.25 chromashift</a>
  913. <ul class="toc-numbered-mark">
  914. <li><a id="toc-Commands-65" href="#Commands-65">32.25.1 Commands</a></li>
  915. </ul></li>
  916. <li><a id="toc-ciescope" href="#ciescope">32.26 ciescope</a></li>
  917. <li><a id="toc-codecview" href="#codecview">32.27 codecview</a>
  918. <ul class="toc-numbered-mark">
  919. <li><a id="toc-Examples-70" href="#Examples-70">32.27.1 Examples</a></li>
  920. </ul></li>
  921. <li><a id="toc-colorbalance" href="#colorbalance">32.28 colorbalance</a>
  922. <ul class="toc-numbered-mark">
  923. <li><a id="toc-Examples-71" href="#Examples-71">32.28.1 Examples</a></li>
  924. <li><a id="toc-Commands-66" href="#Commands-66">32.28.2 Commands</a></li>
  925. </ul></li>
  926. <li><a id="toc-colorcontrast" href="#colorcontrast">32.29 colorcontrast</a>
  927. <ul class="toc-numbered-mark">
  928. <li><a id="toc-Commands-67" href="#Commands-67">32.29.1 Commands</a></li>
  929. </ul></li>
  930. <li><a id="toc-colorcorrect" href="#colorcorrect">32.30 colorcorrect</a>
  931. <ul class="toc-numbered-mark">
  932. <li><a id="toc-Commands-68" href="#Commands-68">32.30.1 Commands</a></li>
  933. </ul></li>
  934. <li><a id="toc-colorchannelmixer" href="#colorchannelmixer">32.31 colorchannelmixer</a>
  935. <ul class="toc-numbered-mark">
  936. <li><a id="toc-Examples-72" href="#Examples-72">32.31.1 Examples</a></li>
  937. <li><a id="toc-Commands-69" href="#Commands-69">32.31.2 Commands</a></li>
  938. </ul></li>
  939. <li><a id="toc-colordetect" href="#colordetect">32.32 colordetect</a></li>
  940. <li><a id="toc-colorize" href="#colorize">32.33 colorize</a>
  941. <ul class="toc-numbered-mark">
  942. <li><a id="toc-Commands-70" href="#Commands-70">32.33.1 Commands</a></li>
  943. </ul></li>
  944. <li><a id="toc-colorkey" href="#colorkey">32.34 colorkey</a>
  945. <ul class="toc-numbered-mark">
  946. <li><a id="toc-Examples-73" href="#Examples-73">32.34.1 Examples</a></li>
  947. <li><a id="toc-Commands-71" href="#Commands-71">32.34.2 Commands</a></li>
  948. </ul></li>
  949. <li><a id="toc-colorhold" href="#colorhold">32.35 colorhold</a>
  950. <ul class="toc-numbered-mark">
  951. <li><a id="toc-Commands-72" href="#Commands-72">32.35.1 Commands</a></li>
  952. </ul></li>
  953. <li><a id="toc-colorlevels" href="#colorlevels">32.36 colorlevels</a>
  954. <ul class="toc-numbered-mark">
  955. <li><a id="toc-Examples-74" href="#Examples-74">32.36.1 Examples</a></li>
  956. <li><a id="toc-Commands-73" href="#Commands-73">32.36.2 Commands</a></li>
  957. </ul></li>
  958. <li><a id="toc-colormap" href="#colormap">32.37 colormap</a></li>
  959. <li><a id="toc-colormatrix" href="#colormatrix">32.38 colormatrix</a></li>
  960. <li><a id="toc-colorspace" href="#colorspace">32.39 colorspace</a></li>
  961. <li><a id="toc-colortemperature" href="#colortemperature">32.40 colortemperature</a>
  962. <ul class="toc-numbered-mark">
  963. <li><a id="toc-Commands-74" href="#Commands-74">32.40.1 Commands</a></li>
  964. </ul></li>
  965. <li><a id="toc-convolution" href="#convolution">32.41 convolution</a>
  966. <ul class="toc-numbered-mark">
  967. <li><a id="toc-Commands-75" href="#Commands-75">32.41.1 Commands</a></li>
  968. <li><a id="toc-Examples-75" href="#Examples-75">32.41.2 Examples</a></li>
  969. </ul></li>
  970. <li><a id="toc-convolve" href="#convolve">32.42 convolve</a></li>
  971. <li><a id="toc-copy" href="#copy">32.43 copy</a></li>
  972. <li><a id="toc-coreimage-1" href="#coreimage-1">32.44 coreimage</a>
  973. <ul class="toc-numbered-mark">
  974. <li><a id="toc-Examples-76" href="#Examples-76">32.44.1 Examples</a></li>
  975. </ul></li>
  976. <li><a id="toc-corr" href="#corr">32.45 corr</a></li>
  977. <li><a id="toc-cover_005frect" href="#cover_005frect">32.46 cover_rect</a>
  978. <ul class="toc-numbered-mark">
  979. <li><a id="toc-Examples-77" href="#Examples-77">32.46.1 Examples</a></li>
  980. </ul></li>
  981. <li><a id="toc-crop" href="#crop">32.47 crop</a>
  982. <ul class="toc-numbered-mark">
  983. <li><a id="toc-Examples-78" href="#Examples-78">32.47.1 Examples</a></li>
  984. <li><a id="toc-Commands-76" href="#Commands-76">32.47.2 Commands</a></li>
  985. </ul></li>
  986. <li><a id="toc-cropdetect" href="#cropdetect">32.48 cropdetect</a>
  987. <ul class="toc-numbered-mark">
  988. <li><a id="toc-Examples-79" href="#Examples-79">32.48.1 Examples</a></li>
  989. <li><a id="toc-Commands-77" href="#Commands-77">32.48.2 Commands</a></li>
  990. </ul></li>
  991. <li><a id="toc-cue-1" href="#cue-1">32.49 cue</a></li>
  992. <li><a id="toc-curves-1" href="#curves-1">32.50 curves</a>
  993. <ul class="toc-numbered-mark">
  994. <li><a id="toc-Commands-78" href="#Commands-78">32.50.1 Commands</a></li>
  995. <li><a id="toc-Examples-80" href="#Examples-80">32.50.2 Examples</a></li>
  996. </ul></li>
  997. <li><a id="toc-datascope" href="#datascope">32.51 datascope</a>
  998. <ul class="toc-numbered-mark">
  999. <li><a id="toc-Commands-79" href="#Commands-79">32.51.1 Commands</a></li>
  1000. </ul></li>
  1001. <li><a id="toc-dblur" href="#dblur">32.52 dblur</a>
  1002. <ul class="toc-numbered-mark">
  1003. <li><a id="toc-Commands-80" href="#Commands-80">32.52.1 Commands</a></li>
  1004. </ul></li>
  1005. <li><a id="toc-dctdnoiz" href="#dctdnoiz">32.53 dctdnoiz</a>
  1006. <ul class="toc-numbered-mark">
  1007. <li><a id="toc-Examples-81" href="#Examples-81">32.53.1 Examples</a></li>
  1008. </ul></li>
  1009. <li><a id="toc-deband" href="#deband">32.54 deband</a>
  1010. <ul class="toc-numbered-mark">
  1011. <li><a id="toc-Commands-81" href="#Commands-81">32.54.1 Commands</a></li>
  1012. </ul></li>
  1013. <li><a id="toc-deblock" href="#deblock">32.55 deblock</a>
  1014. <ul class="toc-numbered-mark">
  1015. <li><a id="toc-Examples-82" href="#Examples-82">32.55.1 Examples</a></li>
  1016. <li><a id="toc-Commands-82" href="#Commands-82">32.55.2 Commands</a></li>
  1017. </ul></li>
  1018. <li><a id="toc-decimate-1" href="#decimate-1">32.56 decimate</a></li>
  1019. <li><a id="toc-deconvolve" href="#deconvolve">32.57 deconvolve</a></li>
  1020. <li><a id="toc-dedot" href="#dedot">32.58 dedot</a></li>
  1021. <li><a id="toc-deflate" href="#deflate">32.59 deflate</a>
  1022. <ul class="toc-numbered-mark">
  1023. <li><a id="toc-Commands-83" href="#Commands-83">32.59.1 Commands</a></li>
  1024. </ul></li>
  1025. <li><a id="toc-deflicker" href="#deflicker">32.60 deflicker</a></li>
  1026. <li><a id="toc-dejudder" href="#dejudder">32.61 dejudder</a></li>
  1027. <li><a id="toc-delogo" href="#delogo">32.62 delogo</a>
  1028. <ul class="toc-numbered-mark">
  1029. <li><a id="toc-Examples-83" href="#Examples-83">32.62.1 Examples</a></li>
  1030. </ul></li>
  1031. <li><a id="toc-derain-1" href="#derain-1">32.63 derain</a></li>
  1032. <li><a id="toc-deshake" href="#deshake">32.64 deshake</a></li>
  1033. <li><a id="toc-despill" href="#despill">32.65 despill</a>
  1034. <ul class="toc-numbered-mark">
  1035. <li><a id="toc-Commands-84" href="#Commands-84">32.65.1 Commands</a></li>
  1036. </ul></li>
  1037. <li><a id="toc-detelecine" href="#detelecine">32.66 detelecine</a></li>
  1038. <li><a id="toc-dilation-1" href="#dilation-1">32.67 dilation</a>
  1039. <ul class="toc-numbered-mark">
  1040. <li><a id="toc-Commands-85" href="#Commands-85">32.67.1 Commands</a></li>
  1041. </ul></li>
  1042. <li><a id="toc-displace" href="#displace">32.68 displace</a>
  1043. <ul class="toc-numbered-mark">
  1044. <li><a id="toc-Examples-84" href="#Examples-84">32.68.1 Examples</a></li>
  1045. </ul></li>
  1046. <li><a id="toc-dnn_005fclassify" href="#dnn_005fclassify">32.69 dnn_classify</a></li>
  1047. <li><a id="toc-dnn_005fdetect" href="#dnn_005fdetect">32.70 dnn_detect</a></li>
  1048. <li><a id="toc-dnn_005fprocessing-1" href="#dnn_005fprocessing-1">32.71 dnn_processing</a>
  1049. <ul class="toc-numbered-mark">
  1050. <li><a id="toc-Examples-85" href="#Examples-85">32.71.1 Examples</a></li>
  1051. </ul></li>
  1052. <li><a id="toc-drawbox" href="#drawbox">32.72 drawbox</a>
  1053. <ul class="toc-numbered-mark">
  1054. <li><a id="toc-Examples-86" href="#Examples-86">32.72.1 Examples</a></li>
  1055. <li><a id="toc-Commands-86" href="#Commands-86">32.72.2 Commands</a></li>
  1056. </ul></li>
  1057. <li><a id="toc-drawgraph-1" href="#drawgraph-1">32.73 drawgraph</a></li>
  1058. <li><a id="toc-drawgrid" href="#drawgrid">32.74 drawgrid</a>
  1059. <ul class="toc-numbered-mark">
  1060. <li><a id="toc-Examples-87" href="#Examples-87">32.74.1 Examples</a></li>
  1061. <li><a id="toc-Commands-87" href="#Commands-87">32.74.2 Commands</a></li>
  1062. </ul></li>
  1063. <li><a id="toc-drawtext-1" href="#drawtext-1">32.75 drawtext</a>
  1064. <ul class="toc-numbered-mark">
  1065. <li><a id="toc-Syntax-2" href="#Syntax-2">32.75.1 Syntax</a></li>
  1066. <li><a id="toc-Text-expansion" href="#Text-expansion">32.75.2 Text expansion</a></li>
  1067. <li><a id="toc-Commands-88" href="#Commands-88">32.75.3 Commands</a></li>
  1068. <li><a id="toc-Examples-88" href="#Examples-88">32.75.4 Examples</a></li>
  1069. </ul></li>
  1070. <li><a id="toc-drawvg-1" href="#drawvg-1">32.76 drawvg</a>
  1071. <ul class="toc-numbered-mark">
  1072. <li><a id="toc-Parameters" href="#Parameters">32.76.1 Parameters</a></li>
  1073. <li><a id="toc-Pixel-Formats" href="#Pixel-Formats">32.76.2 Pixel Formats</a></li>
  1074. <li><a id="toc-Examples-89" href="#Examples-89">32.76.3 Examples</a></li>
  1075. </ul></li>
  1076. <li><a id="toc-edgedetect" href="#edgedetect">32.77 edgedetect</a>
  1077. <ul class="toc-numbered-mark">
  1078. <li><a id="toc-Examples-90" href="#Examples-90">32.77.1 Examples</a></li>
  1079. </ul></li>
  1080. <li><a id="toc-elbg" href="#elbg">32.78 elbg</a></li>
  1081. <li><a id="toc-entropy" href="#entropy">32.79 entropy</a></li>
  1082. <li><a id="toc-epx" href="#epx">32.80 epx</a></li>
  1083. <li><a id="toc-eq" href="#eq">32.81 eq</a>
  1084. <ul class="toc-numbered-mark">
  1085. <li><a id="toc-Commands-89" href="#Commands-89">32.81.1 Commands</a></li>
  1086. </ul></li>
  1087. <li><a id="toc-erosion-1" href="#erosion-1">32.82 erosion</a>
  1088. <ul class="toc-numbered-mark">
  1089. <li><a id="toc-Commands-90" href="#Commands-90">32.82.1 Commands</a></li>
  1090. </ul></li>
  1091. <li><a id="toc-estdif" href="#estdif">32.83 estdif</a>
  1092. <ul class="toc-numbered-mark">
  1093. <li><a id="toc-Commands-91" href="#Commands-91">32.83.1 Commands</a></li>
  1094. </ul></li>
  1095. <li><a id="toc-exposure" href="#exposure">32.84 exposure</a>
  1096. <ul class="toc-numbered-mark">
  1097. <li><a id="toc-Commands-92" href="#Commands-92">32.84.1 Commands</a></li>
  1098. </ul></li>
  1099. <li><a id="toc-extractplanes" href="#extractplanes">32.85 extractplanes</a>
  1100. <ul class="toc-numbered-mark">
  1101. <li><a id="toc-Examples-91" href="#Examples-91">32.85.1 Examples</a></li>
  1102. </ul></li>
  1103. <li><a id="toc-fade" href="#fade">32.86 fade</a>
  1104. <ul class="toc-numbered-mark">
  1105. <li><a id="toc-Examples-92" href="#Examples-92">32.86.1 Examples</a></li>
  1106. </ul></li>
  1107. <li><a id="toc-feedback" href="#feedback">32.87 feedback</a>
  1108. <ul class="toc-numbered-mark">
  1109. <li><a id="toc-Examples-93" href="#Examples-93">32.87.1 Examples</a></li>
  1110. </ul></li>
  1111. <li><a id="toc-fftdnoiz" href="#fftdnoiz">32.88 fftdnoiz</a></li>
  1112. <li><a id="toc-fftfilt" href="#fftfilt">32.89 fftfilt</a>
  1113. <ul class="toc-numbered-mark">
  1114. <li><a id="toc-Examples-94" href="#Examples-94">32.89.1 Examples</a></li>
  1115. </ul></li>
  1116. <li><a id="toc-field" href="#field">32.90 field</a></li>
  1117. <li><a id="toc-fieldhint" href="#fieldhint">32.91 fieldhint</a></li>
  1118. <li><a id="toc-fieldmatch" href="#fieldmatch">32.92 fieldmatch</a>
  1119. <ul class="toc-numbered-mark">
  1120. <li><a id="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">32.92.1 p/c/n/u/b meaning</a>
  1121. <ul class="toc-numbered-mark">
  1122. <li><a id="toc-p_002fc_002fn" href="#p_002fc_002fn">32.92.1.1 p/c/n</a></li>
  1123. <li><a id="toc-u_002fb" href="#u_002fb">32.92.1.2 u/b</a></li>
  1124. </ul></li>
  1125. <li><a id="toc-Examples-95" href="#Examples-95">32.92.2 Examples</a></li>
  1126. </ul></li>
  1127. <li><a id="toc-fieldorder" href="#fieldorder">32.93 fieldorder</a></li>
  1128. <li><a id="toc-fillborders" href="#fillborders">32.94 fillborders</a>
  1129. <ul class="toc-numbered-mark">
  1130. <li><a id="toc-Commands-93" href="#Commands-93">32.94.1 Commands</a></li>
  1131. </ul></li>
  1132. <li><a id="toc-find_005frect" href="#find_005frect">32.95 find_rect</a>
  1133. <ul class="toc-numbered-mark">
  1134. <li><a id="toc-Examples-96" href="#Examples-96">32.95.1 Examples</a></li>
  1135. </ul></li>
  1136. <li><a id="toc-floodfill" href="#floodfill">32.96 floodfill</a></li>
  1137. <li><a id="toc-format-1" href="#format-1">32.97 format</a>
  1138. <ul class="toc-numbered-mark">
  1139. <li><a id="toc-Examples-97" href="#Examples-97">32.97.1 Examples</a></li>
  1140. </ul></li>
  1141. <li><a id="toc-fps-1" href="#fps-1">32.98 fps</a>
  1142. <ul class="toc-numbered-mark">
  1143. <li><a id="toc-Examples-98" href="#Examples-98">32.98.1 Examples</a></li>
  1144. </ul></li>
  1145. <li><a id="toc-framepack" href="#framepack">32.99 framepack</a></li>
  1146. <li><a id="toc-framerate" href="#framerate">32.100 framerate</a></li>
  1147. <li><a id="toc-framestep" href="#framestep">32.101 framestep</a></li>
  1148. <li><a id="toc-freezedetect" href="#freezedetect">32.102 freezedetect</a></li>
  1149. <li><a id="toc-freezeframes" href="#freezeframes">32.103 freezeframes</a></li>
  1150. <li><a id="toc-frei0r-1" href="#frei0r-1">32.104 frei0r</a>
  1151. <ul class="toc-numbered-mark">
  1152. <li><a id="toc-Examples-99" href="#Examples-99">32.104.1 Examples</a></li>
  1153. <li><a id="toc-Commands-94" href="#Commands-94">32.104.2 Commands</a></li>
  1154. </ul></li>
  1155. <li><a id="toc-fspp" href="#fspp">32.105 fspp</a></li>
  1156. <li><a id="toc-fsync-1" href="#fsync-1">32.106 fsync</a></li>
  1157. <li><a id="toc-gblur" href="#gblur">32.107 gblur</a>
  1158. <ul class="toc-numbered-mark">
  1159. <li><a id="toc-Commands-95" href="#Commands-95">32.107.1 Commands</a></li>
  1160. </ul></li>
  1161. <li><a id="toc-geq" href="#geq">32.108 geq</a>
  1162. <ul class="toc-numbered-mark">
  1163. <li><a id="toc-Examples-100" href="#Examples-100">32.108.1 Examples</a></li>
  1164. </ul></li>
  1165. <li><a id="toc-gradfun" href="#gradfun">32.109 gradfun</a>
  1166. <ul class="toc-numbered-mark">
  1167. <li><a id="toc-Examples-101" href="#Examples-101">32.109.1 Examples</a></li>
  1168. </ul></li>
  1169. <li><a id="toc-graphmonitor-1" href="#graphmonitor-1">32.110 graphmonitor</a></li>
  1170. <li><a id="toc-grayworld" href="#grayworld">32.111 grayworld</a></li>
  1171. <li><a id="toc-greyedge" href="#greyedge">32.112 greyedge</a>
  1172. <ul class="toc-numbered-mark">
  1173. <li><a id="toc-Examples-102" href="#Examples-102">32.112.1 Examples</a></li>
  1174. </ul></li>
  1175. <li><a id="toc-guided" href="#guided">32.113 guided</a>
  1176. <ul class="toc-numbered-mark">
  1177. <li><a id="toc-Commands-96" href="#Commands-96">32.113.1 Commands</a></li>
  1178. <li><a id="toc-Examples-103" href="#Examples-103">32.113.2 Examples</a></li>
  1179. </ul></li>
  1180. <li><a id="toc-haldclut-1" href="#haldclut-1">32.114 haldclut</a>
  1181. <ul class="toc-numbered-mark">
  1182. <li><a id="toc-Commands-97" href="#Commands-97">32.114.1 Commands</a></li>
  1183. <li><a id="toc-Workflow-examples" href="#Workflow-examples">32.114.2 Workflow examples</a>
  1184. <ul class="toc-numbered-mark">
  1185. <li><a id="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">32.114.2.1 Hald CLUT video stream</a></li>
  1186. <li><a id="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">32.114.2.2 Hald CLUT with preview</a></li>
  1187. </ul></li>
  1188. </ul></li>
  1189. <li><a id="toc-hflip" href="#hflip">32.115 hflip</a></li>
  1190. <li><a id="toc-histeq" href="#histeq">32.116 histeq</a></li>
  1191. <li><a id="toc-histogram-1" href="#histogram-1">32.117 histogram</a>
  1192. <ul class="toc-numbered-mark">
  1193. <li><a id="toc-Examples-104" href="#Examples-104">32.117.1 Examples</a></li>
  1194. </ul></li>
  1195. <li><a id="toc-hqdn3d-1" href="#hqdn3d-1">32.118 hqdn3d</a>
  1196. <ul class="toc-numbered-mark">
  1197. <li><a id="toc-Commands-98" href="#Commands-98">32.118.1 Commands</a></li>
  1198. </ul></li>
  1199. <li><a id="toc-hwdownload-1" href="#hwdownload-1">32.119 hwdownload</a></li>
  1200. <li><a id="toc-hwmap" href="#hwmap">32.120 hwmap</a></li>
  1201. <li><a id="toc-hwupload-1" href="#hwupload-1">32.121 hwupload</a></li>
  1202. <li><a id="toc-hwupload_005fcuda-1" href="#hwupload_005fcuda-1">32.122 hwupload_cuda</a></li>
  1203. <li><a id="toc-hqx" href="#hqx">32.123 hqx</a></li>
  1204. <li><a id="toc-hstack-1" href="#hstack-1">32.124 hstack</a></li>
  1205. <li><a id="toc-hsvhold" href="#hsvhold">32.125 hsvhold</a></li>
  1206. <li><a id="toc-hsvkey" href="#hsvkey">32.126 hsvkey</a></li>
  1207. <li><a id="toc-hue" href="#hue">32.127 hue</a>
  1208. <ul class="toc-numbered-mark">
  1209. <li><a id="toc-Examples-105" href="#Examples-105">32.127.1 Examples</a></li>
  1210. <li><a id="toc-Commands-99" href="#Commands-99">32.127.2 Commands</a></li>
  1211. </ul></li>
  1212. <li><a id="toc-huesaturation" href="#huesaturation">32.128 huesaturation</a></li>
  1213. <li><a id="toc-hysteresis" href="#hysteresis">32.129 hysteresis</a></li>
  1214. <li><a id="toc-iccdetect" href="#iccdetect">32.130 iccdetect</a></li>
  1215. <li><a id="toc-iccgen" href="#iccgen">32.131 iccgen</a></li>
  1216. <li><a id="toc-identity" href="#identity">32.132 identity</a></li>
  1217. <li><a id="toc-idet" href="#idet">32.133 idet</a>
  1218. <ul class="toc-numbered-mark">
  1219. <li><a id="toc-Examples-106" href="#Examples-106">32.133.1 Examples</a></li>
  1220. </ul></li>
  1221. <li><a id="toc-il" href="#il">32.134 il</a>
  1222. <ul class="toc-numbered-mark">
  1223. <li><a id="toc-Commands-100" href="#Commands-100">32.134.1 Commands</a></li>
  1224. </ul></li>
  1225. <li><a id="toc-inflate" href="#inflate">32.135 inflate</a>
  1226. <ul class="toc-numbered-mark">
  1227. <li><a id="toc-Commands-101" href="#Commands-101">32.135.1 Commands</a></li>
  1228. </ul></li>
  1229. <li><a id="toc-interlace_002c-interlace_005fvulkan" href="#interlace_002c-interlace_005fvulkan">32.136 interlace, interlace_vulkan</a></li>
  1230. <li><a id="toc-kerndeint" href="#kerndeint">32.137 kerndeint</a>
  1231. <ul class="toc-numbered-mark">
  1232. <li><a id="toc-Examples-107" href="#Examples-107">32.137.1 Examples</a></li>
  1233. </ul></li>
  1234. <li><a id="toc-kirsch" href="#kirsch">32.138 kirsch</a>
  1235. <ul class="toc-numbered-mark">
  1236. <li><a id="toc-Commands-102" href="#Commands-102">32.138.1 Commands</a></li>
  1237. </ul></li>
  1238. <li><a id="toc-lagfun" href="#lagfun">32.139 lagfun</a>
  1239. <ul class="toc-numbered-mark">
  1240. <li><a id="toc-Commands-103" href="#Commands-103">32.139.1 Commands</a></li>
  1241. </ul></li>
  1242. <li><a id="toc-lenscorrection" href="#lenscorrection">32.140 lenscorrection</a>
  1243. <ul class="toc-numbered-mark">
  1244. <li><a id="toc-Options-37" href="#Options-37">32.140.1 Options</a></li>
  1245. <li><a id="toc-Commands-104" href="#Commands-104">32.140.2 Commands</a></li>
  1246. </ul></li>
  1247. <li><a id="toc-lensfun" href="#lensfun">32.141 lensfun</a>
  1248. <ul class="toc-numbered-mark">
  1249. <li><a id="toc-Examples-108" href="#Examples-108">32.141.1 Examples</a></li>
  1250. </ul></li>
  1251. <li><a id="toc-lcevc" href="#lcevc">32.142 lcevc</a></li>
  1252. <li><a id="toc-libplacebo" href="#libplacebo">32.143 libplacebo</a>
  1253. <ul class="toc-numbered-mark">
  1254. <li><a id="toc-Options-38" href="#Options-38">32.143.1 Options</a>
  1255. <ul class="toc-numbered-mark">
  1256. <li><a id="toc-Output-mode" href="#Output-mode">32.143.1.1 Output mode</a></li>
  1257. <li><a id="toc-Scaling" href="#Scaling">32.143.1.2 Scaling</a></li>
  1258. <li><a id="toc-Deinterlacing" href="#Deinterlacing">32.143.1.3 Deinterlacing</a></li>
  1259. <li><a id="toc-Debanding" href="#Debanding">32.143.1.4 Debanding</a></li>
  1260. <li><a id="toc-Color-adjustment" href="#Color-adjustment">32.143.1.5 Color adjustment</a></li>
  1261. <li><a id="toc-Peak-detection" href="#Peak-detection">32.143.1.6 Peak detection</a></li>
  1262. <li><a id="toc-Tone-mapping" href="#Tone-mapping">32.143.1.7 Tone mapping</a></li>
  1263. <li><a id="toc-Dithering" href="#Dithering">32.143.1.8 Dithering</a></li>
  1264. <li><a id="toc-Custom-shaders" href="#Custom-shaders">32.143.1.9 Custom shaders</a></li>
  1265. <li><a id="toc-Debugging-_002f-performance" href="#Debugging-_002f-performance">32.143.1.10 Debugging / performance</a></li>
  1266. </ul></li>
  1267. <li><a id="toc-Commands-105" href="#Commands-105">32.143.2 Commands</a></li>
  1268. <li><a id="toc-Examples-109" href="#Examples-109">32.143.3 Examples</a></li>
  1269. </ul></li>
  1270. <li><a id="toc-libvmaf-1" href="#libvmaf-1">32.144 libvmaf</a>
  1271. <ul class="toc-numbered-mark">
  1272. <li><a id="toc-Examples-110" href="#Examples-110">32.144.1 Examples</a></li>
  1273. </ul></li>
  1274. <li><a id="toc-libvmaf_005fcuda" href="#libvmaf_005fcuda">32.145 libvmaf_cuda</a>
  1275. <ul class="toc-numbered-mark">
  1276. <li><a id="toc-Examples-111" href="#Examples-111">32.145.1 Examples</a></li>
  1277. </ul></li>
  1278. <li><a id="toc-limitdiff" href="#limitdiff">32.146 limitdiff</a>
  1279. <ul class="toc-numbered-mark">
  1280. <li><a id="toc-Commands-106" href="#Commands-106">32.146.1 Commands</a></li>
  1281. </ul></li>
  1282. <li><a id="toc-limiter" href="#limiter">32.147 limiter</a>
  1283. <ul class="toc-numbered-mark">
  1284. <li><a id="toc-Commands-107" href="#Commands-107">32.147.1 Commands</a></li>
  1285. </ul></li>
  1286. <li><a id="toc-loop" href="#loop">32.148 loop</a>
  1287. <ul class="toc-numbered-mark">
  1288. <li><a id="toc-Examples-112" href="#Examples-112">32.148.1 Examples</a></li>
  1289. </ul></li>
  1290. <li><a id="toc-lut1d" href="#lut1d">32.149 lut1d</a>
  1291. <ul class="toc-numbered-mark">
  1292. <li><a id="toc-Commands-108" href="#Commands-108">32.149.1 Commands</a></li>
  1293. </ul></li>
  1294. <li><a id="toc-lut3d-1" href="#lut3d-1">32.150 lut3d</a>
  1295. <ul class="toc-numbered-mark">
  1296. <li><a id="toc-Commands-109" href="#Commands-109">32.150.1 Commands</a></li>
  1297. </ul></li>
  1298. <li><a id="toc-lumakey" href="#lumakey">32.151 lumakey</a>
  1299. <ul class="toc-numbered-mark">
  1300. <li><a id="toc-Commands-110" href="#Commands-110">32.151.1 Commands</a></li>
  1301. </ul></li>
  1302. <li><a id="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">32.152 lut, lutrgb, lutyuv</a>
  1303. <ul class="toc-numbered-mark">
  1304. <li><a id="toc-Commands-111" href="#Commands-111">32.152.1 Commands</a></li>
  1305. <li><a id="toc-Examples-113" href="#Examples-113">32.152.2 Examples</a></li>
  1306. </ul></li>
  1307. <li><a id="toc-lut2_002c-tlut2" href="#lut2_002c-tlut2">32.153 lut2, tlut2</a>
  1308. <ul class="toc-numbered-mark">
  1309. <li><a id="toc-Commands-112" href="#Commands-112">32.153.1 Commands</a></li>
  1310. <li><a id="toc-Examples-114" href="#Examples-114">32.153.2 Examples</a></li>
  1311. </ul></li>
  1312. <li><a id="toc-maskedclamp" href="#maskedclamp">32.154 maskedclamp</a>
  1313. <ul class="toc-numbered-mark">
  1314. <li><a id="toc-Commands-113" href="#Commands-113">32.154.1 Commands</a></li>
  1315. </ul></li>
  1316. <li><a id="toc-maskedmax" href="#maskedmax">32.155 maskedmax</a>
  1317. <ul class="toc-numbered-mark">
  1318. <li><a id="toc-Commands-114" href="#Commands-114">32.155.1 Commands</a></li>
  1319. </ul></li>
  1320. <li><a id="toc-maskedmerge" href="#maskedmerge">32.156 maskedmerge</a>
  1321. <ul class="toc-numbered-mark">
  1322. <li><a id="toc-Commands-115" href="#Commands-115">32.156.1 Commands</a></li>
  1323. </ul></li>
  1324. <li><a id="toc-maskedmin" href="#maskedmin">32.157 maskedmin</a>
  1325. <ul class="toc-numbered-mark">
  1326. <li><a id="toc-Commands-116" href="#Commands-116">32.157.1 Commands</a></li>
  1327. </ul></li>
  1328. <li><a id="toc-maskedthreshold" href="#maskedthreshold">32.158 maskedthreshold</a>
  1329. <ul class="toc-numbered-mark">
  1330. <li><a id="toc-Commands-117" href="#Commands-117">32.158.1 Commands</a></li>
  1331. </ul></li>
  1332. <li><a id="toc-maskfun" href="#maskfun">32.159 maskfun</a>
  1333. <ul class="toc-numbered-mark">
  1334. <li><a id="toc-Commands-118" href="#Commands-118">32.159.1 Commands</a></li>
  1335. </ul></li>
  1336. <li><a id="toc-mcdeint" href="#mcdeint">32.160 mcdeint</a></li>
  1337. <li><a id="toc-median" href="#median">32.161 median</a>
  1338. <ul class="toc-numbered-mark">
  1339. <li><a id="toc-Commands-119" href="#Commands-119">32.161.1 Commands</a></li>
  1340. </ul></li>
  1341. <li><a id="toc-mergeplanes" href="#mergeplanes">32.162 mergeplanes</a>
  1342. <ul class="toc-numbered-mark">
  1343. <li><a id="toc-Examples-115" href="#Examples-115">32.162.1 Examples</a></li>
  1344. </ul></li>
  1345. <li><a id="toc-mestimate" href="#mestimate">32.163 mestimate</a></li>
  1346. <li><a id="toc-midequalizer" href="#midequalizer">32.164 midequalizer</a></li>
  1347. <li><a id="toc-minterpolate" href="#minterpolate">32.165 minterpolate</a></li>
  1348. <li><a id="toc-mix" href="#mix">32.166 mix</a>
  1349. <ul class="toc-numbered-mark">
  1350. <li><a id="toc-Commands-120" href="#Commands-120">32.166.1 Commands</a></li>
  1351. </ul></li>
  1352. <li><a id="toc-monochrome" href="#monochrome">32.167 monochrome</a>
  1353. <ul class="toc-numbered-mark">
  1354. <li><a id="toc-Commands-121" href="#Commands-121">32.167.1 Commands</a></li>
  1355. </ul></li>
  1356. <li><a id="toc-morpho" href="#morpho">32.168 morpho</a>
  1357. <ul class="toc-numbered-mark">
  1358. <li><a id="toc-Commands-122" href="#Commands-122">32.168.1 Commands</a></li>
  1359. </ul></li>
  1360. <li><a id="toc-mpdecimate" href="#mpdecimate">32.169 mpdecimate</a></li>
  1361. <li><a id="toc-msad" href="#msad">32.170 msad</a></li>
  1362. <li><a id="toc-multiply" href="#multiply">32.171 multiply</a>
  1363. <ul class="toc-numbered-mark">
  1364. <li><a id="toc-Commands-123" href="#Commands-123">32.171.1 Commands</a></li>
  1365. </ul></li>
  1366. <li><a id="toc-negate" href="#negate">32.172 negate</a>
  1367. <ul class="toc-numbered-mark">
  1368. <li><a id="toc-Commands-124" href="#Commands-124">32.172.1 Commands</a></li>
  1369. </ul></li>
  1370. <li><a id="toc-nlmeans-1" href="#nlmeans-1">32.173 nlmeans</a></li>
  1371. <li><a id="toc-nnedi" href="#nnedi">32.174 nnedi</a>
  1372. <ul class="toc-numbered-mark">
  1373. <li><a id="toc-Commands-125" href="#Commands-125">32.174.1 Commands</a></li>
  1374. </ul></li>
  1375. <li><a id="toc-noformat" href="#noformat">32.175 noformat</a>
  1376. <ul class="toc-numbered-mark">
  1377. <li><a id="toc-Examples-116" href="#Examples-116">32.175.1 Examples</a></li>
  1378. </ul></li>
  1379. <li><a id="toc-noise-1" href="#noise-1">32.176 noise</a>
  1380. <ul class="toc-numbered-mark">
  1381. <li><a id="toc-Examples-117" href="#Examples-117">32.176.1 Examples</a></li>
  1382. </ul></li>
  1383. <li><a id="toc-normalize" href="#normalize">32.177 normalize</a>
  1384. <ul class="toc-numbered-mark">
  1385. <li><a id="toc-Commands-126" href="#Commands-126">32.177.1 Commands</a></li>
  1386. <li><a id="toc-Examples-118" href="#Examples-118">32.177.2 Examples</a></li>
  1387. </ul></li>
  1388. <li><a id="toc-null-1" href="#null-1">32.178 null</a></li>
  1389. <li><a id="toc-ocr" href="#ocr">32.179 ocr</a></li>
  1390. <li><a id="toc-ocv" href="#ocv">32.180 ocv</a>
  1391. <ul class="toc-numbered-mark">
  1392. <li><a id="toc-dilate-1" href="#dilate-1">32.180.1 dilate</a></li>
  1393. <li><a id="toc-erode" href="#erode">32.180.2 erode</a></li>
  1394. <li><a id="toc-smooth" href="#smooth">32.180.3 smooth</a></li>
  1395. </ul></li>
  1396. <li><a id="toc-oscilloscope" href="#oscilloscope">32.181 oscilloscope</a>
  1397. <ul class="toc-numbered-mark">
  1398. <li><a id="toc-Commands-127" href="#Commands-127">32.181.1 Commands</a></li>
  1399. <li><a id="toc-Examples-119" href="#Examples-119">32.181.2 Examples</a></li>
  1400. </ul></li>
  1401. <li><a id="toc-overlay-1" href="#overlay-1">32.182 overlay</a>
  1402. <ul class="toc-numbered-mark">
  1403. <li><a id="toc-Commands-128" href="#Commands-128">32.182.1 Commands</a></li>
  1404. <li><a id="toc-Examples-120" href="#Examples-120">32.182.2 Examples</a></li>
  1405. </ul></li>
  1406. <li><a id="toc-owdenoise" href="#owdenoise">32.183 owdenoise</a></li>
  1407. <li><a id="toc-pad-1" href="#pad-1">32.184 pad</a>
  1408. <ul class="toc-numbered-mark">
  1409. <li><a id="toc-Examples-121" href="#Examples-121">32.184.1 Examples</a></li>
  1410. </ul></li>
  1411. <li><a id="toc-palettegen-1" href="#palettegen-1">32.185 palettegen</a>
  1412. <ul class="toc-numbered-mark">
  1413. <li><a id="toc-Examples-122" href="#Examples-122">32.185.1 Examples</a></li>
  1414. </ul></li>
  1415. <li><a id="toc-paletteuse" href="#paletteuse">32.186 paletteuse</a>
  1416. <ul class="toc-numbered-mark">
  1417. <li><a id="toc-Examples-123" href="#Examples-123">32.186.1 Examples</a></li>
  1418. </ul></li>
  1419. <li><a id="toc-perspective" href="#perspective">32.187 perspective</a></li>
  1420. <li><a id="toc-phase" href="#phase">32.188 phase</a>
  1421. <ul class="toc-numbered-mark">
  1422. <li><a id="toc-Commands-129" href="#Commands-129">32.188.1 Commands</a></li>
  1423. </ul></li>
  1424. <li><a id="toc-photosensitivity" href="#photosensitivity">32.189 photosensitivity</a></li>
  1425. <li><a id="toc-pixdesctest" href="#pixdesctest">32.190 pixdesctest</a></li>
  1426. <li><a id="toc-pixelize" href="#pixelize">32.191 pixelize</a>
  1427. <ul class="toc-numbered-mark">
  1428. <li><a id="toc-Commands-130" href="#Commands-130">32.191.1 Commands</a></li>
  1429. </ul></li>
  1430. <li><a id="toc-pixscope" href="#pixscope">32.192 pixscope</a>
  1431. <ul class="toc-numbered-mark">
  1432. <li><a id="toc-Commands-131" href="#Commands-131">32.192.1 Commands</a></li>
  1433. </ul></li>
  1434. <li><a id="toc-pp7" href="#pp7">32.193 pp7</a></li>
  1435. <li><a id="toc-premultiply" href="#premultiply">32.194 premultiply</a></li>
  1436. <li><a id="toc-premultiply_005fdynamic" href="#premultiply_005fdynamic">32.195 premultiply_dynamic</a></li>
  1437. <li><a id="toc-prewitt" href="#prewitt">32.196 prewitt</a>
  1438. <ul class="toc-numbered-mark">
  1439. <li><a id="toc-Commands-132" href="#Commands-132">32.196.1 Commands</a></li>
  1440. </ul></li>
  1441. <li><a id="toc-pseudocolor" href="#pseudocolor">32.197 pseudocolor</a>
  1442. <ul class="toc-numbered-mark">
  1443. <li><a id="toc-Commands-133" href="#Commands-133">32.197.1 Commands</a></li>
  1444. <li><a id="toc-Examples-124" href="#Examples-124">32.197.2 Examples</a></li>
  1445. </ul></li>
  1446. <li><a id="toc-psnr-1" href="#psnr-1">32.198 psnr</a>
  1447. <ul class="toc-numbered-mark">
  1448. <li><a id="toc-Examples-125" href="#Examples-125">32.198.1 Examples</a></li>
  1449. </ul></li>
  1450. <li><a id="toc-pullup-1" href="#pullup-1">32.199 pullup</a></li>
  1451. <li><a id="toc-qp" href="#qp">32.200 qp</a>
  1452. <ul class="toc-numbered-mark">
  1453. <li><a id="toc-Examples-126" href="#Examples-126">32.200.1 Examples</a></li>
  1454. </ul></li>
  1455. <li><a id="toc-qrencode" href="#qrencode">32.201 qrencode</a>
  1456. <ul class="toc-numbered-mark">
  1457. <li><a id="toc-qrencode-Expressions" href="#qrencode-Expressions">32.201.1 qrencode Expressions</a></li>
  1458. <li><a id="toc-qrencode-Text-expansion" href="#qrencode-Text-expansion">32.201.2 qrencode Text expansion</a></li>
  1459. <li><a id="toc-Examples-127" href="#Examples-127">32.201.3 Examples</a></li>
  1460. </ul></li>
  1461. <li><a id="toc-quirc" href="#quirc">32.202 quirc</a></li>
  1462. <li><a id="toc-random" href="#random">32.203 random</a></li>
  1463. <li><a id="toc-readeia608" href="#readeia608">32.204 readeia608</a>
  1464. <ul class="toc-numbered-mark">
  1465. <li><a id="toc-Commands-134" href="#Commands-134">32.204.1 Commands</a></li>
  1466. <li><a id="toc-Examples-128" href="#Examples-128">32.204.2 Examples</a></li>
  1467. </ul></li>
  1468. <li><a id="toc-readvitc" href="#readvitc">32.205 readvitc</a>
  1469. <ul class="toc-numbered-mark">
  1470. <li><a id="toc-Examples-129" href="#Examples-129">32.205.1 Examples</a></li>
  1471. </ul></li>
  1472. <li><a id="toc-remap" href="#remap">32.206 remap</a></li>
  1473. <li><a id="toc-removegrain" href="#removegrain">32.207 removegrain</a></li>
  1474. <li><a id="toc-removelogo" href="#removelogo">32.208 removelogo</a></li>
  1475. <li><a id="toc-repeatfields" href="#repeatfields">32.209 repeatfields</a></li>
  1476. <li><a id="toc-reverse" href="#reverse">32.210 reverse</a>
  1477. <ul class="toc-numbered-mark">
  1478. <li><a id="toc-Examples-130" href="#Examples-130">32.210.1 Examples</a></li>
  1479. </ul></li>
  1480. <li><a id="toc-rgbashift" href="#rgbashift">32.211 rgbashift</a>
  1481. <ul class="toc-numbered-mark">
  1482. <li><a id="toc-Commands-135" href="#Commands-135">32.211.1 Commands</a></li>
  1483. </ul></li>
  1484. <li><a id="toc-roberts" href="#roberts">32.212 roberts</a>
  1485. <ul class="toc-numbered-mark">
  1486. <li><a id="toc-Commands-136" href="#Commands-136">32.212.1 Commands</a></li>
  1487. </ul></li>
  1488. <li><a id="toc-rotate" href="#rotate">32.213 rotate</a>
  1489. <ul class="toc-numbered-mark">
  1490. <li><a id="toc-Examples-131" href="#Examples-131">32.213.1 Examples</a></li>
  1491. <li><a id="toc-Commands-137" href="#Commands-137">32.213.2 Commands</a></li>
  1492. </ul></li>
  1493. <li><a id="toc-sab" href="#sab">32.214 sab</a></li>
  1494. <li><a id="toc-scale-1" href="#scale-1">32.215 scale</a>
  1495. <ul class="toc-numbered-mark">
  1496. <li><a id="toc-Options-39" href="#Options-39">32.215.1 Options</a></li>
  1497. <li><a id="toc-Examples-132" href="#Examples-132">32.215.2 Examples</a></li>
  1498. <li><a id="toc-Commands-138" href="#Commands-138">32.215.3 Commands</a></li>
  1499. </ul></li>
  1500. <li><a id="toc-scharr" href="#scharr">32.216 scharr</a>
  1501. <ul class="toc-numbered-mark">
  1502. <li><a id="toc-Commands-139" href="#Commands-139">32.216.1 Commands</a></li>
  1503. </ul></li>
  1504. <li><a id="toc-scroll" href="#scroll">32.217 scroll</a>
  1505. <ul class="toc-numbered-mark">
  1506. <li><a id="toc-Commands-140" href="#Commands-140">32.217.1 Commands</a></li>
  1507. </ul></li>
  1508. <li><a id="toc-scdet-1" href="#scdet-1">32.218 scdet</a></li>
  1509. <li><a id="toc-selectivecolor-1" href="#selectivecolor-1">32.219 selectivecolor</a>
  1510. <ul class="toc-numbered-mark">
  1511. <li><a id="toc-Examples-133" href="#Examples-133">32.219.1 Examples</a></li>
  1512. </ul></li>
  1513. <li><a id="toc-separatefields-1" href="#separatefields-1">32.220 separatefields</a></li>
  1514. <li><a id="toc-setdar_002c-setsar" href="#setdar_002c-setsar">32.221 setdar, setsar</a>
  1515. <ul class="toc-numbered-mark">
  1516. <li><a id="toc-Examples-134" href="#Examples-134">32.221.1 Examples</a></li>
  1517. </ul></li>
  1518. <li><a id="toc-setfield-1" href="#setfield-1">32.222 setfield</a></li>
  1519. <li><a id="toc-setparams-1" href="#setparams-1">32.223 setparams</a></li>
  1520. <li><a id="toc-shear" href="#shear">32.224 shear</a>
  1521. <ul class="toc-numbered-mark">
  1522. <li><a id="toc-Commands-141" href="#Commands-141">32.224.1 Commands</a></li>
  1523. </ul></li>
  1524. <li><a id="toc-showinfo-1" href="#showinfo-1">32.225 showinfo</a></li>
  1525. <li><a id="toc-showpalette" href="#showpalette">32.226 showpalette</a></li>
  1526. <li><a id="toc-shuffleframes" href="#shuffleframes">32.227 shuffleframes</a>
  1527. <ul class="toc-numbered-mark">
  1528. <li><a id="toc-Examples-135" href="#Examples-135">32.227.1 Examples</a></li>
  1529. </ul></li>
  1530. <li><a id="toc-shufflepixels" href="#shufflepixels">32.228 shufflepixels</a></li>
  1531. <li><a id="toc-shuffleplanes" href="#shuffleplanes">32.229 shuffleplanes</a>
  1532. <ul class="toc-numbered-mark">
  1533. <li><a id="toc-Examples-136" href="#Examples-136">32.229.1 Examples</a></li>
  1534. </ul></li>
  1535. <li><a id="toc-signalstats-1" href="#signalstats-1">32.230 signalstats</a>
  1536. <ul class="toc-numbered-mark">
  1537. <li><a id="toc-Examples-137" href="#Examples-137">32.230.1 Examples</a></li>
  1538. </ul></li>
  1539. <li><a id="toc-signature-1" href="#signature-1">32.231 signature</a>
  1540. <ul class="toc-numbered-mark">
  1541. <li><a id="toc-Examples-138" href="#Examples-138">32.231.1 Examples</a></li>
  1542. </ul></li>
  1543. <li><a id="toc-siti-1" href="#siti-1">32.232 siti</a>
  1544. <ul class="toc-numbered-mark">
  1545. <li><a id="toc-Examples-139" href="#Examples-139">32.232.1 Examples</a></li>
  1546. </ul></li>
  1547. <li><a id="toc-smartblur-1" href="#smartblur-1">32.233 smartblur</a></li>
  1548. <li><a id="toc-sobel" href="#sobel">32.234 sobel</a>
  1549. <ul class="toc-numbered-mark">
  1550. <li><a id="toc-Commands-142" href="#Commands-142">32.234.1 Commands</a></li>
  1551. </ul></li>
  1552. <li><a id="toc-spp-1" href="#spp-1">32.235 spp</a>
  1553. <ul class="toc-numbered-mark">
  1554. <li><a id="toc-Commands-143" href="#Commands-143">32.235.1 Commands</a></li>
  1555. </ul></li>
  1556. <li><a id="toc-sr-1" href="#sr-1">32.236 sr</a></li>
  1557. <li><a id="toc-sr_005famf-1" href="#sr_005famf-1">32.237 sr_amf</a>
  1558. <ul class="toc-numbered-mark">
  1559. <li><a id="toc-Examples-140" href="#Examples-140">32.237.1 Examples</a></li>
  1560. </ul></li>
  1561. <li><a id="toc-ssim" href="#ssim">32.238 ssim</a>
  1562. <ul class="toc-numbered-mark">
  1563. <li><a id="toc-Examples-141" href="#Examples-141">32.238.1 Examples</a></li>
  1564. </ul></li>
  1565. <li><a id="toc-stereo3d" href="#stereo3d">32.239 stereo3d</a>
  1566. <ul class="toc-numbered-mark">
  1567. <li><a id="toc-Examples-142" href="#Examples-142">32.239.1 Examples</a></li>
  1568. </ul></li>
  1569. <li><a id="toc-streamselect_002c-astreamselect" href="#streamselect_002c-astreamselect">32.240 streamselect, astreamselect</a>
  1570. <ul class="toc-numbered-mark">
  1571. <li><a id="toc-Commands-144" href="#Commands-144">32.240.1 Commands</a></li>
  1572. <li><a id="toc-Examples-143" href="#Examples-143">32.240.2 Examples</a></li>
  1573. </ul></li>
  1574. <li><a id="toc-subtitles-1" href="#subtitles-1">32.241 subtitles</a></li>
  1575. <li><a id="toc-super2xsai" href="#super2xsai">32.242 super2xsai</a></li>
  1576. <li><a id="toc-swaprect" href="#swaprect">32.243 swaprect</a>
  1577. <ul class="toc-numbered-mark">
  1578. <li><a id="toc-Commands-145" href="#Commands-145">32.243.1 Commands</a></li>
  1579. </ul></li>
  1580. <li><a id="toc-swapuv" href="#swapuv">32.244 swapuv</a></li>
  1581. <li><a id="toc-tblend" href="#tblend">32.245 tblend</a></li>
  1582. <li><a id="toc-telecine" href="#telecine">32.246 telecine</a></li>
  1583. <li><a id="toc-thistogram" href="#thistogram">32.247 thistogram</a></li>
  1584. <li><a id="toc-threshold" href="#threshold">32.248 threshold</a>
  1585. <ul class="toc-numbered-mark">
  1586. <li><a id="toc-Commands-146" href="#Commands-146">32.248.1 Commands</a></li>
  1587. <li><a id="toc-Examples-144" href="#Examples-144">32.248.2 Examples</a></li>
  1588. </ul></li>
  1589. <li><a id="toc-thumbnail" href="#thumbnail">32.249 thumbnail</a>
  1590. <ul class="toc-numbered-mark">
  1591. <li><a id="toc-Examples-145" href="#Examples-145">32.249.1 Examples</a></li>
  1592. </ul></li>
  1593. <li><a id="toc-tile-1" href="#tile-1">32.250 tile</a>
  1594. <ul class="toc-numbered-mark">
  1595. <li><a id="toc-Examples-146" href="#Examples-146">32.250.1 Examples</a></li>
  1596. </ul></li>
  1597. <li><a id="toc-tiltandshift" href="#tiltandshift">32.251 tiltandshift</a></li>
  1598. <li><a id="toc-tinterlace" href="#tinterlace">32.252 tinterlace</a></li>
  1599. <li><a id="toc-tmedian" href="#tmedian">32.253 tmedian</a>
  1600. <ul class="toc-numbered-mark">
  1601. <li><a id="toc-Commands-147" href="#Commands-147">32.253.1 Commands</a></li>
  1602. </ul></li>
  1603. <li><a id="toc-tmidequalizer" href="#tmidequalizer">32.254 tmidequalizer</a></li>
  1604. <li><a id="toc-tmix" href="#tmix">32.255 tmix</a>
  1605. <ul class="toc-numbered-mark">
  1606. <li><a id="toc-Examples-147" href="#Examples-147">32.255.1 Examples</a></li>
  1607. <li><a id="toc-Commands-148" href="#Commands-148">32.255.2 Commands</a></li>
  1608. </ul></li>
  1609. <li><a id="toc-tonemap-1" href="#tonemap-1">32.256 tonemap</a>
  1610. <ul class="toc-numbered-mark">
  1611. <li><a id="toc-Options-40" href="#Options-40">32.256.1 Options</a></li>
  1612. </ul></li>
  1613. <li><a id="toc-tpad" href="#tpad">32.257 tpad</a></li>
  1614. <li><a id="toc-transpose-1" href="#transpose-1">32.258 transpose</a></li>
  1615. <li><a id="toc-trim" href="#trim">32.259 trim</a></li>
  1616. <li><a id="toc-unpremultiply" href="#unpremultiply">32.260 unpremultiply</a></li>
  1617. <li><a id="toc-unsharp-1" href="#unsharp-1">32.261 unsharp</a>
  1618. <ul class="toc-numbered-mark">
  1619. <li><a id="toc-Examples-148" href="#Examples-148">32.261.1 Examples</a></li>
  1620. </ul></li>
  1621. <li><a id="toc-untile-1" href="#untile-1">32.262 untile</a>
  1622. <ul class="toc-numbered-mark">
  1623. <li><a id="toc-Examples-149" href="#Examples-149">32.262.1 Examples</a></li>
  1624. </ul></li>
  1625. <li><a id="toc-uspp" href="#uspp">32.263 uspp</a></li>
  1626. <li><a id="toc-v360" href="#v360">32.264 v360</a>
  1627. <ul class="toc-numbered-mark">
  1628. <li><a id="toc-Examples-150" href="#Examples-150">32.264.1 Examples</a></li>
  1629. <li><a id="toc-Commands-149" href="#Commands-149">32.264.2 Commands</a></li>
  1630. </ul></li>
  1631. <li><a id="toc-vaguedenoiser" href="#vaguedenoiser">32.265 vaguedenoiser</a></li>
  1632. <li><a id="toc-varblur" href="#varblur">32.266 varblur</a>
  1633. <ul class="toc-numbered-mark">
  1634. <li><a id="toc-Commands-150" href="#Commands-150">32.266.1 Commands</a></li>
  1635. </ul></li>
  1636. <li><a id="toc-vectorscope" href="#vectorscope">32.267 vectorscope</a></li>
  1637. <li><a id="toc-vidstabdetect-1" href="#vidstabdetect-1">32.268 vidstabdetect</a>
  1638. <ul class="toc-numbered-mark">
  1639. <li><a id="toc-Examples-151" href="#Examples-151">32.268.1 Examples</a></li>
  1640. </ul></li>
  1641. <li><a id="toc-vidstabtransform-1" href="#vidstabtransform-1">32.269 vidstabtransform</a>
  1642. <ul class="toc-numbered-mark">
  1643. <li><a id="toc-Options-41" href="#Options-41">32.269.1 Options</a></li>
  1644. <li><a id="toc-Examples-152" href="#Examples-152">32.269.2 Examples</a></li>
  1645. </ul></li>
  1646. <li><a id="toc-vflip" href="#vflip">32.270 vflip</a></li>
  1647. <li><a id="toc-vfrdet" href="#vfrdet">32.271 vfrdet</a></li>
  1648. <li><a id="toc-vibrance" href="#vibrance">32.272 vibrance</a>
  1649. <ul class="toc-numbered-mark">
  1650. <li><a id="toc-Commands-151" href="#Commands-151">32.272.1 Commands</a></li>
  1651. </ul></li>
  1652. <li><a id="toc-vif" href="#vif">32.273 vif</a></li>
  1653. <li><a id="toc-vignette-1" href="#vignette-1">32.274 vignette</a>
  1654. <ul class="toc-numbered-mark">
  1655. <li><a id="toc-Expressions" href="#Expressions">32.274.1 Expressions</a></li>
  1656. <li><a id="toc-Examples-153" href="#Examples-153">32.274.2 Examples</a></li>
  1657. </ul></li>
  1658. <li><a id="toc-vmafmotion" href="#vmafmotion">32.275 vmafmotion</a></li>
  1659. <li><a id="toc-vpp_005famf-1" href="#vpp_005famf-1">32.276 vpp_amf</a>
  1660. <ul class="toc-numbered-mark">
  1661. <li><a id="toc-Examples-154" href="#Examples-154">32.276.1 Examples</a></li>
  1662. </ul></li>
  1663. <li><a id="toc-vstack-1" href="#vstack-1">32.277 vstack</a></li>
  1664. <li><a id="toc-w3fdif" href="#w3fdif">32.278 w3fdif</a>
  1665. <ul class="toc-numbered-mark">
  1666. <li><a id="toc-Commands-152" href="#Commands-152">32.278.1 Commands</a></li>
  1667. </ul></li>
  1668. <li><a id="toc-waveform" href="#waveform">32.279 waveform</a></li>
  1669. <li><a id="toc-weave_002c-doubleweave" href="#weave_002c-doubleweave">32.280 weave, doubleweave</a>
  1670. <ul class="toc-numbered-mark">
  1671. <li><a id="toc-Examples-155" href="#Examples-155">32.280.1 Examples</a></li>
  1672. </ul></li>
  1673. <li><a id="toc-xbr" href="#xbr">32.281 xbr</a></li>
  1674. <li><a id="toc-xcorrelate" href="#xcorrelate">32.282 xcorrelate</a></li>
  1675. <li><a id="toc-xfade" href="#xfade">32.283 xfade</a>
  1676. <ul class="toc-numbered-mark">
  1677. <li><a id="toc-Examples-156" href="#Examples-156">32.283.1 Examples</a></li>
  1678. </ul></li>
  1679. <li><a id="toc-xmedian" href="#xmedian">32.284 xmedian</a>
  1680. <ul class="toc-numbered-mark">
  1681. <li><a id="toc-Commands-153" href="#Commands-153">32.284.1 Commands</a></li>
  1682. </ul></li>
  1683. <li><a id="toc-xpsnr-1" href="#xpsnr-1">32.285 xpsnr</a>
  1684. <ul class="toc-numbered-mark">
  1685. <li><a id="toc-Examples-157" href="#Examples-157">32.285.1 Examples</a></li>
  1686. </ul></li>
  1687. <li><a id="toc-xstack-1" href="#xstack-1">32.286 xstack</a>
  1688. <ul class="toc-numbered-mark">
  1689. <li><a id="toc-Examples-158" href="#Examples-158">32.286.1 Examples</a></li>
  1690. </ul></li>
  1691. <li><a id="toc-yadif-1" href="#yadif-1">32.287 yadif</a></li>
  1692. <li><a id="toc-yaepblur" href="#yaepblur">32.288 yaepblur</a>
  1693. <ul class="toc-numbered-mark">
  1694. <li><a id="toc-Commands-154" href="#Commands-154">32.288.1 Commands</a></li>
  1695. </ul></li>
  1696. <li><a id="toc-zoompan" href="#zoompan">32.289 zoompan</a>
  1697. <ul class="toc-numbered-mark">
  1698. <li><a id="toc-Examples-159" href="#Examples-159">32.289.1 Examples</a></li>
  1699. </ul></li>
  1700. <li><a id="toc-zscale-1" href="#zscale-1">32.290 zscale</a>
  1701. <ul class="toc-numbered-mark">
  1702. <li><a id="toc-Options-42" href="#Options-42">32.290.1 Options</a></li>
  1703. <li><a id="toc-Commands-155" href="#Commands-155">32.290.2 Commands</a></li>
  1704. </ul></li>
  1705. </ul></li>
  1706. <li><a id="toc-CUDA-Video-Filters" href="#CUDA-Video-Filters">33 CUDA Video Filters</a>
  1707. <ul class="toc-numbered-mark">
  1708. <li><a id="toc-CUDA-1" href="#CUDA-1">33.1 CUDA</a>
  1709. <ul class="toc-numbered-mark">
  1710. <li><a id="toc-bilateral_005fcuda" href="#bilateral_005fcuda">33.1.1 bilateral_cuda</a>
  1711. <ul class="toc-numbered-mark">
  1712. <li><a id="toc-Examples-160" href="#Examples-160">33.1.1.1 Examples</a></li>
  1713. </ul></li>
  1714. <li><a id="toc-bwdif_005fcuda" href="#bwdif_005fcuda">33.1.2 bwdif_cuda</a></li>
  1715. <li><a id="toc-chromakey_005fcuda" href="#chromakey_005fcuda">33.1.3 chromakey_cuda</a>
  1716. <ul class="toc-numbered-mark">
  1717. <li><a id="toc-Examples-161" href="#Examples-161">33.1.3.1 Examples</a></li>
  1718. </ul></li>
  1719. <li><a id="toc-colorspace_005fcuda" href="#colorspace_005fcuda">33.1.4 colorspace_cuda</a></li>
  1720. <li><a id="toc-overlay_005fcuda-1" href="#overlay_005fcuda-1">33.1.5 overlay_cuda</a></li>
  1721. <li><a id="toc-pad_005fcuda-1" href="#pad_005fcuda-1">33.1.6 pad_cuda</a>
  1722. <ul class="toc-numbered-mark">
  1723. <li><a id="toc-Examples-162" href="#Examples-162">33.1.6.1 Examples</a></li>
  1724. </ul></li>
  1725. <li><a id="toc-scale_005fcuda-1" href="#scale_005fcuda-1">33.1.7 scale_cuda</a>
  1726. <ul class="toc-numbered-mark">
  1727. <li><a id="toc-Examples-163" href="#Examples-163">33.1.7.1 Examples</a></li>
  1728. </ul></li>
  1729. <li><a id="toc-thumbnail_005fcuda" href="#thumbnail_005fcuda">33.1.8 thumbnail_cuda</a>
  1730. <ul class="toc-numbered-mark">
  1731. <li><a id="toc-Example" href="#Example">33.1.8.1 Example</a></li>
  1732. </ul></li>
  1733. <li><a id="toc-yadif_005fcuda" href="#yadif_005fcuda">33.1.9 yadif_cuda</a></li>
  1734. </ul></li>
  1735. <li><a id="toc-CUDA-NPP-1" href="#CUDA-NPP-1">33.2 CUDA NPP</a>
  1736. <ul class="toc-numbered-mark">
  1737. <li><a id="toc-scale_005fnpp-1" href="#scale_005fnpp-1">33.2.1 scale_npp</a></li>
  1738. <li><a id="toc-scale2ref_005fnpp" href="#scale2ref_005fnpp">33.2.2 scale2ref_npp</a>
  1739. <ul class="toc-numbered-mark">
  1740. <li><a id="toc-Examples-164" href="#Examples-164">33.2.2.1 Examples</a></li>
  1741. </ul></li>
  1742. <li><a id="toc-sharpen_005fnpp" href="#sharpen_005fnpp">33.2.3 sharpen_npp</a></li>
  1743. <li><a id="toc-transpose_005fnpp" href="#transpose_005fnpp">33.2.4 transpose_npp</a></li>
  1744. </ul></li>
  1745. </ul></li>
  1746. <li><a id="toc-OpenCL-Video-Filters" href="#OpenCL-Video-Filters">34 OpenCL Video Filters</a>
  1747. <ul class="toc-numbered-mark">
  1748. <li><a id="toc-avgblur_005fopencl" href="#avgblur_005fopencl">34.1 avgblur_opencl</a>
  1749. <ul class="toc-numbered-mark">
  1750. <li><a id="toc-Example-1" href="#Example-1">34.1.1 Example</a></li>
  1751. </ul></li>
  1752. <li><a id="toc-boxblur_005fopencl" href="#boxblur_005fopencl">34.2 boxblur_opencl</a>
  1753. <ul class="toc-numbered-mark">
  1754. <li><a id="toc-Examples-165" href="#Examples-165">34.2.1 Examples</a></li>
  1755. </ul></li>
  1756. <li><a id="toc-colorkey_005fopencl" href="#colorkey_005fopencl">34.3 colorkey_opencl</a>
  1757. <ul class="toc-numbered-mark">
  1758. <li><a id="toc-Examples-166" href="#Examples-166">34.3.1 Examples</a></li>
  1759. </ul></li>
  1760. <li><a id="toc-convolution_005fopencl" href="#convolution_005fopencl">34.4 convolution_opencl</a>
  1761. <ul class="toc-numbered-mark">
  1762. <li><a id="toc-Examples-167" href="#Examples-167">34.4.1 Examples</a></li>
  1763. </ul></li>
  1764. <li><a id="toc-erosion_005fopencl" href="#erosion_005fopencl">34.5 erosion_opencl</a>
  1765. <ul class="toc-numbered-mark">
  1766. <li><a id="toc-Example-2" href="#Example-2">34.5.1 Example</a></li>
  1767. </ul></li>
  1768. <li><a id="toc-deshake_005fopencl" href="#deshake_005fopencl">34.6 deshake_opencl</a>
  1769. <ul class="toc-numbered-mark">
  1770. <li><a id="toc-Examples-168" href="#Examples-168">34.6.1 Examples</a></li>
  1771. </ul></li>
  1772. <li><a id="toc-dilation_005fopencl" href="#dilation_005fopencl">34.7 dilation_opencl</a>
  1773. <ul class="toc-numbered-mark">
  1774. <li><a id="toc-Example-3" href="#Example-3">34.7.1 Example</a></li>
  1775. </ul></li>
  1776. <li><a id="toc-nlmeans_005fopencl-1" href="#nlmeans_005fopencl-1">34.8 nlmeans_opencl</a></li>
  1777. <li><a id="toc-overlay_005fopencl" href="#overlay_005fopencl">34.9 overlay_opencl</a>
  1778. <ul class="toc-numbered-mark">
  1779. <li><a id="toc-Examples-169" href="#Examples-169">34.9.1 Examples</a></li>
  1780. </ul></li>
  1781. <li><a id="toc-pad_005fopencl" href="#pad_005fopencl">34.10 pad_opencl</a></li>
  1782. <li><a id="toc-prewitt_005fopencl" href="#prewitt_005fopencl">34.11 prewitt_opencl</a>
  1783. <ul class="toc-numbered-mark">
  1784. <li><a id="toc-Example-4" href="#Example-4">34.11.1 Example</a></li>
  1785. </ul></li>
  1786. <li><a id="toc-program_005fopencl-1" href="#program_005fopencl-1">34.12 program_opencl</a></li>
  1787. <li><a id="toc-remap_005fopencl" href="#remap_005fopencl">34.13 remap_opencl</a></li>
  1788. <li><a id="toc-roberts_005fopencl" href="#roberts_005fopencl">34.14 roberts_opencl</a>
  1789. <ul class="toc-numbered-mark">
  1790. <li><a id="toc-Example-5" href="#Example-5">34.14.1 Example</a></li>
  1791. </ul></li>
  1792. <li><a id="toc-sobel_005fopencl" href="#sobel_005fopencl">34.15 sobel_opencl</a>
  1793. <ul class="toc-numbered-mark">
  1794. <li><a id="toc-Example-6" href="#Example-6">34.15.1 Example</a></li>
  1795. </ul></li>
  1796. <li><a id="toc-tonemap_005fopencl" href="#tonemap_005fopencl">34.16 tonemap_opencl</a>
  1797. <ul class="toc-numbered-mark">
  1798. <li><a id="toc-Example-7" href="#Example-7">34.16.1 Example</a></li>
  1799. </ul></li>
  1800. <li><a id="toc-unsharp_005fopencl" href="#unsharp_005fopencl">34.17 unsharp_opencl</a>
  1801. <ul class="toc-numbered-mark">
  1802. <li><a id="toc-Examples-170" href="#Examples-170">34.17.1 Examples</a></li>
  1803. </ul></li>
  1804. <li><a id="toc-xfade_005fopencl" href="#xfade_005fopencl">34.18 xfade_opencl</a></li>
  1805. </ul></li>
  1806. <li><a id="toc-VAAPI-Video-Filters" href="#VAAPI-Video-Filters">35 VAAPI Video Filters</a>
  1807. <ul class="toc-numbered-mark">
  1808. <li><a id="toc-overlay_005fvaapi" href="#overlay_005fvaapi">35.1 overlay_vaapi</a>
  1809. <ul class="toc-numbered-mark">
  1810. <li><a id="toc-Examples-171" href="#Examples-171">35.1.1 Examples</a></li>
  1811. </ul></li>
  1812. <li><a id="toc-tonemap_005fvaapi" href="#tonemap_005fvaapi">35.2 tonemap_vaapi</a>
  1813. <ul class="toc-numbered-mark">
  1814. <li><a id="toc-Example-8" href="#Example-8">35.2.1 Example</a></li>
  1815. </ul></li>
  1816. <li><a id="toc-hstack_005fvaapi" href="#hstack_005fvaapi">35.3 hstack_vaapi</a></li>
  1817. <li><a id="toc-vstack_005fvaapi" href="#vstack_005fvaapi">35.4 vstack_vaapi</a></li>
  1818. <li><a id="toc-xstack_005fvaapi" href="#xstack_005fvaapi">35.5 xstack_vaapi</a></li>
  1819. <li><a id="toc-pad_005fvaapi" href="#pad_005fvaapi">35.6 pad_vaapi</a></li>
  1820. <li><a id="toc-drawbox_005fvaapi" href="#drawbox_005fvaapi">35.7 drawbox_vaapi</a>
  1821. <ul class="toc-numbered-mark">
  1822. <li><a id="toc-Examples-172" href="#Examples-172">35.7.1 Examples</a></li>
  1823. </ul></li>
  1824. </ul></li>
  1825. <li><a id="toc-VideoToolbox-Video-Filters" href="#VideoToolbox-Video-Filters">36 VideoToolbox Video Filters</a>
  1826. <ul class="toc-numbered-mark">
  1827. <li><a id="toc-scale_005fvt" href="#scale_005fvt">36.1 scale_vt</a>
  1828. <ul class="toc-numbered-mark">
  1829. <li><a id="toc-Examples-173" href="#Examples-173">36.1.1 Examples</a></li>
  1830. </ul></li>
  1831. <li><a id="toc-transpose_005fvt" href="#transpose_005fvt">36.2 transpose_vt</a></li>
  1832. </ul></li>
  1833. <li><a id="toc-Vulkan-Video-Filters" href="#Vulkan-Video-Filters">37 Vulkan Video Filters</a>
  1834. <ul class="toc-numbered-mark">
  1835. <li><a id="toc-avgblur_005fvulkan" href="#avgblur_005fvulkan">37.1 avgblur_vulkan</a></li>
  1836. <li><a id="toc-blend_005fvulkan" href="#blend_005fvulkan">37.2 blend_vulkan</a></li>
  1837. <li><a id="toc-bwdif_005fvulkan" href="#bwdif_005fvulkan">37.3 bwdif_vulkan</a></li>
  1838. <li><a id="toc-chromaber_005fvulkan" href="#chromaber_005fvulkan">37.4 chromaber_vulkan</a></li>
  1839. <li><a id="toc-color_005fvulkan" href="#color_005fvulkan">37.5 color_vulkan</a></li>
  1840. <li><a id="toc-vflip_005fvulkan" href="#vflip_005fvulkan">37.6 vflip_vulkan</a></li>
  1841. <li><a id="toc-hflip_005fvulkan" href="#hflip_005fvulkan">37.7 hflip_vulkan</a></li>
  1842. <li><a id="toc-flip_005fvulkan" href="#flip_005fvulkan">37.8 flip_vulkan</a></li>
  1843. <li><a id="toc-gblur_005fvulkan" href="#gblur_005fvulkan">37.9 gblur_vulkan</a></li>
  1844. <li><a id="toc-nlmeans_005fvulkan" href="#nlmeans_005fvulkan">37.10 nlmeans_vulkan</a></li>
  1845. <li><a id="toc-overlay_005fvulkan" href="#overlay_005fvulkan">37.11 overlay_vulkan</a></li>
  1846. <li><a id="toc-transpose_005fvulkan" href="#transpose_005fvulkan">37.12 transpose_vulkan</a></li>
  1847. </ul></li>
  1848. <li><a id="toc-QSV-Video-Filters" href="#QSV-Video-Filters">38 QSV Video Filters</a>
  1849. <ul class="toc-numbered-mark">
  1850. <li><a id="toc-hstack_005fqsv" href="#hstack_005fqsv">38.1 hstack_qsv</a></li>
  1851. <li><a id="toc-vstack_005fqsv" href="#vstack_005fqsv">38.2 vstack_qsv</a></li>
  1852. <li><a id="toc-xstack_005fqsv" href="#xstack_005fqsv">38.3 xstack_qsv</a></li>
  1853. </ul></li>
  1854. <li><a id="toc-Video-Sources" href="#Video-Sources">39 Video Sources</a>
  1855. <ul class="toc-numbered-mark">
  1856. <li><a id="toc-buffer" href="#buffer">39.1 buffer</a></li>
  1857. <li><a id="toc-cellauto" href="#cellauto">39.2 cellauto</a>
  1858. <ul class="toc-numbered-mark">
  1859. <li><a id="toc-Examples-174" href="#Examples-174">39.2.1 Examples</a></li>
  1860. </ul></li>
  1861. <li><a id="toc-coreimagesrc-1" href="#coreimagesrc-1">39.3 coreimagesrc</a>
  1862. <ul class="toc-numbered-mark">
  1863. <li><a id="toc-Examples-175" href="#Examples-175">39.3.1 Examples</a></li>
  1864. </ul></li>
  1865. <li><a id="toc-ddagrab" href="#ddagrab">39.4 ddagrab</a>
  1866. <ul class="toc-numbered-mark">
  1867. <li><a id="toc-Examples-176" href="#Examples-176">39.4.1 Examples</a></li>
  1868. </ul></li>
  1869. <li><a id="toc-gfxcapture" href="#gfxcapture">39.5 gfxcapture</a>
  1870. <ul class="toc-numbered-mark">
  1871. <li><a id="toc-Examples-177" href="#Examples-177">39.5.1 Examples</a></li>
  1872. </ul></li>
  1873. <li><a id="toc-gradients" href="#gradients">39.6 gradients</a>
  1874. <ul class="toc-numbered-mark">
  1875. <li><a id="toc-Commands-156" href="#Commands-156">39.6.1 Commands</a></li>
  1876. </ul></li>
  1877. <li><a id="toc-mandelbrot" href="#mandelbrot">39.7 mandelbrot</a></li>
  1878. <li><a id="toc-mptestsrc" href="#mptestsrc">39.8 mptestsrc</a></li>
  1879. <li><a id="toc-frei0r_005fsrc" href="#frei0r_005fsrc">39.9 frei0r_src</a></li>
  1880. <li><a id="toc-life" href="#life">39.10 life</a>
  1881. <ul class="toc-numbered-mark">
  1882. <li><a id="toc-Examples-178" href="#Examples-178">39.10.1 Examples</a></li>
  1883. </ul></li>
  1884. <li><a id="toc-perlin" href="#perlin">39.11 perlin</a>
  1885. <ul class="toc-numbered-mark">
  1886. <li><a id="toc-Options-43" href="#Options-43">39.11.1 Options</a></li>
  1887. <li><a id="toc-Examples-179" href="#Examples-179">39.11.2 Examples</a></li>
  1888. </ul></li>
  1889. <li><a id="toc-qrencodesrc" href="#qrencodesrc">39.12 qrencodesrc</a>
  1890. <ul class="toc-numbered-mark">
  1891. <li><a id="toc-Examples-180" href="#Examples-180">39.12.1 Examples</a></li>
  1892. </ul></li>
  1893. <li><a id="toc-allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" href="#allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc">39.13 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a>
  1894. <ul class="toc-numbered-mark">
  1895. <li><a id="toc-Examples-181" href="#Examples-181">39.13.1 Examples</a></li>
  1896. <li><a id="toc-Commands-157" href="#Commands-157">39.13.2 Commands</a></li>
  1897. </ul></li>
  1898. <li><a id="toc-openclsrc" href="#openclsrc">39.14 openclsrc</a></li>
  1899. <li><a id="toc-sierpinski" href="#sierpinski">39.15 sierpinski</a></li>
  1900. <li><a id="toc-zoneplate" href="#zoneplate">39.16 zoneplate</a>
  1901. <ul class="toc-numbered-mark">
  1902. <li><a id="toc-Commands-158" href="#Commands-158">39.16.1 Commands</a></li>
  1903. <li><a id="toc-Examples-182" href="#Examples-182">39.16.2 Examples</a></li>
  1904. </ul></li>
  1905. </ul></li>
  1906. <li><a id="toc-Video-Sinks" href="#Video-Sinks">40 Video Sinks</a>
  1907. <ul class="toc-numbered-mark">
  1908. <li><a id="toc-buffersink" href="#buffersink">40.1 buffersink</a></li>
  1909. <li><a id="toc-nullsink" href="#nullsink">40.2 nullsink</a></li>
  1910. </ul></li>
  1911. <li><a id="toc-Multimedia-Filters" href="#Multimedia-Filters">41 Multimedia Filters</a>
  1912. <ul class="toc-numbered-mark">
  1913. <li><a id="toc-a3dscope" href="#a3dscope">41.1 a3dscope</a>
  1914. <ul class="toc-numbered-mark">
  1915. <li><a id="toc-Commands-159" href="#Commands-159">41.1.1 Commands</a></li>
  1916. </ul></li>
  1917. <li><a id="toc-abitscope" href="#abitscope">41.2 abitscope</a></li>
  1918. <li><a id="toc-adrawgraph" href="#adrawgraph">41.3 adrawgraph</a></li>
  1919. <li><a id="toc-agraphmonitor" href="#agraphmonitor">41.4 agraphmonitor</a></li>
  1920. <li><a id="toc-ahistogram" href="#ahistogram">41.5 ahistogram</a></li>
  1921. <li><a id="toc-aphasemeter" href="#aphasemeter">41.6 aphasemeter</a>
  1922. <ul class="toc-numbered-mark">
  1923. <li><a id="toc-phasing-detection" href="#phasing-detection">41.6.1 phasing detection</a></li>
  1924. <li><a id="toc-Examples-183" href="#Examples-183">41.6.2 Examples</a></li>
  1925. </ul></li>
  1926. <li><a id="toc-avectorscope" href="#avectorscope">41.7 avectorscope</a>
  1927. <ul class="toc-numbered-mark">
  1928. <li><a id="toc-Examples-184" href="#Examples-184">41.7.1 Examples</a></li>
  1929. <li><a id="toc-Commands-160" href="#Commands-160">41.7.2 Commands</a></li>
  1930. </ul></li>
  1931. <li><a id="toc-bench_002c-abench" href="#bench_002c-abench">41.8 bench, abench</a>
  1932. <ul class="toc-numbered-mark">
  1933. <li><a id="toc-Examples-185" href="#Examples-185">41.8.1 Examples</a></li>
  1934. </ul></li>
  1935. <li><a id="toc-concat-3" href="#concat-3">41.9 concat</a>
  1936. <ul class="toc-numbered-mark">
  1937. <li><a id="toc-Examples-186" href="#Examples-186">41.9.1 Examples</a></li>
  1938. <li><a id="toc-Commands-161" href="#Commands-161">41.9.2 Commands</a></li>
  1939. </ul></li>
  1940. <li><a id="toc-ebur128-1" href="#ebur128-1">41.10 ebur128</a>
  1941. <ul class="toc-numbered-mark">
  1942. <li><a id="toc-Examples-187" href="#Examples-187">41.10.1 Examples</a></li>
  1943. </ul></li>
  1944. <li><a id="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">41.11 interleave, ainterleave</a>
  1945. <ul class="toc-numbered-mark">
  1946. <li><a id="toc-Examples-188" href="#Examples-188">41.11.1 Examples</a></li>
  1947. </ul></li>
  1948. <li><a id="toc-latency_002c-alatency" href="#latency_002c-alatency">41.12 latency, alatency</a></li>
  1949. <li><a id="toc-metadata_002c-ametadata" href="#metadata_002c-ametadata">41.13 metadata, ametadata</a>
  1950. <ul class="toc-numbered-mark">
  1951. <li><a id="toc-Examples-189" href="#Examples-189">41.13.1 Examples</a></li>
  1952. </ul></li>
  1953. <li><a id="toc-perms_002c-aperms" href="#perms_002c-aperms">41.14 perms, aperms</a></li>
  1954. <li><a id="toc-realtime_002c-arealtime" href="#realtime_002c-arealtime">41.15 realtime, arealtime</a>
  1955. <ul class="toc-numbered-mark">
  1956. <li><a id="toc-Commands-162" href="#Commands-162">41.15.1 Commands</a></li>
  1957. </ul></li>
  1958. <li><a id="toc-segment_002c-asegment" href="#segment_002c-asegment">41.16 segment, asegment</a>
  1959. <ul class="toc-numbered-mark">
  1960. <li><a id="toc-Examples-190" href="#Examples-190">41.16.1 Examples</a></li>
  1961. </ul></li>
  1962. <li><a id="toc-select_002c-aselect" href="#select_002c-aselect">41.17 select, aselect</a>
  1963. <ul class="toc-numbered-mark">
  1964. <li><a id="toc-Examples-191" href="#Examples-191">41.17.1 Examples</a></li>
  1965. </ul></li>
  1966. <li><a id="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">41.18 sendcmd, asendcmd</a>
  1967. <ul class="toc-numbered-mark">
  1968. <li><a id="toc-Commands-syntax" href="#Commands-syntax">41.18.1 Commands syntax</a></li>
  1969. <li><a id="toc-Examples-192" href="#Examples-192">41.18.2 Examples</a></li>
  1970. </ul></li>
  1971. <li><a id="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">41.19 setpts, asetpts</a>
  1972. <ul class="toc-numbered-mark">
  1973. <li><a id="toc-Examples-193" href="#Examples-193">41.19.1 Examples</a></li>
  1974. <li><a id="toc-Commands-163" href="#Commands-163">41.19.2 Commands</a></li>
  1975. </ul></li>
  1976. <li><a id="toc-setrange" href="#setrange">41.20 setrange</a></li>
  1977. <li><a id="toc-settb_002c-asettb" href="#settb_002c-asettb">41.21 settb, asettb</a>
  1978. <ul class="toc-numbered-mark">
  1979. <li><a id="toc-Examples-194" href="#Examples-194">41.21.1 Examples</a></li>
  1980. </ul></li>
  1981. <li><a id="toc-showcqt" href="#showcqt">41.22 showcqt</a>
  1982. <ul class="toc-numbered-mark">
  1983. <li><a id="toc-Examples-195" href="#Examples-195">41.22.1 Examples</a></li>
  1984. </ul></li>
  1985. <li><a id="toc-showcwt" href="#showcwt">41.23 showcwt</a></li>
  1986. <li><a id="toc-showfreqs" href="#showfreqs">41.24 showfreqs</a></li>
  1987. <li><a id="toc-showspatial" href="#showspatial">41.25 showspatial</a></li>
  1988. <li><a id="toc-showspectrum-1" href="#showspectrum-1">41.26 showspectrum</a>
  1989. <ul class="toc-numbered-mark">
  1990. <li><a id="toc-Examples-196" href="#Examples-196">41.26.1 Examples</a></li>
  1991. </ul></li>
  1992. <li><a id="toc-showspectrumpic" href="#showspectrumpic">41.27 showspectrumpic</a>
  1993. <ul class="toc-numbered-mark">
  1994. <li><a id="toc-Examples-197" href="#Examples-197">41.27.1 Examples</a></li>
  1995. </ul></li>
  1996. <li><a id="toc-showvolume" href="#showvolume">41.28 showvolume</a></li>
  1997. <li><a id="toc-showwaves" href="#showwaves">41.29 showwaves</a>
  1998. <ul class="toc-numbered-mark">
  1999. <li><a id="toc-Examples-198" href="#Examples-198">41.29.1 Examples</a></li>
  2000. </ul></li>
  2001. <li><a id="toc-showwavespic" href="#showwavespic">41.30 showwavespic</a>
  2002. <ul class="toc-numbered-mark">
  2003. <li><a id="toc-Examples-199" href="#Examples-199">41.30.1 Examples</a></li>
  2004. </ul></li>
  2005. <li><a id="toc-sidedata_002c-asidedata" href="#sidedata_002c-asidedata">41.31 sidedata, asidedata</a></li>
  2006. <li><a id="toc-spectrumsynth" href="#spectrumsynth">41.32 spectrumsynth</a>
  2007. <ul class="toc-numbered-mark">
  2008. <li><a id="toc-Examples-200" href="#Examples-200">41.32.1 Examples</a></li>
  2009. </ul></li>
  2010. <li><a id="toc-split_002c-asplit" href="#split_002c-asplit">41.33 split, asplit</a>
  2011. <ul class="toc-numbered-mark">
  2012. <li><a id="toc-Examples-201" href="#Examples-201">41.33.1 Examples</a></li>
  2013. </ul></li>
  2014. <li><a id="toc-zmq_002c-azmq" href="#zmq_002c-azmq">41.34 zmq, azmq</a>
  2015. <ul class="toc-numbered-mark">
  2016. <li><a id="toc-Examples-202" href="#Examples-202">41.34.1 Examples</a></li>
  2017. </ul></li>
  2018. </ul></li>
  2019. <li><a id="toc-Multimedia-Sources" href="#Multimedia-Sources">42 Multimedia Sources</a>
  2020. <ul class="toc-numbered-mark">
  2021. <li><a id="toc-amovie" href="#amovie">42.1 amovie</a></li>
  2022. <li><a id="toc-avsynctest" href="#avsynctest">42.2 avsynctest</a>
  2023. <ul class="toc-numbered-mark">
  2024. <li><a id="toc-Commands-164" href="#Commands-164">42.2.1 Commands</a></li>
  2025. </ul></li>
  2026. <li><a id="toc-movie-1" href="#movie-1">42.3 movie</a>
  2027. <ul class="toc-numbered-mark">
  2028. <li><a id="toc-Examples-203" href="#Examples-203">42.3.1 Examples</a></li>
  2029. <li><a id="toc-Commands-165" href="#Commands-165">42.3.2 Commands</a></li>
  2030. </ul></li>
  2031. </ul></li>
  2032. <li><a id="toc-External-libraries" href="#External-libraries">43 External libraries</a>
  2033. <ul class="toc-numbered-mark">
  2034. <li><a id="toc-Alliance-for-Open-Media-_0028AOM_0029" href="#Alliance-for-Open-Media-_0028AOM_0029">43.1 Alliance for Open Media (AOM)</a></li>
  2035. <li><a id="toc-AMD-AMF_002fVCE" href="#AMD-AMF_002fVCE">43.2 AMD AMF/VCE</a></li>
  2036. <li><a id="toc-AviSynth" href="#AviSynth">43.3 AviSynth</a></li>
  2037. <li><a id="toc-Chromaprint" href="#Chromaprint">43.4 Chromaprint</a></li>
  2038. <li><a id="toc-codec2" href="#codec2">43.5 codec2</a></li>
  2039. <li><a id="toc-dav1d" href="#dav1d">43.6 dav1d</a></li>
  2040. <li><a id="toc-davs2" href="#davs2">43.7 davs2</a></li>
  2041. <li><a id="toc-uavs3d" href="#uavs3d">43.8 uavs3d</a></li>
  2042. <li><a id="toc-Game-Music-Emu" href="#Game-Music-Emu">43.9 Game Music Emu</a></li>
  2043. <li><a id="toc-Intel-QuickSync-Video" href="#Intel-QuickSync-Video">43.10 Intel QuickSync Video</a></li>
  2044. <li><a id="toc-Kvazaar" href="#Kvazaar">43.11 Kvazaar</a></li>
  2045. <li><a id="toc-LAME" href="#LAME">43.12 LAME</a></li>
  2046. <li><a id="toc-LCEVCdec" href="#LCEVCdec">43.13 LCEVCdec</a></li>
  2047. <li><a id="toc-libilbc-1" href="#libilbc-1">43.14 libilbc</a></li>
  2048. <li><a id="toc-libjxl" href="#libjxl">43.15 libjxl</a></li>
  2049. <li><a id="toc-libvpx" href="#libvpx">43.16 libvpx</a></li>
  2050. <li><a id="toc-ModPlug" href="#ModPlug">43.17 ModPlug</a></li>
  2051. <li><a id="toc-OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries" href="#OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries">43.18 OpenCORE, VisualOn, and Fraunhofer libraries</a>
  2052. <ul class="toc-numbered-mark">
  2053. <li><a id="toc-OpenCORE-AMR" href="#OpenCORE-AMR">43.18.1 OpenCORE AMR</a></li>
  2054. <li><a id="toc-VisualOn-AMR_002dWB-encoder-library" href="#VisualOn-AMR_002dWB-encoder-library">43.18.2 VisualOn AMR-WB encoder library</a></li>
  2055. <li><a id="toc-Fraunhofer-AAC-library" href="#Fraunhofer-AAC-library">43.18.3 Fraunhofer AAC library</a></li>
  2056. <li><a id="toc-Fraunhofer-MPEG_002dH-3D-Audio-decoder-library" href="#Fraunhofer-MPEG_002dH-3D-Audio-decoder-library">43.18.4 Fraunhofer MPEG-H 3D Audio decoder library</a></li>
  2057. <li><a id="toc-LC3-library" href="#LC3-library">43.18.5 LC3 library</a></li>
  2058. </ul></li>
  2059. <li><a id="toc-OpenH264" href="#OpenH264">43.19 OpenH264</a></li>
  2060. <li><a id="toc-OpenJPEG" href="#OpenJPEG">43.20 OpenJPEG</a></li>
  2061. <li><a id="toc-rav1e" href="#rav1e">43.21 rav1e</a></li>
  2062. <li><a id="toc-SVT_002dAV1" href="#SVT_002dAV1">43.22 SVT-AV1</a></li>
  2063. <li><a id="toc-SVT_002dJPEG_002dXS" href="#SVT_002dJPEG_002dXS">43.23 SVT-JPEG-XS</a></li>
  2064. <li><a id="toc-TwoLAME" href="#TwoLAME">43.24 TwoLAME</a></li>
  2065. <li><a id="toc-VapourSynth" href="#VapourSynth">43.25 VapourSynth</a></li>
  2066. <li><a id="toc-x264" href="#x264">43.26 x264</a></li>
  2067. <li><a id="toc-x265" href="#x265">43.27 x265</a></li>
  2068. <li><a id="toc-xavs" href="#xavs">43.28 xavs</a></li>
  2069. <li><a id="toc-xavs2" href="#xavs2">43.29 xavs2</a></li>
  2070. <li><a id="toc-eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029" href="#eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029">43.30 eXtra-fast Essential Video Encoder (XEVE)</a></li>
  2071. <li><a id="toc-eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029" href="#eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029">43.31 eXtra-fast Essential Video Decoder (XEVD)</a></li>
  2072. <li><a id="toc-ZVBI" href="#ZVBI">43.32 ZVBI</a></li>
  2073. </ul></li>
  2074. <li><a id="toc-Supported-File-Formats_002c-Codecs-or-Features" href="#Supported-File-Formats_002c-Codecs-or-Features">44 Supported File Formats, Codecs or Features</a>
  2075. <ul class="toc-numbered-mark">
  2076. <li><a id="toc-File-Formats" href="#File-Formats">44.1 File Formats</a></li>
  2077. <li><a id="toc-Image-Formats" href="#Image-Formats">44.2 Image Formats</a></li>
  2078. <li><a id="toc-Video-Codecs" href="#Video-Codecs">44.3 Video Codecs</a></li>
  2079. <li><a id="toc-Audio-Codecs" href="#Audio-Codecs">44.4 Audio Codecs</a></li>
  2080. <li><a id="toc-Subtitle-Formats" href="#Subtitle-Formats">44.5 Subtitle Formats</a></li>
  2081. <li><a id="toc-Network-Protocols" href="#Network-Protocols">44.6 Network Protocols</a></li>
  2082. <li><a id="toc-Input_002fOutput-Devices" href="#Input_002fOutput-Devices">44.7 Input/Output Devices</a></li>
  2083. <li><a id="toc-Timecode-1" href="#Timecode-1">44.8 Timecode</a></li>
  2084. </ul></li>
  2085. <li><a id="toc-See-Also" href="#See-Also">45 See Also</a></li>
  2086. <li><a id="toc-Authors" href="#Authors">46 Authors</a></li>
  2087. </ul>
  2088. </div>
  2089. </div>
  2090. <a name="Synopsis"></a>
  2091. <h2 class="chapter">1 Synopsis<span class="pull-right"><a class="anchor hidden-xs" href="#Synopsis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Synopsis" aria-hidden="true">TOC</a></span></h2>
  2092. <p>ffprobe [<var class="var">options</var>] <samp class="file">input_url</samp>
  2093. </p>
  2094. <a name="Description"></a>
  2095. <h2 class="chapter">2 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
  2096. <p>ffprobe gathers information from multimedia streams and prints it in
  2097. human- and machine-readable fashion.
  2098. </p>
  2099. <p>For example it can be used to check the format of the container used
  2100. by a multimedia stream and the format and type of each media stream
  2101. contained in it.
  2102. </p>
  2103. <p>If a url is specified in input, ffprobe will try to open and
  2104. probe the url content. If the url cannot be opened or recognized as
  2105. a multimedia file, a positive exit code is returned.
  2106. </p>
  2107. <p>If no output is specified as output with <samp class="option">o</samp> ffprobe will write
  2108. to stdout.
  2109. </p>
  2110. <p>ffprobe may be employed both as a standalone application or in
  2111. combination with a textual filter, which may perform more
  2112. sophisticated processing, e.g. statistical processing or plotting.
  2113. </p>
  2114. <p>Options are used to list some of the formats supported by ffprobe or
  2115. for specifying which information to display, and for setting how
  2116. ffprobe will show it.
  2117. </p>
  2118. <p>ffprobe output is designed to be easily parsable by a textual filter,
  2119. and consists of one or more sections of a form defined by the selected
  2120. writer, which is specified by the <samp class="option">output_format</samp> option.
  2121. </p>
  2122. <p>Sections may contain other nested sections, and are identified by a
  2123. name (which may be shared by other sections), and an unique
  2124. name. See the output of <samp class="option">sections</samp>.
  2125. </p>
  2126. <p>Metadata tags stored in the container or in the streams are recognized
  2127. and printed in the corresponding &quot;FORMAT&quot;, &quot;STREAM&quot;, &quot;STREAM_GROUP_STREAM&quot;
  2128. or &quot;PROGRAM_STREAM&quot; section.
  2129. </p>
  2130. <a name="Options"></a>
  2131. <h2 class="chapter">3 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options" aria-hidden="true">TOC</a></span></h2>
  2132. <p>All the numerical options, if not specified otherwise, accept a string
  2133. representing a number as input, which may be followed by one of the SI
  2134. unit prefixes, for example: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
  2135. </p>
  2136. <p>If &rsquo;i&rsquo; is appended to the SI unit prefix, the complete prefix will be
  2137. interpreted as a unit prefix for binary multiples, which are based on
  2138. powers of 1024 instead of powers of 1000. Appending &rsquo;B&rsquo; to the SI unit
  2139. prefix multiplies the value by 8. This allows using, for example:
  2140. &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
  2141. </p>
  2142. <p>Options which do not take arguments are boolean options, and set the
  2143. corresponding value to true. They can be set to false by prefixing
  2144. the option name with &quot;no&quot;. For example using &quot;-nofoo&quot;
  2145. will set the boolean option with name &quot;foo&quot; to false.
  2146. </p>
  2147. <p>Options that take arguments support a special syntax where the argument given on
  2148. the command line is interpreted as a path to the file from which the actual
  2149. argument value is loaded. To use this feature, add a forward slash &rsquo;/&rsquo;
  2150. immediately before the option name (after the leading dash). E.g.
  2151. </p><div class="example">
  2152. <pre class="example-preformatted">ffmpeg -i INPUT -/filter:v filter.script OUTPUT
  2153. </pre></div>
  2154. <p>will load a filtergraph description from the file named <samp class="file">filter.script</samp>.
  2155. </p>
  2156. <a class="anchor" id="Stream-specifiers"></a><a name="Stream-specifiers-1"></a>
  2157. <h3 class="section">3.1 Stream specifiers<span class="pull-right"><a class="anchor hidden-xs" href="#Stream-specifiers-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Stream-specifiers-1" aria-hidden="true">TOC</a></span></h3>
  2158. <p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
  2159. are used to precisely specify which stream(s) a given option belongs to.
  2160. </p>
  2161. <p>A stream specifier is a string generally appended to the option name and
  2162. separated from it by a colon. E.g. <code class="code">-codec:a:1 ac3</code> contains the
  2163. <code class="code">a:1</code> stream specifier, which matches the second audio stream. Therefore, it
  2164. would select the ac3 codec for the second audio stream.
  2165. </p>
  2166. <p>A stream specifier can match several streams, so that the option is applied to all
  2167. of them. E.g. the stream specifier in <code class="code">-b:a 128k</code> matches all audio
  2168. streams.
  2169. </p>
  2170. <p>An empty stream specifier matches all streams. For example, <code class="code">-codec copy</code>
  2171. or <code class="code">-codec: copy</code> would copy all the streams without reencoding.
  2172. </p>
  2173. <p>Possible forms of stream specifiers are:
  2174. </p><dl class="table">
  2175. <dt><samp class="option"><var class="var">stream_index</var></samp></dt>
  2176. <dd><p>Matches the stream with this index. E.g. <code class="code">-threads:1 4</code> would set the
  2177. thread count for the second stream to 4. If <var class="var">stream_index</var> is used as an
  2178. additional stream specifier (see below), then it selects stream number
  2179. <var class="var">stream_index</var> from the matching streams. Stream numbering is based on the
  2180. order of the streams as detected by libavformat except when a stream group
  2181. specifier or program ID is also specified. In this case it is based on the
  2182. ordering of the streams in the group or program.
  2183. </p></dd>
  2184. <dt><samp class="option"><var class="var">stream_type</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  2185. <dd><p><var class="var">stream_type</var> is one of following: &rsquo;v&rsquo; or &rsquo;V&rsquo; for video, &rsquo;a&rsquo; for audio, &rsquo;s&rsquo;
  2186. for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. &rsquo;v&rsquo; matches all video
  2187. streams, &rsquo;V&rsquo; only matches video streams which are not attached pictures, video
  2188. thumbnails or cover arts. If <var class="var">additional_stream_specifier</var> is used, then
  2189. it matches streams which both have this type and match the
  2190. <var class="var">additional_stream_specifier</var>. Otherwise, it matches all streams of the
  2191. specified type.
  2192. </p></dd>
  2193. <dt><samp class="option">g:<var class="var">group_specifier</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  2194. <dd><p>Matches streams which are in the group with the specifier <var class="var">group_specifier</var>.
  2195. if <var class="var">additional_stream_specifier</var> is used, then it matches streams which both
  2196. are part of the group and match the <var class="var">additional_stream_specifier</var>.
  2197. <var class="var">group_specifier</var> may be one of the following:
  2198. </p><dl class="table">
  2199. <dt><samp class="option"><var class="var">group_index</var></samp></dt>
  2200. <dd><p>Match the stream with this group index.
  2201. </p></dd>
  2202. <dt><samp class="option">#<var class="var">group_id</var> or i:<var class="var">group_id</var></samp></dt>
  2203. <dd><p>Match the stream with this group id.
  2204. </p></dd>
  2205. </dl>
  2206. </dd>
  2207. <dt><samp class="option">p:<var class="var">program_id</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  2208. <dd><p>Matches streams which are in the program with the id <var class="var">program_id</var>. If
  2209. <var class="var">additional_stream_specifier</var> is used, then it matches streams which both
  2210. are part of the program and match the <var class="var">additional_stream_specifier</var>.
  2211. </p>
  2212. </dd>
  2213. <dt><samp class="option">#<var class="var">stream_id</var> or i:<var class="var">stream_id</var></samp></dt>
  2214. <dd><p>Match the stream by stream id (e.g. PID in MPEG-TS container).
  2215. </p></dd>
  2216. <dt><samp class="option">m:<var class="var">key</var>[:<var class="var">value</var>]</samp></dt>
  2217. <dd><p>Matches streams with the metadata tag <var class="var">key</var> having the specified value. If
  2218. <var class="var">value</var> is not given, matches streams that contain the given tag with any
  2219. value. The colon character &rsquo;:&rsquo; in <var class="var">key</var> or <var class="var">value</var> needs to be
  2220. backslash-escaped.
  2221. </p></dd>
  2222. <dt><samp class="option">disp:<var class="var">dispositions</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  2223. <dd><p>Matches streams with the given disposition(s). <var class="var">dispositions</var> is a list of
  2224. one or more dispositions (as printed by the <samp class="option">-dispositions</samp> option)
  2225. joined with &rsquo;+&rsquo;.
  2226. </p></dd>
  2227. <dt><samp class="option">u</samp></dt>
  2228. <dd><p>Matches streams with usable configuration, the codec must be defined and the
  2229. essential information such as video dimension or audio sample rate must be present.
  2230. </p>
  2231. <p>Note that in <code class="command">ffmpeg</code>, matching by metadata will only work properly for
  2232. input files.
  2233. </p></dd>
  2234. </dl>
  2235. <a name="Generic-options"></a>
  2236. <h3 class="section">3.2 Generic options<span class="pull-right"><a class="anchor hidden-xs" href="#Generic-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Generic-options" aria-hidden="true">TOC</a></span></h3>
  2237. <p>These options are shared amongst the ff* tools.
  2238. </p>
  2239. <dl class="table">
  2240. <dt><samp class="option">-L, -license</samp></dt>
  2241. <dd><p>Show license.
  2242. </p>
  2243. </dd>
  2244. <dt><samp class="option">-h, -?, -help, --help [<var class="var">arg</var>]</samp></dt>
  2245. <dd><p>Show help. An optional parameter may be specified to print help about a specific
  2246. item. If no argument is specified, only basic (non advanced) tool
  2247. options are shown.
  2248. </p>
  2249. <p>Possible values of <var class="var">arg</var> are:
  2250. </p><dl class="table">
  2251. <dt><samp class="option">long</samp></dt>
  2252. <dd><p>Print advanced tool options in addition to the basic tool options.
  2253. </p>
  2254. </dd>
  2255. <dt><samp class="option">full</samp></dt>
  2256. <dd><p>Print complete list of options, including shared and private options
  2257. for encoders, decoders, demuxers, muxers, filters, etc.
  2258. </p>
  2259. </dd>
  2260. <dt><samp class="option">decoder=<var class="var">decoder_name</var></samp></dt>
  2261. <dd><p>Print detailed information about the decoder named <var class="var">decoder_name</var>. Use the
  2262. <samp class="option">-decoders</samp> option to get a list of all decoders.
  2263. </p>
  2264. </dd>
  2265. <dt><samp class="option">encoder=<var class="var">encoder_name</var></samp></dt>
  2266. <dd><p>Print detailed information about the encoder named <var class="var">encoder_name</var>. Use the
  2267. <samp class="option">-encoders</samp> option to get a list of all encoders.
  2268. </p>
  2269. </dd>
  2270. <dt><samp class="option">demuxer=<var class="var">demuxer_name</var></samp></dt>
  2271. <dd><p>Print detailed information about the demuxer named <var class="var">demuxer_name</var>. Use the
  2272. <samp class="option">-formats</samp> option to get a list of all demuxers and muxers.
  2273. </p>
  2274. </dd>
  2275. <dt><samp class="option">muxer=<var class="var">muxer_name</var></samp></dt>
  2276. <dd><p>Print detailed information about the muxer named <var class="var">muxer_name</var>. Use the
  2277. <samp class="option">-formats</samp> option to get a list of all muxers and demuxers.
  2278. </p>
  2279. </dd>
  2280. <dt><samp class="option">filter=<var class="var">filter_name</var></samp></dt>
  2281. <dd><p>Print detailed information about the filter named <var class="var">filter_name</var>. Use the
  2282. <samp class="option">-filters</samp> option to get a list of all filters.
  2283. </p>
  2284. </dd>
  2285. <dt><samp class="option">bsf=<var class="var">bitstream_filter_name</var></samp></dt>
  2286. <dd><p>Print detailed information about the bitstream filter named <var class="var">bitstream_filter_name</var>.
  2287. Use the <samp class="option">-bsfs</samp> option to get a list of all bitstream filters.
  2288. </p>
  2289. </dd>
  2290. <dt><samp class="option">protocol=<var class="var">protocol_name</var></samp></dt>
  2291. <dd><p>Print detailed information about the protocol named <var class="var">protocol_name</var>.
  2292. Use the <samp class="option">-protocols</samp> option to get a list of all protocols.
  2293. </p></dd>
  2294. </dl>
  2295. </dd>
  2296. <dt><samp class="option">-version</samp></dt>
  2297. <dd><p>Show version.
  2298. </p>
  2299. </dd>
  2300. <dt><samp class="option">-buildconf</samp></dt>
  2301. <dd><p>Show the build configuration, one option per line.
  2302. </p>
  2303. </dd>
  2304. <dt><samp class="option">-formats</samp></dt>
  2305. <dd><p>Show available formats (including devices).
  2306. </p>
  2307. </dd>
  2308. <dt><samp class="option">-demuxers</samp></dt>
  2309. <dd><p>Show available demuxers.
  2310. </p>
  2311. </dd>
  2312. <dt><samp class="option">-muxers</samp></dt>
  2313. <dd><p>Show available muxers.
  2314. </p>
  2315. </dd>
  2316. <dt><samp class="option">-devices</samp></dt>
  2317. <dd><p>Show available devices.
  2318. </p>
  2319. </dd>
  2320. <dt><samp class="option">-codecs</samp></dt>
  2321. <dd><p>Show all codecs known to libavcodec.
  2322. </p>
  2323. <p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
  2324. for what is more correctly called a media bitstream format.
  2325. </p>
  2326. </dd>
  2327. <dt><samp class="option">-decoders</samp></dt>
  2328. <dd><p>Show available decoders.
  2329. </p>
  2330. </dd>
  2331. <dt><samp class="option">-encoders</samp></dt>
  2332. <dd><p>Show all available encoders.
  2333. </p>
  2334. </dd>
  2335. <dt><samp class="option">-bsfs</samp></dt>
  2336. <dd><p>Show available bitstream filters.
  2337. </p>
  2338. </dd>
  2339. <dt><samp class="option">-protocols</samp></dt>
  2340. <dd><p>Show available protocols.
  2341. </p>
  2342. </dd>
  2343. <dt><samp class="option">-filters</samp></dt>
  2344. <dd><p>Show available libavfilter filters.
  2345. </p>
  2346. </dd>
  2347. <dt><samp class="option">-pix_fmts</samp></dt>
  2348. <dd><p>Show available pixel formats.
  2349. </p>
  2350. </dd>
  2351. <dt><samp class="option">-sample_fmts</samp></dt>
  2352. <dd><p>Show available sample formats.
  2353. </p>
  2354. </dd>
  2355. <dt><samp class="option">-layouts</samp></dt>
  2356. <dd><p>Show channel names and standard channel layouts.
  2357. </p>
  2358. </dd>
  2359. <dt><samp class="option">-dispositions</samp></dt>
  2360. <dd><p>Show stream dispositions.
  2361. </p>
  2362. </dd>
  2363. <dt><samp class="option">-colors</samp></dt>
  2364. <dd><p>Show recognized color names.
  2365. </p>
  2366. </dd>
  2367. <dt><samp class="option">-sources <var class="var">device</var>[,<var class="var">opt1</var>=<var class="var">val1</var>[,<var class="var">opt2</var>=<var class="var">val2</var>]...]</samp></dt>
  2368. <dd><p>Show autodetected sources of the input device.
  2369. Some devices may provide system-dependent source names that cannot be autodetected.
  2370. The returned list cannot be assumed to be always complete.
  2371. </p><div class="example">
  2372. <pre class="example-preformatted">ffmpeg -sources pulse,server=192.168.0.4
  2373. </pre></div>
  2374. </dd>
  2375. <dt><samp class="option">-sinks <var class="var">device</var>[,<var class="var">opt1</var>=<var class="var">val1</var>[,<var class="var">opt2</var>=<var class="var">val2</var>]...]</samp></dt>
  2376. <dd><p>Show autodetected sinks of the output device.
  2377. Some devices may provide system-dependent sink names that cannot be autodetected.
  2378. The returned list cannot be assumed to be always complete.
  2379. </p><div class="example">
  2380. <pre class="example-preformatted">ffmpeg -sinks pulse,server=192.168.0.4
  2381. </pre></div>
  2382. </dd>
  2383. <dt><samp class="option">-loglevel [<var class="var">flags</var>+]<var class="var">loglevel</var> | -v [<var class="var">flags</var>+]<var class="var">loglevel</var></samp></dt>
  2384. <dd><p>Set logging level and flags used by the library.
  2385. </p>
  2386. <p>The optional <var class="var">flags</var> prefix can consist of the following values:
  2387. </p><dl class="table">
  2388. <dt>&lsquo;<samp class="samp">repeat</samp>&rsquo;</dt>
  2389. <dd><p>Indicates that repeated log output should not be compressed to the first line
  2390. and the &quot;Last message repeated n times&quot; line will be omitted.
  2391. </p></dd>
  2392. <dt>&lsquo;<samp class="samp">level</samp>&rsquo;</dt>
  2393. <dd><p>Indicates that log output should add a <code class="code">[level]</code> prefix to each message
  2394. line. This can be used as an alternative to log coloring, e.g. when dumping the
  2395. log to file.
  2396. </p></dd>
  2397. <dt>&lsquo;<samp class="samp">time</samp>&rsquo;</dt>
  2398. <dd><p>Indicates that log lines should be prefixed with time information.
  2399. </p></dd>
  2400. <dt>&lsquo;<samp class="samp">datetime</samp>&rsquo;</dt>
  2401. <dd><p>Indicates that log lines should be prefixed with date and time information.
  2402. </p></dd>
  2403. </dl>
  2404. <p>Flags can also be used alone by adding a &rsquo;+&rsquo;/&rsquo;-&rsquo; prefix to set/reset a single
  2405. flag without affecting other <var class="var">flags</var> or changing <var class="var">loglevel</var>. When
  2406. setting both <var class="var">flags</var> and <var class="var">loglevel</var>, a &rsquo;+&rsquo; separator is expected
  2407. between the last <var class="var">flags</var> value and before <var class="var">loglevel</var>.
  2408. </p>
  2409. <p><var class="var">loglevel</var> is a string or a number containing one of the following values:
  2410. </p><dl class="table">
  2411. <dt>&lsquo;<samp class="samp">quiet, -8</samp>&rsquo;</dt>
  2412. <dd><p>Show nothing at all; be silent.
  2413. </p></dd>
  2414. <dt>&lsquo;<samp class="samp">panic, 0</samp>&rsquo;</dt>
  2415. <dd><p>Only show fatal errors which could lead the process to crash, such as
  2416. an assertion failure. This is not currently used for anything.
  2417. </p></dd>
  2418. <dt>&lsquo;<samp class="samp">fatal, 8</samp>&rsquo;</dt>
  2419. <dd><p>Only show fatal errors. These are errors after which the process absolutely
  2420. cannot continue.
  2421. </p></dd>
  2422. <dt>&lsquo;<samp class="samp">error, 16</samp>&rsquo;</dt>
  2423. <dd><p>Show all errors, including ones which can be recovered from.
  2424. </p></dd>
  2425. <dt>&lsquo;<samp class="samp">warning, 24</samp>&rsquo;</dt>
  2426. <dd><p>Show all warnings and errors. Any message related to possibly
  2427. incorrect or unexpected events will be shown.
  2428. </p></dd>
  2429. <dt>&lsquo;<samp class="samp">info, 32</samp>&rsquo;</dt>
  2430. <dd><p>Show informative messages during processing. This is in addition to
  2431. warnings and errors. This is the default value.
  2432. </p></dd>
  2433. <dt>&lsquo;<samp class="samp">verbose, 40</samp>&rsquo;</dt>
  2434. <dd><p>Same as <code class="code">info</code>, except more verbose.
  2435. </p></dd>
  2436. <dt>&lsquo;<samp class="samp">debug, 48</samp>&rsquo;</dt>
  2437. <dd><p>Show everything, including debugging information.
  2438. </p></dd>
  2439. <dt>&lsquo;<samp class="samp">trace, 56</samp>&rsquo;</dt>
  2440. </dl>
  2441. <p>For example to enable repeated log output, add the <code class="code">level</code> prefix, and set
  2442. <var class="var">loglevel</var> to <code class="code">verbose</code>:
  2443. </p><div class="example">
  2444. <pre class="example-preformatted">ffmpeg -loglevel repeat+level+verbose -i input output
  2445. </pre></div>
  2446. <p>Another example that enables repeated log output without affecting current
  2447. state of <code class="code">level</code> prefix flag or <var class="var">loglevel</var>:
  2448. </p><div class="example">
  2449. <pre class="example-preformatted">ffmpeg [...] -loglevel +repeat
  2450. </pre></div>
  2451. <p>By default the program logs to stderr. If coloring is supported by the
  2452. terminal, colors are used to mark errors and warnings. Log coloring
  2453. can be disabled setting the environment variable
  2454. <code class="env">AV_LOG_FORCE_NOCOLOR</code>, or can be forced setting
  2455. the environment variable <code class="env">AV_LOG_FORCE_COLOR</code>.
  2456. </p>
  2457. </dd>
  2458. <dt><samp class="option">-report</samp></dt>
  2459. <dd><p>Dump full command line and log output to a file named
  2460. <code class="code"><var class="var">program</var>-<var class="var">YYYYMMDD</var>-<var class="var">HHMMSS</var>.log</code> in the current
  2461. directory.
  2462. This file can be useful for bug reports.
  2463. It also implies <code class="code">-loglevel debug</code>.
  2464. </p>
  2465. <p>Setting the environment variable <code class="env">FFREPORT</code> to any value has the
  2466. same effect. If the value is a &rsquo;:&rsquo;-separated key=value sequence, these
  2467. options will affect the report; option values must be escaped if they
  2468. contain special characters or the options delimiter &rsquo;:&rsquo; (see the
  2469. &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual).
  2470. </p>
  2471. <p>The following options are recognized:
  2472. </p><dl class="table">
  2473. <dt><samp class="option">file</samp></dt>
  2474. <dd><p>set the file name to use for the report; <code class="code">%p</code> is expanded to the name
  2475. of the program, <code class="code">%t</code> is expanded to a timestamp, <code class="code">%%</code> is expanded
  2476. to a plain <code class="code">%</code>
  2477. </p></dd>
  2478. <dt><samp class="option">level</samp></dt>
  2479. <dd><p>set the log verbosity level using a numerical value (see <code class="code">-loglevel</code>).
  2480. </p></dd>
  2481. </dl>
  2482. <p>For example, to output a report to a file named <samp class="file">ffreport.log</samp>
  2483. using a log level of <code class="code">32</code> (alias for log level <code class="code">info</code>):
  2484. </p>
  2485. <div class="example">
  2486. <pre class="example-preformatted">FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
  2487. </pre></div>
  2488. <p>Errors in parsing the environment variable are not fatal, and will not
  2489. appear in the report.
  2490. </p>
  2491. </dd>
  2492. <dt><samp class="option">-hide_banner</samp></dt>
  2493. <dd><p>Suppress printing banner.
  2494. </p>
  2495. <p>All FFmpeg tools will normally show a copyright notice, build options
  2496. and library versions. This option can be used to suppress printing
  2497. this information.
  2498. </p>
  2499. </dd>
  2500. <dt><samp class="option">-cpuflags flags (<em class="emph">global</em>)</samp></dt>
  2501. <dd><p>Allows setting and clearing cpu flags. This option is intended
  2502. for testing. Do not use it unless you know what you&rsquo;re doing.
  2503. </p><div class="example">
  2504. <pre class="example-preformatted">ffmpeg -cpuflags -sse+mmx ...
  2505. ffmpeg -cpuflags mmx ...
  2506. ffmpeg -cpuflags 0 ...
  2507. </pre></div>
  2508. <p>Possible flags for this option are:
  2509. </p><dl class="table">
  2510. <dt>&lsquo;<samp class="samp">x86</samp>&rsquo;</dt>
  2511. <dd><dl class="table">
  2512. <dt>&lsquo;<samp class="samp">mmx</samp>&rsquo;</dt>
  2513. <dt>&lsquo;<samp class="samp">mmxext</samp>&rsquo;</dt>
  2514. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  2515. <dt>&lsquo;<samp class="samp">sse2</samp>&rsquo;</dt>
  2516. <dt>&lsquo;<samp class="samp">sse2slow</samp>&rsquo;</dt>
  2517. <dt>&lsquo;<samp class="samp">sse3</samp>&rsquo;</dt>
  2518. <dt>&lsquo;<samp class="samp">sse3slow</samp>&rsquo;</dt>
  2519. <dt>&lsquo;<samp class="samp">ssse3</samp>&rsquo;</dt>
  2520. <dt>&lsquo;<samp class="samp">atom</samp>&rsquo;</dt>
  2521. <dt>&lsquo;<samp class="samp">sse4.1</samp>&rsquo;</dt>
  2522. <dt>&lsquo;<samp class="samp">sse4.2</samp>&rsquo;</dt>
  2523. <dt>&lsquo;<samp class="samp">avx</samp>&rsquo;</dt>
  2524. <dt>&lsquo;<samp class="samp">avx2</samp>&rsquo;</dt>
  2525. <dt>&lsquo;<samp class="samp">xop</samp>&rsquo;</dt>
  2526. <dt>&lsquo;<samp class="samp">fma3</samp>&rsquo;</dt>
  2527. <dt>&lsquo;<samp class="samp">fma4</samp>&rsquo;</dt>
  2528. <dt>&lsquo;<samp class="samp">3dnow</samp>&rsquo;</dt>
  2529. <dt>&lsquo;<samp class="samp">3dnowext</samp>&rsquo;</dt>
  2530. <dt>&lsquo;<samp class="samp">bmi1</samp>&rsquo;</dt>
  2531. <dt>&lsquo;<samp class="samp">bmi2</samp>&rsquo;</dt>
  2532. <dt>&lsquo;<samp class="samp">cmov</samp>&rsquo;</dt>
  2533. </dl>
  2534. </dd>
  2535. <dt>&lsquo;<samp class="samp">ARM</samp>&rsquo;</dt>
  2536. <dd><dl class="table">
  2537. <dt>&lsquo;<samp class="samp">armv5te</samp>&rsquo;</dt>
  2538. <dt>&lsquo;<samp class="samp">armv6</samp>&rsquo;</dt>
  2539. <dt>&lsquo;<samp class="samp">armv6t2</samp>&rsquo;</dt>
  2540. <dt>&lsquo;<samp class="samp">vfp</samp>&rsquo;</dt>
  2541. <dt>&lsquo;<samp class="samp">vfpv3</samp>&rsquo;</dt>
  2542. <dt>&lsquo;<samp class="samp">neon</samp>&rsquo;</dt>
  2543. <dt>&lsquo;<samp class="samp">setend</samp>&rsquo;</dt>
  2544. </dl>
  2545. </dd>
  2546. <dt>&lsquo;<samp class="samp">AArch64</samp>&rsquo;</dt>
  2547. <dd><dl class="table">
  2548. <dt>&lsquo;<samp class="samp">armv8</samp>&rsquo;</dt>
  2549. <dt>&lsquo;<samp class="samp">vfp</samp>&rsquo;</dt>
  2550. <dt>&lsquo;<samp class="samp">neon</samp>&rsquo;</dt>
  2551. </dl>
  2552. </dd>
  2553. <dt>&lsquo;<samp class="samp">PowerPC</samp>&rsquo;</dt>
  2554. <dd><dl class="table">
  2555. <dt>&lsquo;<samp class="samp">altivec</samp>&rsquo;</dt>
  2556. </dl>
  2557. </dd>
  2558. <dt>&lsquo;<samp class="samp">Specific Processors</samp>&rsquo;</dt>
  2559. <dd><dl class="table">
  2560. <dt>&lsquo;<samp class="samp">pentium2</samp>&rsquo;</dt>
  2561. <dt>&lsquo;<samp class="samp">pentium3</samp>&rsquo;</dt>
  2562. <dt>&lsquo;<samp class="samp">pentium4</samp>&rsquo;</dt>
  2563. <dt>&lsquo;<samp class="samp">k6</samp>&rsquo;</dt>
  2564. <dt>&lsquo;<samp class="samp">k62</samp>&rsquo;</dt>
  2565. <dt>&lsquo;<samp class="samp">athlon</samp>&rsquo;</dt>
  2566. <dt>&lsquo;<samp class="samp">athlonxp</samp>&rsquo;</dt>
  2567. <dt>&lsquo;<samp class="samp">k8</samp>&rsquo;</dt>
  2568. </dl>
  2569. </dd>
  2570. </dl>
  2571. </dd>
  2572. <dt><samp class="option">-cpucount <var class="var">count</var> (<em class="emph">global</em>)</samp></dt>
  2573. <dd><p>Override detection of CPU count. This option is intended
  2574. for testing. Do not use it unless you know what you&rsquo;re doing.
  2575. </p><div class="example">
  2576. <pre class="example-preformatted">ffmpeg -cpucount 2
  2577. </pre></div>
  2578. </dd>
  2579. <dt><samp class="option">-max_alloc <var class="var">bytes</var></samp></dt>
  2580. <dd><p>Set the maximum size limit for allocating a block on the heap by ffmpeg&rsquo;s
  2581. family of malloc functions. Exercise <strong class="strong">extreme caution</strong> when using
  2582. this option. Don&rsquo;t use if you do not understand the full consequence of doing so.
  2583. Default is INT_MAX.
  2584. </p></dd>
  2585. </dl>
  2586. <a name="AVOptions"></a>
  2587. <h3 class="section">3.3 AVOptions<span class="pull-right"><a class="anchor hidden-xs" href="#AVOptions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AVOptions" aria-hidden="true">TOC</a></span></h3>
  2588. <p>These options are provided directly by the libavformat, libavdevice and
  2589. libavcodec libraries. To see the list of available AVOptions, use the
  2590. <samp class="option">-help</samp> option. They are separated into two categories:
  2591. </p><dl class="table">
  2592. <dt><samp class="option">generic</samp></dt>
  2593. <dd><p>These options can be set for any container, codec or device. Generic options
  2594. are listed under AVFormatContext options for containers/devices and under
  2595. AVCodecContext options for codecs.
  2596. </p></dd>
  2597. <dt><samp class="option">private</samp></dt>
  2598. <dd><p>These options are specific to the given container, device or codec. Private
  2599. options are listed under their corresponding containers/devices/codecs.
  2600. </p></dd>
  2601. </dl>
  2602. <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
  2603. an MP3 file, use the <samp class="option">id3v2_version</samp> private option of the MP3
  2604. muxer:
  2605. </p><div class="example">
  2606. <pre class="example-preformatted">ffmpeg -i input.flac -id3v2_version 3 out.mp3
  2607. </pre></div>
  2608. <p>All codec AVOptions are per-stream, and thus a stream specifier
  2609. should be attached to them:
  2610. </p><div class="example">
  2611. <pre class="example-preformatted">ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
  2612. </pre></div>
  2613. <p>In the above example, a multichannel audio stream is mapped twice for output.
  2614. The first instance is encoded with codec ac3 and bitrate 640k.
  2615. The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using
  2616. absolute index of the output stream.
  2617. </p>
  2618. <p>Note: the <samp class="option">-nooption</samp> syntax cannot be used for boolean
  2619. AVOptions, use <samp class="option">-option 0</samp>/<samp class="option">-option 1</samp>.
  2620. </p>
  2621. <p>Note: the old undocumented way of specifying per-stream AVOptions by
  2622. prepending v/a/s to the options name is now obsolete and will be
  2623. removed soon.
  2624. </p>
  2625. <a name="Main-options"></a>
  2626. <h3 class="section">3.4 Main options<span class="pull-right"><a class="anchor hidden-xs" href="#Main-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Main-options" aria-hidden="true">TOC</a></span></h3>
  2627. <dl class="table">
  2628. <dt><samp class="option">-f <var class="var">format</var></samp></dt>
  2629. <dd><p>Force format to use.
  2630. </p>
  2631. </dd>
  2632. <dt><samp class="option">-unit</samp></dt>
  2633. <dd><p>Show the unit of the displayed values.
  2634. </p>
  2635. </dd>
  2636. <dt><samp class="option">-prefix</samp></dt>
  2637. <dd><p>Use SI prefixes for the displayed values.
  2638. Unless the &quot;-byte_binary_prefix&quot; option is used all the prefixes
  2639. are decimal.
  2640. </p>
  2641. </dd>
  2642. <dt><samp class="option">-byte_binary_prefix</samp></dt>
  2643. <dd><p>Force the use of binary prefixes for byte values.
  2644. </p>
  2645. </dd>
  2646. <dt><samp class="option">-sexagesimal</samp></dt>
  2647. <dd><p>Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
  2648. </p>
  2649. </dd>
  2650. <dt><samp class="option">-pretty</samp></dt>
  2651. <dd><p>Prettify the format of the displayed values, it corresponds to the
  2652. options &quot;-unit -prefix -byte_binary_prefix -sexagesimal&quot;.
  2653. </p>
  2654. </dd>
  2655. <dt><samp class="option">-output_format, -of, -print_format <var class="var">writer_name</var>[=<var class="var">writer_options</var>]</samp></dt>
  2656. <dd><p>Set the output printing format.
  2657. </p>
  2658. <p><var class="var">writer_name</var> specifies the name of the writer, and
  2659. <var class="var">writer_options</var> specifies the options to be passed to the writer.
  2660. </p>
  2661. <p>For example for printing the output in JSON format, specify:
  2662. </p><div class="example">
  2663. <pre class="example-preformatted">-output_format json
  2664. </pre></div>
  2665. <p>For more details on the available output printing formats, see the
  2666. Writers section below.
  2667. </p>
  2668. </dd>
  2669. <dt><samp class="option">-sections</samp></dt>
  2670. <dd><p>Print sections structure and section information, and exit. The output
  2671. is not meant to be parsed by a machine.
  2672. </p>
  2673. </dd>
  2674. <dt><samp class="option">-select_streams <var class="var">stream_specifier</var></samp></dt>
  2675. <dd><p>Select only the streams specified by <var class="var">stream_specifier</var>. This
  2676. option affects only the options related to streams
  2677. (e.g. <code class="code">show_streams</code>, <code class="code">show_packets</code>, etc.).
  2678. </p>
  2679. <p>For example to show only audio streams, you can use the command:
  2680. </p><div class="example">
  2681. <pre class="example-preformatted">ffprobe -show_streams -select_streams a INPUT
  2682. </pre></div>
  2683. <p>To show only video packets belonging to the video stream with index 1:
  2684. </p><div class="example">
  2685. <pre class="example-preformatted">ffprobe -show_packets -select_streams v:1 INPUT
  2686. </pre></div>
  2687. </dd>
  2688. <dt><samp class="option">-show_data</samp></dt>
  2689. <dd><p>Show payload data, as a hexadecimal and ASCII dump. Coupled with
  2690. <samp class="option">-show_packets</samp>, it will dump the packets&rsquo; data. Coupled with
  2691. <samp class="option">-show_streams</samp>, it will dump the codec extradata.
  2692. </p>
  2693. <p>The dump is printed as the &quot;data&quot; field. It may contain newlines.
  2694. </p>
  2695. </dd>
  2696. <dt><samp class="option">-show_data_hash <var class="var">algorithm</var></samp></dt>
  2697. <dd><p>Show a hash of payload data, for packets with <samp class="option">-show_packets</samp> and for
  2698. codec extradata with <samp class="option">-show_streams</samp>.
  2699. </p>
  2700. </dd>
  2701. <dt><samp class="option">-show_error</samp></dt>
  2702. <dd><p>Show information about the error found when trying to probe the input.
  2703. </p>
  2704. <p>The error information is printed within a section with name &quot;ERROR&quot;.
  2705. </p>
  2706. </dd>
  2707. <dt><samp class="option">-show_format</samp></dt>
  2708. <dd><p>Show information about the container format of the input multimedia
  2709. stream.
  2710. </p>
  2711. <p>All the container format information is printed within a section with
  2712. name &quot;FORMAT&quot;.
  2713. </p>
  2714. </dd>
  2715. <dt><samp class="option">-show_entries <var class="var">section_entries</var></samp></dt>
  2716. <dd><p>Set list of entries to show.
  2717. </p>
  2718. <p>Entries are specified according to the following
  2719. syntax. <var class="var">section_entries</var> contains a list of section entries
  2720. separated by <code class="code">:</code>. Each section entry is composed by a section
  2721. name (or unique name), optionally followed by a list of entries local
  2722. to that section, separated by <code class="code">,</code>.
  2723. </p>
  2724. <p>If section name is specified but is followed by no <code class="code">=</code>, all
  2725. entries are printed to output, together with all the contained
  2726. sections. Otherwise only the entries specified in the local section
  2727. entries list are printed. In particular, if <code class="code">=</code> is specified but
  2728. the list of local entries is empty, then no entries will be shown for
  2729. that section.
  2730. </p>
  2731. <p>Note that the order of specification of the local section entries is
  2732. not honored in the output, and the usual display order will be
  2733. retained.
  2734. </p>
  2735. <p>The formal syntax is given by:
  2736. </p><div class="example">
  2737. <pre class="example-preformatted"><var class="var">LOCAL_SECTION_ENTRIES</var> ::= <var class="var">SECTION_ENTRY_NAME</var>[,<var class="var">LOCAL_SECTION_ENTRIES</var>]
  2738. <var class="var">SECTION_ENTRY</var> ::= <var class="var">SECTION_NAME</var>[=[<var class="var">LOCAL_SECTION_ENTRIES</var>]]
  2739. <var class="var">SECTION_ENTRIES</var> ::= <var class="var">SECTION_ENTRY</var>[:<var class="var">SECTION_ENTRIES</var>]
  2740. </pre></div>
  2741. <p>For example, to show only the index and type of each stream, and the PTS
  2742. time, duration time, and stream index of the packets, you can specify
  2743. the argument:
  2744. </p><div class="example">
  2745. <pre class="example-preformatted">packet=pts_time,duration_time,stream_index : stream=index,codec_type
  2746. </pre></div>
  2747. <p>To show all the entries in the section &quot;format&quot;, but only the codec
  2748. type in the section &quot;stream&quot;, specify the argument:
  2749. </p><div class="example">
  2750. <pre class="example-preformatted">format : stream=codec_type
  2751. </pre></div>
  2752. <p>To show all the tags in the stream and format sections:
  2753. </p><div class="example">
  2754. <pre class="example-preformatted">stream_tags : format_tags
  2755. </pre></div>
  2756. <p>To show only the <code class="code">title</code> tag (if available) in the stream
  2757. sections:
  2758. </p><div class="example">
  2759. <pre class="example-preformatted">stream_tags=title
  2760. </pre></div>
  2761. </dd>
  2762. <dt><samp class="option">-show_packets</samp></dt>
  2763. <dd><p>Show information about each packet contained in the input multimedia
  2764. stream.
  2765. </p>
  2766. <p>The information for each single packet is printed within a dedicated
  2767. section with name &quot;PACKET&quot;.
  2768. </p>
  2769. </dd>
  2770. <dt><samp class="option">-show_frames</samp></dt>
  2771. <dd><p>Show information about each frame and subtitle contained in the input
  2772. multimedia stream.
  2773. </p>
  2774. <p>The information for each single frame is printed within a dedicated
  2775. section with name &quot;FRAME&quot; or &quot;SUBTITLE&quot;.
  2776. </p>
  2777. </dd>
  2778. <dt><samp class="option">-show_log <var class="var">loglevel</var></samp></dt>
  2779. <dd><p>Show logging information from the decoder about each frame according to
  2780. the value set in <var class="var">loglevel</var>, (see <code class="code">-loglevel</code>). This option requires <code class="code">-show_frames</code>.
  2781. </p>
  2782. <p>The information for each log message is printed within a dedicated
  2783. section with name &quot;LOG&quot;.
  2784. </p>
  2785. </dd>
  2786. <dt><samp class="option">-show_streams</samp></dt>
  2787. <dd><p>Show information about each media stream contained in the input
  2788. multimedia stream.
  2789. </p>
  2790. <p>Each media stream information is printed within a dedicated section
  2791. with name &quot;STREAM&quot;.
  2792. </p>
  2793. </dd>
  2794. <dt><samp class="option">-show_programs</samp></dt>
  2795. <dd><p>Show information about programs and their streams contained in the input
  2796. multimedia stream.
  2797. </p>
  2798. <p>Each media stream information is printed within a dedicated section
  2799. with name &quot;PROGRAM_STREAM&quot;.
  2800. </p>
  2801. </dd>
  2802. <dt><samp class="option">-show_stream_groups</samp></dt>
  2803. <dd><p>Show information about stream groups and their streams contained in the
  2804. input multimedia stream.
  2805. </p>
  2806. <p>Each media stream information is printed within a dedicated section
  2807. with name &quot;STREAM_GROUP_STREAM&quot;.
  2808. </p>
  2809. </dd>
  2810. <dt><samp class="option">-show_chapters</samp></dt>
  2811. <dd><p>Show information about chapters stored in the format.
  2812. </p>
  2813. <p>Each chapter is printed within a dedicated section with name &quot;CHAPTER&quot;.
  2814. </p>
  2815. </dd>
  2816. <dt><samp class="option">-count_frames</samp></dt>
  2817. <dd><p>Count the number of frames per stream and report it in the
  2818. corresponding stream section.
  2819. </p>
  2820. </dd>
  2821. <dt><samp class="option">-count_packets</samp></dt>
  2822. <dd><p>Count the number of packets per stream and report it in the
  2823. corresponding stream section.
  2824. </p>
  2825. </dd>
  2826. <dt><samp class="option">-read_intervals <var class="var">read_intervals</var></samp></dt>
  2827. <dd>
  2828. <p>Read only the specified intervals. <var class="var">read_intervals</var> must be a
  2829. sequence of interval specifications separated by &quot;,&quot;.
  2830. <code class="command">ffprobe</code> will seek to the interval starting point, and will
  2831. continue reading from that.
  2832. </p>
  2833. <p>Each interval is specified by two optional parts, separated by &quot;%&quot;.
  2834. </p>
  2835. <p>The first part specifies the interval start position. It is
  2836. interpreted as an absolute position, or as a relative offset from the
  2837. current position if it is preceded by the &quot;+&quot; character. If this first
  2838. part is not specified, no seeking will be performed when reading this
  2839. interval.
  2840. </p>
  2841. <p>The second part specifies the interval end position. It is interpreted
  2842. as an absolute position, or as a relative offset from the current
  2843. position if it is preceded by the &quot;+&quot; character. If the offset
  2844. specification starts with &quot;#&quot;, it is interpreted as the number of
  2845. packets to read (not including the flushing packets) from the interval
  2846. start. If no second part is specified, the program will read until the
  2847. end of the input.
  2848. </p>
  2849. <p>Note that seeking is not accurate, thus the actual interval start
  2850. point may be different from the specified position. Also, when an
  2851. interval duration is specified, the absolute end time will be computed
  2852. by adding the duration to the interval start point found by seeking
  2853. the file, rather than to the specified start value.
  2854. </p>
  2855. <p>The formal syntax is given by:
  2856. </p><div class="example">
  2857. <pre class="example-preformatted"><var class="var">INTERVAL</var> ::= [<var class="var">START</var>|+<var class="var">START_OFFSET</var>][%[<var class="var">END</var>|+<var class="var">END_OFFSET</var>]]
  2858. <var class="var">INTERVALS</var> ::= <var class="var">INTERVAL</var>[,<var class="var">INTERVALS</var>]
  2859. </pre></div>
  2860. <p>A few examples follow.
  2861. </p><ul class="itemize mark-bullet">
  2862. <li>Seek to time 10, read packets until 20 seconds after the found seek
  2863. point, then seek to position <code class="code">01:30</code> (1 minute and thirty
  2864. seconds) and read packets until position <code class="code">01:45</code>.
  2865. <div class="example">
  2866. <pre class="example-preformatted">10%+20,01:30%01:45
  2867. </pre></div>
  2868. </li><li>Read only 42 packets after seeking to position <code class="code">01:23</code>:
  2869. <div class="example">
  2870. <pre class="example-preformatted">01:23%+#42
  2871. </pre></div>
  2872. </li><li>Read only the first 20 seconds from the start:
  2873. <div class="example">
  2874. <pre class="example-preformatted">%+20
  2875. </pre></div>
  2876. </li><li>Read from the start until position <code class="code">02:30</code>:
  2877. <div class="example">
  2878. <pre class="example-preformatted">%02:30
  2879. </pre></div>
  2880. </li></ul>
  2881. </dd>
  2882. <dt><samp class="option">-show_private_data, -private</samp></dt>
  2883. <dd><p>Show private data, that is data depending on the format of the
  2884. particular shown element.
  2885. This option is enabled by default, but you may need to disable it
  2886. for specific uses, for example when creating XSD-compliant XML output.
  2887. </p>
  2888. </dd>
  2889. <dt><samp class="option">-show_program_version</samp></dt>
  2890. <dd><p>Show information related to program version.
  2891. </p>
  2892. <p>Version information is printed within a section with name
  2893. &quot;PROGRAM_VERSION&quot;.
  2894. </p>
  2895. </dd>
  2896. <dt><samp class="option">-show_library_versions</samp></dt>
  2897. <dd><p>Show information related to library versions.
  2898. </p>
  2899. <p>Version information for each library is printed within a section with
  2900. name &quot;LIBRARY_VERSION&quot;.
  2901. </p>
  2902. </dd>
  2903. <dt><samp class="option">-show_versions</samp></dt>
  2904. <dd><p>Show information related to program and library versions. This is the
  2905. equivalent of setting both <samp class="option">-show_program_version</samp> and
  2906. <samp class="option">-show_library_versions</samp> options.
  2907. </p>
  2908. </dd>
  2909. <dt><samp class="option">-show_pixel_formats</samp></dt>
  2910. <dd><p>Show information about all pixel formats supported by FFmpeg.
  2911. </p>
  2912. <p>Pixel format information for each format is printed within a section
  2913. with name &quot;PIXEL_FORMAT&quot;.
  2914. </p>
  2915. </dd>
  2916. <dt><samp class="option">-show_optional_fields <var class="var">value</var></samp></dt>
  2917. <dd><p>Some writers viz. JSON and XML, omit the printing of fields with invalid or non-applicable values,
  2918. while other writers always print them. This option enables one to control this behaviour.
  2919. Valid values are <code class="code">always</code>/<code class="code">1</code>, <code class="code">never</code>/<code class="code">0</code> and <code class="code">auto</code>/<code class="code">-1</code>.
  2920. Default is <var class="var">auto</var>.
  2921. </p>
  2922. </dd>
  2923. <dt><samp class="option">-analyze_frames</samp></dt>
  2924. <dd><p>Analyze frames and/or their side data up to the provided read interval,
  2925. providing additional information that may be useful at a stream level.
  2926. Must be paired with the <samp class="option">-show_streams</samp> option or it will have no effect.
  2927. </p>
  2928. <p>Currently, the additional fields provided by this option when enabled are the
  2929. <code class="code">closed_captions</code> and <code class="code">film_grain</code> fields.
  2930. </p>
  2931. <p>For example, to analyze the first 20 seconds and populate these fields:
  2932. </p><div class="example">
  2933. <pre class="example-preformatted">ffprobe -show_streams -analyze_frames -read_intervals &quot;%+20&quot; INPUT
  2934. </pre></div>
  2935. </dd>
  2936. <dt><samp class="option">-bitexact</samp></dt>
  2937. <dd><p>Force bitexact output, useful to produce output which is not dependent
  2938. on the specific build.
  2939. </p>
  2940. </dd>
  2941. <dt><samp class="option">-i <var class="var">input_url</var></samp></dt>
  2942. <dd><p>Read <var class="var">input_url</var>.
  2943. </p>
  2944. </dd>
  2945. <dt><samp class="option">-o <var class="var">output_url</var></samp></dt>
  2946. <dd><p>Write output to <var class="var">output_url</var>. If not specified, the output is sent
  2947. to stdout.
  2948. </p>
  2949. </dd>
  2950. <dt><samp class="option">-c:<var class="var">media_specifier</var> <var class="var">codec_name</var></samp></dt>
  2951. <dt><samp class="option">-codec:<var class="var">media_specifier</var> <var class="var">codec_name</var></samp></dt>
  2952. <dd><p>Force a specific decoder implementation for the stream identified by
  2953. <var class="var">media_specifier</var>, which can assume the values <code class="code">a</code> (audio),
  2954. <code class="code">v</code> (video), <code class="code">s</code> (subtitle), and <code class="code">d</code> (data).
  2955. </p>
  2956. </dd>
  2957. </dl>
  2958. <a name="Writers"></a>
  2959. <h2 class="chapter">4 Writers<span class="pull-right"><a class="anchor hidden-xs" href="#Writers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Writers" aria-hidden="true">TOC</a></span></h2>
  2960. <p>A writer defines the output format adopted by <code class="command">ffprobe</code>, and will be
  2961. used for printing all the parts of the output.
  2962. </p>
  2963. <p>A writer may accept one or more arguments, which specify the options
  2964. to adopt. The options are specified as a list of <var class="var">key</var>=<var class="var">value</var>
  2965. pairs, separated by &quot;:&quot;.
  2966. </p>
  2967. <p>All writers support the following options:
  2968. </p>
  2969. <dl class="table">
  2970. <dt><samp class="option">string_validation, sv</samp></dt>
  2971. <dd><p>Set string validation mode.
  2972. </p>
  2973. <p>The following values are accepted.
  2974. </p><dl class="table">
  2975. <dt>&lsquo;<samp class="samp">fail</samp>&rsquo;</dt>
  2976. <dd><p>The writer will fail immediately in case an invalid string (UTF-8)
  2977. sequence or code point is found in the input. This is especially
  2978. useful to validate input metadata.
  2979. </p>
  2980. </dd>
  2981. <dt>&lsquo;<samp class="samp">ignore</samp>&rsquo;</dt>
  2982. <dd><p>Any validation error will be ignored. This will result in possibly
  2983. broken output, especially with the json or xml writer.
  2984. </p>
  2985. </dd>
  2986. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  2987. <dd><p>The writer will substitute invalid UTF-8 sequences or code points with
  2988. the string specified with the <samp class="option">string_validation_replacement</samp>.
  2989. </p></dd>
  2990. </dl>
  2991. <p>Default value is &lsquo;<samp class="samp">replace</samp>&rsquo;.
  2992. </p>
  2993. </dd>
  2994. <dt><samp class="option">string_validation_replacement, svr</samp></dt>
  2995. <dd><p>Set replacement string to use in case <samp class="option">string_validation</samp> is
  2996. set to &lsquo;<samp class="samp">replace</samp>&rsquo;.
  2997. </p>
  2998. <p>In case the option is not specified, the writer will assume the empty
  2999. string, that is it will remove the invalid sequences from the input
  3000. strings.
  3001. </p></dd>
  3002. </dl>
  3003. <p>A description of the currently available writers follows.
  3004. </p>
  3005. <a name="default"></a>
  3006. <h3 class="section">4.1 default<span class="pull-right"><a class="anchor hidden-xs" href="#default" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-default" aria-hidden="true">TOC</a></span></h3>
  3007. <p>Default format.
  3008. </p>
  3009. <p>Print each section in the form:
  3010. </p><div class="example">
  3011. <pre class="example-preformatted">[SECTION]
  3012. key1=val1
  3013. ...
  3014. keyN=valN
  3015. [/SECTION]
  3016. </pre></div>
  3017. <p>Metadata tags are printed as a line in the corresponding FORMAT, STREAM,
  3018. STREAM_GROUP_STREAM or PROGRAM_STREAM section, and are prefixed by the
  3019. string &quot;TAG:&quot;.
  3020. </p>
  3021. <p>A description of the accepted options follows.
  3022. </p>
  3023. <dl class="table">
  3024. <dt><samp class="option">nokey, nk</samp></dt>
  3025. <dd><p>If set to 1 specify not to print the key of each field. Default value
  3026. is 0.
  3027. </p>
  3028. </dd>
  3029. <dt><samp class="option">noprint_wrappers, nw</samp></dt>
  3030. <dd><p>If set to 1 specify not to print the section header and footer.
  3031. Default value is 0.
  3032. </p></dd>
  3033. </dl>
  3034. <a name="compact_002c-csv"></a>
  3035. <h3 class="section">4.2 compact, csv<span class="pull-right"><a class="anchor hidden-xs" href="#compact_002c-csv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-compact_002c-csv" aria-hidden="true">TOC</a></span></h3>
  3036. <p>Compact and CSV format.
  3037. </p>
  3038. <p>The <code class="code">csv</code> writer is equivalent to <code class="code">compact</code>, but supports
  3039. different defaults.
  3040. </p>
  3041. <p>Each section is printed on a single line.
  3042. If no option is specified, the output has the form:
  3043. </p><div class="example">
  3044. <pre class="example-preformatted">section|key1=val1| ... |keyN=valN
  3045. </pre></div>
  3046. <p>Metadata tags are printed in the corresponding &quot;format&quot; or &quot;stream&quot;
  3047. section. A metadata tag key, if printed, is prefixed by the string
  3048. &quot;tag:&quot;.
  3049. </p>
  3050. <p>The description of the accepted options follows.
  3051. </p>
  3052. <dl class="table">
  3053. <dt><samp class="option">item_sep, s</samp></dt>
  3054. <dd><p>Specify the character to use for separating fields in the output line.
  3055. It must be a single printable character, it is &quot;|&quot; by default (&quot;,&quot; for
  3056. the <code class="code">csv</code> writer).
  3057. </p>
  3058. </dd>
  3059. <dt><samp class="option">nokey, nk</samp></dt>
  3060. <dd><p>If set to 1 specify not to print the key of each field. Its default
  3061. value is 0 (1 for the <code class="code">csv</code> writer).
  3062. </p>
  3063. </dd>
  3064. <dt><samp class="option">escape, e</samp></dt>
  3065. <dd><p>Set the escape mode to use, default to &quot;c&quot; (&quot;csv&quot; for the <code class="code">csv</code>
  3066. writer).
  3067. </p>
  3068. <p>It can assume one of the following values:
  3069. </p><dl class="table">
  3070. <dt><samp class="option">c</samp></dt>
  3071. <dd><p>Perform C-like escaping. Strings containing a newline (&lsquo;<samp class="samp">\n</samp>&rsquo;), carriage
  3072. return (&lsquo;<samp class="samp">\r</samp>&rsquo;), a tab (&lsquo;<samp class="samp">\t</samp>&rsquo;), a form feed (&lsquo;<samp class="samp">\f</samp>&rsquo;), the escaping
  3073. character (&lsquo;<samp class="samp">\</samp>&rsquo;) or the item separator character <var class="var">SEP</var> are escaped
  3074. using C-like fashioned escaping, so that a newline is converted to the
  3075. sequence &lsquo;<samp class="samp">\n</samp>&rsquo;, a carriage return to &lsquo;<samp class="samp">\r</samp>&rsquo;, &lsquo;<samp class="samp">\</samp>&rsquo; to &lsquo;<samp class="samp">\\</samp>&rsquo; and
  3076. the separator <var class="var">SEP</var> is converted to &lsquo;<samp class="samp">\<var class="var">SEP</var></samp>&rsquo;.
  3077. </p>
  3078. </dd>
  3079. <dt><samp class="option">csv</samp></dt>
  3080. <dd><p>Perform CSV-like escaping, as described in RFC4180. Strings
  3081. containing a newline (&lsquo;<samp class="samp">\n</samp>&rsquo;), a carriage return (&lsquo;<samp class="samp">\r</samp>&rsquo;), a double quote
  3082. (&lsquo;<samp class="samp">&quot;</samp>&rsquo;), or <var class="var">SEP</var> are enclosed in double-quotes.
  3083. </p>
  3084. </dd>
  3085. <dt><samp class="option">none</samp></dt>
  3086. <dd><p>Perform no escaping.
  3087. </p></dd>
  3088. </dl>
  3089. </dd>
  3090. <dt><samp class="option">print_section, p</samp></dt>
  3091. <dd><p>Print the section name at the beginning of each line if the value is
  3092. <code class="code">1</code>, disable it with value set to <code class="code">0</code>. Default value is
  3093. <code class="code">1</code>.
  3094. </p>
  3095. </dd>
  3096. </dl>
  3097. <a name="flat"></a>
  3098. <h3 class="section">4.3 flat<span class="pull-right"><a class="anchor hidden-xs" href="#flat" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flat" aria-hidden="true">TOC</a></span></h3>
  3099. <p>Flat format.
  3100. </p>
  3101. <p>A free-form output where each line contains an explicit key=value, such as
  3102. &quot;streams.stream.3.tags.foo=bar&quot;. The output is shell escaped, so it can be
  3103. directly embedded in sh scripts as long as the separator character is an
  3104. alphanumeric character or an underscore (see <var class="var">sep_char</var> option).
  3105. </p>
  3106. <p>The description of the accepted options follows.
  3107. </p>
  3108. <dl class="table">
  3109. <dt><samp class="option">sep_char, s</samp></dt>
  3110. <dd><p>Separator character used to separate the chapter, the section name, IDs and
  3111. potential tags in the printed field key.
  3112. </p>
  3113. <p>Default value is &lsquo;<samp class="samp">.</samp>&rsquo;.
  3114. </p>
  3115. </dd>
  3116. <dt><samp class="option">hierarchical, h</samp></dt>
  3117. <dd><p>Specify if the section name specification should be hierarchical. If
  3118. set to 1, and if there is more than one section in the current
  3119. chapter, the section name will be prefixed by the name of the
  3120. chapter. A value of 0 will disable this behavior.
  3121. </p>
  3122. <p>Default value is 1.
  3123. </p></dd>
  3124. </dl>
  3125. <a name="ini"></a>
  3126. <h3 class="section">4.4 ini<span class="pull-right"><a class="anchor hidden-xs" href="#ini" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ini" aria-hidden="true">TOC</a></span></h3>
  3127. <p>INI format output.
  3128. </p>
  3129. <p>Print output in an INI based format.
  3130. </p>
  3131. <p>The following conventions are adopted:
  3132. </p>
  3133. <ul class="itemize mark-bullet">
  3134. <li>all key and values are UTF-8
  3135. </li><li>&lsquo;<samp class="samp">.</samp>&rsquo; is the subgroup separator
  3136. </li><li>newline, &lsquo;<samp class="samp">\t</samp>&rsquo;, &lsquo;<samp class="samp">\f</samp>&rsquo;, &lsquo;<samp class="samp">\b</samp>&rsquo; and the following characters are
  3137. escaped
  3138. </li><li>&lsquo;<samp class="samp">\</samp>&rsquo; is the escape character
  3139. </li><li>&lsquo;<samp class="samp">#</samp>&rsquo; is the comment indicator
  3140. </li><li>&lsquo;<samp class="samp">=</samp>&rsquo; is the key/value separator
  3141. </li><li>&lsquo;<samp class="samp">:</samp>&rsquo; is not used but usually parsed as key/value separator
  3142. </li></ul>
  3143. <p>This writer accepts options as a list of <var class="var">key</var>=<var class="var">value</var> pairs,
  3144. separated by &lsquo;<samp class="samp">:</samp>&rsquo;.
  3145. </p>
  3146. <p>The description of the accepted options follows.
  3147. </p>
  3148. <dl class="table">
  3149. <dt><samp class="option">hierarchical, h</samp></dt>
  3150. <dd><p>Specify if the section name specification should be hierarchical. If
  3151. set to 1, and if there is more than one section in the current
  3152. chapter, the section name will be prefixed by the name of the
  3153. chapter. A value of 0 will disable this behavior.
  3154. </p>
  3155. <p>Default value is 1.
  3156. </p></dd>
  3157. </dl>
  3158. <a name="json"></a>
  3159. <h3 class="section">4.5 json<span class="pull-right"><a class="anchor hidden-xs" href="#json" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-json" aria-hidden="true">TOC</a></span></h3>
  3160. <p>JSON based format.
  3161. </p>
  3162. <p>Each section is printed using JSON notation.
  3163. </p>
  3164. <p>The description of the accepted options follows.
  3165. </p>
  3166. <dl class="table">
  3167. <dt><samp class="option">compact, c</samp></dt>
  3168. <dd><p>If set to 1 enable compact output, that is each section will be
  3169. printed on a single line. Default value is 0.
  3170. </p></dd>
  3171. </dl>
  3172. <p>For more information about JSON, see <a class="url" href="http://www.json.org/">http://www.json.org/</a>.
  3173. </p>
  3174. <a name="xml"></a>
  3175. <h3 class="section">4.6 xml<span class="pull-right"><a class="anchor hidden-xs" href="#xml" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xml" aria-hidden="true">TOC</a></span></h3>
  3176. <p>XML based format.
  3177. </p>
  3178. <p>The XML output is described in the XML schema description file
  3179. <samp class="file">ffprobe.xsd</samp> installed in the FFmpeg datadir.
  3180. </p>
  3181. <p>An updated version of the schema can be retrieved at the url
  3182. <a class="url" href="http://www.ffmpeg.org/schema/ffprobe.xsd">http://www.ffmpeg.org/schema/ffprobe.xsd</a>, which redirects to the
  3183. latest schema committed into the FFmpeg development source code tree.
  3184. </p>
  3185. <p>Note that the output issued will be compliant to the
  3186. <samp class="file">ffprobe.xsd</samp> schema only when no special global output options
  3187. (<samp class="option">unit</samp>, <samp class="option">prefix</samp>, <samp class="option">byte_binary_prefix</samp>,
  3188. <samp class="option">sexagesimal</samp> etc.) are specified.
  3189. </p>
  3190. <p>The description of the accepted options follows.
  3191. </p>
  3192. <dl class="table">
  3193. <dt><samp class="option">fully_qualified, q</samp></dt>
  3194. <dd><p>If set to 1 specify if the output should be fully qualified. Default
  3195. value is 0.
  3196. This is required for generating an XML file which can be validated
  3197. through an XSD file.
  3198. </p>
  3199. </dd>
  3200. <dt><samp class="option">xsd_strict, x</samp></dt>
  3201. <dd><p>If set to 1 perform more checks for ensuring that the output is XSD
  3202. compliant. Default value is 0.
  3203. This option automatically sets <samp class="option">fully_qualified</samp> to 1.
  3204. </p></dd>
  3205. </dl>
  3206. <p>For more information about the XML format, see
  3207. <a class="url" href="https://www.w3.org/XML/">https://www.w3.org/XML/</a>.
  3208. </p>
  3209. <a name="Timecode"></a>
  3210. <h2 class="chapter">5 Timecode<span class="pull-right"><a class="anchor hidden-xs" href="#Timecode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Timecode" aria-hidden="true">TOC</a></span></h2>
  3211. <p><code class="command">ffprobe</code> supports Timecode extraction:
  3212. </p>
  3213. <ul class="itemize mark-bullet">
  3214. <li>MPEG1/2 timecode is extracted from the GOP, and is available in the video
  3215. stream details (<samp class="option">-show_streams</samp>, see <var class="var">timecode</var>).
  3216. </li><li>MOV timecode is extracted from tmcd track, so is available in the tmcd
  3217. stream metadata (<samp class="option">-show_streams</samp>, see <var class="var">TAG:timecode</var>).
  3218. </li><li>DV, GXF and AVI timecodes are available in format metadata
  3219. (<samp class="option">-show_format</samp>, see <var class="var">TAG:timecode</var>).
  3220. </li></ul>
  3221. <a name="Syntax"></a>
  3222. <h2 class="chapter">6 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax" aria-hidden="true">TOC</a></span></h2>
  3223. <p>This section documents the syntax and formats employed by the FFmpeg
  3224. libraries and tools.
  3225. </p>
  3226. <a class="anchor" id="quoting_005fand_005fescaping"></a><a name="Quoting-and-escaping"></a>
  3227. <h3 class="section">6.1 Quoting and escaping<span class="pull-right"><a class="anchor hidden-xs" href="#Quoting-and-escaping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Quoting-and-escaping" aria-hidden="true">TOC</a></span></h3>
  3228. <p>FFmpeg adopts the following quoting and escaping mechanism, unless
  3229. explicitly specified. The following rules are applied:
  3230. </p>
  3231. <ul class="itemize mark-bullet">
  3232. <li>&lsquo;<samp class="samp">'</samp>&rsquo; and &lsquo;<samp class="samp">\</samp>&rsquo; are special characters (respectively used for
  3233. quoting and escaping). In addition to them, there might be other
  3234. special characters depending on the specific syntax where the escaping
  3235. and quoting are employed.
  3236. </li><li>A special character is escaped by prefixing it with a &lsquo;<samp class="samp">\</samp>&rsquo;.
  3237. </li><li>All characters enclosed between &lsquo;<samp class="samp">''</samp>&rsquo; are included literally in the
  3238. parsed string. The quote character &lsquo;<samp class="samp">'</samp>&rsquo; itself cannot be quoted,
  3239. so you may need to close the quote and escape it.
  3240. </li><li>Leading and trailing whitespaces, unless escaped or quoted, are
  3241. removed from the parsed string.
  3242. </li></ul>
  3243. <p>Note that you may need to add a second level of escaping when using
  3244. the command line or a script, which depends on the syntax of the
  3245. adopted shell language.
  3246. </p>
  3247. <p>The function <code class="code">av_get_token</code> defined in
  3248. <samp class="file">libavutil/avstring.h</samp> can be used to parse a token quoted or
  3249. escaped according to the rules defined above.
  3250. </p>
  3251. <p>The tool <samp class="file">tools/ffescape</samp> in the FFmpeg source tree can be used
  3252. to automatically quote or escape a string in a script.
  3253. </p>
  3254. <a name="Examples"></a>
  3255. <h4 class="subsection">6.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples" aria-hidden="true">TOC</a></span></h4>
  3256. <ul class="itemize mark-bullet">
  3257. <li>Escape the string <code class="code">Crime d'Amour</code> containing the <code class="code">'</code> special
  3258. character:
  3259. <div class="example">
  3260. <pre class="example-preformatted">Crime d\'Amour
  3261. </pre></div>
  3262. </li><li>The string above contains a quote, so the <code class="code">'</code> needs to be escaped
  3263. when quoting it:
  3264. <div class="example">
  3265. <pre class="example-preformatted">'Crime d'\''Amour'
  3266. </pre></div>
  3267. </li><li>Include leading or trailing whitespaces using quoting:
  3268. <div class="example">
  3269. <pre class="example-preformatted">' this string starts and ends with whitespaces '
  3270. </pre></div>
  3271. </li><li>Escaping and quoting can be mixed together:
  3272. <div class="example">
  3273. <pre class="example-preformatted">' The string '\'string\'' is a string '
  3274. </pre></div>
  3275. </li><li>To include a literal &lsquo;<samp class="samp">\</samp>&rsquo; you can use either escaping or quoting:
  3276. <div class="example">
  3277. <pre class="example-preformatted">'c:\foo' can be written as c:\\foo
  3278. </pre></div>
  3279. </li></ul>
  3280. <a class="anchor" id="date-syntax"></a><a name="Date"></a>
  3281. <h3 class="section">6.2 Date<span class="pull-right"><a class="anchor hidden-xs" href="#Date" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Date" aria-hidden="true">TOC</a></span></h3>
  3282. <p>The accepted syntax is:
  3283. </p><div class="example">
  3284. <pre class="example-preformatted">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
  3285. now
  3286. </pre></div>
  3287. <p>If the value is &quot;now&quot; it takes the current time.
  3288. </p>
  3289. <p>Time is local time unless Z is appended, in which case it is
  3290. interpreted as UTC.
  3291. If the year-month-day part is not specified it takes the current
  3292. year-month-day.
  3293. </p>
  3294. <a class="anchor" id="time-duration-syntax"></a><a name="Time-duration"></a>
  3295. <h3 class="section">6.3 Time duration<span class="pull-right"><a class="anchor hidden-xs" href="#Time-duration" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Time-duration" aria-hidden="true">TOC</a></span></h3>
  3296. <p>There are two accepted syntaxes for expressing time duration.
  3297. </p>
  3298. <div class="example">
  3299. <pre class="example-preformatted">[-][<var class="var">HH</var>:]<var class="var">MM</var>:<var class="var">SS</var>[.<var class="var">m</var>...]
  3300. </pre></div>
  3301. <p><var class="var">HH</var> expresses the number of hours, <var class="var">MM</var> the number of minutes
  3302. for a maximum of 2 digits, and <var class="var">SS</var> the number of seconds for a
  3303. maximum of 2 digits. The <var class="var">m</var> at the end expresses decimal value for
  3304. <var class="var">SS</var>.
  3305. </p>
  3306. <p><em class="emph">or</em>
  3307. </p>
  3308. <div class="example">
  3309. <pre class="example-preformatted">[-]<var class="var">S</var>+[.<var class="var">m</var>...][s|ms|us]
  3310. </pre></div>
  3311. <p><var class="var">S</var> expresses the number of seconds, with the optional decimal part
  3312. <var class="var">m</var>. The optional literal suffixes &lsquo;<samp class="samp">s</samp>&rsquo;, &lsquo;<samp class="samp">ms</samp>&rsquo; or &lsquo;<samp class="samp">us</samp>&rsquo;
  3313. indicate to interpret the value as seconds, milliseconds or microseconds,
  3314. respectively.
  3315. </p>
  3316. <p>In both expressions, the optional &lsquo;<samp class="samp">-</samp>&rsquo; indicates negative duration.
  3317. </p>
  3318. <a name="Examples-1"></a>
  3319. <h4 class="subsection">6.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-1" aria-hidden="true">TOC</a></span></h4>
  3320. <p>The following examples are all valid time duration:
  3321. </p>
  3322. <dl class="table">
  3323. <dt>&lsquo;<samp class="samp">55</samp>&rsquo;</dt>
  3324. <dd><p>55 seconds
  3325. </p>
  3326. </dd>
  3327. <dt>&lsquo;<samp class="samp">0.2</samp>&rsquo;</dt>
  3328. <dd><p>0.2 seconds
  3329. </p>
  3330. </dd>
  3331. <dt>&lsquo;<samp class="samp">200ms</samp>&rsquo;</dt>
  3332. <dd><p>200 milliseconds, that&rsquo;s 0.2s
  3333. </p>
  3334. </dd>
  3335. <dt>&lsquo;<samp class="samp">200000us</samp>&rsquo;</dt>
  3336. <dd><p>200000 microseconds, that&rsquo;s 0.2s
  3337. </p>
  3338. </dd>
  3339. <dt>&lsquo;<samp class="samp">12:03:45</samp>&rsquo;</dt>
  3340. <dd><p>12 hours, 03 minutes and 45 seconds
  3341. </p>
  3342. </dd>
  3343. <dt>&lsquo;<samp class="samp">23.189</samp>&rsquo;</dt>
  3344. <dd><p>23.189 seconds
  3345. </p></dd>
  3346. </dl>
  3347. <a class="anchor" id="video-size-syntax"></a><a name="Video-size"></a>
  3348. <h3 class="section">6.4 Video size<span class="pull-right"><a class="anchor hidden-xs" href="#Video-size" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-size" aria-hidden="true">TOC</a></span></h3>
  3349. <p>Specify the size of the sourced video, it may be a string of the form
  3350. <var class="var">width</var>x<var class="var">height</var>, or the name of a size abbreviation.
  3351. </p>
  3352. <p>The following abbreviations are recognized:
  3353. </p><dl class="table">
  3354. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  3355. <dd><p>720x480
  3356. </p></dd>
  3357. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  3358. <dd><p>720x576
  3359. </p></dd>
  3360. <dt>&lsquo;<samp class="samp">qntsc</samp>&rsquo;</dt>
  3361. <dd><p>352x240
  3362. </p></dd>
  3363. <dt>&lsquo;<samp class="samp">qpal</samp>&rsquo;</dt>
  3364. <dd><p>352x288
  3365. </p></dd>
  3366. <dt>&lsquo;<samp class="samp">sntsc</samp>&rsquo;</dt>
  3367. <dd><p>640x480
  3368. </p></dd>
  3369. <dt>&lsquo;<samp class="samp">spal</samp>&rsquo;</dt>
  3370. <dd><p>768x576
  3371. </p></dd>
  3372. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  3373. <dd><p>352x240
  3374. </p></dd>
  3375. <dt>&lsquo;<samp class="samp">ntsc-film</samp>&rsquo;</dt>
  3376. <dd><p>352x240
  3377. </p></dd>
  3378. <dt>&lsquo;<samp class="samp">sqcif</samp>&rsquo;</dt>
  3379. <dd><p>128x96
  3380. </p></dd>
  3381. <dt>&lsquo;<samp class="samp">qcif</samp>&rsquo;</dt>
  3382. <dd><p>176x144
  3383. </p></dd>
  3384. <dt>&lsquo;<samp class="samp">cif</samp>&rsquo;</dt>
  3385. <dd><p>352x288
  3386. </p></dd>
  3387. <dt>&lsquo;<samp class="samp">4cif</samp>&rsquo;</dt>
  3388. <dd><p>704x576
  3389. </p></dd>
  3390. <dt>&lsquo;<samp class="samp">16cif</samp>&rsquo;</dt>
  3391. <dd><p>1408x1152
  3392. </p></dd>
  3393. <dt>&lsquo;<samp class="samp">qqvga</samp>&rsquo;</dt>
  3394. <dd><p>160x120
  3395. </p></dd>
  3396. <dt>&lsquo;<samp class="samp">qvga</samp>&rsquo;</dt>
  3397. <dd><p>320x240
  3398. </p></dd>
  3399. <dt>&lsquo;<samp class="samp">vga</samp>&rsquo;</dt>
  3400. <dd><p>640x480
  3401. </p></dd>
  3402. <dt>&lsquo;<samp class="samp">svga</samp>&rsquo;</dt>
  3403. <dd><p>800x600
  3404. </p></dd>
  3405. <dt>&lsquo;<samp class="samp">xga</samp>&rsquo;</dt>
  3406. <dd><p>1024x768
  3407. </p></dd>
  3408. <dt>&lsquo;<samp class="samp">uxga</samp>&rsquo;</dt>
  3409. <dd><p>1600x1200
  3410. </p></dd>
  3411. <dt>&lsquo;<samp class="samp">qxga</samp>&rsquo;</dt>
  3412. <dd><p>2048x1536
  3413. </p></dd>
  3414. <dt>&lsquo;<samp class="samp">sxga</samp>&rsquo;</dt>
  3415. <dd><p>1280x1024
  3416. </p></dd>
  3417. <dt>&lsquo;<samp class="samp">qsxga</samp>&rsquo;</dt>
  3418. <dd><p>2560x2048
  3419. </p></dd>
  3420. <dt>&lsquo;<samp class="samp">hsxga</samp>&rsquo;</dt>
  3421. <dd><p>5120x4096
  3422. </p></dd>
  3423. <dt>&lsquo;<samp class="samp">wvga</samp>&rsquo;</dt>
  3424. <dd><p>852x480
  3425. </p></dd>
  3426. <dt>&lsquo;<samp class="samp">wxga</samp>&rsquo;</dt>
  3427. <dd><p>1366x768
  3428. </p></dd>
  3429. <dt>&lsquo;<samp class="samp">wsxga</samp>&rsquo;</dt>
  3430. <dd><p>1600x1024
  3431. </p></dd>
  3432. <dt>&lsquo;<samp class="samp">wuxga</samp>&rsquo;</dt>
  3433. <dd><p>1920x1200
  3434. </p></dd>
  3435. <dt>&lsquo;<samp class="samp">woxga</samp>&rsquo;</dt>
  3436. <dd><p>2560x1600
  3437. </p></dd>
  3438. <dt>&lsquo;<samp class="samp">wqsxga</samp>&rsquo;</dt>
  3439. <dd><p>3200x2048
  3440. </p></dd>
  3441. <dt>&lsquo;<samp class="samp">wquxga</samp>&rsquo;</dt>
  3442. <dd><p>3840x2400
  3443. </p></dd>
  3444. <dt>&lsquo;<samp class="samp">whsxga</samp>&rsquo;</dt>
  3445. <dd><p>6400x4096
  3446. </p></dd>
  3447. <dt>&lsquo;<samp class="samp">whuxga</samp>&rsquo;</dt>
  3448. <dd><p>7680x4800
  3449. </p></dd>
  3450. <dt>&lsquo;<samp class="samp">cga</samp>&rsquo;</dt>
  3451. <dd><p>320x200
  3452. </p></dd>
  3453. <dt>&lsquo;<samp class="samp">ega</samp>&rsquo;</dt>
  3454. <dd><p>640x350
  3455. </p></dd>
  3456. <dt>&lsquo;<samp class="samp">hd480</samp>&rsquo;</dt>
  3457. <dd><p>852x480
  3458. </p></dd>
  3459. <dt>&lsquo;<samp class="samp">hd720</samp>&rsquo;</dt>
  3460. <dd><p>1280x720
  3461. </p></dd>
  3462. <dt>&lsquo;<samp class="samp">hd1080</samp>&rsquo;</dt>
  3463. <dd><p>1920x1080
  3464. </p></dd>
  3465. <dt>&lsquo;<samp class="samp">2k</samp>&rsquo;</dt>
  3466. <dd><p>2048x1080
  3467. </p></dd>
  3468. <dt>&lsquo;<samp class="samp">2kflat</samp>&rsquo;</dt>
  3469. <dd><p>1998x1080
  3470. </p></dd>
  3471. <dt>&lsquo;<samp class="samp">2kscope</samp>&rsquo;</dt>
  3472. <dd><p>2048x858
  3473. </p></dd>
  3474. <dt>&lsquo;<samp class="samp">4k</samp>&rsquo;</dt>
  3475. <dd><p>4096x2160
  3476. </p></dd>
  3477. <dt>&lsquo;<samp class="samp">4kflat</samp>&rsquo;</dt>
  3478. <dd><p>3996x2160
  3479. </p></dd>
  3480. <dt>&lsquo;<samp class="samp">4kscope</samp>&rsquo;</dt>
  3481. <dd><p>4096x1716
  3482. </p></dd>
  3483. <dt>&lsquo;<samp class="samp">nhd</samp>&rsquo;</dt>
  3484. <dd><p>640x360
  3485. </p></dd>
  3486. <dt>&lsquo;<samp class="samp">hqvga</samp>&rsquo;</dt>
  3487. <dd><p>240x160
  3488. </p></dd>
  3489. <dt>&lsquo;<samp class="samp">wqvga</samp>&rsquo;</dt>
  3490. <dd><p>400x240
  3491. </p></dd>
  3492. <dt>&lsquo;<samp class="samp">fwqvga</samp>&rsquo;</dt>
  3493. <dd><p>432x240
  3494. </p></dd>
  3495. <dt>&lsquo;<samp class="samp">hvga</samp>&rsquo;</dt>
  3496. <dd><p>480x320
  3497. </p></dd>
  3498. <dt>&lsquo;<samp class="samp">qhd</samp>&rsquo;</dt>
  3499. <dd><p>960x540
  3500. </p></dd>
  3501. <dt>&lsquo;<samp class="samp">2kdci</samp>&rsquo;</dt>
  3502. <dd><p>2048x1080
  3503. </p></dd>
  3504. <dt>&lsquo;<samp class="samp">4kdci</samp>&rsquo;</dt>
  3505. <dd><p>4096x2160
  3506. </p></dd>
  3507. <dt>&lsquo;<samp class="samp">uhd2160</samp>&rsquo;</dt>
  3508. <dd><p>3840x2160
  3509. </p></dd>
  3510. <dt>&lsquo;<samp class="samp">uhd4320</samp>&rsquo;</dt>
  3511. <dd><p>7680x4320
  3512. </p></dd>
  3513. </dl>
  3514. <a class="anchor" id="video-rate-syntax"></a><a name="Video-rate"></a>
  3515. <h3 class="section">6.5 Video rate<span class="pull-right"><a class="anchor hidden-xs" href="#Video-rate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-rate" aria-hidden="true">TOC</a></span></h3>
  3516. <p>Specify the frame rate of a video, expressed as the number of frames
  3517. generated per second. It has to be a string in the format
  3518. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a float
  3519. number or a valid video frame rate abbreviation.
  3520. </p>
  3521. <p>The following abbreviations are recognized:
  3522. </p><dl class="table">
  3523. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  3524. <dd><p>30000/1001
  3525. </p></dd>
  3526. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  3527. <dd><p>25/1
  3528. </p></dd>
  3529. <dt>&lsquo;<samp class="samp">qntsc</samp>&rsquo;</dt>
  3530. <dd><p>30000/1001
  3531. </p></dd>
  3532. <dt>&lsquo;<samp class="samp">qpal</samp>&rsquo;</dt>
  3533. <dd><p>25/1
  3534. </p></dd>
  3535. <dt>&lsquo;<samp class="samp">sntsc</samp>&rsquo;</dt>
  3536. <dd><p>30000/1001
  3537. </p></dd>
  3538. <dt>&lsquo;<samp class="samp">spal</samp>&rsquo;</dt>
  3539. <dd><p>25/1
  3540. </p></dd>
  3541. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  3542. <dd><p>24/1
  3543. </p></dd>
  3544. <dt>&lsquo;<samp class="samp">ntsc-film</samp>&rsquo;</dt>
  3545. <dd><p>24000/1001
  3546. </p></dd>
  3547. </dl>
  3548. <a class="anchor" id="ratio-syntax"></a><a name="Ratio"></a>
  3549. <h3 class="section">6.6 Ratio<span class="pull-right"><a class="anchor hidden-xs" href="#Ratio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Ratio" aria-hidden="true">TOC</a></span></h3>
  3550. <p>A ratio can be expressed as an expression, or in the form
  3551. <var class="var">numerator</var>:<var class="var">denominator</var>.
  3552. </p>
  3553. <p>Note that a ratio with infinite (1/0) or negative value is
  3554. considered valid, so you should check on the returned value if you
  3555. want to exclude those values.
  3556. </p>
  3557. <p>The undefined value can be expressed using the &quot;0:0&quot; string.
  3558. </p>
  3559. <a class="anchor" id="color-syntax"></a><a name="Color"></a>
  3560. <h3 class="section">6.7 Color<span class="pull-right"><a class="anchor hidden-xs" href="#Color" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Color" aria-hidden="true">TOC</a></span></h3>
  3561. <p>It can be the name of a color as defined below (case insensitive match) or a
  3562. <code class="code">[0x|#]RRGGBB[AA]</code> sequence, possibly followed by @ and a string
  3563. representing the alpha component.
  3564. </p>
  3565. <p>The alpha component may be a string composed by &quot;0x&quot; followed by an
  3566. hexadecimal number or a decimal number between 0.0 and 1.0, which
  3567. represents the opacity value (&lsquo;<samp class="samp">0x00</samp>&rsquo; or &lsquo;<samp class="samp">0.0</samp>&rsquo; means completely
  3568. transparent, &lsquo;<samp class="samp">0xff</samp>&rsquo; or &lsquo;<samp class="samp">1.0</samp>&rsquo; completely opaque). If the alpha
  3569. component is not specified then &lsquo;<samp class="samp">0xff</samp>&rsquo; is assumed.
  3570. </p>
  3571. <p>The string &lsquo;<samp class="samp">random</samp>&rsquo; will result in a random color.
  3572. </p>
  3573. <p>The following names of colors are recognized:
  3574. </p><dl class="table">
  3575. <dt>&lsquo;<samp class="samp">AliceBlue</samp>&rsquo;</dt>
  3576. <dd><p>0xF0F8FF
  3577. </p></dd>
  3578. <dt>&lsquo;<samp class="samp">AntiqueWhite</samp>&rsquo;</dt>
  3579. <dd><p>0xFAEBD7
  3580. </p></dd>
  3581. <dt>&lsquo;<samp class="samp">Aqua</samp>&rsquo;</dt>
  3582. <dd><p>0x00FFFF
  3583. </p></dd>
  3584. <dt>&lsquo;<samp class="samp">Aquamarine</samp>&rsquo;</dt>
  3585. <dd><p>0x7FFFD4
  3586. </p></dd>
  3587. <dt>&lsquo;<samp class="samp">Azure</samp>&rsquo;</dt>
  3588. <dd><p>0xF0FFFF
  3589. </p></dd>
  3590. <dt>&lsquo;<samp class="samp">Beige</samp>&rsquo;</dt>
  3591. <dd><p>0xF5F5DC
  3592. </p></dd>
  3593. <dt>&lsquo;<samp class="samp">Bisque</samp>&rsquo;</dt>
  3594. <dd><p>0xFFE4C4
  3595. </p></dd>
  3596. <dt>&lsquo;<samp class="samp">Black</samp>&rsquo;</dt>
  3597. <dd><p>0x000000
  3598. </p></dd>
  3599. <dt>&lsquo;<samp class="samp">BlanchedAlmond</samp>&rsquo;</dt>
  3600. <dd><p>0xFFEBCD
  3601. </p></dd>
  3602. <dt>&lsquo;<samp class="samp">Blue</samp>&rsquo;</dt>
  3603. <dd><p>0x0000FF
  3604. </p></dd>
  3605. <dt>&lsquo;<samp class="samp">BlueViolet</samp>&rsquo;</dt>
  3606. <dd><p>0x8A2BE2
  3607. </p></dd>
  3608. <dt>&lsquo;<samp class="samp">Brown</samp>&rsquo;</dt>
  3609. <dd><p>0xA52A2A
  3610. </p></dd>
  3611. <dt>&lsquo;<samp class="samp">BurlyWood</samp>&rsquo;</dt>
  3612. <dd><p>0xDEB887
  3613. </p></dd>
  3614. <dt>&lsquo;<samp class="samp">CadetBlue</samp>&rsquo;</dt>
  3615. <dd><p>0x5F9EA0
  3616. </p></dd>
  3617. <dt>&lsquo;<samp class="samp">Chartreuse</samp>&rsquo;</dt>
  3618. <dd><p>0x7FFF00
  3619. </p></dd>
  3620. <dt>&lsquo;<samp class="samp">Chocolate</samp>&rsquo;</dt>
  3621. <dd><p>0xD2691E
  3622. </p></dd>
  3623. <dt>&lsquo;<samp class="samp">Coral</samp>&rsquo;</dt>
  3624. <dd><p>0xFF7F50
  3625. </p></dd>
  3626. <dt>&lsquo;<samp class="samp">CornflowerBlue</samp>&rsquo;</dt>
  3627. <dd><p>0x6495ED
  3628. </p></dd>
  3629. <dt>&lsquo;<samp class="samp">Cornsilk</samp>&rsquo;</dt>
  3630. <dd><p>0xFFF8DC
  3631. </p></dd>
  3632. <dt>&lsquo;<samp class="samp">Crimson</samp>&rsquo;</dt>
  3633. <dd><p>0xDC143C
  3634. </p></dd>
  3635. <dt>&lsquo;<samp class="samp">Cyan</samp>&rsquo;</dt>
  3636. <dd><p>0x00FFFF
  3637. </p></dd>
  3638. <dt>&lsquo;<samp class="samp">DarkBlue</samp>&rsquo;</dt>
  3639. <dd><p>0x00008B
  3640. </p></dd>
  3641. <dt>&lsquo;<samp class="samp">DarkCyan</samp>&rsquo;</dt>
  3642. <dd><p>0x008B8B
  3643. </p></dd>
  3644. <dt>&lsquo;<samp class="samp">DarkGoldenRod</samp>&rsquo;</dt>
  3645. <dd><p>0xB8860B
  3646. </p></dd>
  3647. <dt>&lsquo;<samp class="samp">DarkGray</samp>&rsquo;</dt>
  3648. <dd><p>0xA9A9A9
  3649. </p></dd>
  3650. <dt>&lsquo;<samp class="samp">DarkGreen</samp>&rsquo;</dt>
  3651. <dd><p>0x006400
  3652. </p></dd>
  3653. <dt>&lsquo;<samp class="samp">DarkKhaki</samp>&rsquo;</dt>
  3654. <dd><p>0xBDB76B
  3655. </p></dd>
  3656. <dt>&lsquo;<samp class="samp">DarkMagenta</samp>&rsquo;</dt>
  3657. <dd><p>0x8B008B
  3658. </p></dd>
  3659. <dt>&lsquo;<samp class="samp">DarkOliveGreen</samp>&rsquo;</dt>
  3660. <dd><p>0x556B2F
  3661. </p></dd>
  3662. <dt>&lsquo;<samp class="samp">Darkorange</samp>&rsquo;</dt>
  3663. <dd><p>0xFF8C00
  3664. </p></dd>
  3665. <dt>&lsquo;<samp class="samp">DarkOrchid</samp>&rsquo;</dt>
  3666. <dd><p>0x9932CC
  3667. </p></dd>
  3668. <dt>&lsquo;<samp class="samp">DarkRed</samp>&rsquo;</dt>
  3669. <dd><p>0x8B0000
  3670. </p></dd>
  3671. <dt>&lsquo;<samp class="samp">DarkSalmon</samp>&rsquo;</dt>
  3672. <dd><p>0xE9967A
  3673. </p></dd>
  3674. <dt>&lsquo;<samp class="samp">DarkSeaGreen</samp>&rsquo;</dt>
  3675. <dd><p>0x8FBC8F
  3676. </p></dd>
  3677. <dt>&lsquo;<samp class="samp">DarkSlateBlue</samp>&rsquo;</dt>
  3678. <dd><p>0x483D8B
  3679. </p></dd>
  3680. <dt>&lsquo;<samp class="samp">DarkSlateGray</samp>&rsquo;</dt>
  3681. <dd><p>0x2F4F4F
  3682. </p></dd>
  3683. <dt>&lsquo;<samp class="samp">DarkTurquoise</samp>&rsquo;</dt>
  3684. <dd><p>0x00CED1
  3685. </p></dd>
  3686. <dt>&lsquo;<samp class="samp">DarkViolet</samp>&rsquo;</dt>
  3687. <dd><p>0x9400D3
  3688. </p></dd>
  3689. <dt>&lsquo;<samp class="samp">DeepPink</samp>&rsquo;</dt>
  3690. <dd><p>0xFF1493
  3691. </p></dd>
  3692. <dt>&lsquo;<samp class="samp">DeepSkyBlue</samp>&rsquo;</dt>
  3693. <dd><p>0x00BFFF
  3694. </p></dd>
  3695. <dt>&lsquo;<samp class="samp">DimGray</samp>&rsquo;</dt>
  3696. <dd><p>0x696969
  3697. </p></dd>
  3698. <dt>&lsquo;<samp class="samp">DodgerBlue</samp>&rsquo;</dt>
  3699. <dd><p>0x1E90FF
  3700. </p></dd>
  3701. <dt>&lsquo;<samp class="samp">FireBrick</samp>&rsquo;</dt>
  3702. <dd><p>0xB22222
  3703. </p></dd>
  3704. <dt>&lsquo;<samp class="samp">FloralWhite</samp>&rsquo;</dt>
  3705. <dd><p>0xFFFAF0
  3706. </p></dd>
  3707. <dt>&lsquo;<samp class="samp">ForestGreen</samp>&rsquo;</dt>
  3708. <dd><p>0x228B22
  3709. </p></dd>
  3710. <dt>&lsquo;<samp class="samp">Fuchsia</samp>&rsquo;</dt>
  3711. <dd><p>0xFF00FF
  3712. </p></dd>
  3713. <dt>&lsquo;<samp class="samp">Gainsboro</samp>&rsquo;</dt>
  3714. <dd><p>0xDCDCDC
  3715. </p></dd>
  3716. <dt>&lsquo;<samp class="samp">GhostWhite</samp>&rsquo;</dt>
  3717. <dd><p>0xF8F8FF
  3718. </p></dd>
  3719. <dt>&lsquo;<samp class="samp">Gold</samp>&rsquo;</dt>
  3720. <dd><p>0xFFD700
  3721. </p></dd>
  3722. <dt>&lsquo;<samp class="samp">GoldenRod</samp>&rsquo;</dt>
  3723. <dd><p>0xDAA520
  3724. </p></dd>
  3725. <dt>&lsquo;<samp class="samp">Gray</samp>&rsquo;</dt>
  3726. <dd><p>0x808080
  3727. </p></dd>
  3728. <dt>&lsquo;<samp class="samp">Green</samp>&rsquo;</dt>
  3729. <dd><p>0x008000
  3730. </p></dd>
  3731. <dt>&lsquo;<samp class="samp">GreenYellow</samp>&rsquo;</dt>
  3732. <dd><p>0xADFF2F
  3733. </p></dd>
  3734. <dt>&lsquo;<samp class="samp">HoneyDew</samp>&rsquo;</dt>
  3735. <dd><p>0xF0FFF0
  3736. </p></dd>
  3737. <dt>&lsquo;<samp class="samp">HotPink</samp>&rsquo;</dt>
  3738. <dd><p>0xFF69B4
  3739. </p></dd>
  3740. <dt>&lsquo;<samp class="samp">IndianRed</samp>&rsquo;</dt>
  3741. <dd><p>0xCD5C5C
  3742. </p></dd>
  3743. <dt>&lsquo;<samp class="samp">Indigo</samp>&rsquo;</dt>
  3744. <dd><p>0x4B0082
  3745. </p></dd>
  3746. <dt>&lsquo;<samp class="samp">Ivory</samp>&rsquo;</dt>
  3747. <dd><p>0xFFFFF0
  3748. </p></dd>
  3749. <dt>&lsquo;<samp class="samp">Khaki</samp>&rsquo;</dt>
  3750. <dd><p>0xF0E68C
  3751. </p></dd>
  3752. <dt>&lsquo;<samp class="samp">Lavender</samp>&rsquo;</dt>
  3753. <dd><p>0xE6E6FA
  3754. </p></dd>
  3755. <dt>&lsquo;<samp class="samp">LavenderBlush</samp>&rsquo;</dt>
  3756. <dd><p>0xFFF0F5
  3757. </p></dd>
  3758. <dt>&lsquo;<samp class="samp">LawnGreen</samp>&rsquo;</dt>
  3759. <dd><p>0x7CFC00
  3760. </p></dd>
  3761. <dt>&lsquo;<samp class="samp">LemonChiffon</samp>&rsquo;</dt>
  3762. <dd><p>0xFFFACD
  3763. </p></dd>
  3764. <dt>&lsquo;<samp class="samp">LightBlue</samp>&rsquo;</dt>
  3765. <dd><p>0xADD8E6
  3766. </p></dd>
  3767. <dt>&lsquo;<samp class="samp">LightCoral</samp>&rsquo;</dt>
  3768. <dd><p>0xF08080
  3769. </p></dd>
  3770. <dt>&lsquo;<samp class="samp">LightCyan</samp>&rsquo;</dt>
  3771. <dd><p>0xE0FFFF
  3772. </p></dd>
  3773. <dt>&lsquo;<samp class="samp">LightGoldenRodYellow</samp>&rsquo;</dt>
  3774. <dd><p>0xFAFAD2
  3775. </p></dd>
  3776. <dt>&lsquo;<samp class="samp">LightGreen</samp>&rsquo;</dt>
  3777. <dd><p>0x90EE90
  3778. </p></dd>
  3779. <dt>&lsquo;<samp class="samp">LightGrey</samp>&rsquo;</dt>
  3780. <dd><p>0xD3D3D3
  3781. </p></dd>
  3782. <dt>&lsquo;<samp class="samp">LightPink</samp>&rsquo;</dt>
  3783. <dd><p>0xFFB6C1
  3784. </p></dd>
  3785. <dt>&lsquo;<samp class="samp">LightSalmon</samp>&rsquo;</dt>
  3786. <dd><p>0xFFA07A
  3787. </p></dd>
  3788. <dt>&lsquo;<samp class="samp">LightSeaGreen</samp>&rsquo;</dt>
  3789. <dd><p>0x20B2AA
  3790. </p></dd>
  3791. <dt>&lsquo;<samp class="samp">LightSkyBlue</samp>&rsquo;</dt>
  3792. <dd><p>0x87CEFA
  3793. </p></dd>
  3794. <dt>&lsquo;<samp class="samp">LightSlateGray</samp>&rsquo;</dt>
  3795. <dd><p>0x778899
  3796. </p></dd>
  3797. <dt>&lsquo;<samp class="samp">LightSteelBlue</samp>&rsquo;</dt>
  3798. <dd><p>0xB0C4DE
  3799. </p></dd>
  3800. <dt>&lsquo;<samp class="samp">LightYellow</samp>&rsquo;</dt>
  3801. <dd><p>0xFFFFE0
  3802. </p></dd>
  3803. <dt>&lsquo;<samp class="samp">Lime</samp>&rsquo;</dt>
  3804. <dd><p>0x00FF00
  3805. </p></dd>
  3806. <dt>&lsquo;<samp class="samp">LimeGreen</samp>&rsquo;</dt>
  3807. <dd><p>0x32CD32
  3808. </p></dd>
  3809. <dt>&lsquo;<samp class="samp">Linen</samp>&rsquo;</dt>
  3810. <dd><p>0xFAF0E6
  3811. </p></dd>
  3812. <dt>&lsquo;<samp class="samp">Magenta</samp>&rsquo;</dt>
  3813. <dd><p>0xFF00FF
  3814. </p></dd>
  3815. <dt>&lsquo;<samp class="samp">Maroon</samp>&rsquo;</dt>
  3816. <dd><p>0x800000
  3817. </p></dd>
  3818. <dt>&lsquo;<samp class="samp">MediumAquaMarine</samp>&rsquo;</dt>
  3819. <dd><p>0x66CDAA
  3820. </p></dd>
  3821. <dt>&lsquo;<samp class="samp">MediumBlue</samp>&rsquo;</dt>
  3822. <dd><p>0x0000CD
  3823. </p></dd>
  3824. <dt>&lsquo;<samp class="samp">MediumOrchid</samp>&rsquo;</dt>
  3825. <dd><p>0xBA55D3
  3826. </p></dd>
  3827. <dt>&lsquo;<samp class="samp">MediumPurple</samp>&rsquo;</dt>
  3828. <dd><p>0x9370D8
  3829. </p></dd>
  3830. <dt>&lsquo;<samp class="samp">MediumSeaGreen</samp>&rsquo;</dt>
  3831. <dd><p>0x3CB371
  3832. </p></dd>
  3833. <dt>&lsquo;<samp class="samp">MediumSlateBlue</samp>&rsquo;</dt>
  3834. <dd><p>0x7B68EE
  3835. </p></dd>
  3836. <dt>&lsquo;<samp class="samp">MediumSpringGreen</samp>&rsquo;</dt>
  3837. <dd><p>0x00FA9A
  3838. </p></dd>
  3839. <dt>&lsquo;<samp class="samp">MediumTurquoise</samp>&rsquo;</dt>
  3840. <dd><p>0x48D1CC
  3841. </p></dd>
  3842. <dt>&lsquo;<samp class="samp">MediumVioletRed</samp>&rsquo;</dt>
  3843. <dd><p>0xC71585
  3844. </p></dd>
  3845. <dt>&lsquo;<samp class="samp">MidnightBlue</samp>&rsquo;</dt>
  3846. <dd><p>0x191970
  3847. </p></dd>
  3848. <dt>&lsquo;<samp class="samp">MintCream</samp>&rsquo;</dt>
  3849. <dd><p>0xF5FFFA
  3850. </p></dd>
  3851. <dt>&lsquo;<samp class="samp">MistyRose</samp>&rsquo;</dt>
  3852. <dd><p>0xFFE4E1
  3853. </p></dd>
  3854. <dt>&lsquo;<samp class="samp">Moccasin</samp>&rsquo;</dt>
  3855. <dd><p>0xFFE4B5
  3856. </p></dd>
  3857. <dt>&lsquo;<samp class="samp">NavajoWhite</samp>&rsquo;</dt>
  3858. <dd><p>0xFFDEAD
  3859. </p></dd>
  3860. <dt>&lsquo;<samp class="samp">Navy</samp>&rsquo;</dt>
  3861. <dd><p>0x000080
  3862. </p></dd>
  3863. <dt>&lsquo;<samp class="samp">OldLace</samp>&rsquo;</dt>
  3864. <dd><p>0xFDF5E6
  3865. </p></dd>
  3866. <dt>&lsquo;<samp class="samp">Olive</samp>&rsquo;</dt>
  3867. <dd><p>0x808000
  3868. </p></dd>
  3869. <dt>&lsquo;<samp class="samp">OliveDrab</samp>&rsquo;</dt>
  3870. <dd><p>0x6B8E23
  3871. </p></dd>
  3872. <dt>&lsquo;<samp class="samp">Orange</samp>&rsquo;</dt>
  3873. <dd><p>0xFFA500
  3874. </p></dd>
  3875. <dt>&lsquo;<samp class="samp">OrangeRed</samp>&rsquo;</dt>
  3876. <dd><p>0xFF4500
  3877. </p></dd>
  3878. <dt>&lsquo;<samp class="samp">Orchid</samp>&rsquo;</dt>
  3879. <dd><p>0xDA70D6
  3880. </p></dd>
  3881. <dt>&lsquo;<samp class="samp">PaleGoldenRod</samp>&rsquo;</dt>
  3882. <dd><p>0xEEE8AA
  3883. </p></dd>
  3884. <dt>&lsquo;<samp class="samp">PaleGreen</samp>&rsquo;</dt>
  3885. <dd><p>0x98FB98
  3886. </p></dd>
  3887. <dt>&lsquo;<samp class="samp">PaleTurquoise</samp>&rsquo;</dt>
  3888. <dd><p>0xAFEEEE
  3889. </p></dd>
  3890. <dt>&lsquo;<samp class="samp">PaleVioletRed</samp>&rsquo;</dt>
  3891. <dd><p>0xD87093
  3892. </p></dd>
  3893. <dt>&lsquo;<samp class="samp">PapayaWhip</samp>&rsquo;</dt>
  3894. <dd><p>0xFFEFD5
  3895. </p></dd>
  3896. <dt>&lsquo;<samp class="samp">PeachPuff</samp>&rsquo;</dt>
  3897. <dd><p>0xFFDAB9
  3898. </p></dd>
  3899. <dt>&lsquo;<samp class="samp">Peru</samp>&rsquo;</dt>
  3900. <dd><p>0xCD853F
  3901. </p></dd>
  3902. <dt>&lsquo;<samp class="samp">Pink</samp>&rsquo;</dt>
  3903. <dd><p>0xFFC0CB
  3904. </p></dd>
  3905. <dt>&lsquo;<samp class="samp">Plum</samp>&rsquo;</dt>
  3906. <dd><p>0xDDA0DD
  3907. </p></dd>
  3908. <dt>&lsquo;<samp class="samp">PowderBlue</samp>&rsquo;</dt>
  3909. <dd><p>0xB0E0E6
  3910. </p></dd>
  3911. <dt>&lsquo;<samp class="samp">Purple</samp>&rsquo;</dt>
  3912. <dd><p>0x800080
  3913. </p></dd>
  3914. <dt>&lsquo;<samp class="samp">Red</samp>&rsquo;</dt>
  3915. <dd><p>0xFF0000
  3916. </p></dd>
  3917. <dt>&lsquo;<samp class="samp">RosyBrown</samp>&rsquo;</dt>
  3918. <dd><p>0xBC8F8F
  3919. </p></dd>
  3920. <dt>&lsquo;<samp class="samp">RoyalBlue</samp>&rsquo;</dt>
  3921. <dd><p>0x4169E1
  3922. </p></dd>
  3923. <dt>&lsquo;<samp class="samp">SaddleBrown</samp>&rsquo;</dt>
  3924. <dd><p>0x8B4513
  3925. </p></dd>
  3926. <dt>&lsquo;<samp class="samp">Salmon</samp>&rsquo;</dt>
  3927. <dd><p>0xFA8072
  3928. </p></dd>
  3929. <dt>&lsquo;<samp class="samp">SandyBrown</samp>&rsquo;</dt>
  3930. <dd><p>0xF4A460
  3931. </p></dd>
  3932. <dt>&lsquo;<samp class="samp">SeaGreen</samp>&rsquo;</dt>
  3933. <dd><p>0x2E8B57
  3934. </p></dd>
  3935. <dt>&lsquo;<samp class="samp">SeaShell</samp>&rsquo;</dt>
  3936. <dd><p>0xFFF5EE
  3937. </p></dd>
  3938. <dt>&lsquo;<samp class="samp">Sienna</samp>&rsquo;</dt>
  3939. <dd><p>0xA0522D
  3940. </p></dd>
  3941. <dt>&lsquo;<samp class="samp">Silver</samp>&rsquo;</dt>
  3942. <dd><p>0xC0C0C0
  3943. </p></dd>
  3944. <dt>&lsquo;<samp class="samp">SkyBlue</samp>&rsquo;</dt>
  3945. <dd><p>0x87CEEB
  3946. </p></dd>
  3947. <dt>&lsquo;<samp class="samp">SlateBlue</samp>&rsquo;</dt>
  3948. <dd><p>0x6A5ACD
  3949. </p></dd>
  3950. <dt>&lsquo;<samp class="samp">SlateGray</samp>&rsquo;</dt>
  3951. <dd><p>0x708090
  3952. </p></dd>
  3953. <dt>&lsquo;<samp class="samp">Snow</samp>&rsquo;</dt>
  3954. <dd><p>0xFFFAFA
  3955. </p></dd>
  3956. <dt>&lsquo;<samp class="samp">SpringGreen</samp>&rsquo;</dt>
  3957. <dd><p>0x00FF7F
  3958. </p></dd>
  3959. <dt>&lsquo;<samp class="samp">SteelBlue</samp>&rsquo;</dt>
  3960. <dd><p>0x4682B4
  3961. </p></dd>
  3962. <dt>&lsquo;<samp class="samp">Tan</samp>&rsquo;</dt>
  3963. <dd><p>0xD2B48C
  3964. </p></dd>
  3965. <dt>&lsquo;<samp class="samp">Teal</samp>&rsquo;</dt>
  3966. <dd><p>0x008080
  3967. </p></dd>
  3968. <dt>&lsquo;<samp class="samp">Thistle</samp>&rsquo;</dt>
  3969. <dd><p>0xD8BFD8
  3970. </p></dd>
  3971. <dt>&lsquo;<samp class="samp">Tomato</samp>&rsquo;</dt>
  3972. <dd><p>0xFF6347
  3973. </p></dd>
  3974. <dt>&lsquo;<samp class="samp">Turquoise</samp>&rsquo;</dt>
  3975. <dd><p>0x40E0D0
  3976. </p></dd>
  3977. <dt>&lsquo;<samp class="samp">Violet</samp>&rsquo;</dt>
  3978. <dd><p>0xEE82EE
  3979. </p></dd>
  3980. <dt>&lsquo;<samp class="samp">Wheat</samp>&rsquo;</dt>
  3981. <dd><p>0xF5DEB3
  3982. </p></dd>
  3983. <dt>&lsquo;<samp class="samp">White</samp>&rsquo;</dt>
  3984. <dd><p>0xFFFFFF
  3985. </p></dd>
  3986. <dt>&lsquo;<samp class="samp">WhiteSmoke</samp>&rsquo;</dt>
  3987. <dd><p>0xF5F5F5
  3988. </p></dd>
  3989. <dt>&lsquo;<samp class="samp">Yellow</samp>&rsquo;</dt>
  3990. <dd><p>0xFFFF00
  3991. </p></dd>
  3992. <dt>&lsquo;<samp class="samp">YellowGreen</samp>&rsquo;</dt>
  3993. <dd><p>0x9ACD32
  3994. </p></dd>
  3995. </dl>
  3996. <a class="anchor" id="channel-layout-syntax"></a><a name="Channel-Layout"></a>
  3997. <h3 class="section">6.8 Channel Layout<span class="pull-right"><a class="anchor hidden-xs" href="#Channel-Layout" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Channel-Layout" aria-hidden="true">TOC</a></span></h3>
  3998. <p>A channel layout specifies the spatial disposition of the channels in
  3999. a multi-channel audio stream. To specify a channel layout, FFmpeg
  4000. makes use of a special syntax.
  4001. </p>
  4002. <p>Individual channels are identified by an id, as given by the table
  4003. below:
  4004. </p><dl class="table">
  4005. <dt>&lsquo;<samp class="samp">FL</samp>&rsquo;</dt>
  4006. <dd><p>front left
  4007. </p></dd>
  4008. <dt>&lsquo;<samp class="samp">FR</samp>&rsquo;</dt>
  4009. <dd><p>front right
  4010. </p></dd>
  4011. <dt>&lsquo;<samp class="samp">FC</samp>&rsquo;</dt>
  4012. <dd><p>front center
  4013. </p></dd>
  4014. <dt>&lsquo;<samp class="samp">LFE</samp>&rsquo;</dt>
  4015. <dd><p>low frequency
  4016. </p></dd>
  4017. <dt>&lsquo;<samp class="samp">BL</samp>&rsquo;</dt>
  4018. <dd><p>back left
  4019. </p></dd>
  4020. <dt>&lsquo;<samp class="samp">BR</samp>&rsquo;</dt>
  4021. <dd><p>back right
  4022. </p></dd>
  4023. <dt>&lsquo;<samp class="samp">FLC</samp>&rsquo;</dt>
  4024. <dd><p>front left-of-center
  4025. </p></dd>
  4026. <dt>&lsquo;<samp class="samp">FRC</samp>&rsquo;</dt>
  4027. <dd><p>front right-of-center
  4028. </p></dd>
  4029. <dt>&lsquo;<samp class="samp">BC</samp>&rsquo;</dt>
  4030. <dd><p>back center
  4031. </p></dd>
  4032. <dt>&lsquo;<samp class="samp">SL</samp>&rsquo;</dt>
  4033. <dd><p>side left
  4034. </p></dd>
  4035. <dt>&lsquo;<samp class="samp">SR</samp>&rsquo;</dt>
  4036. <dd><p>side right
  4037. </p></dd>
  4038. <dt>&lsquo;<samp class="samp">TC</samp>&rsquo;</dt>
  4039. <dd><p>top center
  4040. </p></dd>
  4041. <dt>&lsquo;<samp class="samp">TFL</samp>&rsquo;</dt>
  4042. <dd><p>top front left
  4043. </p></dd>
  4044. <dt>&lsquo;<samp class="samp">TFC</samp>&rsquo;</dt>
  4045. <dd><p>top front center
  4046. </p></dd>
  4047. <dt>&lsquo;<samp class="samp">TFR</samp>&rsquo;</dt>
  4048. <dd><p>top front right
  4049. </p></dd>
  4050. <dt>&lsquo;<samp class="samp">TBL</samp>&rsquo;</dt>
  4051. <dd><p>top back left
  4052. </p></dd>
  4053. <dt>&lsquo;<samp class="samp">TBC</samp>&rsquo;</dt>
  4054. <dd><p>top back center
  4055. </p></dd>
  4056. <dt>&lsquo;<samp class="samp">TBR</samp>&rsquo;</dt>
  4057. <dd><p>top back right
  4058. </p></dd>
  4059. <dt>&lsquo;<samp class="samp">DL</samp>&rsquo;</dt>
  4060. <dd><p>downmix left
  4061. </p></dd>
  4062. <dt>&lsquo;<samp class="samp">DR</samp>&rsquo;</dt>
  4063. <dd><p>downmix right
  4064. </p></dd>
  4065. <dt>&lsquo;<samp class="samp">WL</samp>&rsquo;</dt>
  4066. <dd><p>wide left
  4067. </p></dd>
  4068. <dt>&lsquo;<samp class="samp">WR</samp>&rsquo;</dt>
  4069. <dd><p>wide right
  4070. </p></dd>
  4071. <dt>&lsquo;<samp class="samp">SDL</samp>&rsquo;</dt>
  4072. <dd><p>surround direct left
  4073. </p></dd>
  4074. <dt>&lsquo;<samp class="samp">SDR</samp>&rsquo;</dt>
  4075. <dd><p>surround direct right
  4076. </p></dd>
  4077. <dt>&lsquo;<samp class="samp">LFE2</samp>&rsquo;</dt>
  4078. <dd><p>low frequency 2
  4079. </p></dd>
  4080. </dl>
  4081. <p>Standard channel layout compositions can be specified by using the
  4082. following identifiers:
  4083. </p><dl class="table">
  4084. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  4085. <dd><p>FC
  4086. </p></dd>
  4087. <dt>&lsquo;<samp class="samp">stereo</samp>&rsquo;</dt>
  4088. <dd><p>FL+FR
  4089. </p></dd>
  4090. <dt>&lsquo;<samp class="samp">2.1</samp>&rsquo;</dt>
  4091. <dd><p>FL+FR+LFE
  4092. </p></dd>
  4093. <dt>&lsquo;<samp class="samp">3.0</samp>&rsquo;</dt>
  4094. <dd><p>FL+FR+FC
  4095. </p></dd>
  4096. <dt>&lsquo;<samp class="samp">3.0(back)</samp>&rsquo;</dt>
  4097. <dd><p>FL+FR+BC
  4098. </p></dd>
  4099. <dt>&lsquo;<samp class="samp">4.0</samp>&rsquo;</dt>
  4100. <dd><p>FL+FR+FC+BC
  4101. </p></dd>
  4102. <dt>&lsquo;<samp class="samp">quad</samp>&rsquo;</dt>
  4103. <dd><p>FL+FR+BL+BR
  4104. </p></dd>
  4105. <dt>&lsquo;<samp class="samp">quad(side)</samp>&rsquo;</dt>
  4106. <dd><p>FL+FR+SL+SR
  4107. </p></dd>
  4108. <dt>&lsquo;<samp class="samp">3.1</samp>&rsquo;</dt>
  4109. <dd><p>FL+FR+FC+LFE
  4110. </p></dd>
  4111. <dt>&lsquo;<samp class="samp">5.0</samp>&rsquo;</dt>
  4112. <dd><p>FL+FR+FC+BL+BR
  4113. </p></dd>
  4114. <dt>&lsquo;<samp class="samp">5.0(side)</samp>&rsquo;</dt>
  4115. <dd><p>FL+FR+FC+SL+SR
  4116. </p></dd>
  4117. <dt>&lsquo;<samp class="samp">4.1</samp>&rsquo;</dt>
  4118. <dd><p>FL+FR+FC+LFE+BC
  4119. </p></dd>
  4120. <dt>&lsquo;<samp class="samp">5.1</samp>&rsquo;</dt>
  4121. <dd><p>FL+FR+FC+LFE+BL+BR
  4122. </p></dd>
  4123. <dt>&lsquo;<samp class="samp">5.1(side)</samp>&rsquo;</dt>
  4124. <dd><p>FL+FR+FC+LFE+SL+SR
  4125. </p></dd>
  4126. <dt>&lsquo;<samp class="samp">6.0</samp>&rsquo;</dt>
  4127. <dd><p>FL+FR+FC+BC+SL+SR
  4128. </p></dd>
  4129. <dt>&lsquo;<samp class="samp">6.0(front)</samp>&rsquo;</dt>
  4130. <dd><p>FL+FR+FLC+FRC+SL+SR
  4131. </p></dd>
  4132. <dt>&lsquo;<samp class="samp">3.1.2</samp>&rsquo;</dt>
  4133. <dd><p>FL+FR+FC+LFE+TFL+TFR
  4134. </p></dd>
  4135. <dt>&lsquo;<samp class="samp">hexagonal</samp>&rsquo;</dt>
  4136. <dd><p>FL+FR+FC+BL+BR+BC
  4137. </p></dd>
  4138. <dt>&lsquo;<samp class="samp">6.1</samp>&rsquo;</dt>
  4139. <dd><p>FL+FR+FC+LFE+BC+SL+SR
  4140. </p></dd>
  4141. <dt>&lsquo;<samp class="samp">6.1</samp>&rsquo;</dt>
  4142. <dd><p>FL+FR+FC+LFE+BL+BR+BC
  4143. </p></dd>
  4144. <dt>&lsquo;<samp class="samp">6.1(front)</samp>&rsquo;</dt>
  4145. <dd><p>FL+FR+LFE+FLC+FRC+SL+SR
  4146. </p></dd>
  4147. <dt>&lsquo;<samp class="samp">7.0</samp>&rsquo;</dt>
  4148. <dd><p>FL+FR+FC+BL+BR+SL+SR
  4149. </p></dd>
  4150. <dt>&lsquo;<samp class="samp">7.0(front)</samp>&rsquo;</dt>
  4151. <dd><p>FL+FR+FC+FLC+FRC+SL+SR
  4152. </p></dd>
  4153. <dt>&lsquo;<samp class="samp">7.1</samp>&rsquo;</dt>
  4154. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
  4155. </p></dd>
  4156. <dt>&lsquo;<samp class="samp">7.1(wide)</samp>&rsquo;</dt>
  4157. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
  4158. </p></dd>
  4159. <dt>&lsquo;<samp class="samp">7.1(wide-side)</samp>&rsquo;</dt>
  4160. <dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
  4161. </p></dd>
  4162. <dt>&lsquo;<samp class="samp">5.1.2</samp>&rsquo;</dt>
  4163. <dd><p>FL+FR+FC+LFE+BL+BR+TFL+TFR
  4164. </p></dd>
  4165. <dt>&lsquo;<samp class="samp">octagonal</samp>&rsquo;</dt>
  4166. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR
  4167. </p></dd>
  4168. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  4169. <dd><p>FL+FR+BL+BR+TFL+TFR+TBL+TBR
  4170. </p></dd>
  4171. <dt>&lsquo;<samp class="samp">5.1.4</samp>&rsquo;</dt>
  4172. <dd><p>FL+FR+FC+LFE+BL+BR+TFL+TFR+TBL+TBR
  4173. </p></dd>
  4174. <dt>&lsquo;<samp class="samp">7.1.2</samp>&rsquo;</dt>
  4175. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR
  4176. </p></dd>
  4177. <dt>&lsquo;<samp class="samp">7.1.4</samp>&rsquo;</dt>
  4178. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBL+TBR
  4179. </p></dd>
  4180. <dt>&lsquo;<samp class="samp">7.2.3</samp>&rsquo;</dt>
  4181. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBC+LFE2
  4182. </p></dd>
  4183. <dt>&lsquo;<samp class="samp">9.1.4</samp>&rsquo;</dt>
  4184. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC+SL+SR+TFL+TFR+TBL+TBR
  4185. </p></dd>
  4186. <dt>&lsquo;<samp class="samp">9.1.6</samp>&rsquo;</dt>
  4187. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC+SL+SR+TFL+TFR+TBL+TBR+TSL+TSR
  4188. </p></dd>
  4189. <dt>&lsquo;<samp class="samp">hexadecagonal</samp>&rsquo;</dt>
  4190. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR
  4191. </p></dd>
  4192. <dt>&lsquo;<samp class="samp">binaural</samp>&rsquo;</dt>
  4193. <dd><p>BIL+BIR
  4194. </p></dd>
  4195. <dt>&lsquo;<samp class="samp">downmix</samp>&rsquo;</dt>
  4196. <dd><p>DL+DR
  4197. </p></dd>
  4198. <dt>&lsquo;<samp class="samp">22.2</samp>&rsquo;</dt>
  4199. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC+BC+SL+SR+TC+TFL+TFC+TFR+TBL+TBC+TBR+LFE2+TSL+TSR+BFC+BFL+BFR
  4200. </p></dd>
  4201. </dl>
  4202. <p>A custom channel layout can be specified as a sequence of terms, separated by &rsquo;+&rsquo;.
  4203. Each term can be:
  4204. </p><ul class="itemize mark-bullet">
  4205. <li>the name of a single channel (e.g. &lsquo;<samp class="samp">FL</samp>&rsquo;, &lsquo;<samp class="samp">FR</samp>&rsquo;, &lsquo;<samp class="samp">FC</samp>&rsquo;, &lsquo;<samp class="samp">LFE</samp>&rsquo;, etc.),
  4206. each optionally containing a custom name after a &rsquo;@&rsquo;, (e.g. &lsquo;<samp class="samp">FL@Left</samp>&rsquo;,
  4207. &lsquo;<samp class="samp">FR@Right</samp>&rsquo;, &lsquo;<samp class="samp">FC@Center</samp>&rsquo;, &lsquo;<samp class="samp">LFE@Low_Frequency</samp>&rsquo;, etc.)
  4208. </li></ul>
  4209. <p>A standard channel layout can be specified by the following:
  4210. </p><ul class="itemize mark-bullet">
  4211. <li>the name of a single channel (e.g. &lsquo;<samp class="samp">FL</samp>&rsquo;, &lsquo;<samp class="samp">FR</samp>&rsquo;, &lsquo;<samp class="samp">FC</samp>&rsquo;, &lsquo;<samp class="samp">LFE</samp>&rsquo;, etc.)
  4212. </li><li>the name of a standard channel layout (e.g. &lsquo;<samp class="samp">mono</samp>&rsquo;,
  4213. &lsquo;<samp class="samp">stereo</samp>&rsquo;, &lsquo;<samp class="samp">4.0</samp>&rsquo;, &lsquo;<samp class="samp">quad</samp>&rsquo;, &lsquo;<samp class="samp">5.0</samp>&rsquo;, etc.)
  4214. </li><li>a number of channels, in decimal, followed by &rsquo;c&rsquo;, yielding the default channel
  4215. layout for that number of channels (see the function
  4216. <code class="code">av_channel_layout_default</code>). Note that not all channel counts have a
  4217. default layout.
  4218. </li><li>a number of channels, in decimal, followed by &rsquo;C&rsquo;, yielding an unknown channel
  4219. layout with the specified number of channels. Note that not all channel layout
  4220. specification strings support unknown channel layouts.
  4221. </li><li>a channel layout mask, in hexadecimal starting with &quot;0x&quot; (see the
  4222. <code class="code">AV_CH_*</code> macros in <samp class="file">libavutil/channel_layout.h</samp>.
  4223. </li></ul>
  4224. <p>Before libavutil version 53 the trailing character &quot;c&quot; to specify a number of
  4225. channels was optional, but now it is required, while a channel layout mask can
  4226. also be specified as a decimal number (if and only if not followed by &quot;c&quot; or &quot;C&quot;).
  4227. </p>
  4228. <p>See also the function <code class="code">av_channel_layout_from_string</code> defined in
  4229. <samp class="file">libavutil/channel_layout.h</samp>.
  4230. </p>
  4231. <a name="Expression-Evaluation"></a>
  4232. <h2 class="chapter">7 Expression Evaluation<span class="pull-right"><a class="anchor hidden-xs" href="#Expression-Evaluation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Expression-Evaluation" aria-hidden="true">TOC</a></span></h2>
  4233. <p>When evaluating an arithmetic expression, FFmpeg uses an internal
  4234. formula evaluator, implemented through the <samp class="file">libavutil/eval.h</samp>
  4235. interface.
  4236. </p>
  4237. <p>An expression may contain unary, binary operators, constants, and
  4238. functions.
  4239. </p>
  4240. <p>Two expressions <var class="var">expr1</var> and <var class="var">expr2</var> can be combined to form
  4241. another expression &quot;<var class="var">expr1</var>;<var class="var">expr2</var>&quot;.
  4242. <var class="var">expr1</var> and <var class="var">expr2</var> are evaluated in turn, and the new
  4243. expression evaluates to the value of <var class="var">expr2</var>.
  4244. </p>
  4245. <p>The following binary operators are available: <code class="code">+</code>, <code class="code">-</code>,
  4246. <code class="code">*</code>, <code class="code">/</code>, <code class="code">^</code>.
  4247. </p>
  4248. <p>The following unary operators are available: <code class="code">+</code>, <code class="code">-</code>.
  4249. </p>
  4250. <p>Some internal variables can be used to store and load intermediary
  4251. results. They can be accessed using the <code class="code">ld</code> and <code class="code">st</code>
  4252. functions with an index argument varying from 0 to 9 to specify which
  4253. internal variable to access.
  4254. </p>
  4255. <p>The following functions are available:
  4256. </p><dl class="table">
  4257. <dt><samp class="option">abs(x)</samp></dt>
  4258. <dd><p>Compute absolute value of <var class="var">x</var>.
  4259. </p>
  4260. </dd>
  4261. <dt><samp class="option">acos(x)</samp></dt>
  4262. <dd><p>Compute arccosine of <var class="var">x</var>.
  4263. </p>
  4264. </dd>
  4265. <dt><samp class="option">asin(x)</samp></dt>
  4266. <dd><p>Compute arcsine of <var class="var">x</var>.
  4267. </p>
  4268. </dd>
  4269. <dt><samp class="option">atan(x)</samp></dt>
  4270. <dd><p>Compute arctangent of <var class="var">x</var>.
  4271. </p>
  4272. </dd>
  4273. <dt><samp class="option">atan2(y, x)</samp></dt>
  4274. <dd><p>Compute principal value of the arc tangent of <var class="var">y</var>/<var class="var">x</var>.
  4275. </p>
  4276. </dd>
  4277. <dt><samp class="option">between(x, min, max)</samp></dt>
  4278. <dd><p>Return 1 if <var class="var">x</var> is greater than or equal to <var class="var">min</var> and lesser than or
  4279. equal to <var class="var">max</var>, 0 otherwise.
  4280. </p>
  4281. </dd>
  4282. <dt><samp class="option">bitand(x, y)</samp></dt>
  4283. <dt><samp class="option">bitor(x, y)</samp></dt>
  4284. <dd><p>Compute bitwise and/or operation on <var class="var">x</var> and <var class="var">y</var>.
  4285. </p>
  4286. <p>The results of the evaluation of <var class="var">x</var> and <var class="var">y</var> are converted to
  4287. integers before executing the bitwise operation.
  4288. </p>
  4289. <p>Note that both the conversion to integer and the conversion back to
  4290. floating point can lose precision. Beware of unexpected results for
  4291. large numbers (usually 2^53 and larger).
  4292. </p>
  4293. </dd>
  4294. <dt><samp class="option">ceil(expr)</samp></dt>
  4295. <dd><p>Round the value of expression <var class="var">expr</var> upwards to the nearest
  4296. integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
  4297. </p>
  4298. </dd>
  4299. <dt><samp class="option">clip(x, min, max)</samp></dt>
  4300. <dd><p>Return the value of <var class="var">x</var> clipped between <var class="var">min</var> and <var class="var">max</var>.
  4301. </p>
  4302. </dd>
  4303. <dt><samp class="option">cos(x)</samp></dt>
  4304. <dd><p>Compute cosine of <var class="var">x</var>.
  4305. </p>
  4306. </dd>
  4307. <dt><samp class="option">cosh(x)</samp></dt>
  4308. <dd><p>Compute hyperbolic cosine of <var class="var">x</var>.
  4309. </p>
  4310. </dd>
  4311. <dt><samp class="option">eq(x, y)</samp></dt>
  4312. <dd><p>Return 1 if <var class="var">x</var> and <var class="var">y</var> are equivalent, 0 otherwise.
  4313. </p>
  4314. </dd>
  4315. <dt><samp class="option">exp(x)</samp></dt>
  4316. <dd><p>Compute exponential of <var class="var">x</var> (with base <code class="code">e</code>, the Euler&rsquo;s number).
  4317. </p>
  4318. </dd>
  4319. <dt><samp class="option">floor(expr)</samp></dt>
  4320. <dd><p>Round the value of expression <var class="var">expr</var> downwards to the nearest
  4321. integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
  4322. </p>
  4323. </dd>
  4324. <dt><samp class="option">gauss(x)</samp></dt>
  4325. <dd><p>Compute Gauss function of <var class="var">x</var>, corresponding to
  4326. <code class="code">exp(-x*x/2) / sqrt(2*PI)</code>.
  4327. </p>
  4328. </dd>
  4329. <dt><samp class="option">gcd(x, y)</samp></dt>
  4330. <dd><p>Return the greatest common divisor of <var class="var">x</var> and <var class="var">y</var>. If both <var class="var">x</var> and
  4331. <var class="var">y</var> are 0 or either or both are less than zero then behavior is undefined.
  4332. </p>
  4333. </dd>
  4334. <dt><samp class="option">gt(x, y)</samp></dt>
  4335. <dd><p>Return 1 if <var class="var">x</var> is greater than <var class="var">y</var>, 0 otherwise.
  4336. </p>
  4337. </dd>
  4338. <dt><samp class="option">gte(x, y)</samp></dt>
  4339. <dd><p>Return 1 if <var class="var">x</var> is greater than or equal to <var class="var">y</var>, 0 otherwise.
  4340. </p>
  4341. </dd>
  4342. <dt><samp class="option">hypot(x, y)</samp></dt>
  4343. <dd><p>This function is similar to the C function with the same name; it returns
  4344. &quot;sqrt(<var class="var">x</var>*<var class="var">x</var> + <var class="var">y</var>*<var class="var">y</var>)&quot;, the length of the hypotenuse of a
  4345. right triangle with sides of length <var class="var">x</var> and <var class="var">y</var>, or the distance of the
  4346. point (<var class="var">x</var>, <var class="var">y</var>) from the origin.
  4347. </p>
  4348. </dd>
  4349. <dt><samp class="option">if(x, y)</samp></dt>
  4350. <dd><p>Evaluate <var class="var">x</var>, and if the result is non-zero return the result of
  4351. the evaluation of <var class="var">y</var>, return 0 otherwise.
  4352. </p>
  4353. </dd>
  4354. <dt><samp class="option">if(x, y, z)</samp></dt>
  4355. <dd><p>Evaluate <var class="var">x</var>, and if the result is non-zero return the evaluation
  4356. result of <var class="var">y</var>, otherwise the evaluation result of <var class="var">z</var>.
  4357. </p>
  4358. </dd>
  4359. <dt><samp class="option">ifnot(x, y)</samp></dt>
  4360. <dd><p>Evaluate <var class="var">x</var>, and if the result is zero return the result of the
  4361. evaluation of <var class="var">y</var>, return 0 otherwise.
  4362. </p>
  4363. </dd>
  4364. <dt><samp class="option">ifnot(x, y, z)</samp></dt>
  4365. <dd><p>Evaluate <var class="var">x</var>, and if the result is zero return the evaluation
  4366. result of <var class="var">y</var>, otherwise the evaluation result of <var class="var">z</var>.
  4367. </p>
  4368. </dd>
  4369. <dt><samp class="option">isinf(x)</samp></dt>
  4370. <dd><p>Return 1.0 if <var class="var">x</var> is +/-INFINITY, 0.0 otherwise.
  4371. </p>
  4372. </dd>
  4373. <dt><samp class="option">isnan(x)</samp></dt>
  4374. <dd><p>Return 1.0 if <var class="var">x</var> is NAN, 0.0 otherwise.
  4375. </p>
  4376. </dd>
  4377. <dt><samp class="option">ld(idx)</samp></dt>
  4378. <dd><p>Load the value of the internal variable with index <var class="var">idx</var>, which was
  4379. previously stored with st(<var class="var">idx</var>, <var class="var">expr</var>).
  4380. The function returns the loaded value.
  4381. </p>
  4382. </dd>
  4383. <dt><samp class="option">lerp(x, y, z)</samp></dt>
  4384. <dd><p>Return linear interpolation between <var class="var">x</var> and <var class="var">y</var> by amount of <var class="var">z</var>.
  4385. </p>
  4386. </dd>
  4387. <dt><samp class="option">log(x)</samp></dt>
  4388. <dd><p>Compute natural logarithm of <var class="var">x</var>.
  4389. </p>
  4390. </dd>
  4391. <dt><samp class="option">lt(x, y)</samp></dt>
  4392. <dd><p>Return 1 if <var class="var">x</var> is lesser than <var class="var">y</var>, 0 otherwise.
  4393. </p>
  4394. </dd>
  4395. <dt><samp class="option">lte(x, y)</samp></dt>
  4396. <dd><p>Return 1 if <var class="var">x</var> is lesser than or equal to <var class="var">y</var>, 0 otherwise.
  4397. </p>
  4398. </dd>
  4399. <dt><samp class="option">max(x, y)</samp></dt>
  4400. <dd><p>Return the maximum between <var class="var">x</var> and <var class="var">y</var>.
  4401. </p>
  4402. </dd>
  4403. <dt><samp class="option">min(x, y)</samp></dt>
  4404. <dd><p>Return the minimum between <var class="var">x</var> and <var class="var">y</var>.
  4405. </p>
  4406. </dd>
  4407. <dt><samp class="option">mod(x, y)</samp></dt>
  4408. <dd><p>Compute the remainder of division of <var class="var">x</var> by <var class="var">y</var>.
  4409. </p>
  4410. </dd>
  4411. <dt><samp class="option">not(expr)</samp></dt>
  4412. <dd><p>Return 1.0 if <var class="var">expr</var> is zero, 0.0 otherwise.
  4413. </p>
  4414. </dd>
  4415. <dt><samp class="option">pow(x, y)</samp></dt>
  4416. <dd><p>Compute the power of <var class="var">x</var> elevated <var class="var">y</var>, it is equivalent to
  4417. &quot;(<var class="var">x</var>)^(<var class="var">y</var>)&quot;.
  4418. </p>
  4419. </dd>
  4420. <dt><samp class="option">print(t)</samp></dt>
  4421. <dt><samp class="option">print(t, l)</samp></dt>
  4422. <dd><p>Print the value of expression <var class="var">t</var> with loglevel <var class="var">l</var>. If <var class="var">l</var> is not
  4423. specified then a default log level is used.
  4424. Return the value of the expression printed.
  4425. </p>
  4426. </dd>
  4427. <dt><samp class="option">random(idx)</samp></dt>
  4428. <dd><p>Return a pseudo random value between 0.0 and 1.0. <var class="var">idx</var> is the
  4429. index of the internal variable used to save the seed/state, which can be
  4430. previously stored with <code class="code">st(idx)</code>.
  4431. </p>
  4432. <p>To initialize the seed, you need to store the seed value as a 64-bit
  4433. unsigned integer in the internal variable with index <var class="var">idx</var>.
  4434. </p>
  4435. <p>For example, to store the seed with value <code class="code">42</code> in the internal
  4436. variable with index <code class="code">0</code> and print a few random values:
  4437. </p><div class="example">
  4438. <pre class="example-preformatted">st(0,42); print(random(0)); print(random(0)); print(random(0))
  4439. </pre></div>
  4440. </dd>
  4441. <dt><samp class="option">randomi(idx, min, max)</samp></dt>
  4442. <dd><p>Return a pseudo random value in the interval between <var class="var">min</var> and
  4443. <var class="var">max</var>. <var class="var">idx</var> is the index of the internal variable which will be used to
  4444. save the seed/state, which can be previously stored with <code class="code">st(idx)</code>.
  4445. </p>
  4446. <p>To initialize the seed, you need to store the seed value as a 64-bit
  4447. unsigned integer in the internal variable with index <var class="var">idx</var>.
  4448. </p>
  4449. </dd>
  4450. <dt><samp class="option">root(expr, max)</samp></dt>
  4451. <dd><p>Find an input value for which the function represented by <var class="var">expr</var>
  4452. with argument <var class="var">ld(0)</var> is 0 in the interval 0..<var class="var">max</var>.
  4453. </p>
  4454. <p>The expression in <var class="var">expr</var> must denote a continuous function or the
  4455. result is undefined.
  4456. </p>
  4457. <p><var class="var">ld(0)</var> is used to represent the function input value, which means that the
  4458. given expression will be evaluated multiple times with various input values that
  4459. the expression can access through <code class="code">ld(0)</code>. When the expression evaluates to
  4460. 0 then the corresponding input value will be returned.
  4461. </p>
  4462. </dd>
  4463. <dt><samp class="option">round(expr)</samp></dt>
  4464. <dd><p>Round the value of expression <var class="var">expr</var> to the nearest integer. For example,
  4465. &quot;round(1.5)&quot; is &quot;2.0&quot;.
  4466. </p>
  4467. </dd>
  4468. <dt><samp class="option">sgn(x)</samp></dt>
  4469. <dd><p>Compute sign of <var class="var">x</var>.
  4470. </p>
  4471. </dd>
  4472. <dt><samp class="option">sin(x)</samp></dt>
  4473. <dd><p>Compute sine of <var class="var">x</var>.
  4474. </p>
  4475. </dd>
  4476. <dt><samp class="option">sinh(x)</samp></dt>
  4477. <dd><p>Compute hyperbolic sine of <var class="var">x</var>.
  4478. </p>
  4479. </dd>
  4480. <dt><samp class="option">sqrt(expr)</samp></dt>
  4481. <dd><p>Compute the square root of <var class="var">expr</var>. This is equivalent to
  4482. &quot;(<var class="var">expr</var>)^.5&quot;.
  4483. </p>
  4484. </dd>
  4485. <dt><samp class="option">squish(x)</samp></dt>
  4486. <dd><p>Compute expression <code class="code">1/(1 + exp(4*x))</code>.
  4487. </p>
  4488. </dd>
  4489. <dt><samp class="option">st(idx, expr)</samp></dt>
  4490. <dd><p>Store the value of the expression <var class="var">expr</var> in an internal
  4491. variable. <var class="var">idx</var> specifies the index of the variable where to store
  4492. the value, and it is a value ranging from 0 to 9. The function returns
  4493. the value stored in the internal variable.
  4494. </p>
  4495. <p>The stored value can be retrieved with <code class="code">ld(var)</code>.
  4496. </p>
  4497. <p>Note: variables are currently not shared between expressions.
  4498. </p>
  4499. </dd>
  4500. <dt><samp class="option">tan(x)</samp></dt>
  4501. <dd><p>Compute tangent of <var class="var">x</var>.
  4502. </p>
  4503. </dd>
  4504. <dt><samp class="option">tanh(x)</samp></dt>
  4505. <dd><p>Compute hyperbolic tangent of <var class="var">x</var>.
  4506. </p>
  4507. </dd>
  4508. <dt><samp class="option">taylor(expr, x)</samp></dt>
  4509. <dt><samp class="option">taylor(expr, x, idx)</samp></dt>
  4510. <dd><p>Evaluate a Taylor series at <var class="var">x</var>, given an expression representing
  4511. the <code class="code">ld(idx)</code>-th derivative of a function at 0.
  4512. </p>
  4513. <p>When the series does not converge the result is undefined.
  4514. </p>
  4515. <p><var class="var">ld(idx)</var> is used to represent the derivative order in <var class="var">expr</var>,
  4516. which means that the given expression will be evaluated multiple times
  4517. with various input values that the expression can access through
  4518. <code class="code">ld(idx)</code>. If <var class="var">idx</var> is not specified then 0 is assumed.
  4519. </p>
  4520. <p>Note, when you have the derivatives at y instead of 0,
  4521. <code class="code">taylor(expr, x-y)</code> can be used.
  4522. </p>
  4523. </dd>
  4524. <dt><samp class="option">time(0)</samp></dt>
  4525. <dd><p>Return the current (wallclock) time in seconds.
  4526. </p>
  4527. </dd>
  4528. <dt><samp class="option">trunc(expr)</samp></dt>
  4529. <dd><p>Round the value of expression <var class="var">expr</var> towards zero to the nearest
  4530. integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
  4531. </p>
  4532. </dd>
  4533. <dt><samp class="option">while(cond, expr)</samp></dt>
  4534. <dd><p>Evaluate expression <var class="var">expr</var> while the expression <var class="var">cond</var> is
  4535. non-zero, and returns the value of the last <var class="var">expr</var> evaluation, or
  4536. NAN if <var class="var">cond</var> was always false.
  4537. </p></dd>
  4538. </dl>
  4539. <p>The following constants are available:
  4540. </p><dl class="table">
  4541. <dt><samp class="option">PI</samp></dt>
  4542. <dd><p>area of the unit disc, approximately 3.14
  4543. </p></dd>
  4544. <dt><samp class="option">E</samp></dt>
  4545. <dd><p>exp(1) (Euler&rsquo;s number), approximately 2.718
  4546. </p></dd>
  4547. <dt><samp class="option">PHI</samp></dt>
  4548. <dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
  4549. </p></dd>
  4550. </dl>
  4551. <p>Assuming that an expression is considered &quot;true&quot; if it has a non-zero
  4552. value, note that:
  4553. </p>
  4554. <p><code class="code">*</code> works like AND
  4555. </p>
  4556. <p><code class="code">+</code> works like OR
  4557. </p>
  4558. <p>For example the construct:
  4559. </p><div class="example">
  4560. <pre class="example-preformatted">if (A AND B) then C
  4561. </pre></div>
  4562. <p>is equivalent to:
  4563. </p><div class="example">
  4564. <pre class="example-preformatted">if(A*B, C)
  4565. </pre></div>
  4566. <p>In your C code, you can extend the list of unary and binary functions,
  4567. and define recognized constants, so that they are available for your
  4568. expressions.
  4569. </p>
  4570. <p>The evaluator also recognizes the International System unit prefixes.
  4571. If &rsquo;i&rsquo; is appended after the prefix, binary prefixes are used, which
  4572. are based on powers of 1024 instead of powers of 1000.
  4573. The &rsquo;B&rsquo; postfix multiplies the value by 8, and can be appended after a
  4574. unit prefix or used alone. This allows using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;,
  4575. &rsquo;G&rsquo; and &rsquo;B&rsquo; as number postfix.
  4576. </p>
  4577. <p>The list of available International System prefixes follows, with
  4578. indication of the corresponding powers of 10 and of 2.
  4579. </p><dl class="table">
  4580. <dt><samp class="option">y</samp></dt>
  4581. <dd><p>10^-24 / 2^-80
  4582. </p></dd>
  4583. <dt><samp class="option">z</samp></dt>
  4584. <dd><p>10^-21 / 2^-70
  4585. </p></dd>
  4586. <dt><samp class="option">a</samp></dt>
  4587. <dd><p>10^-18 / 2^-60
  4588. </p></dd>
  4589. <dt><samp class="option">f</samp></dt>
  4590. <dd><p>10^-15 / 2^-50
  4591. </p></dd>
  4592. <dt><samp class="option">p</samp></dt>
  4593. <dd><p>10^-12 / 2^-40
  4594. </p></dd>
  4595. <dt><samp class="option">n</samp></dt>
  4596. <dd><p>10^-9 / 2^-30
  4597. </p></dd>
  4598. <dt><samp class="option">u</samp></dt>
  4599. <dd><p>10^-6 / 2^-20
  4600. </p></dd>
  4601. <dt><samp class="option">m</samp></dt>
  4602. <dd><p>10^-3 / 2^-10
  4603. </p></dd>
  4604. <dt><samp class="option">c</samp></dt>
  4605. <dd><p>10^-2
  4606. </p></dd>
  4607. <dt><samp class="option">d</samp></dt>
  4608. <dd><p>10^-1
  4609. </p></dd>
  4610. <dt><samp class="option">h</samp></dt>
  4611. <dd><p>10^2
  4612. </p></dd>
  4613. <dt><samp class="option">k</samp></dt>
  4614. <dd><p>10^3 / 2^10
  4615. </p></dd>
  4616. <dt><samp class="option">K</samp></dt>
  4617. <dd><p>10^3 / 2^10
  4618. </p></dd>
  4619. <dt><samp class="option">M</samp></dt>
  4620. <dd><p>10^6 / 2^20
  4621. </p></dd>
  4622. <dt><samp class="option">G</samp></dt>
  4623. <dd><p>10^9 / 2^30
  4624. </p></dd>
  4625. <dt><samp class="option">T</samp></dt>
  4626. <dd><p>10^12 / 2^40
  4627. </p></dd>
  4628. <dt><samp class="option">P</samp></dt>
  4629. <dd><p>10^15 / 2^50
  4630. </p></dd>
  4631. <dt><samp class="option">E</samp></dt>
  4632. <dd><p>10^18 / 2^60
  4633. </p></dd>
  4634. <dt><samp class="option">Z</samp></dt>
  4635. <dd><p>10^21 / 2^70
  4636. </p></dd>
  4637. <dt><samp class="option">Y</samp></dt>
  4638. <dd><p>10^24 / 2^80
  4639. </p></dd>
  4640. </dl>
  4641. <a class="anchor" id="codec_002doptions"></a><a name="Codec-Options"></a>
  4642. <h2 class="chapter">8 Codec Options<span class="pull-right"><a class="anchor hidden-xs" href="#Codec-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Codec-Options" aria-hidden="true">TOC</a></span></h2>
  4643. <p>libavcodec provides some generic global options, which can be set on
  4644. all the encoders and decoders. In addition, each codec may support
  4645. so-called private options, which are specific for a given codec.
  4646. </p>
  4647. <p>Sometimes, a global option may only affect a specific kind of codec,
  4648. and may be nonsensical or ignored by another, so you need to be aware
  4649. of the meaning of the specified options. Also some options are
  4650. meant only for decoding or encoding.
  4651. </p>
  4652. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  4653. FFmpeg tools, or by setting the value explicitly in the
  4654. <code class="code">AVCodecContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  4655. for programmatic use.
  4656. </p>
  4657. <p>The list of supported options follow:
  4658. </p>
  4659. <dl class="table">
  4660. <dt><samp class="option">b <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  4661. <dd><p>Set bitrate in bits/s. Default value is 200K.
  4662. </p>
  4663. </dd>
  4664. <dt><samp class="option">ab <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  4665. <dd><p>Set audio bitrate (in bits/s). Default value is 128K.
  4666. </p>
  4667. </dd>
  4668. <dt><samp class="option">bt <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4669. <dd><p>Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
  4670. tolerance specifies how far ratecontrol is willing to deviate from the
  4671. target average bitrate value. This is not related to min/max
  4672. bitrate. Lowering tolerance too much has an adverse effect on quality.
  4673. </p>
  4674. </dd>
  4675. <dt><samp class="option">flags <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  4676. <dd><p>Set generic flags.
  4677. </p>
  4678. <p>Possible values:
  4679. </p><dl class="table">
  4680. <dt>&lsquo;<samp class="samp">mv4</samp>&rsquo;</dt>
  4681. <dd><p>Use four motion vector by macroblock (mpeg4).
  4682. </p></dd>
  4683. <dt>&lsquo;<samp class="samp">qpel</samp>&rsquo;</dt>
  4684. <dd><p>Use 1/4 pel motion compensation.
  4685. </p></dd>
  4686. <dt>&lsquo;<samp class="samp">loop</samp>&rsquo;</dt>
  4687. <dd><p>Use loop filter.
  4688. </p></dd>
  4689. <dt>&lsquo;<samp class="samp">qscale</samp>&rsquo;</dt>
  4690. <dd><p>Use fixed qscale.
  4691. </p></dd>
  4692. <dt>&lsquo;<samp class="samp">pass1</samp>&rsquo;</dt>
  4693. <dd><p>Use internal 2pass ratecontrol in first pass mode.
  4694. </p></dd>
  4695. <dt>&lsquo;<samp class="samp">pass2</samp>&rsquo;</dt>
  4696. <dd><p>Use internal 2pass ratecontrol in second pass mode.
  4697. </p></dd>
  4698. <dt>&lsquo;<samp class="samp">gray</samp>&rsquo;</dt>
  4699. <dd><p>Only decode/encode grayscale.
  4700. </p></dd>
  4701. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  4702. <dd><p>Set error[?] variables during encoding.
  4703. </p></dd>
  4704. <dt>&lsquo;<samp class="samp">truncated</samp>&rsquo;</dt>
  4705. <dd><p>Input bitstream might be randomly truncated.
  4706. </p></dd>
  4707. <dt>&lsquo;<samp class="samp">drop_changed</samp>&rsquo;</dt>
  4708. <dd><p>Don&rsquo;t output frames whose parameters differ from first decoded frame in stream.
  4709. Error AVERROR_INPUT_CHANGED is returned when a frame is dropped.
  4710. </p>
  4711. </dd>
  4712. <dt>&lsquo;<samp class="samp">ildct</samp>&rsquo;</dt>
  4713. <dd><p>Use interlaced DCT.
  4714. </p></dd>
  4715. <dt>&lsquo;<samp class="samp">low_delay</samp>&rsquo;</dt>
  4716. <dd><p>Force low delay.
  4717. </p></dd>
  4718. <dt>&lsquo;<samp class="samp">global_header</samp>&rsquo;</dt>
  4719. <dd><p>Place global headers in extradata instead of every keyframe.
  4720. </p></dd>
  4721. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  4722. <dd><p>Only write platform-, build- and time-independent data. (except (I)DCT).
  4723. This ensures that file and data checksums are reproducible and match between
  4724. platforms. Its primary use is for regression testing.
  4725. </p></dd>
  4726. <dt>&lsquo;<samp class="samp">aic</samp>&rsquo;</dt>
  4727. <dd><p>Apply H263 advanced intra coding / mpeg4 ac prediction.
  4728. </p></dd>
  4729. <dt>&lsquo;<samp class="samp">ilme</samp>&rsquo;</dt>
  4730. <dd><p>Apply interlaced motion estimation.
  4731. </p></dd>
  4732. <dt>&lsquo;<samp class="samp">cgop</samp>&rsquo;</dt>
  4733. <dd><p>Use closed gop.
  4734. </p></dd>
  4735. <dt>&lsquo;<samp class="samp">output_corrupt</samp>&rsquo;</dt>
  4736. <dd><p>Output even potentially corrupted frames.
  4737. </p></dd>
  4738. </dl>
  4739. </dd>
  4740. <dt><samp class="option">time_base <var class="var">rational number</var></samp></dt>
  4741. <dd><p>Set codec time base.
  4742. </p>
  4743. <p>It is the fundamental unit of time (in seconds) in terms of which
  4744. frame timestamps are represented. For fixed-fps content, timebase
  4745. should be <code class="code">1 / frame_rate</code> and timestamp increments should be
  4746. identically 1.
  4747. </p>
  4748. </dd>
  4749. <dt><samp class="option">g <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4750. <dd><p>Set the group of picture (GOP) size. Default value is 12.
  4751. </p>
  4752. </dd>
  4753. <dt><samp class="option">ar <var class="var">integer</var> (<em class="emph">decoding/encoding,audio</em>)</samp></dt>
  4754. <dd><p>Set audio sampling rate (in Hz).
  4755. </p>
  4756. </dd>
  4757. <dt><samp class="option">ac <var class="var">integer</var> (<em class="emph">decoding/encoding,audio</em>)</samp></dt>
  4758. <dd><p>Set number of audio channels.
  4759. </p>
  4760. </dd>
  4761. <dt><samp class="option">cutoff <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  4762. <dd><p>Set cutoff bandwidth. (Supported only by selected encoders, see
  4763. their respective documentation sections.)
  4764. </p>
  4765. </dd>
  4766. <dt><samp class="option">frame_size <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  4767. <dd><p>Set audio frame size.
  4768. </p>
  4769. <p>Each submitted frame except the last must contain exactly frame_size
  4770. samples per channel. May be 0 when the codec has
  4771. CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
  4772. restricted. It is set by some decoders to indicate constant frame
  4773. size.
  4774. </p>
  4775. </dd>
  4776. <dt><samp class="option">frame_number <var class="var">integer</var></samp></dt>
  4777. <dd><p>Set the frame number.
  4778. </p>
  4779. </dd>
  4780. <dt><samp class="option">delay <var class="var">integer</var></samp></dt>
  4781. <dt><samp class="option">qcomp <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4782. <dd><p>Set video quantizer scale compression (VBR). It is used as a constant
  4783. in the ratecontrol equation. Recommended range for default rc_eq:
  4784. 0.0-1.0.
  4785. </p>
  4786. </dd>
  4787. <dt><samp class="option">qblur <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4788. <dd><p>Set video quantizer scale blur (VBR).
  4789. </p>
  4790. </dd>
  4791. <dt><samp class="option">qmin <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4792. <dd><p>Set min video quantizer scale (VBR). Must be included between -1 and
  4793. 69, default value is 2.
  4794. </p>
  4795. </dd>
  4796. <dt><samp class="option">qmax <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4797. <dd><p>Set max video quantizer scale (VBR). Must be included between -1 and
  4798. 1024, default value is 31.
  4799. </p>
  4800. </dd>
  4801. <dt><samp class="option">qdiff <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4802. <dd><p>Set max difference between the quantizer scale (VBR).
  4803. </p>
  4804. </dd>
  4805. <dt><samp class="option">bf <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4806. <dd><p>Set max number of B frames between non-B-frames.
  4807. </p>
  4808. <p>Must be an integer between -1 and 16. 0 means that B-frames are
  4809. disabled. If a value of -1 is used, it will choose an automatic value
  4810. depending on the encoder.
  4811. </p>
  4812. <p>Default value is 0.
  4813. </p>
  4814. </dd>
  4815. <dt><samp class="option">b_qfactor <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4816. <dd><p>Set qp factor between P and B frames.
  4817. </p>
  4818. </dd>
  4819. <dt><samp class="option">codec_tag <var class="var">integer</var></samp></dt>
  4820. <dt><samp class="option">bug <var class="var">flags</var> (<em class="emph">decoding,video</em>)</samp></dt>
  4821. <dd><p>Workaround not auto detected encoder bugs.
  4822. </p>
  4823. <p>Possible values:
  4824. </p><dl class="table">
  4825. <dt>&lsquo;<samp class="samp">autodetect</samp>&rsquo;</dt>
  4826. <dt>&lsquo;<samp class="samp">xvid_ilace</samp>&rsquo;</dt>
  4827. <dd><p>Xvid interlacing bug (autodetected if fourcc==XVIX)
  4828. </p></dd>
  4829. <dt>&lsquo;<samp class="samp">ump4</samp>&rsquo;</dt>
  4830. <dd><p>(autodetected if fourcc==UMP4)
  4831. </p></dd>
  4832. <dt>&lsquo;<samp class="samp">no_padding</samp>&rsquo;</dt>
  4833. <dd><p>padding bug (autodetected)
  4834. </p></dd>
  4835. <dt>&lsquo;<samp class="samp">amv</samp>&rsquo;</dt>
  4836. <dt>&lsquo;<samp class="samp">qpel_chroma</samp>&rsquo;</dt>
  4837. <dt>&lsquo;<samp class="samp">std_qpel</samp>&rsquo;</dt>
  4838. <dd><p>old standard qpel (autodetected per fourcc/version)
  4839. </p></dd>
  4840. <dt>&lsquo;<samp class="samp">qpel_chroma2</samp>&rsquo;</dt>
  4841. <dt>&lsquo;<samp class="samp">direct_blocksize</samp>&rsquo;</dt>
  4842. <dd><p>direct-qpel-blocksize bug (autodetected per fourcc/version)
  4843. </p></dd>
  4844. <dt>&lsquo;<samp class="samp">edge</samp>&rsquo;</dt>
  4845. <dd><p>edge padding bug (autodetected per fourcc/version)
  4846. </p></dd>
  4847. <dt>&lsquo;<samp class="samp">hpel_chroma</samp>&rsquo;</dt>
  4848. <dt>&lsquo;<samp class="samp">dc_clip</samp>&rsquo;</dt>
  4849. <dt>&lsquo;<samp class="samp">ms</samp>&rsquo;</dt>
  4850. <dd><p>Workaround various bugs in microsoft broken decoders.
  4851. </p></dd>
  4852. <dt>&lsquo;<samp class="samp">trunc</samp>&rsquo;</dt>
  4853. <dd><p>trancated frames
  4854. </p></dd>
  4855. </dl>
  4856. </dd>
  4857. <dt><samp class="option">strict <var class="var">integer</var> (<em class="emph">decoding/encoding,audio,video</em>)</samp></dt>
  4858. <dd><p>Specify how strictly to follow the standards.
  4859. </p>
  4860. <p>Possible values:
  4861. </p><dl class="table">
  4862. <dt>&lsquo;<samp class="samp">very</samp>&rsquo;</dt>
  4863. <dd><p>strictly conform to an older more strict version of the spec or reference software
  4864. </p></dd>
  4865. <dt>&lsquo;<samp class="samp">strict</samp>&rsquo;</dt>
  4866. <dd><p>strictly conform to all the things in the spec no matter what consequences
  4867. </p></dd>
  4868. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  4869. <dt>&lsquo;<samp class="samp">unofficial</samp>&rsquo;</dt>
  4870. <dd><p>allow unofficial extensions
  4871. </p></dd>
  4872. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  4873. <dd><p>allow non standardized experimental things, experimental
  4874. (unfinished/work in progress/not well tested) decoders and encoders.
  4875. Note: experimental decoders can pose a security risk, do not use this for
  4876. decoding untrusted input.
  4877. </p></dd>
  4878. </dl>
  4879. </dd>
  4880. <dt><samp class="option">b_qoffset <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4881. <dd><p>Set QP offset between P and B frames.
  4882. </p>
  4883. </dd>
  4884. <dt><samp class="option">err_detect <var class="var">flags</var> (<em class="emph">decoding,audio,video</em>)</samp></dt>
  4885. <dd><p>Set error detection flags.
  4886. </p>
  4887. <p>Possible values:
  4888. </p><dl class="table">
  4889. <dt>&lsquo;<samp class="samp">crccheck</samp>&rsquo;</dt>
  4890. <dd><p>verify embedded CRCs
  4891. </p></dd>
  4892. <dt>&lsquo;<samp class="samp">bitstream</samp>&rsquo;</dt>
  4893. <dd><p>detect bitstream specification deviations
  4894. </p></dd>
  4895. <dt>&lsquo;<samp class="samp">buffer</samp>&rsquo;</dt>
  4896. <dd><p>detect improper bitstream length
  4897. </p></dd>
  4898. <dt>&lsquo;<samp class="samp">explode</samp>&rsquo;</dt>
  4899. <dd><p>abort decoding on minor error detection
  4900. </p></dd>
  4901. <dt>&lsquo;<samp class="samp">ignore_err</samp>&rsquo;</dt>
  4902. <dd><p>ignore decoding errors, and continue decoding.
  4903. This is useful if you want to analyze the content of a video and thus want
  4904. everything to be decoded no matter what. This option will not result in a video
  4905. that is pleasing to watch in case of errors.
  4906. </p></dd>
  4907. <dt>&lsquo;<samp class="samp">careful</samp>&rsquo;</dt>
  4908. <dd><p>consider things that violate the spec and have not been seen in the wild as errors
  4909. </p></dd>
  4910. <dt>&lsquo;<samp class="samp">compliant</samp>&rsquo;</dt>
  4911. <dd><p>consider all spec non compliancies as errors
  4912. </p></dd>
  4913. <dt>&lsquo;<samp class="samp">aggressive</samp>&rsquo;</dt>
  4914. <dd><p>consider things that a sane encoder should not do as an error
  4915. </p></dd>
  4916. </dl>
  4917. </dd>
  4918. <dt><samp class="option">has_b_frames <var class="var">integer</var></samp></dt>
  4919. <dt><samp class="option">block_align <var class="var">integer</var></samp></dt>
  4920. <dt><samp class="option">rc_override_count <var class="var">integer</var></samp></dt>
  4921. <dt><samp class="option">maxrate <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  4922. <dd><p>Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
  4923. </p>
  4924. </dd>
  4925. <dt><samp class="option">minrate <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  4926. <dd><p>Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
  4927. encode. It is of little use elsewise.
  4928. </p>
  4929. </dd>
  4930. <dt><samp class="option">bufsize <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  4931. <dd><p>Set ratecontrol buffer size (in bits).
  4932. </p>
  4933. </dd>
  4934. <dt><samp class="option">i_qfactor <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4935. <dd><p>Set QP factor between P and I frames.
  4936. </p>
  4937. </dd>
  4938. <dt><samp class="option">i_qoffset <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4939. <dd><p>Set QP offset between P and I frames.
  4940. </p>
  4941. </dd>
  4942. <dt><samp class="option">dct <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4943. <dd><p>Set DCT algorithm.
  4944. </p>
  4945. <p>Possible values:
  4946. </p><dl class="table">
  4947. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  4948. <dd><p>autoselect a good one (default)
  4949. </p></dd>
  4950. <dt>&lsquo;<samp class="samp">fastint</samp>&rsquo;</dt>
  4951. <dd><p>fast integer
  4952. </p></dd>
  4953. <dt>&lsquo;<samp class="samp">int</samp>&rsquo;</dt>
  4954. <dd><p>accurate integer
  4955. </p></dd>
  4956. <dt>&lsquo;<samp class="samp">mmx</samp>&rsquo;</dt>
  4957. <dt>&lsquo;<samp class="samp">altivec</samp>&rsquo;</dt>
  4958. <dt>&lsquo;<samp class="samp">faan</samp>&rsquo;</dt>
  4959. <dd><p>floating point AAN DCT
  4960. </p></dd>
  4961. </dl>
  4962. </dd>
  4963. <dt><samp class="option">lumi_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4964. <dd><p>Compress bright areas stronger than medium ones.
  4965. </p>
  4966. </dd>
  4967. <dt><samp class="option">tcplx_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4968. <dd><p>Set temporal complexity masking.
  4969. </p>
  4970. </dd>
  4971. <dt><samp class="option">scplx_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4972. <dd><p>Set spatial complexity masking.
  4973. </p>
  4974. </dd>
  4975. <dt><samp class="option">p_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4976. <dd><p>Set inter masking.
  4977. </p>
  4978. </dd>
  4979. <dt><samp class="option">dark_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4980. <dd><p>Compress dark areas stronger than medium ones.
  4981. </p>
  4982. </dd>
  4983. <dt><samp class="option">idct <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  4984. <dd><p>Select IDCT implementation.
  4985. </p>
  4986. <p>Possible values:
  4987. </p><dl class="table">
  4988. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  4989. <dt>&lsquo;<samp class="samp">int</samp>&rsquo;</dt>
  4990. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  4991. <dt>&lsquo;<samp class="samp">simplemmx</samp>&rsquo;</dt>
  4992. <dt>&lsquo;<samp class="samp">simpleauto</samp>&rsquo;</dt>
  4993. <dd><p>Automatically pick a IDCT compatible with the simple one
  4994. </p>
  4995. </dd>
  4996. <dt>&lsquo;<samp class="samp">arm</samp>&rsquo;</dt>
  4997. <dt>&lsquo;<samp class="samp">altivec</samp>&rsquo;</dt>
  4998. <dt>&lsquo;<samp class="samp">sh4</samp>&rsquo;</dt>
  4999. <dt>&lsquo;<samp class="samp">simplearm</samp>&rsquo;</dt>
  5000. <dt>&lsquo;<samp class="samp">simplearmv5te</samp>&rsquo;</dt>
  5001. <dt>&lsquo;<samp class="samp">simplearmv6</samp>&rsquo;</dt>
  5002. <dt>&lsquo;<samp class="samp">simpleneon</samp>&rsquo;</dt>
  5003. <dt>&lsquo;<samp class="samp">xvid</samp>&rsquo;</dt>
  5004. <dt>&lsquo;<samp class="samp">faani</samp>&rsquo;</dt>
  5005. <dd><p>floating point AAN IDCT
  5006. </p></dd>
  5007. </dl>
  5008. </dd>
  5009. <dt><samp class="option">slice_count <var class="var">integer</var></samp></dt>
  5010. <dt><samp class="option">ec <var class="var">flags</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5011. <dd><p>Set error concealment strategy.
  5012. </p>
  5013. <p>Possible values:
  5014. </p><dl class="table">
  5015. <dt>&lsquo;<samp class="samp">guess_mvs</samp>&rsquo;</dt>
  5016. <dd><p>iterative motion vector (MV) search (slow)
  5017. </p></dd>
  5018. <dt>&lsquo;<samp class="samp">deblock</samp>&rsquo;</dt>
  5019. <dd><p>use strong deblock filter for damaged MBs
  5020. </p></dd>
  5021. <dt>&lsquo;<samp class="samp">favor_inter</samp>&rsquo;</dt>
  5022. <dd><p>favor predicting from the previous frame instead of the current
  5023. </p></dd>
  5024. </dl>
  5025. </dd>
  5026. <dt><samp class="option">bits_per_coded_sample <var class="var">integer</var></samp></dt>
  5027. <dt><samp class="option">aspect <var class="var">rational number</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5028. <dd><p>Set sample aspect ratio.
  5029. </p>
  5030. </dd>
  5031. <dt><samp class="option">sar <var class="var">rational number</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5032. <dd><p>Set sample aspect ratio. Alias to <var class="var">aspect</var>.
  5033. </p>
  5034. </dd>
  5035. <dt><samp class="option">debug <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  5036. <dd><p>Print specific debug info.
  5037. </p>
  5038. <p>Possible values:
  5039. </p><dl class="table">
  5040. <dt>&lsquo;<samp class="samp">pict</samp>&rsquo;</dt>
  5041. <dd><p>picture info
  5042. </p></dd>
  5043. <dt>&lsquo;<samp class="samp">rc</samp>&rsquo;</dt>
  5044. <dd><p>rate control
  5045. </p></dd>
  5046. <dt>&lsquo;<samp class="samp">bitstream</samp>&rsquo;</dt>
  5047. <dt>&lsquo;<samp class="samp">mb_type</samp>&rsquo;</dt>
  5048. <dd><p>macroblock (MB) type
  5049. </p></dd>
  5050. <dt>&lsquo;<samp class="samp">qp</samp>&rsquo;</dt>
  5051. <dd><p>per-block quantization parameter (QP)
  5052. </p></dd>
  5053. <dt>&lsquo;<samp class="samp">dct_coeff</samp>&rsquo;</dt>
  5054. <dt>&lsquo;<samp class="samp">green_metadata</samp>&rsquo;</dt>
  5055. <dd><p>display complexity metadata for the upcoming frame, GoP or for a given duration.
  5056. </p>
  5057. </dd>
  5058. <dt>&lsquo;<samp class="samp">skip</samp>&rsquo;</dt>
  5059. <dt>&lsquo;<samp class="samp">startcode</samp>&rsquo;</dt>
  5060. <dt>&lsquo;<samp class="samp">er</samp>&rsquo;</dt>
  5061. <dd><p>error recognition
  5062. </p></dd>
  5063. <dt>&lsquo;<samp class="samp">mmco</samp>&rsquo;</dt>
  5064. <dd><p>memory management control operations (H.264)
  5065. </p></dd>
  5066. <dt>&lsquo;<samp class="samp">bugs</samp>&rsquo;</dt>
  5067. <dt>&lsquo;<samp class="samp">buffers</samp>&rsquo;</dt>
  5068. <dd><p>picture buffer allocations
  5069. </p></dd>
  5070. <dt>&lsquo;<samp class="samp">thread_ops</samp>&rsquo;</dt>
  5071. <dd><p>threading operations
  5072. </p></dd>
  5073. <dt>&lsquo;<samp class="samp">nomc</samp>&rsquo;</dt>
  5074. <dd><p>skip motion compensation
  5075. </p></dd>
  5076. </dl>
  5077. </dd>
  5078. <dt><samp class="option">cmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5079. <dd><p>Set full pel me compare function.
  5080. </p>
  5081. <p>Possible values:
  5082. </p><dl class="table">
  5083. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  5084. <dd><p>sum of absolute differences, fast (default)
  5085. </p></dd>
  5086. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  5087. <dd><p>sum of squared errors
  5088. </p></dd>
  5089. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  5090. <dd><p>sum of absolute Hadamard transformed differences
  5091. </p></dd>
  5092. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  5093. <dd><p>sum of absolute DCT transformed differences
  5094. </p></dd>
  5095. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  5096. <dd><p>sum of squared quantization errors (avoid, low quality)
  5097. </p></dd>
  5098. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  5099. <dd><p>number of bits needed for the block
  5100. </p></dd>
  5101. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  5102. <dd><p>rate distortion optimal, slow
  5103. </p></dd>
  5104. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  5105. <dd><p>0
  5106. </p></dd>
  5107. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  5108. <dd><p>sum of absolute vertical differences
  5109. </p></dd>
  5110. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  5111. <dd><p>sum of squared vertical differences
  5112. </p></dd>
  5113. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  5114. <dd><p>noise preserving sum of squared differences
  5115. </p></dd>
  5116. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  5117. <dd><p>5/3 wavelet, only used in snow
  5118. </p></dd>
  5119. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  5120. <dd><p>9/7 wavelet, only used in snow
  5121. </p></dd>
  5122. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  5123. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  5124. </dl>
  5125. </dd>
  5126. <dt><samp class="option">subcmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5127. <dd><p>Set sub pel me compare function.
  5128. </p>
  5129. <p>Possible values:
  5130. </p><dl class="table">
  5131. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  5132. <dd><p>sum of absolute differences, fast (default)
  5133. </p></dd>
  5134. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  5135. <dd><p>sum of squared errors
  5136. </p></dd>
  5137. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  5138. <dd><p>sum of absolute Hadamard transformed differences
  5139. </p></dd>
  5140. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  5141. <dd><p>sum of absolute DCT transformed differences
  5142. </p></dd>
  5143. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  5144. <dd><p>sum of squared quantization errors (avoid, low quality)
  5145. </p></dd>
  5146. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  5147. <dd><p>number of bits needed for the block
  5148. </p></dd>
  5149. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  5150. <dd><p>rate distortion optimal, slow
  5151. </p></dd>
  5152. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  5153. <dd><p>0
  5154. </p></dd>
  5155. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  5156. <dd><p>sum of absolute vertical differences
  5157. </p></dd>
  5158. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  5159. <dd><p>sum of squared vertical differences
  5160. </p></dd>
  5161. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  5162. <dd><p>noise preserving sum of squared differences
  5163. </p></dd>
  5164. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  5165. <dd><p>5/3 wavelet, only used in snow
  5166. </p></dd>
  5167. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  5168. <dd><p>9/7 wavelet, only used in snow
  5169. </p></dd>
  5170. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  5171. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  5172. </dl>
  5173. </dd>
  5174. <dt><samp class="option">mbcmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5175. <dd><p>Set macroblock compare function.
  5176. </p>
  5177. <p>Possible values:
  5178. </p><dl class="table">
  5179. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  5180. <dd><p>sum of absolute differences, fast (default)
  5181. </p></dd>
  5182. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  5183. <dd><p>sum of squared errors
  5184. </p></dd>
  5185. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  5186. <dd><p>sum of absolute Hadamard transformed differences
  5187. </p></dd>
  5188. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  5189. <dd><p>sum of absolute DCT transformed differences
  5190. </p></dd>
  5191. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  5192. <dd><p>sum of squared quantization errors (avoid, low quality)
  5193. </p></dd>
  5194. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  5195. <dd><p>number of bits needed for the block
  5196. </p></dd>
  5197. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  5198. <dd><p>rate distortion optimal, slow
  5199. </p></dd>
  5200. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  5201. <dd><p>0
  5202. </p></dd>
  5203. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  5204. <dd><p>sum of absolute vertical differences
  5205. </p></dd>
  5206. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  5207. <dd><p>sum of squared vertical differences
  5208. </p></dd>
  5209. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  5210. <dd><p>noise preserving sum of squared differences
  5211. </p></dd>
  5212. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  5213. <dd><p>5/3 wavelet, only used in snow
  5214. </p></dd>
  5215. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  5216. <dd><p>9/7 wavelet, only used in snow
  5217. </p></dd>
  5218. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  5219. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  5220. </dl>
  5221. </dd>
  5222. <dt><samp class="option">ildctcmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5223. <dd><p>Set interlaced dct compare function.
  5224. </p>
  5225. <p>Possible values:
  5226. </p><dl class="table">
  5227. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  5228. <dd><p>sum of absolute differences, fast (default)
  5229. </p></dd>
  5230. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  5231. <dd><p>sum of squared errors
  5232. </p></dd>
  5233. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  5234. <dd><p>sum of absolute Hadamard transformed differences
  5235. </p></dd>
  5236. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  5237. <dd><p>sum of absolute DCT transformed differences
  5238. </p></dd>
  5239. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  5240. <dd><p>sum of squared quantization errors (avoid, low quality)
  5241. </p></dd>
  5242. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  5243. <dd><p>number of bits needed for the block
  5244. </p></dd>
  5245. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  5246. <dd><p>rate distortion optimal, slow
  5247. </p></dd>
  5248. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  5249. <dd><p>0
  5250. </p></dd>
  5251. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  5252. <dd><p>sum of absolute vertical differences
  5253. </p></dd>
  5254. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  5255. <dd><p>sum of squared vertical differences
  5256. </p></dd>
  5257. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  5258. <dd><p>noise preserving sum of squared differences
  5259. </p></dd>
  5260. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  5261. <dd><p>5/3 wavelet, only used in snow
  5262. </p></dd>
  5263. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  5264. <dd><p>9/7 wavelet, only used in snow
  5265. </p></dd>
  5266. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  5267. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  5268. </dl>
  5269. </dd>
  5270. <dt><samp class="option">dia_size <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5271. <dd><p>Set diamond type &amp; size for motion estimation.
  5272. </p><dl class="table">
  5273. <dt>&lsquo;<samp class="samp">(1024, INT_MAX)</samp>&rsquo;</dt>
  5274. <dd><p>full motion estimation(slowest)
  5275. </p></dd>
  5276. <dt>&lsquo;<samp class="samp">(768, 1024]</samp>&rsquo;</dt>
  5277. <dd><p>umh motion estimation
  5278. </p></dd>
  5279. <dt>&lsquo;<samp class="samp">(512, 768]</samp>&rsquo;</dt>
  5280. <dd><p>hex motion estimation
  5281. </p></dd>
  5282. <dt>&lsquo;<samp class="samp">(256, 512]</samp>&rsquo;</dt>
  5283. <dd><p>l2s diamond motion estimation
  5284. </p></dd>
  5285. <dt>&lsquo;<samp class="samp">[2,256]</samp>&rsquo;</dt>
  5286. <dd><p>var diamond motion estimation
  5287. </p></dd>
  5288. <dt>&lsquo;<samp class="samp">(-1, 2)</samp>&rsquo;</dt>
  5289. <dd><p>small diamond motion estimation
  5290. </p></dd>
  5291. <dt>&lsquo;<samp class="samp">-1</samp>&rsquo;</dt>
  5292. <dd><p>funny diamond motion estimation
  5293. </p></dd>
  5294. <dt>&lsquo;<samp class="samp">(INT_MIN, -1)</samp>&rsquo;</dt>
  5295. <dd><p>sab diamond motion estimation
  5296. </p></dd>
  5297. </dl>
  5298. </dd>
  5299. <dt><samp class="option">last_pred <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5300. <dd><p>Set amount of motion predictors from the previous frame.
  5301. </p>
  5302. </dd>
  5303. <dt><samp class="option">precmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5304. <dd><p>Set pre motion estimation compare function.
  5305. </p>
  5306. <p>Possible values:
  5307. </p><dl class="table">
  5308. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  5309. <dd><p>sum of absolute differences, fast (default)
  5310. </p></dd>
  5311. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  5312. <dd><p>sum of squared errors
  5313. </p></dd>
  5314. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  5315. <dd><p>sum of absolute Hadamard transformed differences
  5316. </p></dd>
  5317. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  5318. <dd><p>sum of absolute DCT transformed differences
  5319. </p></dd>
  5320. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  5321. <dd><p>sum of squared quantization errors (avoid, low quality)
  5322. </p></dd>
  5323. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  5324. <dd><p>number of bits needed for the block
  5325. </p></dd>
  5326. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  5327. <dd><p>rate distortion optimal, slow
  5328. </p></dd>
  5329. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  5330. <dd><p>0
  5331. </p></dd>
  5332. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  5333. <dd><p>sum of absolute vertical differences
  5334. </p></dd>
  5335. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  5336. <dd><p>sum of squared vertical differences
  5337. </p></dd>
  5338. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  5339. <dd><p>noise preserving sum of squared differences
  5340. </p></dd>
  5341. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  5342. <dd><p>5/3 wavelet, only used in snow
  5343. </p></dd>
  5344. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  5345. <dd><p>9/7 wavelet, only used in snow
  5346. </p></dd>
  5347. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  5348. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  5349. </dl>
  5350. </dd>
  5351. <dt><samp class="option">pre_dia_size <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5352. <dd><p>Set diamond type &amp; size for motion estimation pre-pass.
  5353. </p>
  5354. </dd>
  5355. <dt><samp class="option">subq <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5356. <dd><p>Set sub pel motion estimation quality.
  5357. </p>
  5358. </dd>
  5359. <dt><samp class="option">me_range <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5360. <dd><p>Set limit motion vectors range (1023 for DivX player).
  5361. </p>
  5362. </dd>
  5363. <dt><samp class="option">global_quality <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  5364. <dt><samp class="option">slice_flags <var class="var">integer</var></samp></dt>
  5365. <dt><samp class="option">mbd <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5366. <dd><p>Set macroblock decision algorithm (high quality mode).
  5367. </p>
  5368. <p>Possible values:
  5369. </p><dl class="table">
  5370. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  5371. <dd><p>use mbcmp (default)
  5372. </p></dd>
  5373. <dt>&lsquo;<samp class="samp">bits</samp>&rsquo;</dt>
  5374. <dd><p>use fewest bits
  5375. </p></dd>
  5376. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  5377. <dd><p>use best rate distortion
  5378. </p></dd>
  5379. </dl>
  5380. </dd>
  5381. <dt><samp class="option">rc_init_occupancy <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5382. <dd><p>Set number of bits which should be loaded into the rc buffer before
  5383. decoding starts.
  5384. </p>
  5385. </dd>
  5386. <dt><samp class="option">flags2 <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  5387. <dd>
  5388. <p>Possible values:
  5389. </p><dl class="table">
  5390. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  5391. <dd><p>Allow non spec compliant speedup tricks.
  5392. </p></dd>
  5393. <dt>&lsquo;<samp class="samp">noout</samp>&rsquo;</dt>
  5394. <dd><p>Skip bitstream encoding.
  5395. </p></dd>
  5396. <dt>&lsquo;<samp class="samp">ignorecrop</samp>&rsquo;</dt>
  5397. <dd><p>Ignore cropping information from sps.
  5398. </p></dd>
  5399. <dt>&lsquo;<samp class="samp">local_header</samp>&rsquo;</dt>
  5400. <dd><p>Place global headers at every keyframe instead of in extradata.
  5401. </p></dd>
  5402. <dt>&lsquo;<samp class="samp">chunks</samp>&rsquo;</dt>
  5403. <dd><p>Frame data might be split into multiple chunks.
  5404. </p></dd>
  5405. <dt>&lsquo;<samp class="samp">showall</samp>&rsquo;</dt>
  5406. <dd><p>Show all frames before the first keyframe.
  5407. </p></dd>
  5408. <dt>&lsquo;<samp class="samp">export_mvs</samp>&rsquo;</dt>
  5409. <dd><p>Export motion vectors into frame side-data (see <code class="code">AV_FRAME_DATA_MOTION_VECTORS</code>)
  5410. for codecs that support it. See also <samp class="file">doc/examples/export_mvs.c</samp>.
  5411. </p></dd>
  5412. <dt>&lsquo;<samp class="samp">skip_manual</samp>&rsquo;</dt>
  5413. <dd><p>Do not skip samples and export skip information as frame side data.
  5414. </p></dd>
  5415. <dt>&lsquo;<samp class="samp">ass_ro_flush_noop</samp>&rsquo;</dt>
  5416. <dd><p>Do not reset ASS ReadOrder field on flush.
  5417. </p></dd>
  5418. <dt>&lsquo;<samp class="samp">icc_profiles</samp>&rsquo;</dt>
  5419. <dd><p>Generate/parse embedded ICC profiles from/to colorimetry tags.
  5420. </p></dd>
  5421. </dl>
  5422. </dd>
  5423. <dt><samp class="option">export_side_data <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  5424. <dd>
  5425. <p>Possible values:
  5426. </p><dl class="table">
  5427. <dt>&lsquo;<samp class="samp">mvs</samp>&rsquo;</dt>
  5428. <dd><p>Export motion vectors into frame side-data (see <code class="code">AV_FRAME_DATA_MOTION_VECTORS</code>)
  5429. for codecs that support it. See also <samp class="file">doc/examples/export_mvs.c</samp>.
  5430. </p></dd>
  5431. <dt>&lsquo;<samp class="samp">prft</samp>&rsquo;</dt>
  5432. <dd><p>Export encoder Producer Reference Time into packet side-data (see <code class="code">AV_PKT_DATA_PRFT</code>)
  5433. for codecs that support it.
  5434. </p></dd>
  5435. <dt>&lsquo;<samp class="samp">venc_params</samp>&rsquo;</dt>
  5436. <dd><p>Export video encoding parameters through frame side data (see <code class="code">AV_FRAME_DATA_VIDEO_ENC_PARAMS</code>)
  5437. for codecs that support it. At present, those are H.264 and VP9.
  5438. </p></dd>
  5439. <dt>&lsquo;<samp class="samp">film_grain</samp>&rsquo;</dt>
  5440. <dd><p>Export film grain parameters through frame side data (see <code class="code">AV_FRAME_DATA_FILM_GRAIN_PARAMS</code>).
  5441. Supported at present by AV1 decoders.
  5442. </p></dd>
  5443. <dt>&lsquo;<samp class="samp">enhancements</samp>&rsquo;</dt>
  5444. <dd><p>Export picture enhancement metadata through frame side data, e.g. LCEVC (see <code class="code">AV_FRAME_DATA_LCEVC</code>).
  5445. </p></dd>
  5446. </dl>
  5447. </dd>
  5448. <dt><samp class="option">threads <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5449. <dd><p>Set the number of threads to be used, in case the selected codec
  5450. implementation supports multi-threading.
  5451. </p>
  5452. <p>Possible values:
  5453. </p><dl class="table">
  5454. <dt>&lsquo;<samp class="samp">auto, 0</samp>&rsquo;</dt>
  5455. <dd><p>automatically select the number of threads to set
  5456. </p></dd>
  5457. </dl>
  5458. <p>Default value is &lsquo;<samp class="samp">auto</samp>&rsquo;.
  5459. </p>
  5460. </dd>
  5461. <dt><samp class="option">dc <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5462. <dd><p>Set intra_dc_precision.
  5463. </p>
  5464. </dd>
  5465. <dt><samp class="option">nssew <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5466. <dd><p>Set nsse weight.
  5467. </p>
  5468. </dd>
  5469. <dt><samp class="option">skip_top <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5470. <dd><p>Set number of macroblock rows at the top which are skipped.
  5471. </p>
  5472. </dd>
  5473. <dt><samp class="option">skip_bottom <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5474. <dd><p>Set number of macroblock rows at the bottom which are skipped.
  5475. </p>
  5476. </dd>
  5477. <dt><samp class="option">profile <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  5478. <dd>
  5479. <p>Set encoder codec profile. Default value is &lsquo;<samp class="samp">unknown</samp>&rsquo;. Encoder specific
  5480. profiles are documented in the relevant encoder documentation.
  5481. </p>
  5482. </dd>
  5483. <dt><samp class="option">level <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  5484. <dd>
  5485. <p>Set the encoder level. This level depends on the specific codec, and
  5486. might correspond to the profile level. It is set by default to
  5487. &lsquo;<samp class="samp">unknown</samp>&rsquo;.
  5488. </p>
  5489. <p>Possible values:
  5490. </p><dl class="table">
  5491. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  5492. </dl>
  5493. </dd>
  5494. <dt><samp class="option">lowres <var class="var">integer</var> (<em class="emph">decoding,audio,video</em>)</samp></dt>
  5495. <dd><p>Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
  5496. </p>
  5497. </dd>
  5498. <dt><samp class="option">mblmin <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5499. <dd><p>Set min macroblock lagrange factor (VBR).
  5500. </p>
  5501. </dd>
  5502. <dt><samp class="option">mblmax <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5503. <dd><p>Set max macroblock lagrange factor (VBR).
  5504. </p>
  5505. </dd>
  5506. <dt><samp class="option">skip_loop_filter <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5507. <dt><samp class="option">skip_idct <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5508. <dt><samp class="option">skip_frame <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5509. <dd>
  5510. <p>Make decoder discard processing depending on the frame type selected
  5511. by the option value.
  5512. </p>
  5513. <p><samp class="option">skip_loop_filter</samp> skips frame loop filtering, <samp class="option">skip_idct</samp>
  5514. skips frame IDCT/dequantization, <samp class="option">skip_frame</samp> skips decoding.
  5515. </p>
  5516. <p>Possible values:
  5517. </p><dl class="table">
  5518. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  5519. <dd><p>Discard no frame.
  5520. </p>
  5521. </dd>
  5522. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  5523. <dd><p>Discard useless frames like 0-sized frames.
  5524. </p>
  5525. </dd>
  5526. <dt>&lsquo;<samp class="samp">noref</samp>&rsquo;</dt>
  5527. <dd><p>Discard all non-reference frames.
  5528. </p>
  5529. </dd>
  5530. <dt>&lsquo;<samp class="samp">bidir</samp>&rsquo;</dt>
  5531. <dd><p>Discard all bidirectional frames.
  5532. </p>
  5533. </dd>
  5534. <dt>&lsquo;<samp class="samp">nokey</samp>&rsquo;</dt>
  5535. <dd><p>Discard all frames excepts keyframes.
  5536. </p>
  5537. </dd>
  5538. <dt>&lsquo;<samp class="samp">nointra</samp>&rsquo;</dt>
  5539. <dd><p>Discard all frames except I frames.
  5540. </p>
  5541. </dd>
  5542. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  5543. <dd><p>Discard all frames.
  5544. </p></dd>
  5545. </dl>
  5546. <p>Default value is &lsquo;<samp class="samp">default</samp>&rsquo;.
  5547. </p>
  5548. </dd>
  5549. <dt><samp class="option">bidir_refine <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5550. <dd><p>Refine the two motion vectors used in bidirectional macroblocks.
  5551. </p>
  5552. </dd>
  5553. <dt><samp class="option">keyint_min <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5554. <dd><p>Set minimum interval between IDR-frames.
  5555. </p>
  5556. </dd>
  5557. <dt><samp class="option">refs <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5558. <dd><p>Set reference frames to consider for motion compensation.
  5559. </p>
  5560. </dd>
  5561. <dt><samp class="option">trellis <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  5562. <dd><p>Set rate-distortion optimal quantization.
  5563. </p>
  5564. </dd>
  5565. <dt><samp class="option">mv0_threshold <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5566. <dt><samp class="option">compression_level <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  5567. <dt><samp class="option">bits_per_raw_sample <var class="var">integer</var></samp></dt>
  5568. <dt><samp class="option">channel_layout <var class="var">integer</var> (<em class="emph">decoding/encoding,audio</em>)</samp></dt>
  5569. <dd><p>See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#channel-layout-syntax">the Channel Layout section in the ffmpeg-utils(1) manual</a>
  5570. for the required syntax.
  5571. </p>
  5572. </dd>
  5573. <dt><samp class="option">rc_max_vbv_use <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5574. <dt><samp class="option">rc_min_vbv_use <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5575. <dt><samp class="option">color_primaries <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5576. <dd><p>Possible values:
  5577. </p><dl class="table">
  5578. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  5579. <dd><p>BT.709
  5580. </p></dd>
  5581. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  5582. <dd><p>BT.470 M
  5583. </p></dd>
  5584. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  5585. <dd><p>BT.470 BG
  5586. </p></dd>
  5587. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  5588. <dd><p>SMPTE 170 M
  5589. </p></dd>
  5590. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  5591. <dd><p>SMPTE 240 M
  5592. </p></dd>
  5593. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  5594. <dd><p>Film
  5595. </p></dd>
  5596. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  5597. <dd><p>BT.2020
  5598. </p></dd>
  5599. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  5600. <dt>&lsquo;<samp class="samp">smpte428_1</samp>&rsquo;</dt>
  5601. <dd><p>SMPTE ST 428-1
  5602. </p></dd>
  5603. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  5604. <dd><p>SMPTE 431-2
  5605. </p></dd>
  5606. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  5607. <dd><p>SMPTE 432-1
  5608. </p></dd>
  5609. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  5610. <dd><p>JEDEC P22
  5611. </p></dd>
  5612. </dl>
  5613. </dd>
  5614. <dt><samp class="option">color_trc <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5615. <dd><p>Possible values:
  5616. </p><dl class="table">
  5617. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  5618. <dd><p>BT.709
  5619. </p></dd>
  5620. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  5621. <dd><p>BT.470 M
  5622. </p></dd>
  5623. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  5624. <dd><p>BT.470 BG
  5625. </p></dd>
  5626. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  5627. <dd><p>SMPTE 170 M
  5628. </p></dd>
  5629. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  5630. <dd><p>SMPTE 240 M
  5631. </p></dd>
  5632. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  5633. <dd><p>Linear
  5634. </p></dd>
  5635. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  5636. <dt>&lsquo;<samp class="samp">log100</samp>&rsquo;</dt>
  5637. <dd><p>Log
  5638. </p></dd>
  5639. <dt>&lsquo;<samp class="samp">log_sqrt</samp>&rsquo;</dt>
  5640. <dt>&lsquo;<samp class="samp">log316</samp>&rsquo;</dt>
  5641. <dd><p>Log square root
  5642. </p></dd>
  5643. <dt>&lsquo;<samp class="samp">iec61966_2_4</samp>&rsquo;</dt>
  5644. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  5645. <dd><p>IEC 61966-2-4
  5646. </p></dd>
  5647. <dt>&lsquo;<samp class="samp">bt1361</samp>&rsquo;</dt>
  5648. <dt>&lsquo;<samp class="samp">bt1361e</samp>&rsquo;</dt>
  5649. <dd><p>BT.1361
  5650. </p></dd>
  5651. <dt>&lsquo;<samp class="samp">iec61966_2_1</samp>&rsquo;</dt>
  5652. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  5653. <dd><p>IEC 61966-2-1
  5654. </p></dd>
  5655. <dt>&lsquo;<samp class="samp">bt2020_10</samp>&rsquo;</dt>
  5656. <dt>&lsquo;<samp class="samp">bt2020_10bit</samp>&rsquo;</dt>
  5657. <dd><p>BT.2020 - 10 bit
  5658. </p></dd>
  5659. <dt>&lsquo;<samp class="samp">bt2020_12</samp>&rsquo;</dt>
  5660. <dt>&lsquo;<samp class="samp">bt2020_12bit</samp>&rsquo;</dt>
  5661. <dd><p>BT.2020 - 12 bit
  5662. </p></dd>
  5663. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  5664. <dd><p>SMPTE ST 2084
  5665. </p></dd>
  5666. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  5667. <dt>&lsquo;<samp class="samp">smpte428_1</samp>&rsquo;</dt>
  5668. <dd><p>SMPTE ST 428-1
  5669. </p></dd>
  5670. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  5671. <dd><p>ARIB STD-B67
  5672. </p></dd>
  5673. </dl>
  5674. </dd>
  5675. <dt><samp class="option">colorspace <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5676. <dd><p>Possible values:
  5677. </p><dl class="table">
  5678. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  5679. <dd><p>RGB
  5680. </p></dd>
  5681. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  5682. <dd><p>BT.709
  5683. </p></dd>
  5684. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  5685. <dd><p>FCC
  5686. </p></dd>
  5687. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  5688. <dd><p>BT.470 BG
  5689. </p></dd>
  5690. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  5691. <dd><p>SMPTE 170 M
  5692. </p></dd>
  5693. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  5694. <dd><p>SMPTE 240 M
  5695. </p></dd>
  5696. <dt>&lsquo;<samp class="samp">ycocg</samp>&rsquo;</dt>
  5697. <dd><p>YCOCG
  5698. </p></dd>
  5699. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  5700. <dt>&lsquo;<samp class="samp">bt2020_ncl</samp>&rsquo;</dt>
  5701. <dd><p>BT.2020 NCL
  5702. </p></dd>
  5703. <dt>&lsquo;<samp class="samp">bt2020c</samp>&rsquo;</dt>
  5704. <dt>&lsquo;<samp class="samp">bt2020_cl</samp>&rsquo;</dt>
  5705. <dd><p>BT.2020 CL
  5706. </p></dd>
  5707. <dt>&lsquo;<samp class="samp">smpte2085</samp>&rsquo;</dt>
  5708. <dd><p>SMPTE 2085
  5709. </p></dd>
  5710. <dt>&lsquo;<samp class="samp">chroma-derived-nc</samp>&rsquo;</dt>
  5711. <dd><p>Chroma-derived NCL
  5712. </p></dd>
  5713. <dt>&lsquo;<samp class="samp">chroma-derived-c</samp>&rsquo;</dt>
  5714. <dd><p>Chroma-derived CL
  5715. </p></dd>
  5716. <dt>&lsquo;<samp class="samp">ictcp</samp>&rsquo;</dt>
  5717. <dd><p>ICtCp
  5718. </p></dd>
  5719. </dl>
  5720. </dd>
  5721. <dt><samp class="option">color_range <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5722. <dd><p>If used as input parameter, it serves as a hint to the decoder, which
  5723. color_range the input has.
  5724. Possible values:
  5725. </p><dl class="table">
  5726. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  5727. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  5728. <dt>&lsquo;<samp class="samp">limited</samp>&rsquo;</dt>
  5729. <dd><p>MPEG (219*2^(n-8))
  5730. </p></dd>
  5731. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  5732. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  5733. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  5734. <dd><p>JPEG (2^n-1)
  5735. </p></dd>
  5736. </dl>
  5737. </dd>
  5738. <dt><samp class="option">chroma_sample_location <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5739. <dd><p>Possible values:
  5740. </p><dl class="table">
  5741. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  5742. <dt>&lsquo;<samp class="samp">center</samp>&rsquo;</dt>
  5743. <dt>&lsquo;<samp class="samp">topleft</samp>&rsquo;</dt>
  5744. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  5745. <dt>&lsquo;<samp class="samp">bottomleft</samp>&rsquo;</dt>
  5746. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  5747. </dl>
  5748. </dd>
  5749. <dt><samp class="option">alpha_mode <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5750. <dd><p>Possible values:
  5751. </p><dl class="table">
  5752. <dt>&lsquo;<samp class="samp">premultiplied</samp>&rsquo;</dt>
  5753. <dt>&lsquo;<samp class="samp">straight</samp>&rsquo;</dt>
  5754. </dl>
  5755. </dd>
  5756. <dt><samp class="option">log_level_offset <var class="var">integer</var></samp></dt>
  5757. <dd><p>Set the log level offset.
  5758. </p>
  5759. </dd>
  5760. <dt><samp class="option">slices <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5761. <dd><p>Number of slices, used in parallelized encoding.
  5762. </p>
  5763. </dd>
  5764. <dt><samp class="option">thread_type <var class="var">flags</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5765. <dd><p>Select which multithreading methods to use.
  5766. </p>
  5767. <p>Use of &lsquo;<samp class="samp">frame</samp>&rsquo; will increase decoding delay by one frame per
  5768. thread, so clients which cannot provide future frames should not use
  5769. it.
  5770. </p>
  5771. <p>Possible values:
  5772. </p><dl class="table">
  5773. <dt>&lsquo;<samp class="samp">slice</samp>&rsquo;</dt>
  5774. <dd><p>Decode more than one part of a single frame at once.
  5775. </p>
  5776. <p>Multithreading using slices works only when the video was encoded with
  5777. slices.
  5778. </p>
  5779. </dd>
  5780. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  5781. <dd><p>Decode more than one frame at once.
  5782. </p></dd>
  5783. </dl>
  5784. <p>Default value is &lsquo;<samp class="samp">slice+frame</samp>&rsquo;.
  5785. </p>
  5786. </dd>
  5787. <dt><samp class="option">audio_service_type <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  5788. <dd><p>Set audio service type.
  5789. </p>
  5790. <p>Possible values:
  5791. </p><dl class="table">
  5792. <dt>&lsquo;<samp class="samp">ma</samp>&rsquo;</dt>
  5793. <dd><p>Main Audio Service
  5794. </p></dd>
  5795. <dt>&lsquo;<samp class="samp">ef</samp>&rsquo;</dt>
  5796. <dd><p>Effects
  5797. </p></dd>
  5798. <dt>&lsquo;<samp class="samp">vi</samp>&rsquo;</dt>
  5799. <dd><p>Visually Impaired
  5800. </p></dd>
  5801. <dt>&lsquo;<samp class="samp">hi</samp>&rsquo;</dt>
  5802. <dd><p>Hearing Impaired
  5803. </p></dd>
  5804. <dt>&lsquo;<samp class="samp">di</samp>&rsquo;</dt>
  5805. <dd><p>Dialogue
  5806. </p></dd>
  5807. <dt>&lsquo;<samp class="samp">co</samp>&rsquo;</dt>
  5808. <dd><p>Commentary
  5809. </p></dd>
  5810. <dt>&lsquo;<samp class="samp">em</samp>&rsquo;</dt>
  5811. <dd><p>Emergency
  5812. </p></dd>
  5813. <dt>&lsquo;<samp class="samp">vo</samp>&rsquo;</dt>
  5814. <dd><p>Voice Over
  5815. </p></dd>
  5816. <dt>&lsquo;<samp class="samp">ka</samp>&rsquo;</dt>
  5817. <dd><p>Karaoke
  5818. </p></dd>
  5819. </dl>
  5820. </dd>
  5821. <dt><samp class="option">request_sample_fmt <var class="var">sample_fmt</var> (<em class="emph">decoding,audio</em>)</samp></dt>
  5822. <dd><p>Set sample format audio decoders should prefer. Default value is
  5823. <code class="code">none</code>.
  5824. </p>
  5825. </dd>
  5826. <dt><samp class="option">pkt_timebase <var class="var">rational number</var></samp></dt>
  5827. <dt><samp class="option">sub_charenc <var class="var">encoding</var> (<em class="emph">decoding,subtitles</em>)</samp></dt>
  5828. <dd><p>Set the input subtitles character encoding.
  5829. </p>
  5830. </dd>
  5831. <dt><samp class="option">field_order <var class="var">field_order</var> (<em class="emph">video</em>)</samp></dt>
  5832. <dd><p>Set/override the field order of the video.
  5833. Possible values:
  5834. </p><dl class="table">
  5835. <dt>&lsquo;<samp class="samp">progressive</samp>&rsquo;</dt>
  5836. <dd><p>Progressive video
  5837. </p></dd>
  5838. <dt>&lsquo;<samp class="samp">tt</samp>&rsquo;</dt>
  5839. <dd><p>Interlaced video, top field coded and displayed first
  5840. </p></dd>
  5841. <dt>&lsquo;<samp class="samp">bb</samp>&rsquo;</dt>
  5842. <dd><p>Interlaced video, bottom field coded and displayed first
  5843. </p></dd>
  5844. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  5845. <dd><p>Interlaced video, top coded first, bottom displayed first
  5846. </p></dd>
  5847. <dt>&lsquo;<samp class="samp">bt</samp>&rsquo;</dt>
  5848. <dd><p>Interlaced video, bottom coded first, top displayed first
  5849. </p></dd>
  5850. </dl>
  5851. </dd>
  5852. <dt><samp class="option">skip_alpha <var class="var">bool</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5853. <dd><p>Set to 1 to disable processing alpha (transparency). This works like the
  5854. &lsquo;<samp class="samp">gray</samp>&rsquo; flag in the <samp class="option">flags</samp> option which skips chroma information
  5855. instead of alpha. Default is 0.
  5856. </p>
  5857. </dd>
  5858. <dt><samp class="option">codec_whitelist <var class="var">list</var> (<em class="emph">input</em>)</samp></dt>
  5859. <dd><p>&quot;,&quot; separated list of allowed decoders. By default all are allowed.
  5860. </p>
  5861. </dd>
  5862. <dt><samp class="option">dump_separator <var class="var">string</var> (<em class="emph">input</em>)</samp></dt>
  5863. <dd><p>Separator used to separate the fields printed on the command line about the
  5864. Stream parameters.
  5865. For example, to separate the fields with newlines and indentation:
  5866. </p><div class="example">
  5867. <pre class="example-preformatted">ffprobe -dump_separator &quot;
  5868. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  5869. </pre></div>
  5870. </dd>
  5871. <dt><samp class="option">max_pixels <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5872. <dd><p>Maximum number of pixels per image. This value can be used to avoid out of
  5873. memory failures due to large images.
  5874. </p>
  5875. </dd>
  5876. <dt><samp class="option">apply_cropping <var class="var">bool</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5877. <dd><p>Enable cropping if cropping parameters are multiples of the required
  5878. alignment for the left and top parameters. If the alignment is not met the
  5879. cropping will be partially applied to maintain alignment.
  5880. Default is 1 (enabled).
  5881. Note: The required alignment depends on if <code class="code">AV_CODEC_FLAG_UNALIGNED</code> is set and the
  5882. CPU. <code class="code">AV_CODEC_FLAG_UNALIGNED</code> cannot be changed from the command line. Also hardware
  5883. decoders will not apply left/top Cropping.
  5884. </p>
  5885. </dd>
  5886. </dl>
  5887. <a name="Decoders"></a>
  5888. <h2 class="chapter">9 Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Decoders" aria-hidden="true">TOC</a></span></h2>
  5889. <p>Decoders are configured elements in FFmpeg which allow the decoding of
  5890. multimedia streams.
  5891. </p>
  5892. <p>When you configure your FFmpeg build, all the supported native decoders
  5893. are enabled by default. Decoders requiring an external library must be enabled
  5894. manually via the corresponding <code class="code">--enable-lib</code> option. You can list all
  5895. available decoders using the configure option <code class="code">--list-decoders</code>.
  5896. </p>
  5897. <p>You can disable all the decoders with the configure option
  5898. <code class="code">--disable-decoders</code> and selectively enable / disable single decoders
  5899. with the options <code class="code">--enable-decoder=<var class="var">DECODER</var></code> /
  5900. <code class="code">--disable-decoder=<var class="var">DECODER</var></code>.
  5901. </p>
  5902. <p>The option <code class="code">-decoders</code> of the ff* tools will display the list of
  5903. enabled decoders.
  5904. </p>
  5905. <a name="Video-Decoders"></a>
  5906. <h2 class="chapter">10 Video Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Decoders" aria-hidden="true">TOC</a></span></h2>
  5907. <p>A description of some of the currently available video decoders
  5908. follows.
  5909. </p>
  5910. <a name="av1"></a>
  5911. <h3 class="section">10.1 av1<span class="pull-right"><a class="anchor hidden-xs" href="#av1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-av1" aria-hidden="true">TOC</a></span></h3>
  5912. <p>AOMedia Video 1 (AV1) decoder.
  5913. </p>
  5914. <a name="Options-1"></a>
  5915. <h4 class="subsection">10.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-1" aria-hidden="true">TOC</a></span></h4>
  5916. <dl class="table">
  5917. <dt><samp class="option">operating_point</samp></dt>
  5918. <dd><p>Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0.
  5919. </p>
  5920. </dd>
  5921. </dl>
  5922. <a name="hevc"></a>
  5923. <h3 class="section">10.2 hevc<span class="pull-right"><a class="anchor hidden-xs" href="#hevc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hevc" aria-hidden="true">TOC</a></span></h3>
  5924. <p>HEVC (AKA ITU-T H.265 or ISO/IEC 23008-2) decoder.
  5925. </p>
  5926. <p>The decoder supports MV-HEVC multiview streams with at most two views. Views to
  5927. be output are selected by supplying a list of view IDs to the decoder (the
  5928. <samp class="option">view_ids</samp> option). This option may be set either statically before
  5929. decoder init, or from the <code class="code">get_format()</code> callback - useful for the case
  5930. when the view count or IDs change dynamically during decoding.
  5931. </p>
  5932. <p>Only the base layer is decoded by default.
  5933. </p>
  5934. <p>Note that if you are using the <code class="code">ffmpeg</code> CLI tool, you should be using view
  5935. specifiers as documented in its manual, rather than the options documented here.
  5936. </p>
  5937. <a name="Options-2"></a>
  5938. <h4 class="subsection">10.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-2" aria-hidden="true">TOC</a></span></h4>
  5939. <dl class="table">
  5940. <dt><samp class="option">view_ids (MV-HEVC)</samp></dt>
  5941. <dd><p>Specify a list of view IDs that should be output. This option can also be set to
  5942. a single &rsquo;-1&rsquo;, which will cause all views defined in the VPS to be decoded and
  5943. output.
  5944. </p>
  5945. </dd>
  5946. <dt><samp class="option">view_ids_available (MV-HEVC)</samp></dt>
  5947. <dd><p>This option may be read by the caller to retrieve an array of view IDs available
  5948. in the active VPS. The array is empty for single-layer video.
  5949. </p>
  5950. <p>The value of this option is guaranteed to be accurate when read from the
  5951. <code class="code">get_format()</code> callback. It may also be set at other times (e.g. after
  5952. opening the decoder), but the value is informational only and may be incorrect
  5953. (e.g. when the stream contains multiple distinct VPS NALUs).
  5954. </p>
  5955. </dd>
  5956. <dt><samp class="option">view_pos_available (MV-HEVC)</samp></dt>
  5957. <dd><p>This option may be read by the caller to retrieve an array of view positions
  5958. (left, right, or unspecified) available in the active VPS, as
  5959. <code class="code">AVStereo3DView</code> values. When the array is available, its elements apply to
  5960. the corresponding elements of <samp class="option">view_ids_available</samp>, i.e.
  5961. <code class="code">view_pos_available[i]</code> contains the position of view with ID
  5962. <code class="code">view_ids_available[i]</code>.
  5963. </p>
  5964. <p>Same validity restrictions as for <samp class="option">view_ids_available</samp> apply to
  5965. this option.
  5966. </p>
  5967. </dd>
  5968. </dl>
  5969. <a name="rawvideo"></a>
  5970. <h3 class="section">10.3 rawvideo<span class="pull-right"><a class="anchor hidden-xs" href="#rawvideo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rawvideo" aria-hidden="true">TOC</a></span></h3>
  5971. <p>Raw video decoder.
  5972. </p>
  5973. <p>This decoder decodes rawvideo streams.
  5974. </p>
  5975. <a name="Options-3"></a>
  5976. <h4 class="subsection">10.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-3" aria-hidden="true">TOC</a></span></h4>
  5977. <dl class="table">
  5978. <dt><samp class="option">top <var class="var">top_field_first</var></samp></dt>
  5979. <dd><p>Specify the assumed field type of the input video.
  5980. </p><dl class="table">
  5981. <dt><samp class="option">-1</samp></dt>
  5982. <dd><p>the video is assumed to be progressive (default)
  5983. </p></dd>
  5984. <dt><samp class="option">0</samp></dt>
  5985. <dd><p>bottom-field-first is assumed
  5986. </p></dd>
  5987. <dt><samp class="option">1</samp></dt>
  5988. <dd><p>top-field-first is assumed
  5989. </p></dd>
  5990. </dl>
  5991. </dd>
  5992. </dl>
  5993. <a name="libdav1d"></a>
  5994. <h3 class="section">10.4 libdav1d<span class="pull-right"><a class="anchor hidden-xs" href="#libdav1d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libdav1d" aria-hidden="true">TOC</a></span></h3>
  5995. <p>dav1d AV1 decoder.
  5996. </p>
  5997. <p>libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec.
  5998. Requires the presence of the libdav1d headers and library during configuration.
  5999. You need to explicitly configure the build with <code class="code">--enable-libdav1d</code>.
  6000. </p>
  6001. <a name="Options-4"></a>
  6002. <h4 class="subsection">10.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-4" aria-hidden="true">TOC</a></span></h4>
  6003. <p>The following options are supported by the libdav1d wrapper.
  6004. </p>
  6005. <dl class="table">
  6006. <dt><samp class="option">max_frame_delay</samp></dt>
  6007. <dd><p>Set max amount of frames the decoder may buffer internally. The default value is 0
  6008. (autodetect).
  6009. </p>
  6010. </dd>
  6011. <dt><samp class="option">filmgrain</samp></dt>
  6012. <dd><p>Apply film grain to the decoded video if present in the bitstream. Defaults to the
  6013. internal default of the library.
  6014. This option is deprecated and will be removed in the future. See the global option
  6015. <code class="code">export_side_data</code> to export Film Grain parameters instead of applying it.
  6016. </p>
  6017. </dd>
  6018. <dt><samp class="option">oppoint</samp></dt>
  6019. <dd><p>Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the
  6020. internal default of the library.
  6021. </p>
  6022. </dd>
  6023. <dt><samp class="option">alllayers</samp></dt>
  6024. <dd><p>Output all spatial layers of a scalable AV1 bitstream. The default value is false.
  6025. </p>
  6026. </dd>
  6027. </dl>
  6028. <a name="libdavs2"></a>
  6029. <h3 class="section">10.5 libdavs2<span class="pull-right"><a class="anchor hidden-xs" href="#libdavs2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libdavs2" aria-hidden="true">TOC</a></span></h3>
  6030. <p>AVS2-P2/IEEE1857.4 video decoder wrapper.
  6031. </p>
  6032. <p>This decoder allows libavcodec to decode AVS2 streams with davs2 library.
  6033. </p>
  6034. <a name="libuavs3d"></a>
  6035. <h3 class="section">10.6 libuavs3d<span class="pull-right"><a class="anchor hidden-xs" href="#libuavs3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libuavs3d" aria-hidden="true">TOC</a></span></h3>
  6036. <p>AVS3-P2/IEEE1857.10 video decoder.
  6037. </p>
  6038. <p>libuavs3d allows libavcodec to decode AVS3 streams.
  6039. Requires the presence of the libuavs3d headers and library during configuration.
  6040. You need to explicitly configure the build with <code class="code">--enable-libuavs3d</code>.
  6041. </p>
  6042. <a name="Options-5"></a>
  6043. <h4 class="subsection">10.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-5" aria-hidden="true">TOC</a></span></h4>
  6044. <p>The following option is supported by the libuavs3d wrapper.
  6045. </p>
  6046. <dl class="table">
  6047. <dt><samp class="option">frame_threads</samp></dt>
  6048. <dd><p>Set amount of frame threads to use during decoding. The default value is 0 (autodetect).
  6049. </p>
  6050. </dd>
  6051. </dl>
  6052. <a name="libxevd"></a>
  6053. <h3 class="section">10.7 libxevd<span class="pull-right"><a class="anchor hidden-xs" href="#libxevd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libxevd" aria-hidden="true">TOC</a></span></h3>
  6054. <p>eXtra-fast Essential Video Decoder (XEVD) MPEG-5 EVC decoder wrapper.
  6055. </p>
  6056. <p>This decoder requires the presence of the libxevd headers and library
  6057. during configuration. You need to explicitly configure the build with
  6058. <samp class="option">--enable-libxevd</samp>.
  6059. </p>
  6060. <p>The xevd project website is at <a class="url" href="https://github.com/mpeg5/xevd">https://github.com/mpeg5/xevd</a>.
  6061. </p>
  6062. <a name="Options-6"></a>
  6063. <h4 class="subsection">10.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-6" aria-hidden="true">TOC</a></span></h4>
  6064. <p>The following options are supported by the libxevd wrapper.
  6065. The xevd-equivalent options or values are listed in parentheses for easy migration.
  6066. </p>
  6067. <p>To get a more accurate and extensive documentation of the libxevd options,
  6068. invoke the command <code class="code">xevd_app --help</code> or consult the libxevd documentation.
  6069. </p>
  6070. <dl class="table">
  6071. <dt><samp class="option">threads (<em class="emph">threads</em>)</samp></dt>
  6072. <dd><p>Force to use a specific number of threads
  6073. </p>
  6074. </dd>
  6075. </dl>
  6076. <a name="QSV-Decoders"></a>
  6077. <h3 class="section">10.8 QSV Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#QSV-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-QSV-Decoders" aria-hidden="true">TOC</a></span></h3>
  6078. <p>The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC,
  6079. JPEG/MJPEG, VP8, VP9, AV1, VVC).
  6080. </p>
  6081. <a name="Common-Options"></a>
  6082. <h4 class="subsection">10.8.1 Common Options<span class="pull-right"><a class="anchor hidden-xs" href="#Common-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Common-Options" aria-hidden="true">TOC</a></span></h4>
  6083. <p>The following options are supported by all qsv decoders.
  6084. </p>
  6085. <dl class="table">
  6086. <dt><samp class="option"><var class="var">async_depth</var></samp></dt>
  6087. <dd><p>Internal parallelization depth, the higher the value the higher the latency.
  6088. </p>
  6089. </dd>
  6090. <dt><samp class="option"><var class="var">gpu_copy</var></samp></dt>
  6091. <dd><p>A GPU-accelerated copy between video and system memory
  6092. </p><dl class="table">
  6093. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  6094. <dt>&lsquo;<samp class="samp">on</samp>&rsquo;</dt>
  6095. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  6096. </dl>
  6097. </dd>
  6098. </dl>
  6099. <a name="HEVC-Options"></a>
  6100. <h4 class="subsection">10.8.2 HEVC Options<span class="pull-right"><a class="anchor hidden-xs" href="#HEVC-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-HEVC-Options" aria-hidden="true">TOC</a></span></h4>
  6101. <p>Extra options for hevc_qsv.
  6102. </p>
  6103. <dl class="table">
  6104. <dt><samp class="option"><var class="var">load_plugin</var></samp></dt>
  6105. <dd><p>A user plugin to load in an internal session
  6106. </p><dl class="table">
  6107. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  6108. <dt>&lsquo;<samp class="samp">hevc_sw</samp>&rsquo;</dt>
  6109. <dt>&lsquo;<samp class="samp">hevc_hw</samp>&rsquo;</dt>
  6110. </dl>
  6111. </dd>
  6112. <dt><samp class="option"><var class="var">load_plugins</var></samp></dt>
  6113. <dd><p>A :-separate list of hexadecimal plugin UIDs to load in an internal session
  6114. </p>
  6115. </dd>
  6116. </dl>
  6117. <a name="v210"></a>
  6118. <h3 class="section">10.9 v210<span class="pull-right"><a class="anchor hidden-xs" href="#v210" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-v210" aria-hidden="true">TOC</a></span></h3>
  6119. <p>Uncompressed 4:2:2 10-bit decoder.
  6120. </p>
  6121. <a name="Options-7"></a>
  6122. <h4 class="subsection">10.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-7" aria-hidden="true">TOC</a></span></h4>
  6123. <dl class="table">
  6124. <dt><samp class="option">custom_stride</samp></dt>
  6125. <dd><p>Set the line size of the v210 data in bytes. The default value is 0
  6126. (autodetect). You can use the special -1 value for a strideless v210 as seen in
  6127. BOXX files.
  6128. </p>
  6129. </dd>
  6130. </dl>
  6131. <a name="Audio-Decoders"></a>
  6132. <h2 class="chapter">11 Audio Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Decoders" aria-hidden="true">TOC</a></span></h2>
  6133. <p>A description of some of the currently available audio decoders
  6134. follows.
  6135. </p>
  6136. <a name="ac3"></a>
  6137. <h3 class="section">11.1 ac3<span class="pull-right"><a class="anchor hidden-xs" href="#ac3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ac3" aria-hidden="true">TOC</a></span></h3>
  6138. <p>AC-3 audio decoder.
  6139. </p>
  6140. <p>This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  6141. the undocumented RealAudio 3 (a.k.a. dnet).
  6142. </p>
  6143. <a name="AC_002d3-Decoder-Options"></a>
  6144. <h4 class="subsection">11.1.1 AC-3 Decoder Options<span class="pull-right"><a class="anchor hidden-xs" href="#AC_002d3-Decoder-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AC_002d3-Decoder-Options" aria-hidden="true">TOC</a></span></h4>
  6145. <dl class="table">
  6146. <dt><samp class="option">-drc_scale <var class="var">value</var></samp></dt>
  6147. <dd><p>Dynamic Range Scale Factor. The factor to apply to dynamic range values
  6148. from the AC-3 stream. This factor is applied exponentially. The default value is 1.
  6149. There are 3 notable scale factor ranges:
  6150. </p><dl class="table">
  6151. <dt><samp class="option">drc_scale == 0</samp></dt>
  6152. <dd><p>DRC disabled. Produces full range audio.
  6153. </p></dd>
  6154. <dt><samp class="option">0 &lt; drc_scale &lt;= 1</samp></dt>
  6155. <dd><p>DRC enabled. Applies a fraction of the stream DRC value.
  6156. Audio reproduction is between full range and full compression.
  6157. </p></dd>
  6158. <dt><samp class="option">drc_scale &gt; 1</samp></dt>
  6159. <dd><p>DRC enabled. Applies drc_scale asymmetrically.
  6160. Loud sounds are fully compressed. Soft sounds are enhanced.
  6161. </p></dd>
  6162. </dl>
  6163. </dd>
  6164. </dl>
  6165. <a name="flac"></a>
  6166. <h3 class="section">11.2 flac<span class="pull-right"><a class="anchor hidden-xs" href="#flac" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flac" aria-hidden="true">TOC</a></span></h3>
  6167. <p>FLAC audio decoder.
  6168. </p>
  6169. <p>This decoder aims to implement the complete FLAC specification from Xiph.
  6170. </p>
  6171. <a name="FLAC-Decoder-options"></a>
  6172. <h4 class="subsection">11.2.1 FLAC Decoder options<span class="pull-right"><a class="anchor hidden-xs" href="#FLAC-Decoder-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-FLAC-Decoder-options" aria-hidden="true">TOC</a></span></h4>
  6173. <dl class="table">
  6174. <dt><samp class="option">-use_buggy_lpc</samp></dt>
  6175. <dd><p>The lavc FLAC encoder used to produce buggy streams with high lpc values
  6176. (like the default value). This option makes it possible to decode such streams
  6177. correctly by using lavc&rsquo;s old buggy lpc logic for decoding.
  6178. </p>
  6179. </dd>
  6180. </dl>
  6181. <a name="ffwavesynth"></a>
  6182. <h3 class="section">11.3 ffwavesynth<span class="pull-right"><a class="anchor hidden-xs" href="#ffwavesynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ffwavesynth" aria-hidden="true">TOC</a></span></h3>
  6183. <p>Internal wave synthesizer.
  6184. </p>
  6185. <p>This decoder generates wave patterns according to predefined sequences. Its
  6186. use is purely internal and the format of the data it accepts is not publicly
  6187. documented.
  6188. </p>
  6189. <a name="libcelt"></a>
  6190. <h3 class="section">11.4 libcelt<span class="pull-right"><a class="anchor hidden-xs" href="#libcelt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libcelt" aria-hidden="true">TOC</a></span></h3>
  6191. <p>libcelt decoder wrapper.
  6192. </p>
  6193. <p>libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
  6194. Requires the presence of the libcelt headers and library during configuration.
  6195. You need to explicitly configure the build with <code class="code">--enable-libcelt</code>.
  6196. </p>
  6197. <a name="libgsm"></a>
  6198. <h3 class="section">11.5 libgsm<span class="pull-right"><a class="anchor hidden-xs" href="#libgsm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libgsm" aria-hidden="true">TOC</a></span></h3>
  6199. <p>libgsm decoder wrapper.
  6200. </p>
  6201. <p>libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
  6202. the presence of the libgsm headers and library during configuration. You need
  6203. to explicitly configure the build with <code class="code">--enable-libgsm</code>.
  6204. </p>
  6205. <p>This decoder supports both the ordinary GSM and the Microsoft variant.
  6206. </p>
  6207. <a name="libilbc"></a>
  6208. <h3 class="section">11.6 libilbc<span class="pull-right"><a class="anchor hidden-xs" href="#libilbc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libilbc" aria-hidden="true">TOC</a></span></h3>
  6209. <p>libilbc decoder wrapper.
  6210. </p>
  6211. <p>libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
  6212. audio codec. Requires the presence of the libilbc headers and library during
  6213. configuration. You need to explicitly configure the build with
  6214. <code class="code">--enable-libilbc</code>.
  6215. </p>
  6216. <a name="Options-8"></a>
  6217. <h4 class="subsection">11.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-8" aria-hidden="true">TOC</a></span></h4>
  6218. <p>The following option is supported by the libilbc wrapper.
  6219. </p>
  6220. <dl class="table">
  6221. <dt><samp class="option">enhance</samp></dt>
  6222. <dd>
  6223. <p>Enable the enhancement of the decoded audio when set to 1. The default
  6224. value is 0 (disabled).
  6225. </p>
  6226. </dd>
  6227. </dl>
  6228. <a name="libmpeghdec"></a>
  6229. <h3 class="section">11.7 libmpeghdec<span class="pull-right"><a class="anchor hidden-xs" href="#libmpeghdec" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libmpeghdec" aria-hidden="true">TOC</a></span></h3>
  6230. <p>libmpeghdec decoder wrapper.
  6231. </p>
  6232. <p>libmpeghdec allows libmpeghdec to decode the MPEG-H 3D audio codec.
  6233. Requires the presence of the libmpeghdec headers and library during
  6234. configuration. You need to explicitly configure the build with
  6235. <code class="code">--enable-libmpeghdec --enable-nonfree</code>.
  6236. </p>
  6237. <a name="libopencore_002damrnb"></a>
  6238. <h3 class="section">11.8 libopencore-amrnb<span class="pull-right"><a class="anchor hidden-xs" href="#libopencore_002damrnb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopencore_002damrnb" aria-hidden="true">TOC</a></span></h3>
  6239. <p>libopencore-amrnb decoder wrapper.
  6240. </p>
  6241. <p>libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
  6242. Narrowband audio codec. Using it requires the presence of the
  6243. libopencore-amrnb headers and library during configuration. You need to
  6244. explicitly configure the build with <code class="code">--enable-libopencore-amrnb</code>.
  6245. </p>
  6246. <p>An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
  6247. without this library.
  6248. </p>
  6249. <a name="libopencore_002damrwb"></a>
  6250. <h3 class="section">11.9 libopencore-amrwb<span class="pull-right"><a class="anchor hidden-xs" href="#libopencore_002damrwb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopencore_002damrwb" aria-hidden="true">TOC</a></span></h3>
  6251. <p>libopencore-amrwb decoder wrapper.
  6252. </p>
  6253. <p>libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
  6254. Wideband audio codec. Using it requires the presence of the
  6255. libopencore-amrwb headers and library during configuration. You need to
  6256. explicitly configure the build with <code class="code">--enable-libopencore-amrwb</code>.
  6257. </p>
  6258. <p>An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
  6259. without this library.
  6260. </p>
  6261. <a name="libopus"></a>
  6262. <h3 class="section">11.10 libopus<span class="pull-right"><a class="anchor hidden-xs" href="#libopus" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopus" aria-hidden="true">TOC</a></span></h3>
  6263. <p>libopus decoder wrapper.
  6264. </p>
  6265. <p>libopus allows libavcodec to decode the Opus Interactive Audio Codec.
  6266. Requires the presence of the libopus headers and library during
  6267. configuration. You need to explicitly configure the build with
  6268. <code class="code">--enable-libopus</code>.
  6269. </p>
  6270. <p>An FFmpeg native decoder for Opus exists, so users can decode Opus
  6271. without this library.
  6272. </p>
  6273. <a name="Subtitles-Decoders"></a>
  6274. <h2 class="chapter">12 Subtitles Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Subtitles-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Subtitles-Decoders" aria-hidden="true">TOC</a></span></h2>
  6275. <a name="libaribb24"></a>
  6276. <h3 class="section">12.1 libaribb24<span class="pull-right"><a class="anchor hidden-xs" href="#libaribb24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaribb24" aria-hidden="true">TOC</a></span></h3>
  6277. <p>ARIB STD-B24 caption decoder.
  6278. </p>
  6279. <p>Implements profiles A and C of the ARIB STD-B24 standard.
  6280. </p>
  6281. <a name="libaribb24-Decoder-Options"></a>
  6282. <h4 class="subsection">12.1.1 libaribb24 Decoder Options<span class="pull-right"><a class="anchor hidden-xs" href="#libaribb24-Decoder-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaribb24-Decoder-Options" aria-hidden="true">TOC</a></span></h4>
  6283. <dl class="table">
  6284. <dt><samp class="option">-aribb24-base-path <var class="var">path</var></samp></dt>
  6285. <dd><p>Sets the base path for the libaribb24 library. This is utilized for reading of
  6286. configuration files (for custom unicode conversions), and for dumping of
  6287. non-text symbols as images under that location.
  6288. </p>
  6289. <p>Unset by default.
  6290. </p>
  6291. </dd>
  6292. <dt><samp class="option">-aribb24-skip-ruby-text <var class="var">boolean</var></samp></dt>
  6293. <dd><p>Tells the decoder wrapper to skip text blocks that contain half-height ruby
  6294. text.
  6295. </p>
  6296. <p>Enabled by default.
  6297. </p>
  6298. </dd>
  6299. </dl>
  6300. <a name="libaribcaption"></a>
  6301. <h3 class="section">12.2 libaribcaption<span class="pull-right"><a class="anchor hidden-xs" href="#libaribcaption" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaribcaption" aria-hidden="true">TOC</a></span></h3>
  6302. <p>Yet another ARIB STD-B24 caption decoder using external <em class="dfn">libaribcaption</em>
  6303. library.
  6304. </p>
  6305. <p>Implements profiles A and C of the Japanese ARIB STD-B24 standard,
  6306. Brazilian ABNT NBR 15606-1, and Philippines version of ISDB-T.
  6307. </p>
  6308. <p>Requires the presence of the libaribcaption headers and library
  6309. (<a class="url" href="https://github.com/xqq/libaribcaption">https://github.com/xqq/libaribcaption</a>) during configuration.
  6310. You need to explicitly configure the build with <code class="code">--enable-libaribcaption</code>.
  6311. If both <em class="dfn">libaribb24</em> and <em class="dfn">libaribcaption</em> are enabled, <em class="dfn">libaribcaption</em>
  6312. decoder precedes.
  6313. </p>
  6314. <a name="libaribcaption-Decoder-Options"></a>
  6315. <h4 class="subsection">12.2.1 libaribcaption Decoder Options<span class="pull-right"><a class="anchor hidden-xs" href="#libaribcaption-Decoder-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaribcaption-Decoder-Options" aria-hidden="true">TOC</a></span></h4>
  6316. <dl class="table">
  6317. <dt><samp class="option">-sub_type <var class="var">subtitle_type</var></samp></dt>
  6318. <dd><p>Specifies the format of the decoded subtitles.
  6319. </p>
  6320. <dl class="table">
  6321. <dt>&lsquo;<samp class="samp">bitmap</samp>&rsquo;</dt>
  6322. <dd><p>Graphical image.
  6323. </p></dd>
  6324. <dt>&lsquo;<samp class="samp">ass</samp>&rsquo;</dt>
  6325. <dd><p>ASS formatted text.
  6326. </p></dd>
  6327. <dt>&lsquo;<samp class="samp">text</samp>&rsquo;</dt>
  6328. <dd><p>Simple text based output without formatting.
  6329. </p></dd>
  6330. </dl>
  6331. <p>The default is <em class="dfn">ass</em> as same as <em class="dfn">libaribb24</em> decoder.
  6332. Some present players (e.g., <em class="dfn">mpv</em>) expect ASS format for ARIB caption.
  6333. </p>
  6334. </dd>
  6335. <dt><samp class="option">-caption_encoding <var class="var">encoding_scheme</var></samp></dt>
  6336. <dd><p>Specifies the encoding scheme of input subtitle text.
  6337. </p>
  6338. <dl class="table">
  6339. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  6340. <dd><p>Automatically detect text encoding (default).
  6341. </p></dd>
  6342. <dt>&lsquo;<samp class="samp">jis</samp>&rsquo;</dt>
  6343. <dd><p>8bit-char JIS encoding defined in ARIB STD B24.
  6344. This encoding used in Japan for ISDB captions.
  6345. </p></dd>
  6346. <dt>&lsquo;<samp class="samp">utf8</samp>&rsquo;</dt>
  6347. <dd><p>UTF-8 encoding defined in ARIB STD B24.
  6348. This encoding is used in Philippines for ISDB-T captions.
  6349. </p></dd>
  6350. <dt>&lsquo;<samp class="samp">latin</samp>&rsquo;</dt>
  6351. <dd><p>Latin character encoding defined in ABNT NBR 15606-1.
  6352. This encoding is used in South America for SBTVD / ISDB-Tb captions.
  6353. </p></dd>
  6354. </dl>
  6355. </dd>
  6356. <dt><samp class="option">-font <var class="var">font_name[,font_name2,...]</var></samp></dt>
  6357. <dd><p>Specify comma-separated list of font family names to be used for <em class="dfn">bitmap</em>
  6358. or <em class="dfn">ass</em> type subtitle rendering.
  6359. Only first font name is used for <em class="dfn">ass</em> type subtitle.
  6360. </p>
  6361. <p>If not specified, use internally defined default font family.
  6362. </p>
  6363. </dd>
  6364. <dt><samp class="option">-ass_single_rect <var class="var">boolean</var></samp></dt>
  6365. <dd><p>ARIB STD-B24 specifies that some captions may be displayed at different
  6366. positions at a time (multi-rectangle subtitle).
  6367. Since some players (e.g., old <em class="dfn">mpv</em>) can&rsquo;t handle multiple ASS rectangles
  6368. in a single AVSubtitle, or multiple ASS rectangles of indeterminate duration
  6369. with the same start timestamp, this option can change the behavior so that
  6370. all the texts are displayed in a single ASS rectangle.
  6371. </p>
  6372. <p>The default is <var class="var">false</var>.
  6373. </p>
  6374. <p>If your player cannot handle AVSubtitles with multiple ASS rectangles properly,
  6375. set this option to <var class="var">true</var> or define <code class="env">ASS_SINGLE_RECT=1</code> to change
  6376. default behavior at compilation.
  6377. </p>
  6378. </dd>
  6379. <dt><samp class="option">-force_outline_text <var class="var">boolean</var></samp></dt>
  6380. <dd><p>Specify whether always render outline text for all characters regardless of
  6381. the indication by character style.
  6382. </p>
  6383. <p>The default is <var class="var">false</var>.
  6384. </p>
  6385. </dd>
  6386. <dt><samp class="option">-outline_width <var class="var">number</var> (0.0 - 3.0)</samp></dt>
  6387. <dd><p>Specify width for outline text, in dots (relative).
  6388. </p>
  6389. <p>The default is <var class="var">1.5</var>.
  6390. </p>
  6391. </dd>
  6392. <dt><samp class="option">-ignore_background <var class="var">boolean</var></samp></dt>
  6393. <dd><p>Specify whether to ignore background color rendering.
  6394. </p>
  6395. <p>The default is <var class="var">false</var>.
  6396. </p>
  6397. </dd>
  6398. <dt><samp class="option">-ignore_ruby <var class="var">boolean</var></samp></dt>
  6399. <dd><p>Specify whether to ignore rendering for ruby-like (furigana) characters.
  6400. </p>
  6401. <p>The default is <var class="var">false</var>.
  6402. </p>
  6403. </dd>
  6404. <dt><samp class="option">-replace_drcs <var class="var">boolean</var></samp></dt>
  6405. <dd><p>Specify whether to render replaced DRCS characters as Unicode characters.
  6406. </p>
  6407. <p>The default is <var class="var">true</var>.
  6408. </p>
  6409. </dd>
  6410. <dt><samp class="option">-replace_msz_ascii <var class="var">boolean</var></samp></dt>
  6411. <dd><p>Specify whether to replace MSZ (Middle Size; half width) fullwidth
  6412. alphanumerics with halfwidth alphanumerics.
  6413. </p>
  6414. <p>The default is <var class="var">true</var>.
  6415. </p>
  6416. </dd>
  6417. <dt><samp class="option">-replace_msz_japanese <var class="var">boolean</var></samp></dt>
  6418. <dd><p>Specify whether to replace some MSZ (Middle Size; half width) fullwidth
  6419. japanese special characters with halfwidth ones.
  6420. </p>
  6421. <p>The default is <var class="var">true</var>.
  6422. </p>
  6423. </dd>
  6424. <dt><samp class="option">-replace_msz_glyph <var class="var">boolean</var></samp></dt>
  6425. <dd><p>Specify whether to replace MSZ (Middle Size; half width) characters
  6426. with halfwidth glyphs if the fonts supports it.
  6427. This option works under FreeType or DirectWrite renderer
  6428. with Adobe-Japan1 compliant fonts.
  6429. e.g., IBM Plex Sans JP, Morisawa BIZ UDGothic, Morisawa BIZ UDMincho,
  6430. Yu Gothic, Yu Mincho, and Meiryo.
  6431. </p>
  6432. <p>The default is <var class="var">true</var>.
  6433. </p>
  6434. </dd>
  6435. <dt><samp class="option">-canvas_size <var class="var">image_size</var></samp></dt>
  6436. <dd><p>Specify the resolution of the canvas to render subtitles to; usually, this
  6437. should be frame size of input video.
  6438. This only applies when <code class="code">-subtitle_type</code> is set to <var class="var">bitmap</var>.
  6439. </p>
  6440. <p>The libaribcaption decoder assumes input frame size for bitmap rendering as below:
  6441. </p><ol class="enumerate">
  6442. <li> PROFILE_A : 1440 x 1080 with SAR (PAR) 4:3
  6443. </li><li> PROFILE_C : 320 x 180 with SAR (PAR) 1:1
  6444. </li></ol>
  6445. <p>If actual frame size of input video does not match above assumption,
  6446. the rendered captions may be distorted.
  6447. To make the captions undistorted, add <code class="code">-canvas_size</code> option to specify
  6448. actual input video size.
  6449. </p>
  6450. <p>Note that the <code class="code">-canvas_size</code> option is not required for video with
  6451. different size but same aspect ratio.
  6452. In such cases, the caption will be stretched or shrunk to actual video size
  6453. if <code class="code">-canvas_size</code> option is not specified.
  6454. If <code class="code">-canvas_size</code> option is specified with different size,
  6455. the caption will be stretched or shrunk as specified size with calculated SAR.
  6456. </p>
  6457. </dd>
  6458. </dl>
  6459. <a name="libaribcaption-decoder-usage-examples"></a>
  6460. <h4 class="subsection">12.2.2 libaribcaption decoder usage examples<span class="pull-right"><a class="anchor hidden-xs" href="#libaribcaption-decoder-usage-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaribcaption-decoder-usage-examples" aria-hidden="true">TOC</a></span></h4>
  6461. <p>Display MPEG-TS file with ARIB subtitle by <code class="code">ffplay</code> tool:
  6462. </p><div class="example">
  6463. <pre class="example-preformatted">ffplay -sub_type bitmap MPEG.TS
  6464. </pre></div>
  6465. <p>Display MPEG-TS file with input frame size 1920x1080 by <code class="code">ffplay</code> tool:
  6466. </p><div class="example">
  6467. <pre class="example-preformatted">ffplay -sub_type bitmap -canvas_size 1920x1080 MPEG.TS
  6468. </pre></div>
  6469. <p>Embed ARIB subtitle in transcoded video:
  6470. </p><div class="example">
  6471. <pre class="example-preformatted">ffmpeg -sub_type bitmap -i src.m2t -filter_complex &quot;[0:v][0:s]overlay&quot; -vcodec h264 dest.mp4
  6472. </pre></div>
  6473. <a name="dvbsub"></a>
  6474. <h3 class="section">12.3 dvbsub<span class="pull-right"><a class="anchor hidden-xs" href="#dvbsub" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dvbsub" aria-hidden="true">TOC</a></span></h3>
  6475. <a name="Options-9"></a>
  6476. <h4 class="subsection">12.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-9" aria-hidden="true">TOC</a></span></h4>
  6477. <dl class="table">
  6478. <dt><samp class="option">compute_clut</samp></dt>
  6479. <dd><dl class="table">
  6480. <dt><samp class="option">-2</samp></dt>
  6481. <dd><p>Compute clut once if no matching CLUT is in the stream.
  6482. </p></dd>
  6483. <dt><samp class="option">-1</samp></dt>
  6484. <dd><p>Compute clut if no matching CLUT is in the stream.
  6485. </p></dd>
  6486. <dt><samp class="option">0</samp></dt>
  6487. <dd><p>Never compute CLUT
  6488. </p></dd>
  6489. <dt><samp class="option">1</samp></dt>
  6490. <dd><p>Always compute CLUT and override the one provided in the stream.
  6491. </p></dd>
  6492. </dl>
  6493. </dd>
  6494. <dt><samp class="option">dvb_substream</samp></dt>
  6495. <dd><p>Selects the dvb substream, or all substreams if -1 which is default.
  6496. </p>
  6497. </dd>
  6498. </dl>
  6499. <a name="dvdsub"></a>
  6500. <h3 class="section">12.4 dvdsub<span class="pull-right"><a class="anchor hidden-xs" href="#dvdsub" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dvdsub" aria-hidden="true">TOC</a></span></h3>
  6501. <p>This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
  6502. also be found in VobSub file pairs and in some Matroska files.
  6503. </p>
  6504. <a name="Options-10"></a>
  6505. <h4 class="subsection">12.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-10" aria-hidden="true">TOC</a></span></h4>
  6506. <dl class="table">
  6507. <dt><samp class="option">palette</samp></dt>
  6508. <dd><p>Specify the global palette used by the bitmaps. When stored in VobSub, the
  6509. palette is normally specified in the index file; in Matroska, the palette is
  6510. stored in the codec extra-data in the same format as in VobSub. In DVDs, the
  6511. palette is stored in the IFO file, and therefore not available when reading
  6512. from dumped VOB files.
  6513. </p>
  6514. <p>The format for this option is a string containing 16 24-bits hexadecimal
  6515. numbers (without 0x prefix) separated by commas, for example <code class="code">0d00ee,
  6516. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  6517. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
  6518. </p>
  6519. </dd>
  6520. <dt><samp class="option">ifo_palette</samp></dt>
  6521. <dd><p>Specify the IFO file from which the global palette is obtained.
  6522. (experimental)
  6523. </p>
  6524. </dd>
  6525. <dt><samp class="option">forced_subs_only</samp></dt>
  6526. <dd><p>Only decode subtitle entries marked as forced. Some titles have forced
  6527. and non-forced subtitles in the same track. Setting this flag to <code class="code">1</code>
  6528. will only keep the forced subtitles. Default value is <code class="code">0</code>.
  6529. </p></dd>
  6530. </dl>
  6531. <a name="libzvbi_002dteletext"></a>
  6532. <h3 class="section">12.5 libzvbi-teletext<span class="pull-right"><a class="anchor hidden-xs" href="#libzvbi_002dteletext" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libzvbi_002dteletext" aria-hidden="true">TOC</a></span></h3>
  6533. <p>Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext
  6534. subtitles. Requires the presence of the libzvbi headers and library during
  6535. configuration. You need to explicitly configure the build with
  6536. <code class="code">--enable-libzvbi</code>.
  6537. </p>
  6538. <a name="Options-11"></a>
  6539. <h4 class="subsection">12.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-11" aria-hidden="true">TOC</a></span></h4>
  6540. <dl class="table">
  6541. <dt><samp class="option">txt_page</samp></dt>
  6542. <dd><p>List of teletext page numbers to decode. Pages that do not match the specified
  6543. list are dropped. You may use the special <code class="code">*</code> string to match all pages,
  6544. or <code class="code">subtitle</code> to match all subtitle pages.
  6545. Default value is *.
  6546. </p></dd>
  6547. <dt><samp class="option">txt_default_region</samp></dt>
  6548. <dd><p>Set default character set used for decoding, a value between 0 and 87 (see
  6549. ETS 300 706, Section 15, Table 32). Default value is -1, which does not
  6550. override the libzvbi default. This option is needed for some legacy level 1.0
  6551. transmissions which cannot signal the proper charset.
  6552. </p></dd>
  6553. <dt><samp class="option">txt_chop_top</samp></dt>
  6554. <dd><p>Discards the top teletext line. Default value is 1.
  6555. </p></dd>
  6556. <dt><samp class="option">txt_format</samp></dt>
  6557. <dd><p>Specifies the format of the decoded subtitles.
  6558. </p><dl class="table">
  6559. <dt><samp class="option">bitmap</samp></dt>
  6560. <dd><p>The default format, you should use this for teletext pages, because certain
  6561. graphics and colors cannot be expressed in simple text or even ASS.
  6562. </p></dd>
  6563. <dt><samp class="option">text</samp></dt>
  6564. <dd><p>Simple text based output without formatting.
  6565. </p></dd>
  6566. <dt><samp class="option">ass</samp></dt>
  6567. <dd><p>Formatted ASS output, subtitle pages and teletext pages are returned in
  6568. different styles, subtitle pages are stripped down to text, but an effort is
  6569. made to keep the text alignment and the formatting.
  6570. </p></dd>
  6571. </dl>
  6572. </dd>
  6573. <dt><samp class="option">txt_left</samp></dt>
  6574. <dd><p>X offset of generated bitmaps, default is 0.
  6575. </p></dd>
  6576. <dt><samp class="option">txt_top</samp></dt>
  6577. <dd><p>Y offset of generated bitmaps, default is 0.
  6578. </p></dd>
  6579. <dt><samp class="option">txt_chop_spaces</samp></dt>
  6580. <dd><p>Chops leading and trailing spaces and removes empty lines from the generated
  6581. text. This option is useful for teletext based subtitles where empty spaces may
  6582. be present at the start or at the end of the lines or empty lines may be
  6583. present between the subtitle lines because of double-sized teletext characters.
  6584. Default value is 1.
  6585. </p></dd>
  6586. <dt><samp class="option">txt_duration</samp></dt>
  6587. <dd><p>Sets the display duration of the decoded teletext pages or subtitles in
  6588. milliseconds. Default value is -1 which means infinity or until the next
  6589. subtitle event comes.
  6590. </p></dd>
  6591. <dt><samp class="option">txt_transparent</samp></dt>
  6592. <dd><p>Force transparent background of the generated teletext bitmaps. Default value
  6593. is 0 which means an opaque background.
  6594. </p></dd>
  6595. <dt><samp class="option">txt_opacity</samp></dt>
  6596. <dd><p>Sets the opacity (0-255) of the teletext background. If
  6597. <samp class="option">txt_transparent</samp> is not set, it only affects characters between a start
  6598. box and an end box, typically subtitles. Default value is 0 if
  6599. <samp class="option">txt_transparent</samp> is set, 255 otherwise.
  6600. </p>
  6601. </dd>
  6602. </dl>
  6603. <a name="Bitstream-Filters"></a>
  6604. <h2 class="chapter">13 Bitstream Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Bitstream-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Bitstream-Filters" aria-hidden="true">TOC</a></span></h2>
  6605. <p>When you configure your FFmpeg build, all the supported bitstream
  6606. filters are enabled by default. You can list all available ones using
  6607. the configure option <code class="code">--list-bsfs</code>.
  6608. </p>
  6609. <p>You can disable all the bitstream filters using the configure option
  6610. <code class="code">--disable-bsfs</code>, and selectively enable any bitstream filter using
  6611. the option <code class="code">--enable-bsf=BSF</code>, or you can disable a particular
  6612. bitstream filter using the option <code class="code">--disable-bsf=BSF</code>.
  6613. </p>
  6614. <p>The option <code class="code">-bsfs</code> of the ff* tools will display the list of
  6615. all the supported bitstream filters included in your build.
  6616. </p>
  6617. <p>The ff* tools have a -bsf option applied per stream, taking a
  6618. comma-separated list of filters, whose parameters follow the filter
  6619. name after a &rsquo;=&rsquo;.
  6620. </p>
  6621. <div class="example">
  6622. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
  6623. </pre></div>
  6624. <p>Below is a description of the currently available bitstream filters,
  6625. with their parameters, if any.
  6626. </p>
  6627. <a name="aac_005fadtstoasc"></a>
  6628. <h3 class="section">13.1 aac_adtstoasc<span class="pull-right"><a class="anchor hidden-xs" href="#aac_005fadtstoasc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aac_005fadtstoasc" aria-hidden="true">TOC</a></span></h3>
  6629. <p>Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration
  6630. bitstream.
  6631. </p>
  6632. <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
  6633. ADTS header and removes the ADTS header.
  6634. </p>
  6635. <p>This filter is required for example when copying an AAC stream from a
  6636. raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or
  6637. to MOV/MP4 files and related formats such as 3GP or M4A. Please note
  6638. that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats.
  6639. </p>
  6640. <a name="av1_005fmetadata"></a>
  6641. <h3 class="section">13.2 av1_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#av1_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-av1_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  6642. <p>Modify metadata embedded in an AV1 stream.
  6643. </p>
  6644. <dl class="table">
  6645. <dt><samp class="option">td</samp></dt>
  6646. <dd><p>Insert or remove temporal delimiter OBUs in all temporal units of the
  6647. stream.
  6648. </p>
  6649. <dl class="table">
  6650. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  6651. <dd><p>Insert a TD at the beginning of every TU which does not already have one.
  6652. </p></dd>
  6653. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  6654. <dd><p>Remove the TD from the beginning of every TU which has one.
  6655. </p></dd>
  6656. </dl>
  6657. </dd>
  6658. <dt><samp class="option">color_primaries</samp></dt>
  6659. <dt><samp class="option">transfer_characteristics</samp></dt>
  6660. <dt><samp class="option">matrix_coefficients</samp></dt>
  6661. <dd><p>Set the color description fields in the stream (see AV1 section 6.4.2).
  6662. </p>
  6663. </dd>
  6664. <dt><samp class="option">color_range</samp></dt>
  6665. <dd><p>Set the color range in the stream (see AV1 section 6.4.2; note that
  6666. this cannot be set for streams using BT.709 primaries, sRGB transfer
  6667. characteristic and identity (RGB) matrix coefficients).
  6668. </p><dl class="table">
  6669. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  6670. <dd><p>Limited range.
  6671. </p></dd>
  6672. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  6673. <dd><p>Full range.
  6674. </p></dd>
  6675. </dl>
  6676. </dd>
  6677. <dt><samp class="option">chroma_sample_position</samp></dt>
  6678. <dd><p>Set the chroma sample location in the stream (see AV1 section 6.4.2).
  6679. This can only be set for 4:2:0 streams.
  6680. </p>
  6681. <dl class="table">
  6682. <dt>&lsquo;<samp class="samp">vertical</samp>&rsquo;</dt>
  6683. <dd><p>Left position (matching the default in MPEG-2 and H.264).
  6684. </p></dd>
  6685. <dt>&lsquo;<samp class="samp">colocated</samp>&rsquo;</dt>
  6686. <dd><p>Top-left position.
  6687. </p></dd>
  6688. </dl>
  6689. </dd>
  6690. <dt><samp class="option">tick_rate</samp></dt>
  6691. <dd><p>Set the tick rate (<em class="emph">time_scale / num_units_in_display_tick</em>) in
  6692. the timing info in the sequence header.
  6693. </p></dd>
  6694. <dt><samp class="option">num_ticks_per_picture</samp></dt>
  6695. <dd><p>Set the number of ticks in each picture, to indicate that the stream
  6696. has a fixed framerate. Ignored if <samp class="option">tick_rate</samp> is not also set.
  6697. </p>
  6698. </dd>
  6699. <dt><samp class="option">delete_padding</samp></dt>
  6700. <dd><p>Deletes Padding OBUs.
  6701. </p>
  6702. </dd>
  6703. </dl>
  6704. <a name="chomp"></a>
  6705. <h3 class="section">13.3 chomp<span class="pull-right"><a class="anchor hidden-xs" href="#chomp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chomp" aria-hidden="true">TOC</a></span></h3>
  6706. <p>Remove zero padding at the end of a packet.
  6707. </p>
  6708. <a name="dca_005fcore"></a>
  6709. <h3 class="section">13.4 dca_core<span class="pull-right"><a class="anchor hidden-xs" href="#dca_005fcore" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dca_005fcore" aria-hidden="true">TOC</a></span></h3>
  6710. <p>Extract the core from a DCA/DTS stream, dropping extensions such as
  6711. DTS-HD.
  6712. </p>
  6713. <a name="dovi_005frpu"></a>
  6714. <h3 class="section">13.5 dovi_rpu<span class="pull-right"><a class="anchor hidden-xs" href="#dovi_005frpu" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dovi_005frpu" aria-hidden="true">TOC</a></span></h3>
  6715. <p>Manipulate Dolby Vision metadata in a HEVC/AV1 bitstream, optionally enabling
  6716. metadata compression.
  6717. </p>
  6718. <dl class="table">
  6719. <dt><samp class="option">strip</samp></dt>
  6720. <dd><p>If enabled, strip all Dolby Vision metadata (configuration record + RPU data
  6721. blocks) from the stream.
  6722. </p></dd>
  6723. <dt><samp class="option">compression</samp></dt>
  6724. <dd><p>Which compression level to enable.
  6725. </p><dl class="table">
  6726. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  6727. <dd><p>No metadata compression.
  6728. </p></dd>
  6729. <dt>&lsquo;<samp class="samp">limited</samp>&rsquo;</dt>
  6730. <dd><p>Limited metadata compression scheme. Should be compatible with most devices.
  6731. This is the default.
  6732. </p></dd>
  6733. <dt>&lsquo;<samp class="samp">extended</samp>&rsquo;</dt>
  6734. <dd><p>Extended metadata compression. Devices are not required to support this. Note
  6735. that this level currently behaves the same as &lsquo;<samp class="samp">limited</samp>&rsquo; in libavcodec.
  6736. </p></dd>
  6737. </dl>
  6738. </dd>
  6739. </dl>
  6740. <a name="dump_005fextra"></a>
  6741. <h3 class="section">13.6 dump_extra<span class="pull-right"><a class="anchor hidden-xs" href="#dump_005fextra" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dump_005fextra" aria-hidden="true">TOC</a></span></h3>
  6742. <p>Add extradata to the beginning of the filtered packets except when
  6743. said packets already exactly begin with the extradata that is intended
  6744. to be added.
  6745. </p>
  6746. <dl class="table">
  6747. <dt><samp class="option">freq</samp></dt>
  6748. <dd><p>The additional argument specifies which packets should be filtered.
  6749. It accepts the values:
  6750. </p><dl class="table">
  6751. <dt>&lsquo;<samp class="samp">k</samp>&rsquo;</dt>
  6752. <dt>&lsquo;<samp class="samp">keyframe</samp>&rsquo;</dt>
  6753. <dd><p>add extradata to all key packets
  6754. </p>
  6755. </dd>
  6756. <dt>&lsquo;<samp class="samp">e</samp>&rsquo;</dt>
  6757. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  6758. <dd><p>add extradata to all packets
  6759. </p></dd>
  6760. </dl>
  6761. </dd>
  6762. </dl>
  6763. <p>If not specified it is assumed &lsquo;<samp class="samp">k</samp>&rsquo;.
  6764. </p>
  6765. <p>For example the following <code class="command">ffmpeg</code> command forces a global
  6766. header (thus disabling individual packet headers) in the H.264 packets
  6767. generated by the <code class="code">libx264</code> encoder, but corrects them by adding
  6768. the header stored in extradata to the key packets:
  6769. </p><div class="example">
  6770. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
  6771. </pre></div>
  6772. <a name="dv_005ferror_005fmarker"></a>
  6773. <h3 class="section">13.7 dv_error_marker<span class="pull-right"><a class="anchor hidden-xs" href="#dv_005ferror_005fmarker" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dv_005ferror_005fmarker" aria-hidden="true">TOC</a></span></h3>
  6774. <p>Blocks in DV which are marked as damaged are replaced by blocks of the specified color.
  6775. </p>
  6776. <dl class="table">
  6777. <dt><samp class="option">color</samp></dt>
  6778. <dd><p>The color to replace damaged blocks by
  6779. </p></dd>
  6780. <dt><samp class="option">sta</samp></dt>
  6781. <dd><p>A 16 bit mask which specifies which of the 16 possible error status values are
  6782. to be replaced by colored blocks. 0xFFFE is the default which replaces all non 0
  6783. error status values.
  6784. </p><dl class="table">
  6785. <dt>&lsquo;<samp class="samp">ok</samp>&rsquo;</dt>
  6786. <dd><p>No error, no concealment
  6787. </p></dd>
  6788. <dt>&lsquo;<samp class="samp">err</samp>&rsquo;</dt>
  6789. <dd><p>Error, No concealment
  6790. </p></dd>
  6791. <dt>&lsquo;<samp class="samp">res</samp>&rsquo;</dt>
  6792. <dd><p>Reserved
  6793. </p></dd>
  6794. <dt>&lsquo;<samp class="samp">notok</samp>&rsquo;</dt>
  6795. <dd><p>Error or concealment
  6796. </p></dd>
  6797. <dt>&lsquo;<samp class="samp">notres</samp>&rsquo;</dt>
  6798. <dd><p>Not reserved
  6799. </p></dd>
  6800. <dt>&lsquo;<samp class="samp">Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru</samp>&rsquo;</dt>
  6801. <dd><p>The specific error status code
  6802. </p></dd>
  6803. </dl>
  6804. <p>see page 44-46 or section 5.5 of
  6805. <a class="url" href="http://web.archive.org/web/20060927044735/http://www.smpte.org/smpte_store/standards/pdf/s314m.pdf">http://web.archive.org/web/20060927044735/http://www.smpte.org/smpte_store/standards/pdf/s314m.pdf</a>
  6806. </p>
  6807. </dd>
  6808. </dl>
  6809. <a name="eac3_005fcore"></a>
  6810. <h3 class="section">13.8 eac3_core<span class="pull-right"><a class="anchor hidden-xs" href="#eac3_005fcore" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eac3_005fcore" aria-hidden="true">TOC</a></span></h3>
  6811. <p>Extract the core from a E-AC-3 stream, dropping extra channels.
  6812. </p>
  6813. <a name="eia608_005fto_005fsmpte436m"></a>
  6814. <h3 class="section">13.9 eia608_to_smpte436m<span class="pull-right"><a class="anchor hidden-xs" href="#eia608_005fto_005fsmpte436m" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eia608_005fto_005fsmpte436m" aria-hidden="true">TOC</a></span></h3>
  6815. <p>Convert from a <code class="code">EIA_608</code> stream to a <code class="code">SMPTE_436M_ANC</code> data stream, wrapping the closed captions in CTA-708 CDP VANC packets.
  6816. </p>
  6817. <dl class="table">
  6818. <dt><samp class="option">line_number</samp></dt>
  6819. <dd><p>Choose which line number the generated VANC packets should go on. You generally want either line 9 (the default) or 11.
  6820. </p></dd>
  6821. <dt><samp class="option">wrapping_type</samp></dt>
  6822. <dd><p>Choose the SMPTE 436M wrapping type, defaults to &lsquo;<samp class="samp">vanc_frame</samp>&rsquo;.
  6823. It accepts the values:
  6824. </p><dl class="table">
  6825. <dt>&lsquo;<samp class="samp">vanc_frame</samp>&rsquo;</dt>
  6826. <dd><p>VANC frame (interlaced or segmented progressive frame)
  6827. </p></dd>
  6828. <dt>&lsquo;<samp class="samp">vanc_field_1</samp>&rsquo;</dt>
  6829. <dt>&lsquo;<samp class="samp">vanc_field_2</samp>&rsquo;</dt>
  6830. <dt>&lsquo;<samp class="samp">vanc_progressive_frame</samp>&rsquo;</dt>
  6831. </dl>
  6832. </dd>
  6833. <dt><samp class="option">sample_coding</samp></dt>
  6834. <dd><p>Choose the SMPTE 436M sample coding, defaults to &lsquo;<samp class="samp">8bit_luma</samp>&rsquo;.
  6835. It accepts the values:
  6836. </p><dl class="table">
  6837. <dt>&lsquo;<samp class="samp">8bit_luma</samp>&rsquo;</dt>
  6838. <dd><p>8-bit component luma samples
  6839. </p></dd>
  6840. <dt>&lsquo;<samp class="samp">8bit_color_diff</samp>&rsquo;</dt>
  6841. <dd><p>8-bit component color difference samples
  6842. </p></dd>
  6843. <dt>&lsquo;<samp class="samp">8bit_luma_and_color_diff</samp>&rsquo;</dt>
  6844. <dd><p>8-bit component luma and color difference samples
  6845. </p></dd>
  6846. <dt>&lsquo;<samp class="samp">10bit_luma</samp>&rsquo;</dt>
  6847. <dd><p>10-bit component luma samples
  6848. </p></dd>
  6849. <dt>&lsquo;<samp class="samp">10bit_color_diff</samp>&rsquo;</dt>
  6850. <dd><p>10-bit component color difference samples
  6851. </p></dd>
  6852. <dt>&lsquo;<samp class="samp">10bit_luma_and_color_diff</samp>&rsquo;</dt>
  6853. <dd><p>10-bit component luma and color difference samples
  6854. </p></dd>
  6855. <dt>&lsquo;<samp class="samp">8bit_luma_parity_error</samp>&rsquo;</dt>
  6856. <dd><p>8-bit component luma samples with parity error
  6857. </p></dd>
  6858. <dt>&lsquo;<samp class="samp">8bit_color_diff_parity_error</samp>&rsquo;</dt>
  6859. <dd><p>8-bit component color difference samples with parity error
  6860. </p></dd>
  6861. <dt>&lsquo;<samp class="samp">8bit_luma_and_color_diff_parity_error</samp>&rsquo;</dt>
  6862. <dd><p>8-bit component luma and color difference samples with parity error
  6863. </p></dd>
  6864. </dl>
  6865. </dd>
  6866. <dt><samp class="option">initial_cdp_sequence_cntr</samp></dt>
  6867. <dd><p>The initial value of the CDP&rsquo;s 16-bit unsigned integer <code class="code">cdp_hdr_sequence_cntr</code> and <code class="code">cdp_ftr_sequence_cntr</code> fields. Defaults to 0.
  6868. </p></dd>
  6869. <dt><samp class="option">cdp_frame_rate</samp></dt>
  6870. <dd><p>Set the CDP&rsquo;s <code class="code">cdp_frame_rate</code> field. This doesn&rsquo;t actually change the timing of the data stream, it just changes the values inserted in that field in the generated CDP packets. Defaults to &lsquo;<samp class="samp">30000/1001</samp>&rsquo;.
  6871. </p></dd>
  6872. </dl>
  6873. <a name="extract_005fextradata"></a>
  6874. <h3 class="section">13.10 extract_extradata<span class="pull-right"><a class="anchor hidden-xs" href="#extract_005fextradata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-extract_005fextradata" aria-hidden="true">TOC</a></span></h3>
  6875. <p>Extract the in-band extradata.
  6876. </p>
  6877. <p>Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers,
  6878. or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either &quot;in-band&quot; (i.e. as a part
  6879. of the bitstream containing the coded frames) or &quot;out of band&quot; (e.g. on the
  6880. container level). This latter form is called &quot;extradata&quot; in FFmpeg terminology.
  6881. </p>
  6882. <p>This bitstream filter detects the in-band headers and makes them available as
  6883. extradata.
  6884. </p>
  6885. <dl class="table">
  6886. <dt><samp class="option">remove</samp></dt>
  6887. <dd><p>When this option is enabled, the long-term headers are removed from the
  6888. bitstream after extraction.
  6889. </p></dd>
  6890. </dl>
  6891. <a name="filter_005funits"></a>
  6892. <h3 class="section">13.11 filter_units<span class="pull-right"><a class="anchor hidden-xs" href="#filter_005funits" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-filter_005funits" aria-hidden="true">TOC</a></span></h3>
  6893. <p>Remove units with types in or not in a given set from the stream.
  6894. </p>
  6895. <dl class="table">
  6896. <dt><samp class="option">pass_types</samp></dt>
  6897. <dd><p>List of unit types or ranges of unit types to pass through while removing
  6898. all others. This is specified as a &rsquo;|&rsquo;-separated list of unit type values
  6899. or ranges of values with &rsquo;-&rsquo;.
  6900. </p>
  6901. </dd>
  6902. <dt><samp class="option">remove_types</samp></dt>
  6903. <dd><p>Identical to <samp class="option">pass_types</samp>, except the units in the given set
  6904. removed and all others passed through.
  6905. </p></dd>
  6906. </dl>
  6907. <p>The types used by pass_types and remove_types correspond to NAL unit types
  6908. (nal_unit_type) in H.264, HEVC and H.266 (see Table 7-1 in the H.264
  6909. and HEVC specifications or Table 5 in the H.266 specification), to
  6910. marker values for JPEG (without 0xFF prefix) and to start codes without
  6911. start code prefix (i.e. the byte following the 0x000001) for MPEG-2.
  6912. For VP8 and VP9, every unit has type zero.
  6913. </p>
  6914. <p>Extradata is unchanged by this transformation, but note that if the stream
  6915. contains inline parameter sets then the output may be unusable if they are
  6916. removed.
  6917. </p>
  6918. <p>For example, to remove all non-VCL NAL units from an H.264 stream:
  6919. </p><div class="example">
  6920. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
  6921. </pre></div>
  6922. <p>To remove all AUDs, SEI and filler from an H.265 stream:
  6923. </p><div class="example">
  6924. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
  6925. </pre></div>
  6926. <p>To remove all user data from a MPEG-2 stream, including Closed Captions:
  6927. </p><div class="example">
  6928. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=178' OUTPUT
  6929. </pre></div>
  6930. <p>To remove all SEI from a H264 stream, including Closed Captions:
  6931. </p><div class="example">
  6932. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=6' OUTPUT
  6933. </pre></div>
  6934. <p>To remove all prefix and suffix SEI from a HEVC stream, including Closed Captions and dynamic HDR:
  6935. </p><div class="example">
  6936. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=39|40' OUTPUT
  6937. </pre></div>
  6938. <a name="hapqa_005fextract"></a>
  6939. <h3 class="section">13.12 hapqa_extract<span class="pull-right"><a class="anchor hidden-xs" href="#hapqa_005fextract" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hapqa_005fextract" aria-hidden="true">TOC</a></span></h3>
  6940. <p>Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file.
  6941. </p>
  6942. <dl class="table">
  6943. <dt><samp class="option">texture</samp></dt>
  6944. <dd><p>Specifies the texture to keep.
  6945. </p>
  6946. <dl class="table">
  6947. <dt><samp class="option">color</samp></dt>
  6948. <dt><samp class="option">alpha</samp></dt>
  6949. </dl>
  6950. </dd>
  6951. </dl>
  6952. <p>Convert HAPQA to HAPQ
  6953. </p><div class="example">
  6954. <pre class="example-preformatted">ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=color -tag:v HapY -metadata:s:v:0 encoder=&quot;HAPQ&quot; hapq_file.mov
  6955. </pre></div>
  6956. <p>Convert HAPQA to HAPAlphaOnly
  6957. </p><div class="example">
  6958. <pre class="example-preformatted">ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=alpha -tag:v HapA -metadata:s:v:0 encoder=&quot;HAPAlpha Only&quot; hapalphaonly_file.mov
  6959. </pre></div>
  6960. <a name="h264_005fmetadata"></a>
  6961. <h3 class="section">13.13 h264_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#h264_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  6962. <p>Modify metadata embedded in an H.264 stream.
  6963. </p>
  6964. <dl class="table">
  6965. <dt><samp class="option">aud</samp></dt>
  6966. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  6967. </p>
  6968. <dl class="table">
  6969. <dt>&lsquo;<samp class="samp">pass</samp>&rsquo;</dt>
  6970. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  6971. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  6972. </dl>
  6973. <p>Default is pass.
  6974. </p>
  6975. </dd>
  6976. <dt><samp class="option">sample_aspect_ratio</samp></dt>
  6977. <dd><p>Set the sample aspect ratio of the stream in the VUI parameters.
  6978. See H.264 table E-1.
  6979. </p>
  6980. </dd>
  6981. <dt><samp class="option">overscan_appropriate_flag</samp></dt>
  6982. <dd><p>Set whether the stream is suitable for display using overscan
  6983. or not (see H.264 section E.2.1).
  6984. </p>
  6985. </dd>
  6986. <dt><samp class="option">video_format</samp></dt>
  6987. <dt><samp class="option">video_full_range_flag</samp></dt>
  6988. <dd><p>Set the video format in the stream (see H.264 section E.2.1 and
  6989. table E-2).
  6990. </p>
  6991. </dd>
  6992. <dt><samp class="option">colour_primaries</samp></dt>
  6993. <dt><samp class="option">transfer_characteristics</samp></dt>
  6994. <dt><samp class="option">matrix_coefficients</samp></dt>
  6995. <dd><p>Set the colour description in the stream (see H.264 section E.2.1
  6996. and tables E-3, E-4 and E-5).
  6997. </p>
  6998. </dd>
  6999. <dt><samp class="option">chroma_sample_loc_type</samp></dt>
  7000. <dd><p>Set the chroma sample location in the stream (see H.264 section
  7001. E.2.1 and figure E-1).
  7002. </p>
  7003. </dd>
  7004. <dt><samp class="option">tick_rate</samp></dt>
  7005. <dd><p>Set the tick rate (time_scale / num_units_in_tick) in the VUI
  7006. parameters. This is the smallest time unit representable in the
  7007. stream, and in many cases represents the field rate of the stream
  7008. (double the frame rate).
  7009. </p></dd>
  7010. <dt><samp class="option">fixed_frame_rate_flag</samp></dt>
  7011. <dd><p>Set whether the stream has fixed framerate - typically this indicates
  7012. that the framerate is exactly half the tick rate, but the exact
  7013. meaning is dependent on interlacing and the picture structure (see
  7014. H.264 section E.2.1 and table E-6).
  7015. </p></dd>
  7016. <dt><samp class="option">zero_new_constraint_set_flags</samp></dt>
  7017. <dd><p>Zero constraint_set4_flag and constraint_set5_flag in the SPS. These
  7018. bits were reserved in a previous version of the H.264 spec, and thus
  7019. some hardware decoders require these to be zero. The result of zeroing
  7020. this is still a valid bitstream.
  7021. </p>
  7022. </dd>
  7023. <dt><samp class="option">crop_left</samp></dt>
  7024. <dt><samp class="option">crop_right</samp></dt>
  7025. <dt><samp class="option">crop_top</samp></dt>
  7026. <dt><samp class="option">crop_bottom</samp></dt>
  7027. <dd><p>Set the frame cropping offsets in the SPS. These values will replace
  7028. the current ones if the stream is already cropped.
  7029. </p>
  7030. <p>These fields are set in pixels. Note that some sizes may not be
  7031. representable if the chroma is subsampled or the stream is interlaced
  7032. (see H.264 section 7.4.2.1.1).
  7033. </p>
  7034. </dd>
  7035. <dt><samp class="option">sei_user_data</samp></dt>
  7036. <dd><p>Insert a string as SEI unregistered user data. The argument must
  7037. be of the form <em class="emph">UUID+string</em>, where the UUID is as hex digits
  7038. possibly separated by hyphens, and the string can be anything.
  7039. </p>
  7040. <p>For example, &lsquo;<samp class="samp">086f3693-b7b3-4f2c-9653-21492feee5b8+hello</samp>&rsquo; will
  7041. insert the string &ldquo;hello&rdquo; associated with the given UUID.
  7042. </p>
  7043. </dd>
  7044. <dt><samp class="option">delete_filler</samp></dt>
  7045. <dd><p>Deletes both filler NAL units and filler SEI messages.
  7046. </p>
  7047. </dd>
  7048. <dt><samp class="option">display_orientation</samp></dt>
  7049. <dd><p>Insert, extract or remove Display orientation SEI messages.
  7050. See H.264 section D.1.27 and D.2.27 for syntax and semantics.
  7051. </p>
  7052. <dl class="table">
  7053. <dt>&lsquo;<samp class="samp">pass</samp>&rsquo;</dt>
  7054. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  7055. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  7056. <dt>&lsquo;<samp class="samp">extract</samp>&rsquo;</dt>
  7057. </dl>
  7058. <p>Default is pass.
  7059. </p>
  7060. <p>Insert mode works in conjunction with <code class="code">rotate</code> and <code class="code">flip</code> options.
  7061. Any pre-existing Display orientation messages will be removed in insert or remove mode.
  7062. Extract mode attaches the display matrix to the packet as side data.
  7063. </p>
  7064. </dd>
  7065. <dt><samp class="option">rotate</samp></dt>
  7066. <dd><p>Set rotation in display orientation SEI (anticlockwise angle in degrees).
  7067. Range is -360 to +360. Default is NaN.
  7068. </p>
  7069. </dd>
  7070. <dt><samp class="option">flip</samp></dt>
  7071. <dd><p>Set flip in display orientation SEI.
  7072. </p>
  7073. <dl class="table">
  7074. <dt>&lsquo;<samp class="samp">horizontal</samp>&rsquo;</dt>
  7075. <dt>&lsquo;<samp class="samp">vertical</samp>&rsquo;</dt>
  7076. </dl>
  7077. <p>Default is unset.
  7078. </p>
  7079. </dd>
  7080. <dt><samp class="option">level</samp></dt>
  7081. <dd><p>Set the level in the SPS. Refer to H.264 section A.3 and tables A-1
  7082. to A-5.
  7083. </p>
  7084. <p>The argument must be the name of a level (for example, &lsquo;<samp class="samp">4.2</samp>&rsquo;), a
  7085. level_idc value (for example, &lsquo;<samp class="samp">42</samp>&rsquo;), or the special name &lsquo;<samp class="samp">auto</samp>&rsquo;
  7086. indicating that the filter should attempt to guess the level from the
  7087. input stream properties.
  7088. </p>
  7089. </dd>
  7090. </dl>
  7091. <a name="h264_005fmp4toannexb"></a>
  7092. <h3 class="section">13.14 h264_mp4toannexb<span class="pull-right"><a class="anchor hidden-xs" href="#h264_005fmp4toannexb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264_005fmp4toannexb" aria-hidden="true">TOC</a></span></h3>
  7093. <p>Convert an H.264 bitstream from length prefixed mode to start code
  7094. prefixed mode (as defined in the Annex B of the ITU-T H.264
  7095. specification).
  7096. </p>
  7097. <p>This is required by some streaming formats, typically the MPEG-2
  7098. transport stream format (muxer <code class="code">mpegts</code>).
  7099. </p>
  7100. <p>For example to remux an MP4 file containing an H.264 stream to mpegts
  7101. format with <code class="command">ffmpeg</code>, you can use the command:
  7102. </p>
  7103. <div class="example">
  7104. <pre class="example-preformatted">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
  7105. </pre></div>
  7106. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  7107. <code class="code">mpegts</code>) and raw H.264 (muxer <code class="code">h264</code>) output formats.
  7108. </p>
  7109. <a name="h264_005fredundant_005fpps"></a>
  7110. <h3 class="section">13.15 h264_redundant_pps<span class="pull-right"><a class="anchor hidden-xs" href="#h264_005fredundant_005fpps" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264_005fredundant_005fpps" aria-hidden="true">TOC</a></span></h3>
  7111. <p>This applies a specific fixup to some Blu-ray BDMV H264 streams
  7112. which contain redundant PPSs. The PPSs modify irrelevant parameters
  7113. of the stream, confusing other transformations which require
  7114. the correct extradata.
  7115. </p>
  7116. <p>The encoder used on these impacted streams adds extra PPSs throughout
  7117. the stream, varying the initial QP and whether weighted prediction
  7118. was enabled. This causes issues after copying the stream into
  7119. a global header container, as the starting PPS is not suitable
  7120. for the rest of the stream. One side effect, for example,
  7121. is seeking will return garbled output until a new PPS appears.
  7122. </p>
  7123. <p>This BSF removes the extra PPSs and rewrites the slice headers
  7124. such that the stream uses a single leading PPS in the global header,
  7125. which resolves the issue.
  7126. </p>
  7127. <a name="hevc_005fmetadata"></a>
  7128. <h3 class="section">13.16 hevc_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#hevc_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hevc_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  7129. <p>Modify metadata embedded in an HEVC stream.
  7130. </p>
  7131. <dl class="table">
  7132. <dt><samp class="option">aud</samp></dt>
  7133. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  7134. </p>
  7135. <dl class="table">
  7136. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  7137. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  7138. </dl>
  7139. </dd>
  7140. <dt><samp class="option">sample_aspect_ratio</samp></dt>
  7141. <dd><p>Set the sample aspect ratio in the stream in the VUI parameters.
  7142. </p>
  7143. </dd>
  7144. <dt><samp class="option">video_format</samp></dt>
  7145. <dt><samp class="option">video_full_range_flag</samp></dt>
  7146. <dd><p>Set the video format in the stream (see H.265 section E.3.1 and
  7147. table E.2).
  7148. </p>
  7149. </dd>
  7150. <dt><samp class="option">colour_primaries</samp></dt>
  7151. <dt><samp class="option">transfer_characteristics</samp></dt>
  7152. <dt><samp class="option">matrix_coefficients</samp></dt>
  7153. <dd><p>Set the colour description in the stream (see H.265 section E.3.1
  7154. and tables E.3, E.4 and E.5).
  7155. </p>
  7156. </dd>
  7157. <dt><samp class="option">chroma_sample_loc_type</samp></dt>
  7158. <dd><p>Set the chroma sample location in the stream (see H.265 section
  7159. E.3.1 and figure E.1).
  7160. </p>
  7161. </dd>
  7162. <dt><samp class="option">tick_rate</samp></dt>
  7163. <dd><p>Set the tick rate in the VPS and VUI parameters (time_scale /
  7164. num_units_in_tick). Combined with <samp class="option">num_ticks_poc_diff_one</samp>, this can
  7165. set a constant framerate in the stream. Note that it is likely to be
  7166. overridden by container parameters when the stream is in a container.
  7167. </p>
  7168. </dd>
  7169. <dt><samp class="option">num_ticks_poc_diff_one</samp></dt>
  7170. <dd><p>Set poc_proportional_to_timing_flag in VPS and VUI and use this value
  7171. to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and
  7172. E.3.1). Ignored if <samp class="option">tick_rate</samp> is not also set.
  7173. </p>
  7174. </dd>
  7175. <dt><samp class="option">crop_left</samp></dt>
  7176. <dt><samp class="option">crop_right</samp></dt>
  7177. <dt><samp class="option">crop_top</samp></dt>
  7178. <dt><samp class="option">crop_bottom</samp></dt>
  7179. <dd><p>Set the conformance window cropping offsets in the SPS. These values
  7180. will replace the current ones if the stream is already cropped.
  7181. </p>
  7182. <p>These fields are set in pixels. Note that some sizes may not be
  7183. representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
  7184. </p>
  7185. </dd>
  7186. <dt><samp class="option">width</samp></dt>
  7187. <dt><samp class="option">height</samp></dt>
  7188. <dd><p>Set width and height after crop.
  7189. </p>
  7190. </dd>
  7191. <dt><samp class="option">level</samp></dt>
  7192. <dd><p>Set the level in the VPS and SPS. See H.265 section A.4 and tables
  7193. A.6 and A.7.
  7194. </p>
  7195. <p>The argument must be the name of a level (for example, &lsquo;<samp class="samp">5.1</samp>&rsquo;), a
  7196. <em class="emph">general_level_idc</em> value (for example, &lsquo;<samp class="samp">153</samp>&rsquo; for level 5.1),
  7197. or the special name &lsquo;<samp class="samp">auto</samp>&rsquo; indicating that the filter should
  7198. attempt to guess the level from the input stream properties.
  7199. </p>
  7200. </dd>
  7201. </dl>
  7202. <a name="hevc_005fmp4toannexb"></a>
  7203. <h3 class="section">13.17 hevc_mp4toannexb<span class="pull-right"><a class="anchor hidden-xs" href="#hevc_005fmp4toannexb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hevc_005fmp4toannexb" aria-hidden="true">TOC</a></span></h3>
  7204. <p>Convert an HEVC/H.265 bitstream from length prefixed mode to start code
  7205. prefixed mode (as defined in the Annex B of the ITU-T H.265
  7206. specification).
  7207. </p>
  7208. <p>This is required by some streaming formats, typically the MPEG-2
  7209. transport stream format (muxer <code class="code">mpegts</code>).
  7210. </p>
  7211. <p>For example to remux an MP4 file containing an HEVC stream to mpegts
  7212. format with <code class="command">ffmpeg</code>, you can use the command:
  7213. </p>
  7214. <div class="example">
  7215. <pre class="example-preformatted">ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
  7216. </pre></div>
  7217. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  7218. <code class="code">mpegts</code>) and raw HEVC/H.265 (muxer <code class="code">h265</code> or
  7219. <code class="code">hevc</code>) output formats.
  7220. </p>
  7221. <a name="imxdump"></a>
  7222. <h3 class="section">13.18 imxdump<span class="pull-right"><a class="anchor hidden-xs" href="#imxdump" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-imxdump" aria-hidden="true">TOC</a></span></h3>
  7223. <p>Modifies the bitstream to fit in MOV and to be usable by the Final Cut
  7224. Pro decoder. This filter only applies to the mpeg2video codec, and is
  7225. likely not needed for Final Cut Pro 7 and newer with the appropriate
  7226. <samp class="option">-tag:v</samp>.
  7227. </p>
  7228. <p>For example, to remux 30 MB/sec NTSC IMX to MOV:
  7229. </p>
  7230. <div class="example">
  7231. <pre class="example-preformatted">ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
  7232. </pre></div>
  7233. <a name="mjpeg2jpeg"></a>
  7234. <h3 class="section">13.19 mjpeg2jpeg<span class="pull-right"><a class="anchor hidden-xs" href="#mjpeg2jpeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mjpeg2jpeg" aria-hidden="true">TOC</a></span></h3>
  7235. <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
  7236. </p>
  7237. <p>MJPEG is a video codec wherein each video frame is essentially a
  7238. JPEG image. The individual frames can be extracted without loss,
  7239. e.g. by
  7240. </p>
  7241. <div class="example">
  7242. <pre class="example-preformatted">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
  7243. </pre></div>
  7244. <p>Unfortunately, these chunks are incomplete JPEG images, because
  7245. they lack the DHT segment required for decoding. Quoting from
  7246. <a class="url" href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
  7247. </p>
  7248. <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
  7249. commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
  7250. MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
  7251. Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
  7252. and it must use basic Huffman encoding, not arithmetic or
  7253. progressive. . . . You can indeed extract the MJPEG frames and
  7254. decode them with a regular JPEG decoder, but you have to prepend
  7255. the DHT segment to them, or else the decoder won&rsquo;t have any idea
  7256. how to decompress the data. The exact table necessary is given in
  7257. the OpenDML spec.&quot;
  7258. </p>
  7259. <p>This bitstream filter patches the header of frames extracted from an MJPEG
  7260. stream (carrying the AVI1 header ID and lacking a DHT segment) to
  7261. produce fully qualified JPEG images.
  7262. </p>
  7263. <div class="example">
  7264. <pre class="example-preformatted">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
  7265. exiftran -i -9 frame*.jpg
  7266. ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
  7267. </pre></div>
  7268. <a name="mjpegadump"></a>
  7269. <h3 class="section">13.20 mjpegadump<span class="pull-right"><a class="anchor hidden-xs" href="#mjpegadump" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mjpegadump" aria-hidden="true">TOC</a></span></h3>
  7270. <p>Add an MJPEG A header to the bitstream, to enable decoding by
  7271. Quicktime.
  7272. </p>
  7273. <a class="anchor" id="mov2textsub"></a><a name="mov2textsub-1"></a>
  7274. <h3 class="section">13.21 mov2textsub<span class="pull-right"><a class="anchor hidden-xs" href="#mov2textsub-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mov2textsub-1" aria-hidden="true">TOC</a></span></h3>
  7275. <p>Extract a representable text file from MOV subtitles, stripping the
  7276. metadata header from each subtitle packet.
  7277. </p>
  7278. <p>See also the <a class="ref" href="#text2movsub">text2movsub</a> filter.
  7279. </p>
  7280. <a name="mpeg2_005fmetadata"></a>
  7281. <h3 class="section">13.22 mpeg2_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#mpeg2_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpeg2_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  7282. <p>Modify metadata embedded in an MPEG-2 stream.
  7283. </p>
  7284. <dl class="table">
  7285. <dt><samp class="option">display_aspect_ratio</samp></dt>
  7286. <dd><p>Set the display aspect ratio in the stream.
  7287. </p>
  7288. <p>The following fixed values are supported:
  7289. </p><dl class="table">
  7290. <dt><samp class="option">4/3</samp></dt>
  7291. <dt><samp class="option">16/9</samp></dt>
  7292. <dt><samp class="option">221/100</samp></dt>
  7293. </dl>
  7294. <p>Any other value will result in square pixels being signalled instead
  7295. (see H.262 section 6.3.3 and table 6-3).
  7296. </p>
  7297. </dd>
  7298. <dt><samp class="option">frame_rate</samp></dt>
  7299. <dd><p>Set the frame rate in the stream. This is constructed from a table
  7300. of known values combined with a small multiplier and divisor - if
  7301. the supplied value is not exactly representable, the nearest
  7302. representable value will be used instead (see H.262 section 6.3.3
  7303. and table 6-4).
  7304. </p>
  7305. </dd>
  7306. <dt><samp class="option">video_format</samp></dt>
  7307. <dd><p>Set the video format in the stream (see H.262 section 6.3.6 and
  7308. table 6-6).
  7309. </p>
  7310. </dd>
  7311. <dt><samp class="option">colour_primaries</samp></dt>
  7312. <dt><samp class="option">transfer_characteristics</samp></dt>
  7313. <dt><samp class="option">matrix_coefficients</samp></dt>
  7314. <dd><p>Set the colour description in the stream (see H.262 section 6.3.6
  7315. and tables 6-7, 6-8 and 6-9).
  7316. </p>
  7317. </dd>
  7318. </dl>
  7319. <a name="mpeg4_005funpack_005fbframes"></a>
  7320. <h3 class="section">13.23 mpeg4_unpack_bframes<span class="pull-right"><a class="anchor hidden-xs" href="#mpeg4_005funpack_005fbframes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpeg4_005funpack_005fbframes" aria-hidden="true">TOC</a></span></h3>
  7321. <p>Unpack DivX-style packed B-frames.
  7322. </p>
  7323. <p>DivX-style packed B-frames are not valid MPEG-4 and were only a
  7324. workaround for the broken Video for Windows subsystem.
  7325. They use more space, can cause minor AV sync issues, require more
  7326. CPU power to decode (unless the player has some decoded picture queue
  7327. to compensate the 2,0,2,0 frame per packet style) and cause
  7328. trouble if copied into a standard container like mp4 or mpeg-ps/ts,
  7329. because MPEG-4 decoders may not be able to decode them, since they are
  7330. not valid MPEG-4.
  7331. </p>
  7332. <p>For example to fix an AVI file containing an MPEG-4 stream with
  7333. DivX-style packed B-frames using <code class="command">ffmpeg</code>, you can use the command:
  7334. </p>
  7335. <div class="example">
  7336. <pre class="example-preformatted">ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
  7337. </pre></div>
  7338. <a name="noise"></a>
  7339. <h3 class="section">13.24 noise<span class="pull-right"><a class="anchor hidden-xs" href="#noise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noise" aria-hidden="true">TOC</a></span></h3>
  7340. <p>Damages the contents of packets or simply drops them without damaging the
  7341. container. Can be used for fuzzing or testing error resilience/concealment.
  7342. </p>
  7343. <p>Parameters:
  7344. </p><dl class="table">
  7345. <dt><samp class="option">amount</samp></dt>
  7346. <dd><p>Accepts an expression whose evaluation per-packet determines how often bytes in that
  7347. packet will be modified. A value below 0 will result in a variable frequency.
  7348. Default is 0 which results in no modification. However, if neither amount nor drop is specified,
  7349. amount will be set to <var class="var">-1</var>. See below for accepted variables.
  7350. </p></dd>
  7351. <dt><samp class="option">drop</samp></dt>
  7352. <dd><p>Accepts an expression evaluated per-packet whose value determines whether that packet is dropped.
  7353. Evaluation to a positive value results in the packet being dropped. Evaluation to a negative
  7354. value results in a variable chance of it being dropped, roughly inverse in proportion to the magnitude
  7355. of the value. Default is 0 which results in no drops. See below for accepted variables.
  7356. </p></dd>
  7357. <dt><samp class="option">dropamount</samp></dt>
  7358. <dd><p>Accepts a non-negative integer, which assigns a variable chance of it being dropped, roughly inverse
  7359. in proportion to the value. Default is 0 which results in no drops. This option is kept for backwards
  7360. compatibility and is equivalent to setting drop to a negative value with the same magnitude
  7361. i.e. <code class="code">dropamount=4</code> is the same as <code class="code">drop=-4</code>. Ignored if drop is also specified.
  7362. </p></dd>
  7363. </dl>
  7364. <p>Both <code class="code">amount</code> and <code class="code">drop</code> accept expressions containing the following variables:
  7365. </p>
  7366. <dl class="table">
  7367. <dt>&lsquo;<samp class="samp">n</samp>&rsquo;</dt>
  7368. <dd><p>The index of the packet, starting from zero.
  7369. </p></dd>
  7370. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  7371. <dd><p>The timebase for packet timestamps.
  7372. </p></dd>
  7373. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  7374. <dd><p>Packet presentation timestamp.
  7375. </p></dd>
  7376. <dt>&lsquo;<samp class="samp">dts</samp>&rsquo;</dt>
  7377. <dd><p>Packet decoding timestamp.
  7378. </p></dd>
  7379. <dt>&lsquo;<samp class="samp">nopts</samp>&rsquo;</dt>
  7380. <dd><p>Constant representing AV_NOPTS_VALUE.
  7381. </p></dd>
  7382. <dt>&lsquo;<samp class="samp">startpts</samp>&rsquo;</dt>
  7383. <dd><p>First non-AV_NOPTS_VALUE PTS seen in the stream.
  7384. </p></dd>
  7385. <dt>&lsquo;<samp class="samp">startdts</samp>&rsquo;</dt>
  7386. <dd><p>First non-AV_NOPTS_VALUE DTS seen in the stream.
  7387. </p></dd>
  7388. <dt>&lsquo;<samp class="samp">duration</samp>&rsquo;</dt>
  7389. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  7390. <dd><p>Packet duration, in timebase units.
  7391. </p></dd>
  7392. <dt>&lsquo;<samp class="samp">pos</samp>&rsquo;</dt>
  7393. <dd><p>Packet position in input; may be -1 when unknown or not set.
  7394. </p></dd>
  7395. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  7396. <dd><p>Packet size, in bytes.
  7397. </p></dd>
  7398. <dt>&lsquo;<samp class="samp">key</samp>&rsquo;</dt>
  7399. <dd><p>Whether packet is marked as a keyframe.
  7400. </p></dd>
  7401. <dt>&lsquo;<samp class="samp">state</samp>&rsquo;</dt>
  7402. <dd><p>A pseudo random integer, primarily derived from the content of packet payload.
  7403. </p></dd>
  7404. </dl>
  7405. <a name="Examples-2"></a>
  7406. <h4 class="subsection">13.24.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-2" aria-hidden="true">TOC</a></span></h4>
  7407. <p>Apply modification to every byte but don&rsquo;t drop any packets.
  7408. </p><div class="example">
  7409. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv
  7410. </pre></div>
  7411. <p>Drop every video packet not marked as a keyframe after timestamp 30s but do not
  7412. modify any of the remaining packets.
  7413. </p><div class="example">
  7414. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(pts*tb\,30)*not(key)' output.mkv
  7415. </pre></div>
  7416. <p>Drop one second of audio every 10 seconds and add some random noise to the rest.
  7417. </p><div class="example">
  7418. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(pts*tb\,10)\,9\,10)' output.mkv
  7419. </pre></div>
  7420. <a name="null"></a>
  7421. <h3 class="section">13.25 null<span class="pull-right"><a class="anchor hidden-xs" href="#null" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-null" aria-hidden="true">TOC</a></span></h3>
  7422. <p>This bitstream filter passes the packets through unchanged.
  7423. </p>
  7424. <a name="pcm_005frechunk"></a>
  7425. <h3 class="section">13.26 pcm_rechunk<span class="pull-right"><a class="anchor hidden-xs" href="#pcm_005frechunk" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pcm_005frechunk" aria-hidden="true">TOC</a></span></h3>
  7426. <p>Repacketize PCM audio to a fixed number of samples per packet or a fixed packet
  7427. rate per second. This is similar to the <a data-manual="ffmpeg-filters" href="ffmpeg-filters.html#asetnsamples">asetnsamples audio
  7428. filter</a> but works on audio packets instead of audio frames.
  7429. </p>
  7430. <dl class="table">
  7431. <dt><samp class="option">nb_out_samples, n</samp></dt>
  7432. <dd><p>Set the number of samples per each output audio packet. The number is intended
  7433. as the number of samples <em class="emph">per each channel</em>. Default value is 1024.
  7434. </p>
  7435. </dd>
  7436. <dt><samp class="option">pad, p</samp></dt>
  7437. <dd><p>If set to 1, the filter will pad the last audio packet with silence, so that it
  7438. will contain the same number of samples (or roughly the same number of samples,
  7439. see <samp class="option">frame_rate</samp>) as the previous ones. Default value is 1.
  7440. </p>
  7441. </dd>
  7442. <dt><samp class="option">frame_rate, r</samp></dt>
  7443. <dd><p>This option makes the filter output a fixed number of packets per second instead
  7444. of a fixed number of samples per packet. If the audio sample rate is not
  7445. divisible by the frame rate then the number of samples will not be constant but
  7446. will vary slightly so that each packet will start as close to the frame
  7447. boundary as possible. Using this option has precedence over <samp class="option">nb_out_samples</samp>.
  7448. </p></dd>
  7449. </dl>
  7450. <p>You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio
  7451. for NTSC frame rate using the <samp class="option">frame_rate</samp> option.
  7452. </p><div class="example">
  7453. <pre class="example-preformatted">ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
  7454. </pre></div>
  7455. <a name="pgs_005fframe_005fmerge"></a>
  7456. <h3 class="section">13.27 pgs_frame_merge<span class="pull-right"><a class="anchor hidden-xs" href="#pgs_005fframe_005fmerge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pgs_005fframe_005fmerge" aria-hidden="true">TOC</a></span></h3>
  7457. <p>Merge a sequence of PGS Subtitle segments ending with an &quot;end of display set&quot;
  7458. segment into a single packet.
  7459. </p>
  7460. <p>This is required by some containers that support PGS subtitles
  7461. (muxer <code class="code">matroska</code>).
  7462. </p>
  7463. <a name="prores_005fmetadata"></a>
  7464. <h3 class="section">13.28 prores_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#prores_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prores_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  7465. <p>Modify color property metadata embedded in prores stream.
  7466. </p>
  7467. <dl class="table">
  7468. <dt><samp class="option">color_primaries</samp></dt>
  7469. <dd><p>Set the color primaries.
  7470. Available values are:
  7471. </p>
  7472. <dl class="table">
  7473. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  7474. <dd><p>Keep the same color primaries property (default).
  7475. </p>
  7476. </dd>
  7477. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  7478. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  7479. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  7480. <dd><p>BT601 625
  7481. </p>
  7482. </dd>
  7483. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  7484. <dd><p>BT601 525
  7485. </p>
  7486. </dd>
  7487. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  7488. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  7489. <dd><p>DCI P3
  7490. </p>
  7491. </dd>
  7492. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  7493. <dd><p>P3 D65
  7494. </p>
  7495. </dd>
  7496. </dl>
  7497. </dd>
  7498. <dt><samp class="option">transfer_characteristics</samp></dt>
  7499. <dd><p>Set the color transfer.
  7500. Available values are:
  7501. </p>
  7502. <dl class="table">
  7503. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  7504. <dd><p>Keep the same transfer characteristics property (default).
  7505. </p>
  7506. </dd>
  7507. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  7508. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  7509. <dd><p>BT 601, BT 709, BT 2020
  7510. </p></dd>
  7511. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  7512. <dd><p>SMPTE ST 2084
  7513. </p></dd>
  7514. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  7515. <dd><p>ARIB STD-B67
  7516. </p></dd>
  7517. </dl>
  7518. </dd>
  7519. <dt><samp class="option">matrix_coefficients</samp></dt>
  7520. <dd><p>Set the matrix coefficient.
  7521. Available values are:
  7522. </p>
  7523. <dl class="table">
  7524. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  7525. <dd><p>Keep the same colorspace property (default).
  7526. </p>
  7527. </dd>
  7528. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  7529. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  7530. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  7531. <dd><p>BT 601
  7532. </p>
  7533. </dd>
  7534. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  7535. </dl>
  7536. </dd>
  7537. </dl>
  7538. <p>Set Rec709 colorspace for each frame of the file
  7539. </p><div class="example">
  7540. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
  7541. </pre></div>
  7542. <p>Set Hybrid Log-Gamma parameters for each frame of the file
  7543. </p><div class="example">
  7544. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov
  7545. </pre></div>
  7546. <a name="remove_005fextra"></a>
  7547. <h3 class="section">13.29 remove_extra<span class="pull-right"><a class="anchor hidden-xs" href="#remove_005fextra" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-remove_005fextra" aria-hidden="true">TOC</a></span></h3>
  7548. <p>Remove extradata from packets.
  7549. </p>
  7550. <p>It accepts the following parameter:
  7551. </p><dl class="table">
  7552. <dt><samp class="option">freq</samp></dt>
  7553. <dd><p>Set which frame types to remove extradata from.
  7554. </p>
  7555. <dl class="table">
  7556. <dt>&lsquo;<samp class="samp">k</samp>&rsquo;</dt>
  7557. <dd><p>Remove extradata from non-keyframes only.
  7558. </p>
  7559. </dd>
  7560. <dt>&lsquo;<samp class="samp">keyframe</samp>&rsquo;</dt>
  7561. <dd><p>Remove extradata from keyframes only.
  7562. </p>
  7563. </dd>
  7564. <dt>&lsquo;<samp class="samp">e, all</samp>&rsquo;</dt>
  7565. <dd><p>Remove extradata from all frames.
  7566. </p>
  7567. </dd>
  7568. </dl>
  7569. </dd>
  7570. </dl>
  7571. <a name="setts"></a>
  7572. <h3 class="section">13.30 setts<span class="pull-right"><a class="anchor hidden-xs" href="#setts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setts" aria-hidden="true">TOC</a></span></h3>
  7573. <p>Set PTS and DTS in packets.
  7574. </p>
  7575. <p>It accepts the following parameters:
  7576. </p><dl class="table">
  7577. <dt><samp class="option">ts</samp></dt>
  7578. <dt><samp class="option">pts</samp></dt>
  7579. <dt><samp class="option">dts</samp></dt>
  7580. <dd><p>Set expressions for PTS, DTS or both.
  7581. </p></dd>
  7582. <dt><samp class="option">duration</samp></dt>
  7583. <dd><p>Set expression for duration.
  7584. </p></dd>
  7585. <dt><samp class="option">time_base</samp></dt>
  7586. <dd><p>Set output time base.
  7587. </p></dd>
  7588. <dt><samp class="option">prescale</samp></dt>
  7589. <dd><p>Set whether to convert time fields to user-set output time base before evaluation of expressions. Defaults to 0.
  7590. </p></dd>
  7591. </dl>
  7592. <p>The expressions are evaluated through the eval API and can contain the following
  7593. constants:
  7594. </p>
  7595. <dl class="table">
  7596. <dt><samp class="option">N</samp></dt>
  7597. <dd><p>The count of the input packet. Starting from 0.
  7598. </p>
  7599. </dd>
  7600. <dt><samp class="option">TS</samp></dt>
  7601. <dd><p>The demux timestamp in input in case of <code class="code">ts</code> or <code class="code">dts</code> option or presentation
  7602. timestamp in case of <code class="code">pts</code> option.
  7603. </p>
  7604. </dd>
  7605. <dt><samp class="option">POS</samp></dt>
  7606. <dd><p>The original position in the file of the packet, or undefined if undefined
  7607. for the current packet
  7608. </p>
  7609. </dd>
  7610. <dt><samp class="option">DTS</samp></dt>
  7611. <dd><p>The demux timestamp in input.
  7612. </p>
  7613. </dd>
  7614. <dt><samp class="option">PTS</samp></dt>
  7615. <dd><p>The presentation timestamp in input.
  7616. </p>
  7617. </dd>
  7618. <dt><samp class="option">DURATION</samp></dt>
  7619. <dd><p>The duration in input.
  7620. </p>
  7621. </dd>
  7622. <dt><samp class="option">STARTDTS</samp></dt>
  7623. <dd><p>The DTS of the first packet.
  7624. </p>
  7625. </dd>
  7626. <dt><samp class="option">STARTPTS</samp></dt>
  7627. <dd><p>The PTS of the first packet.
  7628. </p>
  7629. </dd>
  7630. <dt><samp class="option">PREV_INDTS</samp></dt>
  7631. <dd><p>The previous input DTS.
  7632. </p>
  7633. </dd>
  7634. <dt><samp class="option">PREV_INPTS</samp></dt>
  7635. <dd><p>The previous input PTS.
  7636. </p>
  7637. </dd>
  7638. <dt><samp class="option">PREV_INDURATION</samp></dt>
  7639. <dd><p>The previous input duration.
  7640. </p>
  7641. </dd>
  7642. <dt><samp class="option">PREV_OUTDTS</samp></dt>
  7643. <dd><p>The previous output DTS.
  7644. </p>
  7645. </dd>
  7646. <dt><samp class="option">PREV_OUTPTS</samp></dt>
  7647. <dd><p>The previous output PTS.
  7648. </p>
  7649. </dd>
  7650. <dt><samp class="option">PREV_OUTDURATION</samp></dt>
  7651. <dd><p>The previous output duration.
  7652. </p>
  7653. </dd>
  7654. <dt><samp class="option">NEXT_DTS</samp></dt>
  7655. <dd><p>The next input DTS.
  7656. </p>
  7657. </dd>
  7658. <dt><samp class="option">NEXT_PTS</samp></dt>
  7659. <dd><p>The next input PTS.
  7660. </p>
  7661. </dd>
  7662. <dt><samp class="option">NEXT_DURATION</samp></dt>
  7663. <dd><p>The next input duration.
  7664. </p>
  7665. </dd>
  7666. <dt><samp class="option">TB</samp></dt>
  7667. <dd><p>The timebase in which time fields are denominated. The user-set output timebase if prescale is enabled, else the input timebase.
  7668. </p>
  7669. </dd>
  7670. <dt><samp class="option">TB_OUT</samp></dt>
  7671. <dd><p>The output timebase.
  7672. </p>
  7673. </dd>
  7674. <dt><samp class="option">SR</samp></dt>
  7675. <dd><p>The sample rate of stream packet belongs.
  7676. </p>
  7677. </dd>
  7678. <dt><samp class="option">NOPTS</samp></dt>
  7679. <dd><p>The AV_NOPTS_VALUE constant.
  7680. </p></dd>
  7681. </dl>
  7682. <p>For example, to set PTS equal to DTS (not recommended if B-frames are involved):
  7683. </p><div class="example">
  7684. <pre class="example-preformatted">ffmpeg -i INPUT -c:a copy -bsf:a setts=pts=DTS out.mkv
  7685. </pre></div>
  7686. <a name="showinfo"></a>
  7687. <h3 class="section">13.31 showinfo<span class="pull-right"><a class="anchor hidden-xs" href="#showinfo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showinfo" aria-hidden="true">TOC</a></span></h3>
  7688. <p>Log basic packet information. Mainly useful for testing, debugging,
  7689. and development.
  7690. </p>
  7691. <a name="smpte436m_005fto_005feia608"></a>
  7692. <h3 class="section">13.32 smpte436m_to_eia608<span class="pull-right"><a class="anchor hidden-xs" href="#smpte436m_005fto_005feia608" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smpte436m_005fto_005feia608" aria-hidden="true">TOC</a></span></h3>
  7693. <p>Convert from a <code class="code">SMPTE_436M_ANC</code> data stream to a <code class="code">EIA_608</code> stream,
  7694. extracting the closed captions from CTA-708 CDP VANC packets, and ignoring all other data.
  7695. </p>
  7696. <a class="anchor" id="text2movsub"></a><a name="text2movsub-1"></a>
  7697. <h3 class="section">13.33 text2movsub<span class="pull-right"><a class="anchor hidden-xs" href="#text2movsub-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-text2movsub-1" aria-hidden="true">TOC</a></span></h3>
  7698. <p>Convert text subtitles to MOV subtitles (as used by the <code class="code">mov_text</code>
  7699. codec) with metadata headers.
  7700. </p>
  7701. <p>See also the <a class="ref" href="#mov2textsub">mov2textsub</a> filter.
  7702. </p>
  7703. <a name="trace_005fheaders"></a>
  7704. <h3 class="section">13.34 trace_headers<span class="pull-right"><a class="anchor hidden-xs" href="#trace_005fheaders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-trace_005fheaders" aria-hidden="true">TOC</a></span></h3>
  7705. <p>Log trace output containing all syntax elements in the coded stream
  7706. headers (everything above the level of individual coded blocks).
  7707. This can be useful for debugging low-level stream issues.
  7708. </p>
  7709. <p>Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending
  7710. on the build only a subset of these may be available.
  7711. </p>
  7712. <a name="truehd_005fcore"></a>
  7713. <h3 class="section">13.35 truehd_core<span class="pull-right"><a class="anchor hidden-xs" href="#truehd_005fcore" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-truehd_005fcore" aria-hidden="true">TOC</a></span></h3>
  7714. <p>Extract the core from a TrueHD stream, dropping ATMOS data.
  7715. </p>
  7716. <a name="vp9_005fmetadata"></a>
  7717. <h3 class="section">13.36 vp9_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  7718. <p>Modify metadata embedded in a VP9 stream.
  7719. </p>
  7720. <dl class="table">
  7721. <dt><samp class="option">color_space</samp></dt>
  7722. <dd><p>Set the color space value in the frame header. Note that any frame
  7723. set to RGB will be implicitly set to PC range and that RGB is
  7724. incompatible with profiles 0 and 2.
  7725. </p><dl class="table">
  7726. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  7727. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  7728. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  7729. <dt>&lsquo;<samp class="samp">smpte170</samp>&rsquo;</dt>
  7730. <dt>&lsquo;<samp class="samp">smpte240</samp>&rsquo;</dt>
  7731. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  7732. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  7733. </dl>
  7734. </dd>
  7735. <dt><samp class="option">color_range</samp></dt>
  7736. <dd><p>Set the color range value in the frame header. Note that any value
  7737. imposed by the color space will take precedence over this value.
  7738. </p><dl class="table">
  7739. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  7740. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  7741. </dl>
  7742. </dd>
  7743. </dl>
  7744. <a name="vp9_005fsuperframe"></a>
  7745. <h3 class="section">13.37 vp9_superframe<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fsuperframe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fsuperframe" aria-hidden="true">TOC</a></span></h3>
  7746. <p>Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This
  7747. fixes merging of split/segmented VP9 streams where the alt-ref frame
  7748. was split from its visible counterpart.
  7749. </p>
  7750. <a name="vp9_005fsuperframe_005fsplit"></a>
  7751. <h3 class="section">13.38 vp9_superframe_split<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fsuperframe_005fsplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fsuperframe_005fsplit" aria-hidden="true">TOC</a></span></h3>
  7752. <p>Split VP9 superframes into single frames.
  7753. </p>
  7754. <a name="vp9_005fraw_005freorder"></a>
  7755. <h3 class="section">13.39 vp9_raw_reorder<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fraw_005freorder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fraw_005freorder" aria-hidden="true">TOC</a></span></h3>
  7756. <p>Given a VP9 stream with correct timestamps but possibly out of order,
  7757. insert additional show-existing-frame packets to correct the ordering.
  7758. </p>
  7759. <a name="Format-Options"></a>
  7760. <h2 class="chapter">14 Format Options<span class="pull-right"><a class="anchor hidden-xs" href="#Format-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Format-Options" aria-hidden="true">TOC</a></span></h2>
  7761. <p>The libavformat library provides some generic global options, which
  7762. can be set on all the muxers and demuxers. In addition each muxer or
  7763. demuxer may support so-called private options, which are specific for
  7764. that component.
  7765. </p>
  7766. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  7767. FFmpeg tools, or by setting the value explicitly in the
  7768. <code class="code">AVFormatContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  7769. for programmatic use.
  7770. </p>
  7771. <p>The list of supported options follows:
  7772. </p>
  7773. <dl class="table">
  7774. <dt><samp class="option">avioflags <var class="var">flags</var> (<em class="emph">input/output</em>)</samp></dt>
  7775. <dd><p>Possible values:
  7776. </p><dl class="table">
  7777. <dt>&lsquo;<samp class="samp">direct</samp>&rsquo;</dt>
  7778. <dd><p>Reduce buffering.
  7779. </p></dd>
  7780. </dl>
  7781. </dd>
  7782. <dt><samp class="option">probesize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7783. <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
  7784. stream information. A higher value will enable detecting more
  7785. information in case it is dispersed into the stream, but will increase
  7786. latency. Must be an integer not lesser than 32. It is 5000000 by default.
  7787. </p>
  7788. </dd>
  7789. <dt><samp class="option">max_probe_packets <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7790. <dd><p>Set the maximum number of buffered packets when probing a codec.
  7791. Default is 2500 packets.
  7792. </p>
  7793. </dd>
  7794. <dt><samp class="option">packetsize <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7795. <dd><p>Set packet size.
  7796. </p>
  7797. </dd>
  7798. <dt><samp class="option">fflags <var class="var">flags</var></samp></dt>
  7799. <dd><p>Set format flags. Some are implemented for a limited number of formats.
  7800. </p>
  7801. <p>Possible values for input files:
  7802. </p><dl class="table">
  7803. <dt>&lsquo;<samp class="samp">discardcorrupt</samp>&rsquo;</dt>
  7804. <dd><p>Discard corrupted packets.
  7805. </p></dd>
  7806. <dt>&lsquo;<samp class="samp">fastseek</samp>&rsquo;</dt>
  7807. <dd><p>Enable fast, but inaccurate seeks for some formats.
  7808. </p></dd>
  7809. <dt>&lsquo;<samp class="samp">genpts</samp>&rsquo;</dt>
  7810. <dd><p>Generate missing PTS if DTS is present.
  7811. </p></dd>
  7812. <dt>&lsquo;<samp class="samp">igndts</samp>&rsquo;</dt>
  7813. <dd><p>Ignore DTS if PTS is also set. In case the PTS is set, the DTS value
  7814. is set to NOPTS. This is ignored when the <code class="code">nofillin</code> flag is set.
  7815. </p></dd>
  7816. <dt>&lsquo;<samp class="samp">ignidx</samp>&rsquo;</dt>
  7817. <dd><p>Ignore index.
  7818. </p></dd>
  7819. <dt>&lsquo;<samp class="samp">nobuffer</samp>&rsquo;</dt>
  7820. <dd><p>Reduce the latency introduced by buffering during initial input streams analysis.
  7821. </p></dd>
  7822. <dt>&lsquo;<samp class="samp">nofillin</samp>&rsquo;</dt>
  7823. <dd><p>Do not fill in missing values in packet fields that can be exactly calculated.
  7824. </p></dd>
  7825. <dt>&lsquo;<samp class="samp">noparse</samp>&rsquo;</dt>
  7826. <dd><p>Disable AVParsers, this needs <code class="code">+nofillin</code> too.
  7827. </p></dd>
  7828. <dt>&lsquo;<samp class="samp">sortdts</samp>&rsquo;</dt>
  7829. <dd><p>Try to interleave output packets by DTS. At present, available only for AVIs with an index.
  7830. </p></dd>
  7831. </dl>
  7832. <p>Possible values for output files:
  7833. </p><dl class="table">
  7834. <dt>&lsquo;<samp class="samp">autobsf</samp>&rsquo;</dt>
  7835. <dd><p>Automatically apply bitstream filters as required by the output format. Enabled by default.
  7836. </p></dd>
  7837. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  7838. <dd><p>Only write platform-, build- and time-independent data.
  7839. This ensures that file and data checksums are reproducible and match between
  7840. platforms. Its primary use is for regression testing.
  7841. </p></dd>
  7842. <dt>&lsquo;<samp class="samp">flush_packets</samp>&rsquo;</dt>
  7843. <dd><p>Write out packets immediately.
  7844. </p></dd>
  7845. <dt>&lsquo;<samp class="samp">shortest</samp>&rsquo;</dt>
  7846. <dd><p>Stop muxing at the end of the shortest stream.
  7847. It may be needed to increase max_interleave_delta to avoid flushing the longer
  7848. streams before EOF.
  7849. </p></dd>
  7850. </dl>
  7851. </dd>
  7852. <dt><samp class="option">seek2any <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7853. <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  7854. Default is 0.
  7855. </p>
  7856. </dd>
  7857. <dt><samp class="option">analyzeduration <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7858. <dd><p>Specify how many microseconds are analyzed to probe the input. A
  7859. higher value will enable detecting more accurate information, but will
  7860. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  7861. </p>
  7862. </dd>
  7863. <dt><samp class="option">cryptokey <var class="var">hexadecimal string</var> (<em class="emph">input</em>)</samp></dt>
  7864. <dd><p>Set decryption key.
  7865. </p>
  7866. </dd>
  7867. <dt><samp class="option">indexmem <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7868. <dd><p>Set max memory used for timestamp index (per stream).
  7869. </p>
  7870. </dd>
  7871. <dt><samp class="option">rtbufsize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7872. <dd><p>Set max memory used for buffering real-time frames.
  7873. </p>
  7874. </dd>
  7875. <dt><samp class="option">fdebug <var class="var">flags</var> (<em class="emph">input/output</em>)</samp></dt>
  7876. <dd><p>Print specific debug info.
  7877. </p>
  7878. <p>Possible values:
  7879. </p><dl class="table">
  7880. <dt>&lsquo;<samp class="samp">ts</samp>&rsquo;</dt>
  7881. </dl>
  7882. </dd>
  7883. <dt><samp class="option">max_delay <var class="var">integer</var> (<em class="emph">input/output</em>)</samp></dt>
  7884. <dd><p>Set maximum muxing or demuxing delay in microseconds.
  7885. </p>
  7886. </dd>
  7887. <dt><samp class="option">fpsprobesize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7888. <dd><p>Set number of frames used to probe fps.
  7889. </p>
  7890. </dd>
  7891. <dt><samp class="option">audio_preload <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7892. <dd><p>Set microseconds by which audio packets should be interleaved earlier.
  7893. </p>
  7894. </dd>
  7895. <dt><samp class="option">chunk_duration <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7896. <dd><p>Set microseconds for each chunk.
  7897. </p>
  7898. </dd>
  7899. <dt><samp class="option">chunk_size <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7900. <dd><p>Set size in bytes for each chunk.
  7901. </p>
  7902. </dd>
  7903. <dt><samp class="option">err_detect, f_err_detect <var class="var">flags</var> (<em class="emph">input</em>)</samp></dt>
  7904. <dd><p>Set error detection flags. <code class="code">f_err_detect</code> is deprecated and
  7905. should be used only via the <code class="command">ffmpeg</code> tool.
  7906. </p>
  7907. <p>Possible values:
  7908. </p><dl class="table">
  7909. <dt>&lsquo;<samp class="samp">crccheck</samp>&rsquo;</dt>
  7910. <dd><p>Verify embedded CRCs.
  7911. </p></dd>
  7912. <dt>&lsquo;<samp class="samp">bitstream</samp>&rsquo;</dt>
  7913. <dd><p>Detect bitstream specification deviations.
  7914. </p></dd>
  7915. <dt>&lsquo;<samp class="samp">buffer</samp>&rsquo;</dt>
  7916. <dd><p>Detect improper bitstream length.
  7917. </p></dd>
  7918. <dt>&lsquo;<samp class="samp">explode</samp>&rsquo;</dt>
  7919. <dd><p>Abort decoding on minor error detection.
  7920. </p></dd>
  7921. <dt>&lsquo;<samp class="samp">careful</samp>&rsquo;</dt>
  7922. <dd><p>Consider things that violate the spec and have not been seen in the
  7923. wild as errors.
  7924. </p></dd>
  7925. <dt>&lsquo;<samp class="samp">compliant</samp>&rsquo;</dt>
  7926. <dd><p>Consider all spec non compliancies as errors.
  7927. </p></dd>
  7928. <dt>&lsquo;<samp class="samp">aggressive</samp>&rsquo;</dt>
  7929. <dd><p>Consider things that a sane encoder should not do as an error.
  7930. </p></dd>
  7931. </dl>
  7932. </dd>
  7933. <dt><samp class="option">max_interleave_delta <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7934. <dd><p>Set maximum buffering duration for interleaving. The duration is
  7935. expressed in microseconds, and defaults to 10000000 (10 seconds).
  7936. </p>
  7937. <p>To ensure all the streams are interleaved correctly, libavformat will
  7938. wait until it has at least one packet for each stream before actually
  7939. writing any packets to the output file. When some streams are
  7940. &quot;sparse&quot; (i.e. there are large gaps between successive packets), this
  7941. can result in excessive buffering.
  7942. </p>
  7943. <p>This field specifies the maximum difference between the timestamps of the
  7944. first and the last packet in the muxing queue, above which libavformat
  7945. will output a packet regardless of whether it has queued a packet for all
  7946. the streams.
  7947. </p>
  7948. <p>If set to 0, libavformat will continue buffering packets until it has
  7949. a packet for each stream, regardless of the maximum timestamp
  7950. difference between the buffered packets.
  7951. </p>
  7952. </dd>
  7953. <dt><samp class="option">use_wallclock_as_timestamps <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7954. <dd><p>Use wallclock as timestamps if set to 1. Default is 0.
  7955. </p>
  7956. </dd>
  7957. <dt><samp class="option">avoid_negative_ts <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7958. <dd>
  7959. <p>Possible values:
  7960. </p><dl class="table">
  7961. <dt>&lsquo;<samp class="samp">make_non_negative</samp>&rsquo;</dt>
  7962. <dd><p>Shift timestamps to make them non-negative.
  7963. Also note that this affects only leading negative timestamps, and not
  7964. non-monotonic negative timestamps.
  7965. </p></dd>
  7966. <dt>&lsquo;<samp class="samp">make_zero</samp>&rsquo;</dt>
  7967. <dd><p>Shift timestamps so that the first timestamp is 0.
  7968. </p></dd>
  7969. <dt>&lsquo;<samp class="samp">auto (default)</samp>&rsquo;</dt>
  7970. <dd><p>Enables shifting when required by the target format.
  7971. </p></dd>
  7972. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  7973. <dd><p>Disables shifting of timestamp.
  7974. </p></dd>
  7975. </dl>
  7976. <p>When shifting is enabled, all output timestamps are shifted by the
  7977. same amount. Audio, video, and subtitles desynching and relative
  7978. timestamp differences are preserved compared to how they would have
  7979. been without shifting.
  7980. </p>
  7981. </dd>
  7982. <dt><samp class="option">skip_initial_bytes <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7983. <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
  7984. Default is 0.
  7985. </p>
  7986. </dd>
  7987. <dt><samp class="option">correct_ts_overflow <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7988. <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
  7989. </p>
  7990. </dd>
  7991. <dt><samp class="option">flush_packets <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7992. <dd><p>Flush the underlying I/O stream after each packet. Default is -1 (auto), which
  7993. means that the underlying protocol will decide, 1 enables it, and has the
  7994. effect of reducing the latency, 0 disables it and may increase IO throughput in
  7995. some cases.
  7996. </p>
  7997. </dd>
  7998. <dt><samp class="option">output_ts_offset <var class="var">offset</var> (<em class="emph">output</em>)</samp></dt>
  7999. <dd><p>Set the output time offset.
  8000. </p>
  8001. <p><var class="var">offset</var> must be a time duration specification,
  8002. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  8003. </p>
  8004. <p>The offset is added by the muxer to the output timestamps.
  8005. </p>
  8006. <p>Specifying a positive offset means that the corresponding streams are
  8007. delayed bt the time duration specified in <var class="var">offset</var>. Default value
  8008. is <code class="code">0</code> (meaning that no offset is applied).
  8009. </p>
  8010. </dd>
  8011. <dt><samp class="option">format_whitelist <var class="var">list</var> (<em class="emph">input</em>)</samp></dt>
  8012. <dd><p>&quot;,&quot; separated list of allowed demuxers. By default all are allowed.
  8013. </p>
  8014. </dd>
  8015. <dt><samp class="option">dump_separator <var class="var">string</var> (<em class="emph">input</em>)</samp></dt>
  8016. <dd><p>Separator used to separate the fields printed on the command line about the
  8017. Stream parameters.
  8018. For example, to separate the fields with newlines and indentation:
  8019. </p><div class="example">
  8020. <pre class="example-preformatted">ffprobe -dump_separator &quot;
  8021. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  8022. </pre></div>
  8023. </dd>
  8024. <dt><samp class="option">max_streams <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  8025. <dd><p>Specifies the maximum number of streams. This can be used to reject files that
  8026. would require too many resources due to a large number of streams.
  8027. </p>
  8028. </dd>
  8029. <dt><samp class="option">skip_estimate_duration_from_pts <var class="var">bool</var> (<em class="emph">input</em>)</samp></dt>
  8030. <dd><p>Skip estimation of input duration if it requires an additional probing for PTS at end of file.
  8031. At present, applicable for MPEG-PS and MPEG-TS.
  8032. </p>
  8033. </dd>
  8034. <dt><samp class="option">duration_probesize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  8035. <dd><p>Set probing size, in bytes, for input duration estimation when it actually requires
  8036. an additional probing for PTS at end of file (at present: MPEG-PS and MPEG-TS).
  8037. It is aimed at users interested in better durations probing for itself, or indirectly
  8038. because using the concat demuxer, for example.
  8039. The typical use case is an MPEG-TS CBR with a high bitrate, high video buffering and
  8040. ending cleaning with similar PTS for video and audio: in such a scenario, the large
  8041. physical gap between the last video packet and the last audio packet makes it necessary
  8042. to read many bytes in order to get the video stream duration.
  8043. Another use case is where the default probing behaviour only reaches a single video frame which is
  8044. not the last one of the stream due to frame reordering, so the duration is not accurate.
  8045. Setting this option has a performance impact even for small files because the probing
  8046. size is fixed.
  8047. Default behaviour is a general purpose trade-off, largely adaptive, but the probing size
  8048. will not be extended to get streams durations at all costs.
  8049. Must be an integer not lesser than 1, or 0 for default behaviour.
  8050. </p>
  8051. </dd>
  8052. <dt><samp class="option">strict, f_strict <var class="var">integer</var> (<em class="emph">input/output</em>)</samp></dt>
  8053. <dd><p>Specify how strictly to follow the standards. <code class="code">f_strict</code> is deprecated and
  8054. should be used only via the <code class="command">ffmpeg</code> tool.
  8055. </p>
  8056. <p>Possible values:
  8057. </p><dl class="table">
  8058. <dt>&lsquo;<samp class="samp">very</samp>&rsquo;</dt>
  8059. <dd><p>strictly conform to an older more strict version of the spec or reference software
  8060. </p></dd>
  8061. <dt>&lsquo;<samp class="samp">strict</samp>&rsquo;</dt>
  8062. <dd><p>strictly conform to all the things in the spec no matter what consequences
  8063. </p></dd>
  8064. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  8065. <dt>&lsquo;<samp class="samp">unofficial</samp>&rsquo;</dt>
  8066. <dd><p>allow unofficial extensions
  8067. </p></dd>
  8068. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  8069. <dd><p>allow non standardized experimental things, experimental
  8070. (unfinished/work in progress/not well tested) decoders and encoders.
  8071. Note: experimental decoders can pose a security risk, do not use this for
  8072. decoding untrusted input.
  8073. </p></dd>
  8074. </dl>
  8075. </dd>
  8076. </dl>
  8077. <a class="anchor" id="Format-stream-specifiers"></a><a name="Format-stream-specifiers-1"></a>
  8078. <h3 class="section">14.1 Format stream specifiers<span class="pull-right"><a class="anchor hidden-xs" href="#Format-stream-specifiers-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Format-stream-specifiers-1" aria-hidden="true">TOC</a></span></h3>
  8079. <p>Format stream specifiers allow selection of one or more streams that
  8080. match specific properties.
  8081. </p>
  8082. <p>The exact semantics of stream specifiers is defined by the
  8083. <code class="code">avformat_match_stream_specifier()</code> function declared in the
  8084. <samp class="file">libavformat/avformat.h</samp> header and documented in the
  8085. <a data-manual="ffmpeg" href="ffmpeg.html#Stream-specifiers">Stream specifiers section in the ffmpeg(1) manual</a>.
  8086. </p>
  8087. <a name="Demuxers"></a>
  8088. <h2 class="chapter">15 Demuxers<span class="pull-right"><a class="anchor hidden-xs" href="#Demuxers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Demuxers" aria-hidden="true">TOC</a></span></h2>
  8089. <p>Demuxers are configured elements in FFmpeg that can read the
  8090. multimedia streams from a particular type of file.
  8091. </p>
  8092. <p>When you configure your FFmpeg build, all the supported demuxers
  8093. are enabled by default. You can list all available ones using the
  8094. configure option <code class="code">--list-demuxers</code>.
  8095. </p>
  8096. <p>You can disable all the demuxers using the configure option
  8097. <code class="code">--disable-demuxers</code>, and selectively enable a single demuxer with
  8098. the option <code class="code">--enable-demuxer=<var class="var">DEMUXER</var></code>, or disable it
  8099. with the option <code class="code">--disable-demuxer=<var class="var">DEMUXER</var></code>.
  8100. </p>
  8101. <p>The option <code class="code">-demuxers</code> of the ff* tools will display the list of
  8102. enabled demuxers. Use <code class="code">-formats</code> to view a combined list of
  8103. enabled demuxers and muxers.
  8104. </p>
  8105. <p>The description of some of the currently available demuxers follows.
  8106. </p>
  8107. <a name="aa"></a>
  8108. <h3 class="section">15.1 aa<span class="pull-right"><a class="anchor hidden-xs" href="#aa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aa" aria-hidden="true">TOC</a></span></h3>
  8109. <p>Audible Format 2, 3, and 4 demuxer.
  8110. </p>
  8111. <p>This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
  8112. </p>
  8113. <a name="aac"></a>
  8114. <h3 class="section">15.2 aac<span class="pull-right"><a class="anchor hidden-xs" href="#aac" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aac" aria-hidden="true">TOC</a></span></h3>
  8115. <p>Raw Audio Data Transport Stream AAC demuxer.
  8116. </p>
  8117. <p>This demuxer is used to demux an ADTS input containing a single AAC stream
  8118. alongwith any ID3v1/2 or APE tags in it.
  8119. </p>
  8120. <a name="apng"></a>
  8121. <h3 class="section">15.3 apng<span class="pull-right"><a class="anchor hidden-xs" href="#apng" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apng" aria-hidden="true">TOC</a></span></h3>
  8122. <p>Animated Portable Network Graphics demuxer.
  8123. </p>
  8124. <p>This demuxer is used to demux APNG files.
  8125. All headers, but the PNG signature, up to (but not including) the first
  8126. fcTL chunk are transmitted as extradata.
  8127. Frames are then split as being all the chunks between two fcTL ones, or
  8128. between the last fcTL and IEND chunks.
  8129. </p>
  8130. <dl class="table">
  8131. <dt><samp class="option">-ignore_loop <var class="var">bool</var></samp></dt>
  8132. <dd><p>Ignore the loop variable in the file if set. Default is enabled.
  8133. </p>
  8134. </dd>
  8135. <dt><samp class="option">-max_fps <var class="var">int</var></samp></dt>
  8136. <dd><p>Maximum framerate in frames per second. Default of 0 imposes no limit.
  8137. </p>
  8138. </dd>
  8139. <dt><samp class="option">-default_fps <var class="var">int</var></samp></dt>
  8140. <dd><p>Default framerate in frames per second when none is specified in the file
  8141. (0 meaning as fast as possible). Default is 15.
  8142. </p>
  8143. </dd>
  8144. </dl>
  8145. <a name="asf"></a>
  8146. <h3 class="section">15.4 asf<span class="pull-right"><a class="anchor hidden-xs" href="#asf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asf" aria-hidden="true">TOC</a></span></h3>
  8147. <p>Advanced Systems Format demuxer.
  8148. </p>
  8149. <p>This demuxer is used to demux ASF files and MMS network streams.
  8150. </p>
  8151. <dl class="table">
  8152. <dt><samp class="option">-no_resync_search <var class="var">bool</var></samp></dt>
  8153. <dd><p>Do not try to resynchronize by looking for a certain optional start code.
  8154. </p></dd>
  8155. </dl>
  8156. <a class="anchor" id="concat"></a><a name="concat-1"></a>
  8157. <h3 class="section">15.5 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat-1" aria-hidden="true">TOC</a></span></h3>
  8158. <p>Virtual concatenation script demuxer.
  8159. </p>
  8160. <p>This demuxer reads a list of files and other directives from a text file and
  8161. demuxes them one after the other, as if all their packets had been muxed
  8162. together.
  8163. </p>
  8164. <p>The timestamps in the files are adjusted so that the first file starts at 0
  8165. and each next file starts where the previous one finishes. Note that it is
  8166. done globally and may cause gaps if all streams do not have exactly the same
  8167. length.
  8168. </p>
  8169. <p>All files must have the same streams (same codecs, same time base, etc.).
  8170. </p>
  8171. <p>The duration of each file is used to adjust the timestamps of the next file:
  8172. if the duration is incorrect (because it was computed using the bit-rate or
  8173. because the file is truncated, for example), it can cause artifacts. The
  8174. <code class="code">duration</code> directive can be used to override the duration stored in
  8175. each file.
  8176. </p>
  8177. <a name="Syntax-1"></a>
  8178. <h4 class="subsection">15.5.1 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax-1" aria-hidden="true">TOC</a></span></h4>
  8179. <p>The script is a text file in extended-ASCII, with one directive per line.
  8180. Empty lines, leading spaces and lines starting with &rsquo;#&rsquo; are ignored. The
  8181. following directive is recognized:
  8182. </p>
  8183. <dl class="table">
  8184. <dt><samp class="option"><code class="code">file <var class="var">path</var></code></samp></dt>
  8185. <dd><p>Path to a file to read; special characters and spaces must be escaped with
  8186. backslash or single quotes.
  8187. </p>
  8188. <p>All subsequent file-related directives apply to that file.
  8189. </p>
  8190. </dd>
  8191. <dt><samp class="option"><code class="code">ffconcat version 1.0</code></samp></dt>
  8192. <dd><p>Identify the script type and version.
  8193. </p>
  8194. <p>To make FFmpeg recognize the format automatically, this directive must
  8195. appear exactly as is (no extra space or byte-order-mark) on the very first
  8196. line of the script.
  8197. </p>
  8198. </dd>
  8199. <dt><samp class="option"><code class="code">duration <var class="var">dur</var></code></samp></dt>
  8200. <dd><p>Duration of the file. This information can be specified from the file;
  8201. specifying it here may be more efficient or help if the information from the
  8202. file is not available or accurate.
  8203. </p>
  8204. <p>If the duration is set for all files, then it is possible to seek in the
  8205. whole concatenated video.
  8206. </p>
  8207. </dd>
  8208. <dt><samp class="option"><code class="code">inpoint <var class="var">timestamp</var></code></samp></dt>
  8209. <dd><p>In point of the file. When the demuxer opens the file it instantly seeks to the
  8210. specified timestamp. Seeking is done so that all streams can be presented
  8211. successfully at In point.
  8212. </p>
  8213. <p>This directive works best with intra frame codecs, because for non-intra frame
  8214. ones you will usually get extra packets before the actual In point and the
  8215. decoded content will most likely contain frames before In point too.
  8216. </p>
  8217. <p>For each file, packets before the file In point will have timestamps less than
  8218. the calculated start timestamp of the file (negative in case of the first
  8219. file), and the duration of the files (if not specified by the <code class="code">duration</code>
  8220. directive) will be reduced based on their specified In point.
  8221. </p>
  8222. <p>Because of potential packets before the specified In point, packet timestamps
  8223. may overlap between two concatenated files.
  8224. </p>
  8225. </dd>
  8226. <dt><samp class="option"><code class="code">outpoint <var class="var">timestamp</var></code></samp></dt>
  8227. <dd><p>Out point of the file. When the demuxer reaches the specified decoding
  8228. timestamp in any of the streams, it handles it as an end of file condition and
  8229. skips the current and all the remaining packets from all streams.
  8230. </p>
  8231. <p>Out point is exclusive, which means that the demuxer will not output packets
  8232. with a decoding timestamp greater or equal to Out point.
  8233. </p>
  8234. <p>This directive works best with intra frame codecs and formats where all streams
  8235. are tightly interleaved. For non-intra frame codecs you will usually get
  8236. additional packets with presentation timestamp after Out point therefore the
  8237. decoded content will most likely contain frames after Out point too. If your
  8238. streams are not tightly interleaved you may not get all the packets from all
  8239. streams before Out point and you may only will be able to decode the earliest
  8240. stream until Out point.
  8241. </p>
  8242. <p>The duration of the files (if not specified by the <code class="code">duration</code>
  8243. directive) will be reduced based on their specified Out point.
  8244. </p>
  8245. </dd>
  8246. <dt><samp class="option"><code class="code">file_packet_metadata <var class="var">key=value</var></code></samp></dt>
  8247. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  8248. each file packet. You can specify this directive multiple times to add multiple
  8249. metadata entries.
  8250. This directive is deprecated, use <code class="code">file_packet_meta</code> instead.
  8251. </p>
  8252. </dd>
  8253. <dt><samp class="option"><code class="code">file_packet_meta <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  8254. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  8255. each file packet. You can specify this directive multiple times to add multiple
  8256. metadata entries.
  8257. </p>
  8258. </dd>
  8259. <dt><samp class="option"><code class="code">option <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  8260. <dd><p>Option to access, open and probe the file.
  8261. Can be present multiple times.
  8262. </p>
  8263. </dd>
  8264. <dt><samp class="option"><code class="code">stream</code></samp></dt>
  8265. <dd><p>Introduce a stream in the virtual file.
  8266. All subsequent stream-related directives apply to the last introduced
  8267. stream.
  8268. Some streams properties must be set in order to allow identifying the
  8269. matching streams in the subfiles.
  8270. If no streams are defined in the script, the streams from the first file are
  8271. copied.
  8272. </p>
  8273. </dd>
  8274. <dt><samp class="option"><code class="code">exact_stream_id <var class="var">id</var></code></samp></dt>
  8275. <dd><p>Set the id of the stream.
  8276. If this directive is given, the string with the corresponding id in the
  8277. subfiles will be used.
  8278. This is especially useful for MPEG-PS (VOB) files, where the order of the
  8279. streams is not reliable.
  8280. </p>
  8281. </dd>
  8282. <dt><samp class="option"><code class="code">stream_meta <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  8283. <dd><p>Metadata for the stream.
  8284. Can be present multiple times.
  8285. </p>
  8286. </dd>
  8287. <dt><samp class="option"><code class="code">stream_codec <var class="var">value</var></code></samp></dt>
  8288. <dd><p>Codec for the stream.
  8289. </p>
  8290. </dd>
  8291. <dt><samp class="option"><code class="code">stream_extradata <var class="var">hex_string</var></code></samp></dt>
  8292. <dd><p>Extradata for the string, encoded in hexadecimal.
  8293. </p>
  8294. </dd>
  8295. <dt><samp class="option"><code class="code">chapter <var class="var">id</var> <var class="var">start</var> <var class="var">end</var></code></samp></dt>
  8296. <dd><p>Add a chapter. <var class="var">id</var> is an unique identifier, possibly small and
  8297. consecutive.
  8298. </p>
  8299. </dd>
  8300. </dl>
  8301. <a name="Options-12"></a>
  8302. <h4 class="subsection">15.5.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-12" aria-hidden="true">TOC</a></span></h4>
  8303. <p>This demuxer accepts the following option:
  8304. </p>
  8305. <dl class="table">
  8306. <dt><samp class="option">safe</samp></dt>
  8307. <dd><p>If set to 1, reject unsafe file paths and directives.
  8308. A file path is considered safe if it
  8309. does not contain a protocol specification and is relative and all components
  8310. only contain characters from the portable character set (letters, digits,
  8311. period, underscore and hyphen) and have no period at the beginning of a
  8312. component.
  8313. </p>
  8314. <p>If set to 0, any file name is accepted.
  8315. </p>
  8316. <p>The default is 1.
  8317. </p>
  8318. </dd>
  8319. <dt><samp class="option">auto_convert</samp></dt>
  8320. <dd><p>If set to 1, try to perform automatic conversions on packet data to make the
  8321. streams concatenable.
  8322. The default is 1.
  8323. </p>
  8324. <p>Currently, the only conversion is adding the h264_mp4toannexb bitstream
  8325. filter to H.264 streams in MP4 format. This is necessary in particular if
  8326. there are resolution changes.
  8327. </p>
  8328. </dd>
  8329. <dt><samp class="option">segment_time_metadata</samp></dt>
  8330. <dd><p>If set to 1, every packet will contain the <var class="var">lavf.concat.start_time</var> and the
  8331. <var class="var">lavf.concat.duration</var> packet metadata values which are the start_time and
  8332. the duration of the respective file segments in the concatenated output
  8333. expressed in microseconds. The duration metadata is only set if it is known
  8334. based on the concat file.
  8335. The default is 0.
  8336. </p>
  8337. </dd>
  8338. </dl>
  8339. <a name="Examples-3"></a>
  8340. <h4 class="subsection">15.5.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-3" aria-hidden="true">TOC</a></span></h4>
  8341. <ul class="itemize mark-bullet">
  8342. <li>Use absolute filenames and include some comments:
  8343. <div class="example">
  8344. <pre class="example-preformatted"># my first filename
  8345. file /mnt/share/file-1.wav
  8346. # my second filename including whitespace
  8347. file '/mnt/share/file 2.wav'
  8348. # my third filename including whitespace plus single quote
  8349. file '/mnt/share/file 3'\''.wav'
  8350. </pre></div>
  8351. </li><li>Allow for input format auto-probing, use safe filenames and set the duration of
  8352. the first file:
  8353. <div class="example">
  8354. <pre class="example-preformatted">ffconcat version 1.0
  8355. file file-1.wav
  8356. duration 20.0
  8357. file subdir/file-2.wav
  8358. </pre></div>
  8359. </li></ul>
  8360. <a name="dash"></a>
  8361. <h3 class="section">15.6 dash<span class="pull-right"><a class="anchor hidden-xs" href="#dash" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dash" aria-hidden="true">TOC</a></span></h3>
  8362. <p>Dynamic Adaptive Streaming over HTTP demuxer.
  8363. </p>
  8364. <p>This demuxer presents all AVStreams found in the manifest.
  8365. By setting the discard flags on AVStreams the caller can decide
  8366. which streams to actually receive.
  8367. Each stream mirrors the <code class="code">id</code> and <code class="code">bandwidth</code> properties from the
  8368. <code class="code">&lt;Representation&gt;</code> as metadata keys named &quot;id&quot; and &quot;variant_bitrate&quot; respectively.
  8369. </p>
  8370. <a name="Options-13"></a>
  8371. <h4 class="subsection">15.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-13" aria-hidden="true">TOC</a></span></h4>
  8372. <p>This demuxer accepts the following option:
  8373. </p>
  8374. <dl class="table">
  8375. <dt><samp class="option">cenc_decryption_key</samp></dt>
  8376. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  8377. </p>
  8378. </dd>
  8379. </dl>
  8380. <a name="dvdvideo"></a>
  8381. <h3 class="section">15.7 dvdvideo<span class="pull-right"><a class="anchor hidden-xs" href="#dvdvideo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dvdvideo" aria-hidden="true">TOC</a></span></h3>
  8382. <p>DVD-Video demuxer, powered by libdvdnav and libdvdread.
  8383. </p>
  8384. <p>Can directly ingest DVD titles, specifically sequential PGCs, into
  8385. a conversion pipeline. Menu assets, such as background video or audio,
  8386. can also be demuxed given the menu&rsquo;s coordinates (at best effort).
  8387. </p>
  8388. <p>Block devices (DVD drives), ISO files, and directory structures are accepted.
  8389. Activate with <code class="code">-f dvdvideo</code> in front of one of these inputs.
  8390. </p>
  8391. <p>This demuxer does NOT have decryption code of any kind. You are on your own
  8392. working with encrypted DVDs, and should not expect support on the matter.
  8393. </p>
  8394. <p>Underlying playback is handled by libdvdnav, and structure parsing by libdvdread.
  8395. FFmpeg must be built with GPL library support available as well as the
  8396. configure switches <code class="code">--enable-libdvdnav</code> and <code class="code">--enable-libdvdread</code>.
  8397. </p>
  8398. <p>You will need to provide either the desired &quot;title number&quot; or exact PGC/PG coordinates.
  8399. Many open-source DVD players and tools can aid in providing this information.
  8400. If not specified, the demuxer will default to title 1 which works for many discs.
  8401. However, due to the flexibility of the format, it is recommended to check manually.
  8402. There are many discs that are authored strangely or with invalid headers.
  8403. </p>
  8404. <p>If the input is a real DVD drive, please note that there are some drives which may
  8405. silently fail on reading bad sectors from the disc, returning random bits instead
  8406. which is effectively corrupt data. This is especially prominent on aging or rotting discs.
  8407. A second pass and integrity checks would be needed to detect the corruption.
  8408. This is not an FFmpeg issue.
  8409. </p>
  8410. <a name="Background"></a>
  8411. <h4 class="subsection">15.7.1 Background<span class="pull-right"><a class="anchor hidden-xs" href="#Background" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Background" aria-hidden="true">TOC</a></span></h4>
  8412. <p>DVD-Video is not a directly accessible, linear container format in the
  8413. traditional sense. Instead, it allows for complex and programmatic playback of
  8414. carefully muxed MPEG-PS streams that are stored in headerless VOB files.
  8415. To the end-user, these streams are known simply as &quot;titles&quot;, but the actual
  8416. logical playback sequence is defined by one or more &quot;PGCs&quot;, or Program Group Chains,
  8417. within the title. The PGC is in turn comprised of multiple &quot;PGs&quot;, or Programs&quot;,
  8418. which are the actual video segments (and for a typical video feature, sequentially
  8419. ordered). The PGC structure, along with stream layout and metadata, are stored in
  8420. IFO files that need to be parsed. PGCs can be thought of as playlists in easier terms.
  8421. </p>
  8422. <p>An actual DVD player relies on user GUI interaction via menus and an internal VM
  8423. to drive the direction of demuxing. Generally, the user would either navigate (via menus)
  8424. or automatically be redirected to the PGC of their choice. During this process and
  8425. the subsequent playback, the DVD player&rsquo;s internal VM also maintains a state and
  8426. executes instructions that can create jumps to different sectors during playback.
  8427. This is why libdvdnav is involved, as a linear read of the MPEG-PS blobs on the
  8428. disc (VOBs) is not enough to produce the right sequence in many cases.
  8429. </p>
  8430. <p>There are many other DVD structures (a long subject) that will not be discussed here.
  8431. NAV packets, in particular, are handled by this demuxer to build accurate timing
  8432. but not emitted as a stream. For a good high-level understanding, refer to:
  8433. <a class="url" href="https://code.videolan.org/videolan/libdvdnav/-/blob/master/doc/dvd_structures">https://code.videolan.org/videolan/libdvdnav/-/blob/master/doc/dvd_structures</a>
  8434. </p>
  8435. <a name="Options-14"></a>
  8436. <h4 class="subsection">15.7.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-14" aria-hidden="true">TOC</a></span></h4>
  8437. <p>This demuxer accepts the following options:
  8438. </p>
  8439. <dl class="table">
  8440. <dt><samp class="option">title <var class="var">int</var></samp></dt>
  8441. <dd><p>The title number to play. Must be set if <samp class="option">pgc</samp> and <samp class="option">pg</samp> are not set.
  8442. Not applicable to menus.
  8443. Default is 0 (auto), which currently only selects the first available title (title 1)
  8444. and notifies the user about the implications.
  8445. </p>
  8446. </dd>
  8447. <dt><samp class="option">chapter_start <var class="var">int</var></samp></dt>
  8448. <dd><p>The chapter, or PTT (part-of-title), number to start at. Not applicable to menus.
  8449. Default is 1.
  8450. </p>
  8451. </dd>
  8452. <dt><samp class="option">chapter_end <var class="var">int</var></samp></dt>
  8453. <dd><p>The chapter, or PTT (part-of-title), number to end at. Not applicable to menus.
  8454. Default is 0, which is a special value to signal end at the last possible chapter.
  8455. </p>
  8456. </dd>
  8457. <dt><samp class="option">angle <var class="var">int</var></samp></dt>
  8458. <dd><p>The video angle number, referring to what is essentially an additional
  8459. video stream that is composed from alternate frames interleaved in the VOBs.
  8460. Not applicable to menus.
  8461. Default is 1.
  8462. </p>
  8463. </dd>
  8464. <dt><samp class="option">region <var class="var">int</var></samp></dt>
  8465. <dd><p>The region code to use for playback. Some discs may use this to default playback
  8466. at a particular angle in different regions. This option will not affect the region code
  8467. of a real DVD drive, if used as an input. Not applicable to menus.
  8468. Default is 0, &quot;world&quot;.
  8469. </p>
  8470. </dd>
  8471. <dt><samp class="option">menu <var class="var">bool</var></samp></dt>
  8472. <dd><p>Demux menu assets instead of navigating a title. Requires exact coordinates
  8473. of the menu (<samp class="option">menu_lu</samp>, <samp class="option">menu_vts</samp>, <samp class="option">pgc</samp>, <samp class="option">pg</samp>).
  8474. Default is false.
  8475. </p>
  8476. </dd>
  8477. <dt><samp class="option">menu_lu <var class="var">int</var></samp></dt>
  8478. <dd><p>The menu language to demux. In DVD, menus are grouped by language.
  8479. Default is 1, the first language unit.
  8480. </p>
  8481. </dd>
  8482. <dt><samp class="option">menu_vts <var class="var">int</var></samp></dt>
  8483. <dd><p>The VTS where the menu lives, or 0 if it is a VMG menu (root-level).
  8484. Default is 1, menu of the first VTS.
  8485. </p>
  8486. </dd>
  8487. <dt><samp class="option">pgc <var class="var">int</var></samp></dt>
  8488. <dd><p>The entry PGC to start playback, in conjunction with <samp class="option">pg</samp>.
  8489. Alternative to setting <samp class="option">title</samp>.
  8490. Chapter markers are not supported at this time.
  8491. Must be explicitly set for menus.
  8492. Default is 0, automatically resolve from value of <samp class="option">title</samp>.
  8493. </p>
  8494. </dd>
  8495. <dt><samp class="option">pg <var class="var">int</var></samp></dt>
  8496. <dd><p>The entry PG to start playback, in conjunction with <samp class="option">pgc</samp>.
  8497. Alternative to setting <samp class="option">title</samp>.
  8498. Chapter markers are not supported at this time.
  8499. Default is 1, the first PG of the PGC.
  8500. </p>
  8501. </dd>
  8502. <dt><samp class="option">preindex <var class="var">bool</var></samp></dt>
  8503. <dd><p>Enable this to have accurate chapter (PTT) markers and duration measurement,
  8504. which requires a slow second pass read in order to index the chapter marker
  8505. timestamps from NAV packets. This is non-ideal extra work for real optical drives.
  8506. It is recommended and faster to use this option with a backup of the DVD structure
  8507. stored on a hard drive. Not compatible with <samp class="option">pgc</samp> and <samp class="option">pg</samp>.
  8508. Default is 0, false.
  8509. </p>
  8510. </dd>
  8511. <dt><samp class="option">trim <var class="var">bool</var></samp></dt>
  8512. <dd><p>Skip padding cells (i.e. cells shorter than 1 second) from the beginning.
  8513. There exist many discs with filler segments at the beginning of the PGC,
  8514. often with junk data intended for controlling a real DVD player&rsquo;s
  8515. buffering speed and with no other material data value.
  8516. Not applicable to menus.
  8517. Default is 1, true.
  8518. </p>
  8519. </dd>
  8520. </dl>
  8521. <a name="Examples-4"></a>
  8522. <h4 class="subsection">15.7.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-4" aria-hidden="true">TOC</a></span></h4>
  8523. <ul class="itemize mark-bullet">
  8524. <li>Open title 3 from a given DVD structure:
  8525. <div class="example">
  8526. <pre class="example-preformatted">ffmpeg -f dvdvideo -title 3 -i &lt;path to DVD&gt; ...
  8527. </pre></div>
  8528. </li><li>Open chapters 3-6 from title 1 from a given DVD structure:
  8529. <div class="example">
  8530. <pre class="example-preformatted">ffmpeg -f dvdvideo -chapter_start 3 -chapter_end 6 -title 1 -i &lt;path to DVD&gt; ...
  8531. </pre></div>
  8532. </li><li>Open only chapter 5 from title 1 from a given DVD structure:
  8533. <div class="example">
  8534. <pre class="example-preformatted">ffmpeg -f dvdvideo -chapter_start 5 -chapter_end 5 -title 1 -i &lt;path to DVD&gt; ...
  8535. </pre></div>
  8536. </li><li>Demux menu with language 1 from VTS 1, PGC 1, starting at PG 1:
  8537. <div class="example">
  8538. <pre class="example-preformatted">ffmpeg -f dvdvideo -menu 1 -menu_lu 1 -menu_vts 1 -pgc 1 -pg 1 -i &lt;path to DVD&gt; ...
  8539. </pre></div>
  8540. </li></ul>
  8541. <a name="ea"></a>
  8542. <h3 class="section">15.8 ea<span class="pull-right"><a class="anchor hidden-xs" href="#ea" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ea" aria-hidden="true">TOC</a></span></h3>
  8543. <p>Electronic Arts Multimedia format demuxer.
  8544. </p>
  8545. <p>This format is used by various Electronic Arts games.
  8546. </p>
  8547. <a name="Options-15"></a>
  8548. <h4 class="subsection">15.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-15" aria-hidden="true">TOC</a></span></h4>
  8549. <dl class="table">
  8550. <dt><samp class="option">merge_alpha <var class="var">bool</var></samp></dt>
  8551. <dd>
  8552. <p>Normally the VP6 alpha channel (if exists) is returned as a secondary video
  8553. stream, by setting this option you can make the demuxer return a single video
  8554. stream which contains the alpha channel in addition to the ordinary video.
  8555. </p>
  8556. </dd>
  8557. </dl>
  8558. <a name="imf"></a>
  8559. <h3 class="section">15.9 imf<span class="pull-right"><a class="anchor hidden-xs" href="#imf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-imf" aria-hidden="true">TOC</a></span></h3>
  8560. <p>Interoperable Master Format demuxer.
  8561. </p>
  8562. <p>This demuxer presents audio and video streams found in an IMF Composition, as
  8563. specified in <a class="url" href="https://doi.org/10.5594/SMPTE.ST2067-2.2020">SMPTE ST 2067-2</a>.
  8564. </p>
  8565. <div class="example">
  8566. <pre class="example-preformatted">ffmpeg [-assetmaps &lt;path of ASSETMAP1&gt;,&lt;path of ASSETMAP2&gt;,...] -i &lt;path of CPL&gt; ...
  8567. </pre></div>
  8568. <p>If <code class="code">-assetmaps</code> is not specified, the demuxer looks for a file called
  8569. <samp class="file">ASSETMAP.xml</samp> in the same directory as the CPL.
  8570. </p>
  8571. <a name="flv_002c-live_005fflv_002c-kux"></a>
  8572. <h3 class="section">15.10 flv, live_flv, kux<span class="pull-right"><a class="anchor hidden-xs" href="#flv_002c-live_005fflv_002c-kux" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flv_002c-live_005fflv_002c-kux" aria-hidden="true">TOC</a></span></h3>
  8573. <p>Adobe Flash Video Format demuxer.
  8574. </p>
  8575. <p>This demuxer is used to demux FLV files and RTMP network streams. In case of live network streams, if you force format, you may use live_flv option instead of flv to survive timestamp discontinuities.
  8576. KUX is a flv variant used on the Youku platform.
  8577. </p>
  8578. <div class="example">
  8579. <pre class="example-preformatted">ffmpeg -f flv -i myfile.flv ...
  8580. ffmpeg -f live_flv -i rtmp://&lt;any.server&gt;/anything/key ....
  8581. </pre></div>
  8582. <dl class="table">
  8583. <dt><samp class="option">-flv_metadata <var class="var">bool</var></samp></dt>
  8584. <dd><p>Allocate the streams according to the onMetaData array content.
  8585. </p>
  8586. </dd>
  8587. <dt><samp class="option">-flv_ignore_prevtag <var class="var">bool</var></samp></dt>
  8588. <dd><p>Ignore the size of previous tag value.
  8589. </p>
  8590. </dd>
  8591. <dt><samp class="option">-flv_full_metadata <var class="var">bool</var></samp></dt>
  8592. <dd><p>Output all context of the onMetadata.
  8593. </p></dd>
  8594. </dl>
  8595. <a name="gif"></a>
  8596. <h3 class="section">15.11 gif<span class="pull-right"><a class="anchor hidden-xs" href="#gif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gif" aria-hidden="true">TOC</a></span></h3>
  8597. <p>Animated GIF demuxer.
  8598. </p>
  8599. <p>It accepts the following options:
  8600. </p>
  8601. <dl class="table">
  8602. <dt><samp class="option">min_delay</samp></dt>
  8603. <dd><p>Set the minimum valid delay between frames in hundredths of seconds.
  8604. Range is 0 to 6000. Default value is 2.
  8605. </p>
  8606. </dd>
  8607. <dt><samp class="option">max_gif_delay</samp></dt>
  8608. <dd><p>Set the maximum valid delay between frames in hundredth of seconds.
  8609. Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
  8610. the maximum value allowed by the specification.
  8611. </p>
  8612. </dd>
  8613. <dt><samp class="option">default_delay</samp></dt>
  8614. <dd><p>Set the default delay between frames in hundredths of seconds.
  8615. Range is 0 to 6000. Default value is 10.
  8616. </p>
  8617. </dd>
  8618. <dt><samp class="option">ignore_loop</samp></dt>
  8619. <dd><p>GIF files can contain information to loop a certain number of times (or
  8620. infinitely). If <samp class="option">ignore_loop</samp> is set to 1, then the loop setting
  8621. from the input will be ignored and looping will not occur. If set to 0,
  8622. then looping will occur and will cycle the number of times according to
  8623. the GIF. Default value is 1.
  8624. </p></dd>
  8625. </dl>
  8626. <p>For example, with the overlay filter, place an infinitely looping GIF
  8627. over another video:
  8628. </p><div class="example">
  8629. <pre class="example-preformatted">ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
  8630. </pre></div>
  8631. <p>Note that in the above example the shortest option for overlay filter is
  8632. used to end the output video at the length of the shortest input file,
  8633. which in this case is <samp class="file">input.mp4</samp> as the GIF in this example loops
  8634. infinitely.
  8635. </p>
  8636. <a name="hls"></a>
  8637. <h3 class="section">15.12 hls<span class="pull-right"><a class="anchor hidden-xs" href="#hls" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hls" aria-hidden="true">TOC</a></span></h3>
  8638. <p>HLS demuxer
  8639. </p>
  8640. <p>Apple HTTP Live Streaming demuxer.
  8641. </p>
  8642. <p>This demuxer presents all AVStreams from all variant streams.
  8643. The id field is set to the bitrate variant index number. By setting
  8644. the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
  8645. the caller can decide which variant streams to actually receive.
  8646. The total bitrate of the variant that the stream belongs to is
  8647. available in a metadata key named &quot;variant_bitrate&quot;.
  8648. </p>
  8649. <p>It accepts the following options:
  8650. </p>
  8651. <dl class="table">
  8652. <dt><samp class="option">live_start_index</samp></dt>
  8653. <dd><p>segment index to start live streams at (negative values are from the end).
  8654. </p>
  8655. </dd>
  8656. <dt><samp class="option">prefer_x_start</samp></dt>
  8657. <dd><p>prefer to use #EXT-X-START if it&rsquo;s in playlist instead of live_start_index.
  8658. </p>
  8659. </dd>
  8660. <dt><samp class="option">allowed_extensions</samp></dt>
  8661. <dd><p>&rsquo;,&rsquo; separated list of file extensions that hls is allowed to access.
  8662. </p>
  8663. </dd>
  8664. <dt><samp class="option">extension_picky</samp></dt>
  8665. <dd><p>This blocks disallowed extensions from probing
  8666. It also requires all available segments to have matching extensions to the format
  8667. except mpegts, which is always allowed.
  8668. It is recommended to set the whitelists correctly instead of depending on extensions
  8669. Enabled by default.
  8670. </p>
  8671. </dd>
  8672. <dt><samp class="option">max_reload</samp></dt>
  8673. <dd><p>Maximum number of times a insufficient list is attempted to be reloaded.
  8674. Default value is 1000.
  8675. </p>
  8676. </dd>
  8677. <dt><samp class="option">m3u8_hold_counters</samp></dt>
  8678. <dd><p>The maximum number of times to load m3u8 when it refreshes without new segments.
  8679. Default value is 1000.
  8680. </p>
  8681. </dd>
  8682. <dt><samp class="option">http_persistent</samp></dt>
  8683. <dd><p>Use persistent HTTP connections. Applicable only for HTTP streams.
  8684. Enabled by default.
  8685. </p>
  8686. </dd>
  8687. <dt><samp class="option">http_multiple</samp></dt>
  8688. <dd><p>Use multiple HTTP connections for downloading HTTP segments.
  8689. Enabled by default for HTTP/1.1 servers.
  8690. </p>
  8691. </dd>
  8692. <dt><samp class="option">http_seekable</samp></dt>
  8693. <dd><p>Use HTTP partial requests for downloading HTTP segments.
  8694. 0 = disable, 1 = enable, -1 = auto, Default is auto.
  8695. </p>
  8696. </dd>
  8697. <dt><samp class="option">seg_format_options</samp></dt>
  8698. <dd><p>Set options for the demuxer of media segments using a list of key=value pairs separated by <code class="code">:</code>.
  8699. </p>
  8700. </dd>
  8701. <dt><samp class="option">seg_max_retry</samp></dt>
  8702. <dd><p>Maximum number of times to reload a segment on error, useful when segment skip on network error is not desired.
  8703. Default value is 0.
  8704. </p></dd>
  8705. </dl>
  8706. <a name="image2"></a>
  8707. <h3 class="section">15.13 image2<span class="pull-right"><a class="anchor hidden-xs" href="#image2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-image2" aria-hidden="true">TOC</a></span></h3>
  8708. <p>Image file demuxer.
  8709. </p>
  8710. <p>This demuxer reads from a list of image files specified by a pattern.
  8711. The syntax and meaning of the pattern is specified by the
  8712. option <var class="var">pattern_type</var>.
  8713. </p>
  8714. <p>The pattern may contain a suffix which is used to automatically
  8715. determine the format of the images contained in the files.
  8716. </p>
  8717. <p>The size, the pixel format, and the format of each image must be the
  8718. same for all the files in the sequence.
  8719. </p>
  8720. <p>This demuxer accepts the following options:
  8721. </p><dl class="table">
  8722. <dt><samp class="option">framerate</samp></dt>
  8723. <dd><p>Set the frame rate for the video stream. It defaults to 25.
  8724. </p></dd>
  8725. <dt><samp class="option">loop</samp></dt>
  8726. <dd><p>If set to 1, loop over the input. Default value is 0.
  8727. </p></dd>
  8728. <dt><samp class="option">pattern_type</samp></dt>
  8729. <dd><p>Select the pattern type used to interpret the provided filename.
  8730. </p>
  8731. <p><var class="var">pattern_type</var> accepts one of the following values.
  8732. </p><dl class="table">
  8733. <dt><samp class="option">none</samp></dt>
  8734. <dd><p>Disable pattern matching, therefore the video will only contain the specified
  8735. image. You should use this option if you do not want to create sequences from
  8736. multiple images and your filenames may contain special pattern characters.
  8737. </p></dd>
  8738. <dt><samp class="option">sequence</samp></dt>
  8739. <dd><p>Select a sequence pattern type, used to specify a sequence of files
  8740. indexed by sequential numbers.
  8741. </p>
  8742. <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, which
  8743. specifies the position of the characters representing a sequential
  8744. number in each filename matched by the pattern. If the form
  8745. &quot;%d0<var class="var">N</var>d&quot; is used, the string representing the number in each
  8746. filename is 0-padded and <var class="var">N</var> is the total number of 0-padded
  8747. digits representing the number. The literal character &rsquo;%&rsquo; can be
  8748. specified in the pattern with the string &quot;%%&quot;.
  8749. </p>
  8750. <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, the first filename of
  8751. the file list specified by the pattern must contain a number
  8752. inclusively contained between <var class="var">start_number</var> and
  8753. <var class="var">start_number</var>+<var class="var">start_number_range</var>-1, and all the following
  8754. numbers must be sequential.
  8755. </p>
  8756. <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
  8757. filenames of the form <samp class="file">img-001.bmp</samp>, <samp class="file">img-002.bmp</samp>, ...,
  8758. <samp class="file">img-010.bmp</samp>, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
  8759. sequence of filenames of the form <samp class="file">i%m%g-1.jpg</samp>,
  8760. <samp class="file">i%m%g-2.jpg</samp>, ..., <samp class="file">i%m%g-10.jpg</samp>, etc.
  8761. </p>
  8762. <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
  8763. &quot;%0<var class="var">N</var>d&quot;, for example to convert a single image file
  8764. <samp class="file">img.jpeg</samp> you can employ the command:
  8765. </p><div class="example">
  8766. <pre class="example-preformatted">ffmpeg -i img.jpeg img.png
  8767. </pre></div>
  8768. </dd>
  8769. <dt><samp class="option">glob</samp></dt>
  8770. <dd><p>Select a glob wildcard pattern type.
  8771. </p>
  8772. <p>The pattern is interpreted like a <code class="code">glob()</code> pattern. This is only
  8773. selectable if libavformat was compiled with globbing support.
  8774. </p></dd>
  8775. </dl>
  8776. <p>Default value is <var class="var">sequence</var>.
  8777. </p></dd>
  8778. <dt><samp class="option">pixel_format</samp></dt>
  8779. <dd><p>Set the pixel format of the images to read. If not specified the pixel
  8780. format is guessed from the first image file in the sequence.
  8781. </p></dd>
  8782. <dt><samp class="option">start_number</samp></dt>
  8783. <dd><p>Set the index of the file matched by the image file pattern to start
  8784. to read from. Default value is 0.
  8785. </p></dd>
  8786. <dt><samp class="option">start_number_range</samp></dt>
  8787. <dd><p>Set the index interval range to check when looking for the first image
  8788. file in the sequence, starting from <var class="var">start_number</var>. Default value
  8789. is 5.
  8790. </p></dd>
  8791. <dt><samp class="option">ts_from_file</samp></dt>
  8792. <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
  8793. that monotonity of timestamps is not provided: images go in the same order as
  8794. without this option. Default value is 0.
  8795. If set to 2, will set frame timestamp to the modification time of the image file in
  8796. nanosecond precision.
  8797. </p></dd>
  8798. <dt><samp class="option">video_size</samp></dt>
  8799. <dd><p>Set the video size of the images to read. If not specified the video
  8800. size is guessed from the first image file in the sequence.
  8801. </p></dd>
  8802. <dt><samp class="option">export_path_metadata</samp></dt>
  8803. <dd><p>If set to 1, will add two extra fields to the metadata found in input, making them
  8804. also available for other filters (see <var class="var">drawtext</var> filter for examples). Default
  8805. value is 0. The extra fields are described below:
  8806. </p><dl class="table">
  8807. <dt><samp class="option">lavf.image2dec.source_path</samp></dt>
  8808. <dd><p>Corresponds to the full path to the input file being read.
  8809. </p></dd>
  8810. <dt><samp class="option">lavf.image2dec.source_basename</samp></dt>
  8811. <dd><p>Corresponds to the name of the file being read.
  8812. </p></dd>
  8813. </dl>
  8814. </dd>
  8815. </dl>
  8816. <a name="Examples-5"></a>
  8817. <h4 class="subsection">15.13.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-5" aria-hidden="true">TOC</a></span></h4>
  8818. <ul class="itemize mark-bullet">
  8819. <li>Use <code class="command">ffmpeg</code> for creating a video from the images in the file
  8820. sequence <samp class="file">img-001.jpeg</samp>, <samp class="file">img-002.jpeg</samp>, ..., assuming an
  8821. input frame rate of 10 frames per second:
  8822. <div class="example">
  8823. <pre class="example-preformatted">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
  8824. </pre></div>
  8825. </li><li>As above, but start by reading from a file with index 100 in the sequence:
  8826. <div class="example">
  8827. <pre class="example-preformatted">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
  8828. </pre></div>
  8829. </li><li>Read images matching the &quot;*.png&quot; glob pattern , that is all the files
  8830. terminating with the &quot;.png&quot; suffix:
  8831. <div class="example">
  8832. <pre class="example-preformatted">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
  8833. </pre></div>
  8834. </li></ul>
  8835. <a name="libgme"></a>
  8836. <h3 class="section">15.14 libgme<span class="pull-right"><a class="anchor hidden-xs" href="#libgme" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libgme" aria-hidden="true">TOC</a></span></h3>
  8837. <p>The Game Music Emu library is a collection of video game music file emulators.
  8838. </p>
  8839. <p>See <a class="url" href="https://bitbucket.org/mpyne/game-music-emu/overview">https://bitbucket.org/mpyne/game-music-emu/overview</a> for more information.
  8840. </p>
  8841. <p>It accepts the following options:
  8842. </p>
  8843. <dl class="table">
  8844. <dt><samp class="option">track_index</samp></dt>
  8845. <dd><p>Set the index of which track to demux. The demuxer can only export one track.
  8846. Track indexes start at 0. Default is to pick the first track. Number of tracks
  8847. is exported as <var class="var">tracks</var> metadata entry.
  8848. </p>
  8849. </dd>
  8850. <dt><samp class="option">sample_rate</samp></dt>
  8851. <dd><p>Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100.
  8852. </p>
  8853. </dd>
  8854. <dt><samp class="option">max_size <em class="emph">(bytes)</em></samp></dt>
  8855. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  8856. which in turn, acts as a ceiling for the size of files that can be read.
  8857. Default is 50 MiB.
  8858. </p>
  8859. </dd>
  8860. </dl>
  8861. <a name="libmodplug"></a>
  8862. <h3 class="section">15.15 libmodplug<span class="pull-right"><a class="anchor hidden-xs" href="#libmodplug" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libmodplug" aria-hidden="true">TOC</a></span></h3>
  8863. <p>ModPlug based module demuxer
  8864. </p>
  8865. <p>See <a class="url" href="https://github.com/Konstanty/libmodplug">https://github.com/Konstanty/libmodplug</a>
  8866. </p>
  8867. <p>It will export one 2-channel 16-bit 44.1 kHz audio stream.
  8868. Optionally, a <code class="code">pal8</code> 16-color video stream can be exported with or without printed metadata.
  8869. </p>
  8870. <p>It accepts the following options:
  8871. </p>
  8872. <dl class="table">
  8873. <dt><samp class="option">noise_reduction</samp></dt>
  8874. <dd><p>Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0.
  8875. </p>
  8876. </dd>
  8877. <dt><samp class="option">reverb_depth</samp></dt>
  8878. <dd><p>Set amount of reverb. Range 0-100. Default is 0.
  8879. </p>
  8880. </dd>
  8881. <dt><samp class="option">reverb_delay</samp></dt>
  8882. <dd><p>Set delay in ms, clamped to 40-250 ms. Default is 0.
  8883. </p>
  8884. </dd>
  8885. <dt><samp class="option">bass_amount</samp></dt>
  8886. <dd><p>Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0.
  8887. </p>
  8888. </dd>
  8889. <dt><samp class="option">bass_range</samp></dt>
  8890. <dd><p>Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0.
  8891. </p>
  8892. </dd>
  8893. <dt><samp class="option">surround_depth</samp></dt>
  8894. <dd><p>Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0.
  8895. </p>
  8896. </dd>
  8897. <dt><samp class="option">surround_delay</samp></dt>
  8898. <dd><p>Set surround delay in ms, clamped to 5-40 ms. Default is 0.
  8899. </p>
  8900. </dd>
  8901. <dt><samp class="option">max_size</samp></dt>
  8902. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  8903. which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB.
  8904. 0 removes buffer size limit (not recommended). Default is 5 MiB.
  8905. </p>
  8906. </dd>
  8907. <dt><samp class="option">video_stream_expr</samp></dt>
  8908. <dd><p>String which is evaluated using the eval API to assign colors to the generated video stream.
  8909. Variables which can be used are <code class="code">x</code>, <code class="code">y</code>, <code class="code">w</code>, <code class="code">h</code>, <code class="code">t</code>, <code class="code">speed</code>,
  8910. <code class="code">tempo</code>, <code class="code">order</code>, <code class="code">pattern</code> and <code class="code">row</code>.
  8911. </p>
  8912. </dd>
  8913. <dt><samp class="option">video_stream</samp></dt>
  8914. <dd><p>Generate video stream. Can be 1 (on) or 0 (off). Default is 0.
  8915. </p>
  8916. </dd>
  8917. <dt><samp class="option">video_stream_w</samp></dt>
  8918. <dd><p>Set video frame width in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  8919. </p>
  8920. </dd>
  8921. <dt><samp class="option">video_stream_h</samp></dt>
  8922. <dd><p>Set video frame height in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  8923. </p>
  8924. </dd>
  8925. <dt><samp class="option">video_stream_ptxt</samp></dt>
  8926. <dd><p>Print metadata on video stream. Includes <code class="code">speed</code>, <code class="code">tempo</code>, <code class="code">order</code>, <code class="code">pattern</code>,
  8927. <code class="code">row</code> and <code class="code">ts</code> (time in ms). Can be 1 (on) or 0 (off). Default is 1.
  8928. </p>
  8929. </dd>
  8930. </dl>
  8931. <a name="libopenmpt"></a>
  8932. <h3 class="section">15.16 libopenmpt<span class="pull-right"><a class="anchor hidden-xs" href="#libopenmpt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopenmpt" aria-hidden="true">TOC</a></span></h3>
  8933. <p>libopenmpt based module demuxer
  8934. </p>
  8935. <p>See <a class="url" href="https://lib.openmpt.org/libopenmpt/">https://lib.openmpt.org/libopenmpt/</a> for more information.
  8936. </p>
  8937. <p>Some files have multiple subsongs (tracks) this can be set with the <samp class="option">subsong</samp>
  8938. option.
  8939. </p>
  8940. <p>It accepts the following options:
  8941. </p>
  8942. <dl class="table">
  8943. <dt><samp class="option">subsong</samp></dt>
  8944. <dd><p>Set the subsong index. This can be either &rsquo;all&rsquo;, &rsquo;auto&rsquo;, or the index of the
  8945. subsong. Subsong indexes start at 0. The default is &rsquo;auto&rsquo;.
  8946. </p>
  8947. <p>The default value is to let libopenmpt choose.
  8948. </p>
  8949. </dd>
  8950. <dt><samp class="option">layout</samp></dt>
  8951. <dd><p>Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
  8952. The default value is STEREO.
  8953. </p>
  8954. </dd>
  8955. <dt><samp class="option">sample_rate</samp></dt>
  8956. <dd><p>Set the sample rate for libopenmpt to output.
  8957. Range is from 1000 to INT_MAX. The value default is 48000.
  8958. </p></dd>
  8959. </dl>
  8960. <a class="anchor" id="mccdec"></a><a name="mcc"></a>
  8961. <h3 class="section">15.17 mcc<span class="pull-right"><a class="anchor hidden-xs" href="#mcc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mcc" aria-hidden="true">TOC</a></span></h3>
  8962. <p>Demuxer for MacCaption MCC files, it supports MCC versions 1.0 and 2.0.
  8963. MCC files store VANC data, which can include closed captions (EIA-608 and CEA-708), ancillary time code, pan-scan data, etc.
  8964. By default, for backward compatibility, the MCC demuxer extracts just the EIA-608 and CEA-708 closed captions and returns a <code class="code">EIA_608</code> stream, ignoring all other VANC data.
  8965. You can change it to return all VANC data in a <code class="code">SMPTE_436M_ANC</code> data stream by setting <samp class="option">-eia608_extract 0</samp>
  8966. </p>
  8967. <a name="Examples-6"></a>
  8968. <h4 class="subsection">15.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-6" aria-hidden="true">TOC</a></span></h4>
  8969. <ul class="itemize mark-bullet">
  8970. <li>Convert a MCC file to Scenarist (SCC) format:
  8971. <div class="example">
  8972. <pre class="example-preformatted">ffmpeg -i CC.mcc -c:s copy CC.scc
  8973. </pre></div>
  8974. <p>Note that the SCC format only supports EIA-608, so this will discard all other data such as CEA-708 extensions.
  8975. </p>
  8976. </li><li>Merge a MCC file into a MXF file:
  8977. <div class="example">
  8978. <pre class="example-preformatted">ffmpeg -i video_and_audio.mxf -eia608_extract 0 -i CC.mcc -c copy -map 0 -map 1 out.mxf
  8979. </pre></div>
  8980. <p>This retains all VANC data and inserts it into the output MXF file as a <code class="code">SMPTE_436M_ANC</code> data stream.
  8981. </p></li></ul>
  8982. <a name="mov_002fmp4_002f3gp"></a>
  8983. <h3 class="section">15.18 mov/mp4/3gp<span class="pull-right"><a class="anchor hidden-xs" href="#mov_002fmp4_002f3gp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mov_002fmp4_002f3gp" aria-hidden="true">TOC</a></span></h3>
  8984. <p>Demuxer for Quicktime File Format &amp; ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12).
  8985. </p>
  8986. <p>Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v
  8987. </p>
  8988. <a name="Options-16"></a>
  8989. <h4 class="subsection">15.18.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-16" aria-hidden="true">TOC</a></span></h4>
  8990. <p>This demuxer accepts the following options:
  8991. </p><dl class="table">
  8992. <dt><samp class="option">enable_drefs</samp></dt>
  8993. <dd><p>Enable loading of external tracks, disabled by default.
  8994. Enabling this can theoretically leak information in some use cases.
  8995. </p>
  8996. </dd>
  8997. <dt><samp class="option">use_absolute_path</samp></dt>
  8998. <dd><p>Allows loading of external tracks via absolute paths, disabled by default.
  8999. Enabling this poses a security risk. It should only be enabled if the source
  9000. is known to be non-malicious.
  9001. </p>
  9002. </dd>
  9003. <dt><samp class="option">seek_streams_individually</samp></dt>
  9004. <dd><p>When seeking, identify the closest point in each stream individually and demux packets in
  9005. that stream from identified point. This can lead to a different sequence of packets compared
  9006. to demuxing linearly from the beginning. Default is true.
  9007. </p>
  9008. </dd>
  9009. <dt><samp class="option">ignore_editlist</samp></dt>
  9010. <dd><p>Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the
  9011. timeline described by the edit list. Default is false.
  9012. </p>
  9013. </dd>
  9014. <dt><samp class="option">advanced_editlist</samp></dt>
  9015. <dd><p>Modify the stream index to reflect the timeline described by the edit list. <code class="code">ignore_editlist</code>
  9016. must be set to false for this option to be effective.
  9017. If both <code class="code">ignore_editlist</code> and this option are set to false, then only the
  9018. start of the stream index is modified to reflect initial dwell time or starting timestamp
  9019. described by the edit list. Default is true.
  9020. </p>
  9021. </dd>
  9022. <dt><samp class="option">ignore_chapters</samp></dt>
  9023. <dd><p>Don&rsquo;t parse chapters. This includes GoPro &rsquo;HiLight&rsquo; tags/moments. Note that chapters are
  9024. only parsed when input is seekable. Default is false.
  9025. </p>
  9026. </dd>
  9027. <dt><samp class="option">use_mfra_for</samp></dt>
  9028. <dd><p>For seekable fragmented input, set fragment&rsquo;s starting timestamp from media fragment random access box, if present.
  9029. </p>
  9030. <p>Following options are available:
  9031. </p><dl class="table">
  9032. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  9033. <dd><p>Auto-detect whether to set mfra timestamps as PTS or DTS <em class="emph">(default)</em>
  9034. </p>
  9035. </dd>
  9036. <dt>&lsquo;<samp class="samp">dts</samp>&rsquo;</dt>
  9037. <dd><p>Set mfra timestamps as DTS
  9038. </p>
  9039. </dd>
  9040. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  9041. <dd><p>Set mfra timestamps as PTS
  9042. </p>
  9043. </dd>
  9044. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  9045. <dd><p>Don&rsquo;t use mfra box to set timestamps
  9046. </p></dd>
  9047. </dl>
  9048. </dd>
  9049. <dt><samp class="option">use_tfdt</samp></dt>
  9050. <dd><p>For fragmented input, set fragment&rsquo;s starting timestamp to <code class="code">baseMediaDecodeTime</code> from the <code class="code">tfdt</code> box.
  9051. Default is enabled, which will prefer to use the <code class="code">tfdt</code> box to set DTS. Disable to use the <code class="code">earliest_presentation_time</code> from the <code class="code">sidx</code> box.
  9052. In either case, the timestamp from the <code class="code">mfra</code> box will be used if it&rsquo;s available and <code class="code">use_mfra_for</code> is
  9053. set to pts or dts.
  9054. </p>
  9055. </dd>
  9056. <dt><samp class="option">export_all</samp></dt>
  9057. <dd><p>Export unrecognized boxes within the <var class="var">udta</var> box as metadata entries. The first four
  9058. characters of the box type are set as the key. Default is false.
  9059. </p>
  9060. </dd>
  9061. <dt><samp class="option">export_xmp</samp></dt>
  9062. <dd><p>Export entire contents of <var class="var">XMP_</var> box and <var class="var">uuid</var> box as a string with key <code class="code">xmp</code>. Note that
  9063. if <code class="code">export_all</code> is set and this option isn&rsquo;t, the contents of <var class="var">XMP_</var> box are still exported
  9064. but with key <code class="code">XMP_</code>. Default is false.
  9065. </p>
  9066. </dd>
  9067. <dt><samp class="option">activation_bytes</samp></dt>
  9068. <dd><p>4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below.
  9069. </p>
  9070. </dd>
  9071. <dt><samp class="option">audible_fixed_key</samp></dt>
  9072. <dd><p>Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to
  9073. specify.
  9074. </p>
  9075. </dd>
  9076. <dt><samp class="option">decryption_key</samp></dt>
  9077. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  9078. </p>
  9079. </dd>
  9080. <dt><samp class="option">max_stts_delta</samp></dt>
  9081. <dd><p>Very high sample deltas written in a trak&rsquo;s stts box may occasionally be intended but usually they are written in
  9082. error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets
  9083. the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when
  9084. cast to int32 are used to adjust onward dts.
  9085. </p>
  9086. <p>Unit is the track time scale. Range is 0 to UINT_MAX. Default is <code class="code">UINT_MAX - 48000*10</code> which allows up to
  9087. a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of <code class="code">uint32</code> range.
  9088. </p>
  9089. </dd>
  9090. <dt><samp class="option">interleaved_read</samp></dt>
  9091. <dd><p>Interleave packets from multiple tracks at demuxer level. For badly interleaved files, this prevents playback issues
  9092. caused by large gaps between packets in different tracks, as MOV/MP4 do not have packet placement requirements.
  9093. However, this can cause excessive seeking on very badly interleaved files, due to seeking between tracks, so disabling
  9094. it may prevent I/O issues, at the expense of playback.
  9095. </p>
  9096. </dd>
  9097. </dl>
  9098. <a name="Audible-AAX"></a>
  9099. <h4 class="subsection">15.18.2 Audible AAX<span class="pull-right"><a class="anchor hidden-xs" href="#Audible-AAX" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audible-AAX" aria-hidden="true">TOC</a></span></h4>
  9100. <p>Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
  9101. </p><div class="example">
  9102. <pre class="example-preformatted">ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
  9103. </pre></div>
  9104. <a name="mpegts"></a>
  9105. <h3 class="section">15.19 mpegts<span class="pull-right"><a class="anchor hidden-xs" href="#mpegts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpegts" aria-hidden="true">TOC</a></span></h3>
  9106. <p>MPEG-2 transport stream demuxer.
  9107. </p>
  9108. <p>This demuxer accepts the following options:
  9109. </p><dl class="table">
  9110. <dt><samp class="option">resync_size</samp></dt>
  9111. <dd><p>Set size limit for looking up a new synchronization. Default value is
  9112. 65536.
  9113. </p>
  9114. </dd>
  9115. <dt><samp class="option">skip_unknown_pmt</samp></dt>
  9116. <dd><p>Skip PMTs for programs not defined in the PAT. Default value is 0.
  9117. </p>
  9118. </dd>
  9119. <dt><samp class="option">fix_teletext_pts</samp></dt>
  9120. <dd><p>Override teletext packet PTS and DTS values with the timestamps calculated
  9121. from the PCR of the first program which the teletext stream is part of and is
  9122. not discarded. Default value is 1, set this option to 0 if you want your
  9123. teletext packet PTS and DTS values untouched.
  9124. </p>
  9125. </dd>
  9126. <dt><samp class="option">ts_packetsize</samp></dt>
  9127. <dd><p>Output option carrying the raw packet size in bytes.
  9128. Show the detected raw packet size, cannot be set by the user.
  9129. </p>
  9130. </dd>
  9131. <dt><samp class="option">scan_all_pmts</samp></dt>
  9132. <dd><p>Scan and combine all PMTs. The value is an integer with value from -1
  9133. to 1 (-1 means automatic setting, 1 means enabled, 0 means
  9134. disabled). Default value is -1.
  9135. </p>
  9136. </dd>
  9137. <dt><samp class="option">merge_pmt_versions</samp></dt>
  9138. <dd><p>Reuse existing streams when a PMT&rsquo;s version is updated and elementary
  9139. streams move to different PIDs. Default value is 0.
  9140. </p>
  9141. </dd>
  9142. <dt><samp class="option">max_packet_size</samp></dt>
  9143. <dd><p>Set maximum size, in bytes, of packet emitted by the demuxer. Payloads above this size
  9144. are split across multiple packets. Range is 1 to INT_MAX/2. Default is 204800 bytes.
  9145. </p></dd>
  9146. </dl>
  9147. <a name="mpjpeg"></a>
  9148. <h3 class="section">15.20 mpjpeg<span class="pull-right"><a class="anchor hidden-xs" href="#mpjpeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpjpeg" aria-hidden="true">TOC</a></span></h3>
  9149. <p>MJPEG encapsulated in multi-part MIME demuxer.
  9150. </p>
  9151. <p>This demuxer allows reading of MJPEG, where each frame is represented as a part of
  9152. multipart/x-mixed-replace stream.
  9153. </p><dl class="table">
  9154. <dt><samp class="option">strict_mime_boundary</samp></dt>
  9155. <dd><p>Default implementation applies a relaxed standard to multi-part MIME boundary detection,
  9156. to prevent regression with numerous existing endpoints not generating a proper MIME
  9157. MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check
  9158. of the boundary value.
  9159. </p></dd>
  9160. </dl>
  9161. <a name="rawvideo-1"></a>
  9162. <h3 class="section">15.21 rawvideo<span class="pull-right"><a class="anchor hidden-xs" href="#rawvideo-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rawvideo-1" aria-hidden="true">TOC</a></span></h3>
  9163. <p>Raw video demuxer.
  9164. </p>
  9165. <p>This demuxer allows one to read raw video data. Since there is no header
  9166. specifying the assumed video parameters, the user must specify them
  9167. in order to be able to decode the data correctly.
  9168. </p>
  9169. <p>This demuxer accepts the following options:
  9170. </p><dl class="table">
  9171. <dt><samp class="option">framerate</samp></dt>
  9172. <dd><p>Set input video frame rate. Default value is 25.
  9173. </p>
  9174. </dd>
  9175. <dt><samp class="option">pixel_format</samp></dt>
  9176. <dd><p>Set the input video pixel format. Default value is <code class="code">yuv420p</code>.
  9177. </p>
  9178. </dd>
  9179. <dt><samp class="option">stride</samp></dt>
  9180. <dd><p>Set frame line size in bytes, only required if there are extra padding.
  9181. For multiplane formats, <samp class="option">stride</samp> is a list of line size for each
  9182. plane.
  9183. </p>
  9184. </dd>
  9185. <dt><samp class="option">video_size</samp></dt>
  9186. <dd><p>Set the input video size. This value must be specified explicitly.
  9187. </p></dd>
  9188. </dl>
  9189. <p>For example to read a rawvideo file <samp class="file">input.raw</samp> with
  9190. <code class="command">ffplay</code>, assuming a pixel format of <code class="code">rgb24</code>, a video
  9191. size of <code class="code">320x240</code>, and a frame rate of 10 images per second, use
  9192. the command:
  9193. </p><div class="example">
  9194. <pre class="example-preformatted">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
  9195. </pre></div>
  9196. <p>Read a rawvideo with <code class="command">ffplay</code>, assuming a pixel format of <code class="code">yuv420p</code>,
  9197. a video size of <code class="code">1080x1920</code>, has 8 bytes of padding in each line of Y plane,
  9198. and 4 bytes of padding with UV plane,
  9199. </p><div class="example">
  9200. <pre class="example-preformatted">ffplay -f rawvideo -pixel_format yuv420p -video_size 1080x1920 -stride 1088,544,544 input.raw
  9201. </pre></div>
  9202. <a class="anchor" id="rcwtdec"></a><a name="rcwt"></a>
  9203. <h3 class="section">15.22 rcwt<span class="pull-right"><a class="anchor hidden-xs" href="#rcwt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rcwt" aria-hidden="true">TOC</a></span></h3>
  9204. <p>RCWT (Raw Captions With Time) is a format native to ccextractor, a commonly
  9205. used open source tool for processing 608/708 Closed Captions (CC) sources.
  9206. For more information on the format, see <a data-manual="ffmpeg-formats" href="ffmpeg-formats.html#rcwtenc">(ffmpeg-formats)rcwtenc</a>.
  9207. </p>
  9208. <p>This demuxer implements the specification as of March 2024, which has
  9209. been stable and unchanged since April 2014.
  9210. </p>
  9211. <a name="Examples-7"></a>
  9212. <h4 class="subsection">15.22.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-7" aria-hidden="true">TOC</a></span></h4>
  9213. <ul class="itemize mark-bullet">
  9214. <li>Render CC to ASS using the built-in decoder:
  9215. <div class="example">
  9216. <pre class="example-preformatted">ffmpeg -i CC.rcwt.bin CC.ass
  9217. </pre></div>
  9218. <p>Note that if your output appears to be empty, you may have to manually
  9219. set the decoder&rsquo;s <samp class="option">data_field</samp> option to pick the desired CC substream.
  9220. </p>
  9221. </li><li>Convert an RCWT backup to Scenarist (SCC) format:
  9222. <div class="example">
  9223. <pre class="example-preformatted">ffmpeg -i CC.rcwt.bin -c:s copy CC.scc
  9224. </pre></div>
  9225. <p>Note that the SCC format does not support all of the possible CC extensions
  9226. that can be stored in RCWT (such as EIA-708).
  9227. </p></li></ul>
  9228. <a name="sbg"></a>
  9229. <h3 class="section">15.23 sbg<span class="pull-right"><a class="anchor hidden-xs" href="#sbg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sbg" aria-hidden="true">TOC</a></span></h3>
  9230. <p>SBaGen script demuxer.
  9231. </p>
  9232. <p>This demuxer reads the script language used by SBaGen
  9233. <a class="url" href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
  9234. script looks like that:
  9235. </p><div class="example">
  9236. <pre class="example-preformatted">-SE
  9237. a: 300-2.5/3 440+4.5/0
  9238. b: 300-2.5/0 440+4.5/3
  9239. off: -
  9240. NOW == a
  9241. +0:07:00 == b
  9242. +0:14:00 == a
  9243. +0:21:00 == b
  9244. +0:30:00 off
  9245. </pre></div>
  9246. <p>A SBG script can mix absolute and relative timestamps. If the script uses
  9247. either only absolute timestamps (including the script start time) or only
  9248. relative ones, then its layout is fixed, and the conversion is
  9249. straightforward. On the other hand, if the script mixes both kind of
  9250. timestamps, then the <var class="var">NOW</var> reference for relative timestamps will be
  9251. taken from the current time of day at the time the script is read, and the
  9252. script layout will be frozen according to that reference. That means that if
  9253. the script is directly played, the actual times will match the absolute
  9254. timestamps up to the sound controller&rsquo;s clock accuracy, but if the user
  9255. somehow pauses the playback or seeks, all times will be shifted accordingly.
  9256. </p>
  9257. <a name="tedcaptions"></a>
  9258. <h3 class="section">15.24 tedcaptions<span class="pull-right"><a class="anchor hidden-xs" href="#tedcaptions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tedcaptions" aria-hidden="true">TOC</a></span></h3>
  9259. <p>JSON captions used for <a class="url" href="http://www.ted.com/">TED Talks</a>.
  9260. </p>
  9261. <p>TED does not provide links to the captions, but they can be guessed from the
  9262. page. The file <samp class="file">tools/bookmarklets.html</samp> from the FFmpeg source tree
  9263. contains a bookmarklet to expose them.
  9264. </p>
  9265. <p>This demuxer accepts the following option:
  9266. </p><dl class="table">
  9267. <dt><samp class="option">start_time</samp></dt>
  9268. <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
  9269. (15s). It is used to sync the captions with the downloadable videos, because
  9270. they include a 15s intro.
  9271. </p></dd>
  9272. </dl>
  9273. <p>Example: convert the captions to a format most players understand:
  9274. </p><div class="example">
  9275. <pre class="example-preformatted">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
  9276. </pre></div>
  9277. <a name="vapoursynth"></a>
  9278. <h3 class="section">15.25 vapoursynth<span class="pull-right"><a class="anchor hidden-xs" href="#vapoursynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vapoursynth" aria-hidden="true">TOC</a></span></h3>
  9279. <p>Vapoursynth wrapper.
  9280. </p>
  9281. <p>Due to security concerns, Vapoursynth scripts will not
  9282. be autodetected so the input format has to be forced. For ff* CLI tools,
  9283. add <code class="code">-f vapoursynth</code> before the input <code class="code">-i yourscript.vpy</code>.
  9284. </p>
  9285. <p>This demuxer accepts the following option:
  9286. </p><dl class="table">
  9287. <dt><samp class="option">max_script_size</samp></dt>
  9288. <dd><p>The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size,
  9289. which in turn, acts as a ceiling for the size of scripts that can be read.
  9290. Default is 1 MiB.
  9291. </p></dd>
  9292. </dl>
  9293. <a name="w64"></a>
  9294. <h3 class="section">15.26 w64<span class="pull-right"><a class="anchor hidden-xs" href="#w64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-w64" aria-hidden="true">TOC</a></span></h3>
  9295. <p>Sony Wave64 Audio demuxer.
  9296. </p>
  9297. <p>This demuxer accepts the following options:
  9298. </p><dl class="table">
  9299. <dt><samp class="option">max_size</samp></dt>
  9300. <dd><p>See the same option for the <a class="ref" href="#wav">wav</a> demuxer.
  9301. </p></dd>
  9302. </dl>
  9303. <a class="anchor" id="wav"></a><a name="wav-1"></a>
  9304. <h3 class="section">15.27 wav<span class="pull-right"><a class="anchor hidden-xs" href="#wav-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-wav-1" aria-hidden="true">TOC</a></span></h3>
  9305. <p>RIFF Wave Audio demuxer.
  9306. </p>
  9307. <p>This demuxer accepts the following options:
  9308. </p><dl class="table">
  9309. <dt><samp class="option">max_size</samp></dt>
  9310. <dd><p>Specify the maximum packet size in bytes for the demuxed packets. By default
  9311. this is set to 0, which means that a sensible value is chosen based on the
  9312. input format.
  9313. </p></dd>
  9314. </dl>
  9315. <a class="anchor" id="metadata"></a><a name="Metadata"></a>
  9316. <h2 class="chapter">16 Metadata<span class="pull-right"><a class="anchor hidden-xs" href="#Metadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Metadata" aria-hidden="true">TOC</a></span></h2>
  9317. <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
  9318. INI-like text file and then load it back using the metadata muxer/demuxer.
  9319. </p>
  9320. <p>The file format is as follows:
  9321. </p><ol class="enumerate">
  9322. <li> A file consists of a header and a number of metadata tags divided into sections,
  9323. each on its own line.
  9324. </li><li> The header is a &lsquo;<samp class="samp">;FFMETADATA</samp>&rsquo; string, followed by a version number (now 1).
  9325. </li><li> Metadata tags are of the form &lsquo;<samp class="samp">key=value</samp>&rsquo;
  9326. </li><li> Immediately after header follows global metadata
  9327. </li><li> After global metadata there may be sections with per-stream/per-chapter
  9328. metadata.
  9329. </li><li> A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
  9330. brackets (&lsquo;<samp class="samp">[</samp>&rsquo;, &lsquo;<samp class="samp">]</samp>&rsquo;) and ends with next section or end of file.
  9331. </li><li> At the beginning of a chapter section there may be an optional timebase to be
  9332. used for start/end values. It must be in form
  9333. &lsquo;<samp class="samp">TIMEBASE=<var class="var">num</var>/<var class="var">den</var></samp>&rsquo;, where <var class="var">num</var> and <var class="var">den</var> are
  9334. integers. If the timebase is missing then start/end times are assumed to
  9335. be in nanoseconds.
  9336. <p>Next a chapter section must contain chapter start and end times in form
  9337. &lsquo;<samp class="samp">START=<var class="var">num</var></samp>&rsquo;, &lsquo;<samp class="samp">END=<var class="var">num</var></samp>&rsquo;, where <var class="var">num</var> is a positive
  9338. integer.
  9339. </p>
  9340. </li><li> Empty lines and lines starting with &lsquo;<samp class="samp">;</samp>&rsquo; or &lsquo;<samp class="samp">#</samp>&rsquo; are ignored.
  9341. </li><li> Metadata keys or values containing special characters (&lsquo;<samp class="samp">=</samp>&rsquo;, &lsquo;<samp class="samp">;</samp>&rsquo;,
  9342. &lsquo;<samp class="samp">#</samp>&rsquo;, &lsquo;<samp class="samp">\</samp>&rsquo; and a newline) must be escaped with a backslash &lsquo;<samp class="samp">\</samp>&rsquo;.
  9343. </li><li> Note that whitespace in metadata (e.g. &lsquo;<samp class="samp">foo = bar</samp>&rsquo;) is considered to be
  9344. a part of the tag (in the example above key is &lsquo;<samp class="samp">foo </samp>&rsquo;, value is
  9345. &lsquo;<samp class="samp"> bar</samp>&rsquo;).
  9346. </li></ol>
  9347. <p>A ffmetadata file might look like this:
  9348. </p><div class="example">
  9349. <pre class="example-preformatted">;FFMETADATA1
  9350. title=bike\\shed
  9351. ;this is a comment
  9352. artist=FFmpeg troll team
  9353. [CHAPTER]
  9354. TIMEBASE=1/1000
  9355. START=0
  9356. #chapter ends at 0:01:00
  9357. END=60000
  9358. title=chapter \#1
  9359. [STREAM]
  9360. title=multi\
  9361. line
  9362. </pre></div>
  9363. <p>By using the ffmetadata muxer and demuxer it is possible to extract
  9364. metadata from an input file to an ffmetadata file, and then transcode
  9365. the file into an output file with the edited ffmetadata file.
  9366. </p>
  9367. <p>Extracting an ffmetadata file with <samp class="file">ffmpeg</samp> goes as follows:
  9368. </p><div class="example">
  9369. <pre class="example-preformatted">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
  9370. </pre></div>
  9371. <p>Reinserting edited metadata information from the FFMETADATAFILE file can
  9372. be done as:
  9373. </p><div class="example">
  9374. <pre class="example-preformatted">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
  9375. </pre></div>
  9376. <a name="Protocol-Options"></a>
  9377. <h2 class="chapter">17 Protocol Options<span class="pull-right"><a class="anchor hidden-xs" href="#Protocol-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Protocol-Options" aria-hidden="true">TOC</a></span></h2>
  9378. <p>The libavformat library provides some generic global options, which
  9379. can be set on all the protocols. In addition each protocol may support
  9380. so-called private options, which are specific for that component.
  9381. </p>
  9382. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  9383. FFmpeg tools, or by setting the value explicitly in the
  9384. <code class="code">AVFormatContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  9385. for programmatic use.
  9386. </p>
  9387. <p>The list of supported options follows:
  9388. </p>
  9389. <dl class="table">
  9390. <dt><samp class="option">protocol_whitelist <var class="var">list</var> (<em class="emph">input</em>)</samp></dt>
  9391. <dd><p>Set a &quot;,&quot;-separated list of allowed protocols. &quot;ALL&quot; matches all protocols. Protocols
  9392. prefixed by &quot;-&quot; are disabled.
  9393. All protocols are allowed by default but protocols used by an another
  9394. protocol (nested protocols) are restricted to a per protocol subset.
  9395. </p></dd>
  9396. </dl>
  9397. <a name="Protocols"></a>
  9398. <h2 class="chapter">18 Protocols<span class="pull-right"><a class="anchor hidden-xs" href="#Protocols" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Protocols" aria-hidden="true">TOC</a></span></h2>
  9399. <p>Protocols are configured elements in FFmpeg that enable access to
  9400. resources that require specific protocols.
  9401. </p>
  9402. <p>When you configure your FFmpeg build, all the supported protocols are
  9403. enabled by default. You can list all available ones using the
  9404. configure option &quot;&ndash;list-protocols&quot;.
  9405. </p>
  9406. <p>You can disable all the protocols using the configure option
  9407. &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
  9408. option &quot;&ndash;enable-protocol=<var class="var">PROTOCOL</var>&quot;, or you can disable a
  9409. particular protocol using the option
  9410. &quot;&ndash;disable-protocol=<var class="var">PROTOCOL</var>&quot;.
  9411. </p>
  9412. <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
  9413. supported protocols.
  9414. </p>
  9415. <p>All protocols accept the following options:
  9416. </p>
  9417. <dl class="table">
  9418. <dt><samp class="option">rw_timeout</samp></dt>
  9419. <dd><p>Maximum time to wait for (network) read/write operations to complete,
  9420. in microseconds.
  9421. </p></dd>
  9422. </dl>
  9423. <p>A description of the currently available protocols follows.
  9424. </p>
  9425. <a name="amqp"></a>
  9426. <h3 class="section">18.1 amqp<span class="pull-right"><a class="anchor hidden-xs" href="#amqp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amqp" aria-hidden="true">TOC</a></span></h3>
  9427. <p>Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based
  9428. publish-subscribe communication protocol.
  9429. </p>
  9430. <p>FFmpeg must be compiled with &ndash;enable-librabbitmq to support AMQP. A separate
  9431. AMQP broker must also be run. An example open-source AMQP broker is RabbitMQ.
  9432. </p>
  9433. <p>After starting the broker, an FFmpeg client may stream data to the broker using
  9434. the command:
  9435. </p>
  9436. <div class="example">
  9437. <pre class="example-preformatted">ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@]hostname[:port][/vhost]
  9438. </pre></div>
  9439. <p>Where hostname and port (default is 5672) is the address of the broker. The
  9440. client may also set a user/password for authentication. The default for both
  9441. fields is &quot;guest&quot;. Name of virtual host on broker can be set with vhost. The
  9442. default value is &quot;/&quot;.
  9443. </p>
  9444. <p>Multiple subscribers may stream from the broker using the command:
  9445. </p><div class="example">
  9446. <pre class="example-preformatted">ffplay amqp://[[user]:[password]@]hostname[:port][/vhost]
  9447. </pre></div>
  9448. <p>In RabbitMQ all data published to the broker flows through a specific exchange,
  9449. and each subscribing client has an assigned queue/buffer. When a packet arrives
  9450. at an exchange, it may be copied to a client&rsquo;s queue depending on the exchange
  9451. and routing_key fields.
  9452. </p>
  9453. <p>The following options are supported:
  9454. </p>
  9455. <dl class="table">
  9456. <dt><samp class="option">exchange</samp></dt>
  9457. <dd><p>Sets the exchange to use on the broker. RabbitMQ has several predefined
  9458. exchanges: &quot;amq.direct&quot; is the default exchange, where the publisher and
  9459. subscriber must have a matching routing_key; &quot;amq.fanout&quot; is the same as a
  9460. broadcast operation (i.e. the data is forwarded to all queues on the fanout
  9461. exchange independent of the routing_key); and &quot;amq.topic&quot; is similar to
  9462. &quot;amq.direct&quot;, but allows for more complex pattern matching (refer to the RabbitMQ
  9463. documentation).
  9464. </p>
  9465. </dd>
  9466. <dt><samp class="option">routing_key</samp></dt>
  9467. <dd><p>Sets the routing key. The default value is &quot;amqp&quot;. The routing key is used on
  9468. the &quot;amq.direct&quot; and &quot;amq.topic&quot; exchanges to decide whether packets are written
  9469. to the queue of a subscriber.
  9470. </p>
  9471. </dd>
  9472. <dt><samp class="option">pkt_size</samp></dt>
  9473. <dd><p>Maximum size of each packet sent/received to the broker. Default is 131072.
  9474. Minimum is 4096 and max is any large value (representable by an int). When
  9475. receiving packets, this sets an internal buffer size in FFmpeg. It should be
  9476. equal to or greater than the size of the published packets to the broker. Otherwise
  9477. the received message may be truncated causing decoding errors.
  9478. </p>
  9479. </dd>
  9480. <dt><samp class="option">connection_timeout</samp></dt>
  9481. <dd><p>The timeout in seconds during the initial connection to the broker. The
  9482. default value is rw_timeout, or 5 seconds if rw_timeout is not set.
  9483. </p>
  9484. </dd>
  9485. <dt><samp class="option">delivery_mode <var class="var">mode</var></samp></dt>
  9486. <dd><p>Sets the delivery mode of each message sent to broker.
  9487. The following values are accepted:
  9488. </p><dl class="table">
  9489. <dt>&lsquo;<samp class="samp">persistent</samp>&rsquo;</dt>
  9490. <dd><p>Delivery mode set to &quot;persistent&quot; (2). This is the default value.
  9491. Messages may be written to the broker&rsquo;s disk depending on its setup.
  9492. </p>
  9493. </dd>
  9494. <dt>&lsquo;<samp class="samp">non-persistent</samp>&rsquo;</dt>
  9495. <dd><p>Delivery mode set to &quot;non-persistent&quot; (1).
  9496. Messages will stay in broker&rsquo;s memory unless the broker is under memory
  9497. pressure.
  9498. </p>
  9499. </dd>
  9500. </dl>
  9501. </dd>
  9502. </dl>
  9503. <a name="async"></a>
  9504. <h3 class="section">18.2 async<span class="pull-right"><a class="anchor hidden-xs" href="#async" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-async" aria-hidden="true">TOC</a></span></h3>
  9505. <p>Asynchronous data filling wrapper for input stream.
  9506. </p>
  9507. <p>Fill data in a background thread, to decouple I/O operation from demux thread.
  9508. </p>
  9509. <div class="example">
  9510. <pre class="example-preformatted">async:<var class="var">URL</var>
  9511. async:http://host/resource
  9512. async:cache:http://host/resource
  9513. </pre></div>
  9514. <a name="bluray"></a>
  9515. <h3 class="section">18.3 bluray<span class="pull-right"><a class="anchor hidden-xs" href="#bluray" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bluray" aria-hidden="true">TOC</a></span></h3>
  9516. <p>Read BluRay playlist.
  9517. </p>
  9518. <p>The accepted options are:
  9519. </p><dl class="table">
  9520. <dt><samp class="option">angle</samp></dt>
  9521. <dd><p>BluRay angle
  9522. </p>
  9523. </dd>
  9524. <dt><samp class="option">chapter</samp></dt>
  9525. <dd><p>Start chapter (1...N)
  9526. </p>
  9527. </dd>
  9528. <dt><samp class="option">playlist</samp></dt>
  9529. <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
  9530. </p>
  9531. </dd>
  9532. </dl>
  9533. <p>Examples:
  9534. </p>
  9535. <p>Read longest playlist from BluRay mounted to /mnt/bluray:
  9536. </p><div class="example">
  9537. <pre class="example-preformatted">bluray:/mnt/bluray
  9538. </pre></div>
  9539. <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
  9540. </p><div class="example">
  9541. <pre class="example-preformatted">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
  9542. </pre></div>
  9543. <a name="cache"></a>
  9544. <h3 class="section">18.4 cache<span class="pull-right"><a class="anchor hidden-xs" href="#cache" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cache" aria-hidden="true">TOC</a></span></h3>
  9545. <p>Caching wrapper for input stream.
  9546. </p>
  9547. <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
  9548. </p>
  9549. <p>The accepted options are:
  9550. </p><dl class="table">
  9551. <dt><samp class="option">read_ahead_limit</samp></dt>
  9552. <dd><p>Amount in bytes that may be read ahead when seeking isn&rsquo;t supported. Range is -1 to INT_MAX.
  9553. -1 for unlimited. Default is 65536.
  9554. </p>
  9555. </dd>
  9556. </dl>
  9557. <p>URL Syntax is
  9558. </p><div class="example">
  9559. <pre class="example-preformatted">cache:<var class="var">URL</var>
  9560. </pre></div>
  9561. <a name="concat-2"></a>
  9562. <h3 class="section">18.5 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat-2" aria-hidden="true">TOC</a></span></h3>
  9563. <p>Physical concatenation protocol.
  9564. </p>
  9565. <p>Read and seek from many resources in sequence as if they were
  9566. a unique resource.
  9567. </p>
  9568. <p>A URL accepted by this protocol has the syntax:
  9569. </p><div class="example">
  9570. <pre class="example-preformatted">concat:<var class="var">URL1</var>|<var class="var">URL2</var>|...|<var class="var">URLN</var>
  9571. </pre></div>
  9572. <p>where <var class="var">URL1</var>, <var class="var">URL2</var>, ..., <var class="var">URLN</var> are the urls of the
  9573. resource to be concatenated, each one possibly specifying a distinct
  9574. protocol.
  9575. </p>
  9576. <p>For example to read a sequence of files <samp class="file">split1.mpeg</samp>,
  9577. <samp class="file">split2.mpeg</samp>, <samp class="file">split3.mpeg</samp> with <code class="command">ffplay</code> use the
  9578. command:
  9579. </p><div class="example">
  9580. <pre class="example-preformatted">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
  9581. </pre></div>
  9582. <p>Note that you may need to escape the character &quot;|&quot; which is special for
  9583. many shells.
  9584. </p>
  9585. <a name="concatf"></a>
  9586. <h3 class="section">18.6 concatf<span class="pull-right"><a class="anchor hidden-xs" href="#concatf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concatf" aria-hidden="true">TOC</a></span></h3>
  9587. <p>Physical concatenation protocol using a line break delimited list of
  9588. resources.
  9589. </p>
  9590. <p>Read and seek from many resources in sequence as if they were
  9591. a unique resource.
  9592. </p>
  9593. <p>A URL accepted by this protocol has the syntax:
  9594. </p><div class="example">
  9595. <pre class="example-preformatted">concatf:<var class="var">URL</var>
  9596. </pre></div>
  9597. <p>where <var class="var">URL</var> is the url containing a line break delimited list of
  9598. resources to be concatenated, each one possibly specifying a distinct
  9599. protocol. Special characters must be escaped with backslash or single
  9600. quotes. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">the &quot;Quoting and escaping&quot;
  9601. section in the ffmpeg-utils(1) manual</a>.
  9602. </p>
  9603. <p>For example to read a sequence of files <samp class="file">split1.mpeg</samp>,
  9604. <samp class="file">split2.mpeg</samp>, <samp class="file">split3.mpeg</samp> listed in separate lines within
  9605. a file <samp class="file">split.txt</samp> with <code class="command">ffplay</code> use the command:
  9606. </p><div class="example">
  9607. <pre class="example-preformatted">ffplay concatf:split.txt
  9608. </pre></div>
  9609. <p>Where <samp class="file">split.txt</samp> contains the lines:
  9610. </p><div class="example">
  9611. <pre class="example-preformatted">split1.mpeg
  9612. split2.mpeg
  9613. split3.mpeg
  9614. </pre></div>
  9615. <a name="crypto"></a>
  9616. <h3 class="section">18.7 crypto<span class="pull-right"><a class="anchor hidden-xs" href="#crypto" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crypto" aria-hidden="true">TOC</a></span></h3>
  9617. <p>AES-encrypted stream reading protocol.
  9618. </p>
  9619. <p>The accepted options are:
  9620. </p><dl class="table">
  9621. <dt><samp class="option">key</samp></dt>
  9622. <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
  9623. </p>
  9624. </dd>
  9625. <dt><samp class="option">iv</samp></dt>
  9626. <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
  9627. </p></dd>
  9628. </dl>
  9629. <p>Accepted URL formats:
  9630. </p><div class="example">
  9631. <pre class="example-preformatted">crypto:<var class="var">URL</var>
  9632. crypto+<var class="var">URL</var>
  9633. </pre></div>
  9634. <a name="data"></a>
  9635. <h3 class="section">18.8 data<span class="pull-right"><a class="anchor hidden-xs" href="#data" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-data" aria-hidden="true">TOC</a></span></h3>
  9636. <p>Data in-line in the URI. See <a class="url" href="http://en.wikipedia.org/wiki/Data_URI_scheme">http://en.wikipedia.org/wiki/Data_URI_scheme</a>.
  9637. </p>
  9638. <p>For example, to convert a GIF file given inline with <code class="command">ffmpeg</code>:
  9639. </p><div class="example">
  9640. <pre class="example-preformatted">ffmpeg -i &quot;data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=&quot; smiley.png
  9641. </pre></div>
  9642. <a name="fd"></a>
  9643. <h3 class="section">18.9 fd<span class="pull-right"><a class="anchor hidden-xs" href="#fd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fd" aria-hidden="true">TOC</a></span></h3>
  9644. <p>File descriptor access protocol.
  9645. </p>
  9646. <p>The accepted syntax is:
  9647. </p><div class="example">
  9648. <pre class="example-preformatted">fd: -fd <var class="var">file_descriptor</var>
  9649. </pre></div>
  9650. <p>If <samp class="option">fd</samp> is not specified, by default the stdout file descriptor will be
  9651. used for writing, stdin for reading. Unlike the pipe protocol, fd protocol has
  9652. seek support if it corresponding to a regular file. fd protocol doesn&rsquo;t support
  9653. pass file descriptor via URL for security.
  9654. </p>
  9655. <p>This protocol accepts the following options:
  9656. </p>
  9657. <dl class="table">
  9658. <dt><samp class="option">blocksize</samp></dt>
  9659. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  9660. <code class="code">INT_MAX</code>, which results in not limiting the requested block size.
  9661. Setting this value reasonably low improves user termination request reaction
  9662. time, which is valuable if data transmission is slow.
  9663. </p>
  9664. </dd>
  9665. <dt><samp class="option">fd</samp></dt>
  9666. <dd><p>Set file descriptor.
  9667. </p></dd>
  9668. </dl>
  9669. <a name="file"></a>
  9670. <h3 class="section">18.10 file<span class="pull-right"><a class="anchor hidden-xs" href="#file" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-file" aria-hidden="true">TOC</a></span></h3>
  9671. <p>File access protocol.
  9672. </p>
  9673. <p>Read from or write to a file.
  9674. </p>
  9675. <p>A file URL can have the form:
  9676. </p><div class="example">
  9677. <pre class="example-preformatted">file:<var class="var">filename</var>
  9678. </pre></div>
  9679. <p>where <var class="var">filename</var> is the path of the file to read.
  9680. </p>
  9681. <p>An URL that does not have a protocol prefix will be assumed to be a
  9682. file URL. Depending on the build, an URL that looks like a Windows
  9683. path with the drive letter at the beginning will also be assumed to be
  9684. a file URL (usually not the case in builds for unix-like systems).
  9685. </p>
  9686. <p>For example to read from a file <samp class="file">input.mpeg</samp> with <code class="command">ffmpeg</code>
  9687. use the command:
  9688. </p><div class="example">
  9689. <pre class="example-preformatted">ffmpeg -i file:input.mpeg output.mpeg
  9690. </pre></div>
  9691. <p>This protocol accepts the following options:
  9692. </p>
  9693. <dl class="table">
  9694. <dt><samp class="option">truncate</samp></dt>
  9695. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  9696. truncating. Default value is 1.
  9697. </p>
  9698. </dd>
  9699. <dt><samp class="option">blocksize</samp></dt>
  9700. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  9701. <code class="code">INT_MAX</code>, which results in not limiting the requested block size.
  9702. Setting this value reasonably low improves user termination request reaction
  9703. time, which is valuable for files on slow medium.
  9704. </p>
  9705. </dd>
  9706. <dt><samp class="option">follow</samp></dt>
  9707. <dd><p>If set to 1, the protocol will retry reading at the end of the file, allowing
  9708. reading files that still are being written. In order for this to terminate,
  9709. you either need to use the rw_timeout option, or use the interrupt callback
  9710. (for API users).
  9711. </p>
  9712. </dd>
  9713. <dt><samp class="option">seekable</samp></dt>
  9714. <dd><p>Controls if seekability is advertised on the file. 0 means non-seekable, -1
  9715. means auto (seekable for normal files, non-seekable for named pipes).
  9716. </p>
  9717. <p>Many demuxers handle seekable and non-seekable resources differently,
  9718. overriding this might speed up opening certain files at the cost of losing some
  9719. features (e.g. accurate seeking).
  9720. </p>
  9721. </dd>
  9722. <dt><samp class="option">pkt_size</samp></dt>
  9723. <dd><p>Set the maximum packet size used for file I/O. A smaller value may reduce
  9724. memory usage. A higher value may increase throughput especially with networked
  9725. filesystems.
  9726. </p>
  9727. <p>For reading, if explicitly set, it overrides the default internal buffer size
  9728. (32 KB) and limits the maximum amount of data read per operation.
  9729. </p>
  9730. <p>For writing, this sets the size of each write operation. The default is 256 KB
  9731. for regular files, 32 KB otherwise.
  9732. </p></dd>
  9733. </dl>
  9734. <a name="ftp"></a>
  9735. <h3 class="section">18.11 ftp<span class="pull-right"><a class="anchor hidden-xs" href="#ftp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ftp" aria-hidden="true">TOC</a></span></h3>
  9736. <p>FTP (File Transfer Protocol).
  9737. </p>
  9738. <p>Read from or write to remote resources using FTP protocol.
  9739. </p>
  9740. <p>Following syntax is required.
  9741. </p><div class="example">
  9742. <pre class="example-preformatted">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  9743. </pre></div>
  9744. <p>This protocol accepts the following options.
  9745. </p>
  9746. <dl class="table">
  9747. <dt><samp class="option">timeout</samp></dt>
  9748. <dd><p>Set timeout in microseconds of socket I/O operations used by the underlying low level
  9749. operation. By default it is set to -1, which means that the timeout is
  9750. not specified.
  9751. </p>
  9752. </dd>
  9753. <dt><samp class="option">ftp-user</samp></dt>
  9754. <dd><p>Set a user to be used for authenticating to the FTP server. This is overridden by the
  9755. user in the FTP URL.
  9756. </p>
  9757. </dd>
  9758. <dt><samp class="option">ftp-password</samp></dt>
  9759. <dd><p>Set a password to be used for authenticating to the FTP server. This is overridden by
  9760. the password in the FTP URL, or by <samp class="option">ftp-anonymous-password</samp> if no user is set.
  9761. </p>
  9762. </dd>
  9763. <dt><samp class="option">ftp-anonymous-password</samp></dt>
  9764. <dd><p>Password used when login as anonymous user. Typically an e-mail address
  9765. should be used.
  9766. </p>
  9767. </dd>
  9768. <dt><samp class="option">ftp-write-seekable</samp></dt>
  9769. <dd><p>Control seekability of connection during encoding. If set to 1 the
  9770. resource is supposed to be seekable, if set to 0 it is assumed not
  9771. to be seekable. Default value is 0.
  9772. </p></dd>
  9773. </dl>
  9774. <p>NOTE: Protocol can be used as output, but it is recommended to not do
  9775. it, unless special care is taken (tests, customized server configuration
  9776. etc.). Different FTP servers behave in different way during seek
  9777. operation. ff* tools may produce incomplete content due to server limitations.
  9778. </p>
  9779. <a name="gopher"></a>
  9780. <h3 class="section">18.12 gopher<span class="pull-right"><a class="anchor hidden-xs" href="#gopher" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gopher" aria-hidden="true">TOC</a></span></h3>
  9781. <p>Gopher protocol.
  9782. </p>
  9783. <a name="gophers"></a>
  9784. <h3 class="section">18.13 gophers<span class="pull-right"><a class="anchor hidden-xs" href="#gophers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gophers" aria-hidden="true">TOC</a></span></h3>
  9785. <p>Gophers protocol.
  9786. </p>
  9787. <p>The Gopher protocol with TLS encapsulation.
  9788. </p>
  9789. <a name="hls-1"></a>
  9790. <h3 class="section">18.14 hls<span class="pull-right"><a class="anchor hidden-xs" href="#hls-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hls-1" aria-hidden="true">TOC</a></span></h3>
  9791. <p>Read Apple HTTP Live Streaming compliant segmented stream as
  9792. a uniform one. The M3U8 playlists describing the segments can be
  9793. remote HTTP resources or local files, accessed using the standard
  9794. file protocol.
  9795. The nested protocol is declared by specifying
  9796. &quot;+<var class="var">proto</var>&quot; after the hls URI scheme name, where <var class="var">proto</var>
  9797. is either &quot;file&quot; or &quot;http&quot;.
  9798. </p>
  9799. <div class="example">
  9800. <pre class="example-preformatted">hls+http://host/path/to/remote/resource.m3u8
  9801. hls+file://path/to/local/resource.m3u8
  9802. </pre></div>
  9803. <p>Using this protocol is discouraged - the hls demuxer should work
  9804. just as well (if not, please report the issues) and is more complete.
  9805. To use the hls demuxer instead, simply use the direct URLs to the
  9806. m3u8 files.
  9807. </p>
  9808. <a name="http"></a>
  9809. <h3 class="section">18.15 http<span class="pull-right"><a class="anchor hidden-xs" href="#http" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-http" aria-hidden="true">TOC</a></span></h3>
  9810. <p>HTTP (Hyper Text Transfer Protocol).
  9811. </p>
  9812. <p>This protocol accepts the following options:
  9813. </p>
  9814. <dl class="table">
  9815. <dt><samp class="option">seekable</samp></dt>
  9816. <dd><p>Control seekability of connection. If set to 1 the resource is
  9817. supposed to be seekable, if set to 0 it is assumed not to be seekable,
  9818. if set to -1 it will try to autodetect if it is seekable. Default
  9819. value is -1.
  9820. </p>
  9821. </dd>
  9822. <dt><samp class="option">chunked_post</samp></dt>
  9823. <dd><p>If set to 1 use chunked Transfer-Encoding for posts, default is 1.
  9824. </p>
  9825. </dd>
  9826. <dt><samp class="option">http_proxy</samp></dt>
  9827. <dd><p>set HTTP proxy to tunnel through e.g. http://example.com:1234
  9828. </p>
  9829. </dd>
  9830. <dt><samp class="option">headers</samp></dt>
  9831. <dd><p>Set custom HTTP headers, can override built in default headers. The
  9832. value must be a string encoding the headers.
  9833. </p>
  9834. </dd>
  9835. <dt><samp class="option">content_type</samp></dt>
  9836. <dd><p>Set a specific content type for the POST messages or for listen mode.
  9837. </p>
  9838. </dd>
  9839. <dt><samp class="option">user_agent</samp></dt>
  9840. <dd><p>Override the User-Agent header. If not specified the protocol will use a
  9841. string describing the libavformat build. (&quot;Lavf/&lt;version&gt;&quot;)
  9842. </p>
  9843. </dd>
  9844. <dt><samp class="option">referer</samp></dt>
  9845. <dd><p>Set the Referer header. Include &rsquo;Referer: URL&rsquo; header in HTTP request.
  9846. </p>
  9847. </dd>
  9848. <dt><samp class="option">multiple_requests</samp></dt>
  9849. <dd><p>Use persistent connections if set to 1, default is 0.
  9850. </p>
  9851. </dd>
  9852. <dt><samp class="option">post_data</samp></dt>
  9853. <dd><p>Set custom HTTP post data.
  9854. </p>
  9855. </dd>
  9856. <dt><samp class="option">mime_type</samp></dt>
  9857. <dd><p>Export the MIME type.
  9858. </p>
  9859. </dd>
  9860. <dt><samp class="option">http_version</samp></dt>
  9861. <dd><p>Exports the HTTP response version number. Usually &quot;1.0&quot; or &quot;1.1&quot;.
  9862. </p>
  9863. </dd>
  9864. <dt><samp class="option">cookies</samp></dt>
  9865. <dd><p>Set the cookies to be sent in future requests. The format of each cookie is the
  9866. same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
  9867. delimited by a newline character.
  9868. </p>
  9869. </dd>
  9870. <dt><samp class="option">icy</samp></dt>
  9871. <dd><p>If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
  9872. supports this, the metadata has to be retrieved by the application by reading
  9873. the <samp class="option">icy_metadata_headers</samp> and <samp class="option">icy_metadata_packet</samp> options.
  9874. The default is 1.
  9875. </p>
  9876. </dd>
  9877. <dt><samp class="option">icy_metadata_headers</samp></dt>
  9878. <dd><p>If the server supports ICY metadata, this contains the ICY-specific HTTP reply
  9879. headers, separated by newline characters.
  9880. </p>
  9881. </dd>
  9882. <dt><samp class="option">icy_metadata_packet</samp></dt>
  9883. <dd><p>If the server supports ICY metadata, and <samp class="option">icy</samp> was set to 1, this
  9884. contains the last non-empty metadata packet sent by the server. It should be
  9885. polled in regular intervals by applications interested in mid-stream metadata
  9886. updates.
  9887. </p>
  9888. </dd>
  9889. <dt><samp class="option">metadata</samp></dt>
  9890. <dd><p>Set an exported dictionary containing Icecast metadata from the bitstream, if present.
  9891. Only useful with the C API.
  9892. </p>
  9893. </dd>
  9894. <dt><samp class="option">auth_type</samp></dt>
  9895. <dd>
  9896. <p>Set HTTP authentication type. No option for Digest, since this method requires
  9897. getting nonce parameters from the server first and can&rsquo;t be used straight away like
  9898. Basic.
  9899. </p>
  9900. <dl class="table">
  9901. <dt><samp class="option">none</samp></dt>
  9902. <dd><p>Choose the HTTP authentication type automatically. This is the default.
  9903. </p></dd>
  9904. <dt><samp class="option">basic</samp></dt>
  9905. <dd>
  9906. <p>Choose the HTTP basic authentication.
  9907. </p>
  9908. <p>Basic authentication sends a Base64-encoded string that contains a user name and password
  9909. for the client. Base64 is not a form of encryption and should be considered the same as
  9910. sending the user name and password in clear text (Base64 is a reversible encoding).
  9911. If a resource needs to be protected, strongly consider using an authentication scheme
  9912. other than basic authentication. HTTPS/TLS should be used with basic authentication.
  9913. Without these additional security enhancements, basic authentication should not be used
  9914. to protect sensitive or valuable information.
  9915. </p></dd>
  9916. </dl>
  9917. </dd>
  9918. <dt><samp class="option">send_expect_100</samp></dt>
  9919. <dd><p>Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
  9920. to 0 it won&rsquo;t, if set to -1 it will try to send if it is applicable. Default
  9921. value is -1.
  9922. </p>
  9923. </dd>
  9924. <dt><samp class="option">location</samp></dt>
  9925. <dd><p>An exported dictionary containing the content location. Only useful with the C
  9926. API.
  9927. </p>
  9928. </dd>
  9929. <dt><samp class="option">offset</samp></dt>
  9930. <dd><p>Set initial byte offset.
  9931. </p>
  9932. </dd>
  9933. <dt><samp class="option">end_offset</samp></dt>
  9934. <dd><p>Try to limit the request to bytes preceding this offset.
  9935. </p>
  9936. </dd>
  9937. <dt><samp class="option">method</samp></dt>
  9938. <dd><p>When used as a client option it sets the HTTP method for the request.
  9939. </p>
  9940. <p>When used as a server option it sets the HTTP method that is going to be
  9941. expected from the client(s).
  9942. If the expected and the received HTTP method do not match the client will
  9943. be given a Bad Request response.
  9944. When unset the HTTP method is not checked for now. This will be replaced by
  9945. autodetection in the future.
  9946. </p>
  9947. </dd>
  9948. <dt><samp class="option">reconnect</samp></dt>
  9949. <dd><p>Reconnect automatically when disconnected before EOF is hit.
  9950. </p>
  9951. </dd>
  9952. <dt><samp class="option">reconnect_at_eof</samp></dt>
  9953. <dd><p>If set then eof is treated like an error and causes reconnection, this is useful
  9954. for live / endless streams.
  9955. </p>
  9956. </dd>
  9957. <dt><samp class="option">reconnect_on_network_error</samp></dt>
  9958. <dd><p>Reconnect automatically in case of TCP/TLS errors during connect.
  9959. </p>
  9960. </dd>
  9961. <dt><samp class="option">reconnect_on_http_error</samp></dt>
  9962. <dd><p>A comma separated list of HTTP status codes to reconnect on. The list can
  9963. include specific status codes (e.g. &rsquo;503&rsquo;) or the strings &rsquo;4xx&rsquo; / &rsquo;5xx&rsquo;.
  9964. </p>
  9965. </dd>
  9966. <dt><samp class="option">reconnect_streamed</samp></dt>
  9967. <dd><p>If set then even streamed/non seekable streams will be reconnected on errors.
  9968. </p>
  9969. </dd>
  9970. <dt><samp class="option">reconnect_delay_max</samp></dt>
  9971. <dd><p>Set the maximum delay in seconds after which to give up reconnecting.
  9972. </p>
  9973. </dd>
  9974. <dt><samp class="option">reconnect_max_retries</samp></dt>
  9975. <dd><p>Set the maximum number of times to retry a connection. Default unset.
  9976. </p>
  9977. </dd>
  9978. <dt><samp class="option">reconnect_delay_total_max</samp></dt>
  9979. <dd><p>Set the maximum total delay in seconds after which to give up reconnecting.
  9980. </p>
  9981. </dd>
  9982. <dt><samp class="option">respect_retry_after</samp></dt>
  9983. <dd><p>If enabled, and a Retry-After header is encountered, its requested reconnection
  9984. delay will be honored, rather than using exponential backoff. Useful for 429 and
  9985. 503 errors. Default enabled.
  9986. </p>
  9987. </dd>
  9988. <dt><samp class="option">listen</samp></dt>
  9989. <dd><p>If set to 1 enables experimental HTTP server. This can be used to send data when
  9990. used as an output option, or read data from a client with HTTP POST when used as
  9991. an input option.
  9992. If set to 2 enables experimental multi-client HTTP server. This is not yet implemented
  9993. in ffmpeg.c and thus must not be used as a command line option.
  9994. </p><div class="example">
  9995. <pre class="example-preformatted"># Server side (sending):
  9996. ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://<var class="var">server</var>:<var class="var">port</var>
  9997. # Client side (receiving):
  9998. ffmpeg -i http://<var class="var">server</var>:<var class="var">port</var> -c copy somefile.ogg
  9999. # Client can also be done with wget:
  10000. wget http://<var class="var">server</var>:<var class="var">port</var> -O somefile.ogg
  10001. # Server side (receiving):
  10002. ffmpeg -listen 1 -i http://<var class="var">server</var>:<var class="var">port</var> -c copy somefile.ogg
  10003. # Client side (sending):
  10004. ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://<var class="var">server</var>:<var class="var">port</var>
  10005. # Client can also be done with wget:
  10006. wget --post-file=somefile.ogg http://<var class="var">server</var>:<var class="var">port</var>
  10007. </pre></div>
  10008. </dd>
  10009. <dt><samp class="option">resource</samp></dt>
  10010. <dd><p>The resource requested by a client, when the experimental HTTP server is in use.
  10011. </p>
  10012. </dd>
  10013. <dt><samp class="option">reply_code</samp></dt>
  10014. <dd><p>The HTTP code returned to the client, when the experimental HTTP server is in use.
  10015. </p>
  10016. </dd>
  10017. <dt><samp class="option">short_seek_size</samp></dt>
  10018. <dd><p>Set the threshold, in bytes, for when a readahead should be preferred over a seek and
  10019. new HTTP request. This is useful, for example, to make sure the same connection
  10020. is used for reading large video packets with small audio packets in between.
  10021. </p>
  10022. </dd>
  10023. </dl>
  10024. <a name="HTTP-Cookies"></a>
  10025. <h4 class="subsection">18.15.1 HTTP Cookies<span class="pull-right"><a class="anchor hidden-xs" href="#HTTP-Cookies" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-HTTP-Cookies" aria-hidden="true">TOC</a></span></h4>
  10026. <p>Some HTTP requests will be denied unless cookie values are passed in with the
  10027. request. The <samp class="option">cookies</samp> option allows these cookies to be specified. At
  10028. the very least, each cookie must specify a value along with a path and domain.
  10029. HTTP requests that match both the domain and path will automatically include the
  10030. cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
  10031. by a newline.
  10032. </p>
  10033. <p>The required syntax to play a stream specifying a cookie is:
  10034. </p><div class="example">
  10035. <pre class="example-preformatted">ffplay -cookies &quot;nlqptid=nltid=tsn; path=/; domain=somedomain.com;&quot; http://somedomain.com/somestream.m3u8
  10036. </pre></div>
  10037. <a name="Icecast"></a>
  10038. <h3 class="section">18.16 Icecast<span class="pull-right"><a class="anchor hidden-xs" href="#Icecast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Icecast" aria-hidden="true">TOC</a></span></h3>
  10039. <p>Icecast protocol (stream to Icecast servers)
  10040. </p>
  10041. <p>This protocol accepts the following options:
  10042. </p>
  10043. <dl class="table">
  10044. <dt><samp class="option">ice_genre</samp></dt>
  10045. <dd><p>Set the stream genre.
  10046. </p>
  10047. </dd>
  10048. <dt><samp class="option">ice_name</samp></dt>
  10049. <dd><p>Set the stream name.
  10050. </p>
  10051. </dd>
  10052. <dt><samp class="option">ice_description</samp></dt>
  10053. <dd><p>Set the stream description.
  10054. </p>
  10055. </dd>
  10056. <dt><samp class="option">ice_url</samp></dt>
  10057. <dd><p>Set the stream website URL.
  10058. </p>
  10059. </dd>
  10060. <dt><samp class="option">ice_public</samp></dt>
  10061. <dd><p>Set if the stream should be public.
  10062. The default is 0 (not public).
  10063. </p>
  10064. </dd>
  10065. <dt><samp class="option">user_agent</samp></dt>
  10066. <dd><p>Override the User-Agent header. If not specified a string of the form
  10067. &quot;Lavf/&lt;version&gt;&quot; will be used.
  10068. </p>
  10069. </dd>
  10070. <dt><samp class="option">password</samp></dt>
  10071. <dd><p>Set the Icecast mountpoint password.
  10072. </p>
  10073. </dd>
  10074. <dt><samp class="option">content_type</samp></dt>
  10075. <dd><p>Set the stream content type. This must be set if it is different from
  10076. audio/mpeg.
  10077. </p>
  10078. </dd>
  10079. <dt><samp class="option">legacy_icecast</samp></dt>
  10080. <dd><p>This enables support for Icecast versions &lt; 2.4.0, that do not support the
  10081. HTTP PUT method but the SOURCE method.
  10082. </p>
  10083. </dd>
  10084. <dt><samp class="option">tls</samp></dt>
  10085. <dd><p>Establish a TLS (HTTPS) connection to Icecast.
  10086. </p>
  10087. </dd>
  10088. </dl>
  10089. <div class="example">
  10090. <pre class="example-preformatted">icecast://[<var class="var">username</var>[:<var class="var">password</var>]@]<var class="var">server</var>:<var class="var">port</var>/<var class="var">mountpoint</var>
  10091. </pre></div>
  10092. <a name="ipfs"></a>
  10093. <h3 class="section">18.17 ipfs<span class="pull-right"><a class="anchor hidden-xs" href="#ipfs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ipfs" aria-hidden="true">TOC</a></span></h3>
  10094. <p>InterPlanetary File System (IPFS) protocol support. One can access files stored
  10095. on the IPFS network through so-called gateways. These are http(s) endpoints.
  10096. This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be sent
  10097. to such a gateway. Users can (and should) host their own node which means this
  10098. protocol will use one&rsquo;s local gateway to access files on the IPFS network.
  10099. </p>
  10100. <p>This protocol accepts the following options:
  10101. </p>
  10102. <dl class="table">
  10103. <dt><samp class="option">gateway</samp></dt>
  10104. <dd><p>Defines the gateway to use. When not set, the protocol will first try
  10105. locating the local gateway by looking at <code class="code">$IPFS_GATEWAY</code>, <code class="code">$IPFS_PATH</code>
  10106. and <code class="code">$HOME/.ipfs/</code>, in that order.
  10107. </p>
  10108. </dd>
  10109. </dl>
  10110. <p>One can use this protocol in 2 ways. Using IPFS:
  10111. </p><div class="example">
  10112. <pre class="example-preformatted">ffplay ipfs://&lt;hash&gt;
  10113. </pre></div>
  10114. <p>Or the IPNS protocol (IPNS is mutable IPFS):
  10115. </p><div class="example">
  10116. <pre class="example-preformatted">ffplay ipns://&lt;hash&gt;
  10117. </pre></div>
  10118. <a name="mmst"></a>
  10119. <h3 class="section">18.18 mmst<span class="pull-right"><a class="anchor hidden-xs" href="#mmst" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mmst" aria-hidden="true">TOC</a></span></h3>
  10120. <p>MMS (Microsoft Media Server) protocol over TCP.
  10121. </p>
  10122. <a name="mmsh"></a>
  10123. <h3 class="section">18.19 mmsh<span class="pull-right"><a class="anchor hidden-xs" href="#mmsh" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mmsh" aria-hidden="true">TOC</a></span></h3>
  10124. <p>MMS (Microsoft Media Server) protocol over HTTP.
  10125. </p>
  10126. <p>The required syntax is:
  10127. </p><div class="example">
  10128. <pre class="example-preformatted">mmsh://<var class="var">server</var>[:<var class="var">port</var>][/<var class="var">app</var>][/<var class="var">playpath</var>]
  10129. </pre></div>
  10130. <a name="md5"></a>
  10131. <h3 class="section">18.20 md5<span class="pull-right"><a class="anchor hidden-xs" href="#md5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-md5" aria-hidden="true">TOC</a></span></h3>
  10132. <p>MD5 output protocol.
  10133. </p>
  10134. <p>Computes the MD5 hash of the data to be written, and on close writes
  10135. this to the designated output or stdout if none is specified. It can
  10136. be used to test muxers without writing an actual file.
  10137. </p>
  10138. <p>Some examples follow.
  10139. </p><div class="example">
  10140. <pre class="example-preformatted"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
  10141. ffmpeg -i input.flv -f avi -y md5:output.avi.md5
  10142. # Write the MD5 hash of the encoded AVI file to stdout.
  10143. ffmpeg -i input.flv -f avi -y md5:
  10144. </pre></div>
  10145. <p>Note that some formats (typically MOV) require the output protocol to
  10146. be seekable, so they will fail with the MD5 output protocol.
  10147. </p>
  10148. <a name="pipe"></a>
  10149. <h3 class="section">18.21 pipe<span class="pull-right"><a class="anchor hidden-xs" href="#pipe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pipe" aria-hidden="true">TOC</a></span></h3>
  10150. <p>UNIX pipe access protocol.
  10151. </p>
  10152. <p>Read and write from UNIX pipes.
  10153. </p>
  10154. <p>The accepted syntax is:
  10155. </p><div class="example">
  10156. <pre class="example-preformatted">pipe:[<var class="var">number</var>]
  10157. </pre></div>
  10158. <p>If <samp class="option">fd</samp> isn&rsquo;t specified, <var class="var">number</var> is the number corresponding to the file descriptor of the
  10159. pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If <var class="var">number</var>
  10160. is not specified, by default the stdout file descriptor will be used
  10161. for writing, stdin for reading.
  10162. </p>
  10163. <p>For example to read from stdin with <code class="command">ffmpeg</code>:
  10164. </p><div class="example">
  10165. <pre class="example-preformatted">cat test.wav | ffmpeg -i pipe:0
  10166. # ...this is the same as...
  10167. cat test.wav | ffmpeg -i pipe:
  10168. </pre></div>
  10169. <p>For writing to stdout with <code class="command">ffmpeg</code>:
  10170. </p><div class="example">
  10171. <pre class="example-preformatted">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
  10172. # ...this is the same as...
  10173. ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
  10174. </pre></div>
  10175. <p>This protocol accepts the following options:
  10176. </p>
  10177. <dl class="table">
  10178. <dt><samp class="option">blocksize</samp></dt>
  10179. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  10180. <code class="code">INT_MAX</code>, which results in not limiting the requested block size.
  10181. Setting this value reasonably low improves user termination request reaction
  10182. time, which is valuable if data transmission is slow.
  10183. </p></dd>
  10184. <dt><samp class="option">fd</samp></dt>
  10185. <dd><p>Set file descriptor.
  10186. </p></dd>
  10187. </dl>
  10188. <p>Note that some formats (typically MOV), require the output protocol to
  10189. be seekable, so they will fail with the pipe output protocol.
  10190. </p>
  10191. <a name="prompeg"></a>
  10192. <h3 class="section">18.22 prompeg<span class="pull-right"><a class="anchor hidden-xs" href="#prompeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prompeg" aria-hidden="true">TOC</a></span></h3>
  10193. <p>Pro-MPEG Code of Practice #3 Release 2 FEC protocol.
  10194. </p>
  10195. <p>The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism
  10196. for MPEG-2 Transport Streams sent over RTP.
  10197. </p>
  10198. <p>This protocol must be used in conjunction with the <code class="code">rtp_mpegts</code> muxer and
  10199. the <code class="code">rtp</code> protocol.
  10200. </p>
  10201. <p>The required syntax is:
  10202. </p><div class="example">
  10203. <pre class="example-preformatted">-f rtp_mpegts -fec prompeg=<var class="var">option</var>=<var class="var">val</var>... rtp://<var class="var">hostname</var>:<var class="var">port</var>
  10204. </pre></div>
  10205. <p>The destination UDP ports are <code class="code">port + 2</code> for the column FEC stream
  10206. and <code class="code">port + 4</code> for the row FEC stream.
  10207. </p>
  10208. <p>This protocol accepts the following options:
  10209. </p><dl class="table">
  10210. <dt><samp class="option">l=<var class="var">n</var></samp></dt>
  10211. <dd><p>The number of columns (4-20, LxD &lt;= 100)
  10212. </p>
  10213. </dd>
  10214. <dt><samp class="option">d=<var class="var">n</var></samp></dt>
  10215. <dd><p>The number of rows (4-20, LxD &lt;= 100)
  10216. </p>
  10217. </dd>
  10218. </dl>
  10219. <p>Example usage:
  10220. </p>
  10221. <div class="example">
  10222. <pre class="example-preformatted">-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://<var class="var">hostname</var>:<var class="var">port</var>
  10223. </pre></div>
  10224. <a name="rist"></a>
  10225. <h3 class="section">18.23 rist<span class="pull-right"><a class="anchor hidden-xs" href="#rist" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rist" aria-hidden="true">TOC</a></span></h3>
  10226. <p>Reliable Internet Streaming Transport protocol
  10227. </p>
  10228. <p>The accepted options are:
  10229. </p><dl class="table">
  10230. <dt><samp class="option">rist_profile</samp></dt>
  10231. <dd><p>Supported values:
  10232. </p><dl class="table">
  10233. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  10234. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  10235. <dd><p>This one is default.
  10236. </p></dd>
  10237. <dt>&lsquo;<samp class="samp">advanced</samp>&rsquo;</dt>
  10238. </dl>
  10239. </dd>
  10240. <dt><samp class="option">buffer_size</samp></dt>
  10241. <dd><p>Set internal RIST buffer size in milliseconds for retransmission of data.
  10242. Default value is 0 which means the librist default (1 sec). Maximum value is 30
  10243. seconds.
  10244. </p>
  10245. </dd>
  10246. <dt><samp class="option">fifo_size</samp></dt>
  10247. <dd><p>Size of the librist receiver output fifo in number of packets. This must be a
  10248. power of 2.
  10249. Defaults to 8192 (vs the librist default of 1024).
  10250. </p>
  10251. </dd>
  10252. <dt><samp class="option">overrun_nonfatal=<var class="var">1|0</var></samp></dt>
  10253. <dd><p>Survive in case of librist fifo buffer overrun. Default value is 0.
  10254. </p>
  10255. </dd>
  10256. <dt><samp class="option">pkt_size</samp></dt>
  10257. <dd><p>Set maximum packet size for sending data. 1316 by default.
  10258. </p>
  10259. </dd>
  10260. <dt><samp class="option">log_level</samp></dt>
  10261. <dd><p>Set loglevel for RIST logging messages. You only need to set this if you
  10262. explicitly want to enable debug level messages or packet loss simulation,
  10263. otherwise the regular loglevel is respected.
  10264. </p>
  10265. </dd>
  10266. <dt><samp class="option">secret</samp></dt>
  10267. <dd><p>Set override of encryption secret, by default is unset.
  10268. </p>
  10269. </dd>
  10270. <dt><samp class="option">encryption</samp></dt>
  10271. <dd><p>Set encryption type, by default is disabled.
  10272. Acceptable values are 128 and 256.
  10273. </p></dd>
  10274. </dl>
  10275. <a name="rtmp"></a>
  10276. <h3 class="section">18.24 rtmp<span class="pull-right"><a class="anchor hidden-xs" href="#rtmp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmp" aria-hidden="true">TOC</a></span></h3>
  10277. <p>Real-Time Messaging Protocol.
  10278. </p>
  10279. <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
  10280. content across a TCP/IP network.
  10281. </p>
  10282. <p>The required syntax is:
  10283. </p><div class="example">
  10284. <pre class="example-preformatted">rtmp://[<var class="var">username</var>:<var class="var">password</var>@]<var class="var">server</var>[:<var class="var">port</var>][/<var class="var">app</var>][/<var class="var">instance</var>][/<var class="var">playpath</var>]
  10285. </pre></div>
  10286. <p>The accepted parameters are:
  10287. </p><dl class="table">
  10288. <dt><samp class="option">username</samp></dt>
  10289. <dd><p>An optional username (mostly for publishing).
  10290. </p>
  10291. </dd>
  10292. <dt><samp class="option">password</samp></dt>
  10293. <dd><p>An optional password (mostly for publishing).
  10294. </p>
  10295. </dd>
  10296. <dt><samp class="option">server</samp></dt>
  10297. <dd><p>The address of the RTMP server.
  10298. </p>
  10299. </dd>
  10300. <dt><samp class="option">port</samp></dt>
  10301. <dd><p>The number of the TCP port to use (by default is 1935).
  10302. </p>
  10303. </dd>
  10304. <dt><samp class="option">app</samp></dt>
  10305. <dd><p>It is the name of the application to access. It usually corresponds to
  10306. the path where the application is installed on the RTMP server
  10307. (e.g. <samp class="file">/ondemand/</samp>, <samp class="file">/flash/live/</samp>, etc.). You can override
  10308. the value parsed from the URI through the <code class="code">rtmp_app</code> option, too.
  10309. </p>
  10310. </dd>
  10311. <dt><samp class="option">playpath</samp></dt>
  10312. <dd><p>It is the path or name of the resource to play with reference to the
  10313. application specified in <var class="var">app</var>, may be prefixed by &quot;mp4:&quot;. You
  10314. can override the value parsed from the URI through the <code class="code">rtmp_playpath</code>
  10315. option, too.
  10316. </p>
  10317. </dd>
  10318. <dt><samp class="option">listen</samp></dt>
  10319. <dd><p>Act as a server, listening for an incoming connection.
  10320. </p>
  10321. </dd>
  10322. <dt><samp class="option">timeout</samp></dt>
  10323. <dd><p>Maximum time to wait for the incoming connection. Implies listen.
  10324. </p></dd>
  10325. </dl>
  10326. <p>Additionally, the following parameters can be set via command line options
  10327. (or in code via <code class="code">AVOption</code>s):
  10328. </p><dl class="table">
  10329. <dt><samp class="option">rtmp_app</samp></dt>
  10330. <dd><p>Name of application to connect on the RTMP server. This option
  10331. overrides the parameter specified in the URI.
  10332. </p>
  10333. </dd>
  10334. <dt><samp class="option">rtmp_buffer</samp></dt>
  10335. <dd><p>Set the client buffer time in milliseconds. The default is 3000.
  10336. </p>
  10337. </dd>
  10338. <dt><samp class="option">rtmp_conn</samp></dt>
  10339. <dd><p>Extra arbitrary AMF connection parameters, parsed from a string,
  10340. e.g. like <code class="code">B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0</code>.
  10341. Each value is prefixed by a single character denoting the type,
  10342. B for Boolean, N for number, S for string, O for object, or Z for null,
  10343. followed by a colon. For Booleans the data must be either 0 or 1 for
  10344. FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
  10345. 1 to end or begin an object, respectively. Data items in subobjects may
  10346. be named, by prefixing the type with &rsquo;N&rsquo; and specifying the name before
  10347. the value (i.e. <code class="code">NB:myFlag:1</code>). This option may be used multiple
  10348. times to construct arbitrary AMF sequences.
  10349. </p>
  10350. </dd>
  10351. <dt><samp class="option">rtmp_enhanced_codecs</samp></dt>
  10352. <dd><p>Specify the list of codecs the client advertises to support in an
  10353. enhanced RTMP stream. This option should be set to a comma separated
  10354. list of fourcc values, like <code class="code">hvc1,av01,vp09</code> for multiple codecs
  10355. or <code class="code">hvc1</code> for only one codec. The specified list will be presented
  10356. in the &quot;fourCcLive&quot; property of the Connect Command Message.
  10357. </p>
  10358. </dd>
  10359. <dt><samp class="option">rtmp_flashver</samp></dt>
  10360. <dd><p>Version of the Flash plugin used to run the SWF player. The default
  10361. is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
  10362. &lt;libavformat version&gt;).)
  10363. </p>
  10364. </dd>
  10365. <dt><samp class="option">rtmp_flush_interval</samp></dt>
  10366. <dd><p>Number of packets flushed in the same request (RTMPT only). The default
  10367. is 10.
  10368. </p>
  10369. </dd>
  10370. <dt><samp class="option">rtmp_live</samp></dt>
  10371. <dd><p>Specify that the media is a live stream. No resuming or seeking in
  10372. live streams is possible. The default value is <code class="code">any</code>, which means the
  10373. subscriber first tries to play the live stream specified in the
  10374. playpath. If a live stream of that name is not found, it plays the
  10375. recorded stream. The other possible values are <code class="code">live</code> and
  10376. <code class="code">recorded</code>.
  10377. </p>
  10378. </dd>
  10379. <dt><samp class="option">rtmp_pageurl</samp></dt>
  10380. <dd><p>URL of the web page in which the media was embedded. By default no
  10381. value will be sent.
  10382. </p>
  10383. </dd>
  10384. <dt><samp class="option">rtmp_playpath</samp></dt>
  10385. <dd><p>Stream identifier to play or to publish. This option overrides the
  10386. parameter specified in the URI.
  10387. </p>
  10388. </dd>
  10389. <dt><samp class="option">rtmp_subscribe</samp></dt>
  10390. <dd><p>Name of live stream to subscribe to. By default no value will be sent.
  10391. It is only sent if the option is specified or if rtmp_live
  10392. is set to live.
  10393. </p>
  10394. </dd>
  10395. <dt><samp class="option">rtmp_swfhash</samp></dt>
  10396. <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
  10397. </p>
  10398. </dd>
  10399. <dt><samp class="option">rtmp_swfsize</samp></dt>
  10400. <dd><p>Size of the decompressed SWF file, required for SWFVerification.
  10401. </p>
  10402. </dd>
  10403. <dt><samp class="option">rtmp_swfurl</samp></dt>
  10404. <dd><p>URL of the SWF player for the media. By default no value will be sent.
  10405. </p>
  10406. </dd>
  10407. <dt><samp class="option">rtmp_swfverify</samp></dt>
  10408. <dd><p>URL to player swf file, compute hash/size automatically.
  10409. </p>
  10410. </dd>
  10411. <dt><samp class="option">rtmp_tcurl</samp></dt>
  10412. <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
  10413. </p>
  10414. </dd>
  10415. <dt><samp class="option">tcp_nodelay=<var class="var">1|0</var></samp></dt>
  10416. <dd><p>Set TCP_NODELAY to disable Nagle&rsquo;s algorithm. Default value is 0.
  10417. </p>
  10418. <p><em class="emph">Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY.</em>
  10419. </p>
  10420. </dd>
  10421. <dt><samp class="option">tcp_keepalive=<var class="var">1|0</var></samp></dt>
  10422. <dd><p>Enable the TCP keepalive mechanism to detect dead peers and help maintain long-lived idle connections. Default value is 0.
  10423. </p>
  10424. <p>Only the basic keepalive option (SO_KEEPALIVE) can be enabled or disabled. Platform-specific tuning parameters such as TCP_KEEPIDLE, TCP_KEEPINTVL, or TCP_KEEPCNT are not configurable and will use the operating system&rsquo;s default values.
  10425. </p>
  10426. </dd>
  10427. </dl>
  10428. <p>For example to read with <code class="command">ffplay</code> a multimedia resource named
  10429. &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
  10430. </p><div class="example">
  10431. <pre class="example-preformatted">ffplay rtmp://myserver/vod/sample
  10432. </pre></div>
  10433. <p>To publish to a password protected server, passing the playpath and
  10434. app names separately:
  10435. </p><div class="example">
  10436. <pre class="example-preformatted">ffmpeg -re -i &lt;input&gt; -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
  10437. </pre></div>
  10438. <a name="rtmpe"></a>
  10439. <h3 class="section">18.25 rtmpe<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpe" aria-hidden="true">TOC</a></span></h3>
  10440. <p>Encrypted Real-Time Messaging Protocol.
  10441. </p>
  10442. <p>The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
  10443. streaming multimedia content within standard cryptographic primitives,
  10444. consisting of Diffie-Hellman key exchange and HMACSHA256, generating
  10445. a pair of RC4 keys.
  10446. </p>
  10447. <a name="rtmps"></a>
  10448. <h3 class="section">18.26 rtmps<span class="pull-right"><a class="anchor hidden-xs" href="#rtmps" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmps" aria-hidden="true">TOC</a></span></h3>
  10449. <p>Real-Time Messaging Protocol over a secure SSL connection.
  10450. </p>
  10451. <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
  10452. multimedia content across an encrypted connection.
  10453. </p>
  10454. <a name="rtmpt"></a>
  10455. <h3 class="section">18.27 rtmpt<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpt" aria-hidden="true">TOC</a></span></h3>
  10456. <p>Real-Time Messaging Protocol tunneled through HTTP.
  10457. </p>
  10458. <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
  10459. for streaming multimedia content within HTTP requests to traverse
  10460. firewalls.
  10461. </p>
  10462. <a name="rtmpte"></a>
  10463. <h3 class="section">18.28 rtmpte<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpte" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpte" aria-hidden="true">TOC</a></span></h3>
  10464. <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
  10465. </p>
  10466. <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
  10467. is used for streaming multimedia content within HTTP requests to traverse
  10468. firewalls.
  10469. </p>
  10470. <a name="rtmpts"></a>
  10471. <h3 class="section">18.29 rtmpts<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpts" aria-hidden="true">TOC</a></span></h3>
  10472. <p>Real-Time Messaging Protocol tunneled through HTTPS.
  10473. </p>
  10474. <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
  10475. for streaming multimedia content within HTTPS requests to traverse
  10476. firewalls.
  10477. </p>
  10478. <a name="libsmbclient"></a>
  10479. <h3 class="section">18.30 libsmbclient<span class="pull-right"><a class="anchor hidden-xs" href="#libsmbclient" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libsmbclient" aria-hidden="true">TOC</a></span></h3>
  10480. <p>libsmbclient permits one to manipulate CIFS/SMB network resources.
  10481. </p>
  10482. <p>Following syntax is required.
  10483. </p>
  10484. <div class="example">
  10485. <pre class="example-preformatted">smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
  10486. </pre></div>
  10487. <p>This protocol accepts the following options.
  10488. </p>
  10489. <dl class="table">
  10490. <dt><samp class="option">timeout</samp></dt>
  10491. <dd><p>Set timeout in milliseconds of socket I/O operations used by the underlying
  10492. low level operation. By default it is set to -1, which means that the timeout
  10493. is not specified.
  10494. </p>
  10495. </dd>
  10496. <dt><samp class="option">truncate</samp></dt>
  10497. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  10498. truncating. Default value is 1.
  10499. </p>
  10500. </dd>
  10501. <dt><samp class="option">workgroup</samp></dt>
  10502. <dd><p>Set the workgroup used for making connections. By default workgroup is not specified.
  10503. </p>
  10504. </dd>
  10505. </dl>
  10506. <p>For more information see: <a class="url" href="http://www.samba.org/">http://www.samba.org/</a>.
  10507. </p>
  10508. <a name="libssh"></a>
  10509. <h3 class="section">18.31 libssh<span class="pull-right"><a class="anchor hidden-xs" href="#libssh" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libssh" aria-hidden="true">TOC</a></span></h3>
  10510. <p>Secure File Transfer Protocol via libssh
  10511. </p>
  10512. <p>Read from or write to remote resources using SFTP protocol.
  10513. </p>
  10514. <p>Following syntax is required.
  10515. </p>
  10516. <div class="example">
  10517. <pre class="example-preformatted">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  10518. </pre></div>
  10519. <p>This protocol accepts the following options.
  10520. </p>
  10521. <dl class="table">
  10522. <dt><samp class="option">timeout</samp></dt>
  10523. <dd><p>Set timeout of socket I/O operations used by the underlying low level
  10524. operation. By default it is set to -1, which means that the timeout
  10525. is not specified.
  10526. </p>
  10527. </dd>
  10528. <dt><samp class="option">truncate</samp></dt>
  10529. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  10530. truncating. Default value is 1.
  10531. </p>
  10532. </dd>
  10533. <dt><samp class="option">private_key</samp></dt>
  10534. <dd><p>Specify the path of the file containing private key to use during authorization.
  10535. By default libssh searches for keys in the <samp class="file">~/.ssh/</samp> directory.
  10536. </p>
  10537. </dd>
  10538. </dl>
  10539. <p>Example: Play a file stored on remote server.
  10540. </p>
  10541. <div class="example">
  10542. <pre class="example-preformatted">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
  10543. </pre></div>
  10544. <a name="librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
  10545. <h3 class="section">18.32 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte<span class="pull-right"><a class="anchor hidden-xs" href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" aria-hidden="true">TOC</a></span></h3>
  10546. <p>Real-Time Messaging Protocol and its variants supported through
  10547. librtmp.
  10548. </p>
  10549. <p>Requires the presence of the librtmp headers and library during
  10550. configuration. You need to explicitly configure the build with
  10551. &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
  10552. protocol.
  10553. </p>
  10554. <p>This protocol provides most client functions and a few server
  10555. functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
  10556. encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
  10557. variants of these encrypted types (RTMPTE, RTMPTS).
  10558. </p>
  10559. <p>The required syntax is:
  10560. </p><div class="example">
  10561. <pre class="example-preformatted"><var class="var">rtmp_proto</var>://<var class="var">server</var>[:<var class="var">port</var>][/<var class="var">app</var>][/<var class="var">playpath</var>] <var class="var">options</var>
  10562. </pre></div>
  10563. <p>where <var class="var">rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
  10564. &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
  10565. <var class="var">server</var>, <var class="var">port</var>, <var class="var">app</var> and <var class="var">playpath</var> have the same
  10566. meaning as specified for the RTMP native protocol.
  10567. <var class="var">options</var> contains a list of space-separated options of the form
  10568. <var class="var">key</var>=<var class="var">val</var>.
  10569. </p>
  10570. <p>See the librtmp manual page (man 3 librtmp) for more information.
  10571. </p>
  10572. <p>For example, to stream a file in real-time to an RTMP server using
  10573. <code class="command">ffmpeg</code>:
  10574. </p><div class="example">
  10575. <pre class="example-preformatted">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
  10576. </pre></div>
  10577. <p>To play the same stream using <code class="command">ffplay</code>:
  10578. </p><div class="example">
  10579. <pre class="example-preformatted">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
  10580. </pre></div>
  10581. <a name="rtp"></a>
  10582. <h3 class="section">18.33 rtp<span class="pull-right"><a class="anchor hidden-xs" href="#rtp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtp" aria-hidden="true">TOC</a></span></h3>
  10583. <p>Real-time Transport Protocol.
  10584. </p>
  10585. <p>The required syntax for an RTP URL is:
  10586. </p><div class="example">
  10587. <pre class="example-preformatted">rtp://<var class="var">hostname</var>[:<var class="var">port</var>][?<var class="var">options</var>]
  10588. </pre></div>
  10589. <p><var class="var">port</var> specifies the RTP port to use.
  10590. </p>
  10591. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  10592. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  10593. space) can be used to escape keys and values.
  10594. </p>
  10595. <p>Options can also can be specified via command line options (or in code via
  10596. <code class="code">AVOption</code>s).
  10597. </p>
  10598. <p>The list of supported options follows.
  10599. </p>
  10600. <dl class="table">
  10601. <dt><samp class="option">ttl=<var class="var">n</var></samp></dt>
  10602. <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
  10603. </p>
  10604. </dd>
  10605. <dt><samp class="option">rtcpport=<var class="var">n</var></samp></dt>
  10606. <dd><p>Set the remote RTCP port to <var class="var">n</var>.
  10607. </p>
  10608. </dd>
  10609. <dt><samp class="option">localport, local_rtpport, localrtpport=<var class="var">n</var></samp></dt>
  10610. <dd><p>Set the local RTP port to <var class="var">n</var>.
  10611. </p>
  10612. <p>Using the localport option name is deprecated and should not be used.
  10613. </p>
  10614. </dd>
  10615. <dt><samp class="option">local_rtcpport, localrtcpport=<var class="var">n</var>'</samp></dt>
  10616. <dd><p>Set the local RTCP port to <var class="var">n</var>.
  10617. </p>
  10618. </dd>
  10619. <dt><samp class="option">pkt_size=<var class="var">n</var></samp></dt>
  10620. <dd><p>Set max packet size (in bytes) to <var class="var">n</var>.
  10621. </p>
  10622. </dd>
  10623. <dt><samp class="option">buffer_size=<var class="var">size</var></samp></dt>
  10624. <dd><p>Set the maximum UDP socket buffer size in bytes.
  10625. </p>
  10626. </dd>
  10627. <dt><samp class="option">connect=0|1</samp></dt>
  10628. <dd><p>Do a <code class="code">connect()</code> on the UDP socket (if set to 1) or not (if set
  10629. to 0).
  10630. </p>
  10631. </dd>
  10632. <dt><samp class="option">sources=<var class="var">ip</var>[,<var class="var">ip</var>]</samp></dt>
  10633. <dd><p>List allowed source IP addresses.
  10634. </p>
  10635. </dd>
  10636. <dt><samp class="option">block=<var class="var">ip</var>[,<var class="var">ip</var>]</samp></dt>
  10637. <dd><p>List disallowed (blocked) source IP addresses.
  10638. </p>
  10639. </dd>
  10640. <dt><samp class="option">write_to_source=0|1</samp></dt>
  10641. <dd><p>Send packets to the source address of the latest received packet (if
  10642. set to 1) or to a default remote address (if set to 0).
  10643. </p>
  10644. </dd>
  10645. <dt><samp class="option">localaddr=<var class="var">addr</var></samp></dt>
  10646. <dd><p>Local IP address of a network interface used for sending packets or joining
  10647. multicast groups.
  10648. </p>
  10649. </dd>
  10650. <dt><samp class="option">timeout=<var class="var">n</var></samp></dt>
  10651. <dd><p>Set timeout (in microseconds) of socket I/O operations to <var class="var">n</var>.
  10652. </p></dd>
  10653. </dl>
  10654. <p>Important notes:
  10655. </p>
  10656. <ol class="enumerate">
  10657. <li> If <samp class="option">rtcpport</samp> is not set the RTCP port will be set to the RTP
  10658. port value plus 1.
  10659. </li><li> If <samp class="option">localrtpport</samp> (the local RTP port) is not set any available
  10660. port will be used for the local RTP and RTCP ports.
  10661. </li><li> If <samp class="option">localrtcpport</samp> (the local RTCP port) is not set it will be
  10662. set to the local RTP port value plus 1.
  10663. </li></ol>
  10664. <a name="rtsp"></a>
  10665. <h3 class="section">18.34 rtsp<span class="pull-right"><a class="anchor hidden-xs" href="#rtsp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtsp" aria-hidden="true">TOC</a></span></h3>
  10666. <p>Real-Time Streaming Protocol.
  10667. </p>
  10668. <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
  10669. and muxer. The demuxer supports both normal RTSP (with data transferred
  10670. over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
  10671. data transferred over RDT).
  10672. </p>
  10673. <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
  10674. supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
  10675. <a class="uref" href="https://github.com/revmischa/rtsp-server">RTSP server</a>).
  10676. </p>
  10677. <p>The required syntax for a RTSP url is:
  10678. </p><div class="example">
  10679. <pre class="example-preformatted">rtsp://<var class="var">hostname</var>[:<var class="var">port</var>]/<var class="var">path</var>
  10680. </pre></div>
  10681. <p>Options can be set on the <code class="command">ffmpeg</code>/<code class="command">ffplay</code> command
  10682. line, or set in code via <code class="code">AVOption</code>s or in
  10683. <code class="code">avformat_open_input</code>.
  10684. </p>
  10685. <a name="Muxer"></a>
  10686. <h4 class="subsection">18.34.1 Muxer<span class="pull-right"><a class="anchor hidden-xs" href="#Muxer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Muxer" aria-hidden="true">TOC</a></span></h4>
  10687. <p>The following options are supported.
  10688. </p>
  10689. <dl class="table">
  10690. <dt><samp class="option">rtsp_transport</samp></dt>
  10691. <dd><p>Set RTSP transport protocols.
  10692. </p>
  10693. <p>It accepts the following values:
  10694. </p><dl class="table">
  10695. <dt>&lsquo;<samp class="samp">udp</samp>&rsquo;</dt>
  10696. <dd><p>Use UDP as lower transport protocol.
  10697. </p>
  10698. </dd>
  10699. <dt>&lsquo;<samp class="samp">tcp</samp>&rsquo;</dt>
  10700. <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
  10701. transport protocol.
  10702. </p></dd>
  10703. </dl>
  10704. <p>Default value is &lsquo;<samp class="samp">0</samp>&rsquo;.
  10705. </p>
  10706. </dd>
  10707. <dt><samp class="option">rtsp_flags</samp></dt>
  10708. <dd><p>Set RTSP flags.
  10709. </p>
  10710. <p>The following values are accepted:
  10711. </p><dl class="table">
  10712. <dt>&lsquo;<samp class="samp">latm</samp>&rsquo;</dt>
  10713. <dd><p>Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC.
  10714. </p></dd>
  10715. <dt>&lsquo;<samp class="samp">rfc2190</samp>&rsquo;</dt>
  10716. <dd><p>Use RFC 2190 packetization instead of RFC 4629 for H.263.
  10717. </p></dd>
  10718. <dt>&lsquo;<samp class="samp">skip_rtcp</samp>&rsquo;</dt>
  10719. <dd><p>Don&rsquo;t send RTCP sender reports.
  10720. </p></dd>
  10721. <dt>&lsquo;<samp class="samp">h264_mode0</samp>&rsquo;</dt>
  10722. <dd><p>Use mode 0 for H.264 in RTP.
  10723. </p></dd>
  10724. <dt>&lsquo;<samp class="samp">send_bye</samp>&rsquo;</dt>
  10725. <dd><p>Send RTCP BYE packets when finishing.
  10726. </p></dd>
  10727. </dl>
  10728. <p>Default value is &lsquo;<samp class="samp">0</samp>&rsquo;.
  10729. </p>
  10730. </dd>
  10731. <dt><samp class="option">min_port</samp></dt>
  10732. <dd><p>Set minimum local UDP port. Default value is 5000.
  10733. </p>
  10734. </dd>
  10735. <dt><samp class="option">max_port</samp></dt>
  10736. <dd><p>Set maximum local UDP port. Default value is 65000.
  10737. </p>
  10738. </dd>
  10739. <dt><samp class="option">buffer_size</samp></dt>
  10740. <dd><p>Set the maximum socket buffer size in bytes.
  10741. </p>
  10742. </dd>
  10743. <dt><samp class="option">pkt_size</samp></dt>
  10744. <dd><p>Set max send packet size (in bytes). Default value is 1472.
  10745. </p></dd>
  10746. </dl>
  10747. <a name="Demuxer"></a>
  10748. <h4 class="subsection">18.34.2 Demuxer<span class="pull-right"><a class="anchor hidden-xs" href="#Demuxer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Demuxer" aria-hidden="true">TOC</a></span></h4>
  10749. <p>The following options are supported.
  10750. </p>
  10751. <dl class="table">
  10752. <dt><samp class="option">initial_pause</samp></dt>
  10753. <dd><p>Do not start playing the stream immediately if set to 1. Default value
  10754. is 0.
  10755. </p>
  10756. </dd>
  10757. <dt><samp class="option">rtsp_transport</samp></dt>
  10758. <dd><p>Set RTSP transport protocols.
  10759. </p>
  10760. <p>It accepts the following values:
  10761. </p><dl class="table">
  10762. <dt>&lsquo;<samp class="samp">udp</samp>&rsquo;</dt>
  10763. <dd><p>Use UDP as lower transport protocol.
  10764. </p>
  10765. </dd>
  10766. <dt>&lsquo;<samp class="samp">tcp</samp>&rsquo;</dt>
  10767. <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
  10768. transport protocol.
  10769. </p>
  10770. </dd>
  10771. <dt>&lsquo;<samp class="samp">udp_multicast</samp>&rsquo;</dt>
  10772. <dd><p>Use UDP multicast as lower transport protocol.
  10773. </p>
  10774. </dd>
  10775. <dt>&lsquo;<samp class="samp">http</samp>&rsquo;</dt>
  10776. <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
  10777. passing proxies.
  10778. </p>
  10779. </dd>
  10780. <dt>&lsquo;<samp class="samp">https</samp>&rsquo;</dt>
  10781. <dd><p>Use HTTPs tunneling as lower transport protocol, which is useful for
  10782. passing proxies and widely used for security consideration.
  10783. </p></dd>
  10784. </dl>
  10785. <p>Multiple lower transport protocols may be specified, in that case they are
  10786. tried one at a time (if the setup of one fails, the next one is tried).
  10787. For the muxer, only the &lsquo;<samp class="samp">tcp</samp>&rsquo; and &lsquo;<samp class="samp">udp</samp>&rsquo; options are supported.
  10788. </p>
  10789. </dd>
  10790. <dt><samp class="option">rtsp_flags</samp></dt>
  10791. <dd><p>Set RTSP flags.
  10792. </p>
  10793. <p>The following values are accepted:
  10794. </p><dl class="table">
  10795. <dt>&lsquo;<samp class="samp">filter_src</samp>&rsquo;</dt>
  10796. <dd><p>Accept packets only from negotiated peer address and port.
  10797. </p></dd>
  10798. <dt>&lsquo;<samp class="samp">listen</samp>&rsquo;</dt>
  10799. <dd><p>Act as a server, listening for an incoming connection.
  10800. </p></dd>
  10801. <dt>&lsquo;<samp class="samp">prefer_tcp</samp>&rsquo;</dt>
  10802. <dd><p>Try TCP for RTP transport first, if TCP is available as RTSP RTP transport.
  10803. </p></dd>
  10804. <dt>&lsquo;<samp class="samp">satip_raw</samp>&rsquo;</dt>
  10805. <dd><p>Export raw MPEG-TS stream instead of demuxing. The flag will simply write out
  10806. the raw stream, with the original PAT/PMT/PIDs intact.
  10807. </p></dd>
  10808. </dl>
  10809. <p>Default value is &lsquo;<samp class="samp">none</samp>&rsquo;.
  10810. </p>
  10811. </dd>
  10812. <dt><samp class="option">allowed_media_types</samp></dt>
  10813. <dd><p>Set media types to accept from the server.
  10814. </p>
  10815. <p>The following flags are accepted:
  10816. </p><dl class="table">
  10817. <dt>&lsquo;<samp class="samp">video</samp>&rsquo;</dt>
  10818. <dt>&lsquo;<samp class="samp">audio</samp>&rsquo;</dt>
  10819. <dt>&lsquo;<samp class="samp">data</samp>&rsquo;</dt>
  10820. <dt>&lsquo;<samp class="samp">subtitle</samp>&rsquo;</dt>
  10821. </dl>
  10822. <p>By default it accepts all media types.
  10823. </p>
  10824. </dd>
  10825. <dt><samp class="option">min_port</samp></dt>
  10826. <dd><p>Set minimum local UDP port. Default value is 5000.
  10827. </p>
  10828. </dd>
  10829. <dt><samp class="option">max_port</samp></dt>
  10830. <dd><p>Set maximum local UDP port. Default value is 65000.
  10831. </p>
  10832. </dd>
  10833. <dt><samp class="option">listen_timeout</samp></dt>
  10834. <dd><p>Set maximum timeout (in seconds) to establish an initial connection. Setting
  10835. <samp class="option">listen_timeout</samp> &gt; 0 sets <samp class="option">rtsp_flags</samp> to &lsquo;<samp class="samp">listen</samp>&rsquo;. Default is -1
  10836. which means an infinite timeout when &lsquo;<samp class="samp">listen</samp>&rsquo; mode is set.
  10837. </p>
  10838. </dd>
  10839. <dt><samp class="option">reorder_queue_size</samp></dt>
  10840. <dd><p>Set number of packets to buffer for handling of reordered packets.
  10841. </p>
  10842. </dd>
  10843. <dt><samp class="option">timeout</samp></dt>
  10844. <dd><p>Set socket TCP I/O timeout in microseconds.
  10845. </p>
  10846. </dd>
  10847. <dt><samp class="option">user_agent</samp></dt>
  10848. <dd><p>Override User-Agent header. If not specified, it defaults to the
  10849. libavformat identifier string.
  10850. </p>
  10851. </dd>
  10852. <dt><samp class="option">buffer_size</samp></dt>
  10853. <dd><p>Set the maximum socket buffer size in bytes.
  10854. </p></dd>
  10855. </dl>
  10856. <p>When receiving data over UDP, the demuxer tries to reorder received packets
  10857. (since they may arrive out of order, or packets may get lost totally). This
  10858. can be disabled by setting the maximum demuxing delay to zero (via
  10859. the <code class="code">max_delay</code> field of AVFormatContext).
  10860. </p>
  10861. <p>When watching multi-bitrate Real-RTSP streams with <code class="command">ffplay</code>, the
  10862. streams to display can be chosen with <code class="code">-vst</code> <var class="var">n</var> and
  10863. <code class="code">-ast</code> <var class="var">n</var> for video and audio respectively, and can be switched
  10864. on the fly by pressing <code class="code">v</code> and <code class="code">a</code>.
  10865. </p>
  10866. <a name="Examples-8"></a>
  10867. <h4 class="subsection">18.34.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-8" aria-hidden="true">TOC</a></span></h4>
  10868. <p>The following examples all make use of the <code class="command">ffplay</code> and
  10869. <code class="command">ffmpeg</code> tools.
  10870. </p>
  10871. <ul class="itemize mark-bullet">
  10872. <li>Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
  10873. <div class="example">
  10874. <pre class="example-preformatted">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
  10875. </pre></div>
  10876. </li><li>Watch a stream tunneled over HTTP:
  10877. <div class="example">
  10878. <pre class="example-preformatted">ffplay -rtsp_transport http rtsp://server/video.mp4
  10879. </pre></div>
  10880. </li><li>Send a stream in realtime to a RTSP server, for others to watch:
  10881. <div class="example">
  10882. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
  10883. </pre></div>
  10884. </li><li>Receive a stream in realtime:
  10885. <div class="example">
  10886. <pre class="example-preformatted">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var class="var">output</var>
  10887. </pre></div>
  10888. </li></ul>
  10889. <a name="sap"></a>
  10890. <h3 class="section">18.35 sap<span class="pull-right"><a class="anchor hidden-xs" href="#sap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sap" aria-hidden="true">TOC</a></span></h3>
  10891. <p>Session Announcement Protocol (RFC 2974). This is not technically a
  10892. protocol handler in libavformat, it is a muxer and demuxer.
  10893. It is used for signalling of RTP streams, by announcing the SDP for the
  10894. streams regularly on a separate port.
  10895. </p>
  10896. <a name="Muxer-1"></a>
  10897. <h4 class="subsection">18.35.1 Muxer<span class="pull-right"><a class="anchor hidden-xs" href="#Muxer-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Muxer-1" aria-hidden="true">TOC</a></span></h4>
  10898. <p>The syntax for a SAP url given to the muxer is:
  10899. </p><div class="example">
  10900. <pre class="example-preformatted">sap://<var class="var">destination</var>[:<var class="var">port</var>][?<var class="var">options</var>]
  10901. </pre></div>
  10902. <p>The RTP packets are sent to <var class="var">destination</var> on port <var class="var">port</var>,
  10903. or to port 5004 if no port is specified.
  10904. <var class="var">options</var> is a <code class="code">&amp;</code>-separated list. The following options
  10905. are supported:
  10906. </p>
  10907. <dl class="table">
  10908. <dt><samp class="option">announce_addr=<var class="var">address</var></samp></dt>
  10909. <dd><p>Specify the destination IP address for sending the announcements to.
  10910. If omitted, the announcements are sent to the commonly used SAP
  10911. announcement multicast address 224.2.127.254 (sap.mcast.net), or
  10912. ff0e::2:7ffe if <var class="var">destination</var> is an IPv6 address.
  10913. </p>
  10914. </dd>
  10915. <dt><samp class="option">announce_port=<var class="var">port</var></samp></dt>
  10916. <dd><p>Specify the port to send the announcements on, defaults to
  10917. 9875 if not specified.
  10918. </p>
  10919. </dd>
  10920. <dt><samp class="option">ttl=<var class="var">ttl</var></samp></dt>
  10921. <dd><p>Specify the time to live value for the announcements and RTP packets,
  10922. defaults to 255.
  10923. </p>
  10924. </dd>
  10925. <dt><samp class="option">same_port=<var class="var">0|1</var></samp></dt>
  10926. <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
  10927. default), all streams are sent on unique ports, with each stream on a
  10928. port 2 numbers higher than the previous.
  10929. VLC/Live555 requires this to be set to 1, to be able to receive the stream.
  10930. The RTP stack in libavformat for receiving requires all streams to be sent
  10931. on unique ports.
  10932. </p></dd>
  10933. </dl>
  10934. <p>Example command lines follow.
  10935. </p>
  10936. <p>To broadcast a stream on the local subnet, for watching in VLC:
  10937. </p>
  10938. <div class="example">
  10939. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f sap sap://224.0.0.255?same_port=1
  10940. </pre></div>
  10941. <p>Similarly, for watching in <code class="command">ffplay</code>:
  10942. </p>
  10943. <div class="example">
  10944. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f sap sap://224.0.0.255
  10945. </pre></div>
  10946. <p>And for watching in <code class="command">ffplay</code>, over IPv6:
  10947. </p>
  10948. <div class="example">
  10949. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f sap sap://[ff0e::1:2:3:4]
  10950. </pre></div>
  10951. <a name="Demuxer-1"></a>
  10952. <h4 class="subsection">18.35.2 Demuxer<span class="pull-right"><a class="anchor hidden-xs" href="#Demuxer-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Demuxer-1" aria-hidden="true">TOC</a></span></h4>
  10953. <p>The syntax for a SAP url given to the demuxer is:
  10954. </p><div class="example">
  10955. <pre class="example-preformatted">sap://[<var class="var">address</var>][:<var class="var">port</var>]
  10956. </pre></div>
  10957. <p><var class="var">address</var> is the multicast address to listen for announcements on,
  10958. if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var class="var">port</var>
  10959. is the port that is listened on, 9875 if omitted.
  10960. </p>
  10961. <p>The demuxers listens for announcements on the given address and port.
  10962. Once an announcement is received, it tries to receive that particular stream.
  10963. </p>
  10964. <p>Example command lines follow.
  10965. </p>
  10966. <p>To play back the first stream announced on the normal SAP multicast address:
  10967. </p>
  10968. <div class="example">
  10969. <pre class="example-preformatted">ffplay sap://
  10970. </pre></div>
  10971. <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
  10972. </p>
  10973. <div class="example">
  10974. <pre class="example-preformatted">ffplay sap://[ff0e::2:7ffe]
  10975. </pre></div>
  10976. <a name="sctp"></a>
  10977. <h3 class="section">18.36 sctp<span class="pull-right"><a class="anchor hidden-xs" href="#sctp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sctp" aria-hidden="true">TOC</a></span></h3>
  10978. <p>Stream Control Transmission Protocol.
  10979. </p>
  10980. <p>The accepted URL syntax is:
  10981. </p><div class="example">
  10982. <pre class="example-preformatted">sctp://<var class="var">host</var>:<var class="var">port</var>[?<var class="var">options</var>]
  10983. </pre></div>
  10984. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  10985. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  10986. space) can be used to escape keys and values.
  10987. </p>
  10988. <p>Options can also can be specified via command line options (or in code via
  10989. <code class="code">AVOption</code>s).
  10990. </p>
  10991. <p>The list of supported options follows.
  10992. </p>
  10993. <dl class="table">
  10994. <dt><samp class="option">listen</samp></dt>
  10995. <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
  10996. </p>
  10997. </dd>
  10998. <dt><samp class="option">max_streams</samp></dt>
  10999. <dd><p>Set the maximum number of streams. By default no limit is set.
  11000. </p></dd>
  11001. </dl>
  11002. <a name="srt"></a>
  11003. <h3 class="section">18.37 srt<span class="pull-right"><a class="anchor hidden-xs" href="#srt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-srt" aria-hidden="true">TOC</a></span></h3>
  11004. <p>Haivision Secure Reliable Transport Protocol via libsrt.
  11005. </p>
  11006. <p>The supported syntax for a SRT URL is:
  11007. </p><div class="example">
  11008. <pre class="example-preformatted">srt://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  11009. </pre></div>
  11010. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  11011. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  11012. space) can be used to escape keys and values.
  11013. </p>
  11014. <p>Options can also can be specified via command line options (or in code via
  11015. <code class="code">AVOption</code>s).
  11016. </p>
  11017. <p>The list of supported options follows.
  11018. </p>
  11019. <dl class="table">
  11020. <dt><samp class="option">connect_timeout=<var class="var">milliseconds</var></samp></dt>
  11021. <dd><p>Connection timeout; SRT cannot connect for RTT &gt; 1500 msec
  11022. (2 handshake exchanges) with the default connect timeout of
  11023. 3 seconds. This option applies to the caller and rendezvous
  11024. connection modes. The connect timeout is 10 times the value
  11025. set for the rendezvous mode (which can be used as a
  11026. workaround for this connection problem with earlier versions).
  11027. </p>
  11028. </dd>
  11029. <dt><samp class="option">ffs=<var class="var">bytes</var></samp></dt>
  11030. <dd><p>Flight Flag Size (Window Size), in bytes. FFS is actually an
  11031. internal parameter and you should set it to not less than
  11032. <samp class="option">recv_buffer_size</samp> and <samp class="option">mss</samp>. The default value
  11033. is relatively large, therefore unless you set a very large receiver buffer,
  11034. you do not need to change this option. Default value is 25600.
  11035. </p>
  11036. </dd>
  11037. <dt><samp class="option">inputbw=<var class="var">bytes/seconds</var></samp></dt>
  11038. <dd><p>Sender nominal input rate, in bytes per seconds. Used along with
  11039. <samp class="option">oheadbw</samp>, when <samp class="option">maxbw</samp> is set to relative (0), to
  11040. calculate maximum sending rate when recovery packets are sent
  11041. along with the main media stream:
  11042. <samp class="option">inputbw</samp> * (100 + <samp class="option">oheadbw</samp>) / 100
  11043. if <samp class="option">inputbw</samp> is not set while <samp class="option">maxbw</samp> is set to
  11044. relative (0), the actual input rate is evaluated inside
  11045. the library. Default value is 0.
  11046. </p>
  11047. </dd>
  11048. <dt><samp class="option">iptos=<var class="var">tos</var></samp></dt>
  11049. <dd><p>IP Type of Service. Applies to sender only. Default value is 0xB8.
  11050. </p>
  11051. </dd>
  11052. <dt><samp class="option">ipttl=<var class="var">ttl</var></samp></dt>
  11053. <dd><p>IP Time To Live. Applies to sender only. Default value is 64.
  11054. </p>
  11055. </dd>
  11056. <dt><samp class="option">latency=<var class="var">microseconds</var></samp></dt>
  11057. <dd><p>Timestamp-based Packet Delivery Delay.
  11058. Used to absorb bursts of missed packet retransmissions.
  11059. This flag sets both <samp class="option">rcvlatency</samp> and <samp class="option">peerlatency</samp>
  11060. to the same value. Note that prior to version 1.3.0
  11061. this is the only flag to set the latency, however
  11062. this is effectively equivalent to setting <samp class="option">peerlatency</samp>,
  11063. when side is sender and <samp class="option">rcvlatency</samp>
  11064. when side is receiver, and the bidirectional stream
  11065. sending is not supported.
  11066. </p>
  11067. </dd>
  11068. <dt><samp class="option">listen_timeout=<var class="var">microseconds</var></samp></dt>
  11069. <dd><p>Set socket listen timeout.
  11070. </p>
  11071. </dd>
  11072. <dt><samp class="option">maxbw=<var class="var">bytes/seconds</var></samp></dt>
  11073. <dd><p>Maximum sending bandwidth, in bytes per seconds.
  11074. -1 infinite (CSRTCC limit is 30mbps)
  11075. 0 relative to input rate (see <samp class="option">inputbw</samp>)
  11076. &gt;0 absolute limit value
  11077. Default value is 0 (relative)
  11078. </p>
  11079. </dd>
  11080. <dt><samp class="option">mode=<var class="var">caller|listener|rendezvous</var></samp></dt>
  11081. <dd><p>Connection mode.
  11082. <samp class="option">caller</samp> opens client connection.
  11083. <samp class="option">listener</samp> starts server to listen for incoming connections.
  11084. <samp class="option">rendezvous</samp> use Rendez-Vous connection mode.
  11085. Default value is caller.
  11086. </p>
  11087. </dd>
  11088. <dt><samp class="option">mss=<var class="var">bytes</var></samp></dt>
  11089. <dd><p>Maximum Segment Size, in bytes. Used for buffer allocation
  11090. and rate calculation using a packet counter assuming fully
  11091. filled packets. The smallest MSS between the peers is
  11092. used. This is 1500 by default in the overall internet.
  11093. This is the maximum size of the UDP packet and can be
  11094. only decreased, unless you have some unusual dedicated
  11095. network settings. Default value is 1500.
  11096. </p>
  11097. </dd>
  11098. <dt><samp class="option">nakreport=<var class="var">1|0</var></samp></dt>
  11099. <dd><p>If set to 1, Receiver will send &lsquo;UMSG_LOSSREPORT&lsquo; messages
  11100. periodically until a lost packet is retransmitted or
  11101. intentionally dropped. Default value is 1.
  11102. </p>
  11103. </dd>
  11104. <dt><samp class="option">oheadbw=<var class="var">percents</var></samp></dt>
  11105. <dd><p>Recovery bandwidth overhead above input rate, in percents.
  11106. See <samp class="option">inputbw</samp>. Default value is 25%.
  11107. </p>
  11108. </dd>
  11109. <dt><samp class="option">passphrase=<var class="var">string</var></samp></dt>
  11110. <dd><p>HaiCrypt Encryption/Decryption Passphrase string, length
  11111. from 10 to 79 characters. The passphrase is the shared
  11112. secret between the sender and the receiver. It is used
  11113. to generate the Key Encrypting Key using PBKDF2
  11114. (Password-Based Key Derivation Function). It is used
  11115. only if <samp class="option">pbkeylen</samp> is non-zero. It is used on
  11116. the receiver only if the received data is encrypted.
  11117. The configured passphrase cannot be recovered (write-only).
  11118. </p>
  11119. </dd>
  11120. <dt><samp class="option">enforced_encryption=<var class="var">1|0</var></samp></dt>
  11121. <dd><p>If true, both connection parties must have the same password
  11122. set (including empty, that is, with no encryption). If the
  11123. password doesn&rsquo;t match or only one side is unencrypted,
  11124. the connection is rejected. Default is true.
  11125. </p>
  11126. </dd>
  11127. <dt><samp class="option">kmrefreshrate=<var class="var">packets</var></samp></dt>
  11128. <dd><p>The number of packets to be transmitted after which the
  11129. encryption key is switched to a new key. Default is -1.
  11130. -1 means auto (0x1000000 in srt library). The range for
  11131. this option is integers in the 0 - <code class="code">INT_MAX</code>.
  11132. </p>
  11133. </dd>
  11134. <dt><samp class="option">kmpreannounce=<var class="var">packets</var></samp></dt>
  11135. <dd><p>The interval between when a new encryption key is sent and
  11136. when switchover occurs. This value also applies to the
  11137. subsequent interval between when switchover occurs and
  11138. when the old encryption key is decommissioned. Default is -1.
  11139. -1 means auto (0x1000 in srt library). The range for
  11140. this option is integers in the 0 - <code class="code">INT_MAX</code>.
  11141. </p>
  11142. </dd>
  11143. <dt><samp class="option">snddropdelay=<var class="var">microseconds</var></samp></dt>
  11144. <dd><p>The sender&rsquo;s extra delay before dropping packets. This delay is
  11145. added to the default drop delay time interval value.
  11146. </p>
  11147. <p>Special value -1: Do not drop packets on the sender at all.
  11148. </p>
  11149. </dd>
  11150. <dt><samp class="option">payload_size=<var class="var">bytes</var></samp></dt>
  11151. <dd><p>Sets the maximum declared size of a packet transferred
  11152. during the single call to the sending function in Live
  11153. mode. Use 0 if this value isn&rsquo;t used (which is default in
  11154. file mode).
  11155. Default is -1 (automatic), which typically means MPEG-TS;
  11156. if you are going to use SRT
  11157. to send any different kind of payload, such as, for example,
  11158. wrapping a live stream in very small frames, then you can
  11159. use a bigger maximum frame size, though not greater than
  11160. 1456 bytes.
  11161. </p>
  11162. </dd>
  11163. <dt><samp class="option">pkt_size=<var class="var">bytes</var></samp></dt>
  11164. <dd><p>Alias for &lsquo;<samp class="samp">payload_size</samp>&rsquo;.
  11165. </p>
  11166. </dd>
  11167. <dt><samp class="option">peerlatency=<var class="var">microseconds</var></samp></dt>
  11168. <dd><p>The latency value (as described in <samp class="option">rcvlatency</samp>) that is
  11169. set by the sender side as a minimum value for the receiver.
  11170. </p>
  11171. </dd>
  11172. <dt><samp class="option">pbkeylen=<var class="var">bytes</var></samp></dt>
  11173. <dd><p>Sender encryption key length, in bytes.
  11174. Only can be set to 0, 16, 24 and 32.
  11175. Enable sender encryption if not 0.
  11176. Not required on receiver (set to 0),
  11177. key size obtained from sender in HaiCrypt handshake.
  11178. Default value is 0.
  11179. </p>
  11180. </dd>
  11181. <dt><samp class="option">rcvlatency=<var class="var">microseconds</var></samp></dt>
  11182. <dd><p>The time that should elapse since the moment when the
  11183. packet was sent and the moment when it&rsquo;s delivered to
  11184. the receiver application in the receiving function.
  11185. This time should be a buffer time large enough to cover
  11186. the time spent for sending, unexpectedly extended RTT
  11187. time, and the time needed to retransmit the lost UDP
  11188. packet. The effective latency value will be the maximum
  11189. of this options&rsquo; value and the value of <samp class="option">peerlatency</samp>
  11190. set by the peer side. Before version 1.3.0 this option
  11191. is only available as <samp class="option">latency</samp>.
  11192. </p>
  11193. </dd>
  11194. <dt><samp class="option">recv_buffer_size=<var class="var">bytes</var></samp></dt>
  11195. <dd><p>Set UDP receive buffer size, expressed in bytes.
  11196. </p>
  11197. </dd>
  11198. <dt><samp class="option">send_buffer_size=<var class="var">bytes</var></samp></dt>
  11199. <dd><p>Set UDP send buffer size, expressed in bytes.
  11200. </p>
  11201. </dd>
  11202. <dt><samp class="option">timeout=<var class="var">microseconds</var></samp></dt>
  11203. <dd><p>Set raise error timeouts for read, write and connect operations. Note that the
  11204. SRT library has internal timeouts which can be controlled separately, the
  11205. value set here is only a cap on those.
  11206. </p>
  11207. </dd>
  11208. <dt><samp class="option">tlpktdrop=<var class="var">1|0</var></samp></dt>
  11209. <dd><p>Too-late Packet Drop. When enabled on receiver, it skips
  11210. missing packets that have not been delivered in time and
  11211. delivers the following packets to the application when
  11212. their time-to-play has come. It also sends a fake ACK to
  11213. the sender. When enabled on sender and enabled on the
  11214. receiving peer, the sender drops the older packets that
  11215. have no chance of being delivered in time. It was
  11216. automatically enabled in the sender if the receiver
  11217. supports it.
  11218. </p>
  11219. </dd>
  11220. <dt><samp class="option">sndbuf=<var class="var">bytes</var></samp></dt>
  11221. <dd><p>Set send buffer size, expressed in bytes.
  11222. </p>
  11223. </dd>
  11224. <dt><samp class="option">rcvbuf=<var class="var">bytes</var></samp></dt>
  11225. <dd><p>Set receive buffer size, expressed in bytes.
  11226. </p>
  11227. <p>Receive buffer must not be greater than <samp class="option">ffs</samp>.
  11228. </p>
  11229. </dd>
  11230. <dt><samp class="option">lossmaxttl=<var class="var">packets</var></samp></dt>
  11231. <dd><p>The value up to which the Reorder Tolerance may grow. When
  11232. Reorder Tolerance is &gt; 0, then packet loss report is delayed
  11233. until that number of packets come in. Reorder Tolerance
  11234. increases every time a &quot;belated&quot; packet has come, but it
  11235. wasn&rsquo;t due to retransmission (that is, when UDP packets tend
  11236. to come out of order), with the difference between the latest
  11237. sequence and this packet&rsquo;s sequence, and not more than the
  11238. value of this option. By default it&rsquo;s 0, which means that this
  11239. mechanism is turned off, and the loss report is always sent
  11240. immediately upon experiencing a &quot;gap&quot; in sequences.
  11241. </p>
  11242. </dd>
  11243. <dt><samp class="option">minversion</samp></dt>
  11244. <dd><p>The minimum SRT version that is required from the peer. A connection
  11245. to a peer that does not satisfy the minimum version requirement
  11246. will be rejected.
  11247. </p>
  11248. <p>The version format in hex is 0xXXYYZZ for x.y.z in human readable
  11249. form.
  11250. </p>
  11251. </dd>
  11252. <dt><samp class="option">streamid=<var class="var">string</var></samp></dt>
  11253. <dd><p>A string limited to 512 characters that can be set on the socket prior
  11254. to connecting. This stream ID will be able to be retrieved by the
  11255. listener side from the socket that is returned from srt_accept and
  11256. was connected by a socket with that set stream ID. SRT does not enforce
  11257. any special interpretation of the contents of this string.
  11258. This option doesn’t make sense in Rendezvous connection; the result
  11259. might be that simply one side will override the value from the other
  11260. side and it’s the matter of luck which one would win
  11261. </p>
  11262. </dd>
  11263. <dt><samp class="option">srt_streamid=<var class="var">string</var></samp></dt>
  11264. <dd><p>Alias for &lsquo;<samp class="samp">streamid</samp>&rsquo; to avoid conflict with ffmpeg command line option.
  11265. </p>
  11266. </dd>
  11267. <dt><samp class="option">smoother=<var class="var">live|file</var></samp></dt>
  11268. <dd><p>The type of Smoother used for the transmission for that socket, which
  11269. is responsible for the transmission and congestion control. The Smoother
  11270. type must be exactly the same on both connecting parties, otherwise
  11271. the connection is rejected.
  11272. </p>
  11273. </dd>
  11274. <dt><samp class="option">messageapi=<var class="var">1|0</var></samp></dt>
  11275. <dd><p>When set, this socket uses the Message API, otherwise it uses Buffer
  11276. API. Note that in live mode (see <samp class="option">transtype</samp>) there’s only
  11277. message API available. In File mode you can chose to use one of two modes:
  11278. </p>
  11279. <p>Stream API (default, when this option is false). In this mode you may
  11280. send as many data as you wish with one sending instruction, or even use
  11281. dedicated functions that read directly from a file. The internal facility
  11282. will take care of any speed and congestion control. When receiving, you
  11283. can also receive as many data as desired, the data not extracted will be
  11284. waiting for the next call. There is no boundary between data portions in
  11285. the Stream mode.
  11286. </p>
  11287. <p>Message API. In this mode your single sending instruction passes exactly
  11288. one piece of data that has boundaries (a message). Contrary to Live mode,
  11289. this message may span across multiple UDP packets and the only size
  11290. limitation is that it shall fit as a whole in the sending buffer. The
  11291. receiver shall use as large buffer as necessary to receive the message,
  11292. otherwise the message will not be given up. When the message is not
  11293. complete (not all packets received or there was a packet loss) it will
  11294. not be given up.
  11295. </p>
  11296. </dd>
  11297. <dt><samp class="option">transtype=<var class="var">live|file</var></samp></dt>
  11298. <dd><p>Sets the transmission type for the socket, in particular, setting this
  11299. option sets multiple other parameters to their default values as required
  11300. for a particular transmission type.
  11301. </p>
  11302. <p>live: Set options as for live transmission. In this mode, you should
  11303. send by one sending instruction only so many data that fit in one UDP packet,
  11304. and limited to the value defined first in <samp class="option">payload_size</samp> (1316 is
  11305. default in this mode). There is no speed control in this mode, only the
  11306. bandwidth control, if configured, in order to not exceed the bandwidth with
  11307. the overhead transmission (retransmitted and control packets).
  11308. </p>
  11309. <p>file: Set options as for non-live transmission. See <samp class="option">messageapi</samp>
  11310. for further explanations
  11311. </p>
  11312. </dd>
  11313. <dt><samp class="option">linger=<var class="var">seconds</var></samp></dt>
  11314. <dd><p>The number of seconds that the socket waits for unsent data when closing.
  11315. Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180
  11316. seconds in file mode). The range for this option is integers in the
  11317. 0 - <code class="code">INT_MAX</code>.
  11318. </p>
  11319. </dd>
  11320. <dt><samp class="option">tsbpd=<var class="var">1|0</var></samp></dt>
  11321. <dd><p>When true, use Timestamp-based Packet Delivery mode. The default behavior
  11322. depends on the transmission type: enabled in live mode, disabled in file
  11323. mode.
  11324. </p>
  11325. </dd>
  11326. </dl>
  11327. <p>For more information see: <a class="url" href="https://github.com/Haivision/srt">https://github.com/Haivision/srt</a>.
  11328. </p>
  11329. <a name="srtp"></a>
  11330. <h3 class="section">18.38 srtp<span class="pull-right"><a class="anchor hidden-xs" href="#srtp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-srtp" aria-hidden="true">TOC</a></span></h3>
  11331. <p>Secure Real-time Transport Protocol.
  11332. </p>
  11333. <p>The accepted options are:
  11334. </p><dl class="table">
  11335. <dt><samp class="option">srtp_in_suite</samp></dt>
  11336. <dt><samp class="option">srtp_out_suite</samp></dt>
  11337. <dd><p>Select input and output encoding suites.
  11338. </p>
  11339. <p>Supported values:
  11340. </p><dl class="table">
  11341. <dt>&lsquo;<samp class="samp">AES_CM_128_HMAC_SHA1_80</samp>&rsquo;</dt>
  11342. <dt>&lsquo;<samp class="samp">SRTP_AES128_CM_HMAC_SHA1_80</samp>&rsquo;</dt>
  11343. <dt>&lsquo;<samp class="samp">AES_CM_128_HMAC_SHA1_32</samp>&rsquo;</dt>
  11344. <dt>&lsquo;<samp class="samp">SRTP_AES128_CM_HMAC_SHA1_32</samp>&rsquo;</dt>
  11345. </dl>
  11346. </dd>
  11347. <dt><samp class="option">srtp_in_params</samp></dt>
  11348. <dt><samp class="option">srtp_out_params</samp></dt>
  11349. <dd><p>Set input and output encoding parameters, which are expressed by a
  11350. base64-encoded representation of a binary block. The first 16 bytes of
  11351. this binary block are used as master key, the following 14 bytes are
  11352. used as master salt.
  11353. </p></dd>
  11354. </dl>
  11355. <a name="subfile"></a>
  11356. <h3 class="section">18.39 subfile<span class="pull-right"><a class="anchor hidden-xs" href="#subfile" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-subfile" aria-hidden="true">TOC</a></span></h3>
  11357. <p>Virtually extract a segment of a file or another stream.
  11358. The underlying stream must be seekable.
  11359. </p>
  11360. <p>Accepted options:
  11361. </p><dl class="table">
  11362. <dt><samp class="option">start</samp></dt>
  11363. <dd><p>Start offset of the extracted segment, in bytes.
  11364. </p></dd>
  11365. <dt><samp class="option">end</samp></dt>
  11366. <dd><p>End offset of the extracted segment, in bytes.
  11367. If set to 0, extract till end of file.
  11368. </p></dd>
  11369. </dl>
  11370. <p>Examples:
  11371. </p>
  11372. <p>Extract a chapter from a DVD VOB file (start and end sectors obtained
  11373. externally and multiplied by 2048):
  11374. </p><div class="example">
  11375. <pre class="example-preformatted">subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
  11376. </pre></div>
  11377. <p>Play an AVI file directly from a TAR archive:
  11378. </p><div class="example">
  11379. <pre class="example-preformatted">subfile,,start,183241728,end,366490624,,:archive.tar
  11380. </pre></div>
  11381. <p>Play a MPEG-TS file from start offset till end:
  11382. </p><div class="example">
  11383. <pre class="example-preformatted">subfile,,start,32815239,end,0,,:video.ts
  11384. </pre></div>
  11385. <a name="tee"></a>
  11386. <h3 class="section">18.40 tee<span class="pull-right"><a class="anchor hidden-xs" href="#tee" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tee" aria-hidden="true">TOC</a></span></h3>
  11387. <p>Writes the output to multiple protocols. The individual outputs are separated
  11388. by |
  11389. </p>
  11390. <div class="example">
  11391. <pre class="example-preformatted">tee:file://path/to/local/this.avi|file://path/to/local/that.avi
  11392. </pre></div>
  11393. <a name="tcp"></a>
  11394. <h3 class="section">18.41 tcp<span class="pull-right"><a class="anchor hidden-xs" href="#tcp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tcp" aria-hidden="true">TOC</a></span></h3>
  11395. <p>Transmission Control Protocol.
  11396. </p>
  11397. <p>The required syntax for a TCP url is:
  11398. </p><div class="example">
  11399. <pre class="example-preformatted">tcp://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  11400. </pre></div>
  11401. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  11402. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  11403. space) can be used to escape keys and values.
  11404. </p>
  11405. <p>Options can also can be specified via command line options (or in code via
  11406. <code class="code">AVOption</code>s).
  11407. </p>
  11408. <p>The list of supported options follows.
  11409. </p>
  11410. <dl class="table">
  11411. <dt><samp class="option">listen=<var class="var">2|1|0</var></samp></dt>
  11412. <dd><p>Listen for an incoming connection. 0 disables listen, 1 enables listen in
  11413. single client mode, 2 enables listen in multi-client mode. Default value is 0.
  11414. </p>
  11415. </dd>
  11416. <dt><samp class="option">local_addr=<var class="var">addr</var></samp></dt>
  11417. <dd><p>Local IP address of a network interface used for tcp socket connect.
  11418. </p>
  11419. </dd>
  11420. <dt><samp class="option">local_port=<var class="var">port</var></samp></dt>
  11421. <dd><p>Local port used for tcp socket connect.
  11422. </p>
  11423. </dd>
  11424. <dt><samp class="option">timeout=<var class="var">microseconds</var></samp></dt>
  11425. <dd><p>Set raise error timeout, expressed in microseconds.
  11426. </p>
  11427. <p>This option is only relevant in read mode: if no data arrived in more
  11428. than this time interval, raise error.
  11429. </p>
  11430. </dd>
  11431. <dt><samp class="option">listen_timeout=<var class="var">milliseconds</var></samp></dt>
  11432. <dd><p>Set listen timeout, expressed in milliseconds.
  11433. </p>
  11434. </dd>
  11435. <dt><samp class="option">recv_buffer_size=<var class="var">bytes</var></samp></dt>
  11436. <dd><p>Set receive buffer size, expressed bytes.
  11437. </p>
  11438. </dd>
  11439. <dt><samp class="option">send_buffer_size=<var class="var">bytes</var></samp></dt>
  11440. <dd><p>Set send buffer size, expressed bytes.
  11441. </p>
  11442. </dd>
  11443. <dt><samp class="option">tcp_nodelay=<var class="var">1|0</var></samp></dt>
  11444. <dd><p>Set TCP_NODELAY to disable Nagle&rsquo;s algorithm. Default value is 0.
  11445. </p>
  11446. <p><em class="emph">Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY.</em>
  11447. </p>
  11448. </dd>
  11449. <dt><samp class="option">tcp_mss=<var class="var">bytes</var></samp></dt>
  11450. <dd><p>Set maximum segment size for outgoing TCP packets, expressed in bytes.
  11451. </p></dd>
  11452. </dl>
  11453. <p>The following example shows how to setup a listening TCP connection
  11454. with <code class="command">ffmpeg</code>, which is then accessed with <code class="command">ffplay</code>:
  11455. </p><div class="example">
  11456. <pre class="example-preformatted">ffmpeg -i <var class="var">input</var> -f <var class="var">format</var> tcp://<var class="var">hostname</var>:<var class="var">port</var>?listen
  11457. ffplay tcp://<var class="var">hostname</var>:<var class="var">port</var>
  11458. </pre></div>
  11459. <a name="tls"></a>
  11460. <h3 class="section">18.42 tls<span class="pull-right"><a class="anchor hidden-xs" href="#tls" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tls" aria-hidden="true">TOC</a></span></h3>
  11461. <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
  11462. </p>
  11463. <p>The required syntax for a TLS/SSL url is:
  11464. </p><div class="example">
  11465. <pre class="example-preformatted">tls://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  11466. </pre></div>
  11467. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  11468. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  11469. space) can be used to escape keys and values.
  11470. </p>
  11471. <p>Options can also can be specified via command line options (or in code via
  11472. <code class="code">AVOption</code>s).
  11473. </p>
  11474. <p>The list of supported options follows.
  11475. </p>
  11476. <dl class="table">
  11477. <dt><samp class="option">ca_file, cafile=<var class="var">filename</var></samp></dt>
  11478. <dd><p>A file containing certificate authority (CA) root certificates to treat
  11479. as trusted. If the linked TLS library contains a default this might not
  11480. need to be specified for verification to work, but not all libraries and
  11481. setups have defaults built in.
  11482. The file must be in OpenSSL PEM format.
  11483. </p>
  11484. </dd>
  11485. <dt><samp class="option">tls_verify, verify=<var class="var">1|0</var></samp></dt>
  11486. <dd><p>If enabled, try to verify the peer that we are communicating with.
  11487. Note, if using OpenSSL, this currently only makes sure that the
  11488. peer certificate is signed by one of the root certificates in the CA
  11489. database, but it does not validate that the certificate actually
  11490. matches the host name we are trying to connect to. (With other backends,
  11491. the host name is validated as well.)
  11492. </p>
  11493. <p>This is disabled by default since it requires a CA database to be
  11494. provided by the caller in many cases.
  11495. </p>
  11496. </dd>
  11497. <dt><samp class="option">cert_file, cert=<var class="var">filename</var></samp></dt>
  11498. <dd><p>A file containing a certificate to use in the handshake with the peer.
  11499. (When operating as server, in listen mode, this is more often required
  11500. by the peer, while client certificates only are mandated in certain
  11501. setups.)
  11502. </p>
  11503. </dd>
  11504. <dt><samp class="option">key_file, key=<var class="var">filename</var></samp></dt>
  11505. <dd><p>A file containing the private key for the certificate.
  11506. </p>
  11507. </dd>
  11508. <dt><samp class="option">listen=<var class="var">1|0</var></samp></dt>
  11509. <dd><p>If enabled, listen for connections on the provided port, and assume
  11510. the server role in the handshake instead of the client role.
  11511. </p>
  11512. </dd>
  11513. <dt><samp class="option">http_proxy</samp></dt>
  11514. <dd><p>The HTTP proxy to tunnel through, e.g. <code class="code">http://example.com:1234</code>.
  11515. The proxy must support the CONNECT method.
  11516. </p>
  11517. </dd>
  11518. </dl>
  11519. <p>Example command lines:
  11520. </p>
  11521. <p>To create a TLS/SSL server that serves an input stream.
  11522. </p>
  11523. <div class="example">
  11524. <pre class="example-preformatted">ffmpeg -i <var class="var">input</var> -f <var class="var">format</var> tls://<var class="var">hostname</var>:<var class="var">port</var>?listen&amp;cert=<var class="var">server.crt</var>&amp;key=<var class="var">server.key</var>
  11525. </pre></div>
  11526. <p>To play back a stream from the TLS/SSL server using <code class="command">ffplay</code>:
  11527. </p>
  11528. <div class="example">
  11529. <pre class="example-preformatted">ffplay tls://<var class="var">hostname</var>:<var class="var">port</var>
  11530. </pre></div>
  11531. <a name="dtls"></a>
  11532. <h3 class="section">18.43 dtls<span class="pull-right"><a class="anchor hidden-xs" href="#dtls" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dtls" aria-hidden="true">TOC</a></span></h3>
  11533. <p>Datagram Transport Layer Security (DTLS)
  11534. </p>
  11535. <p>The required syntax for a DTLS URL is:
  11536. </p><div class="example">
  11537. <pre class="example-preformatted">dtls://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  11538. </pre></div>
  11539. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  11540. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  11541. space) can be used to escape keys and values.
  11542. </p>
  11543. <p>Options can also can be specified via command line options (or in code via
  11544. <code class="code">AVOption</code>s).
  11545. </p>
  11546. <p>DTLS shares most options with TLS, but operates over UDP instead of TCP.
  11547. </p>
  11548. <p>The list of supported options follows.
  11549. </p>
  11550. <dl class="table">
  11551. <dt><samp class="option">ca_file, cafile=<var class="var">filename</var></samp></dt>
  11552. <dd><p>A file containing certificate authority (CA) root certificates to treat
  11553. as trusted. If the linked TLS library contains a default this might not
  11554. need to be specified for verification to work, but not all libraries and
  11555. setups have defaults built in.
  11556. The file must be in OpenSSL PEM format.
  11557. </p>
  11558. </dd>
  11559. <dt><samp class="option">tls_verify, verify=<var class="var">1|0</var></samp></dt>
  11560. <dd><p>If enabled, try to verify the peer that we are communicating with.
  11561. Note, if using OpenSSL, this currently only makes sure that the
  11562. peer certificate is signed by one of the root certificates in the CA
  11563. database, but it does not validate that the certificate actually
  11564. matches the host name we are trying to connect to.
  11565. </p>
  11566. <p>This is disabled by default since it requires a CA database to be
  11567. provided by the caller in many cases.
  11568. </p>
  11569. </dd>
  11570. <dt><samp class="option">cert_file, cert=<var class="var">filename</var></samp></dt>
  11571. <dd><p>A file containing a certificate to use in the handshake with the peer.
  11572. (When operating as server, in listen mode, this is more often required
  11573. by the peer, while client certificates only are mandated in certain
  11574. setups.)
  11575. </p>
  11576. </dd>
  11577. <dt><samp class="option">key_file, key=<var class="var">filename</var></samp></dt>
  11578. <dd><p>A file containing the private key for the certificate.
  11579. </p>
  11580. </dd>
  11581. <dt><samp class="option">cert_pem=<var class="var">string</var></samp></dt>
  11582. <dd><p>Certificate PEM string
  11583. </p>
  11584. </dd>
  11585. <dt><samp class="option">key_pem=<var class="var">string</var></samp></dt>
  11586. <dd><p>Private key PEM string
  11587. </p>
  11588. </dd>
  11589. <dt><samp class="option">listen=<var class="var">1|0</var></samp></dt>
  11590. <dd><p>If enabled, listen for connections on the provided port, and assume
  11591. the server role in the handshake instead of the client role.
  11592. </p>
  11593. </dd>
  11594. <dt><samp class="option">mtu=<var class="var">size</var></samp></dt>
  11595. <dd><p>Set the Maximum Transmission Unit (MTU) for DTLS packets.
  11596. </p>
  11597. </dd>
  11598. <dt><samp class="option">use_srtp=<var class="var">1|0</var></samp></dt>
  11599. <dd><p>Enable the use_srtp DTLS extension.
  11600. This is used in WebRTC applications to establish SRTP encryption keys
  11601. through the DTLS handshake. Default is disabled.
  11602. </p>
  11603. </dd>
  11604. <dt><samp class="option">external_sock=<var class="var">1|0</var></samp></dt>
  11605. <dd><p>Use an external socket instead of creating a new one.
  11606. This option only makes sense to pass when interacting with the code via
  11607. API, enabling this from CLI will cause immediate failure.
  11608. Default is disabled.
  11609. </p>
  11610. </dd>
  11611. </dl>
  11612. <p>Example command lines:
  11613. </p>
  11614. <p>To create a DTLS server:
  11615. </p>
  11616. <div class="example">
  11617. <pre class="example-preformatted">ffmpeg -listen 1 -i dtls://<var class="var">hostname</var>:<var class="var">port</var> <var class="var">output</var>
  11618. </pre></div>
  11619. <p>To create a DTLS client and send data to server:
  11620. </p>
  11621. <div class="example">
  11622. <pre class="example-preformatted">ffmpeg -i <var class="var">input</var> -f <var class="var">format</var> dtls://<var class="var">hostname</var>:<var class="var">port</var>
  11623. </pre></div>
  11624. <a name="udp"></a>
  11625. <h3 class="section">18.44 udp<span class="pull-right"><a class="anchor hidden-xs" href="#udp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-udp" aria-hidden="true">TOC</a></span></h3>
  11626. <p>User Datagram Protocol.
  11627. </p>
  11628. <p>The required syntax for an UDP URL is:
  11629. </p><div class="example">
  11630. <pre class="example-preformatted">udp://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  11631. </pre></div>
  11632. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  11633. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  11634. space) can be used to escape keys and values.
  11635. </p>
  11636. <p>Options can also can be specified via command line options (or in code via
  11637. <code class="code">AVOption</code>s).
  11638. </p>
  11639. <p>In case threading is enabled on the system, a circular buffer is used
  11640. to store the incoming data, which allows one to reduce loss of data due to
  11641. UDP socket buffer overruns. The <var class="var">fifo_size</var> and
  11642. <var class="var">overrun_nonfatal</var> options are related to this buffer.
  11643. </p>
  11644. <p>The list of supported options follows.
  11645. </p>
  11646. <dl class="table">
  11647. <dt><samp class="option">buffer_size=<var class="var">size</var></samp></dt>
  11648. <dd><p>Set the UDP maximum socket buffer size in bytes. This is used to set either
  11649. the receive or send buffer size, depending on what the socket is used for.
  11650. Default is 32 KB for output, 384 KB for input. See also <var class="var">fifo_size</var>.
  11651. </p>
  11652. </dd>
  11653. <dt><samp class="option">bitrate=<var class="var">bitrate</var></samp></dt>
  11654. <dd><p>If set to nonzero, the output will have the specified constant bitrate if the
  11655. input has enough packets to sustain it.
  11656. </p>
  11657. </dd>
  11658. <dt><samp class="option">burst_bits=<var class="var">bits</var></samp></dt>
  11659. <dd><p>When using <var class="var">bitrate</var> this specifies the maximum number of bits in
  11660. packet bursts.
  11661. </p>
  11662. </dd>
  11663. <dt><samp class="option">localport=<var class="var">port</var></samp></dt>
  11664. <dd><p>Override the local UDP port to bind with.
  11665. </p>
  11666. </dd>
  11667. <dt><samp class="option">localaddr=<var class="var">addr</var></samp></dt>
  11668. <dd><p>Local IP address of a network interface used for sending packets or joining
  11669. multicast groups.
  11670. </p>
  11671. </dd>
  11672. <dt><samp class="option">pkt_size=<var class="var">size</var></samp></dt>
  11673. <dd><p>Set the size in bytes of UDP packets.
  11674. </p>
  11675. </dd>
  11676. <dt><samp class="option">reuse=<var class="var">1|0</var></samp></dt>
  11677. <dd><p>Explicitly allow or disallow reusing UDP sockets.
  11678. </p>
  11679. </dd>
  11680. <dt><samp class="option">ttl=<var class="var">ttl</var></samp></dt>
  11681. <dd><p>Set the time to live value (for multicast only).
  11682. </p>
  11683. </dd>
  11684. <dt><samp class="option">dscp=<var class="var">dscp</var></samp></dt>
  11685. <dd><p>Set the 6-bit DSCP field for outgoing packets.
  11686. </p>
  11687. </dd>
  11688. <dt><samp class="option">connect=<var class="var">1|0</var></samp></dt>
  11689. <dd><p>Initialize the UDP socket with <code class="code">connect()</code>. In this case, the
  11690. destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
  11691. If the destination address isn&rsquo;t known at the start, this option can
  11692. be specified in ff_udp_set_remote_url, too.
  11693. This allows finding out the source address for the packets with getsockname,
  11694. and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
  11695. unreachable&quot; is received.
  11696. For receiving, this gives the benefit of only receiving packets from
  11697. the specified peer address/port.
  11698. </p>
  11699. </dd>
  11700. <dt><samp class="option">sources=<var class="var">address</var>[,<var class="var">address</var>]</samp></dt>
  11701. <dd><p>Only receive packets sent from the specified addresses. In case of multicast,
  11702. also subscribe to multicast traffic coming from these addresses only.
  11703. </p>
  11704. </dd>
  11705. <dt><samp class="option">block=<var class="var">address</var>[,<var class="var">address</var>]</samp></dt>
  11706. <dd><p>Ignore packets sent from the specified addresses. In case of multicast, also
  11707. exclude the source addresses in the multicast subscription.
  11708. </p>
  11709. </dd>
  11710. <dt><samp class="option">fifo_size=<var class="var">units</var></samp></dt>
  11711. <dd><p>Set the UDP receiving circular buffer size, expressed as a number of
  11712. packets with size of 188 bytes. If not specified defaults to 7*4096.
  11713. </p>
  11714. </dd>
  11715. <dt><samp class="option">overrun_nonfatal=<var class="var">1|0</var></samp></dt>
  11716. <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
  11717. value is 0.
  11718. </p>
  11719. </dd>
  11720. <dt><samp class="option">timeout=<var class="var">microseconds</var></samp></dt>
  11721. <dd><p>Set raise error timeout, expressed in microseconds.
  11722. </p>
  11723. <p>This option is only relevant in read mode: if no data arrived in more
  11724. than this time interval, raise error.
  11725. </p>
  11726. </dd>
  11727. <dt><samp class="option">broadcast=<var class="var">1|0</var></samp></dt>
  11728. <dd><p>Explicitly allow or disallow UDP broadcasting.
  11729. </p>
  11730. <p>Note that broadcasting may not work properly on networks having
  11731. a broadcast storm protection.
  11732. </p></dd>
  11733. </dl>
  11734. <a name="Examples-9"></a>
  11735. <h4 class="subsection">18.44.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-9" aria-hidden="true">TOC</a></span></h4>
  11736. <ul class="itemize mark-bullet">
  11737. <li>Use <code class="command">ffmpeg</code> to stream over UDP to a remote endpoint:
  11738. <div class="example">
  11739. <pre class="example-preformatted">ffmpeg -i <var class="var">input</var> -f <var class="var">format</var> udp://<var class="var">hostname</var>:<var class="var">port</var>
  11740. </pre></div>
  11741. </li><li>Use <code class="command">ffmpeg</code> to stream in mpegts format over UDP using 188
  11742. sized UDP packets, using a large input buffer:
  11743. <div class="example">
  11744. <pre class="example-preformatted">ffmpeg -i <var class="var">input</var> -f mpegts udp://<var class="var">hostname</var>:<var class="var">port</var>?pkt_size=188&amp;buffer_size=65535
  11745. </pre></div>
  11746. </li><li>Use <code class="command">ffmpeg</code> to receive over UDP from a remote endpoint:
  11747. <div class="example">
  11748. <pre class="example-preformatted">ffmpeg -i udp://[<var class="var">multicast-address</var>]:<var class="var">port</var> ...
  11749. </pre></div>
  11750. </li></ul>
  11751. <a name="unix"></a>
  11752. <h3 class="section">18.45 unix<span class="pull-right"><a class="anchor hidden-xs" href="#unix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unix" aria-hidden="true">TOC</a></span></h3>
  11753. <p>Unix local socket
  11754. </p>
  11755. <p>The required syntax for a Unix socket URL is:
  11756. </p>
  11757. <div class="example">
  11758. <pre class="example-preformatted">unix://<var class="var">filepath</var>
  11759. </pre></div>
  11760. <p>The following parameters can be set via command line options
  11761. (or in code via <code class="code">AVOption</code>s):
  11762. </p>
  11763. <dl class="table">
  11764. <dt><samp class="option">timeout</samp></dt>
  11765. <dd><p>Timeout in ms.
  11766. </p></dd>
  11767. <dt><samp class="option">listen</samp></dt>
  11768. <dd><p>Create the Unix socket in listening mode.
  11769. </p></dd>
  11770. <dt><samp class="option">pkt_size</samp></dt>
  11771. <dd><p>Maximum packet size for packet-oriented sockets (SOCK_DGRAM and
  11772. SOCK_SEQPACKET). If greater than zero, this value is used as
  11773. <code class="code">max_packet_size</code>. Ignored for SOCK_STREAM. Default is <code class="code">0</code>.
  11774. </p></dd>
  11775. </dl>
  11776. <a name="zmq"></a>
  11777. <h3 class="section">18.46 zmq<span class="pull-right"><a class="anchor hidden-xs" href="#zmq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zmq" aria-hidden="true">TOC</a></span></h3>
  11778. <p>ZeroMQ asynchronous messaging using the libzmq library.
  11779. </p>
  11780. <p>This library supports unicast streaming to multiple clients without relying on
  11781. an external server.
  11782. </p>
  11783. <p>The required syntax for streaming or connecting to a stream is:
  11784. </p><div class="example">
  11785. <pre class="example-preformatted">zmq:tcp://ip-address:port
  11786. </pre></div>
  11787. <p>Example:
  11788. Create a localhost stream on port 5555:
  11789. </p><div class="example">
  11790. <pre class="example-preformatted">ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
  11791. </pre></div>
  11792. <p>Multiple clients may connect to the stream using:
  11793. </p><div class="example">
  11794. <pre class="example-preformatted">ffplay zmq:tcp://127.0.0.1:5555
  11795. </pre></div>
  11796. <p>Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern.
  11797. The server side binds to a port and publishes data. Clients connect to the
  11798. server (via IP address/port) and subscribe to the stream. The order in which
  11799. the server and client start generally does not matter.
  11800. </p>
  11801. <p>ffmpeg must be compiled with the &ndash;enable-libzmq option to support
  11802. this protocol.
  11803. </p>
  11804. <p>Options can be set on the <code class="command">ffmpeg</code>/<code class="command">ffplay</code> command
  11805. line. The following options are supported:
  11806. </p>
  11807. <dl class="table">
  11808. <dt><samp class="option">pkt_size</samp></dt>
  11809. <dd><p>Forces the maximum packet size for sending/receiving data. The default value is
  11810. 131,072 bytes. On the server side, this sets the maximum size of sent packets
  11811. via ZeroMQ. On the clients, it sets an internal buffer size for receiving
  11812. packets. Note that pkt_size on the clients should be equal to or greater than
  11813. pkt_size on the server. Otherwise the received message may be truncated causing
  11814. decoding errors.
  11815. </p>
  11816. </dd>
  11817. </dl>
  11818. <a name="Device-Options"></a>
  11819. <h2 class="chapter">19 Device Options<span class="pull-right"><a class="anchor hidden-xs" href="#Device-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Device-Options" aria-hidden="true">TOC</a></span></h2>
  11820. <p>The libavdevice library provides the same interface as
  11821. libavformat. Namely, an input device is considered like a demuxer, and
  11822. an output device like a muxer, and the interface and generic device
  11823. options are the same provided by libavformat (see the ffmpeg-formats
  11824. manual).
  11825. </p>
  11826. <p>In addition each input or output device may support so-called private
  11827. options, which are specific for that component.
  11828. </p>
  11829. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  11830. FFmpeg tools, or by setting the value explicitly in the device
  11831. <code class="code">AVFormatContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  11832. for programmatic use.
  11833. </p>
  11834. <a name="Input-Devices"></a>
  11835. <h2 class="chapter">20 Input Devices<span class="pull-right"><a class="anchor hidden-xs" href="#Input-Devices" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Input-Devices" aria-hidden="true">TOC</a></span></h2>
  11836. <p>Input devices are configured elements in FFmpeg which enable accessing
  11837. the data coming from a multimedia device attached to your system.
  11838. </p>
  11839. <p>When you configure your FFmpeg build, all the supported input devices
  11840. are enabled by default. You can list all available ones using the
  11841. configure option &quot;&ndash;list-indevs&quot;.
  11842. </p>
  11843. <p>You can disable all the input devices using the configure option
  11844. &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
  11845. option &quot;&ndash;enable-indev=<var class="var">INDEV</var>&quot;, or you can disable a particular
  11846. input device using the option &quot;&ndash;disable-indev=<var class="var">INDEV</var>&quot;.
  11847. </p>
  11848. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  11849. supported input devices.
  11850. </p>
  11851. <p>A description of the currently available input devices follows.
  11852. </p>
  11853. <a name="alsa"></a>
  11854. <h3 class="section">20.1 alsa<span class="pull-right"><a class="anchor hidden-xs" href="#alsa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alsa" aria-hidden="true">TOC</a></span></h3>
  11855. <p>ALSA (Advanced Linux Sound Architecture) input device.
  11856. </p>
  11857. <p>To enable this input device during configuration you need libasound
  11858. installed on your system.
  11859. </p>
  11860. <p>This device allows capturing from an ALSA device. The name of the
  11861. device to capture has to be an ALSA card identifier.
  11862. </p>
  11863. <p>An ALSA identifier has the syntax:
  11864. </p><div class="example">
  11865. <pre class="example-preformatted">hw:<var class="var">CARD</var>[,<var class="var">DEV</var>[,<var class="var">SUBDEV</var>]]
  11866. </pre></div>
  11867. <p>where the <var class="var">DEV</var> and <var class="var">SUBDEV</var> components are optional.
  11868. </p>
  11869. <p>The three arguments (in order: <var class="var">CARD</var>,<var class="var">DEV</var>,<var class="var">SUBDEV</var>)
  11870. specify card number or identifier, device number and subdevice number
  11871. (-1 means any).
  11872. </p>
  11873. <p>To see the list of cards currently recognized by your system check the
  11874. files <samp class="file">/proc/asound/cards</samp> and <samp class="file">/proc/asound/devices</samp>.
  11875. </p>
  11876. <p>For example to capture with <code class="command">ffmpeg</code> from an ALSA device with
  11877. card id 0, you may run the command:
  11878. </p><div class="example">
  11879. <pre class="example-preformatted">ffmpeg -f alsa -i hw:0 alsaout.wav
  11880. </pre></div>
  11881. <p>For more information see:
  11882. <a class="url" href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html">http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html</a>
  11883. </p>
  11884. <a name="Options-17"></a>
  11885. <h4 class="subsection">20.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-17" aria-hidden="true">TOC</a></span></h4>
  11886. <dl class="table">
  11887. <dt><samp class="option">sample_rate</samp></dt>
  11888. <dd><p>Set the sample rate in Hz. Default is 48000.
  11889. </p>
  11890. </dd>
  11891. <dt><samp class="option">channels</samp></dt>
  11892. <dd><p>Set the number of channels. Default is 2.
  11893. </p>
  11894. </dd>
  11895. </dl>
  11896. <a name="android_005fcamera"></a>
  11897. <h3 class="section">20.2 android_camera<span class="pull-right"><a class="anchor hidden-xs" href="#android_005fcamera" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-android_005fcamera" aria-hidden="true">TOC</a></span></h3>
  11898. <p>Android camera input device.
  11899. </p>
  11900. <p>This input devices uses the Android Camera2 NDK API which is
  11901. available on devices with API level 24+. The availability of
  11902. android_camera is autodetected during configuration.
  11903. </p>
  11904. <p>This device allows capturing from all cameras on an Android device,
  11905. which are integrated into the Camera2 NDK API.
  11906. </p>
  11907. <p>The available cameras are enumerated internally and can be selected
  11908. with the <var class="var">camera_index</var> parameter. The input file string is
  11909. discarded.
  11910. </p>
  11911. <p>Generally the back facing camera has index 0 while the front facing
  11912. camera has index 1.
  11913. </p>
  11914. <a name="Options-18"></a>
  11915. <h4 class="subsection">20.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-18" aria-hidden="true">TOC</a></span></h4>
  11916. <dl class="table">
  11917. <dt><samp class="option">video_size</samp></dt>
  11918. <dd><p>Set the video size given as a string such as 640x480 or hd720.
  11919. Falls back to the first available configuration reported by
  11920. Android if requested video size is not available or by default.
  11921. </p>
  11922. </dd>
  11923. <dt><samp class="option">framerate</samp></dt>
  11924. <dd><p>Set the video framerate.
  11925. Falls back to the first available configuration reported by
  11926. Android if requested framerate is not available or by default (-1).
  11927. </p>
  11928. </dd>
  11929. <dt><samp class="option">camera_index</samp></dt>
  11930. <dd><p>Set the index of the camera to use. Default is 0.
  11931. </p>
  11932. </dd>
  11933. <dt><samp class="option">input_queue_size</samp></dt>
  11934. <dd><p>Set the maximum number of frames to buffer. Default is 5.
  11935. </p>
  11936. </dd>
  11937. </dl>
  11938. <a name="avfoundation"></a>
  11939. <h3 class="section">20.3 avfoundation<span class="pull-right"><a class="anchor hidden-xs" href="#avfoundation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avfoundation" aria-hidden="true">TOC</a></span></h3>
  11940. <p>AVFoundation input device.
  11941. </p>
  11942. <p>AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX &gt;= 10.7 as well as on iOS.
  11943. </p>
  11944. <p>The input filename has to be given in the following syntax:
  11945. </p><div class="example">
  11946. <pre class="example-preformatted">-i &quot;[[VIDEO]:[AUDIO]]&quot;
  11947. </pre></div>
  11948. <p>The first entry selects the video input while the latter selects the audio input.
  11949. The stream has to be specified by the device name or the device index as shown by the device list.
  11950. Alternatively, the video and/or audio input device can be chosen by index using the
  11951. <samp class="option">
  11952. -video_device_index &lt;INDEX&gt;
  11953. </samp>
  11954. and/or
  11955. <samp class="option">
  11956. -audio_device_index &lt;INDEX&gt;
  11957. </samp>
  11958. , overriding any
  11959. device name or index given in the input filename.
  11960. </p>
  11961. <p>All available devices can be enumerated by using <samp class="option">-list_devices true</samp>, listing
  11962. all device names and corresponding indices.
  11963. </p>
  11964. <p>There are two device name aliases:
  11965. </p><dl class="table">
  11966. <dt><code class="code">default</code></dt>
  11967. <dd><p>Select the AVFoundation default device of the corresponding type.
  11968. </p>
  11969. </dd>
  11970. <dt><code class="code">none</code></dt>
  11971. <dd><p>Do not record the corresponding media type.
  11972. This is equivalent to specifying an empty device name or index.
  11973. </p>
  11974. </dd>
  11975. </dl>
  11976. <a name="Options-19"></a>
  11977. <h4 class="subsection">20.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-19" aria-hidden="true">TOC</a></span></h4>
  11978. <p>AVFoundation supports the following options:
  11979. </p>
  11980. <dl class="table">
  11981. <dt><samp class="option">-list_devices &lt;TRUE|FALSE&gt;</samp></dt>
  11982. <dd><p>If set to true, a list of all available input devices is given showing all
  11983. device names and indices.
  11984. </p>
  11985. </dd>
  11986. <dt><samp class="option">-video_device_index &lt;INDEX&gt;</samp></dt>
  11987. <dd><p>Specify the video device by its index. Overrides anything given in the input filename.
  11988. </p>
  11989. </dd>
  11990. <dt><samp class="option">-audio_device_index &lt;INDEX&gt;</samp></dt>
  11991. <dd><p>Specify the audio device by its index. Overrides anything given in the input filename.
  11992. </p>
  11993. </dd>
  11994. <dt><samp class="option">-pixel_format &lt;FORMAT&gt;</samp></dt>
  11995. <dd><p>Request the video device to use a specific pixel format.
  11996. If the specified format is not supported, a list of available formats is given
  11997. and the first one in this list is used instead. Available pixel formats are:
  11998. <code class="code">monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
  11999. bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
  12000. yuv420p, nv12, yuyv422, gray</code>
  12001. </p>
  12002. </dd>
  12003. <dt><samp class="option">-framerate</samp></dt>
  12004. <dd><p>Set the grabbing frame rate. Default is <code class="code">ntsc</code>, corresponding to a
  12005. frame rate of <code class="code">30000/1001</code>.
  12006. </p>
  12007. </dd>
  12008. <dt><samp class="option">-video_size</samp></dt>
  12009. <dd><p>Set the video frame size.
  12010. </p>
  12011. </dd>
  12012. <dt><samp class="option">-capture_cursor</samp></dt>
  12013. <dd><p>Capture the mouse pointer. Default is 0.
  12014. </p>
  12015. </dd>
  12016. <dt><samp class="option">-capture_mouse_clicks</samp></dt>
  12017. <dd><p>Capture the screen mouse clicks. Default is 0.
  12018. </p>
  12019. </dd>
  12020. <dt><samp class="option">-capture_raw_data</samp></dt>
  12021. <dd><p>Capture the raw device data. Default is 0.
  12022. Using this option may result in receiving the underlying data delivered to the AVFoundation framework. E.g. for muxed devices that sends raw DV data to the framework (like tape-based camcorders), setting this option to false results in extracted video frames captured in the designated pixel format only. Setting this option to true results in receiving the raw DV stream untouched.
  12023. </p></dd>
  12024. </dl>
  12025. <a name="Examples-10"></a>
  12026. <h4 class="subsection">20.3.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-10" aria-hidden="true">TOC</a></span></h4>
  12027. <ul class="itemize mark-bullet">
  12028. <li>Print the list of AVFoundation supported devices and exit:
  12029. <div class="example">
  12030. <pre class="example-preformatted">$ ffmpeg -f avfoundation -list_devices true -i &quot;&quot;
  12031. </pre></div>
  12032. </li><li>Record video from video device 0 and audio from audio device 0 into out.avi:
  12033. <div class="example">
  12034. <pre class="example-preformatted">$ ffmpeg -f avfoundation -i &quot;0:0&quot; out.avi
  12035. </pre></div>
  12036. </li><li>Record video from video device 2 and audio from audio device 1 into out.avi:
  12037. <div class="example">
  12038. <pre class="example-preformatted">$ ffmpeg -f avfoundation -video_device_index 2 -i &quot;:1&quot; out.avi
  12039. </pre></div>
  12040. </li><li>Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi:
  12041. <div class="example">
  12042. <pre class="example-preformatted">$ ffmpeg -f avfoundation -pixel_format bgr0 -i &quot;default:none&quot; out.avi
  12043. </pre></div>
  12044. </li><li>Record raw DV data from a suitable input device and write the output into out.dv:
  12045. <div class="example">
  12046. <pre class="example-preformatted">$ ffmpeg -f avfoundation -capture_raw_data true -i &quot;zr100:none&quot; out.dv
  12047. </pre></div>
  12048. </li></ul>
  12049. <a name="decklink"></a>
  12050. <h3 class="section">20.4 decklink<span class="pull-right"><a class="anchor hidden-xs" href="#decklink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decklink" aria-hidden="true">TOC</a></span></h3>
  12051. <p>The decklink input device provides capture capabilities for Blackmagic
  12052. DeckLink devices.
  12053. </p>
  12054. <p>To enable this input device, you need the Blackmagic DeckLink SDK and you
  12055. need to configure with the appropriate <code class="code">--extra-cflags</code>
  12056. and <code class="code">--extra-ldflags</code>.
  12057. On Windows, you need to run the IDL files through <code class="command">widl</code>.
  12058. </p>
  12059. <p>DeckLink is very picky about the formats it supports. Pixel format of the
  12060. input can be set with <samp class="option">raw_format</samp>.
  12061. Framerate and video size must be determined for your device with
  12062. <code class="command">-list_formats 1</code>. Audio sample rate is always 48 kHz and the number
  12063. of channels can be 2, 8 or 16. Note that all audio channels are bundled in one single
  12064. audio track.
  12065. </p>
  12066. <a name="Options-20"></a>
  12067. <h4 class="subsection">20.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-20" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-20" aria-hidden="true">TOC</a></span></h4>
  12068. <dl class="table">
  12069. <dt><samp class="option">list_devices</samp></dt>
  12070. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  12071. Defaults to <samp class="option">false</samp>. This option is deprecated, please use the
  12072. <code class="code">-sources</code> option of ffmpeg to list the available input devices.
  12073. </p>
  12074. </dd>
  12075. <dt><samp class="option">list_formats</samp></dt>
  12076. <dd><p>If set to <samp class="option">true</samp>, print a list of supported formats and exit.
  12077. Defaults to <samp class="option">false</samp>.
  12078. </p>
  12079. </dd>
  12080. <dt><samp class="option">format_code &lt;FourCC&gt;</samp></dt>
  12081. <dd><p>This sets the input video format to the format given by the FourCC. To see
  12082. the supported values of your device(s) use <samp class="option">list_formats</samp>.
  12083. Note that there is a FourCC <samp class="option">'pal '</samp> that can also be used
  12084. as <samp class="option">pal</samp> (3 letters).
  12085. Default behavior is autodetection of the input video format, if the hardware
  12086. supports it.
  12087. </p>
  12088. </dd>
  12089. <dt><samp class="option">raw_format</samp></dt>
  12090. <dd><p>Set the pixel format of the captured video.
  12091. Available values are:
  12092. </p><dl class="table">
  12093. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  12094. <dd>
  12095. <p>This is the default which means 8-bit YUV 422 or 8-bit ARGB if format
  12096. autodetection is used, 8-bit YUV 422 otherwise.
  12097. </p>
  12098. </dd>
  12099. <dt>&lsquo;<samp class="samp">uyvy422</samp>&rsquo;</dt>
  12100. <dd>
  12101. <p>8-bit YUV 422.
  12102. </p>
  12103. </dd>
  12104. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  12105. <dd>
  12106. <p>10-bit YUV 422.
  12107. </p>
  12108. </dd>
  12109. <dt>&lsquo;<samp class="samp">argb</samp>&rsquo;</dt>
  12110. <dd>
  12111. <p>8-bit RGB.
  12112. </p>
  12113. </dd>
  12114. <dt>&lsquo;<samp class="samp">bgra</samp>&rsquo;</dt>
  12115. <dd>
  12116. <p>8-bit RGB.
  12117. </p>
  12118. </dd>
  12119. <dt>&lsquo;<samp class="samp">rgb10</samp>&rsquo;</dt>
  12120. <dd>
  12121. <p>10-bit RGB.
  12122. </p>
  12123. </dd>
  12124. </dl>
  12125. </dd>
  12126. <dt><samp class="option">teletext_lines</samp></dt>
  12127. <dd><p>If set to nonzero, an additional teletext stream will be captured from the
  12128. vertical ancillary data. Both SD PAL (576i) and HD (1080i or 1080p)
  12129. sources are supported. In case of HD sources, OP47 packets are decoded.
  12130. </p>
  12131. <p>This option is a bitmask of the SD PAL VBI lines captured, specifically lines 6
  12132. to 22, and lines 318 to 335. Line 6 is the LSB in the mask. Selected lines
  12133. which do not contain teletext information will be ignored. You can use the
  12134. special <samp class="option">all</samp> constant to select all possible lines, or
  12135. <samp class="option">standard</samp> to skip lines 6, 318 and 319, which are not compatible with
  12136. all receivers.
  12137. </p>
  12138. <p>For SD sources, ffmpeg needs to be compiled with <code class="code">--enable-libzvbi</code>. For
  12139. HD sources, on older (pre-4K) DeckLink card models you have to capture in 10
  12140. bit mode.
  12141. </p>
  12142. </dd>
  12143. <dt><samp class="option">channels</samp></dt>
  12144. <dd><p>Defines number of audio channels to capture. Must be &lsquo;<samp class="samp">2</samp>&rsquo;, &lsquo;<samp class="samp">8</samp>&rsquo; or &lsquo;<samp class="samp">16</samp>&rsquo;.
  12145. Defaults to &lsquo;<samp class="samp">2</samp>&rsquo;.
  12146. </p>
  12147. </dd>
  12148. <dt><samp class="option">duplex_mode</samp></dt>
  12149. <dd><p>Sets the decklink device duplex/profile mode. Must be &lsquo;<samp class="samp">unset</samp>&rsquo;, &lsquo;<samp class="samp">half</samp>&rsquo;, &lsquo;<samp class="samp">full</samp>&rsquo;,
  12150. &lsquo;<samp class="samp">one_sub_device_full</samp>&rsquo;, &lsquo;<samp class="samp">one_sub_device_half</samp>&rsquo;, &lsquo;<samp class="samp">two_sub_device_full</samp>&rsquo;,
  12151. &lsquo;<samp class="samp">four_sub_device_half</samp>&rsquo;
  12152. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  12153. </p>
  12154. <p>Note: DeckLink SDK 11.0 have replaced the duplex property by a profile property.
  12155. For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2
  12156. sub-devices that utilize the same connectors. For the DeckLink 8K Pro, a profile
  12157. is shared between all 4 sub-devices. So DeckLink 8K Pro support four profiles.
  12158. </p>
  12159. <p>Valid profile modes for DeckLink 8K Pro(with DeckLink SDK &gt;= 11.0):
  12160. &lsquo;<samp class="samp">one_sub_device_full</samp>&rsquo;, &lsquo;<samp class="samp">one_sub_device_half</samp>&rsquo;, &lsquo;<samp class="samp">two_sub_device_full</samp>&rsquo;,
  12161. &lsquo;<samp class="samp">four_sub_device_half</samp>&rsquo;
  12162. </p>
  12163. <p>Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2:
  12164. &lsquo;<samp class="samp">half</samp>&rsquo;, &lsquo;<samp class="samp">full</samp>&rsquo;
  12165. </p>
  12166. </dd>
  12167. <dt><samp class="option">timecode_format</samp></dt>
  12168. <dd><p>Timecode type to include in the frame and video stream metadata. Must be
  12169. &lsquo;<samp class="samp">none</samp>&rsquo;, &lsquo;<samp class="samp">rp188vitc</samp>&rsquo;, &lsquo;<samp class="samp">rp188vitc2</samp>&rsquo;, &lsquo;<samp class="samp">rp188ltc</samp>&rsquo;,
  12170. &lsquo;<samp class="samp">rp188hfr</samp>&rsquo;, &lsquo;<samp class="samp">rp188any</samp>&rsquo;, &lsquo;<samp class="samp">vitc</samp>&rsquo;, &lsquo;<samp class="samp">vitc2</samp>&rsquo;, or &lsquo;<samp class="samp">serial</samp>&rsquo;.
  12171. Defaults to &lsquo;<samp class="samp">none</samp>&rsquo; (not included).
  12172. </p>
  12173. <p>In order to properly support 50/60 fps timecodes, the ordering of the queried
  12174. timecode types for &lsquo;<samp class="samp">rp188any</samp>&rsquo; is HFR, VITC1, VITC2 and LTC for &gt;30 fps
  12175. content. Note that this is slightly different to the ordering used by the
  12176. DeckLink API, which is HFR, VITC1, LTC, VITC2.
  12177. </p>
  12178. </dd>
  12179. <dt><samp class="option">video_input</samp></dt>
  12180. <dd><p>Sets the video input source. Must be &lsquo;<samp class="samp">unset</samp>&rsquo;, &lsquo;<samp class="samp">sdi</samp>&rsquo;, &lsquo;<samp class="samp">hdmi</samp>&rsquo;,
  12181. &lsquo;<samp class="samp">optical_sdi</samp>&rsquo;, &lsquo;<samp class="samp">component</samp>&rsquo;, &lsquo;<samp class="samp">composite</samp>&rsquo; or &lsquo;<samp class="samp">s_video</samp>&rsquo;.
  12182. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  12183. </p>
  12184. </dd>
  12185. <dt><samp class="option">audio_input</samp></dt>
  12186. <dd><p>Sets the audio input source. Must be &lsquo;<samp class="samp">unset</samp>&rsquo;, &lsquo;<samp class="samp">embedded</samp>&rsquo;,
  12187. &lsquo;<samp class="samp">aes_ebu</samp>&rsquo;, &lsquo;<samp class="samp">analog</samp>&rsquo;, &lsquo;<samp class="samp">analog_xlr</samp>&rsquo;, &lsquo;<samp class="samp">analog_rca</samp>&rsquo; or
  12188. &lsquo;<samp class="samp">microphone</samp>&rsquo;. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  12189. </p>
  12190. </dd>
  12191. <dt><samp class="option">video_pts</samp></dt>
  12192. <dd><p>Sets the video packet timestamp source. Must be &lsquo;<samp class="samp">video</samp>&rsquo;, &lsquo;<samp class="samp">audio</samp>&rsquo;,
  12193. &lsquo;<samp class="samp">reference</samp>&rsquo;, &lsquo;<samp class="samp">wallclock</samp>&rsquo; or &lsquo;<samp class="samp">abs_wallclock</samp>&rsquo;.
  12194. Defaults to &lsquo;<samp class="samp">video</samp>&rsquo;.
  12195. </p>
  12196. </dd>
  12197. <dt><samp class="option">audio_pts</samp></dt>
  12198. <dd><p>Sets the audio packet timestamp source. Must be &lsquo;<samp class="samp">video</samp>&rsquo;, &lsquo;<samp class="samp">audio</samp>&rsquo;,
  12199. &lsquo;<samp class="samp">reference</samp>&rsquo;, &lsquo;<samp class="samp">wallclock</samp>&rsquo; or &lsquo;<samp class="samp">abs_wallclock</samp>&rsquo;.
  12200. Defaults to &lsquo;<samp class="samp">audio</samp>&rsquo;.
  12201. </p>
  12202. </dd>
  12203. <dt><samp class="option">draw_bars</samp></dt>
  12204. <dd><p>If set to &lsquo;<samp class="samp">true</samp>&rsquo;, color bars are drawn in the event of a signal loss.
  12205. Defaults to &lsquo;<samp class="samp">true</samp>&rsquo;.
  12206. This option is deprecated, please use the <code class="code">signal_loss_action</code> option.
  12207. </p>
  12208. </dd>
  12209. <dt><samp class="option">signal_loss_action</samp></dt>
  12210. <dd><p>Sets the action to take in the event of a signal loss. Accepts one of the
  12211. following values:
  12212. </p>
  12213. <dl class="table">
  12214. <dt><samp class="option">1, none</samp></dt>
  12215. <dd><p>Do nothing on signal loss. This usually results in black frames.
  12216. </p></dd>
  12217. <dt><samp class="option">2, bars</samp></dt>
  12218. <dd><p>Draw color bars on signal loss. Only supported for 8-bit input signals.
  12219. </p></dd>
  12220. <dt><samp class="option">3, repeat</samp></dt>
  12221. <dd><p>Repeat the last video frame on signal loss.
  12222. </p></dd>
  12223. </dl>
  12224. <p>Defaults to &lsquo;<samp class="samp">bars</samp>&rsquo;.
  12225. </p>
  12226. </dd>
  12227. <dt><samp class="option">queue_size</samp></dt>
  12228. <dd><p>Sets maximum input buffer size in bytes. If the buffering reaches this value,
  12229. incoming frames will be dropped.
  12230. Defaults to &lsquo;<samp class="samp">1073741824</samp>&rsquo;.
  12231. </p>
  12232. </dd>
  12233. <dt><samp class="option">audio_depth</samp></dt>
  12234. <dd><p>Sets the audio sample bit depth. Must be &lsquo;<samp class="samp">16</samp>&rsquo; or &lsquo;<samp class="samp">32</samp>&rsquo;.
  12235. Defaults to &lsquo;<samp class="samp">16</samp>&rsquo;.
  12236. </p>
  12237. </dd>
  12238. <dt><samp class="option">decklink_copyts</samp></dt>
  12239. <dd><p>If set to <samp class="option">true</samp>, timestamps are forwarded as they are without removing
  12240. the initial offset.
  12241. Defaults to <samp class="option">false</samp>.
  12242. </p>
  12243. </dd>
  12244. <dt><samp class="option">timestamp_align</samp></dt>
  12245. <dd><p>Capture start time alignment in seconds. If set to nonzero, input frames are
  12246. dropped till the system timestamp aligns with configured value.
  12247. Alignment difference of up to one frame duration is tolerated.
  12248. This is useful for maintaining input synchronization across N different
  12249. hardware devices deployed for &rsquo;N-way&rsquo; redundancy. The system time of different
  12250. hardware devices should be synchronized with protocols such as NTP or PTP,
  12251. before using this option.
  12252. Note that this method is not foolproof. In some border cases input
  12253. synchronization may not happen due to thread scheduling jitters in the OS.
  12254. Either sync could go wrong by 1 frame or in a rarer case
  12255. <samp class="option">timestamp_align</samp> seconds.
  12256. Defaults to &lsquo;<samp class="samp">0</samp>&rsquo;.
  12257. </p>
  12258. </dd>
  12259. <dt><samp class="option">wait_for_tc (<em class="emph">bool</em>)</samp></dt>
  12260. <dd><p>Drop frames till a frame with timecode is received. Sometimes serial timecode
  12261. isn&rsquo;t received with the first input frame. If that happens, the stored stream
  12262. timecode will be inaccurate. If this option is set to <samp class="option">true</samp>, input frames
  12263. are dropped till a frame with timecode is received.
  12264. Option <var class="var">timecode_format</var> must be specified.
  12265. Defaults to <samp class="option">false</samp>.
  12266. </p>
  12267. </dd>
  12268. <dt><samp class="option">enable_klv(<em class="emph">bool</em>)</samp></dt>
  12269. <dd><p>If set to <samp class="option">true</samp>, extracts KLV data from VANC and outputs KLV packets.
  12270. KLV VANC packets are joined based on MID and PSC fields and aggregated into
  12271. one KLV packet.
  12272. Defaults to <samp class="option">false</samp>.
  12273. </p>
  12274. </dd>
  12275. </dl>
  12276. <a name="Examples-11"></a>
  12277. <h4 class="subsection">20.4.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-11" aria-hidden="true">TOC</a></span></h4>
  12278. <ul class="itemize mark-bullet">
  12279. <li>List input devices:
  12280. <div class="example">
  12281. <pre class="example-preformatted">ffmpeg -sources decklink
  12282. </pre></div>
  12283. </li><li>List supported formats:
  12284. <div class="example">
  12285. <pre class="example-preformatted">ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
  12286. </pre></div>
  12287. </li><li>Capture video clip at 1080i50:
  12288. <div class="example">
  12289. <pre class="example-preformatted">ffmpeg -format_code Hi50 -f decklink -i 'Intensity Pro' -c:a copy -c:v copy output.avi
  12290. </pre></div>
  12291. </li><li>Capture video clip at 1080i50 10 bit:
  12292. <div class="example">
  12293. <pre class="example-preformatted">ffmpeg -raw_format yuv422p10 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
  12294. </pre></div>
  12295. </li><li>Capture video clip at 1080i50 with 16 audio channels:
  12296. <div class="example">
  12297. <pre class="example-preformatted">ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
  12298. </pre></div>
  12299. </li></ul>
  12300. <a name="dshow"></a>
  12301. <h3 class="section">20.5 dshow<span class="pull-right"><a class="anchor hidden-xs" href="#dshow" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dshow" aria-hidden="true">TOC</a></span></h3>
  12302. <p>Windows DirectShow input device.
  12303. </p>
  12304. <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
  12305. Currently only audio and video devices are supported.
  12306. </p>
  12307. <p>Multiple devices may be opened as separate inputs, but they may also be
  12308. opened on the same input, which should improve synchronism between them.
  12309. </p>
  12310. <p>The input name should be in the format:
  12311. </p>
  12312. <div class="example">
  12313. <pre class="example-preformatted"><var class="var">TYPE</var>=<var class="var">NAME</var>[:<var class="var">TYPE</var>=<var class="var">NAME</var>]
  12314. </pre></div>
  12315. <p>where <var class="var">TYPE</var> can be either <var class="var">audio</var> or <var class="var">video</var>,
  12316. and <var class="var">NAME</var> is the device&rsquo;s name or alternative name..
  12317. </p>
  12318. <a name="Options-21"></a>
  12319. <h4 class="subsection">20.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-21" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-21" aria-hidden="true">TOC</a></span></h4>
  12320. <p>If no options are specified, the device&rsquo;s defaults are used.
  12321. If the device does not support the requested options, it will
  12322. fail to open.
  12323. </p>
  12324. <dl class="table">
  12325. <dt><samp class="option">video_size</samp></dt>
  12326. <dd><p>Set the video size in the captured video.
  12327. </p>
  12328. </dd>
  12329. <dt><samp class="option">framerate</samp></dt>
  12330. <dd><p>Set the frame rate in the captured video.
  12331. </p>
  12332. </dd>
  12333. <dt><samp class="option">sample_rate</samp></dt>
  12334. <dd><p>Set the sample rate (in Hz) of the captured audio.
  12335. </p>
  12336. </dd>
  12337. <dt><samp class="option">sample_size</samp></dt>
  12338. <dd><p>Set the sample size (in bits) of the captured audio.
  12339. </p>
  12340. </dd>
  12341. <dt><samp class="option">channels</samp></dt>
  12342. <dd><p>Set the number of channels in the captured audio.
  12343. </p>
  12344. </dd>
  12345. <dt><samp class="option">list_devices</samp></dt>
  12346. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  12347. </p>
  12348. </dd>
  12349. <dt><samp class="option">list_options</samp></dt>
  12350. <dd><p>If set to <samp class="option">true</samp>, print a list of selected device&rsquo;s options
  12351. and exit.
  12352. </p>
  12353. </dd>
  12354. <dt><samp class="option">video_device_number</samp></dt>
  12355. <dd><p>Set video device number for devices with the same name (starts at 0,
  12356. defaults to 0).
  12357. </p>
  12358. </dd>
  12359. <dt><samp class="option">audio_device_number</samp></dt>
  12360. <dd><p>Set audio device number for devices with the same name (starts at 0,
  12361. defaults to 0).
  12362. </p>
  12363. </dd>
  12364. <dt><samp class="option">pixel_format</samp></dt>
  12365. <dd><p>Select pixel format to be used by DirectShow. This may only be set when
  12366. the video codec is not set or set to rawvideo.
  12367. </p>
  12368. </dd>
  12369. <dt><samp class="option">audio_buffer_size</samp></dt>
  12370. <dd><p>Set audio device buffer size in milliseconds (which can directly
  12371. impact latency, depending on the device).
  12372. Defaults to using the audio device&rsquo;s
  12373. default buffer size (typically some multiple of 500ms).
  12374. Setting this value too low can degrade performance.
  12375. See also
  12376. <a class="url" href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx</a>
  12377. </p>
  12378. </dd>
  12379. <dt><samp class="option">video_pin_name</samp></dt>
  12380. <dd><p>Select video capture pin to use by name or alternative name.
  12381. </p>
  12382. </dd>
  12383. <dt><samp class="option">audio_pin_name</samp></dt>
  12384. <dd><p>Select audio capture pin to use by name or alternative name.
  12385. </p>
  12386. </dd>
  12387. <dt><samp class="option">crossbar_video_input_pin_number</samp></dt>
  12388. <dd><p>Select video input pin number for crossbar device. This will be
  12389. routed to the crossbar device&rsquo;s Video Decoder output pin.
  12390. Note that changing this value can affect future invocations
  12391. (sets a new default) until system reboot occurs.
  12392. </p>
  12393. </dd>
  12394. <dt><samp class="option">crossbar_audio_input_pin_number</samp></dt>
  12395. <dd><p>Select audio input pin number for crossbar device. This will be
  12396. routed to the crossbar device&rsquo;s Audio Decoder output pin.
  12397. Note that changing this value can affect future invocations
  12398. (sets a new default) until system reboot occurs.
  12399. </p>
  12400. </dd>
  12401. <dt><samp class="option">show_video_device_dialog</samp></dt>
  12402. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display dialog
  12403. to the end user, allowing them to change video filter properties
  12404. and configurations manually.
  12405. Note that for crossbar devices, adjusting values in this dialog
  12406. may be needed at times to toggle between PAL (25 fps) and NTSC (29.97)
  12407. input frame rates, sizes, interlacing, etc. Changing these values can
  12408. enable different scan rates/frame rates and avoiding green bars at
  12409. the bottom, flickering scan lines, etc.
  12410. Note that with some devices, changing these properties can also affect future
  12411. invocations (sets new defaults) until system reboot occurs.
  12412. </p>
  12413. </dd>
  12414. <dt><samp class="option">show_audio_device_dialog</samp></dt>
  12415. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display dialog
  12416. to the end user, allowing them to change audio filter properties
  12417. and configurations manually.
  12418. </p>
  12419. </dd>
  12420. <dt><samp class="option">show_video_crossbar_connection_dialog</samp></dt>
  12421. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  12422. dialog to the end user, allowing them to manually
  12423. modify crossbar pin routings, when it opens a video device.
  12424. </p>
  12425. </dd>
  12426. <dt><samp class="option">show_audio_crossbar_connection_dialog</samp></dt>
  12427. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  12428. dialog to the end user, allowing them to manually
  12429. modify crossbar pin routings, when it opens an audio device.
  12430. </p>
  12431. </dd>
  12432. <dt><samp class="option">show_analog_tv_tuner_dialog</samp></dt>
  12433. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  12434. dialog to the end user, allowing them to manually
  12435. modify TV channels and frequencies.
  12436. </p>
  12437. </dd>
  12438. <dt><samp class="option">show_analog_tv_tuner_audio_dialog</samp></dt>
  12439. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  12440. dialog to the end user, allowing them to manually
  12441. modify TV audio (like mono vs. stereo, Language A,B or C).
  12442. </p>
  12443. </dd>
  12444. <dt><samp class="option">audio_device_load</samp></dt>
  12445. <dd><p>Load an audio capture filter device from file instead of searching
  12446. it by name. It may load additional parameters too, if the filter
  12447. supports the serialization of its properties to.
  12448. To use this an audio capture source has to be specified, but it can
  12449. be anything even fake one.
  12450. </p>
  12451. </dd>
  12452. <dt><samp class="option">audio_device_save</samp></dt>
  12453. <dd><p>Save the currently used audio capture filter device and its
  12454. parameters (if the filter supports it) to a file.
  12455. If a file with the same name exists it will be overwritten.
  12456. </p>
  12457. </dd>
  12458. <dt><samp class="option">video_device_load</samp></dt>
  12459. <dd><p>Load a video capture filter device from file instead of searching
  12460. it by name. It may load additional parameters too, if the filter
  12461. supports the serialization of its properties to.
  12462. To use this a video capture source has to be specified, but it can
  12463. be anything even fake one.
  12464. </p>
  12465. </dd>
  12466. <dt><samp class="option">video_device_save</samp></dt>
  12467. <dd><p>Save the currently used video capture filter device and its
  12468. parameters (if the filter supports it) to a file.
  12469. If a file with the same name exists it will be overwritten.
  12470. </p>
  12471. </dd>
  12472. <dt><samp class="option">use_video_device_timestamps</samp></dt>
  12473. <dd><p>If set to <samp class="option">false</samp>, the timestamp for video frames will be
  12474. derived from the wallclock instead of the timestamp provided by
  12475. the capture device. This allows working around devices that
  12476. provide unreliable timestamps.
  12477. </p>
  12478. </dd>
  12479. </dl>
  12480. <a name="Examples-12"></a>
  12481. <h4 class="subsection">20.5.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-12" aria-hidden="true">TOC</a></span></h4>
  12482. <ul class="itemize mark-bullet">
  12483. <li>Print the list of DirectShow supported devices and exit:
  12484. <div class="example">
  12485. <pre class="example-preformatted">$ ffmpeg -list_devices true -f dshow -i dummy
  12486. </pre></div>
  12487. </li><li>Open video device <var class="var">Camera</var>:
  12488. <div class="example">
  12489. <pre class="example-preformatted">$ ffmpeg -f dshow -i video=&quot;Camera&quot;
  12490. </pre></div>
  12491. </li><li>Open second video device with name <var class="var">Camera</var>:
  12492. <div class="example">
  12493. <pre class="example-preformatted">$ ffmpeg -f dshow -video_device_number 1 -i video=&quot;Camera&quot;
  12494. </pre></div>
  12495. </li><li>Open video device <var class="var">Camera</var> and audio device <var class="var">Microphone</var>:
  12496. <div class="example">
  12497. <pre class="example-preformatted">$ ffmpeg -f dshow -i video=&quot;Camera&quot;:audio=&quot;Microphone&quot;
  12498. </pre></div>
  12499. </li><li>Print the list of supported options in selected device and exit:
  12500. <div class="example">
  12501. <pre class="example-preformatted">$ ffmpeg -list_options true -f dshow -i video=&quot;Camera&quot;
  12502. </pre></div>
  12503. </li><li>Specify pin names to capture by name or alternative name, specify alternative device name:
  12504. <div class="example">
  12505. <pre class="example-preformatted">$ ffmpeg -f dshow -audio_pin_name &quot;Audio Out&quot; -video_pin_name 2 -i video=video=&quot;@device_pnp_\\?\pci#ven_1a0a&amp;dev_6200&amp;subsys_62021461&amp;rev_01#4&amp;e2c7dd6&amp;0&amp;00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}&quot;:audio=&quot;Microphone&quot;
  12506. </pre></div>
  12507. </li><li>Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup:
  12508. <div class="example">
  12509. <pre class="example-preformatted">$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
  12510. -crossbar_audio_input_pin_number 3 -i video=&quot;AVerMedia BDA Analog Capture&quot;:audio=&quot;AVerMedia BDA Analog Capture&quot;
  12511. </pre></div>
  12512. </li></ul>
  12513. <a name="fbdev"></a>
  12514. <h3 class="section">20.6 fbdev<span class="pull-right"><a class="anchor hidden-xs" href="#fbdev" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fbdev" aria-hidden="true">TOC</a></span></h3>
  12515. <p>Linux framebuffer input device.
  12516. </p>
  12517. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  12518. layer to show graphics on a computer monitor, typically on the
  12519. console. It is accessed through a file device node, usually
  12520. <samp class="file">/dev/fb0</samp>.
  12521. </p>
  12522. <p>For more detailed information read the file
  12523. Documentation/fb/framebuffer.txt included in the Linux source tree.
  12524. </p>
  12525. <p>See also <a class="url" href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  12526. </p>
  12527. <p>To record from the framebuffer device <samp class="file">/dev/fb0</samp> with
  12528. <code class="command">ffmpeg</code>:
  12529. </p><div class="example">
  12530. <pre class="example-preformatted">ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
  12531. </pre></div>
  12532. <p>You can take a single screenshot image with the command:
  12533. </p><div class="example">
  12534. <pre class="example-preformatted">ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
  12535. </pre></div>
  12536. <a name="Options-22"></a>
  12537. <h4 class="subsection">20.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-22" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-22" aria-hidden="true">TOC</a></span></h4>
  12538. <dl class="table">
  12539. <dt><samp class="option">framerate</samp></dt>
  12540. <dd><p>Set the frame rate. Default is 25.
  12541. </p>
  12542. </dd>
  12543. </dl>
  12544. <a name="gdigrab"></a>
  12545. <h3 class="section">20.7 gdigrab<span class="pull-right"><a class="anchor hidden-xs" href="#gdigrab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gdigrab" aria-hidden="true">TOC</a></span></h3>
  12546. <p>Win32 GDI-based screen capture device.
  12547. </p>
  12548. <p>This device allows you to capture a region of the display on Windows.
  12549. </p>
  12550. <p>Amongst options for the input filenames are such elements as:
  12551. </p><div class="example">
  12552. <pre class="example-preformatted">desktop
  12553. </pre></div>
  12554. <p>or
  12555. </p><div class="example">
  12556. <pre class="example-preformatted">title=<var class="var">window_title</var>
  12557. </pre></div>
  12558. <p>or
  12559. </p><div class="example">
  12560. <pre class="example-preformatted">hwnd=<var class="var">window_hwnd</var>
  12561. </pre></div>
  12562. <p>The first option will capture the entire desktop, or a fixed region of the
  12563. desktop. The second and third options will instead capture the contents of a single
  12564. window, regardless of its position on the screen.
  12565. </p>
  12566. <p>For example, to grab the entire desktop using <code class="command">ffmpeg</code>:
  12567. </p><div class="example">
  12568. <pre class="example-preformatted">ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
  12569. </pre></div>
  12570. <p>Grab a 640x480 region at position <code class="code">10,20</code>:
  12571. </p><div class="example">
  12572. <pre class="example-preformatted">ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
  12573. </pre></div>
  12574. <p>Grab the contents of the window named &quot;Calculator&quot;
  12575. </p><div class="example">
  12576. <pre class="example-preformatted">ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
  12577. </pre></div>
  12578. <a name="Options-23"></a>
  12579. <h4 class="subsection">20.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-23" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-23" aria-hidden="true">TOC</a></span></h4>
  12580. <dl class="table">
  12581. <dt><samp class="option">draw_mouse</samp></dt>
  12582. <dd><p>Specify whether to draw the mouse pointer. Use the value <code class="code">0</code> to
  12583. not draw the pointer. Default value is <code class="code">1</code>.
  12584. </p>
  12585. </dd>
  12586. <dt><samp class="option">framerate</samp></dt>
  12587. <dd><p>Set the grabbing frame rate. Default value is <code class="code">ntsc</code>,
  12588. corresponding to a frame rate of <code class="code">30000/1001</code>.
  12589. </p>
  12590. </dd>
  12591. <dt><samp class="option">show_region</samp></dt>
  12592. <dd><p>Show grabbed region on screen.
  12593. </p>
  12594. <p>If <var class="var">show_region</var> is specified with <code class="code">1</code>, then the grabbing
  12595. region will be indicated on screen. With this option, it is easy to
  12596. know what is being grabbed if only a portion of the screen is grabbed.
  12597. </p>
  12598. <p>Note that <var class="var">show_region</var> is incompatible with grabbing the contents
  12599. of a single window.
  12600. </p>
  12601. <p>For example:
  12602. </p><div class="example">
  12603. <pre class="example-preformatted">ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
  12604. </pre></div>
  12605. </dd>
  12606. <dt><samp class="option">video_size</samp></dt>
  12607. <dd><p>Set the video frame size. The default is to capture the full screen if <samp class="file">desktop</samp> is selected, or the full window size if <samp class="file">title=<var class="var">window_title</var></samp> is selected.
  12608. </p>
  12609. </dd>
  12610. <dt><samp class="option">offset_x</samp></dt>
  12611. <dd><p>When capturing a region with <var class="var">video_size</var>, set the distance from the left edge of the screen or desktop.
  12612. </p>
  12613. <p>Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned to the left of your primary monitor, you will need to use a negative <var class="var">offset_x</var> value to move the region to that monitor.
  12614. </p>
  12615. </dd>
  12616. <dt><samp class="option">offset_y</samp></dt>
  12617. <dd><p>When capturing a region with <var class="var">video_size</var>, set the distance from the top edge of the screen or desktop.
  12618. </p>
  12619. <p>Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned above your primary monitor, you will need to use a negative <var class="var">offset_y</var> value to move the region to that monitor.
  12620. </p>
  12621. </dd>
  12622. </dl>
  12623. <a name="iec61883"></a>
  12624. <h3 class="section">20.8 iec61883<span class="pull-right"><a class="anchor hidden-xs" href="#iec61883" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-iec61883" aria-hidden="true">TOC</a></span></h3>
  12625. <p>FireWire DV/HDV input device using libiec61883.
  12626. </p>
  12627. <p>To enable this input device, you need libiec61883, libraw1394 and
  12628. libavc1394 installed on your system. Use the configure option
  12629. <code class="code">--enable-libiec61883</code> to compile with the device enabled.
  12630. </p>
  12631. <p>The iec61883 capture device supports capturing from a video device
  12632. connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
  12633. FireWire stack (juju). This is the default DV/HDV input method in Linux
  12634. Kernel 2.6.37 and later, since the old FireWire stack was removed.
  12635. </p>
  12636. <p>Specify the FireWire port to be used as input file, or &quot;auto&quot;
  12637. to choose the first port connected.
  12638. </p>
  12639. <a name="Options-24"></a>
  12640. <h4 class="subsection">20.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-24" aria-hidden="true">TOC</a></span></h4>
  12641. <dl class="table">
  12642. <dt><samp class="option">dvtype</samp></dt>
  12643. <dd><p>Override autodetection of DV/HDV. This should only be used if auto
  12644. detection does not work, or if usage of a different device type
  12645. should be prohibited. Treating a DV device as HDV (or vice versa) will
  12646. not work and result in undefined behavior.
  12647. The values <samp class="option">auto</samp>, <samp class="option">dv</samp> and <samp class="option">hdv</samp> are supported.
  12648. </p>
  12649. </dd>
  12650. <dt><samp class="option">dvbuffer</samp></dt>
  12651. <dd><p>Set maximum size of buffer for incoming data, in frames. For DV, this
  12652. is an exact value. For HDV, it is not frame exact, since HDV does
  12653. not have a fixed frame size.
  12654. </p>
  12655. </dd>
  12656. <dt><samp class="option">dvguid</samp></dt>
  12657. <dd><p>Select the capture device by specifying its GUID. Capturing will only
  12658. be performed from the specified device and fails if no device with the
  12659. given GUID is found. This is useful to select the input if multiple
  12660. devices are connected at the same time.
  12661. Look at /sys/bus/firewire/devices to find out the GUIDs.
  12662. </p>
  12663. </dd>
  12664. </dl>
  12665. <a name="Examples-13"></a>
  12666. <h4 class="subsection">20.8.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-13" aria-hidden="true">TOC</a></span></h4>
  12667. <ul class="itemize mark-bullet">
  12668. <li>Grab and show the input of a FireWire DV/HDV device.
  12669. <div class="example">
  12670. <pre class="example-preformatted">ffplay -f iec61883 -i auto
  12671. </pre></div>
  12672. </li><li>Grab and record the input of a FireWire DV/HDV device,
  12673. using a packet buffer of 100000 packets if the source is HDV.
  12674. <div class="example">
  12675. <pre class="example-preformatted">ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
  12676. </pre></div>
  12677. </li></ul>
  12678. <a name="jack"></a>
  12679. <h3 class="section">20.9 jack<span class="pull-right"><a class="anchor hidden-xs" href="#jack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-jack" aria-hidden="true">TOC</a></span></h3>
  12680. <p>JACK input device.
  12681. </p>
  12682. <p>To enable this input device during configuration you need libjack
  12683. installed on your system.
  12684. </p>
  12685. <p>A JACK input device creates one or more JACK writable clients, one for
  12686. each audio channel, with name <var class="var">client_name</var>:input_<var class="var">N</var>, where
  12687. <var class="var">client_name</var> is the name provided by the application, and <var class="var">N</var>
  12688. is a number which identifies the channel.
  12689. Each writable client will send the acquired data to the FFmpeg input
  12690. device.
  12691. </p>
  12692. <p>Once you have created one or more JACK readable clients, you need to
  12693. connect them to one or more JACK writable clients.
  12694. </p>
  12695. <p>To connect or disconnect JACK clients you can use the <code class="command">jack_connect</code>
  12696. and <code class="command">jack_disconnect</code> programs, or do it through a graphical interface,
  12697. for example with <code class="command">qjackctl</code>.
  12698. </p>
  12699. <p>To list the JACK clients and their properties you can invoke the command
  12700. <code class="command">jack_lsp</code>.
  12701. </p>
  12702. <p>Follows an example which shows how to capture a JACK readable client
  12703. with <code class="command">ffmpeg</code>.
  12704. </p><div class="example">
  12705. <pre class="example-preformatted"># Create a JACK writable client with name &quot;ffmpeg&quot;.
  12706. $ ffmpeg -f jack -i ffmpeg -y out.wav
  12707. # Start the sample jack_metro readable client.
  12708. $ jack_metro -b 120 -d 0.2 -f 4000
  12709. # List the current JACK clients.
  12710. $ jack_lsp -c
  12711. system:capture_1
  12712. system:capture_2
  12713. system:playback_1
  12714. system:playback_2
  12715. ffmpeg:input_1
  12716. metro:120_bpm
  12717. # Connect metro to the ffmpeg writable client.
  12718. $ jack_connect metro:120_bpm ffmpeg:input_1
  12719. </pre></div>
  12720. <p>For more information read:
  12721. <a class="url" href="http://jackaudio.org/">http://jackaudio.org/</a>
  12722. </p>
  12723. <a name="Options-25"></a>
  12724. <h4 class="subsection">20.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-25" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-25" aria-hidden="true">TOC</a></span></h4>
  12725. <dl class="table">
  12726. <dt><samp class="option">channels</samp></dt>
  12727. <dd><p>Set the number of channels. Default is 2.
  12728. </p>
  12729. </dd>
  12730. </dl>
  12731. <a name="kmsgrab"></a>
  12732. <h3 class="section">20.10 kmsgrab<span class="pull-right"><a class="anchor hidden-xs" href="#kmsgrab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kmsgrab" aria-hidden="true">TOC</a></span></h3>
  12733. <p>KMS video input device.
  12734. </p>
  12735. <p>Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a
  12736. DRM object that can be passed to other hardware functions.
  12737. </p>
  12738. <p>Requires either DRM master or CAP_SYS_ADMIN to run.
  12739. </p>
  12740. <p>If you don&rsquo;t understand what all of that means, you probably don&rsquo;t want this. Look at
  12741. <samp class="option">x11grab</samp> instead.
  12742. </p>
  12743. <a name="Options-26"></a>
  12744. <h4 class="subsection">20.10.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-26" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-26" aria-hidden="true">TOC</a></span></h4>
  12745. <dl class="table">
  12746. <dt><samp class="option">device</samp></dt>
  12747. <dd><p>DRM device to capture on. Defaults to <samp class="option">/dev/dri/card0</samp>.
  12748. </p>
  12749. </dd>
  12750. <dt><samp class="option">format</samp></dt>
  12751. <dd><p>Pixel format of the framebuffer. This can be autodetected if you are running Linux 5.7
  12752. or later, but needs to be provided for earlier versions. Defaults to <samp class="option">bgr0</samp>,
  12753. which is the most common format used by the Linux console and Xorg X server.
  12754. </p>
  12755. </dd>
  12756. <dt><samp class="option">format_modifier</samp></dt>
  12757. <dd><p>Format modifier to signal on output frames. This is necessary to import correctly into
  12758. some APIs. It can be autodetected if you are running Linux 5.7 or later, but will need
  12759. to be provided explicitly when needed in earlier versions. See the libdrm documentation
  12760. for possible values.
  12761. </p>
  12762. </dd>
  12763. <dt><samp class="option">crtc_id</samp></dt>
  12764. <dd><p>KMS CRTC ID to define the capture source. The first active plane on the given CRTC
  12765. will be used.
  12766. </p>
  12767. </dd>
  12768. <dt><samp class="option">plane_id</samp></dt>
  12769. <dd><p>KMS plane ID to define the capture source. Defaults to the first active plane found if
  12770. neither <samp class="option">crtc_id</samp> nor <samp class="option">plane_id</samp> are specified.
  12771. </p>
  12772. </dd>
  12773. <dt><samp class="option">framerate</samp></dt>
  12774. <dd><p>Framerate to capture at. This is not synchronised to any page flipping or framebuffer
  12775. changes - it just defines the interval at which the framebuffer is sampled. Sampling
  12776. faster than the framebuffer update rate will generate independent frames with the same
  12777. content. Defaults to <code class="code">30</code>.
  12778. </p>
  12779. </dd>
  12780. </dl>
  12781. <a name="Examples-14"></a>
  12782. <h4 class="subsection">20.10.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-14" aria-hidden="true">TOC</a></span></h4>
  12783. <ul class="itemize mark-bullet">
  12784. <li>Capture from the first active plane, download the result to normal frames and encode.
  12785. This will only work if the framebuffer is both linear and mappable - if not, the result
  12786. may be scrambled or fail to download.
  12787. <div class="example">
  12788. <pre class="example-preformatted">ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
  12789. </pre></div>
  12790. </li><li>Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and encode as H.264.
  12791. <div class="example">
  12792. <pre class="example-preformatted">ffmpeg -crtc_id 42 -framerate 60 -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' -c:v h264_vaapi output.mp4
  12793. </pre></div>
  12794. </li><li>To capture only part of a plane the output can be cropped - this can be used to capture
  12795. a single window, as long as it has a known absolute position and size. For example, to
  12796. capture and encode the middle quarter of a 1920x1080 plane:
  12797. <div class="example">
  12798. <pre class="example-preformatted">ffmpeg -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,crop=960:540:480:270,scale_vaapi=960:540:nv12' -c:v h264_vaapi output.mp4
  12799. </pre></div>
  12800. </li></ul>
  12801. <a name="lavfi"></a>
  12802. <h3 class="section">20.11 lavfi<span class="pull-right"><a class="anchor hidden-xs" href="#lavfi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lavfi" aria-hidden="true">TOC</a></span></h3>
  12803. <p>Libavfilter input virtual device.
  12804. </p>
  12805. <p>This input device reads data from the open output pads of a libavfilter
  12806. filtergraph.
  12807. </p>
  12808. <p>For each filtergraph open output, the input device will create a
  12809. corresponding stream which is mapped to the generated output.
  12810. The filtergraph is specified through the option <samp class="option">graph</samp>.
  12811. </p>
  12812. <a name="Options-27"></a>
  12813. <h4 class="subsection">20.11.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-27" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-27" aria-hidden="true">TOC</a></span></h4>
  12814. <dl class="table">
  12815. <dt><samp class="option">graph</samp></dt>
  12816. <dd><p>Specify the filtergraph to use as input. Each video open output must be
  12817. labelled by a unique string of the form &quot;out<var class="var">N</var>&quot;, where <var class="var">N</var> is a
  12818. number starting from 0 corresponding to the mapped input stream
  12819. generated by the device.
  12820. The first unlabelled output is automatically assigned to the &quot;out0&quot;
  12821. label, but all the others need to be specified explicitly.
  12822. </p>
  12823. <p>The suffix &quot;+subcc&quot; can be appended to the output label to create an extra
  12824. stream with the closed captions packets attached to that output
  12825. (experimental; only for EIA-608 / CEA-708 for now).
  12826. The subcc streams are created after all the normal streams, in the order of
  12827. the corresponding stream.
  12828. For example, if there is &quot;out19+subcc&quot;, &quot;out7+subcc&quot; and up to &quot;out42&quot;, the
  12829. stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
  12830. </p>
  12831. <p>If not specified defaults to the filename specified for the input
  12832. device.
  12833. </p>
  12834. </dd>
  12835. <dt><samp class="option">graph_file</samp></dt>
  12836. <dd><p>Set the filename of the filtergraph to be read and sent to the other
  12837. filters. Syntax of the filtergraph is the same as the one specified by
  12838. the option <var class="var">graph</var>.
  12839. </p>
  12840. </dd>
  12841. <dt><samp class="option">dumpgraph</samp></dt>
  12842. <dd><p>Dump graph to stderr.
  12843. </p>
  12844. </dd>
  12845. </dl>
  12846. <a name="Examples-15"></a>
  12847. <h4 class="subsection">20.11.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-15" aria-hidden="true">TOC</a></span></h4>
  12848. <ul class="itemize mark-bullet">
  12849. <li>Create a color video stream and play it back with <code class="command">ffplay</code>:
  12850. <div class="example">
  12851. <pre class="example-preformatted">ffplay -f lavfi -graph &quot;color=c=pink [out0]&quot; dummy
  12852. </pre></div>
  12853. </li><li>As the previous example, but use filename for specifying the graph
  12854. description, and omit the &quot;out0&quot; label:
  12855. <div class="example">
  12856. <pre class="example-preformatted">ffplay -f lavfi color=c=pink
  12857. </pre></div>
  12858. </li><li>Create three different video test filtered sources and play them:
  12859. <div class="example">
  12860. <pre class="example-preformatted">ffplay -f lavfi -graph &quot;testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]&quot; test3
  12861. </pre></div>
  12862. </li><li>Read an audio stream from a file using the amovie source and play it
  12863. back with <code class="command">ffplay</code>:
  12864. <div class="example">
  12865. <pre class="example-preformatted">ffplay -f lavfi &quot;amovie=test.wav&quot;
  12866. </pre></div>
  12867. </li><li>Read an audio stream and a video stream and play it back with
  12868. <code class="command">ffplay</code>:
  12869. <div class="example">
  12870. <pre class="example-preformatted">ffplay -f lavfi &quot;movie=test.avi[out0];amovie=test.wav[out1]&quot;
  12871. </pre></div>
  12872. </li><li>Dump decoded frames to images and Closed Captions to an RCWT backup:
  12873. <div class="example">
  12874. <pre class="example-preformatted">ffmpeg -f lavfi -i &quot;movie=test.ts[out0+subcc]&quot; -map v frame%08d.png -map s -c copy -f rcwt subcc.bin
  12875. </pre></div>
  12876. </li></ul>
  12877. <a name="libcdio"></a>
  12878. <h3 class="section">20.12 libcdio<span class="pull-right"><a class="anchor hidden-xs" href="#libcdio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libcdio" aria-hidden="true">TOC</a></span></h3>
  12879. <p>Audio-CD input device based on libcdio.
  12880. </p>
  12881. <p>To enable this input device during configuration you need libcdio
  12882. installed on your system. It requires the configure option
  12883. <code class="code">--enable-libcdio</code>.
  12884. </p>
  12885. <p>This device allows playing and grabbing from an Audio-CD.
  12886. </p>
  12887. <p>For example to copy with <code class="command">ffmpeg</code> the entire Audio-CD in <samp class="file">/dev/sr0</samp>,
  12888. you may run the command:
  12889. </p><div class="example">
  12890. <pre class="example-preformatted">ffmpeg -f libcdio -i /dev/sr0 cd.wav
  12891. </pre></div>
  12892. <a name="Options-28"></a>
  12893. <h4 class="subsection">20.12.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-28" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-28" aria-hidden="true">TOC</a></span></h4>
  12894. <dl class="table">
  12895. <dt><samp class="option">speed</samp></dt>
  12896. <dd><p>Set drive reading speed. Default value is 0.
  12897. </p>
  12898. <p>The speed is specified CD-ROM speed units. The speed is set through
  12899. the libcdio <code class="code">cdio_cddap_speed_set</code> function. On many CD-ROM
  12900. drives, specifying a value too large will result in using the fastest
  12901. speed.
  12902. </p>
  12903. </dd>
  12904. <dt><samp class="option">paranoia_mode</samp></dt>
  12905. <dd><p>Set paranoia recovery mode flags. It accepts one of the following values:
  12906. </p>
  12907. <dl class="table">
  12908. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  12909. <dt>&lsquo;<samp class="samp">verify</samp>&rsquo;</dt>
  12910. <dt>&lsquo;<samp class="samp">overlap</samp>&rsquo;</dt>
  12911. <dt>&lsquo;<samp class="samp">neverskip</samp>&rsquo;</dt>
  12912. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  12913. </dl>
  12914. <p>Default value is &lsquo;<samp class="samp">disable</samp>&rsquo;.
  12915. </p>
  12916. <p>For more information about the available recovery modes, consult the
  12917. paranoia project documentation.
  12918. </p></dd>
  12919. </dl>
  12920. <a name="libdc1394"></a>
  12921. <h3 class="section">20.13 libdc1394<span class="pull-right"><a class="anchor hidden-xs" href="#libdc1394" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libdc1394" aria-hidden="true">TOC</a></span></h3>
  12922. <p>IIDC1394 input device, based on libdc1394 and libraw1394.
  12923. </p>
  12924. <p>Requires the configure option <code class="code">--enable-libdc1394</code>.
  12925. </p>
  12926. <a name="Options-29"></a>
  12927. <h4 class="subsection">20.13.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-29" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-29" aria-hidden="true">TOC</a></span></h4>
  12928. <dl class="table">
  12929. <dt><samp class="option">framerate</samp></dt>
  12930. <dd><p>Set the frame rate. Default is <code class="code">ntsc</code>, corresponding to a frame
  12931. rate of <code class="code">30000/1001</code>.
  12932. </p>
  12933. </dd>
  12934. <dt><samp class="option">pixel_format</samp></dt>
  12935. <dd><p>Select the pixel format. Default is <code class="code">uyvy422</code>.
  12936. </p>
  12937. </dd>
  12938. <dt><samp class="option">video_size</samp></dt>
  12939. <dd><p>Set the video size given as a string such as <code class="code">640x480</code> or <code class="code">hd720</code>.
  12940. Default is <code class="code">qvga</code>.
  12941. </p></dd>
  12942. </dl>
  12943. <a name="openal"></a>
  12944. <h3 class="section">20.14 openal<span class="pull-right"><a class="anchor hidden-xs" href="#openal" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-openal" aria-hidden="true">TOC</a></span></h3>
  12945. <p>The OpenAL input device provides audio capture on all systems with a
  12946. working OpenAL 1.1 implementation.
  12947. </p>
  12948. <p>To enable this input device during configuration, you need OpenAL
  12949. headers and libraries installed on your system, and need to configure
  12950. FFmpeg with <code class="code">--enable-openal</code>.
  12951. </p>
  12952. <p>OpenAL headers and libraries should be provided as part of your OpenAL
  12953. implementation, or as an additional download (an SDK). Depending on your
  12954. installation you may need to specify additional flags via the
  12955. <code class="code">--extra-cflags</code> and <code class="code">--extra-ldflags</code> for allowing the build
  12956. system to locate the OpenAL headers and libraries.
  12957. </p>
  12958. <p>An incomplete list of OpenAL implementations follows:
  12959. </p>
  12960. <dl class="table">
  12961. <dt><strong class="strong">Creative</strong></dt>
  12962. <dd><p>The official Windows implementation, providing hardware acceleration
  12963. with supported devices and software fallback.
  12964. See <a class="url" href="http://openal.org/">http://openal.org/</a>.
  12965. </p></dd>
  12966. <dt><strong class="strong">OpenAL Soft</strong></dt>
  12967. <dd><p>Portable, open source (LGPL) software implementation. Includes
  12968. backends for the most common sound APIs on the Windows, Linux,
  12969. Solaris, and BSD operating systems.
  12970. See <a class="url" href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
  12971. </p></dd>
  12972. <dt><strong class="strong">Apple</strong></dt>
  12973. <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
  12974. See <a class="url" href="http://developer.apple.com/technologies/mac/audio-and-video.html">http://developer.apple.com/technologies/mac/audio-and-video.html</a>
  12975. </p></dd>
  12976. </dl>
  12977. <p>This device allows one to capture from an audio input device handled
  12978. through OpenAL.
  12979. </p>
  12980. <p>You need to specify the name of the device to capture in the provided
  12981. filename. If the empty string is provided, the device will
  12982. automatically select the default device. You can get the list of the
  12983. supported devices by using the option <var class="var">list_devices</var>.
  12984. </p>
  12985. <a name="Options-30"></a>
  12986. <h4 class="subsection">20.14.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-30" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-30" aria-hidden="true">TOC</a></span></h4>
  12987. <dl class="table">
  12988. <dt><samp class="option">channels</samp></dt>
  12989. <dd><p>Set the number of channels in the captured audio. Only the values
  12990. <samp class="option">1</samp> (monaural) and <samp class="option">2</samp> (stereo) are currently supported.
  12991. Defaults to <samp class="option">2</samp>.
  12992. </p>
  12993. </dd>
  12994. <dt><samp class="option">sample_size</samp></dt>
  12995. <dd><p>Set the sample size (in bits) of the captured audio. Only the values
  12996. <samp class="option">8</samp> and <samp class="option">16</samp> are currently supported. Defaults to
  12997. <samp class="option">16</samp>.
  12998. </p>
  12999. </dd>
  13000. <dt><samp class="option">sample_rate</samp></dt>
  13001. <dd><p>Set the sample rate (in Hz) of the captured audio.
  13002. Defaults to <samp class="option">44.1k</samp>.
  13003. </p>
  13004. </dd>
  13005. <dt><samp class="option">list_devices</samp></dt>
  13006. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  13007. Defaults to <samp class="option">false</samp>.
  13008. </p>
  13009. </dd>
  13010. </dl>
  13011. <a name="Examples-16"></a>
  13012. <h4 class="subsection">20.14.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-16" aria-hidden="true">TOC</a></span></h4>
  13013. <p>Print the list of OpenAL supported devices and exit:
  13014. </p><div class="example">
  13015. <pre class="example-preformatted">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
  13016. </pre></div>
  13017. <p>Capture from the OpenAL device <samp class="file">DR-BT101 via PulseAudio</samp>:
  13018. </p><div class="example">
  13019. <pre class="example-preformatted">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
  13020. </pre></div>
  13021. <p>Capture from the default device (note the empty string &rdquo; as filename):
  13022. </p><div class="example">
  13023. <pre class="example-preformatted">$ ffmpeg -f openal -i '' out.ogg
  13024. </pre></div>
  13025. <p>Capture from two devices simultaneously, writing to two different files,
  13026. within the same <code class="command">ffmpeg</code> command:
  13027. </p><div class="example">
  13028. <pre class="example-preformatted">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
  13029. </pre></div>
  13030. <p>Note: not all OpenAL implementations support multiple simultaneous capture -
  13031. try the latest OpenAL Soft if the above does not work.
  13032. </p>
  13033. <a name="oss"></a>
  13034. <h3 class="section">20.15 oss<span class="pull-right"><a class="anchor hidden-xs" href="#oss" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oss" aria-hidden="true">TOC</a></span></h3>
  13035. <p>Open Sound System input device.
  13036. </p>
  13037. <p>The filename to provide to the input device is the device node
  13038. representing the OSS input device, and is usually set to
  13039. <samp class="file">/dev/dsp</samp>.
  13040. </p>
  13041. <p>For example to grab from <samp class="file">/dev/dsp</samp> using <code class="command">ffmpeg</code> use the
  13042. command:
  13043. </p><div class="example">
  13044. <pre class="example-preformatted">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
  13045. </pre></div>
  13046. <p>For more information about OSS see:
  13047. <a class="url" href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
  13048. </p>
  13049. <a name="Options-31"></a>
  13050. <h4 class="subsection">20.15.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-31" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-31" aria-hidden="true">TOC</a></span></h4>
  13051. <dl class="table">
  13052. <dt><samp class="option">sample_rate</samp></dt>
  13053. <dd><p>Set the sample rate in Hz. Default is 48000.
  13054. </p>
  13055. </dd>
  13056. <dt><samp class="option">channels</samp></dt>
  13057. <dd><p>Set the number of channels. Default is 2.
  13058. </p>
  13059. </dd>
  13060. </dl>
  13061. <a name="pulse"></a>
  13062. <h3 class="section">20.16 pulse<span class="pull-right"><a class="anchor hidden-xs" href="#pulse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pulse" aria-hidden="true">TOC</a></span></h3>
  13063. <p>PulseAudio input device.
  13064. </p>
  13065. <p>To enable this output device you need to configure FFmpeg with <code class="code">--enable-libpulse</code>.
  13066. </p>
  13067. <p>The filename to provide to the input device is a source device or the
  13068. string &quot;default&quot;
  13069. </p>
  13070. <p>To list the PulseAudio source devices and their properties you can invoke
  13071. the command <code class="command">pactl list sources</code>.
  13072. </p>
  13073. <p>More information about PulseAudio can be found on <a class="url" href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
  13074. </p>
  13075. <a name="Options-32"></a>
  13076. <h4 class="subsection">20.16.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-32" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-32" aria-hidden="true">TOC</a></span></h4>
  13077. <dl class="table">
  13078. <dt><samp class="option">server</samp></dt>
  13079. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  13080. Default server is used when not provided.
  13081. </p>
  13082. </dd>
  13083. <dt><samp class="option">name</samp></dt>
  13084. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  13085. by default it is the <code class="code">LIBAVFORMAT_IDENT</code> string.
  13086. </p>
  13087. </dd>
  13088. <dt><samp class="option">stream_name</samp></dt>
  13089. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  13090. by default it is &quot;record&quot;.
  13091. </p>
  13092. </dd>
  13093. <dt><samp class="option">sample_rate</samp></dt>
  13094. <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
  13095. </p>
  13096. </dd>
  13097. <dt><samp class="option">channels</samp></dt>
  13098. <dd><p>Specify the channels in use, by default 2 (stereo) is set.
  13099. </p>
  13100. </dd>
  13101. <dt><samp class="option">frame_size</samp></dt>
  13102. <dd><p>This option does nothing and is deprecated.
  13103. </p>
  13104. </dd>
  13105. <dt><samp class="option">fragment_size</samp></dt>
  13106. <dd><p>Specify the size in bytes of the minimal buffering fragment in PulseAudio, it
  13107. will affect the audio latency. By default it is set to 50 ms amount of data.
  13108. </p>
  13109. </dd>
  13110. <dt><samp class="option">wallclock</samp></dt>
  13111. <dd><p>Set the initial PTS using the current time. Default is 1.
  13112. </p>
  13113. </dd>
  13114. </dl>
  13115. <a name="Examples-17"></a>
  13116. <h4 class="subsection">20.16.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-17" aria-hidden="true">TOC</a></span></h4>
  13117. <p>Record a stream from default device:
  13118. </p><div class="example">
  13119. <pre class="example-preformatted">ffmpeg -f pulse -i default /tmp/pulse.wav
  13120. </pre></div>
  13121. <a name="sndio"></a>
  13122. <h3 class="section">20.17 sndio<span class="pull-right"><a class="anchor hidden-xs" href="#sndio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sndio" aria-hidden="true">TOC</a></span></h3>
  13123. <p>sndio input device.
  13124. </p>
  13125. <p>To enable this input device during configuration you need libsndio
  13126. installed on your system.
  13127. </p>
  13128. <p>The filename to provide to the input device is the device node
  13129. representing the sndio input device, and is usually set to
  13130. <samp class="file">/dev/audio0</samp>.
  13131. </p>
  13132. <p>For example to grab from <samp class="file">/dev/audio0</samp> using <code class="command">ffmpeg</code> use the
  13133. command:
  13134. </p><div class="example">
  13135. <pre class="example-preformatted">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
  13136. </pre></div>
  13137. <a name="Options-33"></a>
  13138. <h4 class="subsection">20.17.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-33" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-33" aria-hidden="true">TOC</a></span></h4>
  13139. <dl class="table">
  13140. <dt><samp class="option">sample_rate</samp></dt>
  13141. <dd><p>Set the sample rate in Hz. Default is 48000.
  13142. </p>
  13143. </dd>
  13144. <dt><samp class="option">channels</samp></dt>
  13145. <dd><p>Set the number of channels. Default is 2.
  13146. </p>
  13147. </dd>
  13148. </dl>
  13149. <a name="video4linux2_002c-v4l2"></a>
  13150. <h3 class="section">20.18 video4linux2, v4l2<span class="pull-right"><a class="anchor hidden-xs" href="#video4linux2_002c-v4l2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-video4linux2_002c-v4l2" aria-hidden="true">TOC</a></span></h3>
  13151. <p>Video4Linux2 input video device.
  13152. </p>
  13153. <p>&quot;v4l2&quot; can be used as alias for &quot;video4linux2&quot;.
  13154. </p>
  13155. <p>If FFmpeg is built with v4l-utils support (by using the
  13156. <code class="code">--enable-libv4l2</code> configure option), it is possible to use it with the
  13157. <code class="code">-use_libv4l2</code> input device option.
  13158. </p>
  13159. <p>The name of the device to grab is a file device node, usually Linux
  13160. systems tend to automatically create such nodes when the device
  13161. (e.g. an USB webcam) is plugged into the system, and has a name of the
  13162. kind <samp class="file">/dev/video<var class="var">N</var></samp>, where <var class="var">N</var> is a number associated to
  13163. the device.
  13164. </p>
  13165. <p>Video4Linux2 devices usually support a limited set of
  13166. <var class="var">width</var>x<var class="var">height</var> sizes and frame rates. You can check which are
  13167. supported using <code class="command">-list_formats all</code> for Video4Linux2 devices.
  13168. Some devices, like TV cards, support one or more standards. It is possible
  13169. to list all the supported standards using <code class="command">-list_standards all</code>.
  13170. </p>
  13171. <p>The time base for the timestamps is 1 microsecond. Depending on the kernel
  13172. version and configuration, the timestamps may be derived from the real time
  13173. clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
  13174. boot time, unaffected by NTP or manual changes to the clock). The
  13175. <samp class="option">-timestamps abs</samp> or <samp class="option">-ts abs</samp> option can be used to force
  13176. conversion into the real time clock.
  13177. </p>
  13178. <p>Some usage examples of the video4linux2 device with <code class="command">ffmpeg</code>
  13179. and <code class="command">ffplay</code>:
  13180. </p><ul class="itemize mark-bullet">
  13181. <li>List supported formats for a video4linux2 device:
  13182. <div class="example">
  13183. <pre class="example-preformatted">ffplay -f video4linux2 -list_formats all /dev/video0
  13184. </pre></div>
  13185. </li><li>Grab and show the input of a video4linux2 device:
  13186. <div class="example">
  13187. <pre class="example-preformatted">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
  13188. </pre></div>
  13189. </li><li>Grab and record the input of a video4linux2 device, leave the
  13190. frame rate and size as previously set:
  13191. <div class="example">
  13192. <pre class="example-preformatted">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
  13193. </pre></div>
  13194. </li></ul>
  13195. <p>For more information about Video4Linux, check <a class="url" href="http://linuxtv.org/">http://linuxtv.org/</a>.
  13196. </p>
  13197. <a name="Options-34"></a>
  13198. <h4 class="subsection">20.18.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-34" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-34" aria-hidden="true">TOC</a></span></h4>
  13199. <dl class="table">
  13200. <dt><samp class="option">standard</samp></dt>
  13201. <dd><p>Set the standard. Must be the name of a supported standard. To get a
  13202. list of the supported standards, use the <samp class="option">list_standards</samp>
  13203. option.
  13204. </p>
  13205. </dd>
  13206. <dt><samp class="option">channel</samp></dt>
  13207. <dd><p>Set the input channel number. Default to -1, which means using the
  13208. previously selected channel.
  13209. </p>
  13210. </dd>
  13211. <dt><samp class="option">video_size</samp></dt>
  13212. <dd><p>Set the video frame size. The argument must be a string in the form
  13213. <var class="var">WIDTH</var>x<var class="var">HEIGHT</var> or a valid size abbreviation.
  13214. </p>
  13215. </dd>
  13216. <dt><samp class="option">pixel_format</samp></dt>
  13217. <dd><p>Select the pixel format (only valid for raw video input).
  13218. </p>
  13219. </dd>
  13220. <dt><samp class="option">input_format</samp></dt>
  13221. <dd><p>Set the preferred pixel format (for raw video) or a codec name.
  13222. This option allows one to select the input format, when several are
  13223. available.
  13224. </p>
  13225. </dd>
  13226. <dt><samp class="option">framerate</samp></dt>
  13227. <dd><p>Set the preferred video frame rate.
  13228. </p>
  13229. </dd>
  13230. <dt><samp class="option">list_formats</samp></dt>
  13231. <dd><p>List available formats (supported pixel formats, codecs, and frame
  13232. sizes) and exit.
  13233. </p>
  13234. <p>Available values are:
  13235. </p><dl class="table">
  13236. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  13237. <dd><p>Show all available (compressed and non-compressed) formats.
  13238. </p>
  13239. </dd>
  13240. <dt>&lsquo;<samp class="samp">raw</samp>&rsquo;</dt>
  13241. <dd><p>Show only raw video (non-compressed) formats.
  13242. </p>
  13243. </dd>
  13244. <dt>&lsquo;<samp class="samp">compressed</samp>&rsquo;</dt>
  13245. <dd><p>Show only compressed formats.
  13246. </p></dd>
  13247. </dl>
  13248. </dd>
  13249. <dt><samp class="option">list_standards</samp></dt>
  13250. <dd><p>List supported standards and exit.
  13251. </p>
  13252. <p>Available values are:
  13253. </p><dl class="table">
  13254. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  13255. <dd><p>Show all supported standards.
  13256. </p></dd>
  13257. </dl>
  13258. </dd>
  13259. <dt><samp class="option">timestamps, ts</samp></dt>
  13260. <dd><p>Set type of timestamps for grabbed frames.
  13261. </p>
  13262. <p>Available values are:
  13263. </p><dl class="table">
  13264. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  13265. <dd><p>Use timestamps from the kernel.
  13266. </p>
  13267. </dd>
  13268. <dt>&lsquo;<samp class="samp">abs</samp>&rsquo;</dt>
  13269. <dd><p>Use absolute timestamps (wall clock).
  13270. </p>
  13271. </dd>
  13272. <dt>&lsquo;<samp class="samp">mono2abs</samp>&rsquo;</dt>
  13273. <dd><p>Force conversion from monotonic to absolute timestamps.
  13274. </p></dd>
  13275. </dl>
  13276. <p>Default value is <code class="code">default</code>.
  13277. </p>
  13278. </dd>
  13279. <dt><samp class="option">use_libv4l2</samp></dt>
  13280. <dd><p>Use libv4l2 (v4l-utils) conversion functions. Default is 0.
  13281. </p>
  13282. </dd>
  13283. </dl>
  13284. <a name="vfwcap"></a>
  13285. <h3 class="section">20.19 vfwcap<span class="pull-right"><a class="anchor hidden-xs" href="#vfwcap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vfwcap" aria-hidden="true">TOC</a></span></h3>
  13286. <p>VfW (Video for Windows) capture input device.
  13287. </p>
  13288. <p>The filename passed as input is the capture driver number, ranging from
  13289. 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
  13290. other filename will be interpreted as device number 0.
  13291. </p>
  13292. <a name="Options-35"></a>
  13293. <h4 class="subsection">20.19.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-35" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-35" aria-hidden="true">TOC</a></span></h4>
  13294. <dl class="table">
  13295. <dt><samp class="option">video_size</samp></dt>
  13296. <dd><p>Set the video frame size.
  13297. </p>
  13298. </dd>
  13299. <dt><samp class="option">framerate</samp></dt>
  13300. <dd><p>Set the grabbing frame rate. Default value is <code class="code">ntsc</code>,
  13301. corresponding to a frame rate of <code class="code">30000/1001</code>.
  13302. </p>
  13303. </dd>
  13304. </dl>
  13305. <a name="x11grab"></a>
  13306. <h3 class="section">20.20 x11grab<span class="pull-right"><a class="anchor hidden-xs" href="#x11grab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-x11grab" aria-hidden="true">TOC</a></span></h3>
  13307. <p>X11 video input device.
  13308. </p>
  13309. <p>To enable this input device during configuration you need libxcb
  13310. installed on your system. It will be automatically detected during
  13311. configuration.
  13312. </p>
  13313. <p>This device allows one to capture a region of an X11 display.
  13314. </p>
  13315. <p>The filename passed as input has the syntax:
  13316. </p><div class="example">
  13317. <pre class="example-preformatted">[<var class="var">hostname</var>]:<var class="var">display_number</var>.<var class="var">screen_number</var>[+<var class="var">x_offset</var>,<var class="var">y_offset</var>]
  13318. </pre></div>
  13319. <p><var class="var">hostname</var>:<var class="var">display_number</var>.<var class="var">screen_number</var> specifies the
  13320. X11 display name of the screen to grab from. <var class="var">hostname</var> can be
  13321. omitted, and defaults to &quot;localhost&quot;. The environment variable
  13322. <code class="env">DISPLAY</code> contains the default display name.
  13323. </p>
  13324. <p><var class="var">x_offset</var> and <var class="var">y_offset</var> specify the offsets of the grabbed
  13325. area with respect to the top-left border of the X11 screen. They
  13326. default to 0.
  13327. </p>
  13328. <p>Check the X11 documentation (e.g. <code class="command">man X</code>) for more detailed
  13329. information.
  13330. </p>
  13331. <p>Use the <code class="command">xdpyinfo</code> program for getting basic information about
  13332. the properties of your X11 display (e.g. grep for &quot;name&quot; or
  13333. &quot;dimensions&quot;).
  13334. </p>
  13335. <p>For example to grab from <samp class="file">:0.0</samp> using <code class="command">ffmpeg</code>:
  13336. </p><div class="example">
  13337. <pre class="example-preformatted">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
  13338. </pre></div>
  13339. <p>Grab at position <code class="code">10,20</code>:
  13340. </p><div class="example">
  13341. <pre class="example-preformatted">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  13342. </pre></div>
  13343. <a name="Options-36"></a>
  13344. <h4 class="subsection">20.20.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-36" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-36" aria-hidden="true">TOC</a></span></h4>
  13345. <dl class="table">
  13346. <dt><samp class="option">select_region</samp></dt>
  13347. <dd><p>Specify whether to select the grabbing area graphically using the pointer.
  13348. A value of <code class="code">1</code> prompts the user to select the grabbing area graphically
  13349. by clicking and dragging. A single click with no dragging will select the
  13350. whole screen. A region with zero width or height will also select the whole
  13351. screen. This option overwrites the <var class="var">video_size</var>, <var class="var">grab_x</var>, and
  13352. <var class="var">grab_y</var> options. Default value is <code class="code">0</code>.
  13353. </p>
  13354. </dd>
  13355. <dt><samp class="option">draw_mouse</samp></dt>
  13356. <dd><p>Specify whether to draw the mouse pointer. A value of <code class="code">0</code> specifies
  13357. not to draw the pointer. Default value is <code class="code">1</code>.
  13358. </p>
  13359. </dd>
  13360. <dt><samp class="option">follow_mouse</samp></dt>
  13361. <dd><p>Make the grabbed area follow the mouse. The argument can be
  13362. <code class="code">centered</code> or a number of pixels <var class="var">PIXELS</var>.
  13363. </p>
  13364. <p>When it is specified with &quot;centered&quot;, the grabbing region follows the mouse
  13365. pointer and keeps the pointer at the center of region; otherwise, the region
  13366. follows only when the mouse pointer reaches within <var class="var">PIXELS</var> (greater than
  13367. zero) to the edge of region.
  13368. </p>
  13369. <p>For example:
  13370. </p><div class="example">
  13371. <pre class="example-preformatted">ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
  13372. </pre></div>
  13373. <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
  13374. </p><div class="example">
  13375. <pre class="example-preformatted">ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
  13376. </pre></div>
  13377. </dd>
  13378. <dt><samp class="option">framerate</samp></dt>
  13379. <dd><p>Set the grabbing frame rate. Default value is <code class="code">ntsc</code>,
  13380. corresponding to a frame rate of <code class="code">30000/1001</code>.
  13381. </p>
  13382. </dd>
  13383. <dt><samp class="option">show_region</samp></dt>
  13384. <dd><p>Show grabbed region on screen.
  13385. </p>
  13386. <p>If <var class="var">show_region</var> is specified with <code class="code">1</code>, then the grabbing
  13387. region will be indicated on screen. With this option, it is easy to
  13388. know what is being grabbed if only a portion of the screen is grabbed.
  13389. </p>
  13390. </dd>
  13391. <dt><samp class="option">region_border</samp></dt>
  13392. <dd><p>Set the region border thickness if <samp class="option">-show_region 1</samp> is used.
  13393. Range is 1 to 128 and default is 3 (XCB-based x11grab only).
  13394. </p>
  13395. <p>For example:
  13396. </p><div class="example">
  13397. <pre class="example-preformatted">ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  13398. </pre></div>
  13399. <p>With <var class="var">follow_mouse</var>:
  13400. </p><div class="example">
  13401. <pre class="example-preformatted">ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
  13402. </pre></div>
  13403. </dd>
  13404. <dt><samp class="option">window_id</samp></dt>
  13405. <dd><p>Grab this window, instead of the whole screen. Default value is 0, which maps to
  13406. the whole screen (root window).
  13407. </p>
  13408. <p>The id of a window can be found using the <code class="command">xwininfo</code> program, possibly with options -tree and
  13409. -root.
  13410. </p>
  13411. <p>If the window is later enlarged, the new area is not recorded. Video ends when
  13412. the window is closed, unmapped (i.e., iconified) or shrunk beyond the video
  13413. size (which defaults to the initial window size).
  13414. </p>
  13415. <p>This option disables options <samp class="option">follow_mouse</samp> and <samp class="option">select_region</samp>.
  13416. </p>
  13417. </dd>
  13418. <dt><samp class="option">video_size</samp></dt>
  13419. <dd><p>Set the video frame size. Default is the full desktop or window.
  13420. </p>
  13421. </dd>
  13422. <dt><samp class="option">grab_x</samp></dt>
  13423. <dt><samp class="option">grab_y</samp></dt>
  13424. <dd><p>Set the grabbing region coordinates. They are expressed as offset from
  13425. the top left corner of the X11 window and correspond to the
  13426. <var class="var">x_offset</var> and <var class="var">y_offset</var> parameters in the device name. The
  13427. default value for both options is 0.
  13428. </p></dd>
  13429. </dl>
  13430. <a name="Resampler-Options"></a>
  13431. <h2 class="chapter">21 Resampler Options<span class="pull-right"><a class="anchor hidden-xs" href="#Resampler-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Resampler-Options" aria-hidden="true">TOC</a></span></h2>
  13432. <p>The audio resampler supports the following named options.
  13433. </p>
  13434. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  13435. FFmpeg tools, <var class="var">option</var>=<var class="var">value</var> for the aresample filter,
  13436. by setting the value explicitly in the
  13437. <code class="code">SwrContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API for
  13438. programmatic use.
  13439. </p>
  13440. <dl class="table">
  13441. <dt><samp class="option">uchl, used_chlayout</samp></dt>
  13442. <dd><p>Set used input channel layout. Default is unset. This option is
  13443. only used for special remapping.
  13444. </p>
  13445. </dd>
  13446. <dt><samp class="option">isr, in_sample_rate</samp></dt>
  13447. <dd><p>Set the input sample rate. Default value is 0.
  13448. </p>
  13449. </dd>
  13450. <dt><samp class="option">osr, out_sample_rate</samp></dt>
  13451. <dd><p>Set the output sample rate. Default value is 0.
  13452. </p>
  13453. </dd>
  13454. <dt><samp class="option">isf, in_sample_fmt</samp></dt>
  13455. <dd><p>Specify the input sample format. It is set by default to <code class="code">none</code>.
  13456. </p>
  13457. </dd>
  13458. <dt><samp class="option">osf, out_sample_fmt</samp></dt>
  13459. <dd><p>Specify the output sample format. It is set by default to <code class="code">none</code>.
  13460. </p>
  13461. </dd>
  13462. <dt><samp class="option">tsf, internal_sample_fmt</samp></dt>
  13463. <dd><p>Set the internal sample format. Default value is <code class="code">none</code>.
  13464. This will automatically be chosen when it is not explicitly set.
  13465. </p>
  13466. </dd>
  13467. <dt><samp class="option">ichl, in_chlayout</samp></dt>
  13468. <dt><samp class="option">ochl, out_chlayout</samp></dt>
  13469. <dd><p>Set the input/output channel layout.
  13470. </p>
  13471. <p>See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#channel-layout-syntax">the Channel Layout section in the ffmpeg-utils(1) manual</a>
  13472. for the required syntax.
  13473. </p>
  13474. </dd>
  13475. <dt><samp class="option">clev, center_mix_level</samp></dt>
  13476. <dd><p>Set the center mix level. It is a value expressed in deciBel, and must be
  13477. in the interval [-32,32].
  13478. </p>
  13479. </dd>
  13480. <dt><samp class="option">slev, surround_mix_level</samp></dt>
  13481. <dd><p>Set the surround mix level. It is a value expressed in deciBel, and must
  13482. be in the interval [-32,32].
  13483. </p>
  13484. </dd>
  13485. <dt><samp class="option">lfe_mix_level</samp></dt>
  13486. <dd><p>Set LFE mix into non LFE level. It is used when there is a LFE input but no
  13487. LFE output. It is a value expressed in deciBel, and must
  13488. be in the interval [-32,32].
  13489. </p>
  13490. </dd>
  13491. <dt><samp class="option">rmvol, rematrix_volume</samp></dt>
  13492. <dd><p>Set rematrix volume. Default value is 1.0.
  13493. </p>
  13494. </dd>
  13495. <dt><samp class="option">rematrix_maxval</samp></dt>
  13496. <dd><p>Set maximum output value for rematrixing.
  13497. This can be used to prevent clipping vs. preventing volume reduction.
  13498. A value of 1.0 prevents clipping.
  13499. </p>
  13500. </dd>
  13501. <dt><samp class="option">flags, swr_flags</samp></dt>
  13502. <dd><p>Set flags used by the converter. Default value is 0.
  13503. </p>
  13504. <p>It supports the following individual flags:
  13505. </p><dl class="table">
  13506. <dt><samp class="option">res</samp></dt>
  13507. <dd><p>force resampling, this flag forces resampling to be used even when the
  13508. input and output sample rates match.
  13509. </p></dd>
  13510. </dl>
  13511. </dd>
  13512. <dt><samp class="option">dither_scale</samp></dt>
  13513. <dd><p>Set the dither scale. Default value is 1.
  13514. </p>
  13515. </dd>
  13516. <dt><samp class="option">dither_method</samp></dt>
  13517. <dd><p>Set dither method. Default value is 0.
  13518. </p>
  13519. <p>Supported values:
  13520. </p><dl class="table">
  13521. <dt>&lsquo;<samp class="samp">rectangular</samp>&rsquo;</dt>
  13522. <dd><p>select rectangular dither
  13523. </p></dd>
  13524. <dt>&lsquo;<samp class="samp">triangular</samp>&rsquo;</dt>
  13525. <dd><p>select triangular dither
  13526. </p></dd>
  13527. <dt>&lsquo;<samp class="samp">triangular_hp</samp>&rsquo;</dt>
  13528. <dd><p>select triangular dither with high pass
  13529. </p></dd>
  13530. <dt>&lsquo;<samp class="samp">lipshitz</samp>&rsquo;</dt>
  13531. <dd><p>select Lipshitz noise shaping dither.
  13532. </p></dd>
  13533. <dt>&lsquo;<samp class="samp">shibata</samp>&rsquo;</dt>
  13534. <dd><p>select Shibata noise shaping dither.
  13535. </p></dd>
  13536. <dt>&lsquo;<samp class="samp">low_shibata</samp>&rsquo;</dt>
  13537. <dd><p>select low Shibata noise shaping dither.
  13538. </p></dd>
  13539. <dt>&lsquo;<samp class="samp">high_shibata</samp>&rsquo;</dt>
  13540. <dd><p>select high Shibata noise shaping dither.
  13541. </p></dd>
  13542. <dt>&lsquo;<samp class="samp">f_weighted</samp>&rsquo;</dt>
  13543. <dd><p>select f-weighted noise shaping dither
  13544. </p></dd>
  13545. <dt>&lsquo;<samp class="samp">modified_e_weighted</samp>&rsquo;</dt>
  13546. <dd><p>select modified-e-weighted noise shaping dither
  13547. </p></dd>
  13548. <dt>&lsquo;<samp class="samp">improved_e_weighted</samp>&rsquo;</dt>
  13549. <dd><p>select improved-e-weighted noise shaping dither
  13550. </p>
  13551. </dd>
  13552. </dl>
  13553. </dd>
  13554. <dt><samp class="option">resampler</samp></dt>
  13555. <dd><p>Set resampling engine. Default value is swr.
  13556. </p>
  13557. <p>Supported values:
  13558. </p><dl class="table">
  13559. <dt>&lsquo;<samp class="samp">swr</samp>&rsquo;</dt>
  13560. <dd><p>select the native SW Resampler; filter options precision and cheby are not
  13561. applicable in this case.
  13562. </p></dd>
  13563. <dt>&lsquo;<samp class="samp">soxr</samp>&rsquo;</dt>
  13564. <dd><p>select the SoX Resampler (where available); compensation, and filter options
  13565. filter_size, phase_shift, exact_rational, filter_type &amp; kaiser_beta, are not
  13566. applicable in this case.
  13567. </p></dd>
  13568. </dl>
  13569. </dd>
  13570. <dt><samp class="option">filter_size</samp></dt>
  13571. <dd><p>For swr only, set resampling filter size, default value is 32.
  13572. </p>
  13573. </dd>
  13574. <dt><samp class="option">phase_shift</samp></dt>
  13575. <dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
  13576. the interval [0,30].
  13577. </p>
  13578. </dd>
  13579. <dt><samp class="option">linear_interp</samp></dt>
  13580. <dd><p>Use linear interpolation when enabled (the default). Disable it if you want
  13581. to preserve speed instead of quality when exact_rational fails.
  13582. </p>
  13583. </dd>
  13584. <dt><samp class="option">exact_rational</samp></dt>
  13585. <dd><p>For swr only, when enabled, try to use exact phase_count based on input and
  13586. output sample rate. However, if it is larger than <code class="code">1 &lt;&lt; phase_shift</code>,
  13587. the phase_count will be <code class="code">1 &lt;&lt; phase_shift</code> as fallback. Default is enabled.
  13588. </p>
  13589. </dd>
  13590. <dt><samp class="option">cutoff</samp></dt>
  13591. <dd><p>Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
  13592. value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
  13593. (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
  13594. </p>
  13595. </dd>
  13596. <dt><samp class="option">precision</samp></dt>
  13597. <dd><p>For soxr only, the precision in bits to which the resampled signal will be
  13598. calculated. The default value of 20 (which, with suitable dithering, is
  13599. appropriate for a destination bit-depth of 16) gives SoX&rsquo;s &rsquo;High Quality&rsquo;; a
  13600. value of 28 gives SoX&rsquo;s &rsquo;Very High Quality&rsquo;.
  13601. </p>
  13602. </dd>
  13603. <dt><samp class="option">cheby</samp></dt>
  13604. <dd><p>For soxr only, selects passband rolloff none (Chebyshev) &amp; higher-precision
  13605. approximation for &rsquo;irrational&rsquo; ratios. Default value is 0.
  13606. </p>
  13607. </dd>
  13608. <dt><samp class="option">async</samp></dt>
  13609. <dd><p>For swr only, simple 1 parameter audio sync to timestamps using stretching,
  13610. squeezing, filling and trimming. Setting this to 1 will enable filling and
  13611. trimming, larger values represent the maximum amount in samples that the data
  13612. may be stretched or squeezed for each second.
  13613. Default value is 0, thus no compensation is applied to make the samples match
  13614. the audio timestamps.
  13615. </p>
  13616. </dd>
  13617. <dt><samp class="option">first_pts</samp></dt>
  13618. <dd><p>For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
  13619. This allows for padding/trimming at the start of stream. By default, no
  13620. assumption is made about the first frame&rsquo;s expected pts, so no padding or
  13621. trimming is done. For example, this could be set to 0 to pad the beginning with
  13622. silence if an audio stream starts after the video stream or to trim any samples
  13623. with a negative pts due to encoder delay.
  13624. </p>
  13625. </dd>
  13626. <dt><samp class="option">min_comp</samp></dt>
  13627. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  13628. seconds) to trigger stretching/squeezing/filling or trimming of the
  13629. data to make it match the timestamps. The default is that
  13630. stretching/squeezing/filling and trimming is disabled
  13631. (<samp class="option">min_comp</samp> = <code class="code">FLT_MAX</code>).
  13632. </p>
  13633. </dd>
  13634. <dt><samp class="option">min_hard_comp</samp></dt>
  13635. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  13636. seconds) to trigger adding/dropping samples to make it match the
  13637. timestamps. This option effectively is a threshold to select between
  13638. hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
  13639. all compensation is by default disabled through <samp class="option">min_comp</samp>.
  13640. The default is 0.1.
  13641. </p>
  13642. </dd>
  13643. <dt><samp class="option">comp_duration</samp></dt>
  13644. <dd><p>For swr only, set duration (in seconds) over which data is stretched/squeezed
  13645. to make it match the timestamps. Must be a non-negative double float value,
  13646. default value is 1.0.
  13647. </p>
  13648. </dd>
  13649. <dt><samp class="option">max_soft_comp</samp></dt>
  13650. <dd><p>For swr only, set maximum factor by which data is stretched/squeezed to make it
  13651. match the timestamps. Must be a non-negative double float value, default value
  13652. is 0.
  13653. </p>
  13654. </dd>
  13655. <dt><samp class="option">matrix_encoding</samp></dt>
  13656. <dd><p>Select matrixed stereo encoding.
  13657. </p>
  13658. <p>It accepts the following values:
  13659. </p><dl class="table">
  13660. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  13661. <dd><p>select none
  13662. </p></dd>
  13663. <dt>&lsquo;<samp class="samp">dolby</samp>&rsquo;</dt>
  13664. <dd><p>select Dolby
  13665. </p></dd>
  13666. <dt>&lsquo;<samp class="samp">dplii</samp>&rsquo;</dt>
  13667. <dd><p>select Dolby Pro Logic II
  13668. </p></dd>
  13669. </dl>
  13670. <p>Default value is <code class="code">none</code>.
  13671. </p>
  13672. </dd>
  13673. <dt><samp class="option">filter_type</samp></dt>
  13674. <dd><p>For swr only, select resampling filter type. This only affects resampling
  13675. operations.
  13676. </p>
  13677. <p>It accepts the following values:
  13678. </p><dl class="table">
  13679. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  13680. <dd><p>select cubic
  13681. </p></dd>
  13682. <dt>&lsquo;<samp class="samp">blackman_nuttall</samp>&rsquo;</dt>
  13683. <dd><p>select Blackman Nuttall windowed sinc
  13684. </p></dd>
  13685. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  13686. <dd><p>select Kaiser windowed sinc
  13687. </p></dd>
  13688. </dl>
  13689. </dd>
  13690. <dt><samp class="option">kaiser_beta</samp></dt>
  13691. <dd><p>For swr only, set Kaiser window beta value. Must be a double float value in the
  13692. interval [2,16], default value is 9.
  13693. </p>
  13694. </dd>
  13695. <dt><samp class="option">output_sample_bits</samp></dt>
  13696. <dd><p>For swr only, set number of used output sample bits for dithering. Must be an integer in the
  13697. interval [0,64], default value is 0, which means it&rsquo;s not used.
  13698. </p>
  13699. </dd>
  13700. </dl>
  13701. <a class="anchor" id="scaler_005foptions"></a><a name="Scaler-Options"></a>
  13702. <h2 class="chapter">22 Scaler Options<span class="pull-right"><a class="anchor hidden-xs" href="#Scaler-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Scaler-Options" aria-hidden="true">TOC</a></span></h2>
  13703. <p>The video scaler supports the following named options.
  13704. </p>
  13705. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  13706. FFmpeg tools, with a few API-only exceptions noted below.
  13707. For programmatic use, they can be set explicitly in the
  13708. <code class="code">SwsContext</code> options or through the <samp class="file">libavutil/opt.h</samp> API.
  13709. </p>
  13710. <dl class="table">
  13711. <dd>
  13712. <a class="anchor" id="sws_005fflags"></a></dd>
  13713. <dt><samp class="option">sws_flags</samp></dt>
  13714. <dd><p>Set the scaler flags. This is also used to set the scaling
  13715. algorithm. Only a single algorithm should be selected. Default
  13716. value is &lsquo;<samp class="samp">bicubic</samp>&rsquo;.
  13717. </p>
  13718. <p>It accepts the following values:
  13719. </p><dl class="table">
  13720. <dt>&lsquo;<samp class="samp">fast_bilinear</samp>&rsquo;</dt>
  13721. <dd><p>Select fast bilinear scaling algorithm.
  13722. </p>
  13723. </dd>
  13724. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  13725. <dd><p>Select bilinear scaling algorithm.
  13726. </p>
  13727. </dd>
  13728. <dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
  13729. <dd><p>Select bicubic scaling algorithm.
  13730. </p>
  13731. </dd>
  13732. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  13733. <dd><p>Select experimental scaling algorithm.
  13734. </p>
  13735. </dd>
  13736. <dt>&lsquo;<samp class="samp">neighbor</samp>&rsquo;</dt>
  13737. <dd><p>Select nearest neighbor rescaling algorithm.
  13738. </p>
  13739. </dd>
  13740. <dt>&lsquo;<samp class="samp">area</samp>&rsquo;</dt>
  13741. <dd><p>Select averaging area rescaling algorithm.
  13742. </p>
  13743. </dd>
  13744. <dt>&lsquo;<samp class="samp">bicublin</samp>&rsquo;</dt>
  13745. <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
  13746. chroma components.
  13747. </p>
  13748. </dd>
  13749. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  13750. <dd><p>Select Gaussian rescaling algorithm.
  13751. </p>
  13752. </dd>
  13753. <dt>&lsquo;<samp class="samp">sinc</samp>&rsquo;</dt>
  13754. <dd><p>Select sinc rescaling algorithm.
  13755. </p>
  13756. </dd>
  13757. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  13758. <dd><p>Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be
  13759. changed by setting <code class="code">param0</code>.
  13760. </p>
  13761. </dd>
  13762. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  13763. <dd><p>Select natural bicubic spline rescaling algorithm.
  13764. </p>
  13765. </dd>
  13766. <dt>&lsquo;<samp class="samp">print_info</samp>&rsquo;</dt>
  13767. <dd><p>Enable printing/debug logging.
  13768. </p>
  13769. </dd>
  13770. <dt>&lsquo;<samp class="samp">accurate_rnd</samp>&rsquo;</dt>
  13771. <dd><p>Enable accurate rounding.
  13772. </p>
  13773. </dd>
  13774. <dt>&lsquo;<samp class="samp">full_chroma_int</samp>&rsquo;</dt>
  13775. <dd><p>Enable full chroma interpolation.
  13776. </p>
  13777. </dd>
  13778. <dt>&lsquo;<samp class="samp">full_chroma_inp</samp>&rsquo;</dt>
  13779. <dd><p>Select full chroma input.
  13780. </p>
  13781. </dd>
  13782. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  13783. <dd><p>Enable bitexact output.
  13784. </p>
  13785. </dd>
  13786. <dt>&lsquo;<samp class="samp">unstable</samp>&rsquo;</dt>
  13787. <dd><p>Allow the use of experimental new code. May subtly affect the output or even
  13788. produce wrong results. For testing only.
  13789. </p></dd>
  13790. </dl>
  13791. </dd>
  13792. <dt><samp class="option">srcw <var class="var">(API only)</var></samp></dt>
  13793. <dd><p>Set source width.
  13794. </p>
  13795. </dd>
  13796. <dt><samp class="option">srch <var class="var">(API only)</var></samp></dt>
  13797. <dd><p>Set source height.
  13798. </p>
  13799. </dd>
  13800. <dt><samp class="option">dstw <var class="var">(API only)</var></samp></dt>
  13801. <dd><p>Set destination width.
  13802. </p>
  13803. </dd>
  13804. <dt><samp class="option">dsth <var class="var">(API only)</var></samp></dt>
  13805. <dd><p>Set destination height.
  13806. </p>
  13807. </dd>
  13808. <dt><samp class="option">src_format <var class="var">(API only)</var></samp></dt>
  13809. <dd><p>Set source pixel format (must be expressed as an integer).
  13810. </p>
  13811. </dd>
  13812. <dt><samp class="option">dst_format <var class="var">(API only)</var></samp></dt>
  13813. <dd><p>Set destination pixel format (must be expressed as an integer).
  13814. </p>
  13815. </dd>
  13816. <dt><samp class="option">src_range <var class="var">(boolean)</var></samp></dt>
  13817. <dd><p>If value is set to <code class="code">1</code>, indicates source is full range. Default value is
  13818. <code class="code">0</code>, which indicates source is limited range.
  13819. </p>
  13820. </dd>
  13821. <dt><samp class="option">dst_range <var class="var">(boolean)</var></samp></dt>
  13822. <dd><p>If value is set to <code class="code">1</code>, enable full range for destination. Default value
  13823. is <code class="code">0</code>, which enables limited range.
  13824. </p>
  13825. </dd>
  13826. <dt><samp class="option">gamma <var class="var">(boolean)</var></samp></dt>
  13827. <dd><p>If value is set to <code class="code">1</code>, enable gamma correct scaling. Default value is <code class="code">0</code>.
  13828. </p>
  13829. <a class="anchor" id="sws_005fparams"></a></dd>
  13830. <dt><samp class="option">param0, param1</samp></dt>
  13831. <dd><p>Set scaling algorithm parameters. The specified values are specific of
  13832. some scaling algorithms and ignored by others. The specified values
  13833. are floating point number values.
  13834. </p>
  13835. </dd>
  13836. <dt><samp class="option">sws_dither</samp></dt>
  13837. <dd><p>Set the dithering algorithm. Accepts one of the following
  13838. values. Default value is &lsquo;<samp class="samp">auto</samp>&rsquo;.
  13839. </p>
  13840. <dl class="table">
  13841. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  13842. <dd><p>automatic choice
  13843. </p>
  13844. </dd>
  13845. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  13846. <dd><p>no dithering
  13847. </p>
  13848. </dd>
  13849. <dt>&lsquo;<samp class="samp">bayer</samp>&rsquo;</dt>
  13850. <dd><p>bayer dither
  13851. </p>
  13852. </dd>
  13853. <dt>&lsquo;<samp class="samp">ed</samp>&rsquo;</dt>
  13854. <dd><p>error diffusion dither
  13855. </p>
  13856. </dd>
  13857. <dt>&lsquo;<samp class="samp">a_dither</samp>&rsquo;</dt>
  13858. <dd><p>arithmetic dither, based using addition
  13859. </p>
  13860. </dd>
  13861. <dt>&lsquo;<samp class="samp">x_dither</samp>&rsquo;</dt>
  13862. <dd><p>arithmetic dither, based using xor (more random/less apparent patterning that
  13863. a_dither).
  13864. </p>
  13865. </dd>
  13866. </dl>
  13867. </dd>
  13868. <dt><samp class="option">alphablend</samp></dt>
  13869. <dd><p>Set the alpha blending to use when the input has alpha but the output does not.
  13870. Default value is &lsquo;<samp class="samp">none</samp>&rsquo;.
  13871. </p>
  13872. <dl class="table">
  13873. <dt>&lsquo;<samp class="samp">uniform_color</samp>&rsquo;</dt>
  13874. <dd><p>Blend onto a uniform background color
  13875. </p>
  13876. </dd>
  13877. <dt>&lsquo;<samp class="samp">checkerboard</samp>&rsquo;</dt>
  13878. <dd><p>Blend onto a checkerboard
  13879. </p>
  13880. </dd>
  13881. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  13882. <dd><p>No blending
  13883. </p>
  13884. </dd>
  13885. </dl>
  13886. </dd>
  13887. </dl>
  13888. <a name="Filtering-Introduction"></a>
  13889. <h2 class="chapter">23 Filtering Introduction<span class="pull-right"><a class="anchor hidden-xs" href="#Filtering-Introduction" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtering-Introduction" aria-hidden="true">TOC</a></span></h2>
  13890. <p>Filtering in FFmpeg is enabled through the libavfilter library.
  13891. </p>
  13892. <p>In libavfilter, a filter can have multiple inputs and multiple
  13893. outputs.
  13894. To illustrate the sorts of things that are possible, we consider the
  13895. following filtergraph.
  13896. </p>
  13897. <pre class="verbatim"> [main]
  13898. input --&gt; split ---------------------&gt; overlay --&gt; output
  13899. | ^
  13900. |[tmp] [flip]|
  13901. +-----&gt; crop --&gt; vflip -------+
  13902. </pre>
  13903. <p>This filtergraph splits the input stream in two streams, then sends one
  13904. stream through the crop filter and the vflip filter, before merging it
  13905. back with the other stream by overlaying it on top. You can use the
  13906. following command to achieve this:
  13907. </p>
  13908. <div class="example">
  13909. <pre class="example-preformatted">ffmpeg -i INPUT -vf &quot;split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2&quot; OUTPUT
  13910. </pre></div>
  13911. <p>The result will be that the top half of the video is mirrored
  13912. onto the bottom half of the output video.
  13913. </p>
  13914. <p>Filters in the same linear chain are separated by commas, and distinct
  13915. linear chains of filters are separated by semicolons. In our example,
  13916. <var class="var">crop,vflip</var> are in one linear chain, <var class="var">split</var> and
  13917. <var class="var">overlay</var> are separately in another. The points where the linear
  13918. chains join are labelled by names enclosed in square brackets. In the
  13919. example, the split filter generates two outputs that are associated to
  13920. the labels <var class="var">[main]</var> and <var class="var">[tmp]</var>.
  13921. </p>
  13922. <p>The stream sent to the second output of <var class="var">split</var>, labelled as
  13923. <var class="var">[tmp]</var>, is processed through the <var class="var">crop</var> filter, which crops
  13924. away the lower half part of the video, and then vertically flipped. The
  13925. <var class="var">overlay</var> filter takes in input the first unchanged output of the
  13926. split filter (which was labelled as <var class="var">[main]</var>), and overlay on its
  13927. lower half the output generated by the <var class="var">crop,vflip</var> filterchain.
  13928. </p>
  13929. <p>Some filters take in input a list of parameters: they are specified
  13930. after the filter name and an equal sign, and are separated from each other
  13931. by a colon.
  13932. </p>
  13933. <p>There exist so-called <var class="var">source filters</var> that do not have an
  13934. audio/video input, and <var class="var">sink filters</var> that will not have audio/video
  13935. output.
  13936. </p>
  13937. <a name="graph2dot"></a>
  13938. <h2 class="chapter">24 graph2dot<span class="pull-right"><a class="anchor hidden-xs" href="#graph2dot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-graph2dot" aria-hidden="true">TOC</a></span></h2>
  13939. <p>The <samp class="file">graph2dot</samp> program included in the FFmpeg <samp class="file">tools</samp>
  13940. directory can be used to parse a filtergraph description and issue a
  13941. corresponding textual representation in the dot language.
  13942. </p>
  13943. <p>Invoke the command:
  13944. </p><div class="example">
  13945. <pre class="example-preformatted">graph2dot -h
  13946. </pre></div>
  13947. <p>to see how to use <samp class="file">graph2dot</samp>.
  13948. </p>
  13949. <p>You can then pass the dot description to the <samp class="file">dot</samp> program (from
  13950. the graphviz suite of programs) and obtain a graphical representation
  13951. of the filtergraph.
  13952. </p>
  13953. <p>For example the sequence of commands:
  13954. </p><div class="example">
  13955. <pre class="example-preformatted">echo <var class="var">GRAPH_DESCRIPTION</var> | \
  13956. tools/graph2dot -o graph.tmp &amp;&amp; \
  13957. dot -Tpng graph.tmp -o graph.png &amp;&amp; \
  13958. display graph.png
  13959. </pre></div>
  13960. <p>can be used to create and display an image representing the graph
  13961. described by the <var class="var">GRAPH_DESCRIPTION</var> string. Note that this string must be
  13962. a complete self-contained graph, with its inputs and outputs explicitly defined.
  13963. For example if your command line is of the form:
  13964. </p><div class="example">
  13965. <pre class="example-preformatted">ffmpeg -i infile -vf scale=640:360 outfile
  13966. </pre></div>
  13967. <p>your <var class="var">GRAPH_DESCRIPTION</var> string will need to be of the form:
  13968. </p><div class="example">
  13969. <pre class="example-preformatted">nullsrc,scale=640:360,nullsink
  13970. </pre></div>
  13971. <p>you may also need to set the <var class="var">nullsrc</var> parameters and add a <var class="var">format</var>
  13972. filter in order to simulate a specific input file.
  13973. </p>
  13974. <a name="Filtergraph-description"></a>
  13975. <h2 class="chapter">25 Filtergraph description<span class="pull-right"><a class="anchor hidden-xs" href="#Filtergraph-description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtergraph-description" aria-hidden="true">TOC</a></span></h2>
  13976. <p>A filtergraph is a directed graph of connected filters. It can contain
  13977. cycles, and there can be multiple links between a pair of
  13978. filters. Each link has one input pad on one side connecting it to one
  13979. filter from which it takes its input, and one output pad on the other
  13980. side connecting it to one filter accepting its output.
  13981. </p>
  13982. <p>Each filter in a filtergraph is an instance of a filter class
  13983. registered in the application, which defines the features and the
  13984. number of input and output pads of the filter.
  13985. </p>
  13986. <p>A filter with no input pads is called a &quot;source&quot;, and a filter with no
  13987. output pads is called a &quot;sink&quot;.
  13988. </p>
  13989. <a class="anchor" id="Filtergraph-syntax"></a><a name="Filtergraph-syntax-1"></a>
  13990. <h3 class="section">25.1 Filtergraph syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Filtergraph-syntax-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtergraph-syntax-1" aria-hidden="true">TOC</a></span></h3>
  13991. <p>A filtergraph has a textual representation, which is recognized by the
  13992. <samp class="option">-filter</samp>/<samp class="option">-vf</samp>/<samp class="option">-af</samp> and
  13993. <samp class="option">-filter_complex</samp> options in <code class="command">ffmpeg</code> and
  13994. <samp class="option">-vf</samp>/<samp class="option">-af</samp> in <code class="command">ffplay</code>, and by the
  13995. <code class="code">avfilter_graph_parse_ptr()</code> function defined in
  13996. <samp class="file">libavfilter/avfilter.h</samp>.
  13997. </p>
  13998. <p>A filterchain consists of a sequence of connected filters, each one
  13999. connected to the previous one in the sequence. A filterchain is
  14000. represented by a list of &quot;,&quot;-separated filter descriptions.
  14001. </p>
  14002. <p>A filtergraph consists of a sequence of filterchains. A sequence of
  14003. filterchains is represented by a list of &quot;;&quot;-separated filterchain
  14004. descriptions.
  14005. </p>
  14006. <p>A filter is represented by a string of the form:
  14007. [<var class="var">in_link_1</var>]...[<var class="var">in_link_N</var>]<var class="var">filter_name</var>@<var class="var">id</var>=<var class="var">arguments</var>[<var class="var">out_link_1</var>]...[<var class="var">out_link_M</var>]
  14008. </p>
  14009. <p><var class="var">filter_name</var> is the name of the filter class of which the
  14010. described filter is an instance of, and has to be the name of one of
  14011. the filter classes registered in the program optionally followed by &quot;@<var class="var">id</var>&quot;.
  14012. The name of the filter class is optionally followed by a string
  14013. &quot;=<var class="var">arguments</var>&quot;.
  14014. </p>
  14015. <p><var class="var">arguments</var> is a string which contains the parameters used to
  14016. initialize the filter instance. It may have one of two forms:
  14017. </p><ul class="itemize mark-bullet">
  14018. <li>A &rsquo;:&rsquo;-separated list of <var class="var">key=value</var> pairs.
  14019. </li><li>A &rsquo;:&rsquo;-separated list of <var class="var">value</var>. In this case, the keys are assumed to be
  14020. the option names in the order they are declared. E.g. the <code class="code">fade</code> filter
  14021. declares three options in this order &ndash; <samp class="option">type</samp>, <samp class="option">start_frame</samp> and
  14022. <samp class="option">nb_frames</samp>. Then the parameter list <var class="var">in:0:30</var> means that the value
  14023. <var class="var">in</var> is assigned to the option <samp class="option">type</samp>, <var class="var">0</var> to
  14024. <samp class="option">start_frame</samp> and <var class="var">30</var> to <samp class="option">nb_frames</samp>.
  14025. </li><li>A &rsquo;:&rsquo;-separated list of mixed direct <var class="var">value</var> and long <var class="var">key=value</var>
  14026. pairs. The direct <var class="var">value</var> must precede the <var class="var">key=value</var> pairs, and
  14027. follow the same constraints order of the previous point. The following
  14028. <var class="var">key=value</var> pairs can be set in any preferred order.
  14029. </li></ul>
  14030. <p>If the option value itself is a list of items (e.g. the <code class="code">format</code> filter
  14031. takes a list of pixel formats), the items in the list are usually separated by
  14032. &lsquo;<samp class="samp">|</samp>&rsquo;.
  14033. </p>
  14034. <p>The list of arguments can be quoted using the character &lsquo;<samp class="samp">'</samp>&rsquo; as initial
  14035. and ending mark, and the character &lsquo;<samp class="samp">\</samp>&rsquo; for escaping the characters
  14036. within the quoted text; otherwise the argument string is considered
  14037. terminated when the next special character (belonging to the set
  14038. &lsquo;<samp class="samp">[]=;,</samp>&rsquo;) is encountered.
  14039. </p>
  14040. <p>A special syntax implemented in the <code class="command">ffmpeg</code> CLI tool allows loading
  14041. option values from files. This is done be prepending a slash &rsquo;/&rsquo; to the option
  14042. name, then the supplied value is interpreted as a path from which the actual
  14043. value is loaded. E.g.
  14044. </p><div class="example">
  14045. <pre class="example-preformatted">ffmpeg -i &lt;INPUT&gt; -vf drawtext=/text=/tmp/some_text &lt;OUTPUT&gt;
  14046. </pre></div>
  14047. <p>will load the text to be drawn from <samp class="file">/tmp/some_text</samp>. API users wishing to
  14048. implement a similar feature should use the <code class="code">avfilter_graph_segment_*()</code>
  14049. functions together with custom IO code.
  14050. </p>
  14051. <p>The name and arguments of the filter are optionally preceded and
  14052. followed by a list of link labels.
  14053. A link label allows one to name a link and associate it to a filter output
  14054. or input pad. The preceding labels <var class="var">in_link_1</var>
  14055. ... <var class="var">in_link_N</var>, are associated to the filter input pads,
  14056. the following labels <var class="var">out_link_1</var> ... <var class="var">out_link_M</var>, are
  14057. associated to the output pads.
  14058. </p>
  14059. <p>When two link labels with the same name are found in the
  14060. filtergraph, a link between the corresponding input and output pad is
  14061. created.
  14062. </p>
  14063. <p>If an output pad is not labelled, it is linked by default to the first
  14064. unlabelled input pad of the next filter in the filterchain.
  14065. For example in the filterchain
  14066. </p><div class="example">
  14067. <pre class="example-preformatted">nullsrc, split[L1], [L2]overlay, nullsink
  14068. </pre></div>
  14069. <p>the split filter instance has two output pads, and the overlay filter
  14070. instance two input pads. The first output pad of split is labelled
  14071. &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
  14072. output pad of split is linked to the second input pad of overlay,
  14073. which are both unlabelled.
  14074. </p>
  14075. <p>In a filter description, if the input label of the first filter is not
  14076. specified, &quot;in&quot; is assumed; if the output label of the last filter is not
  14077. specified, &quot;out&quot; is assumed.
  14078. </p>
  14079. <p>In a complete filterchain all the unlabelled filter input and output
  14080. pads must be connected. A filtergraph is considered valid if all the
  14081. filter input and output pads of all the filterchains are connected.
  14082. </p>
  14083. <p>Leading and trailing whitespaces (space, tabs, or line feeds) separating tokens
  14084. in the filtergraph specification are ignored. This means that the filtergraph
  14085. can be expressed using empty lines and spaces to improve readability.
  14086. </p>
  14087. <p>For example, the filtergraph:
  14088. </p><div class="example">
  14089. <pre class="example-preformatted">testsrc,split[L1],hflip[L2];[L1][L2] hstack
  14090. </pre></div>
  14091. <p>can be represented as:
  14092. </p><div class="example">
  14093. <pre class="example-preformatted">testsrc,
  14094. split [L1], hflip [L2];
  14095. [L1][L2] hstack
  14096. </pre></div>
  14097. <p>Libavfilter will automatically insert <a class="ref" href="#scale">scale</a> filters where format
  14098. conversion is required. It is possible to specify swscale flags
  14099. for those automatically inserted scalers by prepending
  14100. <code class="code">sws_flags=<var class="var">flags</var>;</code>
  14101. to the filtergraph description.
  14102. </p>
  14103. <p>Here is a BNF description of the filtergraph syntax:
  14104. </p><div class="example">
  14105. <pre class="example-preformatted"><var class="var">NAME</var> ::= sequence of alphanumeric characters and '_'
  14106. <var class="var">FILTER_NAME</var> ::= <var class="var">NAME</var>[&quot;@&quot;<var class="var">NAME</var>]
  14107. <var class="var">LINKLABEL</var> ::= &quot;[&quot; <var class="var">NAME</var> &quot;]&quot;
  14108. <var class="var">LINKLABELS</var> ::= <var class="var">LINKLABEL</var> [<var class="var">LINKLABELS</var>]
  14109. <var class="var">FILTER_ARGUMENTS</var> ::= sequence of chars (possibly quoted)
  14110. <var class="var">FILTER</var> ::= [<var class="var">LINKLABELS</var>] <var class="var">FILTER_NAME</var> [&quot;=&quot; <var class="var">FILTER_ARGUMENTS</var>] [<var class="var">LINKLABELS</var>]
  14111. <var class="var">FILTERCHAIN</var> ::= <var class="var">FILTER</var> [,<var class="var">FILTERCHAIN</var>]
  14112. <var class="var">FILTERGRAPH</var> ::= [sws_flags=<var class="var">flags</var>;] <var class="var">FILTERCHAIN</var> [;<var class="var">FILTERGRAPH</var>]
  14113. </pre></div>
  14114. <a class="anchor" id="filtergraph-escaping"></a><a name="Notes-on-filtergraph-escaping"></a>
  14115. <h3 class="section">25.2 Notes on filtergraph escaping<span class="pull-right"><a class="anchor hidden-xs" href="#Notes-on-filtergraph-escaping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Notes-on-filtergraph-escaping" aria-hidden="true">TOC</a></span></h3>
  14116. <p>Filtergraph description composition entails several levels of
  14117. escaping. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">the &quot;Quoting and escaping&quot;
  14118. section in the ffmpeg-utils(1) manual</a> for more
  14119. information about the employed escaping procedure.
  14120. </p>
  14121. <p>A first level escaping affects the content of each filter option
  14122. value, which may contain the special character <code class="code">:</code> used to
  14123. separate values, or one of the escaping characters <code class="code">\'</code>.
  14124. </p>
  14125. <p>A second level escaping affects the whole filter description, which
  14126. may contain the escaping characters <code class="code">\'</code> or the special
  14127. characters <code class="code">[],;</code> used by the filtergraph description.
  14128. </p>
  14129. <p>Finally, when you specify a filtergraph on a shell commandline, you
  14130. need to perform a third level escaping for the shell special
  14131. characters contained within it.
  14132. </p>
  14133. <p>For example, consider the following string to be embedded in
  14134. the <a class="ref" href="#drawtext">drawtext</a> filter description <samp class="option">text</samp> value:
  14135. </p><div class="example">
  14136. <pre class="example-preformatted">this is a 'string': may contain one, or more, special characters
  14137. </pre></div>
  14138. <p>This string contains the <code class="code">'</code> special escaping character, and the
  14139. <code class="code">:</code> special character, so it needs to be escaped in this way:
  14140. </p><div class="example">
  14141. <pre class="example-preformatted">text=this is a \'string\'\: may contain one, or more, special characters
  14142. </pre></div>
  14143. <p>A second level of escaping is required when embedding the filter
  14144. description in a filtergraph description, in order to escape all the
  14145. filtergraph special characters. Thus the example above becomes:
  14146. </p><div class="example">
  14147. <pre class="example-preformatted">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
  14148. </pre></div>
  14149. <p>(note that in addition to the <code class="code">\'</code> escaping special characters,
  14150. also <code class="code">,</code> needs to be escaped).
  14151. </p>
  14152. <p>Finally an additional level of escaping is needed when writing the
  14153. filtergraph description in a shell command, which depends on the
  14154. escaping rules of the adopted shell. For example, assuming that
  14155. <code class="code">\</code> is special and needs to be escaped with another <code class="code">\</code>, the
  14156. previous string will finally result in:
  14157. </p><div class="example">
  14158. <pre class="example-preformatted">-vf &quot;drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&quot;
  14159. </pre></div>
  14160. <p>In order to avoid cumbersome escaping when using a commandline tool accepting a
  14161. filter specification as input, it is advisable to avoid direct inclusion of the
  14162. filter or options specification in the shell.
  14163. </p>
  14164. <p>For example, in case of the <a class="ref" href="#drawtext">drawtext filter</a>, you might prefer to
  14165. use the <samp class="option">textfile</samp> option in place of <samp class="option">text</samp> to specify the text
  14166. to render.
  14167. </p>
  14168. <a name="Timeline-editing"></a>
  14169. <h2 class="chapter">26 Timeline editing<span class="pull-right"><a class="anchor hidden-xs" href="#Timeline-editing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Timeline-editing" aria-hidden="true">TOC</a></span></h2>
  14170. <p>Some filters support a generic <samp class="option">enable</samp> option. For the filters
  14171. supporting timeline editing, this option can be set to an expression which is
  14172. evaluated before sending a frame to the filter. If the evaluation is non-zero,
  14173. the filter will be enabled, otherwise the frame will be sent unchanged to the
  14174. next filter in the filtergraph.
  14175. </p>
  14176. <p>The expression accepts the following values:
  14177. </p><dl class="table">
  14178. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  14179. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  14180. </p>
  14181. </dd>
  14182. <dt>&lsquo;<samp class="samp">n</samp>&rsquo;</dt>
  14183. <dd><p>sequential number of the input frame, starting from 0
  14184. </p>
  14185. </dd>
  14186. <dt>&lsquo;<samp class="samp">pos</samp>&rsquo;</dt>
  14187. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated, do
  14188. not use
  14189. </p>
  14190. </dd>
  14191. <dt>&lsquo;<samp class="samp">w</samp>&rsquo;</dt>
  14192. <dt>&lsquo;<samp class="samp">h</samp>&rsquo;</dt>
  14193. <dd><p>width and height of the input frame if video
  14194. </p></dd>
  14195. </dl>
  14196. <p>Additionally, these filters support an <samp class="option">enable</samp> command that can be used
  14197. to re-define the expression.
  14198. </p>
  14199. <p>Like any other filtering option, the <samp class="option">enable</samp> option follows the same
  14200. rules.
  14201. </p>
  14202. <p>For example, to enable a blur filter (<a class="ref" href="#smartblur">smartblur</a>) from 10 seconds to 3
  14203. minutes, and a <a class="ref" href="#curves">curves</a> filter starting at 3 seconds:
  14204. </p><div class="example">
  14205. <pre class="example-preformatted">smartblur = enable='between(t,10,3*60)',
  14206. curves = enable='gte(t,3)' : preset=cross_process
  14207. </pre></div>
  14208. <p>See <code class="code">ffmpeg -filters</code> to view which filters have timeline support.
  14209. </p>
  14210. <a class="anchor" id="commands"></a><a name="Changing-options-at-runtime-with-a-command"></a>
  14211. <h2 class="chapter">27 Changing options at runtime with a command<span class="pull-right"><a class="anchor hidden-xs" href="#Changing-options-at-runtime-with-a-command" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Changing-options-at-runtime-with-a-command" aria-hidden="true">TOC</a></span></h2>
  14212. <p>Some options can be changed during the operation of the filter using
  14213. a command. These options are marked &rsquo;T&rsquo; on the output of
  14214. <code class="command">ffmpeg</code> <samp class="option">-h filter=&lt;name of filter&gt;</samp>.
  14215. The name of the command is the name of the option and the argument is
  14216. the new value.
  14217. </p>
  14218. <a class="anchor" id="framesync"></a><a name="Options-for-filters-with-several-inputs-_0028framesync_0029"></a>
  14219. <h2 class="chapter">28 Options for filters with several inputs (framesync)<span class="pull-right"><a class="anchor hidden-xs" href="#Options-for-filters-with-several-inputs-_0028framesync_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-for-filters-with-several-inputs-_0028framesync_0029" aria-hidden="true">TOC</a></span></h2>
  14220. <p>Some filters with several inputs support a common set of options.
  14221. These options can only be set by name, not with the short notation.
  14222. </p>
  14223. <dl class="table">
  14224. <dt><samp class="option">eof_action</samp></dt>
  14225. <dd><p>The action to take when EOF is encountered on the secondary input; it accepts
  14226. one of the following values:
  14227. </p>
  14228. <dl class="table">
  14229. <dt><samp class="option">repeat</samp></dt>
  14230. <dd><p>Repeat the last frame (the default).
  14231. </p></dd>
  14232. <dt><samp class="option">endall</samp></dt>
  14233. <dd><p>End both streams.
  14234. </p></dd>
  14235. <dt><samp class="option">pass</samp></dt>
  14236. <dd><p>Pass the main input through.
  14237. </p></dd>
  14238. </dl>
  14239. </dd>
  14240. <dt><samp class="option">shortest</samp></dt>
  14241. <dd><p>If set to 1, force the output to terminate when the shortest input
  14242. terminates. Default value is 0.
  14243. </p>
  14244. </dd>
  14245. <dt><samp class="option">repeatlast</samp></dt>
  14246. <dd><p>If set to 1, force the filter to extend the last frame of secondary streams
  14247. until the end of the primary stream. A value of 0 disables this behavior.
  14248. Default value is 1.
  14249. </p>
  14250. </dd>
  14251. <dt><samp class="option">ts_sync_mode</samp></dt>
  14252. <dd><p>How strictly to sync streams based on secondary input timestamps; it accepts
  14253. one of the following values:
  14254. </p>
  14255. <dl class="table">
  14256. <dt><samp class="option">default</samp></dt>
  14257. <dd><p>Frame from secondary input with the nearest lower or equal timestamp to the
  14258. primary input frame.
  14259. </p></dd>
  14260. <dt><samp class="option">nearest</samp></dt>
  14261. <dd><p>Frame from secondary input with the absolute nearest timestamp to the primary
  14262. input frame.
  14263. </p></dd>
  14264. </dl>
  14265. </dd>
  14266. </dl>
  14267. <a name="Audio-Filters"></a>
  14268. <h2 class="chapter">29 Audio Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Filters" aria-hidden="true">TOC</a></span></h2>
  14269. <p>When you configure your FFmpeg build, you can disable any of the
  14270. existing filters using <code class="code">--disable-filters</code>.
  14271. The configure output will show the audio filters included in your
  14272. build.
  14273. </p>
  14274. <p>Below is a description of the currently available audio filters.
  14275. </p>
  14276. <a name="aap"></a>
  14277. <h3 class="section">29.1 aap<span class="pull-right"><a class="anchor hidden-xs" href="#aap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aap" aria-hidden="true">TOC</a></span></h3>
  14278. <p>Apply Affine Projection algorithm to the first audio stream using the second audio stream.
  14279. </p>
  14280. <p>This adaptive filter is used to estimate unknown audio based on multiple input audio samples.
  14281. Affine projection algorithm can make trade-offs between computation complexity with convergence speed.
  14282. </p>
  14283. <p>A description of the accepted options follows.
  14284. </p>
  14285. <dl class="table">
  14286. <dt><samp class="option">order</samp></dt>
  14287. <dd><p>Set the filter order.
  14288. </p>
  14289. </dd>
  14290. <dt><samp class="option">projection</samp></dt>
  14291. <dd><p>Set the projection order.
  14292. </p>
  14293. </dd>
  14294. <dt><samp class="option">mu</samp></dt>
  14295. <dd><p>Set the filter mu.
  14296. </p>
  14297. </dd>
  14298. <dt><samp class="option">delta</samp></dt>
  14299. <dd><p>Set the coefficient to initialize internal covariance matrix.
  14300. </p>
  14301. </dd>
  14302. <dt><samp class="option">out_mode</samp></dt>
  14303. <dd><p>Set the filter output samples. It accepts the following values:
  14304. </p><dl class="table">
  14305. <dt><samp class="option">i</samp></dt>
  14306. <dd><p>Pass the 1st input.
  14307. </p>
  14308. </dd>
  14309. <dt><samp class="option">d</samp></dt>
  14310. <dd><p>Pass the 2nd input.
  14311. </p>
  14312. </dd>
  14313. <dt><samp class="option">o</samp></dt>
  14314. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  14315. </p>
  14316. </dd>
  14317. <dt><samp class="option">n</samp></dt>
  14318. <dd><p>Pass difference between input, 1st input and error signal estimate.
  14319. </p>
  14320. </dd>
  14321. <dt><samp class="option">e</samp></dt>
  14322. <dd><p>Pass error signal estimated samples.
  14323. </p>
  14324. <p>Default value is <var class="var">o</var>.
  14325. </p></dd>
  14326. </dl>
  14327. </dd>
  14328. <dt><samp class="option">precision</samp></dt>
  14329. <dd><p>Set which precision to use when processing samples.
  14330. </p>
  14331. <dl class="table">
  14332. <dt><samp class="option">auto</samp></dt>
  14333. <dd><p>Auto pick internal sample format depending on other filters.
  14334. </p>
  14335. </dd>
  14336. <dt><samp class="option">float</samp></dt>
  14337. <dd><p>Always use single-floating point precision sample format.
  14338. </p>
  14339. </dd>
  14340. <dt><samp class="option">double</samp></dt>
  14341. <dd><p>Always use double-floating point precision sample format.
  14342. </p></dd>
  14343. </dl>
  14344. </dd>
  14345. </dl>
  14346. <a name="acompressor"></a>
  14347. <h3 class="section">29.2 acompressor<span class="pull-right"><a class="anchor hidden-xs" href="#acompressor" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acompressor" aria-hidden="true">TOC</a></span></h3>
  14348. <p>A compressor is mainly used to reduce the dynamic range of a signal.
  14349. Especially modern music is mostly compressed at a high ratio to
  14350. improve the overall loudness. It&rsquo;s done to get the highest attention
  14351. of a listener, &quot;fatten&quot; the sound and bring more &quot;power&quot; to the track.
  14352. If a signal is compressed too much it may sound dull or &quot;dead&quot;
  14353. afterwards or it may start to &quot;pump&quot; (which could be a powerful effect
  14354. but can also destroy a track completely).
  14355. The right compression is the key to reach a professional sound and is
  14356. the high art of mixing and mastering. Because of its complex settings
  14357. it may take a long time to get the right feeling for this kind of effect.
  14358. </p>
  14359. <p>Compression is done by detecting the volume above a chosen level
  14360. <code class="code">threshold</code> and dividing it by the factor set with <code class="code">ratio</code>.
  14361. So if you set the threshold to -12dB and your signal reaches -6dB a ratio
  14362. of 2:1 will result in a signal at -9dB. Because an exact manipulation of
  14363. the signal would cause distortion of the waveform the reduction can be
  14364. levelled over the time. This is done by setting &quot;Attack&quot; and &quot;Release&quot;.
  14365. <code class="code">attack</code> determines how long the signal has to rise above the threshold
  14366. before any reduction will occur and <code class="code">release</code> sets the time the signal
  14367. has to fall below the threshold to reduce the reduction again. Shorter signals
  14368. than the chosen attack time will be left untouched.
  14369. The overall reduction of the signal can be made up afterwards with the
  14370. <code class="code">makeup</code> setting. So compressing the peaks of a signal about 6dB and
  14371. raising the makeup to this level results in a signal twice as loud than the
  14372. source. To gain a softer entry in the compression the <code class="code">knee</code> flattens the
  14373. hard edge at the threshold in the range of the chosen decibels.
  14374. </p>
  14375. <p>The filter accepts the following options:
  14376. </p>
  14377. <dl class="table">
  14378. <dt><samp class="option">level_in</samp></dt>
  14379. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  14380. </p>
  14381. </dd>
  14382. <dt><samp class="option">mode</samp></dt>
  14383. <dd><p>Set mode of compressor operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  14384. Default is <code class="code">downward</code>.
  14385. </p>
  14386. </dd>
  14387. <dt><samp class="option">threshold</samp></dt>
  14388. <dd><p>If a signal of stream rises above this level it will affect the gain
  14389. reduction.
  14390. By default it is 0.125. Range is between 0.00097563 and 1.
  14391. </p>
  14392. </dd>
  14393. <dt><samp class="option">ratio</samp></dt>
  14394. <dd><p>Set a ratio by which the signal is reduced. 1:2 means that if the level
  14395. rose 4dB above the threshold, it will be only 2dB above after the reduction.
  14396. Default is 2. Range is between 1 and 20.
  14397. </p>
  14398. </dd>
  14399. <dt><samp class="option">attack</samp></dt>
  14400. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  14401. reduction starts. Default is 20. Range is between 0.01 and 2000.
  14402. </p>
  14403. </dd>
  14404. <dt><samp class="option">release</samp></dt>
  14405. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  14406. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  14407. </p>
  14408. </dd>
  14409. <dt><samp class="option">makeup</samp></dt>
  14410. <dd><p>Set the amount by how much signal will be amplified after processing.
  14411. Default is 1. Range is from 1 to 64.
  14412. </p>
  14413. </dd>
  14414. <dt><samp class="option">knee</samp></dt>
  14415. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  14416. Default is 2.82843. Range is between 1 and 8.
  14417. </p>
  14418. </dd>
  14419. <dt><samp class="option">link</samp></dt>
  14420. <dd><p>Choose if the <code class="code">average</code> level between all channels of input stream
  14421. or the louder(<code class="code">maximum</code>) channel of input stream affects the
  14422. reduction. Default is <code class="code">average</code>.
  14423. </p>
  14424. </dd>
  14425. <dt><samp class="option">detection</samp></dt>
  14426. <dd><p>Should the exact signal be taken in case of <code class="code">peak</code> or an RMS one in case
  14427. of <code class="code">rms</code>. Default is <code class="code">rms</code> which is mostly smoother.
  14428. </p>
  14429. </dd>
  14430. <dt><samp class="option">mix</samp></dt>
  14431. <dd><p>How much to use compressed signal in output. Default is 1.
  14432. Range is between 0 and 1.
  14433. </p></dd>
  14434. </dl>
  14435. <a name="Commands"></a>
  14436. <h4 class="subsection">29.2.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands" aria-hidden="true">TOC</a></span></h4>
  14437. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  14438. </p>
  14439. <a name="acontrast"></a>
  14440. <h3 class="section">29.3 acontrast<span class="pull-right"><a class="anchor hidden-xs" href="#acontrast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acontrast" aria-hidden="true">TOC</a></span></h3>
  14441. <p>Simple audio dynamic range compression/expansion filter.
  14442. </p>
  14443. <p>The filter accepts the following options:
  14444. </p>
  14445. <dl class="table">
  14446. <dt><samp class="option">contrast</samp></dt>
  14447. <dd><p>Set contrast. Default is 33. Allowed range is between 0 and 100.
  14448. </p></dd>
  14449. </dl>
  14450. <a name="acopy"></a>
  14451. <h3 class="section">29.4 acopy<span class="pull-right"><a class="anchor hidden-xs" href="#acopy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acopy" aria-hidden="true">TOC</a></span></h3>
  14452. <p>Copy the input audio source unchanged to the output. This is mainly useful for
  14453. testing purposes.
  14454. </p>
  14455. <a name="acrossfade"></a>
  14456. <h3 class="section">29.5 acrossfade<span class="pull-right"><a class="anchor hidden-xs" href="#acrossfade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acrossfade" aria-hidden="true">TOC</a></span></h3>
  14457. <p>Apply cross fade from one input audio stream to another input audio stream.
  14458. The cross fade is applied for specified duration near the end of first stream.
  14459. </p>
  14460. <p>The filter accepts the following options:
  14461. </p>
  14462. <dl class="table">
  14463. <dt><samp class="option">inputs, n</samp></dt>
  14464. <dd><p>Specify the number of inputs to crossfade. When crossfading multiple inputs,
  14465. each input will be concatenated and crossfaded in sequence, similar to the
  14466. <a class="ref" href="#concat-filter">concat filter</a>. Default is 2.
  14467. </p>
  14468. </dd>
  14469. <dt><samp class="option">nb_samples, ns</samp></dt>
  14470. <dd><p>Specify the number of samples for which the cross fade effect has to last.
  14471. At the end of the cross fade effect the first input audio will be completely
  14472. silent. Default is 44100.
  14473. </p>
  14474. </dd>
  14475. <dt><samp class="option">duration, d</samp></dt>
  14476. <dd><p>Specify the duration of the cross fade effect. See
  14477. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  14478. for the accepted syntax.
  14479. By default the duration is determined by <var class="var">nb_samples</var>.
  14480. If set this option is used instead of <var class="var">nb_samples</var>.
  14481. </p>
  14482. </dd>
  14483. <dt><samp class="option">overlap, o</samp></dt>
  14484. <dd><p>Should first stream end overlap with second stream start. Default is enabled.
  14485. </p>
  14486. </dd>
  14487. <dt><samp class="option">curve1</samp></dt>
  14488. <dd><p>Set curve for cross fade transition for first stream.
  14489. </p>
  14490. </dd>
  14491. <dt><samp class="option">curve2</samp></dt>
  14492. <dd><p>Set curve for cross fade transition for second stream.
  14493. </p>
  14494. <p>For description of available curve types see <a class="ref" href="#afade">afade</a> filter description.
  14495. </p></dd>
  14496. </dl>
  14497. <a name="Examples-18"></a>
  14498. <h4 class="subsection">29.5.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-18" aria-hidden="true">TOC</a></span></h4>
  14499. <ul class="itemize mark-bullet">
  14500. <li>Cross fade from one input to another:
  14501. <div class="example">
  14502. <pre class="example-preformatted">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
  14503. </pre></div>
  14504. </li><li>Cross fade from one input to another but without overlapping:
  14505. <div class="example">
  14506. <pre class="example-preformatted">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
  14507. </pre></div>
  14508. <p>Concatenate multiple inputs with cross fade between each:
  14509. </p><div class="example">
  14510. <pre class="example-preformatted">ffmpeg -i first.flac -i second.flac -i third.flac -filter_complex acrossfade=n=3 output.flac
  14511. </pre></div>
  14512. </li></ul>
  14513. <a name="acrossover"></a>
  14514. <h3 class="section">29.6 acrossover<span class="pull-right"><a class="anchor hidden-xs" href="#acrossover" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acrossover" aria-hidden="true">TOC</a></span></h3>
  14515. <p>Split audio stream into several bands.
  14516. </p>
  14517. <p>This filter splits audio stream into two or more frequency ranges.
  14518. Summing all streams back will give flat output.
  14519. </p>
  14520. <p>The filter accepts the following options:
  14521. </p>
  14522. <dl class="table">
  14523. <dt><samp class="option">split</samp></dt>
  14524. <dd><p>Set split frequencies. Those must be positive and increasing.
  14525. </p>
  14526. </dd>
  14527. <dt><samp class="option">order</samp></dt>
  14528. <dd><p>Set filter order for each band split. This controls filter roll-off or steepness
  14529. of filter transfer function.
  14530. Available values are:
  14531. </p>
  14532. <dl class="table">
  14533. <dt>&lsquo;<samp class="samp">2nd</samp>&rsquo;</dt>
  14534. <dd><p>12 dB per octave.
  14535. </p></dd>
  14536. <dt>&lsquo;<samp class="samp">4th</samp>&rsquo;</dt>
  14537. <dd><p>24 dB per octave.
  14538. </p></dd>
  14539. <dt>&lsquo;<samp class="samp">6th</samp>&rsquo;</dt>
  14540. <dd><p>36 dB per octave.
  14541. </p></dd>
  14542. <dt>&lsquo;<samp class="samp">8th</samp>&rsquo;</dt>
  14543. <dd><p>48 dB per octave.
  14544. </p></dd>
  14545. <dt>&lsquo;<samp class="samp">10th</samp>&rsquo;</dt>
  14546. <dd><p>60 dB per octave.
  14547. </p></dd>
  14548. <dt>&lsquo;<samp class="samp">12th</samp>&rsquo;</dt>
  14549. <dd><p>72 dB per octave.
  14550. </p></dd>
  14551. <dt>&lsquo;<samp class="samp">14th</samp>&rsquo;</dt>
  14552. <dd><p>84 dB per octave.
  14553. </p></dd>
  14554. <dt>&lsquo;<samp class="samp">16th</samp>&rsquo;</dt>
  14555. <dd><p>96 dB per octave.
  14556. </p></dd>
  14557. <dt>&lsquo;<samp class="samp">18th</samp>&rsquo;</dt>
  14558. <dd><p>108 dB per octave.
  14559. </p></dd>
  14560. <dt>&lsquo;<samp class="samp">20th</samp>&rsquo;</dt>
  14561. <dd><p>120 dB per octave.
  14562. </p></dd>
  14563. </dl>
  14564. <p>Default is <var class="var">4th</var>.
  14565. </p>
  14566. </dd>
  14567. <dt><samp class="option">level</samp></dt>
  14568. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  14569. </p>
  14570. </dd>
  14571. <dt><samp class="option">gains</samp></dt>
  14572. <dd><p>Set output gain for each band. Default value is 1 for all bands.
  14573. </p>
  14574. </dd>
  14575. <dt><samp class="option">precision</samp></dt>
  14576. <dd><p>Set which precision to use when processing samples.
  14577. </p>
  14578. <dl class="table">
  14579. <dt><samp class="option">auto</samp></dt>
  14580. <dd><p>Auto pick internal sample format depending on other filters.
  14581. </p>
  14582. </dd>
  14583. <dt><samp class="option">float</samp></dt>
  14584. <dd><p>Always use single-floating point precision sample format.
  14585. </p>
  14586. </dd>
  14587. <dt><samp class="option">double</samp></dt>
  14588. <dd><p>Always use double-floating point precision sample format.
  14589. </p></dd>
  14590. </dl>
  14591. <p>Default value is <code class="code">auto</code>.
  14592. </p></dd>
  14593. </dl>
  14594. <a name="Examples-19"></a>
  14595. <h4 class="subsection">29.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-19" aria-hidden="true">TOC</a></span></h4>
  14596. <ul class="itemize mark-bullet">
  14597. <li>Split input audio stream into two bands (low and high) with split frequency of 1500 Hz,
  14598. each band will be in separate stream:
  14599. <div class="example">
  14600. <pre class="example-preformatted">ffmpeg -i in.flac -filter_complex 'acrossover=split=1500[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
  14601. </pre></div>
  14602. </li><li>Same as above, but with higher filter order:
  14603. <div class="example">
  14604. <pre class="example-preformatted">ffmpeg -i in.flac -filter_complex 'acrossover=split=1500:order=8th[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
  14605. </pre></div>
  14606. </li><li>Same as above, but also with additional middle band (frequencies between 1500 and 8000):
  14607. <div class="example">
  14608. <pre class="example-preformatted">ffmpeg -i in.flac -filter_complex 'acrossover=split=1500 8000:order=8th[LOW][MID][HIGH]' -map '[LOW]' low.wav -map '[MID]' mid.wav -map '[HIGH]' high.wav
  14609. </pre></div>
  14610. </li></ul>
  14611. <a name="acrusher"></a>
  14612. <h3 class="section">29.7 acrusher<span class="pull-right"><a class="anchor hidden-xs" href="#acrusher" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acrusher" aria-hidden="true">TOC</a></span></h3>
  14613. <p>Reduce audio bit resolution.
  14614. </p>
  14615. <p>This filter is bit crusher with enhanced functionality. A bit crusher
  14616. is used to audibly reduce number of bits an audio signal is sampled
  14617. with. This doesn&rsquo;t change the bit depth at all, it just produces the
  14618. effect. Material reduced in bit depth sounds more harsh and &quot;digital&quot;.
  14619. This filter is able to even round to continuous values instead of discrete
  14620. bit depths.
  14621. Additionally it has a D/C offset which results in different crushing of
  14622. the lower and the upper half of the signal.
  14623. An Anti-Aliasing setting is able to produce &quot;softer&quot; crushing sounds.
  14624. </p>
  14625. <p>Another feature of this filter is the logarithmic mode.
  14626. This setting switches from linear distances between bits to logarithmic ones.
  14627. The result is a much more &quot;natural&quot; sounding crusher which doesn&rsquo;t gate low
  14628. signals for example. The human ear has a logarithmic perception,
  14629. so this kind of crushing is much more pleasant.
  14630. Logarithmic crushing is also able to get anti-aliased.
  14631. </p>
  14632. <p>The filter accepts the following options:
  14633. </p>
  14634. <dl class="table">
  14635. <dt><samp class="option">level_in</samp></dt>
  14636. <dd><p>Set level in.
  14637. </p>
  14638. </dd>
  14639. <dt><samp class="option">level_out</samp></dt>
  14640. <dd><p>Set level out.
  14641. </p>
  14642. </dd>
  14643. <dt><samp class="option">bits</samp></dt>
  14644. <dd><p>Set bit reduction.
  14645. </p>
  14646. </dd>
  14647. <dt><samp class="option">mix</samp></dt>
  14648. <dd><p>Set mixing amount.
  14649. </p>
  14650. </dd>
  14651. <dt><samp class="option">mode</samp></dt>
  14652. <dd><p>Can be linear: <code class="code">lin</code> or logarithmic: <code class="code">log</code>.
  14653. </p>
  14654. </dd>
  14655. <dt><samp class="option">dc</samp></dt>
  14656. <dd><p>Set DC.
  14657. </p>
  14658. </dd>
  14659. <dt><samp class="option">aa</samp></dt>
  14660. <dd><p>Set anti-aliasing.
  14661. </p>
  14662. </dd>
  14663. <dt><samp class="option">samples</samp></dt>
  14664. <dd><p>Set sample reduction.
  14665. </p>
  14666. </dd>
  14667. <dt><samp class="option">lfo</samp></dt>
  14668. <dd><p>Enable LFO. By default disabled.
  14669. </p>
  14670. </dd>
  14671. <dt><samp class="option">lforange</samp></dt>
  14672. <dd><p>Set LFO range.
  14673. </p>
  14674. </dd>
  14675. <dt><samp class="option">lforate</samp></dt>
  14676. <dd><p>Set LFO rate.
  14677. </p></dd>
  14678. </dl>
  14679. <a name="Commands-1"></a>
  14680. <h4 class="subsection">29.7.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-1" aria-hidden="true">TOC</a></span></h4>
  14681. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  14682. </p>
  14683. <a name="acue"></a>
  14684. <h3 class="section">29.8 acue<span class="pull-right"><a class="anchor hidden-xs" href="#acue" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acue" aria-hidden="true">TOC</a></span></h3>
  14685. <p>Delay audio filtering until a given wallclock timestamp. See the <a class="ref" href="#cue">cue</a>
  14686. filter.
  14687. </p>
  14688. <a name="adeclick"></a>
  14689. <h3 class="section">29.9 adeclick<span class="pull-right"><a class="anchor hidden-xs" href="#adeclick" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adeclick" aria-hidden="true">TOC</a></span></h3>
  14690. <p>Remove impulsive noise from input audio.
  14691. </p>
  14692. <p>Samples detected as impulsive noise are replaced by interpolated samples using
  14693. autoregressive modelling.
  14694. </p>
  14695. <dl class="table">
  14696. <dt><samp class="option">window, w</samp></dt>
  14697. <dd><p>Set window size, in milliseconds. Allowed range is from <code class="code">10</code> to
  14698. <code class="code">100</code>. Default value is <code class="code">55</code> milliseconds.
  14699. This sets size of window which will be processed at once.
  14700. </p>
  14701. </dd>
  14702. <dt><samp class="option">overlap, o</samp></dt>
  14703. <dd><p>Set window overlap, in percentage of window size. Allowed range is from
  14704. <code class="code">50</code> to <code class="code">95</code>. Default value is <code class="code">75</code> percent.
  14705. Setting this to a very high value increases impulsive noise removal but makes
  14706. whole process much slower.
  14707. </p>
  14708. </dd>
  14709. <dt><samp class="option">arorder, a</samp></dt>
  14710. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  14711. <code class="code">0</code> to <code class="code">25</code>. Default value is <code class="code">2</code> percent. This option also
  14712. controls quality of interpolated samples using neighbour good samples.
  14713. </p>
  14714. </dd>
  14715. <dt><samp class="option">threshold, t</samp></dt>
  14716. <dd><p>Set threshold value. Allowed range is from <code class="code">1</code> to <code class="code">100</code>.
  14717. Default value is <code class="code">2</code>.
  14718. This controls the strength of impulsive noise which is going to be removed.
  14719. The lower value, the more samples will be detected as impulsive noise.
  14720. </p>
  14721. </dd>
  14722. <dt><samp class="option">burst, b</samp></dt>
  14723. <dd><p>Set burst fusion, in percentage of window size. Allowed range is <code class="code">0</code> to
  14724. <code class="code">10</code>. Default value is <code class="code">2</code>.
  14725. If any two samples detected as noise are spaced less than this value then any
  14726. sample between those two samples will be also detected as noise.
  14727. </p>
  14728. </dd>
  14729. <dt><samp class="option">method, m</samp></dt>
  14730. <dd><p>Set overlap method.
  14731. </p>
  14732. <p>It accepts the following values:
  14733. </p><dl class="table">
  14734. <dt><samp class="option">add, a</samp></dt>
  14735. <dd><p>Select overlap-add method. Even not interpolated samples are slightly
  14736. changed with this method.
  14737. </p>
  14738. </dd>
  14739. <dt><samp class="option">save, s</samp></dt>
  14740. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  14741. </p></dd>
  14742. </dl>
  14743. <p>Default value is <code class="code">a</code>.
  14744. </p></dd>
  14745. </dl>
  14746. <a name="adeclip"></a>
  14747. <h3 class="section">29.10 adeclip<span class="pull-right"><a class="anchor hidden-xs" href="#adeclip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adeclip" aria-hidden="true">TOC</a></span></h3>
  14748. <p>Remove clipped samples from input audio.
  14749. </p>
  14750. <p>Samples detected as clipped are replaced by interpolated samples using
  14751. autoregressive modelling.
  14752. </p>
  14753. <dl class="table">
  14754. <dt><samp class="option">window, w</samp></dt>
  14755. <dd><p>Set window size, in milliseconds. Allowed range is from <code class="code">10</code> to <code class="code">100</code>.
  14756. Default value is <code class="code">55</code> milliseconds.
  14757. This sets size of window which will be processed at once.
  14758. </p>
  14759. </dd>
  14760. <dt><samp class="option">overlap, o</samp></dt>
  14761. <dd><p>Set window overlap, in percentage of window size. Allowed range is from <code class="code">50</code>
  14762. to <code class="code">95</code>. Default value is <code class="code">75</code> percent.
  14763. </p>
  14764. </dd>
  14765. <dt><samp class="option">arorder, a</samp></dt>
  14766. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  14767. <code class="code">0</code> to <code class="code">25</code>. Default value is <code class="code">8</code> percent. This option also controls
  14768. quality of interpolated samples using neighbour good samples.
  14769. </p>
  14770. </dd>
  14771. <dt><samp class="option">threshold, t</samp></dt>
  14772. <dd><p>Set threshold value. Allowed range is from <code class="code">1</code> to <code class="code">100</code>.
  14773. Default value is <code class="code">10</code>. Higher values make clip detection less aggressive.
  14774. </p>
  14775. </dd>
  14776. <dt><samp class="option">hsize, n</samp></dt>
  14777. <dd><p>Set size of histogram used to detect clips. Allowed range is from <code class="code">100</code> to <code class="code">9999</code>.
  14778. Default value is <code class="code">1000</code>. Higher values make clip detection less aggressive.
  14779. </p>
  14780. </dd>
  14781. <dt><samp class="option">method, m</samp></dt>
  14782. <dd><p>Set overlap method.
  14783. </p>
  14784. <p>It accepts the following values:
  14785. </p><dl class="table">
  14786. <dt><samp class="option">add, a</samp></dt>
  14787. <dd><p>Select overlap-add method. Even not interpolated samples are slightly changed
  14788. with this method.
  14789. </p>
  14790. </dd>
  14791. <dt><samp class="option">save, s</samp></dt>
  14792. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  14793. </p></dd>
  14794. </dl>
  14795. <p>Default value is <code class="code">a</code>.
  14796. </p></dd>
  14797. </dl>
  14798. <a name="adecorrelate"></a>
  14799. <h3 class="section">29.11 adecorrelate<span class="pull-right"><a class="anchor hidden-xs" href="#adecorrelate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adecorrelate" aria-hidden="true">TOC</a></span></h3>
  14800. <p>Apply decorrelation to input audio stream.
  14801. </p>
  14802. <p>The filter accepts the following options:
  14803. </p>
  14804. <dl class="table">
  14805. <dt><samp class="option">stages</samp></dt>
  14806. <dd><p>Set decorrelation stages of filtering. Allowed
  14807. range is from 1 to 16. Default value is 6.
  14808. </p>
  14809. </dd>
  14810. <dt><samp class="option">seed</samp></dt>
  14811. <dd><p>Set random seed used for setting delay in samples across channels.
  14812. </p></dd>
  14813. </dl>
  14814. <a name="adelay"></a>
  14815. <h3 class="section">29.12 adelay<span class="pull-right"><a class="anchor hidden-xs" href="#adelay" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adelay" aria-hidden="true">TOC</a></span></h3>
  14816. <p>Delay one or more audio channels.
  14817. </p>
  14818. <p>Samples in delayed channel are filled with silence.
  14819. </p>
  14820. <p>The filter accepts the following option:
  14821. </p>
  14822. <dl class="table">
  14823. <dt><samp class="option">delays</samp></dt>
  14824. <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
  14825. Unused delays will be silently ignored. If number of given delays is
  14826. smaller than number of channels all remaining channels will not be delayed.
  14827. If you want to delay exact number of samples, append &rsquo;S&rsquo; to number.
  14828. If you want instead to delay in seconds, append &rsquo;s&rsquo; to number.
  14829. </p>
  14830. </dd>
  14831. <dt><samp class="option">all</samp></dt>
  14832. <dd><p>Use last set delay for all remaining channels. By default is disabled.
  14833. This option if enabled changes how option <code class="code">delays</code> is interpreted.
  14834. </p></dd>
  14835. </dl>
  14836. <a name="Examples-20"></a>
  14837. <h4 class="subsection">29.12.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-20" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-20" aria-hidden="true">TOC</a></span></h4>
  14838. <ul class="itemize mark-bullet">
  14839. <li>Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
  14840. the second channel (and any other channels that may be present) unchanged.
  14841. <div class="example">
  14842. <pre class="example-preformatted">adelay=1500|0|500
  14843. </pre></div>
  14844. </li><li>Delay second channel by 500 samples, the third channel by 700 samples and leave
  14845. the first channel (and any other channels that may be present) unchanged.
  14846. <div class="example">
  14847. <pre class="example-preformatted">adelay=0|500S|700S
  14848. </pre></div>
  14849. </li><li>Delay all channels by same number of samples:
  14850. <div class="example">
  14851. <pre class="example-preformatted">adelay=delays=64S:all=1
  14852. </pre></div>
  14853. </li></ul>
  14854. <a name="adenorm"></a>
  14855. <h3 class="section">29.13 adenorm<span class="pull-right"><a class="anchor hidden-xs" href="#adenorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adenorm" aria-hidden="true">TOC</a></span></h3>
  14856. <p>Remedy denormals in audio by adding extremely low-level noise.
  14857. </p>
  14858. <p>This filter shall be placed before any filter that can produce denormals.
  14859. </p>
  14860. <p>A description of the accepted parameters follows.
  14861. </p>
  14862. <dl class="table">
  14863. <dt><samp class="option">level</samp></dt>
  14864. <dd><p>Set level of added noise in dB. Default is <code class="code">-351</code>.
  14865. Allowed range is from -451 to -90.
  14866. </p>
  14867. </dd>
  14868. <dt><samp class="option">type</samp></dt>
  14869. <dd><p>Set type of added noise.
  14870. </p>
  14871. <dl class="table">
  14872. <dt><samp class="option">dc</samp></dt>
  14873. <dd><p>Add DC signal.
  14874. </p></dd>
  14875. <dt><samp class="option">ac</samp></dt>
  14876. <dd><p>Add AC signal.
  14877. </p></dd>
  14878. <dt><samp class="option">square</samp></dt>
  14879. <dd><p>Add square signal.
  14880. </p></dd>
  14881. <dt><samp class="option">pulse</samp></dt>
  14882. <dd><p>Add pulse signal.
  14883. </p></dd>
  14884. </dl>
  14885. <p>Default is <code class="code">dc</code>.
  14886. </p></dd>
  14887. </dl>
  14888. <a name="Commands-2"></a>
  14889. <h4 class="subsection">29.13.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-2" aria-hidden="true">TOC</a></span></h4>
  14890. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  14891. </p>
  14892. <a name="aderivative_002c-aintegral"></a>
  14893. <h3 class="section">29.14 aderivative, aintegral<span class="pull-right"><a class="anchor hidden-xs" href="#aderivative_002c-aintegral" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aderivative_002c-aintegral" aria-hidden="true">TOC</a></span></h3>
  14894. <p>Compute derivative/integral of audio stream.
  14895. </p>
  14896. <p>Applying both filters one after another produces original audio.
  14897. </p>
  14898. <a name="adrc"></a>
  14899. <h3 class="section">29.15 adrc<span class="pull-right"><a class="anchor hidden-xs" href="#adrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adrc" aria-hidden="true">TOC</a></span></h3>
  14900. <p>Apply spectral dynamic range controller filter to input audio stream.
  14901. </p>
  14902. <p>A description of the accepted options follows.
  14903. </p>
  14904. <dl class="table">
  14905. <dt><samp class="option">transfer</samp></dt>
  14906. <dd><p>Set the transfer expression.
  14907. </p>
  14908. <p>The expression can contain the following constants:
  14909. </p>
  14910. <dl class="table">
  14911. <dt><samp class="option">ch</samp></dt>
  14912. <dd><p>current channel number
  14913. </p>
  14914. </dd>
  14915. <dt><samp class="option">sn</samp></dt>
  14916. <dd><p>current sample number
  14917. </p>
  14918. </dd>
  14919. <dt><samp class="option">nb_channels</samp></dt>
  14920. <dd><p>number of channels
  14921. </p>
  14922. </dd>
  14923. <dt><samp class="option">t</samp></dt>
  14924. <dd><p>timestamp expressed in seconds
  14925. </p>
  14926. </dd>
  14927. <dt><samp class="option">sr</samp></dt>
  14928. <dd><p>sample rate
  14929. </p>
  14930. </dd>
  14931. <dt><samp class="option">p</samp></dt>
  14932. <dd><p>current frequency power value, in dB
  14933. </p>
  14934. </dd>
  14935. <dt><samp class="option">f</samp></dt>
  14936. <dd><p>current frequency in Hz
  14937. </p></dd>
  14938. </dl>
  14939. <p>Default value is <code class="code">p</code>.
  14940. </p>
  14941. </dd>
  14942. <dt><samp class="option">attack</samp></dt>
  14943. <dd><p>Set the attack in milliseconds. Default is <code class="code">50</code> milliseconds.
  14944. Allowed range is from 1 to 1000 milliseconds.
  14945. </p></dd>
  14946. <dt><samp class="option">release</samp></dt>
  14947. <dd><p>Set the release in milliseconds. Default is <code class="code">100</code> milliseconds.
  14948. Allowed range is from 5 to 2000 milliseconds.
  14949. </p></dd>
  14950. <dt><samp class="option">channels</samp></dt>
  14951. <dd><p>Set which channels to filter, by default <code class="code">all</code> channels in audio stream are filtered.
  14952. </p></dd>
  14953. </dl>
  14954. <a name="Commands-3"></a>
  14955. <h4 class="subsection">29.15.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-3" aria-hidden="true">TOC</a></span></h4>
  14956. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  14957. </p>
  14958. <a name="Examples-21"></a>
  14959. <h4 class="subsection">29.15.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-21" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-21" aria-hidden="true">TOC</a></span></h4>
  14960. <ul class="itemize mark-bullet">
  14961. <li>Apply spectral compression to all frequencies with threshold of -50 dB and 1:6 ratio:
  14962. <div class="example">
  14963. <pre class="example-preformatted">adrc=transfer='if(gt(p,-50),-50+(p-(-50))/6,p)':attack=50:release=100
  14964. </pre></div>
  14965. </li><li>Similar to above but with 1:2 ratio and filtering only front center channel:
  14966. <div class="example">
  14967. <pre class="example-preformatted">adrc=transfer='if(gt(p,-50),-50+(p-(-50))/2,p)':attack=50:release=100:channels=FC
  14968. </pre></div>
  14969. </li><li>Apply spectral noise gate to all frequencies with threshold of -85 dB and with short attack time and short release time:
  14970. <div class="example">
  14971. <pre class="example-preformatted">adrc=transfer='if(lte(p,-85),p-800,p)':attack=1:release=5
  14972. </pre></div>
  14973. </li><li>Apply spectral expansion to all frequencies with threshold of -10 dB and 1:2 ratio:
  14974. <div class="example">
  14975. <pre class="example-preformatted">adrc=transfer='if(lt(p,-10),-10+(p-(-10))*2,p)':attack=50:release=100
  14976. </pre></div>
  14977. </li><li>Apply limiter to max -60 dB to all frequencies, with attack of 2 ms and release of 10 ms:
  14978. <div class="example">
  14979. <pre class="example-preformatted">adrc=transfer='min(p,-60)':attack=2:release=10
  14980. </pre></div>
  14981. </li></ul>
  14982. <a name="adynamicequalizer"></a>
  14983. <h3 class="section">29.16 adynamicequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#adynamicequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adynamicequalizer" aria-hidden="true">TOC</a></span></h3>
  14984. <p>Apply dynamic equalization to input audio stream.
  14985. </p>
  14986. <p>A description of the accepted options follows.
  14987. </p>
  14988. <dl class="table">
  14989. <dt><samp class="option">threshold</samp></dt>
  14990. <dd><p>Set the detection threshold used to trigger equalization.
  14991. Threshold detection is using detection filter.
  14992. Default value is 0. Allowed range is from 0 to 100.
  14993. </p>
  14994. </dd>
  14995. <dt><samp class="option">dfrequency</samp></dt>
  14996. <dd><p>Set the detection frequency in Hz used for detection filter used to trigger equalization.
  14997. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz.
  14998. </p>
  14999. </dd>
  15000. <dt><samp class="option">dqfactor</samp></dt>
  15001. <dd><p>Set the detection resonance factor for detection filter used to trigger equalization.
  15002. Default value is 1. Allowed range is from 0.001 to 1000.
  15003. </p>
  15004. </dd>
  15005. <dt><samp class="option">tfrequency</samp></dt>
  15006. <dd><p>Set the target frequency of equalization filter.
  15007. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz.
  15008. </p>
  15009. </dd>
  15010. <dt><samp class="option">tqfactor</samp></dt>
  15011. <dd><p>Set the target resonance factor for target equalization filter.
  15012. Default value is 1. Allowed range is from 0.001 to 1000.
  15013. </p>
  15014. </dd>
  15015. <dt><samp class="option">attack</samp></dt>
  15016. <dd><p>Set the amount of milliseconds the signal from detection has to rise above
  15017. the detection threshold before equalization starts.
  15018. Default is 20. Allowed range is between 1 and 2000.
  15019. </p>
  15020. </dd>
  15021. <dt><samp class="option">release</samp></dt>
  15022. <dd><p>Set the amount of milliseconds the signal from detection has to fall below the
  15023. detection threshold before equalization ends.
  15024. Default is 200. Allowed range is between 1 and 2000.
  15025. </p>
  15026. </dd>
  15027. <dt><samp class="option">ratio</samp></dt>
  15028. <dd><p>Set the ratio by which the equalization gain is raised.
  15029. Default is 1. Allowed range is between 0 and 30.
  15030. </p>
  15031. </dd>
  15032. <dt><samp class="option">makeup</samp></dt>
  15033. <dd><p>Set the makeup offset by which the equalization gain is raised.
  15034. Default is 0. Allowed range is between 0 and 100.
  15035. </p>
  15036. </dd>
  15037. <dt><samp class="option">range</samp></dt>
  15038. <dd><p>Set the max allowed cut/boost amount. Default is 50.
  15039. Allowed range is from 1 to 200.
  15040. </p>
  15041. </dd>
  15042. <dt><samp class="option">mode</samp></dt>
  15043. <dd><p>Set the mode of filter operation, can be one of the following:
  15044. </p>
  15045. <dl class="table">
  15046. <dt>&lsquo;<samp class="samp">listen</samp>&rsquo;</dt>
  15047. <dd><p>Output only isolated detection signal.
  15048. </p></dd>
  15049. <dt>&lsquo;<samp class="samp">cutbelow</samp>&rsquo;</dt>
  15050. <dd><p>Cut frequencies below detection threshold.
  15051. </p></dd>
  15052. <dt>&lsquo;<samp class="samp">cutabove</samp>&rsquo;</dt>
  15053. <dd><p>Cut frequencies above detection threshold.
  15054. </p></dd>
  15055. <dt>&lsquo;<samp class="samp">boostbelow</samp>&rsquo;</dt>
  15056. <dd><p>Boost frequencies below detection threshold.
  15057. </p></dd>
  15058. <dt>&lsquo;<samp class="samp">boostabove</samp>&rsquo;</dt>
  15059. <dd><p>Boost frequencies above detection threshold.
  15060. </p></dd>
  15061. </dl>
  15062. <p>Default mode is &lsquo;<samp class="samp">cutbelow</samp>&rsquo;.
  15063. </p>
  15064. </dd>
  15065. <dt><samp class="option">dftype</samp></dt>
  15066. <dd><p>Set the type of detection filter, can be one of the following:
  15067. </p>
  15068. <dl class="table">
  15069. <dt>&lsquo;<samp class="samp">bandpass</samp>&rsquo;</dt>
  15070. <dt>&lsquo;<samp class="samp">lowpass</samp>&rsquo;</dt>
  15071. <dt>&lsquo;<samp class="samp">highpass</samp>&rsquo;</dt>
  15072. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  15073. </dl>
  15074. <p>Default type is &lsquo;<samp class="samp">bandpass</samp>&rsquo;.
  15075. </p>
  15076. </dd>
  15077. <dt><samp class="option">tftype</samp></dt>
  15078. <dd><p>Set the type of target filter, can be one of the following:
  15079. </p>
  15080. <dl class="table">
  15081. <dt>&lsquo;<samp class="samp">bell</samp>&rsquo;</dt>
  15082. <dt>&lsquo;<samp class="samp">lowshelf</samp>&rsquo;</dt>
  15083. <dt>&lsquo;<samp class="samp">highshelf</samp>&rsquo;</dt>
  15084. </dl>
  15085. <p>Default type is &lsquo;<samp class="samp">bell</samp>&rsquo;.
  15086. </p>
  15087. </dd>
  15088. <dt><samp class="option">auto</samp></dt>
  15089. <dd><p>Automatically gather threshold from detection filter. By default
  15090. is &lsquo;<samp class="samp">disabled</samp>&rsquo;.
  15091. This option is useful to detect threshold in certain time frame of
  15092. input audio stream, in such case option value is changed at runtime.
  15093. </p>
  15094. <p>Available values are:
  15095. </p><dl class="table">
  15096. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  15097. <dd><p>Disable using automatically gathered threshold value.
  15098. </p></dd>
  15099. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  15100. <dd><p>Stop picking threshold value.
  15101. </p></dd>
  15102. <dt>&lsquo;<samp class="samp">on</samp>&rsquo;</dt>
  15103. <dd><p>Start picking threshold value.
  15104. </p></dd>
  15105. <dt>&lsquo;<samp class="samp">adaptive</samp>&rsquo;</dt>
  15106. <dd><p>Adaptively pick threshold value, by calculating sliding window entropy.
  15107. </p></dd>
  15108. </dl>
  15109. </dd>
  15110. <dt><samp class="option">precision</samp></dt>
  15111. <dd><p>Set which precision to use when processing samples.
  15112. </p>
  15113. <dl class="table">
  15114. <dt><samp class="option">auto</samp></dt>
  15115. <dd><p>Auto pick internal sample format depending on other filters.
  15116. </p>
  15117. </dd>
  15118. <dt><samp class="option">float</samp></dt>
  15119. <dd><p>Always use single-floating point precision sample format.
  15120. </p>
  15121. </dd>
  15122. <dt><samp class="option">double</samp></dt>
  15123. <dd><p>Always use double-floating point precision sample format.
  15124. </p></dd>
  15125. </dl>
  15126. </dd>
  15127. </dl>
  15128. <a name="Commands-4"></a>
  15129. <h4 class="subsection">29.16.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-4" aria-hidden="true">TOC</a></span></h4>
  15130. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  15131. </p>
  15132. <a name="adynamicsmooth"></a>
  15133. <h3 class="section">29.17 adynamicsmooth<span class="pull-right"><a class="anchor hidden-xs" href="#adynamicsmooth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adynamicsmooth" aria-hidden="true">TOC</a></span></h3>
  15134. <p>Apply dynamic smoothing to input audio stream.
  15135. </p>
  15136. <p>A description of the accepted options follows.
  15137. </p>
  15138. <dl class="table">
  15139. <dt><samp class="option">sensitivity</samp></dt>
  15140. <dd><p>Set an amount of sensitivity to frequency fluctations. Default is 2.
  15141. Allowed range is from 0 to 1e+06.
  15142. </p>
  15143. </dd>
  15144. <dt><samp class="option">basefreq</samp></dt>
  15145. <dd><p>Set a base frequency for smoothing. Default value is 22050.
  15146. Allowed range is from 2 to 1e+06.
  15147. </p></dd>
  15148. </dl>
  15149. <a name="Commands-5"></a>
  15150. <h4 class="subsection">29.17.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-5" aria-hidden="true">TOC</a></span></h4>
  15151. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  15152. </p>
  15153. <a name="aecho"></a>
  15154. <h3 class="section">29.18 aecho<span class="pull-right"><a class="anchor hidden-xs" href="#aecho" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aecho" aria-hidden="true">TOC</a></span></h3>
  15155. <p>Apply echoing to the input audio.
  15156. </p>
  15157. <p>Echoes are reflected sound and can occur naturally amongst mountains
  15158. (and sometimes large buildings) when talking or shouting; digital echo
  15159. effects emulate this behaviour and are often used to help fill out the
  15160. sound of a single instrument or vocal. The time difference between the
  15161. original signal and the reflection is the <code class="code">delay</code>, and the
  15162. loudness of the reflected signal is the <code class="code">decay</code>.
  15163. Multiple echoes can have different delays and decays.
  15164. </p>
  15165. <p>A description of the accepted parameters follows.
  15166. </p>
  15167. <dl class="table">
  15168. <dt><samp class="option">in_gain</samp></dt>
  15169. <dd><p>Set input gain of reflected signal. Default is <code class="code">0.6</code>.
  15170. </p>
  15171. </dd>
  15172. <dt><samp class="option">out_gain</samp></dt>
  15173. <dd><p>Set output gain of reflected signal. Default is <code class="code">0.3</code>.
  15174. </p>
  15175. </dd>
  15176. <dt><samp class="option">delays</samp></dt>
  15177. <dd><p>Set list of time intervals in milliseconds between original signal and reflections
  15178. separated by &rsquo;|&rsquo;. Allowed range for each <code class="code">delay</code> is <code class="code">(0 - 90000.0]</code>.
  15179. Default is <code class="code">1000</code>.
  15180. </p>
  15181. </dd>
  15182. <dt><samp class="option">decays</samp></dt>
  15183. <dd><p>Set list of loudness of reflected signals separated by &rsquo;|&rsquo;.
  15184. Allowed range for each <code class="code">decay</code> is <code class="code">(0 - 1.0]</code>.
  15185. Default is <code class="code">0.5</code>.
  15186. </p></dd>
  15187. </dl>
  15188. <a name="Examples-22"></a>
  15189. <h4 class="subsection">29.18.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-22" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-22" aria-hidden="true">TOC</a></span></h4>
  15190. <ul class="itemize mark-bullet">
  15191. <li>Make it sound as if there are twice as many instruments as are actually playing:
  15192. <div class="example">
  15193. <pre class="example-preformatted">aecho=0.8:0.88:60:0.4
  15194. </pre></div>
  15195. </li><li>If delay is very short, then it sounds like a (metallic) robot playing music:
  15196. <div class="example">
  15197. <pre class="example-preformatted">aecho=0.8:0.88:6:0.4
  15198. </pre></div>
  15199. </li><li>A longer delay will sound like an open air concert in the mountains:
  15200. <div class="example">
  15201. <pre class="example-preformatted">aecho=0.8:0.9:1000:0.3
  15202. </pre></div>
  15203. </li><li>Same as above but with one more mountain:
  15204. <div class="example">
  15205. <pre class="example-preformatted">aecho=0.8:0.9:1000|1800:0.3|0.25
  15206. </pre></div>
  15207. </li></ul>
  15208. <a name="aemphasis"></a>
  15209. <h3 class="section">29.19 aemphasis<span class="pull-right"><a class="anchor hidden-xs" href="#aemphasis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aemphasis" aria-hidden="true">TOC</a></span></h3>
  15210. <p>Audio emphasis filter creates or restores material directly taken from LPs or
  15211. emphased CDs with different filter curves. E.g. to store music on vinyl the
  15212. signal has to be altered by a filter first to even out the disadvantages of
  15213. this recording medium.
  15214. Once the material is played back the inverse filter has to be applied to
  15215. restore the distortion of the frequency response.
  15216. </p>
  15217. <p>The filter accepts the following options:
  15218. </p>
  15219. <dl class="table">
  15220. <dt><samp class="option">level_in</samp></dt>
  15221. <dd><p>Set input gain.
  15222. </p>
  15223. </dd>
  15224. <dt><samp class="option">level_out</samp></dt>
  15225. <dd><p>Set output gain.
  15226. </p>
  15227. </dd>
  15228. <dt><samp class="option">mode</samp></dt>
  15229. <dd><p>Set filter mode. For restoring material use <code class="code">reproduction</code> mode, otherwise
  15230. use <code class="code">production</code> mode. Default is <code class="code">reproduction</code> mode.
  15231. </p>
  15232. </dd>
  15233. <dt><samp class="option">type</samp></dt>
  15234. <dd><p>Set filter type. Selects medium. Can be one of the following:
  15235. </p>
  15236. <dl class="table">
  15237. <dt><samp class="option">col</samp></dt>
  15238. <dd><p>select Columbia.
  15239. </p></dd>
  15240. <dt><samp class="option">emi</samp></dt>
  15241. <dd><p>select EMI.
  15242. </p></dd>
  15243. <dt><samp class="option">bsi</samp></dt>
  15244. <dd><p>select BSI (78RPM).
  15245. </p></dd>
  15246. <dt><samp class="option">riaa</samp></dt>
  15247. <dd><p>select RIAA.
  15248. </p></dd>
  15249. <dt><samp class="option">cd</samp></dt>
  15250. <dd><p>select Compact Disc (CD).
  15251. </p></dd>
  15252. <dt><samp class="option">50fm</samp></dt>
  15253. <dd><p>select 50µs (FM).
  15254. </p></dd>
  15255. <dt><samp class="option">75fm</samp></dt>
  15256. <dd><p>select 75µs (FM).
  15257. </p></dd>
  15258. <dt><samp class="option">50kf</samp></dt>
  15259. <dd><p>select 50µs (FM-KF).
  15260. </p></dd>
  15261. <dt><samp class="option">75kf</samp></dt>
  15262. <dd><p>select 75µs (FM-KF).
  15263. </p></dd>
  15264. </dl>
  15265. </dd>
  15266. </dl>
  15267. <a name="Commands-6"></a>
  15268. <h4 class="subsection">29.19.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-6" aria-hidden="true">TOC</a></span></h4>
  15269. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  15270. </p>
  15271. <a name="aeval"></a>
  15272. <h3 class="section">29.20 aeval<span class="pull-right"><a class="anchor hidden-xs" href="#aeval" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aeval" aria-hidden="true">TOC</a></span></h3>
  15273. <p>Modify an audio signal according to the specified expressions.
  15274. </p>
  15275. <p>This filter accepts one or more expressions (one for each channel),
  15276. which are evaluated and used to modify a corresponding audio signal.
  15277. </p>
  15278. <p>It accepts the following parameters:
  15279. </p>
  15280. <dl class="table">
  15281. <dt><samp class="option">exprs</samp></dt>
  15282. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. If
  15283. the number of input channels is greater than the number of
  15284. expressions, the last specified expression is used for the remaining
  15285. output channels.
  15286. </p>
  15287. </dd>
  15288. <dt><samp class="option">channel_layout, c</samp></dt>
  15289. <dd><p>Set output channel layout. If not specified, the channel layout is
  15290. specified by the number of expressions. If set to &lsquo;<samp class="samp">same</samp>&rsquo;, it will
  15291. use by default the same input channel layout.
  15292. </p></dd>
  15293. </dl>
  15294. <p>Each expression in <var class="var">exprs</var> can contain the following constants and functions:
  15295. </p>
  15296. <dl class="table">
  15297. <dt><samp class="option">ch</samp></dt>
  15298. <dd><p>channel number of the current expression
  15299. </p>
  15300. </dd>
  15301. <dt><samp class="option">n</samp></dt>
  15302. <dd><p>number of the evaluated sample, starting from 0
  15303. </p>
  15304. </dd>
  15305. <dt><samp class="option">s</samp></dt>
  15306. <dd><p>sample rate
  15307. </p>
  15308. </dd>
  15309. <dt><samp class="option">t</samp></dt>
  15310. <dd><p>time of the evaluated sample expressed in seconds
  15311. </p>
  15312. </dd>
  15313. <dt><samp class="option">nb_in_channels</samp></dt>
  15314. <dt><samp class="option">nb_out_channels</samp></dt>
  15315. <dd><p>input and output number of channels
  15316. </p>
  15317. </dd>
  15318. <dt><samp class="option">val(CH)</samp></dt>
  15319. <dd><p>the value of input channel with number <var class="var">CH</var>
  15320. </p></dd>
  15321. </dl>
  15322. <p>Note: this filter is slow. For faster processing you should use a
  15323. dedicated filter.
  15324. </p>
  15325. <a name="Examples-23"></a>
  15326. <h4 class="subsection">29.20.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-23" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-23" aria-hidden="true">TOC</a></span></h4>
  15327. <ul class="itemize mark-bullet">
  15328. <li>Half volume:
  15329. <div class="example">
  15330. <pre class="example-preformatted">aeval=val(ch)/2:c=same
  15331. </pre></div>
  15332. </li><li>Invert phase of the second channel:
  15333. <div class="example">
  15334. <pre class="example-preformatted">aeval=val(0)|-val(1)
  15335. </pre></div>
  15336. </li></ul>
  15337. <a name="aexciter"></a>
  15338. <h3 class="section">29.21 aexciter<span class="pull-right"><a class="anchor hidden-xs" href="#aexciter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aexciter" aria-hidden="true">TOC</a></span></h3>
  15339. <p>An exciter is used to produce high sound that is not present in the
  15340. original signal. This is done by creating harmonic distortions of the
  15341. signal which are restricted in range and added to the original signal.
  15342. An Exciter raises the upper end of an audio signal without simply raising
  15343. the higher frequencies like an equalizer would do to create a more
  15344. &quot;crisp&quot; or &quot;brilliant&quot; sound.
  15345. </p>
  15346. <p>The filter accepts the following options:
  15347. </p>
  15348. <dl class="table">
  15349. <dt><samp class="option">level_in</samp></dt>
  15350. <dd><p>Set input level prior processing of signal.
  15351. Allowed range is from 0 to 64.
  15352. Default value is 1.
  15353. </p>
  15354. </dd>
  15355. <dt><samp class="option">level_out</samp></dt>
  15356. <dd><p>Set output level after processing of signal.
  15357. Allowed range is from 0 to 64.
  15358. Default value is 1.
  15359. </p>
  15360. </dd>
  15361. <dt><samp class="option">amount</samp></dt>
  15362. <dd><p>Set the amount of harmonics added to original signal.
  15363. Allowed range is from 0 to 64.
  15364. Default value is 1.
  15365. </p>
  15366. </dd>
  15367. <dt><samp class="option">drive</samp></dt>
  15368. <dd><p>Set the amount of newly created harmonics.
  15369. Allowed range is from 0.1 to 10.
  15370. Default value is 8.5.
  15371. </p>
  15372. </dd>
  15373. <dt><samp class="option">blend</samp></dt>
  15374. <dd><p>Set the octave of newly created harmonics.
  15375. Allowed range is from -10 to 10.
  15376. Default value is 0.
  15377. </p>
  15378. </dd>
  15379. <dt><samp class="option">freq</samp></dt>
  15380. <dd><p>Set the lower frequency limit of producing harmonics in Hz.
  15381. Allowed range is from 2000 to 12000 Hz.
  15382. Default is 7500 Hz.
  15383. </p>
  15384. </dd>
  15385. <dt><samp class="option">ceil</samp></dt>
  15386. <dd><p>Set the upper frequency limit of producing harmonics.
  15387. Allowed range is from 9999 to 20000 Hz.
  15388. If value is lower than 10000 Hz no limit is applied.
  15389. </p>
  15390. </dd>
  15391. <dt><samp class="option">listen</samp></dt>
  15392. <dd><p>Mute the original signal and output only added harmonics.
  15393. By default is disabled.
  15394. </p></dd>
  15395. </dl>
  15396. <a name="Commands-7"></a>
  15397. <h4 class="subsection">29.21.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-7" aria-hidden="true">TOC</a></span></h4>
  15398. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  15399. </p>
  15400. <a class="anchor" id="afade"></a><a name="afade-1"></a>
  15401. <h3 class="section">29.22 afade<span class="pull-right"><a class="anchor hidden-xs" href="#afade-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afade-1" aria-hidden="true">TOC</a></span></h3>
  15402. <p>Apply fade-in/out effect to input audio.
  15403. </p>
  15404. <p>A description of the accepted parameters follows.
  15405. </p>
  15406. <dl class="table">
  15407. <dt><samp class="option">type, t</samp></dt>
  15408. <dd><p>Specify the effect type, can be either <code class="code">in</code> for fade-in, or
  15409. <code class="code">out</code> for a fade-out effect. Default is <code class="code">in</code>.
  15410. </p>
  15411. </dd>
  15412. <dt><samp class="option">start_sample, ss</samp></dt>
  15413. <dd><p>Specify the number of the start sample for starting to apply the fade
  15414. effect. Default is 0.
  15415. </p>
  15416. </dd>
  15417. <dt><samp class="option">nb_samples, ns</samp></dt>
  15418. <dd><p>Specify the number of samples for which the fade effect has to last. At
  15419. the end of the fade-in effect the output audio will have the same
  15420. volume as the input audio, at the end of the fade-out transition
  15421. the output audio will be silence. Default is 44100.
  15422. </p>
  15423. </dd>
  15424. <dt><samp class="option">start_time, st</samp></dt>
  15425. <dd><p>Specify the start time of the fade effect. Default is 0.
  15426. The value must be specified as a time duration; see
  15427. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  15428. for the accepted syntax.
  15429. If set this option is used instead of <var class="var">start_sample</var>.
  15430. </p>
  15431. </dd>
  15432. <dt><samp class="option">duration, d</samp></dt>
  15433. <dd><p>Specify the duration of the fade effect. See
  15434. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  15435. for the accepted syntax.
  15436. At the end of the fade-in effect the output audio will have the same
  15437. volume as the input audio, at the end of the fade-out transition
  15438. the output audio will be silence.
  15439. By default the duration is determined by <var class="var">nb_samples</var>.
  15440. If set this option is used instead of <var class="var">nb_samples</var>.
  15441. </p>
  15442. </dd>
  15443. <dt><samp class="option">curve</samp></dt>
  15444. <dd><p>Set curve for fade transition.
  15445. </p>
  15446. <p>It accepts the following values:
  15447. </p><dl class="table">
  15448. <dt><samp class="option">tri</samp></dt>
  15449. <dd><p>select triangular, linear slope (default)
  15450. </p></dd>
  15451. <dt><samp class="option">qsin</samp></dt>
  15452. <dd><p>select quarter of sine wave
  15453. </p></dd>
  15454. <dt><samp class="option">hsin</samp></dt>
  15455. <dd><p>select half of sine wave
  15456. </p></dd>
  15457. <dt><samp class="option">esin</samp></dt>
  15458. <dd><p>select exponential sine wave
  15459. </p></dd>
  15460. <dt><samp class="option">log</samp></dt>
  15461. <dd><p>select logarithmic
  15462. </p></dd>
  15463. <dt><samp class="option">ipar</samp></dt>
  15464. <dd><p>select inverted parabola
  15465. </p></dd>
  15466. <dt><samp class="option">qua</samp></dt>
  15467. <dd><p>select quadratic
  15468. </p></dd>
  15469. <dt><samp class="option">cub</samp></dt>
  15470. <dd><p>select cubic
  15471. </p></dd>
  15472. <dt><samp class="option">squ</samp></dt>
  15473. <dd><p>select square root
  15474. </p></dd>
  15475. <dt><samp class="option">cbr</samp></dt>
  15476. <dd><p>select cubic root
  15477. </p></dd>
  15478. <dt><samp class="option">par</samp></dt>
  15479. <dd><p>select parabola
  15480. </p></dd>
  15481. <dt><samp class="option">exp</samp></dt>
  15482. <dd><p>select exponential
  15483. </p></dd>
  15484. <dt><samp class="option">iqsin</samp></dt>
  15485. <dd><p>select inverted quarter of sine wave
  15486. </p></dd>
  15487. <dt><samp class="option">ihsin</samp></dt>
  15488. <dd><p>select inverted half of sine wave
  15489. </p></dd>
  15490. <dt><samp class="option">dese</samp></dt>
  15491. <dd><p>select double-exponential seat
  15492. </p></dd>
  15493. <dt><samp class="option">desi</samp></dt>
  15494. <dd><p>select double-exponential sigmoid
  15495. </p></dd>
  15496. <dt><samp class="option">losi</samp></dt>
  15497. <dd><p>select logistic sigmoid
  15498. </p></dd>
  15499. <dt><samp class="option">sinc</samp></dt>
  15500. <dd><p>select sine cardinal function
  15501. </p></dd>
  15502. <dt><samp class="option">isinc</samp></dt>
  15503. <dd><p>select inverted sine cardinal function
  15504. </p></dd>
  15505. <dt><samp class="option">quat</samp></dt>
  15506. <dd><p>select quartic
  15507. </p></dd>
  15508. <dt><samp class="option">quatr</samp></dt>
  15509. <dd><p>select quartic root
  15510. </p></dd>
  15511. <dt><samp class="option">qsin2</samp></dt>
  15512. <dd><p>select squared quarter of sine wave
  15513. </p></dd>
  15514. <dt><samp class="option">hsin2</samp></dt>
  15515. <dd><p>select squared half of sine wave
  15516. </p></dd>
  15517. <dt><samp class="option">nofade</samp></dt>
  15518. <dd><p>no fade applied
  15519. </p></dd>
  15520. </dl>
  15521. </dd>
  15522. <dt><samp class="option">silence</samp></dt>
  15523. <dd><p>Set the initial gain for fade-in or final gain for fade-out.
  15524. Default value is <code class="code">0.0</code>.
  15525. </p>
  15526. </dd>
  15527. <dt><samp class="option">unity</samp></dt>
  15528. <dd><p>Set the initial gain for fade-out or final gain for fade-in.
  15529. Default value is <code class="code">1.0</code>.
  15530. </p></dd>
  15531. </dl>
  15532. <a name="Commands-8"></a>
  15533. <h4 class="subsection">29.22.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-8" aria-hidden="true">TOC</a></span></h4>
  15534. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  15535. </p>
  15536. <a name="Examples-24"></a>
  15537. <h4 class="subsection">29.22.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-24" aria-hidden="true">TOC</a></span></h4>
  15538. <ul class="itemize mark-bullet">
  15539. <li>Fade in first 15 seconds of audio:
  15540. <div class="example">
  15541. <pre class="example-preformatted">afade=t=in:ss=0:d=15
  15542. </pre></div>
  15543. </li><li>Fade out last 25 seconds of a 900 seconds audio:
  15544. <div class="example">
  15545. <pre class="example-preformatted">afade=t=out:st=875:d=25
  15546. </pre></div>
  15547. </li></ul>
  15548. <a name="afftdn"></a>
  15549. <h3 class="section">29.23 afftdn<span class="pull-right"><a class="anchor hidden-xs" href="#afftdn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afftdn" aria-hidden="true">TOC</a></span></h3>
  15550. <p>Denoise audio samples with FFT.
  15551. </p>
  15552. <p>A description of the accepted parameters follows.
  15553. </p>
  15554. <dl class="table">
  15555. <dt><samp class="option">noise_reduction, nr</samp></dt>
  15556. <dd><p>Set the noise reduction in dB, allowed range is 0.01 to 97.
  15557. Default value is 12 dB.
  15558. </p>
  15559. </dd>
  15560. <dt><samp class="option">noise_floor, nf</samp></dt>
  15561. <dd><p>Set the noise floor in dB, allowed range is -80 to -20.
  15562. Default value is -50 dB.
  15563. </p>
  15564. </dd>
  15565. <dt><samp class="option">noise_type, nt</samp></dt>
  15566. <dd><p>Set the noise type.
  15567. </p>
  15568. <p>It accepts the following values:
  15569. </p><dl class="table">
  15570. <dt><samp class="option">white, w</samp></dt>
  15571. <dd><p>Select white noise.
  15572. </p>
  15573. </dd>
  15574. <dt><samp class="option">vinyl, v</samp></dt>
  15575. <dd><p>Select vinyl noise.
  15576. </p>
  15577. </dd>
  15578. <dt><samp class="option">shellac, s</samp></dt>
  15579. <dd><p>Select shellac noise.
  15580. </p>
  15581. </dd>
  15582. <dt><samp class="option">custom, c</samp></dt>
  15583. <dd><p>Select custom noise, defined in <code class="code">bn</code> option.
  15584. </p>
  15585. <p>Default value is white noise.
  15586. </p></dd>
  15587. </dl>
  15588. </dd>
  15589. <dt><samp class="option">band_noise, bn</samp></dt>
  15590. <dd><p>Set custom band noise profile for every one of 15 bands.
  15591. Bands are separated by &rsquo; &rsquo; or &rsquo;|&rsquo;.
  15592. </p>
  15593. </dd>
  15594. <dt><samp class="option">residual_floor, rf</samp></dt>
  15595. <dd><p>Set the residual floor in dB, allowed range is -80 to -20.
  15596. Default value is -38 dB.
  15597. </p>
  15598. </dd>
  15599. <dt><samp class="option">track_noise, tn</samp></dt>
  15600. <dd><p>Enable noise floor tracking. By default is disabled.
  15601. With this enabled, noise floor is automatically adjusted.
  15602. </p>
  15603. </dd>
  15604. <dt><samp class="option">track_residual, tr</samp></dt>
  15605. <dd><p>Enable residual tracking. By default is disabled.
  15606. </p>
  15607. </dd>
  15608. <dt><samp class="option">output_mode, om</samp></dt>
  15609. <dd><p>Set the output mode.
  15610. </p>
  15611. <p>It accepts the following values:
  15612. </p><dl class="table">
  15613. <dt><samp class="option">input, i</samp></dt>
  15614. <dd><p>Pass input unchanged.
  15615. </p>
  15616. </dd>
  15617. <dt><samp class="option">output, o</samp></dt>
  15618. <dd><p>Pass noise filtered out.
  15619. </p>
  15620. </dd>
  15621. <dt><samp class="option">noise, n</samp></dt>
  15622. <dd><p>Pass only noise.
  15623. </p>
  15624. <p>Default value is <var class="var">output</var>.
  15625. </p></dd>
  15626. </dl>
  15627. </dd>
  15628. <dt><samp class="option">adaptivity, ad</samp></dt>
  15629. <dd><p>Set the adaptivity factor, used how fast to adapt gains adjustments per
  15630. each frequency bin. Value <var class="var">0</var> enables instant adaptation, while higher values
  15631. react much slower.
  15632. Allowed range is from <var class="var">0</var> to <var class="var">1</var>. Default value is <var class="var">0.5</var>.
  15633. </p>
  15634. </dd>
  15635. <dt><samp class="option">floor_offset, fo</samp></dt>
  15636. <dd><p>Set the noise floor offset factor. This option is used to adjust offset applied to measured
  15637. noise floor. It is only effective when noise floor tracking is enabled.
  15638. Allowed range is from <var class="var">-2.0</var> to <var class="var">2.0</var>. Default value is <var class="var">1.0</var>.
  15639. </p>
  15640. </dd>
  15641. <dt><samp class="option">noise_link, nl</samp></dt>
  15642. <dd><p>Set the noise link used for multichannel audio.
  15643. </p>
  15644. <p>It accepts the following values:
  15645. </p><dl class="table">
  15646. <dt><samp class="option">none</samp></dt>
  15647. <dd><p>Use unchanged channel&rsquo;s noise floor.
  15648. </p>
  15649. </dd>
  15650. <dt><samp class="option">min</samp></dt>
  15651. <dd><p>Use measured min noise floor of all channels.
  15652. </p>
  15653. </dd>
  15654. <dt><samp class="option">max</samp></dt>
  15655. <dd><p>Use measured max noise floor of all channels.
  15656. </p>
  15657. </dd>
  15658. <dt><samp class="option">average</samp></dt>
  15659. <dd><p>Use measured average noise floor of all channels.
  15660. </p>
  15661. <p>Default value is <var class="var">min</var>.
  15662. </p></dd>
  15663. </dl>
  15664. </dd>
  15665. <dt><samp class="option">band_multiplier, bm</samp></dt>
  15666. <dd><p>Set the band multiplier factor, used how much to spread bands across frequency bins.
  15667. Allowed range is from <var class="var">0.2</var> to <var class="var">5</var>. Default value is <var class="var">1.25</var>.
  15668. </p>
  15669. </dd>
  15670. <dt><samp class="option">sample_noise, sn</samp></dt>
  15671. <dd><p>Toggle capturing and measurement of noise profile from input audio.
  15672. </p>
  15673. <p>It accepts the following values:
  15674. </p><dl class="table">
  15675. <dt><samp class="option">start, begin</samp></dt>
  15676. <dd><p>Start sample noise capture.
  15677. </p>
  15678. </dd>
  15679. <dt><samp class="option">stop, end</samp></dt>
  15680. <dd><p>Stop sample noise capture and measure new noise band profile.
  15681. </p>
  15682. <p>Default value is <code class="code">none</code>.
  15683. </p></dd>
  15684. </dl>
  15685. </dd>
  15686. <dt><samp class="option">gain_smooth, gs</samp></dt>
  15687. <dd><p>Set gain smooth spatial radius, used to smooth gains applied to each frequency bin.
  15688. Useful to reduce random music noise artefacts.
  15689. Higher values increases smoothing of gains.
  15690. Allowed range is from <code class="code">0</code> to <code class="code">50</code>.
  15691. Default value is <code class="code">0</code>.
  15692. </p></dd>
  15693. </dl>
  15694. <a name="Commands-9"></a>
  15695. <h4 class="subsection">29.23.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-9" aria-hidden="true">TOC</a></span></h4>
  15696. <p>This filter supports the some above mentioned options as <a class="ref" href="#commands">commands</a>.
  15697. </p>
  15698. <a name="Examples-25"></a>
  15699. <h4 class="subsection">29.23.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-25" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-25" aria-hidden="true">TOC</a></span></h4>
  15700. <ul class="itemize mark-bullet">
  15701. <li>Reduce white noise by 10dB, and use previously measured noise floor of -40dB:
  15702. <div class="example">
  15703. <pre class="example-preformatted">afftdn=nr=10:nf=-40
  15704. </pre></div>
  15705. </li><li>Reduce white noise by 10dB, also set initial noise floor to -80dB and enable automatic
  15706. tracking of noise floor so noise floor will gradually change during processing:
  15707. <div class="example">
  15708. <pre class="example-preformatted">afftdn=nr=10:nf=-80:tn=1
  15709. </pre></div>
  15710. </li><li>Reduce noise by 20dB, using noise floor of -40dB and using commands to take noise profile
  15711. of first 0.4 seconds of input audio:
  15712. <div class="example">
  15713. <pre class="example-preformatted">asendcmd=0.0 afftdn sn start,asendcmd=0.4 afftdn sn stop,afftdn=nr=20:nf=-40
  15714. </pre></div>
  15715. </li></ul>
  15716. <a name="afftfilt"></a>
  15717. <h3 class="section">29.24 afftfilt<span class="pull-right"><a class="anchor hidden-xs" href="#afftfilt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afftfilt" aria-hidden="true">TOC</a></span></h3>
  15718. <p>Apply arbitrary expressions to samples in frequency domain.
  15719. </p>
  15720. <dl class="table">
  15721. <dt><samp class="option">real</samp></dt>
  15722. <dd><p>Set frequency domain real expression for each separate channel separated
  15723. by &rsquo;|&rsquo;. Default is &quot;re&quot;.
  15724. If the number of input channels is greater than the number of
  15725. expressions, the last specified expression is used for the remaining
  15726. output channels.
  15727. </p>
  15728. </dd>
  15729. <dt><samp class="option">imag</samp></dt>
  15730. <dd><p>Set frequency domain imaginary expression for each separate channel
  15731. separated by &rsquo;|&rsquo;. Default is &quot;im&quot;.
  15732. </p>
  15733. <p>Each expression in <var class="var">real</var> and <var class="var">imag</var> can contain the following
  15734. constants and functions:
  15735. </p>
  15736. <dl class="table">
  15737. <dt><samp class="option">sr</samp></dt>
  15738. <dd><p>sample rate
  15739. </p>
  15740. </dd>
  15741. <dt><samp class="option">b</samp></dt>
  15742. <dd><p>current frequency bin number
  15743. </p>
  15744. </dd>
  15745. <dt><samp class="option">nb</samp></dt>
  15746. <dd><p>number of available bins
  15747. </p>
  15748. </dd>
  15749. <dt><samp class="option">ch</samp></dt>
  15750. <dd><p>channel number of the current expression
  15751. </p>
  15752. </dd>
  15753. <dt><samp class="option">chs</samp></dt>
  15754. <dd><p>number of channels
  15755. </p>
  15756. </dd>
  15757. <dt><samp class="option">pts</samp></dt>
  15758. <dd><p>current frame pts
  15759. </p>
  15760. </dd>
  15761. <dt><samp class="option">re</samp></dt>
  15762. <dd><p>current real part of frequency bin of current channel
  15763. </p>
  15764. </dd>
  15765. <dt><samp class="option">im</samp></dt>
  15766. <dd><p>current imaginary part of frequency bin of current channel
  15767. </p>
  15768. </dd>
  15769. <dt><samp class="option">real(b, ch)</samp></dt>
  15770. <dd><p>Return the value of real part of frequency bin at location (<var class="var">bin</var>,<var class="var">channel</var>)
  15771. </p>
  15772. </dd>
  15773. <dt><samp class="option">imag(b, ch)</samp></dt>
  15774. <dd><p>Return the value of imaginary part of frequency bin at location (<var class="var">bin</var>,<var class="var">channel</var>)
  15775. </p></dd>
  15776. </dl>
  15777. </dd>
  15778. <dt><samp class="option">win_size</samp></dt>
  15779. <dd><p>Set window size. Allowed range is from 16 to 131072.
  15780. Default is <code class="code">4096</code>
  15781. </p>
  15782. </dd>
  15783. <dt><samp class="option">win_func</samp></dt>
  15784. <dd><p>Set window function.
  15785. </p>
  15786. <p>It accepts the following values:
  15787. </p><dl class="table">
  15788. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  15789. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  15790. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  15791. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  15792. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  15793. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  15794. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  15795. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  15796. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  15797. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  15798. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  15799. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  15800. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  15801. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  15802. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  15803. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  15804. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  15805. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  15806. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  15807. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  15808. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  15809. </dl>
  15810. <p>Default is <code class="code">hann</code>.
  15811. </p>
  15812. </dd>
  15813. <dt><samp class="option">overlap</samp></dt>
  15814. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  15815. window function will be picked. Default is <code class="code">0.75</code>.
  15816. </p></dd>
  15817. </dl>
  15818. <a name="Examples-26"></a>
  15819. <h4 class="subsection">29.24.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-26" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-26" aria-hidden="true">TOC</a></span></h4>
  15820. <ul class="itemize mark-bullet">
  15821. <li>Leave almost only low frequencies in audio:
  15822. <div class="example">
  15823. <pre class="example-preformatted">afftfilt=&quot;'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'&quot;
  15824. </pre></div>
  15825. </li><li>Apply robotize effect:
  15826. <div class="example">
  15827. <pre class="example-preformatted">afftfilt=&quot;real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75&quot;
  15828. </pre></div>
  15829. </li><li>Apply whisper effect:
  15830. <div class="example">
  15831. <pre class="example-preformatted">afftfilt=&quot;real='hypot(re,im)*cos((random(0)*2-1)*2*3.14)':imag='hypot(re,im)*sin((random(1)*2-1)*2*3.14)':win_size=128:overlap=0.8&quot;
  15832. </pre></div>
  15833. </li><li>Apply phase shift:
  15834. <div class="example">
  15835. <pre class="example-preformatted">afftfilt=&quot;real=re*cos(1)-im*sin(1):imag=re*sin(1)+im*cos(1)&quot;
  15836. </pre></div>
  15837. </li></ul>
  15838. <a class="anchor" id="afir"></a><a name="afir-1"></a>
  15839. <h3 class="section">29.25 afir<span class="pull-right"><a class="anchor hidden-xs" href="#afir-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afir-1" aria-hidden="true">TOC</a></span></h3>
  15840. <p>Apply an arbitrary Finite Impulse Response filter.
  15841. </p>
  15842. <p>This filter is designed for applying long FIR filters,
  15843. up to 60 seconds long.
  15844. </p>
  15845. <p>It can be used as component for digital crossover filters,
  15846. room equalization, cross talk cancellation, wavefield synthesis,
  15847. auralization, ambiophonics, ambisonics and spatialization.
  15848. </p>
  15849. <p>This filter uses the streams higher than first one as FIR coefficients.
  15850. If the non-first stream holds a single channel, it will be used
  15851. for all input channels in the first stream, otherwise
  15852. the number of channels in the non-first stream must be same as
  15853. the number of channels in the first stream.
  15854. </p>
  15855. <p>It accepts the following parameters:
  15856. </p>
  15857. <dl class="table">
  15858. <dt><samp class="option">dry</samp></dt>
  15859. <dd><p>Set dry gain. This sets input gain.
  15860. </p>
  15861. </dd>
  15862. <dt><samp class="option">wet</samp></dt>
  15863. <dd><p>Set wet gain. This sets final output gain.
  15864. </p>
  15865. </dd>
  15866. <dt><samp class="option">length</samp></dt>
  15867. <dd><p>Set Impulse Response filter length. Default is 1, which means whole IR is processed.
  15868. </p>
  15869. </dd>
  15870. <dt><samp class="option">gtype</samp></dt>
  15871. <dd><p>This option is deprecated, and does nothing.
  15872. </p>
  15873. </dd>
  15874. <dt><samp class="option">irnorm</samp></dt>
  15875. <dd><p>Set norm to be applied to IR coefficients before filtering.
  15876. Allowed range is from <var class="var">-1</var> to <var class="var">2</var>.
  15877. IR coefficients are normalized with calculated vector norm set by this option.
  15878. For negative values, no norm is calculated, and IR coefficients are not modified at all.
  15879. Default is <var class="var">1</var>.
  15880. </p>
  15881. </dd>
  15882. <dt><samp class="option">irlink</samp></dt>
  15883. <dd><p>For multichannel IR if this option is set to <var class="var">true</var>, all IR channels will be
  15884. normalized with maximal measured gain of all IR channels coefficients as set by <code class="code">irnorm</code> option.
  15885. When disabled, all IR coefficients in each IR channel will be normalized independently.
  15886. Default is <var class="var">true</var>.
  15887. </p>
  15888. </dd>
  15889. <dt><samp class="option">irgain</samp></dt>
  15890. <dd><p>Set gain to be applied to IR coefficients before filtering.
  15891. Allowed range is 0 to 1. This gain is applied after any gain applied with <var class="var">irnorm</var> option.
  15892. </p>
  15893. </dd>
  15894. <dt><samp class="option">irfmt</samp></dt>
  15895. <dd><p>Set format of IR stream. Can be <code class="code">mono</code> or <code class="code">input</code>.
  15896. Default is <code class="code">input</code>.
  15897. </p>
  15898. </dd>
  15899. <dt><samp class="option">maxir</samp></dt>
  15900. <dd><p>Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds.
  15901. Allowed range is 0.1 to 60 seconds.
  15902. </p>
  15903. </dd>
  15904. <dt><samp class="option">response</samp></dt>
  15905. <dd><p>This option is deprecated, and does nothing.
  15906. </p>
  15907. </dd>
  15908. <dt><samp class="option">channel</samp></dt>
  15909. <dd><p>This option is deprecated, and does nothing.
  15910. </p>
  15911. </dd>
  15912. <dt><samp class="option">size</samp></dt>
  15913. <dd><p>This option is deprecated, and does nothing.
  15914. </p>
  15915. </dd>
  15916. <dt><samp class="option">rate</samp></dt>
  15917. <dd><p>This option is deprecated, and does nothing.
  15918. </p>
  15919. </dd>
  15920. <dt><samp class="option">minp</samp></dt>
  15921. <dd><p>Set minimal partition size used for convolution. Default is <var class="var">8192</var>.
  15922. Allowed range is from <var class="var">1</var> to <var class="var">65536</var>.
  15923. Lower values decreases latency at cost of higher CPU usage.
  15924. </p>
  15925. </dd>
  15926. <dt><samp class="option">maxp</samp></dt>
  15927. <dd><p>Set maximal partition size used for convolution. Default is <var class="var">8192</var>.
  15928. Allowed range is from <var class="var">8</var> to <var class="var">65536</var>.
  15929. Lower values may increase CPU usage.
  15930. </p>
  15931. </dd>
  15932. <dt><samp class="option">nbirs</samp></dt>
  15933. <dd><p>Set number of input impulse responses streams which will be switchable at runtime.
  15934. Allowed range is from <var class="var">1</var> to <var class="var">32</var>. Default is <var class="var">1</var>.
  15935. </p>
  15936. </dd>
  15937. <dt><samp class="option">ir</samp></dt>
  15938. <dd><p>Set IR stream which will be used for convolution, starting from <var class="var">0</var>, should always be
  15939. lower than supplied value by <code class="code">nbirs</code> option. Default is <var class="var">0</var>.
  15940. This option can be changed at runtime via <a class="ref" href="#commands">commands</a>.
  15941. </p>
  15942. </dd>
  15943. <dt><samp class="option">precision</samp></dt>
  15944. <dd><p>Set which precision to use when processing samples.
  15945. </p>
  15946. <dl class="table">
  15947. <dt><samp class="option">auto</samp></dt>
  15948. <dd><p>Auto pick internal sample format depending on other filters.
  15949. </p>
  15950. </dd>
  15951. <dt><samp class="option">float</samp></dt>
  15952. <dd><p>Always use single-floating point precision sample format.
  15953. </p>
  15954. </dd>
  15955. <dt><samp class="option">double</samp></dt>
  15956. <dd><p>Always use double-floating point precision sample format.
  15957. </p></dd>
  15958. </dl>
  15959. <p>Default value is auto.
  15960. </p>
  15961. </dd>
  15962. <dt><samp class="option">irload</samp></dt>
  15963. <dd><p>Set when to load IR stream. Can be <code class="code">init</code> or <code class="code">access</code>.
  15964. First one load and prepares all IRs on initialization, second one
  15965. once on first access of specific IR.
  15966. Default is <code class="code">init</code>.
  15967. </p></dd>
  15968. </dl>
  15969. <a name="Examples-27"></a>
  15970. <h4 class="subsection">29.25.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-27" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-27" aria-hidden="true">TOC</a></span></h4>
  15971. <ul class="itemize mark-bullet">
  15972. <li>Apply reverb to stream using mono IR file as second input, complete command using ffmpeg:
  15973. <div class="example">
  15974. <pre class="example-preformatted">ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
  15975. </pre></div>
  15976. </li><li>Apply true stereo processing given input stereo stream, and two stereo impulse responses for left and right channel,
  15977. the impulse response files are files with names l_ir.wav and r_ir.wav, and setting irnorm option value:
  15978. <div class="example">
  15979. <pre class="example-preformatted">&quot;pan=4C|c0=FL|c1=FL|c2=FR|c3=FR[a];amovie=l_ir.wav[LIR];amovie=r_ir.wav[RIR];[LIR][RIR]amerge[ir];[a][ir]afir=irfmt=input:irnorm=1.2,pan=stereo|FL&lt;c0+c2|FR&lt;c1+c3&quot;
  15980. </pre></div>
  15981. </li><li>Similar to above example, but with <code class="code">irgain</code> explicitly set to estimated value and with <code class="code">irnorm</code> disabled:
  15982. <div class="example">
  15983. <pre class="example-preformatted">&quot;pan=4C|c0=FL|c1=FL|c2=FR|c3=FR[a];amovie=l_ir.wav[LIR];amovie=r_ir.wav[RIR];[LIR][RIR]amerge[ir];[a][ir]afir=irfmt=input:irgain=-5dB:irnom=-1,pan=stereo|FL&lt;c0+c2|FR&lt;c1+c3&quot;
  15984. </pre></div>
  15985. </li></ul>
  15986. <a class="anchor" id="aformat"></a><a name="aformat-1"></a>
  15987. <h3 class="section">29.26 aformat<span class="pull-right"><a class="anchor hidden-xs" href="#aformat-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aformat-1" aria-hidden="true">TOC</a></span></h3>
  15988. <p>Set output format constraints for the input audio. The framework will
  15989. negotiate the most appropriate format to minimize conversions.
  15990. </p>
  15991. <p>It accepts the following parameters:
  15992. </p><dl class="table">
  15993. <dt><samp class="option">sample_fmts, f</samp></dt>
  15994. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
  15995. </p>
  15996. </dd>
  15997. <dt><samp class="option">sample_rates, r</samp></dt>
  15998. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
  15999. </p>
  16000. </dd>
  16001. <dt><samp class="option">channel_layouts, cl</samp></dt>
  16002. <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
  16003. </p>
  16004. <p>See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#channel-layout-syntax">the Channel Layout section in the ffmpeg-utils(1) manual</a>
  16005. for the required syntax.
  16006. </p></dd>
  16007. </dl>
  16008. <p>If a parameter is omitted, all values are allowed.
  16009. </p>
  16010. <p>Force the output to either unsigned 8-bit or signed 16-bit stereo
  16011. </p><div class="example">
  16012. <pre class="example-preformatted">aformat=sample_fmts=u8|s16:channel_layouts=stereo
  16013. </pre></div>
  16014. <a name="afreqshift"></a>
  16015. <h3 class="section">29.27 afreqshift<span class="pull-right"><a class="anchor hidden-xs" href="#afreqshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afreqshift" aria-hidden="true">TOC</a></span></h3>
  16016. <p>Apply frequency shift to input audio samples.
  16017. </p>
  16018. <p>The filter accepts the following options:
  16019. </p>
  16020. <dl class="table">
  16021. <dt><samp class="option">shift</samp></dt>
  16022. <dd><p>Specify frequency shift. Allowed range is -INT_MAX to INT_MAX.
  16023. Default value is 0.0.
  16024. </p>
  16025. </dd>
  16026. <dt><samp class="option">level</samp></dt>
  16027. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  16028. Default value is 1.0.
  16029. </p>
  16030. </dd>
  16031. <dt><samp class="option">order</samp></dt>
  16032. <dd><p>Set filter order used for filtering. Allowed range is from 1 to 16.
  16033. Default value is 8.
  16034. </p></dd>
  16035. </dl>
  16036. <a name="Commands-10"></a>
  16037. <h4 class="subsection">29.27.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-10" aria-hidden="true">TOC</a></span></h4>
  16038. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  16039. </p>
  16040. <a name="afwtdn"></a>
  16041. <h3 class="section">29.28 afwtdn<span class="pull-right"><a class="anchor hidden-xs" href="#afwtdn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afwtdn" aria-hidden="true">TOC</a></span></h3>
  16042. <p>Reduce broadband noise from input samples using Wavelets.
  16043. </p>
  16044. <p>A description of the accepted options follows.
  16045. </p>
  16046. <dl class="table">
  16047. <dt><samp class="option">sigma</samp></dt>
  16048. <dd><p>Set the noise sigma, allowed range is from 0 to 1.
  16049. Default value is 0.
  16050. This option controls strength of denoising applied to input samples.
  16051. Most useful way to set this option is via decibels, eg. -45dB.
  16052. </p>
  16053. </dd>
  16054. <dt><samp class="option">levels</samp></dt>
  16055. <dd><p>Set the number of wavelet levels of decomposition.
  16056. Allowed range is from 1 to 12.
  16057. Default value is 10.
  16058. Setting this too low make denoising performance very poor.
  16059. </p>
  16060. </dd>
  16061. <dt><samp class="option">wavet</samp></dt>
  16062. <dd><p>Set wavelet type for decomposition of input frame.
  16063. They are sorted by number of coefficients, from lowest to highest.
  16064. More coefficients means worse filtering speed, but overall better quality.
  16065. Available wavelets are:
  16066. </p>
  16067. <dl class="table">
  16068. <dt>&lsquo;<samp class="samp">sym2</samp>&rsquo;</dt>
  16069. <dt>&lsquo;<samp class="samp">sym4</samp>&rsquo;</dt>
  16070. <dt>&lsquo;<samp class="samp">rbior68</samp>&rsquo;</dt>
  16071. <dt>&lsquo;<samp class="samp">deb10</samp>&rsquo;</dt>
  16072. <dt>&lsquo;<samp class="samp">sym10</samp>&rsquo;</dt>
  16073. <dt>&lsquo;<samp class="samp">coif5</samp>&rsquo;</dt>
  16074. <dt>&lsquo;<samp class="samp">bl3</samp>&rsquo;</dt>
  16075. </dl>
  16076. </dd>
  16077. <dt><samp class="option">percent</samp></dt>
  16078. <dd><p>Set percent of full denoising. Allowed range is from 0 to 100 percent.
  16079. Default value is 85 percent or partial denoising.
  16080. </p>
  16081. </dd>
  16082. <dt><samp class="option">profile</samp></dt>
  16083. <dd><p>If enabled, first input frame will be used as noise profile.
  16084. If first frame samples contain non-noise performance will be very poor.
  16085. </p>
  16086. </dd>
  16087. <dt><samp class="option">adaptive</samp></dt>
  16088. <dd><p>If enabled, input frames are analyzed for presence of noise.
  16089. If noise is detected with high possibility then input frame profile will be
  16090. used for processing following frames, until new noise frame is detected.
  16091. </p>
  16092. </dd>
  16093. <dt><samp class="option">samples</samp></dt>
  16094. <dd><p>Set size of single frame in number of samples. Allowed range is from 512 to
  16095. 65536. Default frame size is 8192 samples.
  16096. </p>
  16097. </dd>
  16098. <dt><samp class="option">softness</samp></dt>
  16099. <dd><p>Set softness applied inside thresholding function. Allowed range is from 0 to
  16100. 10. Default softness is 1.
  16101. </p></dd>
  16102. </dl>
  16103. <a name="Commands-11"></a>
  16104. <h4 class="subsection">29.28.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-11" aria-hidden="true">TOC</a></span></h4>
  16105. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  16106. </p>
  16107. <a name="agate"></a>
  16108. <h3 class="section">29.29 agate<span class="pull-right"><a class="anchor hidden-xs" href="#agate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-agate" aria-hidden="true">TOC</a></span></h3>
  16109. <p>A gate is mainly used to reduce lower parts of a signal. This kind of signal
  16110. processing reduces disturbing noise between useful signals.
  16111. </p>
  16112. <p>Gating is done by detecting the volume below a chosen level <var class="var">threshold</var>
  16113. and dividing it by the factor set with <var class="var">ratio</var>. The bottom of the noise
  16114. floor is set via <var class="var">range</var>. Because an exact manipulation of the signal
  16115. would cause distortion of the waveform the reduction can be levelled over
  16116. time. This is done by setting <var class="var">attack</var> and <var class="var">release</var>.
  16117. </p>
  16118. <p><var class="var">attack</var> determines how long the signal has to fall below the threshold
  16119. before any reduction will occur and <var class="var">release</var> sets the time the signal
  16120. has to rise above the threshold to reduce the reduction again.
  16121. Shorter signals than the chosen attack time will be left untouched.
  16122. </p>
  16123. <dl class="table">
  16124. <dt><samp class="option">level_in</samp></dt>
  16125. <dd><p>Set input level before filtering.
  16126. Default is 1. Allowed range is from 0.015625 to 64.
  16127. </p>
  16128. </dd>
  16129. <dt><samp class="option">mode</samp></dt>
  16130. <dd><p>Set the mode of operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  16131. Default is <code class="code">downward</code>. If set to <code class="code">upward</code> mode, higher parts of signal
  16132. will be amplified, expanding dynamic range in upward direction.
  16133. Otherwise, in case of <code class="code">downward</code> lower parts of signal will be reduced.
  16134. </p>
  16135. </dd>
  16136. <dt><samp class="option">range</samp></dt>
  16137. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  16138. Default is 0.06125. Allowed range is from 0 to 1.
  16139. Setting this to 0 disables reduction and then filter behaves like expander.
  16140. </p>
  16141. </dd>
  16142. <dt><samp class="option">threshold</samp></dt>
  16143. <dd><p>If a signal rises above this level the gain reduction is released.
  16144. Default is 0.125. Allowed range is from 0 to 1.
  16145. </p>
  16146. </dd>
  16147. <dt><samp class="option">ratio</samp></dt>
  16148. <dd><p>Set a ratio by which the signal is reduced.
  16149. Default is 2. Allowed range is from 1 to 9000.
  16150. </p>
  16151. </dd>
  16152. <dt><samp class="option">attack</samp></dt>
  16153. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  16154. reduction stops.
  16155. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  16156. </p>
  16157. </dd>
  16158. <dt><samp class="option">release</samp></dt>
  16159. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  16160. reduction is increased again. Default is 250 milliseconds.
  16161. Allowed range is from 0.01 to 9000.
  16162. </p>
  16163. </dd>
  16164. <dt><samp class="option">makeup</samp></dt>
  16165. <dd><p>Set amount of amplification of signal after processing.
  16166. Default is 1. Allowed range is from 1 to 64.
  16167. </p>
  16168. </dd>
  16169. <dt><samp class="option">knee</samp></dt>
  16170. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  16171. Default is 2.828427125. Allowed range is from 1 to 8.
  16172. </p>
  16173. </dd>
  16174. <dt><samp class="option">detection</samp></dt>
  16175. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  16176. Default is <code class="code">rms</code>. Can be <code class="code">peak</code> or <code class="code">rms</code>.
  16177. </p>
  16178. </dd>
  16179. <dt><samp class="option">link</samp></dt>
  16180. <dd><p>Choose if the average level between all channels or the louder channel affects
  16181. the reduction.
  16182. Default is <code class="code">average</code>. Can be <code class="code">average</code> or <code class="code">maximum</code>.
  16183. </p></dd>
  16184. </dl>
  16185. <a name="Commands-12"></a>
  16186. <h4 class="subsection">29.29.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-12" aria-hidden="true">TOC</a></span></h4>
  16187. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  16188. </p>
  16189. <a name="aiir"></a>
  16190. <h3 class="section">29.30 aiir<span class="pull-right"><a class="anchor hidden-xs" href="#aiir" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aiir" aria-hidden="true">TOC</a></span></h3>
  16191. <p>Apply an arbitrary Infinite Impulse Response filter.
  16192. </p>
  16193. <p>It accepts the following parameters:
  16194. </p>
  16195. <dl class="table">
  16196. <dt><samp class="option">zeros, z</samp></dt>
  16197. <dd><p>Set B/numerator/zeros/reflection coefficients.
  16198. </p>
  16199. </dd>
  16200. <dt><samp class="option">poles, p</samp></dt>
  16201. <dd><p>Set A/denominator/poles/ladder coefficients.
  16202. </p>
  16203. </dd>
  16204. <dt><samp class="option">gains, k</samp></dt>
  16205. <dd><p>Set channels gains.
  16206. </p>
  16207. </dd>
  16208. <dt><samp class="option">dry_gain</samp></dt>
  16209. <dd><p>Set input gain.
  16210. </p>
  16211. </dd>
  16212. <dt><samp class="option">wet_gain</samp></dt>
  16213. <dd><p>Set output gain.
  16214. </p>
  16215. </dd>
  16216. <dt><samp class="option">format, f</samp></dt>
  16217. <dd><p>Set coefficients format.
  16218. </p>
  16219. <dl class="table">
  16220. <dt>&lsquo;<samp class="samp">ll</samp>&rsquo;</dt>
  16221. <dd><p>lattice-ladder function
  16222. </p></dd>
  16223. <dt>&lsquo;<samp class="samp">sf</samp>&rsquo;</dt>
  16224. <dd><p>analog transfer function
  16225. </p></dd>
  16226. <dt>&lsquo;<samp class="samp">tf</samp>&rsquo;</dt>
  16227. <dd><p>digital transfer function
  16228. </p></dd>
  16229. <dt>&lsquo;<samp class="samp">zp</samp>&rsquo;</dt>
  16230. <dd><p>Z-plane zeros/poles, cartesian (default)
  16231. </p></dd>
  16232. <dt>&lsquo;<samp class="samp">pr</samp>&rsquo;</dt>
  16233. <dd><p>Z-plane zeros/poles, polar radians
  16234. </p></dd>
  16235. <dt>&lsquo;<samp class="samp">pd</samp>&rsquo;</dt>
  16236. <dd><p>Z-plane zeros/poles, polar degrees
  16237. </p></dd>
  16238. <dt>&lsquo;<samp class="samp">sp</samp>&rsquo;</dt>
  16239. <dd><p>S-plane zeros/poles
  16240. </p></dd>
  16241. </dl>
  16242. </dd>
  16243. <dt><samp class="option">process, r</samp></dt>
  16244. <dd><p>Set type of processing.
  16245. </p>
  16246. <dl class="table">
  16247. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  16248. <dd><p>direct processing
  16249. </p></dd>
  16250. <dt>&lsquo;<samp class="samp">s</samp>&rsquo;</dt>
  16251. <dd><p>serial processing
  16252. </p></dd>
  16253. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  16254. <dd><p>parallel processing
  16255. </p></dd>
  16256. </dl>
  16257. </dd>
  16258. <dt><samp class="option">precision, e</samp></dt>
  16259. <dd><p>Set filtering precision.
  16260. </p>
  16261. <dl class="table">
  16262. <dt>&lsquo;<samp class="samp">dbl</samp>&rsquo;</dt>
  16263. <dd><p>double-precision floating-point (default)
  16264. </p></dd>
  16265. <dt>&lsquo;<samp class="samp">flt</samp>&rsquo;</dt>
  16266. <dd><p>single-precision floating-point
  16267. </p></dd>
  16268. <dt>&lsquo;<samp class="samp">i32</samp>&rsquo;</dt>
  16269. <dd><p>32-bit integers
  16270. </p></dd>
  16271. <dt>&lsquo;<samp class="samp">i16</samp>&rsquo;</dt>
  16272. <dd><p>16-bit integers
  16273. </p></dd>
  16274. </dl>
  16275. </dd>
  16276. <dt><samp class="option">normalize, n</samp></dt>
  16277. <dd><p>Normalize filter coefficients, by default is enabled.
  16278. Enabling it will normalize magnitude response at DC to 0dB.
  16279. </p>
  16280. </dd>
  16281. <dt><samp class="option">mix</samp></dt>
  16282. <dd><p>How much to use filtered signal in output. Default is 1.
  16283. Range is between 0 and 1.
  16284. </p>
  16285. </dd>
  16286. <dt><samp class="option">response</samp></dt>
  16287. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  16288. By default it is disabled.
  16289. </p>
  16290. </dd>
  16291. <dt><samp class="option">channel</samp></dt>
  16292. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  16293. displayed. This option is used only when <var class="var">response</var> is enabled.
  16294. </p>
  16295. </dd>
  16296. <dt><samp class="option">size</samp></dt>
  16297. <dd><p>Set video stream size. This option is used only when <var class="var">response</var> is enabled.
  16298. </p></dd>
  16299. </dl>
  16300. <p>Coefficients in <code class="code">tf</code> and <code class="code">sf</code> format are separated by spaces and are in ascending
  16301. order.
  16302. </p>
  16303. <p>Coefficients in <code class="code">zp</code> format are separated by spaces and order of coefficients
  16304. doesn&rsquo;t matter. Coefficients in <code class="code">zp</code> format are complex numbers with <var class="var">i</var>
  16305. imaginary unit.
  16306. </p>
  16307. <p>Different coefficients and gains can be provided for every channel, in such case
  16308. use &rsquo;|&rsquo; to separate coefficients or gains. Last provided coefficients will be
  16309. used for all remaining channels.
  16310. </p>
  16311. <a name="Examples-28"></a>
  16312. <h4 class="subsection">29.30.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-28" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-28" aria-hidden="true">TOC</a></span></h4>
  16313. <ul class="itemize mark-bullet">
  16314. <li>Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate:
  16315. <div class="example">
  16316. <pre class="example-preformatted">aiir=k=1:z=7.957584807809675810E-1 -2.575128568908332300 3.674839853930788710 -2.57512875289799137 7.957586296317130880E-1:p=1 -2.86950072432325953 3.63022088054647218 -2.28075678147272232 6.361362326477423500E-1:f=tf:r=d
  16317. </pre></div>
  16318. </li><li>Same as above but in <code class="code">zp</code> format:
  16319. <div class="example">
  16320. <pre class="example-preformatted">aiir=k=0.79575848078096756:z=0.80918701+0.58773007i 0.80918701-0.58773007i 0.80884700+0.58784055i 0.80884700-0.58784055i:p=0.63892345+0.59951235i 0.63892345-0.59951235i 0.79582691+0.44198673i 0.79582691-0.44198673i:f=zp:r=s
  16321. </pre></div>
  16322. </li><li>Apply 3-rd order analog normalized Butterworth low-pass filter, using analog transfer function format:
  16323. <div class="example">
  16324. <pre class="example-preformatted">aiir=z=1.3057 0 0 0:p=1.3057 2.3892 2.1860 1:f=sf:r=d
  16325. </pre></div>
  16326. </li></ul>
  16327. <a name="alimiter"></a>
  16328. <h3 class="section">29.31 alimiter<span class="pull-right"><a class="anchor hidden-xs" href="#alimiter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alimiter" aria-hidden="true">TOC</a></span></h3>
  16329. <p>The limiter prevents an input signal from rising over a desired threshold.
  16330. This limiter uses lookahead technology to prevent your signal from distorting.
  16331. It means that there is a small delay after the signal is processed. Keep in mind
  16332. that the delay it produces is the attack time you set.
  16333. </p>
  16334. <p>The filter accepts the following options:
  16335. </p>
  16336. <dl class="table">
  16337. <dt><samp class="option">level_in</samp></dt>
  16338. <dd><p>Set input gain. Default is 1.
  16339. </p>
  16340. </dd>
  16341. <dt><samp class="option">level_out</samp></dt>
  16342. <dd><p>Set output gain. Default is 1.
  16343. </p>
  16344. </dd>
  16345. <dt><samp class="option">limit</samp></dt>
  16346. <dd><p>Don&rsquo;t let signals above this level pass the limiter. Default is 1.
  16347. </p>
  16348. </dd>
  16349. <dt><samp class="option">attack</samp></dt>
  16350. <dd><p>The limiter will reach its attenuation level in this amount of time in
  16351. milliseconds. Default is 5 milliseconds.
  16352. </p>
  16353. </dd>
  16354. <dt><samp class="option">release</samp></dt>
  16355. <dd><p>Come back from limiting to attenuation 1.0 in this amount of milliseconds.
  16356. Default is 50 milliseconds.
  16357. </p>
  16358. </dd>
  16359. <dt><samp class="option">asc</samp></dt>
  16360. <dd><p>When gain reduction is always needed ASC takes care of releasing to an
  16361. average reduction level rather than reaching a reduction of 0 in the release
  16362. time.
  16363. </p>
  16364. </dd>
  16365. <dt><samp class="option">asc_level</samp></dt>
  16366. <dd><p>Select how much the release time is affected by ASC, 0 means nearly no changes
  16367. in release time while 1 produces higher release times.
  16368. </p>
  16369. </dd>
  16370. <dt><samp class="option">level</samp></dt>
  16371. <dd><p>Auto level output signal. Default is enabled.
  16372. This normalizes audio back to 0dB if enabled.
  16373. </p>
  16374. </dd>
  16375. <dt><samp class="option">latency</samp></dt>
  16376. <dd><p>Compensate the delay introduced by using the lookahead buffer set with attack
  16377. parameter. Also flush the valid audio data in the lookahead buffer when the
  16378. stream hits EOF.
  16379. </p></dd>
  16380. </dl>
  16381. <p>Depending on picked setting it is recommended to upsample input 2x or 4x times
  16382. with <a class="ref" href="#aresample">aresample</a> before applying this filter.
  16383. </p>
  16384. <a name="allpass"></a>
  16385. <h3 class="section">29.32 allpass<span class="pull-right"><a class="anchor hidden-xs" href="#allpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-allpass" aria-hidden="true">TOC</a></span></h3>
  16386. <p>Apply a two-pole all-pass filter with central frequency (in Hz)
  16387. <var class="var">frequency</var>, and filter-width <var class="var">width</var>.
  16388. An all-pass filter changes the audio&rsquo;s frequency to phase relationship
  16389. without changing its frequency to amplitude relationship.
  16390. </p>
  16391. <p>The filter accepts the following options:
  16392. </p>
  16393. <dl class="table">
  16394. <dt><samp class="option">frequency, f</samp></dt>
  16395. <dd><p>Set frequency in Hz.
  16396. </p>
  16397. </dd>
  16398. <dt><samp class="option">width_type, t</samp></dt>
  16399. <dd><p>Set method to specify band-width of filter.
  16400. </p><dl class="table">
  16401. <dt><samp class="option">h</samp></dt>
  16402. <dd><p>Hz
  16403. </p></dd>
  16404. <dt><samp class="option">q</samp></dt>
  16405. <dd><p>Q-Factor
  16406. </p></dd>
  16407. <dt><samp class="option">o</samp></dt>
  16408. <dd><p>octave
  16409. </p></dd>
  16410. <dt><samp class="option">s</samp></dt>
  16411. <dd><p>slope
  16412. </p></dd>
  16413. <dt><samp class="option">k</samp></dt>
  16414. <dd><p>kHz
  16415. </p></dd>
  16416. </dl>
  16417. </dd>
  16418. <dt><samp class="option">width, w</samp></dt>
  16419. <dd><p>Specify the band-width of a filter in width_type units.
  16420. </p>
  16421. </dd>
  16422. <dt><samp class="option">mix, m</samp></dt>
  16423. <dd><p>How much to use filtered signal in output. Default is 1.
  16424. Range is between 0 and 1.
  16425. </p>
  16426. </dd>
  16427. <dt><samp class="option">channels, c</samp></dt>
  16428. <dd><p>Specify which channels to filter, by default all available are filtered.
  16429. </p>
  16430. </dd>
  16431. <dt><samp class="option">normalize, n</samp></dt>
  16432. <dd><p>Normalize biquad coefficients, by default is disabled.
  16433. Enabling it will normalize magnitude response at DC to 0dB.
  16434. </p>
  16435. </dd>
  16436. <dt><samp class="option">order, o</samp></dt>
  16437. <dd><p>Set the filter order, can be 1 or 2. Default is 2.
  16438. </p>
  16439. </dd>
  16440. <dt><samp class="option">transform, a</samp></dt>
  16441. <dd><p>Set transform type of IIR filter.
  16442. </p><dl class="table">
  16443. <dt><samp class="option">di</samp></dt>
  16444. <dt><samp class="option">dii</samp></dt>
  16445. <dt><samp class="option">tdi</samp></dt>
  16446. <dt><samp class="option">tdii</samp></dt>
  16447. <dt><samp class="option">latt</samp></dt>
  16448. <dt><samp class="option">svf</samp></dt>
  16449. <dt><samp class="option">zdf</samp></dt>
  16450. </dl>
  16451. </dd>
  16452. <dt><samp class="option">precision, r</samp></dt>
  16453. <dd><p>Set precision of filtering.
  16454. </p><dl class="table">
  16455. <dt><samp class="option">auto</samp></dt>
  16456. <dd><p>Pick automatic sample format depending on surround filters.
  16457. </p></dd>
  16458. <dt><samp class="option">s16</samp></dt>
  16459. <dd><p>Always use signed 16-bit.
  16460. </p></dd>
  16461. <dt><samp class="option">s32</samp></dt>
  16462. <dd><p>Always use signed 32-bit.
  16463. </p></dd>
  16464. <dt><samp class="option">f32</samp></dt>
  16465. <dd><p>Always use float 32-bit.
  16466. </p></dd>
  16467. <dt><samp class="option">f64</samp></dt>
  16468. <dd><p>Always use float 64-bit.
  16469. </p></dd>
  16470. </dl>
  16471. </dd>
  16472. </dl>
  16473. <a name="Commands-13"></a>
  16474. <h4 class="subsection">29.32.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-13" aria-hidden="true">TOC</a></span></h4>
  16475. <p>This filter supports the following commands:
  16476. </p><dl class="table">
  16477. <dt><samp class="option">frequency, f</samp></dt>
  16478. <dd><p>Change allpass frequency.
  16479. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  16480. </p>
  16481. </dd>
  16482. <dt><samp class="option">width_type, t</samp></dt>
  16483. <dd><p>Change allpass width_type.
  16484. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  16485. </p>
  16486. </dd>
  16487. <dt><samp class="option">width, w</samp></dt>
  16488. <dd><p>Change allpass width.
  16489. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  16490. </p>
  16491. </dd>
  16492. <dt><samp class="option">mix, m</samp></dt>
  16493. <dd><p>Change allpass mix.
  16494. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  16495. </p></dd>
  16496. </dl>
  16497. <a name="aloop"></a>
  16498. <h3 class="section">29.33 aloop<span class="pull-right"><a class="anchor hidden-xs" href="#aloop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aloop" aria-hidden="true">TOC</a></span></h3>
  16499. <p>Loop audio samples.
  16500. </p>
  16501. <p>The filter accepts the following options:
  16502. </p>
  16503. <dl class="table">
  16504. <dt><samp class="option">loop</samp></dt>
  16505. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  16506. Default is 0.
  16507. </p>
  16508. </dd>
  16509. <dt><samp class="option">size</samp></dt>
  16510. <dd><p>Set maximal number of samples. Default is 0.
  16511. </p>
  16512. </dd>
  16513. <dt><samp class="option">start</samp></dt>
  16514. <dd><p>Set first sample of loop. Default is 0.
  16515. </p>
  16516. </dd>
  16517. <dt><samp class="option">time</samp></dt>
  16518. <dd><p>Set the time of loop start in seconds.
  16519. Only used if option named <var class="var">start</var> is set to <code class="code">-1</code>.
  16520. </p></dd>
  16521. </dl>
  16522. <a class="anchor" id="amerge"></a><a name="amerge-1"></a>
  16523. <h3 class="section">29.34 amerge<span class="pull-right"><a class="anchor hidden-xs" href="#amerge-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amerge-1" aria-hidden="true">TOC</a></span></h3>
  16524. <p>Merge two or more audio streams into a single multi-channel stream.
  16525. </p>
  16526. <p>All inputs must have the same sample rate, and format.
  16527. </p>
  16528. <p>If inputs do not have the same duration, the output will stop with the
  16529. shortest.
  16530. </p>
  16531. <p>The filter accepts the following options:
  16532. </p>
  16533. <dl class="table">
  16534. <dt><samp class="option">inputs</samp></dt>
  16535. <dd><p>Set the number of inputs. Default is 2.
  16536. </p>
  16537. </dd>
  16538. <dt><samp class="option">layout_mode</samp></dt>
  16539. <dd>
  16540. <p>This option controls how the output channel layout is determined and if the
  16541. audio channels are reordered during merge.
  16542. </p>
  16543. <dl class="table">
  16544. <dt><samp class="option">legacy</samp></dt>
  16545. <dd>
  16546. <p>This is the mode how the filter behaved historically so it is the default.
  16547. </p>
  16548. <p>If the channel layouts of the inputs are known and disjoint, and therefore
  16549. compatible, the channel layout of the output will be set accordingly and the
  16550. channels will be reordered as necessary. If the channel layouts of the inputs
  16551. are not disjoint, some of them are unknown, or they are using special channel
  16552. layouts, such as ambisonics, the output will have all the channels of the first
  16553. input then all the channels of the second input, in that order, and the channel
  16554. layout of the output will be the default value corresponding to the total
  16555. number of channels.
  16556. </p>
  16557. <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
  16558. is FC+BL+BR, then the output will be in 5.1, with the channels in the
  16559. following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
  16560. first input, b1 is the first channel of the second input).
  16561. </p>
  16562. <p>On the other hand, if both input are in stereo, the output channels will be
  16563. in the default order: a1, a2, b1, b2, and the channel layout will be
  16564. arbitrarily set to 4.0, which may or may not be the expected value.
  16565. </p>
  16566. </dd>
  16567. <dt><samp class="option">reset</samp></dt>
  16568. <dd><p>This mode ignores the input channel layouts and does no channel reordering.
  16569. The output will have all the channels of the first input, then all the channels
  16570. of the second input, in that order, and so on.
  16571. </p>
  16572. <p>The output channel layout will only specify the total channel count.
  16573. </p>
  16574. </dd>
  16575. <dt><samp class="option">normal</samp></dt>
  16576. <dd><p>This mode keeps channel name and designation information from the input
  16577. channels and does no channel reordering. The output will have all the channels
  16578. of the first input, then all the channels of the second input, in that order,
  16579. and so on.
  16580. </p>
  16581. </dd>
  16582. </dl>
  16583. </dd>
  16584. </dl>
  16585. <a name="Examples-29"></a>
  16586. <h4 class="subsection">29.34.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-29" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-29" aria-hidden="true">TOC</a></span></h4>
  16587. <ul class="itemize mark-bullet">
  16588. <li>Merge two mono files into a stereo stream:
  16589. <div class="example">
  16590. <pre class="example-preformatted">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
  16591. </pre></div>
  16592. </li><li>Multiple merges assuming 1 video stream and 6 audio streams in <samp class="file">input.mkv</samp>:
  16593. <div class="example">
  16594. <pre class="example-preformatted">ffmpeg -i input.mkv -filter_complex &quot;[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6&quot; -c:a pcm_s16le output.mkv
  16595. </pre></div>
  16596. </li></ul>
  16597. <a name="amix"></a>
  16598. <h3 class="section">29.35 amix<span class="pull-right"><a class="anchor hidden-xs" href="#amix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amix" aria-hidden="true">TOC</a></span></h3>
  16599. <p>Mixes multiple audio inputs into a single output.
  16600. </p>
  16601. <p>Note that this filter only supports float samples (the <var class="var">amerge</var>
  16602. and <var class="var">pan</var> audio filters support many formats). If the <var class="var">amix</var>
  16603. input has integer samples then <a class="ref" href="#aresample">aresample</a> will be automatically
  16604. inserted to perform the conversion to float samples.
  16605. </p>
  16606. <p>It accepts the following parameters:
  16607. </p><dl class="table">
  16608. <dt><samp class="option">inputs</samp></dt>
  16609. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  16610. </p>
  16611. </dd>
  16612. <dt><samp class="option">duration</samp></dt>
  16613. <dd><p>How to determine the end-of-stream.
  16614. </p><dl class="table">
  16615. <dt><samp class="option">longest</samp></dt>
  16616. <dd><p>The duration of the longest input. (default)
  16617. </p>
  16618. </dd>
  16619. <dt><samp class="option">shortest</samp></dt>
  16620. <dd><p>The duration of the shortest input.
  16621. </p>
  16622. </dd>
  16623. <dt><samp class="option">first</samp></dt>
  16624. <dd><p>The duration of the first input.
  16625. </p>
  16626. </dd>
  16627. </dl>
  16628. </dd>
  16629. <dt><samp class="option">dropout_transition</samp></dt>
  16630. <dd><p>The transition time, in seconds, for volume renormalization when an input
  16631. stream ends. The default value is 2 seconds.
  16632. </p>
  16633. </dd>
  16634. <dt><samp class="option">weights</samp></dt>
  16635. <dd><p>Specify weight of each input audio stream as a sequence of numbers separated
  16636. by a space. If fewer weights are specified compared to number of inputs, the
  16637. last weight is assigned to the remaining inputs.
  16638. Default weight for each input is 1.
  16639. </p>
  16640. </dd>
  16641. <dt><samp class="option">normalize</samp></dt>
  16642. <dd><p>Always scale inputs instead of only doing summation of samples.
  16643. Beware of heavy clipping if inputs are not normalized prior or after filtering
  16644. by this filter if this option is disabled. By default is enabled.
  16645. </p></dd>
  16646. </dl>
  16647. <a name="Examples-30"></a>
  16648. <h4 class="subsection">29.35.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-30" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-30" aria-hidden="true">TOC</a></span></h4>
  16649. <ul class="itemize mark-bullet">
  16650. <li>This will mix 3 input audio streams to a single output with the same duration as the
  16651. first input and a dropout transition time of 3 seconds:
  16652. <div class="example">
  16653. <pre class="example-preformatted">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
  16654. </pre></div>
  16655. </li><li>This will mix one vocal and one music input audio stream to a single output with the same duration as the
  16656. longest input. The music will have quarter the weight as the vocals, and the inputs are not normalized:
  16657. <div class="example">
  16658. <pre class="example-preformatted">ffmpeg -i VOCALS -i MUSIC -filter_complex amix=inputs=2:duration=longest:dropout_transition=0:weights=&quot;1 0.25&quot;:normalize=0 OUTPUT
  16659. </pre></div>
  16660. </li></ul>
  16661. <a name="Commands-14"></a>
  16662. <h4 class="subsection">29.35.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-14" aria-hidden="true">TOC</a></span></h4>
  16663. <p>This filter supports the following commands:
  16664. </p><dl class="table">
  16665. <dt><samp class="option">weights</samp></dt>
  16666. <dt><samp class="option">normalize</samp></dt>
  16667. <dd><p>Syntax is same as option with same name.
  16668. </p></dd>
  16669. </dl>
  16670. <a name="amultiply"></a>
  16671. <h3 class="section">29.36 amultiply<span class="pull-right"><a class="anchor hidden-xs" href="#amultiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amultiply" aria-hidden="true">TOC</a></span></h3>
  16672. <p>Multiply first audio stream with second audio stream and store result
  16673. in output audio stream. Multiplication is done by multiplying each
  16674. sample from first stream with sample at same position from second stream.
  16675. </p>
  16676. <p>With this element-wise multiplication one can create amplitude fades and
  16677. amplitude modulations.
  16678. </p>
  16679. <a name="anequalizer"></a>
  16680. <h3 class="section">29.37 anequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#anequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anequalizer" aria-hidden="true">TOC</a></span></h3>
  16681. <p>High-order parametric multiband equalizer for each channel.
  16682. </p>
  16683. <p>It accepts the following parameters:
  16684. </p><dl class="table">
  16685. <dt><samp class="option">params</samp></dt>
  16686. <dd>
  16687. <p>This option string is in format:
  16688. &quot;c<var class="var">chn</var> f=<var class="var">cf</var> w=<var class="var">w</var> g=<var class="var">g</var> t=<var class="var">f</var> | ...&quot;
  16689. Each equalizer band is separated by &rsquo;|&rsquo;.
  16690. </p>
  16691. <dl class="table">
  16692. <dt><samp class="option">chn</samp></dt>
  16693. <dd><p>Set channel number to which equalization will be applied.
  16694. If input doesn&rsquo;t have that channel the entry is ignored.
  16695. </p>
  16696. </dd>
  16697. <dt><samp class="option">f</samp></dt>
  16698. <dd><p>Set central frequency for band.
  16699. If input doesn&rsquo;t have that frequency the entry is ignored.
  16700. </p>
  16701. </dd>
  16702. <dt><samp class="option">w</samp></dt>
  16703. <dd><p>Set band width in Hertz.
  16704. </p>
  16705. </dd>
  16706. <dt><samp class="option">g</samp></dt>
  16707. <dd><p>Set band gain in dB.
  16708. </p>
  16709. </dd>
  16710. <dt><samp class="option">t</samp></dt>
  16711. <dd><p>Set filter type for band, optional, can be:
  16712. </p>
  16713. <dl class="table">
  16714. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  16715. <dd><p>Butterworth, this is default.
  16716. </p>
  16717. </dd>
  16718. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  16719. <dd><p>Chebyshev type 1.
  16720. </p>
  16721. </dd>
  16722. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  16723. <dd><p>Chebyshev type 2.
  16724. </p></dd>
  16725. </dl>
  16726. </dd>
  16727. </dl>
  16728. </dd>
  16729. <dt><samp class="option">curves</samp></dt>
  16730. <dd><p>With this option activated frequency response of anequalizer is displayed
  16731. in video stream.
  16732. </p>
  16733. </dd>
  16734. <dt><samp class="option">size</samp></dt>
  16735. <dd><p>Set video stream size. Only useful if curves option is activated.
  16736. </p>
  16737. </dd>
  16738. <dt><samp class="option">mgain</samp></dt>
  16739. <dd><p>Set max gain that will be displayed. Only useful if curves option is activated.
  16740. Setting this to a reasonable value makes it possible to display gain which is derived from
  16741. neighbour bands which are too close to each other and thus produce higher gain
  16742. when both are activated.
  16743. </p>
  16744. </dd>
  16745. <dt><samp class="option">fscale</samp></dt>
  16746. <dd><p>Set frequency scale used to draw frequency response in video output.
  16747. Can be linear or logarithmic. Default is logarithmic.
  16748. </p>
  16749. </dd>
  16750. <dt><samp class="option">colors</samp></dt>
  16751. <dd><p>Set color for each channel curve which is going to be displayed in video stream.
  16752. This is list of color names separated by space or by &rsquo;|&rsquo;.
  16753. Unrecognised or missing colors will be replaced by white color.
  16754. </p></dd>
  16755. </dl>
  16756. <a name="Examples-31"></a>
  16757. <h4 class="subsection">29.37.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-31" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-31" aria-hidden="true">TOC</a></span></h4>
  16758. <ul class="itemize mark-bullet">
  16759. <li>Lower gain by 10 of central frequency 200Hz and width 100 Hz
  16760. for first 2 channels using Chebyshev type 1 filter:
  16761. <div class="example">
  16762. <pre class="example-preformatted">anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
  16763. </pre></div>
  16764. </li></ul>
  16765. <a name="Commands-15"></a>
  16766. <h4 class="subsection">29.37.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-15" aria-hidden="true">TOC</a></span></h4>
  16767. <p>This filter supports the following commands:
  16768. </p><dl class="table">
  16769. <dt><samp class="option">change</samp></dt>
  16770. <dd><p>Alter existing filter parameters.
  16771. Syntax for the commands is : &quot;<var class="var">fN</var>|f=<var class="var">freq</var>|w=<var class="var">width</var>|g=<var class="var">gain</var>&quot;
  16772. </p>
  16773. <p><var class="var">fN</var> is existing filter number, starting from 0, if no such filter is available
  16774. error is returned.
  16775. <var class="var">freq</var> set new frequency parameter.
  16776. <var class="var">width</var> set new width parameter in Hertz.
  16777. <var class="var">gain</var> set new gain parameter in dB.
  16778. </p>
  16779. <p>Full filter invocation with asendcmd may look like this:
  16780. asendcmd=c=&rsquo;4.0 anequalizer change 0|f=200|w=50|g=1&rsquo;,anequalizer=...
  16781. </p></dd>
  16782. </dl>
  16783. <a name="anlmdn"></a>
  16784. <h3 class="section">29.38 anlmdn<span class="pull-right"><a class="anchor hidden-xs" href="#anlmdn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anlmdn" aria-hidden="true">TOC</a></span></h3>
  16785. <p>Reduce broadband noise in audio samples using Non-Local Means algorithm.
  16786. </p>
  16787. <p>Each sample is adjusted by looking for other samples with similar contexts. This
  16788. context similarity is defined by comparing their surrounding patches of size
  16789. <samp class="option">p</samp>. Patches are searched in an area of <samp class="option">r</samp> around the sample.
  16790. </p>
  16791. <p>The filter accepts the following options:
  16792. </p>
  16793. <dl class="table">
  16794. <dt><samp class="option">strength, s</samp></dt>
  16795. <dd><p>Set denoising strength. Allowed range is from 0.00001 to 10000. Default value is 0.00001.
  16796. </p>
  16797. </dd>
  16798. <dt><samp class="option">patch, p</samp></dt>
  16799. <dd><p>Set patch radius duration. Allowed range is from 1 to 100 milliseconds.
  16800. Default value is 2 milliseconds.
  16801. </p>
  16802. </dd>
  16803. <dt><samp class="option">research, r</samp></dt>
  16804. <dd><p>Set research radius duration. Allowed range is from 2 to 300 milliseconds.
  16805. Default value is 6 milliseconds.
  16806. </p>
  16807. </dd>
  16808. <dt><samp class="option">output, o</samp></dt>
  16809. <dd><p>Set the output mode.
  16810. </p>
  16811. <p>It accepts the following values:
  16812. </p><dl class="table">
  16813. <dt><samp class="option">i</samp></dt>
  16814. <dd><p>Pass input unchanged.
  16815. </p>
  16816. </dd>
  16817. <dt><samp class="option">o</samp></dt>
  16818. <dd><p>Pass noise filtered out.
  16819. </p>
  16820. </dd>
  16821. <dt><samp class="option">n</samp></dt>
  16822. <dd><p>Pass only noise.
  16823. </p>
  16824. <p>Default value is <var class="var">o</var>.
  16825. </p></dd>
  16826. </dl>
  16827. </dd>
  16828. <dt><samp class="option">smooth, m</samp></dt>
  16829. <dd><p>Set smooth factor. Default value is <var class="var">11</var>. Allowed range is from <var class="var">1</var> to <var class="var">1000</var>.
  16830. </p></dd>
  16831. </dl>
  16832. <a name="Commands-16"></a>
  16833. <h4 class="subsection">29.38.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-16" aria-hidden="true">TOC</a></span></h4>
  16834. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  16835. </p>
  16836. <a name="anlmf_002c-anlms"></a>
  16837. <h3 class="section">29.39 anlmf, anlms<span class="pull-right"><a class="anchor hidden-xs" href="#anlmf_002c-anlms" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anlmf_002c-anlms" aria-hidden="true">TOC</a></span></h3>
  16838. <p>Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream.
  16839. </p>
  16840. <p>This adaptive filter is used to mimic a desired filter by finding the filter coefficients that
  16841. relate to producing the least mean square of the error signal (difference between the desired,
  16842. 2nd input audio stream and the actual signal, the 1st input audio stream).
  16843. </p>
  16844. <p>A description of the accepted options follows.
  16845. </p>
  16846. <dl class="table">
  16847. <dt><samp class="option">order</samp></dt>
  16848. <dd><p>Set filter order.
  16849. </p>
  16850. </dd>
  16851. <dt><samp class="option">mu</samp></dt>
  16852. <dd><p>Set filter mu.
  16853. </p>
  16854. </dd>
  16855. <dt><samp class="option">eps</samp></dt>
  16856. <dd><p>Set the filter eps.
  16857. </p>
  16858. </dd>
  16859. <dt><samp class="option">leakage</samp></dt>
  16860. <dd><p>Set the filter leakage.
  16861. </p>
  16862. </dd>
  16863. <dt><samp class="option">out_mode</samp></dt>
  16864. <dd><p>It accepts the following values:
  16865. </p><dl class="table">
  16866. <dt><samp class="option">i</samp></dt>
  16867. <dd><p>Pass the 1st input.
  16868. </p>
  16869. </dd>
  16870. <dt><samp class="option">d</samp></dt>
  16871. <dd><p>Pass the 2nd input.
  16872. </p>
  16873. </dd>
  16874. <dt><samp class="option">o</samp></dt>
  16875. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  16876. </p>
  16877. </dd>
  16878. <dt><samp class="option">n</samp></dt>
  16879. <dd><p>Pass difference between input, 1st input and error signal estimate.
  16880. </p>
  16881. </dd>
  16882. <dt><samp class="option">e</samp></dt>
  16883. <dd><p>Pass error signal estimated samples.
  16884. </p>
  16885. <p>Default value is <var class="var">o</var>.
  16886. </p></dd>
  16887. </dl>
  16888. </dd>
  16889. <dt><samp class="option">precision</samp></dt>
  16890. <dd><p>Set which precision to use when processing samples.
  16891. </p>
  16892. <dl class="table">
  16893. <dt><samp class="option">auto</samp></dt>
  16894. <dd><p>Auto pick internal sample format depending on other filters.
  16895. </p>
  16896. </dd>
  16897. <dt><samp class="option">float</samp></dt>
  16898. <dd><p>Always use single-floating point precision sample format.
  16899. </p>
  16900. </dd>
  16901. <dt><samp class="option">double</samp></dt>
  16902. <dd><p>Always use double-floating point precision sample format.
  16903. </p></dd>
  16904. </dl>
  16905. </dd>
  16906. </dl>
  16907. <a name="Examples-32"></a>
  16908. <h4 class="subsection">29.39.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-32" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-32" aria-hidden="true">TOC</a></span></h4>
  16909. <ul class="itemize mark-bullet">
  16910. <li>One of many usages of this filter is noise reduction, input audio is filtered
  16911. with same samples that are delayed by fixed amount, one such example for stereo audio is:
  16912. <div class="example">
  16913. <pre class="example-preformatted">asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
  16914. </pre></div>
  16915. </li></ul>
  16916. <a name="Commands-17"></a>
  16917. <h4 class="subsection">29.39.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-17" aria-hidden="true">TOC</a></span></h4>
  16918. <p>This filter supports the same commands as options, excluding option <code class="code">order</code>.
  16919. </p>
  16920. <a name="anull"></a>
  16921. <h3 class="section">29.40 anull<span class="pull-right"><a class="anchor hidden-xs" href="#anull" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anull" aria-hidden="true">TOC</a></span></h3>
  16922. <p>Pass the audio source unchanged to the output.
  16923. </p>
  16924. <a name="apad"></a>
  16925. <h3 class="section">29.41 apad<span class="pull-right"><a class="anchor hidden-xs" href="#apad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apad" aria-hidden="true">TOC</a></span></h3>
  16926. <p>Pad the end of an audio stream with silence.
  16927. </p>
  16928. <p>This can be used together with <code class="command">ffmpeg</code> <samp class="option">-shortest</samp> to
  16929. extend audio streams to the same length as the video stream.
  16930. </p>
  16931. <p>A description of the accepted options follows.
  16932. </p>
  16933. <dl class="table">
  16934. <dt><samp class="option">packet_size</samp></dt>
  16935. <dd><p>Set silence packet size. Default value is 4096.
  16936. </p>
  16937. </dd>
  16938. <dt><samp class="option">pad_len</samp></dt>
  16939. <dd><p>Set the number of samples of silence to add to the end. After the
  16940. value is reached, the stream is terminated. This option is mutually
  16941. exclusive with <samp class="option">whole_len</samp>.
  16942. </p>
  16943. </dd>
  16944. <dt><samp class="option">whole_len</samp></dt>
  16945. <dd><p>Set the minimum total number of samples in the output audio stream. If
  16946. the value is longer than the input audio length, silence is added to
  16947. the end, until the value is reached. This option is mutually exclusive
  16948. with <samp class="option">pad_len</samp>.
  16949. </p>
  16950. </dd>
  16951. <dt><samp class="option">pad_dur</samp></dt>
  16952. <dd><p>Specify the duration of samples of silence to add. See
  16953. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  16954. for the accepted syntax. Used only if set to non-negative value.
  16955. </p>
  16956. </dd>
  16957. <dt><samp class="option">whole_dur</samp></dt>
  16958. <dd><p>Specify the minimum total duration in the output audio stream. See
  16959. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  16960. for the accepted syntax. Used only if set to non-negative value. If the value is longer than
  16961. the input audio length, silence is added to the end, until the value is reached.
  16962. This option is mutually exclusive with <samp class="option">pad_dur</samp>
  16963. </p></dd>
  16964. </dl>
  16965. <p>If neither the <samp class="option">pad_len</samp> nor the <samp class="option">whole_len</samp> nor <samp class="option">pad_dur</samp>
  16966. nor <samp class="option">whole_dur</samp> option is set, the filter will add silence to the end of
  16967. the input stream indefinitely.
  16968. </p>
  16969. <p>Note that for ffmpeg 4.4 and earlier a zero <samp class="option">pad_dur</samp> or
  16970. <samp class="option">whole_dur</samp> also caused the filter to add silence indefinitely.
  16971. </p>
  16972. <a name="Examples-33"></a>
  16973. <h4 class="subsection">29.41.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-33" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-33" aria-hidden="true">TOC</a></span></h4>
  16974. <ul class="itemize mark-bullet">
  16975. <li>Add 1024 samples of silence to the end of the input:
  16976. <div class="example">
  16977. <pre class="example-preformatted">apad=pad_len=1024
  16978. </pre></div>
  16979. </li><li>Make sure the audio output will contain at least 10000 samples, pad
  16980. the input with silence if required:
  16981. <div class="example">
  16982. <pre class="example-preformatted">apad=whole_len=10000
  16983. </pre></div>
  16984. </li><li>Use <code class="command">ffmpeg</code> to pad the audio input with silence, so that the
  16985. video stream will always result the shortest and will be converted
  16986. until the end in the output file when using the <samp class="option">shortest</samp>
  16987. option:
  16988. <div class="example">
  16989. <pre class="example-preformatted">ffmpeg -i VIDEO -i AUDIO -filter_complex &quot;[1:0]apad&quot; -shortest OUTPUT
  16990. </pre></div>
  16991. </li></ul>
  16992. <a name="aphaser"></a>
  16993. <h3 class="section">29.42 aphaser<span class="pull-right"><a class="anchor hidden-xs" href="#aphaser" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aphaser" aria-hidden="true">TOC</a></span></h3>
  16994. <p>Add a phasing effect to the input audio.
  16995. </p>
  16996. <p>A phaser filter creates series of peaks and troughs in the frequency spectrum.
  16997. The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
  16998. </p>
  16999. <p>A description of the accepted parameters follows.
  17000. </p>
  17001. <dl class="table">
  17002. <dt><samp class="option">in_gain</samp></dt>
  17003. <dd><p>Set input gain. Default is 0.4.
  17004. </p>
  17005. </dd>
  17006. <dt><samp class="option">out_gain</samp></dt>
  17007. <dd><p>Set output gain. Default is 0.74
  17008. </p>
  17009. </dd>
  17010. <dt><samp class="option">delay</samp></dt>
  17011. <dd><p>Set delay in milliseconds. Default is 3.0.
  17012. </p>
  17013. </dd>
  17014. <dt><samp class="option">decay</samp></dt>
  17015. <dd><p>Set decay. Default is 0.4.
  17016. </p>
  17017. </dd>
  17018. <dt><samp class="option">speed</samp></dt>
  17019. <dd><p>Set modulation speed in Hz. Default is 0.5.
  17020. </p>
  17021. </dd>
  17022. <dt><samp class="option">type</samp></dt>
  17023. <dd><p>Set modulation type. Default is triangular.
  17024. </p>
  17025. <p>It accepts the following values:
  17026. </p><dl class="table">
  17027. <dt>&lsquo;<samp class="samp">triangular, t</samp>&rsquo;</dt>
  17028. <dt>&lsquo;<samp class="samp">sinusoidal, s</samp>&rsquo;</dt>
  17029. </dl>
  17030. </dd>
  17031. </dl>
  17032. <a name="aphaseshift"></a>
  17033. <h3 class="section">29.43 aphaseshift<span class="pull-right"><a class="anchor hidden-xs" href="#aphaseshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aphaseshift" aria-hidden="true">TOC</a></span></h3>
  17034. <p>Apply phase shift to input audio samples.
  17035. </p>
  17036. <p>The filter accepts the following options:
  17037. </p>
  17038. <dl class="table">
  17039. <dt><samp class="option">shift</samp></dt>
  17040. <dd><p>Specify phase shift. Allowed range is from -1.0 to 1.0.
  17041. Default value is 0.0.
  17042. </p>
  17043. </dd>
  17044. <dt><samp class="option">level</samp></dt>
  17045. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  17046. Default value is 1.0.
  17047. </p>
  17048. </dd>
  17049. <dt><samp class="option">order</samp></dt>
  17050. <dd><p>Set filter order used for filtering. Allowed range is from 1 to 16.
  17051. Default value is 8.
  17052. </p></dd>
  17053. </dl>
  17054. <a name="Commands-18"></a>
  17055. <h4 class="subsection">29.43.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-18" aria-hidden="true">TOC</a></span></h4>
  17056. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17057. </p>
  17058. <a name="apsnr"></a>
  17059. <h3 class="section">29.44 apsnr<span class="pull-right"><a class="anchor hidden-xs" href="#apsnr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apsnr" aria-hidden="true">TOC</a></span></h3>
  17060. <p>Measure Audio Peak Signal-to-Noise Ratio.
  17061. </p>
  17062. <p>This filter takes two audio streams for input, and outputs first
  17063. audio stream.
  17064. Results are in dB per channel at end of either input.
  17065. </p>
  17066. <a name="apsyclip"></a>
  17067. <h3 class="section">29.45 apsyclip<span class="pull-right"><a class="anchor hidden-xs" href="#apsyclip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apsyclip" aria-hidden="true">TOC</a></span></h3>
  17068. <p>Apply Psychoacoustic clipper to input audio stream.
  17069. </p>
  17070. <p>The filter accepts the following options:
  17071. </p>
  17072. <dl class="table">
  17073. <dt><samp class="option">level_in</samp></dt>
  17074. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  17075. </p>
  17076. </dd>
  17077. <dt><samp class="option">level_out</samp></dt>
  17078. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  17079. </p>
  17080. </dd>
  17081. <dt><samp class="option">clip</samp></dt>
  17082. <dd><p>Set the clipping start value. Default value is 0dBFS or 1.
  17083. </p>
  17084. </dd>
  17085. <dt><samp class="option">diff</samp></dt>
  17086. <dd><p>Output only difference samples, useful to hear introduced distortions.
  17087. By default is disabled.
  17088. </p>
  17089. </dd>
  17090. <dt><samp class="option">adaptive</samp></dt>
  17091. <dd><p>Set strength of adaptive distortion applied. Default value is 0.5.
  17092. Allowed range is from 0 to 1.
  17093. </p>
  17094. </dd>
  17095. <dt><samp class="option">iterations</samp></dt>
  17096. <dd><p>Set number of iterations of psychoacoustic clipper.
  17097. Allowed range is from 1 to 20. Default value is 10.
  17098. </p>
  17099. </dd>
  17100. <dt><samp class="option">level</samp></dt>
  17101. <dd><p>Auto level output signal. Default is disabled.
  17102. This normalizes audio back to 0dBFS if enabled.
  17103. </p></dd>
  17104. </dl>
  17105. <a name="Commands-19"></a>
  17106. <h4 class="subsection">29.45.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-19" aria-hidden="true">TOC</a></span></h4>
  17107. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17108. </p>
  17109. <a name="apulsator"></a>
  17110. <h3 class="section">29.46 apulsator<span class="pull-right"><a class="anchor hidden-xs" href="#apulsator" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apulsator" aria-hidden="true">TOC</a></span></h3>
  17111. <p>Audio pulsator is something between an autopanner and a tremolo.
  17112. But it can produce funny stereo effects as well. Pulsator changes the volume
  17113. of the left and right channel based on a LFO (low frequency oscillator) with
  17114. different waveforms and shifted phases.
  17115. This filter have the ability to define an offset between left and right
  17116. channel. An offset of 0 means that both LFO shapes match each other.
  17117. The left and right channel are altered equally - a conventional tremolo.
  17118. An offset of 50% means that the shape of the right channel is exactly shifted
  17119. in phase (or moved backwards about half of the frequency) - pulsator acts as
  17120. an autopanner. At 1 both curves match again. Every setting in between moves the
  17121. phase shift gapless between all stages and produces some &quot;bypassing&quot; sounds with
  17122. sine and triangle waveforms. The more you set the offset near 1 (starting from
  17123. the 0.5) the faster the signal passes from the left to the right speaker.
  17124. </p>
  17125. <p>The filter accepts the following options:
  17126. </p>
  17127. <dl class="table">
  17128. <dt><samp class="option">level_in</samp></dt>
  17129. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  17130. </p>
  17131. </dd>
  17132. <dt><samp class="option">level_out</samp></dt>
  17133. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  17134. </p>
  17135. </dd>
  17136. <dt><samp class="option">mode</samp></dt>
  17137. <dd><p>Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
  17138. sawup or sawdown. Default is sine.
  17139. </p>
  17140. </dd>
  17141. <dt><samp class="option">amount</samp></dt>
  17142. <dd><p>Set modulation. Define how much of original signal is affected by the LFO.
  17143. </p>
  17144. </dd>
  17145. <dt><samp class="option">offset_l</samp></dt>
  17146. <dd><p>Set left channel offset. Default is 0. Allowed range is [0 - 1].
  17147. </p>
  17148. </dd>
  17149. <dt><samp class="option">offset_r</samp></dt>
  17150. <dd><p>Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
  17151. </p>
  17152. </dd>
  17153. <dt><samp class="option">width</samp></dt>
  17154. <dd><p>Set pulse width. Default is 1. Allowed range is [0 - 2].
  17155. </p>
  17156. </dd>
  17157. <dt><samp class="option">timing</samp></dt>
  17158. <dd><p>Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
  17159. </p>
  17160. </dd>
  17161. <dt><samp class="option">bpm</samp></dt>
  17162. <dd><p>Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
  17163. is set to bpm.
  17164. </p>
  17165. </dd>
  17166. <dt><samp class="option">ms</samp></dt>
  17167. <dd><p>Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
  17168. is set to ms.
  17169. </p>
  17170. </dd>
  17171. <dt><samp class="option">hz</samp></dt>
  17172. <dd><p>Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
  17173. if timing is set to hz.
  17174. </p></dd>
  17175. </dl>
  17176. <a class="anchor" id="aresample"></a><a name="aresample-1"></a>
  17177. <h3 class="section">29.47 aresample<span class="pull-right"><a class="anchor hidden-xs" href="#aresample-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aresample-1" aria-hidden="true">TOC</a></span></h3>
  17178. <p>Resample the input audio to the specified parameters, using the
  17179. libswresample library. If none are specified then the filter will
  17180. automatically convert between its input and output.
  17181. </p>
  17182. <p>This filter is also able to stretch/squeeze the audio data to make it match
  17183. the timestamps or to inject silence / cut out audio to make it match the
  17184. timestamps, do a combination of both or do neither.
  17185. </p>
  17186. <p>The filter accepts the syntax
  17187. [<var class="var">sample_rate</var>:]<var class="var">resampler_options</var>, where <var class="var">sample_rate</var>
  17188. expresses a sample rate and <var class="var">resampler_options</var> is a list of
  17189. <var class="var">key</var>=<var class="var">value</var> pairs, separated by &quot;:&quot;. See the
  17190. <a data-manual="ffmpeg-resampler" href="ffmpeg-resampler.html#Resampler-Options">&quot;Resampler Options&quot; section in the
  17191. ffmpeg-resampler(1) manual</a>
  17192. for the complete list of supported options.
  17193. </p>
  17194. <a name="Examples-34"></a>
  17195. <h4 class="subsection">29.47.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-34" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-34" aria-hidden="true">TOC</a></span></h4>
  17196. <ul class="itemize mark-bullet">
  17197. <li>Resample the input audio to 44100Hz:
  17198. <div class="example">
  17199. <pre class="example-preformatted">aresample=44100
  17200. </pre></div>
  17201. </li><li>Stretch/squeeze samples to the given timestamps, with a maximum of 1000
  17202. samples per second compensation:
  17203. <div class="example">
  17204. <pre class="example-preformatted">aresample=async=1000
  17205. </pre></div>
  17206. </li></ul>
  17207. <a name="areverse"></a>
  17208. <h3 class="section">29.48 areverse<span class="pull-right"><a class="anchor hidden-xs" href="#areverse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-areverse" aria-hidden="true">TOC</a></span></h3>
  17209. <p>Reverse an audio clip.
  17210. </p>
  17211. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  17212. is suggested.
  17213. </p>
  17214. <a name="Examples-35"></a>
  17215. <h4 class="subsection">29.48.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-35" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-35" aria-hidden="true">TOC</a></span></h4>
  17216. <ul class="itemize mark-bullet">
  17217. <li>Take the first 5 seconds of a clip, and reverse it.
  17218. <div class="example">
  17219. <pre class="example-preformatted">atrim=end=5,areverse
  17220. </pre></div>
  17221. </li></ul>
  17222. <a name="arls"></a>
  17223. <h3 class="section">29.49 arls<span class="pull-right"><a class="anchor hidden-xs" href="#arls" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-arls" aria-hidden="true">TOC</a></span></h3>
  17224. <p>Apply Recursive Least Squares algorithm to the first audio stream using the second audio stream.
  17225. </p>
  17226. <p>This adaptive filter is used to mimic a desired filter by recursively finding the filter coefficients that
  17227. relate to producing the minimal weighted linear least squares cost function of the error signal (difference
  17228. between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream).
  17229. </p>
  17230. <p>A description of the accepted options follows.
  17231. </p>
  17232. <dl class="table">
  17233. <dt><samp class="option">order</samp></dt>
  17234. <dd><p>Set the filter order.
  17235. </p>
  17236. </dd>
  17237. <dt><samp class="option">lambda</samp></dt>
  17238. <dd><p>Set the forgetting factor.
  17239. </p>
  17240. </dd>
  17241. <dt><samp class="option">delta</samp></dt>
  17242. <dd><p>Set the coefficient to initialize internal covariance matrix.
  17243. </p>
  17244. </dd>
  17245. <dt><samp class="option">out_mode</samp></dt>
  17246. <dd><p>Set the filter output samples. It accepts the following values:
  17247. </p><dl class="table">
  17248. <dt><samp class="option">i</samp></dt>
  17249. <dd><p>Pass the 1st input.
  17250. </p>
  17251. </dd>
  17252. <dt><samp class="option">d</samp></dt>
  17253. <dd><p>Pass the 2nd input.
  17254. </p>
  17255. </dd>
  17256. <dt><samp class="option">o</samp></dt>
  17257. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  17258. </p>
  17259. </dd>
  17260. <dt><samp class="option">n</samp></dt>
  17261. <dd><p>Pass difference between input, 1st input and error signal estimate.
  17262. </p>
  17263. </dd>
  17264. <dt><samp class="option">e</samp></dt>
  17265. <dd><p>Pass error signal estimated samples.
  17266. </p>
  17267. <p>Default value is <var class="var">o</var>.
  17268. </p></dd>
  17269. </dl>
  17270. </dd>
  17271. <dt><samp class="option">precision</samp></dt>
  17272. <dd><p>Set which precision to use when processing samples.
  17273. </p>
  17274. <dl class="table">
  17275. <dt><samp class="option">auto</samp></dt>
  17276. <dd><p>Auto pick internal sample format depending on other filters.
  17277. </p>
  17278. </dd>
  17279. <dt><samp class="option">float</samp></dt>
  17280. <dd><p>Always use single-floating point precision sample format.
  17281. </p>
  17282. </dd>
  17283. <dt><samp class="option">double</samp></dt>
  17284. <dd><p>Always use double-floating point precision sample format.
  17285. </p></dd>
  17286. </dl>
  17287. </dd>
  17288. </dl>
  17289. <a name="arnndn"></a>
  17290. <h3 class="section">29.50 arnndn<span class="pull-right"><a class="anchor hidden-xs" href="#arnndn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-arnndn" aria-hidden="true">TOC</a></span></h3>
  17291. <p>Reduce noise from speech using Recurrent Neural Networks.
  17292. </p>
  17293. <p>This filter accepts the following options:
  17294. </p>
  17295. <dl class="table">
  17296. <dt><samp class="option">model, m</samp></dt>
  17297. <dd><p>Set train model file to load. This option is always required.
  17298. </p>
  17299. </dd>
  17300. <dt><samp class="option">mix</samp></dt>
  17301. <dd><p>Set how much to mix filtered samples into final output.
  17302. Allowed range is from -1 to 1. Default value is 1.
  17303. Negative values are special, they set how much to keep filtered noise
  17304. in the final filter output. Set this option to -1 to hear actual
  17305. noise removed from input signal.
  17306. </p></dd>
  17307. </dl>
  17308. <a name="Commands-20"></a>
  17309. <h4 class="subsection">29.50.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-20" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-20" aria-hidden="true">TOC</a></span></h4>
  17310. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17311. </p>
  17312. <a name="asdr"></a>
  17313. <h3 class="section">29.51 asdr<span class="pull-right"><a class="anchor hidden-xs" href="#asdr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asdr" aria-hidden="true">TOC</a></span></h3>
  17314. <p>Measure Audio Signal-to-Distortion Ratio.
  17315. </p>
  17316. <p>This filter takes two audio streams for input, and outputs first
  17317. audio stream.
  17318. Results are in dB per channel at end of either input.
  17319. </p>
  17320. <a name="asetnsamples"></a>
  17321. <h3 class="section">29.52 asetnsamples<span class="pull-right"><a class="anchor hidden-xs" href="#asetnsamples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asetnsamples" aria-hidden="true">TOC</a></span></h3>
  17322. <p>Set the number of samples per each output audio frame.
  17323. </p>
  17324. <p>The last output packet may contain a different number of samples, as
  17325. the filter will flush all the remaining samples when the input audio
  17326. signals its end.
  17327. </p>
  17328. <p>The filter accepts the following options:
  17329. </p>
  17330. <dl class="table">
  17331. <dt><samp class="option">nb_out_samples, n</samp></dt>
  17332. <dd><p>Set the number of frames per each output audio frame. The number is
  17333. intended as the number of samples <em class="emph">per each channel</em>.
  17334. Default value is 1024.
  17335. </p>
  17336. </dd>
  17337. <dt><samp class="option">pad, p</samp></dt>
  17338. <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
  17339. that the last frame will contain the same number of samples as the
  17340. previous ones. Default value is 1.
  17341. </p></dd>
  17342. </dl>
  17343. <p>For example, to set the number of per-frame samples to 1234 and
  17344. disable padding for the last frame, use:
  17345. </p><div class="example">
  17346. <pre class="example-preformatted">asetnsamples=n=1234:p=0
  17347. </pre></div>
  17348. <a name="asetrate"></a>
  17349. <h3 class="section">29.53 asetrate<span class="pull-right"><a class="anchor hidden-xs" href="#asetrate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asetrate" aria-hidden="true">TOC</a></span></h3>
  17350. <p>Set the sample rate without altering the PCM data.
  17351. This will result in a change of speed and pitch.
  17352. </p>
  17353. <p>The filter accepts the following options:
  17354. </p>
  17355. <dl class="table">
  17356. <dt><samp class="option">sample_rate, r</samp></dt>
  17357. <dd><p>Set the output sample rate. Default is 44100 Hz.
  17358. </p></dd>
  17359. </dl>
  17360. <a name="ashowinfo"></a>
  17361. <h3 class="section">29.54 ashowinfo<span class="pull-right"><a class="anchor hidden-xs" href="#ashowinfo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ashowinfo" aria-hidden="true">TOC</a></span></h3>
  17362. <p>Show a line containing various information for each input audio frame.
  17363. The input audio is not modified.
  17364. </p>
  17365. <p>The shown line contains a sequence of key/value pairs of the form
  17366. <var class="var">key</var>:<var class="var">value</var>.
  17367. </p>
  17368. <p>The following values are shown in the output:
  17369. </p>
  17370. <dl class="table">
  17371. <dt><samp class="option">n</samp></dt>
  17372. <dd><p>The (sequential) number of the input frame, starting from 0.
  17373. </p>
  17374. </dd>
  17375. <dt><samp class="option">pts</samp></dt>
  17376. <dd><p>The presentation timestamp of the input frame, in time base units; the time base
  17377. depends on the filter input pad, and is usually 1/<var class="var">sample_rate</var>.
  17378. </p>
  17379. </dd>
  17380. <dt><samp class="option">pts_time</samp></dt>
  17381. <dd><p>The presentation timestamp of the input frame in seconds.
  17382. </p>
  17383. </dd>
  17384. <dt><samp class="option">fmt</samp></dt>
  17385. <dd><p>The sample format.
  17386. </p>
  17387. </dd>
  17388. <dt><samp class="option">chlayout</samp></dt>
  17389. <dd><p>The channel layout.
  17390. </p>
  17391. </dd>
  17392. <dt><samp class="option">rate</samp></dt>
  17393. <dd><p>The sample rate for the audio frame.
  17394. </p>
  17395. </dd>
  17396. <dt><samp class="option">nb_samples</samp></dt>
  17397. <dd><p>The number of samples (per channel) in the frame.
  17398. </p>
  17399. </dd>
  17400. <dt><samp class="option">checksum</samp></dt>
  17401. <dd><p>The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
  17402. audio, the data is treated as if all the planes were concatenated.
  17403. </p>
  17404. </dd>
  17405. <dt><samp class="option">plane_checksums</samp></dt>
  17406. <dd><p>A list of Adler-32 checksums for each data plane.
  17407. </p></dd>
  17408. </dl>
  17409. <a name="asisdr"></a>
  17410. <h3 class="section">29.55 asisdr<span class="pull-right"><a class="anchor hidden-xs" href="#asisdr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asisdr" aria-hidden="true">TOC</a></span></h3>
  17411. <p>Measure Audio Scaled-Invariant Signal-to-Distortion Ratio.
  17412. </p>
  17413. <p>This filter takes two audio streams for input, and outputs first
  17414. audio stream.
  17415. Results are in dB per channel at end of either input.
  17416. </p>
  17417. <a name="asoftclip"></a>
  17418. <h3 class="section">29.56 asoftclip<span class="pull-right"><a class="anchor hidden-xs" href="#asoftclip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asoftclip" aria-hidden="true">TOC</a></span></h3>
  17419. <p>Apply audio soft clipping.
  17420. </p>
  17421. <p>Soft clipping is a type of distortion effect where the amplitude of a signal is saturated
  17422. along a smooth curve, rather than the abrupt shape of hard-clipping.
  17423. </p>
  17424. <p>This filter accepts the following options:
  17425. </p>
  17426. <dl class="table">
  17427. <dt><samp class="option">type</samp></dt>
  17428. <dd><p>Set type of soft-clipping.
  17429. </p>
  17430. <p>It accepts the following values:
  17431. </p><dl class="table">
  17432. <dt><samp class="option">hard</samp></dt>
  17433. <dt><samp class="option">tanh</samp></dt>
  17434. <dt><samp class="option">atan</samp></dt>
  17435. <dt><samp class="option">cubic</samp></dt>
  17436. <dt><samp class="option">exp</samp></dt>
  17437. <dt><samp class="option">alg</samp></dt>
  17438. <dt><samp class="option">quintic</samp></dt>
  17439. <dt><samp class="option">sin</samp></dt>
  17440. <dt><samp class="option">erf</samp></dt>
  17441. </dl>
  17442. </dd>
  17443. <dt><samp class="option">threshold</samp></dt>
  17444. <dd><p>Set threshold from where to start clipping. Default value is 0dB or 1.
  17445. </p>
  17446. </dd>
  17447. <dt><samp class="option">output</samp></dt>
  17448. <dd><p>Set gain applied to output. Default value is 0dB or 1.
  17449. </p>
  17450. </dd>
  17451. <dt><samp class="option">param</samp></dt>
  17452. <dd><p>Set additional parameter which controls sigmoid function.
  17453. </p>
  17454. </dd>
  17455. <dt><samp class="option">oversample</samp></dt>
  17456. <dd><p>Set oversampling factor.
  17457. </p></dd>
  17458. </dl>
  17459. <a name="Commands-21"></a>
  17460. <h4 class="subsection">29.56.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-21" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-21" aria-hidden="true">TOC</a></span></h4>
  17461. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17462. </p>
  17463. <a name="aspectralstats"></a>
  17464. <h3 class="section">29.57 aspectralstats<span class="pull-right"><a class="anchor hidden-xs" href="#aspectralstats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aspectralstats" aria-hidden="true">TOC</a></span></h3>
  17465. <p>Display frequency domain statistical information about the audio channels.
  17466. Statistics are calculated and stored as metadata for each audio channel and for each audio frame.
  17467. </p>
  17468. <p>It accepts the following option:
  17469. </p><dl class="table">
  17470. <dt><samp class="option">win_size</samp></dt>
  17471. <dd><p>Set the window length in samples. Default value is 2048.
  17472. Allowed range is from 32 to 65536.
  17473. </p>
  17474. </dd>
  17475. <dt><samp class="option">win_func</samp></dt>
  17476. <dd><p>Set window function.
  17477. </p>
  17478. <p>It accepts the following values:
  17479. </p><dl class="table">
  17480. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  17481. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  17482. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  17483. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  17484. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  17485. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  17486. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  17487. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  17488. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  17489. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  17490. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  17491. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  17492. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  17493. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  17494. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  17495. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  17496. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  17497. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  17498. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  17499. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  17500. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  17501. </dl>
  17502. <p>Default is <code class="code">hann</code>.
  17503. </p>
  17504. </dd>
  17505. <dt><samp class="option">overlap</samp></dt>
  17506. <dd><p>Set window overlap. Allowed range is from <code class="code">0</code>
  17507. to <code class="code">1</code>. Default value is <code class="code">0.5</code>.
  17508. </p>
  17509. </dd>
  17510. <dt><samp class="option">measure</samp></dt>
  17511. <dd><p>Select the parameters which are measured. The metadata keys can
  17512. be used as flags, default is <samp class="option">all</samp> which measures everything.
  17513. <samp class="option">none</samp> disables all measurement.
  17514. </p></dd>
  17515. </dl>
  17516. <p>A list of each metadata key follows:
  17517. </p>
  17518. <dl class="table">
  17519. <dt><samp class="option">mean</samp></dt>
  17520. <dt><samp class="option">variance</samp></dt>
  17521. <dt><samp class="option">centroid</samp></dt>
  17522. <dt><samp class="option">spread</samp></dt>
  17523. <dt><samp class="option">skewness</samp></dt>
  17524. <dt><samp class="option">kurtosis</samp></dt>
  17525. <dt><samp class="option">entropy</samp></dt>
  17526. <dt><samp class="option">flatness</samp></dt>
  17527. <dt><samp class="option">crest</samp></dt>
  17528. <dt><samp class="option">flux</samp></dt>
  17529. <dt><samp class="option">slope</samp></dt>
  17530. <dt><samp class="option">decrease</samp></dt>
  17531. <dt><samp class="option">rolloff</samp></dt>
  17532. </dl>
  17533. <a name="asr"></a>
  17534. <h3 class="section">29.58 asr<span class="pull-right"><a class="anchor hidden-xs" href="#asr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asr" aria-hidden="true">TOC</a></span></h3>
  17535. <p>Automatic Speech Recognition
  17536. </p>
  17537. <p>This filter uses PocketSphinx for speech recognition. To enable
  17538. compilation of this filter, you need to configure FFmpeg with
  17539. <code class="code">--enable-pocketsphinx</code>.
  17540. </p>
  17541. <p>It accepts the following options:
  17542. </p>
  17543. <dl class="table">
  17544. <dt><samp class="option">rate</samp></dt>
  17545. <dd><p>Set sampling rate of input audio. Defaults is <code class="code">16000</code>.
  17546. This need to match speech models, otherwise one will get poor results.
  17547. </p>
  17548. </dd>
  17549. <dt><samp class="option">hmm</samp></dt>
  17550. <dd><p>Set dictionary containing acoustic model files.
  17551. </p>
  17552. </dd>
  17553. <dt><samp class="option">dict</samp></dt>
  17554. <dd><p>Set pronunciation dictionary.
  17555. </p>
  17556. </dd>
  17557. <dt><samp class="option">lm</samp></dt>
  17558. <dd><p>Set language model file.
  17559. </p>
  17560. </dd>
  17561. <dt><samp class="option">lmctl</samp></dt>
  17562. <dd><p>Set language model set.
  17563. </p>
  17564. </dd>
  17565. <dt><samp class="option">lmname</samp></dt>
  17566. <dd><p>Set which language model to use.
  17567. </p>
  17568. </dd>
  17569. <dt><samp class="option">logfn</samp></dt>
  17570. <dd><p>Set output for log messages.
  17571. </p></dd>
  17572. </dl>
  17573. <p>The filter exports recognized speech as the frame metadata <code class="code">lavfi.asr.text</code>.
  17574. </p>
  17575. <a class="anchor" id="astats"></a><a name="astats-1"></a>
  17576. <h3 class="section">29.59 astats<span class="pull-right"><a class="anchor hidden-xs" href="#astats-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-astats-1" aria-hidden="true">TOC</a></span></h3>
  17577. <p>Display time domain statistical information about the audio channels.
  17578. Statistics are calculated and displayed for each audio channel and,
  17579. where applicable, an overall figure is also given.
  17580. </p>
  17581. <p>It accepts the following option:
  17582. </p><dl class="table">
  17583. <dt><samp class="option">length</samp></dt>
  17584. <dd><p>Short window length in seconds, used for peak and through RMS measurement.
  17585. Default is <code class="code">0.05</code> (50 milliseconds). Allowed range is <code class="code">[0 - 10]</code>.
  17586. </p>
  17587. </dd>
  17588. <dt><samp class="option">metadata</samp></dt>
  17589. <dd>
  17590. <p>Set metadata injection. All the metadata keys are prefixed with <code class="code">lavfi.astats.X</code>,
  17591. where <code class="code">X</code> is channel number starting from 1 or string <code class="code">Overall</code>. Default is
  17592. disabled.
  17593. </p>
  17594. <p>Available keys for each channel are:
  17595. <var class="var">Bit_depth</var>
  17596. <var class="var">Crest_factor</var>
  17597. <var class="var">DC_offset</var>
  17598. <var class="var">Dynamic_range</var>
  17599. <var class="var">Entropy</var>
  17600. <var class="var">Flat_factor</var>
  17601. <var class="var">Max_difference</var>
  17602. <var class="var">Max_level</var>
  17603. <var class="var">Mean_difference</var>
  17604. <var class="var">Min_difference</var>
  17605. <var class="var">Min_level</var>
  17606. <var class="var">Noise_floor</var>
  17607. <var class="var">Noise_floor_count</var>
  17608. <var class="var">Number_of_Infs</var>
  17609. <var class="var">Number_of_NaNs</var>
  17610. <var class="var">Number_of_denormals</var>
  17611. <var class="var">Peak_count</var>
  17612. <var class="var">Abs_Peak_count</var>
  17613. <var class="var">Peak_level</var>
  17614. <var class="var">RMS_difference</var>
  17615. <var class="var">RMS_peak</var>
  17616. <var class="var">RMS_trough</var>
  17617. <var class="var">Zero_crossings</var>
  17618. <var class="var">Zero_crossings_rate</var>
  17619. </p>
  17620. <p>and for <code class="code">Overall</code>:
  17621. <var class="var">Bit_depth</var>
  17622. <var class="var">DC_offset</var>
  17623. <var class="var">Entropy</var>
  17624. <var class="var">Flat_factor</var>
  17625. <var class="var">Max_difference</var>
  17626. <var class="var">Max_level</var>
  17627. <var class="var">Mean_difference</var>
  17628. <var class="var">Min_difference</var>
  17629. <var class="var">Min_level</var>
  17630. <var class="var">Noise_floor</var>
  17631. <var class="var">Noise_floor_count</var>
  17632. <var class="var">Number_of_Infs</var>
  17633. <var class="var">Number_of_NaNs</var>
  17634. <var class="var">Number_of_denormals</var>
  17635. <var class="var">Number_of_samples</var>
  17636. <var class="var">Peak_count</var>
  17637. <var class="var">Abs_Peak_count</var>
  17638. <var class="var">Peak_level</var>
  17639. <var class="var">RMS_difference</var>
  17640. <var class="var">RMS_level</var>
  17641. <var class="var">RMS_peak</var>
  17642. <var class="var">RMS_trough</var>
  17643. </p>
  17644. <p>For example, a full key looks like <code class="code">lavfi.astats.1.DC_offset</code> or
  17645. <code class="code">lavfi.astats.Overall.Peak_count</code>.
  17646. </p>
  17647. <p>Read below for the description of the keys.
  17648. </p>
  17649. </dd>
  17650. <dt><samp class="option">reset</samp></dt>
  17651. <dd><p>Set the number of frames over which cumulative stats are calculated before
  17652. being reset. Default is disabled.
  17653. </p>
  17654. </dd>
  17655. <dt><samp class="option">measure_perchannel</samp></dt>
  17656. <dd><p>Select the parameters which are measured per channel. The metadata keys can
  17657. be used as flags, default is <samp class="option">all</samp> which measures everything.
  17658. <samp class="option">none</samp> disables all per channel measurement.
  17659. </p>
  17660. </dd>
  17661. <dt><samp class="option">measure_overall</samp></dt>
  17662. <dd><p>Select the parameters which are measured overall. The metadata keys can
  17663. be used as flags, default is <samp class="option">all</samp> which measures everything.
  17664. <samp class="option">none</samp> disables all overall measurement.
  17665. </p>
  17666. </dd>
  17667. </dl>
  17668. <p>A description of the measure keys follow:
  17669. </p>
  17670. <dl class="table">
  17671. <dt><samp class="option">none</samp></dt>
  17672. <dd><p>no measures
  17673. </p>
  17674. </dd>
  17675. <dt><samp class="option">all</samp></dt>
  17676. <dd><p>all measures
  17677. </p>
  17678. </dd>
  17679. <dt><samp class="option">Bit_depth</samp></dt>
  17680. <dd><p>overall bit depth of audio, i.e. number of bits used for each sample
  17681. </p>
  17682. </dd>
  17683. <dt><samp class="option">Crest_factor</samp></dt>
  17684. <dd><p>standard ratio of peak to RMS level (note: not in dB)
  17685. </p>
  17686. </dd>
  17687. <dt><samp class="option">DC_offset</samp></dt>
  17688. <dd><p>mean amplitude displacement from zero
  17689. </p>
  17690. </dd>
  17691. <dt><samp class="option">Dynamic_range</samp></dt>
  17692. <dd><p>measured dynamic range of audio in dB
  17693. </p>
  17694. </dd>
  17695. <dt><samp class="option">Entropy</samp></dt>
  17696. <dd><p>entropy measured across whole audio, entropy of value near 1.0 is typically measured for white noise
  17697. </p>
  17698. </dd>
  17699. <dt><samp class="option">Flat_factor</samp></dt>
  17700. <dd><p>flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
  17701. (i.e. either <var class="var">Min_level</var> or <var class="var">Max_level</var>)
  17702. </p>
  17703. </dd>
  17704. <dt><samp class="option">Max_difference</samp></dt>
  17705. <dd><p>maximal difference between two consecutive samples
  17706. </p>
  17707. </dd>
  17708. <dt><samp class="option">Max_level</samp></dt>
  17709. <dd><p>maximal sample level
  17710. </p>
  17711. </dd>
  17712. <dt><samp class="option">Mean_difference</samp></dt>
  17713. <dd><p>mean difference between two consecutive samples, i.e. the average of each difference between two consecutive samples
  17714. </p>
  17715. </dd>
  17716. <dt><samp class="option">Min_difference</samp></dt>
  17717. <dd><p>minimal difference between two consecutive samples
  17718. </p>
  17719. </dd>
  17720. <dt><samp class="option">Min_level</samp></dt>
  17721. <dd><p>minimal sample level
  17722. </p>
  17723. </dd>
  17724. <dt><samp class="option">Noise_floor</samp></dt>
  17725. <dd><p>minimum local peak measured in dBFS over a short window
  17726. </p>
  17727. </dd>
  17728. <dt><samp class="option">Noise_floor_count</samp></dt>
  17729. <dd><p>number of occasions (not the number of samples) that the signal attained
  17730. <var class="var">Noise floor</var>
  17731. </p>
  17732. </dd>
  17733. <dt><samp class="option">Number_of_Infs</samp></dt>
  17734. <dd><p>number of samples with an infinite value
  17735. </p>
  17736. </dd>
  17737. <dt><samp class="option">Number_of_NaNs</samp></dt>
  17738. <dd><p>number of samples with a NaN (not a number) value
  17739. </p>
  17740. </dd>
  17741. <dt><samp class="option">Number_of_denormals</samp></dt>
  17742. <dd><p>number of samples with a subnormal value
  17743. </p>
  17744. </dd>
  17745. <dt><samp class="option">Number_of_samples</samp></dt>
  17746. <dd><p>number of samples
  17747. </p>
  17748. </dd>
  17749. <dt><samp class="option">Peak_count</samp></dt>
  17750. <dd><p>number of occasions (not the number of samples) that the signal attained either
  17751. <var class="var">Min_level</var> or <var class="var">Max_level</var>
  17752. </p>
  17753. </dd>
  17754. <dt><samp class="option">Abs_Peak_count</samp></dt>
  17755. <dd><p>number of occasions that the absolute samples taken from the signal attained
  17756. max absolute value of <var class="var">Min_level</var> and <var class="var">Max_level</var>
  17757. </p>
  17758. </dd>
  17759. <dt><samp class="option">Peak_level</samp></dt>
  17760. <dd><p>standard peak level measured in dBFS
  17761. </p>
  17762. </dd>
  17763. <dt><samp class="option">RMS_difference</samp></dt>
  17764. <dd><p>Root Mean Square difference between two consecutive samples
  17765. </p>
  17766. </dd>
  17767. <dt><samp class="option">RMS_level</samp></dt>
  17768. <dd><p>standard RMS level measured in dBFS
  17769. </p>
  17770. </dd>
  17771. <dt><samp class="option">RMS_peak</samp></dt>
  17772. <dt><samp class="option">RMS_trough</samp></dt>
  17773. <dd><p>peak and through values for RMS level measured over a short window,
  17774. measured in dBFS.
  17775. </p>
  17776. </dd>
  17777. <dt><samp class="option">Zero crossings</samp></dt>
  17778. <dd><p>number of points where the waveform crosses the zero level axis
  17779. </p>
  17780. </dd>
  17781. <dt><samp class="option">Zero crossings rate</samp></dt>
  17782. <dd><p>rate of Zero crossings and number of audio samples
  17783. </p></dd>
  17784. </dl>
  17785. <a name="asubboost"></a>
  17786. <h3 class="section">29.60 asubboost<span class="pull-right"><a class="anchor hidden-xs" href="#asubboost" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asubboost" aria-hidden="true">TOC</a></span></h3>
  17787. <p>Boost subwoofer frequencies.
  17788. </p>
  17789. <p>The filter accepts the following options:
  17790. </p>
  17791. <dl class="table">
  17792. <dt><samp class="option">dry</samp></dt>
  17793. <dd><p>Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1.
  17794. Default value is 1.0.
  17795. </p>
  17796. </dd>
  17797. <dt><samp class="option">wet</samp></dt>
  17798. <dd><p>Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1.
  17799. Default value is 1.0.
  17800. </p>
  17801. </dd>
  17802. <dt><samp class="option">boost</samp></dt>
  17803. <dd><p>Set max boost factor. Allowed range is from 1 to 12. Default value is 2.
  17804. </p>
  17805. </dd>
  17806. <dt><samp class="option">decay</samp></dt>
  17807. <dd><p>Set delay line decay gain value. Allowed range is from 0 to 1.
  17808. Default value is 0.0.
  17809. </p>
  17810. </dd>
  17811. <dt><samp class="option">feedback</samp></dt>
  17812. <dd><p>Set delay line feedback gain value. Allowed range is from 0 to 1.
  17813. Default value is 0.9.
  17814. </p>
  17815. </dd>
  17816. <dt><samp class="option">cutoff</samp></dt>
  17817. <dd><p>Set cutoff frequency in Hertz. Allowed range is 50 to 900.
  17818. Default value is 100.
  17819. </p>
  17820. </dd>
  17821. <dt><samp class="option">slope</samp></dt>
  17822. <dd><p>Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1.
  17823. Default value is 0.5.
  17824. </p>
  17825. </dd>
  17826. <dt><samp class="option">delay</samp></dt>
  17827. <dd><p>Set delay. Allowed range is from 1 to 100.
  17828. Default value is 20.
  17829. </p>
  17830. </dd>
  17831. <dt><samp class="option">channels</samp></dt>
  17832. <dd><p>Set the channels to process. Default value is all available.
  17833. </p></dd>
  17834. </dl>
  17835. <a name="Commands-22"></a>
  17836. <h4 class="subsection">29.60.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-22" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-22" aria-hidden="true">TOC</a></span></h4>
  17837. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17838. </p>
  17839. <a name="asubcut"></a>
  17840. <h3 class="section">29.61 asubcut<span class="pull-right"><a class="anchor hidden-xs" href="#asubcut" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asubcut" aria-hidden="true">TOC</a></span></h3>
  17841. <p>Cut subwoofer frequencies.
  17842. </p>
  17843. <p>This filter allows to set custom, steeper
  17844. roll off than highpass filter, and thus is able to more attenuate
  17845. frequency content in stop-band.
  17846. </p>
  17847. <p>The filter accepts the following options:
  17848. </p>
  17849. <dl class="table">
  17850. <dt><samp class="option">cutoff</samp></dt>
  17851. <dd><p>Set cutoff frequency in Hertz. Allowed range is 2 to 200.
  17852. Default value is 20.
  17853. </p>
  17854. </dd>
  17855. <dt><samp class="option">order</samp></dt>
  17856. <dd><p>Set filter order. Available values are from 3 to 20.
  17857. Default value is 10.
  17858. </p>
  17859. </dd>
  17860. <dt><samp class="option">level</samp></dt>
  17861. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  17862. </p></dd>
  17863. </dl>
  17864. <a name="Commands-23"></a>
  17865. <h4 class="subsection">29.61.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-23" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-23" aria-hidden="true">TOC</a></span></h4>
  17866. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17867. </p>
  17868. <a name="asupercut"></a>
  17869. <h3 class="section">29.62 asupercut<span class="pull-right"><a class="anchor hidden-xs" href="#asupercut" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asupercut" aria-hidden="true">TOC</a></span></h3>
  17870. <p>Cut super frequencies.
  17871. </p>
  17872. <p>The filter accepts the following options:
  17873. </p>
  17874. <dl class="table">
  17875. <dt><samp class="option">cutoff</samp></dt>
  17876. <dd><p>Set cutoff frequency in Hertz. Allowed range is 20000 to 192000.
  17877. Default value is 20000.
  17878. </p>
  17879. </dd>
  17880. <dt><samp class="option">order</samp></dt>
  17881. <dd><p>Set filter order. Available values are from 3 to 20.
  17882. Default value is 10.
  17883. </p>
  17884. </dd>
  17885. <dt><samp class="option">level</samp></dt>
  17886. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  17887. </p></dd>
  17888. </dl>
  17889. <a name="Commands-24"></a>
  17890. <h4 class="subsection">29.62.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-24" aria-hidden="true">TOC</a></span></h4>
  17891. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17892. </p>
  17893. <a name="asuperpass"></a>
  17894. <h3 class="section">29.63 asuperpass<span class="pull-right"><a class="anchor hidden-xs" href="#asuperpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asuperpass" aria-hidden="true">TOC</a></span></h3>
  17895. <p>Apply high order Butterworth band-pass filter.
  17896. </p>
  17897. <p>The filter accepts the following options:
  17898. </p>
  17899. <dl class="table">
  17900. <dt><samp class="option">centerf</samp></dt>
  17901. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  17902. Default value is 1000.
  17903. </p>
  17904. </dd>
  17905. <dt><samp class="option">order</samp></dt>
  17906. <dd><p>Set filter order. Available values are from 4 to 20.
  17907. Default value is 4.
  17908. </p>
  17909. </dd>
  17910. <dt><samp class="option">qfactor</samp></dt>
  17911. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  17912. </p>
  17913. </dd>
  17914. <dt><samp class="option">level</samp></dt>
  17915. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  17916. </p></dd>
  17917. </dl>
  17918. <a name="Commands-25"></a>
  17919. <h4 class="subsection">29.63.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-25" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-25" aria-hidden="true">TOC</a></span></h4>
  17920. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17921. </p>
  17922. <a name="asuperstop"></a>
  17923. <h3 class="section">29.64 asuperstop<span class="pull-right"><a class="anchor hidden-xs" href="#asuperstop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asuperstop" aria-hidden="true">TOC</a></span></h3>
  17924. <p>Apply high order Butterworth band-stop filter.
  17925. </p>
  17926. <p>The filter accepts the following options:
  17927. </p>
  17928. <dl class="table">
  17929. <dt><samp class="option">centerf</samp></dt>
  17930. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  17931. Default value is 1000.
  17932. </p>
  17933. </dd>
  17934. <dt><samp class="option">order</samp></dt>
  17935. <dd><p>Set filter order. Available values are from 4 to 20.
  17936. Default value is 4.
  17937. </p>
  17938. </dd>
  17939. <dt><samp class="option">qfactor</samp></dt>
  17940. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  17941. </p>
  17942. </dd>
  17943. <dt><samp class="option">level</samp></dt>
  17944. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  17945. </p></dd>
  17946. </dl>
  17947. <a name="Commands-26"></a>
  17948. <h4 class="subsection">29.64.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-26" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-26" aria-hidden="true">TOC</a></span></h4>
  17949. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17950. </p>
  17951. <a name="atempo"></a>
  17952. <h3 class="section">29.65 atempo<span class="pull-right"><a class="anchor hidden-xs" href="#atempo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atempo" aria-hidden="true">TOC</a></span></h3>
  17953. <p>Adjust audio tempo.
  17954. </p>
  17955. <p>The filter accepts exactly one parameter, the audio tempo. If not
  17956. specified then the filter will assume nominal 1.0 tempo. Tempo must
  17957. be in the [0.5, 100.0] range.
  17958. </p>
  17959. <p>Note that tempo greater than 2 will skip some samples rather than
  17960. blend them in. If for any reason this is a concern it is always
  17961. possible to daisy-chain several instances of atempo to achieve the
  17962. desired product tempo.
  17963. </p>
  17964. <a name="Examples-36"></a>
  17965. <h4 class="subsection">29.65.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-36" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-36" aria-hidden="true">TOC</a></span></h4>
  17966. <ul class="itemize mark-bullet">
  17967. <li>Slow down audio to 80% tempo:
  17968. <div class="example">
  17969. <pre class="example-preformatted">atempo=0.8
  17970. </pre></div>
  17971. </li><li>To speed up audio to 300% tempo:
  17972. <div class="example">
  17973. <pre class="example-preformatted">atempo=3
  17974. </pre></div>
  17975. </li><li>To speed up audio to 300% tempo by daisy-chaining two atempo instances:
  17976. <div class="example">
  17977. <pre class="example-preformatted">atempo=sqrt(3),atempo=sqrt(3)
  17978. </pre></div>
  17979. </li></ul>
  17980. <a name="Commands-27"></a>
  17981. <h4 class="subsection">29.65.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-27" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-27" aria-hidden="true">TOC</a></span></h4>
  17982. <p>This filter supports the following commands:
  17983. </p><dl class="table">
  17984. <dt><samp class="option">tempo</samp></dt>
  17985. <dd><p>Change filter tempo scale factor.
  17986. Syntax for the command is : &quot;<var class="var">tempo</var>&quot;
  17987. </p></dd>
  17988. </dl>
  17989. <a name="atilt"></a>
  17990. <h3 class="section">29.66 atilt<span class="pull-right"><a class="anchor hidden-xs" href="#atilt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atilt" aria-hidden="true">TOC</a></span></h3>
  17991. <p>Apply spectral tilt filter to audio stream.
  17992. </p>
  17993. <p>This filter apply any spectral roll-off slope over any specified frequency band.
  17994. </p>
  17995. <p>The filter accepts the following options:
  17996. </p>
  17997. <dl class="table">
  17998. <dt><samp class="option">freq</samp></dt>
  17999. <dd><p>Set central frequency of tilt in Hz. Default is 10000 Hz.
  18000. </p>
  18001. </dd>
  18002. <dt><samp class="option">slope</samp></dt>
  18003. <dd><p>Set slope direction of tilt. Default is 0. Allowed range is from -1 to 1.
  18004. </p>
  18005. </dd>
  18006. <dt><samp class="option">width</samp></dt>
  18007. <dd><p>Set width of tilt. Default is 1000. Allowed range is from 100 to 10000.
  18008. </p>
  18009. </dd>
  18010. <dt><samp class="option">order</samp></dt>
  18011. <dd><p>Set order of tilt filter.
  18012. </p>
  18013. </dd>
  18014. <dt><samp class="option">level</samp></dt>
  18015. <dd><p>Set input volume level. Allowed range is from 0 to 4.
  18016. Default is 1.
  18017. </p></dd>
  18018. </dl>
  18019. <a name="Commands-28"></a>
  18020. <h4 class="subsection">29.66.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-28" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-28" aria-hidden="true">TOC</a></span></h4>
  18021. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  18022. </p>
  18023. <a name="atrim"></a>
  18024. <h3 class="section">29.67 atrim<span class="pull-right"><a class="anchor hidden-xs" href="#atrim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atrim" aria-hidden="true">TOC</a></span></h3>
  18025. <p>Trim the input so that the output contains one continuous subpart of the input.
  18026. </p>
  18027. <p>It accepts the following parameters:
  18028. </p><dl class="table">
  18029. <dt><samp class="option">start</samp></dt>
  18030. <dd><p>Timestamp (in seconds) of the start of the section to keep. I.e. the audio
  18031. sample with the timestamp <var class="var">start</var> will be the first sample in the output.
  18032. </p>
  18033. </dd>
  18034. <dt><samp class="option">end</samp></dt>
  18035. <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
  18036. audio sample immediately preceding the one with the timestamp <var class="var">end</var> will be
  18037. the last sample in the output.
  18038. </p>
  18039. </dd>
  18040. <dt><samp class="option">start_pts</samp></dt>
  18041. <dd><p>Same as <var class="var">start</var>, except this option sets the start timestamp in samples
  18042. instead of seconds.
  18043. </p>
  18044. </dd>
  18045. <dt><samp class="option">end_pts</samp></dt>
  18046. <dd><p>Same as <var class="var">end</var>, except this option sets the end timestamp in samples instead
  18047. of seconds.
  18048. </p>
  18049. </dd>
  18050. <dt><samp class="option">duration</samp></dt>
  18051. <dd><p>The maximum duration of the output in seconds.
  18052. </p>
  18053. </dd>
  18054. <dt><samp class="option">start_sample</samp></dt>
  18055. <dd><p>The number of the first sample that should be output.
  18056. </p>
  18057. </dd>
  18058. <dt><samp class="option">end_sample</samp></dt>
  18059. <dd><p>The number of the first sample that should be dropped.
  18060. </p></dd>
  18061. </dl>
  18062. <p><samp class="option">start</samp>, <samp class="option">end</samp>, and <samp class="option">duration</samp> are expressed as time
  18063. duration specifications; see
  18064. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  18065. </p>
  18066. <p>Note that the first two sets of the start/end options and the <samp class="option">duration</samp>
  18067. option look at the frame timestamp, while the _sample options simply count the
  18068. samples that pass through the filter. So start/end_pts and start/end_sample will
  18069. give different results when the timestamps are wrong, inexact or do not start at
  18070. zero. Also note that this filter does not modify the timestamps. If you wish
  18071. to have the output timestamps start at zero, insert the asetpts filter after the
  18072. atrim filter.
  18073. </p>
  18074. <p>If multiple start or end options are set, this filter tries to be greedy and
  18075. keep all samples that match at least one of the specified constraints. To keep
  18076. only the part that matches all the constraints at once, chain multiple atrim
  18077. filters.
  18078. </p>
  18079. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  18080. just the end values to keep everything before the specified time.
  18081. </p>
  18082. <p>Examples:
  18083. </p><ul class="itemize mark-bullet">
  18084. <li>Drop everything except the second minute of input:
  18085. <div class="example">
  18086. <pre class="example-preformatted">ffmpeg -i INPUT -af atrim=60:120
  18087. </pre></div>
  18088. </li><li>Keep only the first 1000 samples:
  18089. <div class="example">
  18090. <pre class="example-preformatted">ffmpeg -i INPUT -af atrim=end_sample=1000
  18091. </pre></div>
  18092. </li></ul>
  18093. <a name="axcorrelate"></a>
  18094. <h3 class="section">29.68 axcorrelate<span class="pull-right"><a class="anchor hidden-xs" href="#axcorrelate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-axcorrelate" aria-hidden="true">TOC</a></span></h3>
  18095. <p>Calculate normalized windowed cross-correlation between two input audio streams.
  18096. </p>
  18097. <p>Resulted samples are always between -1 and 1 inclusive.
  18098. If result is 1 it means two input samples are highly correlated in that selected segment.
  18099. Result 0 means they are not correlated at all.
  18100. If result is -1 it means two input samples are out of phase, which means they cancel each
  18101. other.
  18102. </p>
  18103. <p>The filter accepts the following options:
  18104. </p>
  18105. <dl class="table">
  18106. <dt><samp class="option">size</samp></dt>
  18107. <dd><p>Set size of segment over which cross-correlation is calculated.
  18108. Default is 256. Allowed range is from 2 to 131072.
  18109. </p>
  18110. </dd>
  18111. <dt><samp class="option">algo</samp></dt>
  18112. <dd><p>Set algorithm for cross-correlation. Can be <code class="code">slow</code> or <code class="code">fast</code> or <code class="code">best</code>.
  18113. Default is <code class="code">best</code>. Fast algorithm assumes mean values over any given segment
  18114. are always zero and thus need much less calculations to make.
  18115. This is generally not true, but is valid for typical audio streams.
  18116. </p></dd>
  18117. </dl>
  18118. <a name="Examples-37"></a>
  18119. <h4 class="subsection">29.68.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-37" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-37" aria-hidden="true">TOC</a></span></h4>
  18120. <ul class="itemize mark-bullet">
  18121. <li>Calculate correlation between channels in stereo audio stream:
  18122. <div class="example">
  18123. <pre class="example-preformatted">ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
  18124. </pre></div>
  18125. </li></ul>
  18126. <a name="bandpass"></a>
  18127. <h3 class="section">29.69 bandpass<span class="pull-right"><a class="anchor hidden-xs" href="#bandpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bandpass" aria-hidden="true">TOC</a></span></h3>
  18128. <p>Apply a two-pole Butterworth band-pass filter with central
  18129. frequency <var class="var">frequency</var>, and (3dB-point) band-width width.
  18130. The <var class="var">csg</var> option selects a constant skirt gain (peak gain = Q)
  18131. instead of the default: constant 0dB peak gain.
  18132. The filter roll off at 6dB per octave (20dB per decade).
  18133. </p>
  18134. <p>The filter accepts the following options:
  18135. </p>
  18136. <dl class="table">
  18137. <dt><samp class="option">frequency, f</samp></dt>
  18138. <dd><p>Set the filter&rsquo;s central frequency. Default is <code class="code">3000</code>.
  18139. </p>
  18140. </dd>
  18141. <dt><samp class="option">csg</samp></dt>
  18142. <dd><p>Constant skirt gain if set to 1. Defaults to 0.
  18143. </p>
  18144. </dd>
  18145. <dt><samp class="option">width_type, t</samp></dt>
  18146. <dd><p>Set method to specify band-width of filter.
  18147. </p><dl class="table">
  18148. <dt><samp class="option">h</samp></dt>
  18149. <dd><p>Hz
  18150. </p></dd>
  18151. <dt><samp class="option">q</samp></dt>
  18152. <dd><p>Q-Factor
  18153. </p></dd>
  18154. <dt><samp class="option">o</samp></dt>
  18155. <dd><p>octave
  18156. </p></dd>
  18157. <dt><samp class="option">s</samp></dt>
  18158. <dd><p>slope
  18159. </p></dd>
  18160. <dt><samp class="option">k</samp></dt>
  18161. <dd><p>kHz
  18162. </p></dd>
  18163. </dl>
  18164. </dd>
  18165. <dt><samp class="option">width, w</samp></dt>
  18166. <dd><p>Specify the band-width of a filter in width_type units.
  18167. </p>
  18168. </dd>
  18169. <dt><samp class="option">mix, m</samp></dt>
  18170. <dd><p>How much to use filtered signal in output. Default is 1.
  18171. Range is between 0 and 1.
  18172. </p>
  18173. </dd>
  18174. <dt><samp class="option">channels, c</samp></dt>
  18175. <dd><p>Specify which channels to filter, by default all available are filtered.
  18176. </p>
  18177. </dd>
  18178. <dt><samp class="option">normalize, n</samp></dt>
  18179. <dd><p>Normalize biquad coefficients, by default is disabled.
  18180. Enabling it will normalize magnitude response at DC to 0dB.
  18181. </p>
  18182. </dd>
  18183. <dt><samp class="option">transform, a</samp></dt>
  18184. <dd><p>Set transform type of IIR filter.
  18185. </p><dl class="table">
  18186. <dt><samp class="option">di</samp></dt>
  18187. <dt><samp class="option">dii</samp></dt>
  18188. <dt><samp class="option">tdi</samp></dt>
  18189. <dt><samp class="option">tdii</samp></dt>
  18190. <dt><samp class="option">latt</samp></dt>
  18191. <dt><samp class="option">svf</samp></dt>
  18192. <dt><samp class="option">zdf</samp></dt>
  18193. </dl>
  18194. </dd>
  18195. <dt><samp class="option">precision, r</samp></dt>
  18196. <dd><p>Set precision of filtering.
  18197. </p><dl class="table">
  18198. <dt><samp class="option">auto</samp></dt>
  18199. <dd><p>Pick automatic sample format depending on surround filters.
  18200. </p></dd>
  18201. <dt><samp class="option">s16</samp></dt>
  18202. <dd><p>Always use signed 16-bit.
  18203. </p></dd>
  18204. <dt><samp class="option">s32</samp></dt>
  18205. <dd><p>Always use signed 32-bit.
  18206. </p></dd>
  18207. <dt><samp class="option">f32</samp></dt>
  18208. <dd><p>Always use float 32-bit.
  18209. </p></dd>
  18210. <dt><samp class="option">f64</samp></dt>
  18211. <dd><p>Always use float 64-bit.
  18212. </p></dd>
  18213. </dl>
  18214. </dd>
  18215. <dt><samp class="option">block_size, b</samp></dt>
  18216. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  18217. value (higher than impulse response length truncated when reaches near zero values) filtering
  18218. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  18219. </p>
  18220. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  18221. </p></dd>
  18222. </dl>
  18223. <a name="Commands-29"></a>
  18224. <h4 class="subsection">29.69.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-29" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-29" aria-hidden="true">TOC</a></span></h4>
  18225. <p>This filter supports the following commands:
  18226. </p><dl class="table">
  18227. <dt><samp class="option">frequency, f</samp></dt>
  18228. <dd><p>Change bandpass frequency.
  18229. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  18230. </p>
  18231. </dd>
  18232. <dt><samp class="option">width_type, t</samp></dt>
  18233. <dd><p>Change bandpass width_type.
  18234. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  18235. </p>
  18236. </dd>
  18237. <dt><samp class="option">width, w</samp></dt>
  18238. <dd><p>Change bandpass width.
  18239. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  18240. </p>
  18241. </dd>
  18242. <dt><samp class="option">mix, m</samp></dt>
  18243. <dd><p>Change bandpass mix.
  18244. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  18245. </p></dd>
  18246. </dl>
  18247. <a name="bandreject"></a>
  18248. <h3 class="section">29.70 bandreject<span class="pull-right"><a class="anchor hidden-xs" href="#bandreject" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bandreject" aria-hidden="true">TOC</a></span></h3>
  18249. <p>Apply a two-pole Butterworth band-reject filter with central
  18250. frequency <var class="var">frequency</var>, and (3dB-point) band-width <var class="var">width</var>.
  18251. The filter roll off at 6dB per octave (20dB per decade).
  18252. </p>
  18253. <p>The filter accepts the following options:
  18254. </p>
  18255. <dl class="table">
  18256. <dt><samp class="option">frequency, f</samp></dt>
  18257. <dd><p>Set the filter&rsquo;s central frequency. Default is <code class="code">3000</code>.
  18258. </p>
  18259. </dd>
  18260. <dt><samp class="option">width_type, t</samp></dt>
  18261. <dd><p>Set method to specify band-width of filter.
  18262. </p><dl class="table">
  18263. <dt><samp class="option">h</samp></dt>
  18264. <dd><p>Hz
  18265. </p></dd>
  18266. <dt><samp class="option">q</samp></dt>
  18267. <dd><p>Q-Factor
  18268. </p></dd>
  18269. <dt><samp class="option">o</samp></dt>
  18270. <dd><p>octave
  18271. </p></dd>
  18272. <dt><samp class="option">s</samp></dt>
  18273. <dd><p>slope
  18274. </p></dd>
  18275. <dt><samp class="option">k</samp></dt>
  18276. <dd><p>kHz
  18277. </p></dd>
  18278. </dl>
  18279. </dd>
  18280. <dt><samp class="option">width, w</samp></dt>
  18281. <dd><p>Specify the band-width of a filter in width_type units.
  18282. </p>
  18283. </dd>
  18284. <dt><samp class="option">mix, m</samp></dt>
  18285. <dd><p>How much to use filtered signal in output. Default is 1.
  18286. Range is between 0 and 1.
  18287. </p>
  18288. </dd>
  18289. <dt><samp class="option">channels, c</samp></dt>
  18290. <dd><p>Specify which channels to filter, by default all available are filtered.
  18291. </p>
  18292. </dd>
  18293. <dt><samp class="option">normalize, n</samp></dt>
  18294. <dd><p>Normalize biquad coefficients, by default is disabled.
  18295. Enabling it will normalize magnitude response at DC to 0dB.
  18296. </p>
  18297. </dd>
  18298. <dt><samp class="option">transform, a</samp></dt>
  18299. <dd><p>Set transform type of IIR filter.
  18300. </p><dl class="table">
  18301. <dt><samp class="option">di</samp></dt>
  18302. <dt><samp class="option">dii</samp></dt>
  18303. <dt><samp class="option">tdi</samp></dt>
  18304. <dt><samp class="option">tdii</samp></dt>
  18305. <dt><samp class="option">latt</samp></dt>
  18306. <dt><samp class="option">svf</samp></dt>
  18307. <dt><samp class="option">zdf</samp></dt>
  18308. </dl>
  18309. </dd>
  18310. <dt><samp class="option">precision, r</samp></dt>
  18311. <dd><p>Set precision of filtering.
  18312. </p><dl class="table">
  18313. <dt><samp class="option">auto</samp></dt>
  18314. <dd><p>Pick automatic sample format depending on surround filters.
  18315. </p></dd>
  18316. <dt><samp class="option">s16</samp></dt>
  18317. <dd><p>Always use signed 16-bit.
  18318. </p></dd>
  18319. <dt><samp class="option">s32</samp></dt>
  18320. <dd><p>Always use signed 32-bit.
  18321. </p></dd>
  18322. <dt><samp class="option">f32</samp></dt>
  18323. <dd><p>Always use float 32-bit.
  18324. </p></dd>
  18325. <dt><samp class="option">f64</samp></dt>
  18326. <dd><p>Always use float 64-bit.
  18327. </p></dd>
  18328. </dl>
  18329. </dd>
  18330. <dt><samp class="option">block_size, b</samp></dt>
  18331. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  18332. value (higher than impulse response length truncated when reaches near zero values) filtering
  18333. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  18334. </p>
  18335. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  18336. </p></dd>
  18337. </dl>
  18338. <a name="Commands-30"></a>
  18339. <h4 class="subsection">29.70.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-30" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-30" aria-hidden="true">TOC</a></span></h4>
  18340. <p>This filter supports the following commands:
  18341. </p><dl class="table">
  18342. <dt><samp class="option">frequency, f</samp></dt>
  18343. <dd><p>Change bandreject frequency.
  18344. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  18345. </p>
  18346. </dd>
  18347. <dt><samp class="option">width_type, t</samp></dt>
  18348. <dd><p>Change bandreject width_type.
  18349. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  18350. </p>
  18351. </dd>
  18352. <dt><samp class="option">width, w</samp></dt>
  18353. <dd><p>Change bandreject width.
  18354. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  18355. </p>
  18356. </dd>
  18357. <dt><samp class="option">mix, m</samp></dt>
  18358. <dd><p>Change bandreject mix.
  18359. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  18360. </p></dd>
  18361. </dl>
  18362. <a name="bass_002c-lowshelf"></a>
  18363. <h3 class="section">29.71 bass, lowshelf<span class="pull-right"><a class="anchor hidden-xs" href="#bass_002c-lowshelf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bass_002c-lowshelf" aria-hidden="true">TOC</a></span></h3>
  18364. <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
  18365. shelving filter with a response similar to that of a standard
  18366. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  18367. </p>
  18368. <p>The filter accepts the following options:
  18369. </p>
  18370. <dl class="table">
  18371. <dt><samp class="option">gain, g</samp></dt>
  18372. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  18373. (for a large cut) to +20 (for a large boost).
  18374. Beware of clipping when using a positive gain.
  18375. </p>
  18376. </dd>
  18377. <dt><samp class="option">frequency, f</samp></dt>
  18378. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  18379. to extend or reduce the frequency range to be boosted or cut.
  18380. The default value is <code class="code">100</code> Hz.
  18381. </p>
  18382. </dd>
  18383. <dt><samp class="option">width_type, t</samp></dt>
  18384. <dd><p>Set method to specify band-width of filter.
  18385. </p><dl class="table">
  18386. <dt><samp class="option">h</samp></dt>
  18387. <dd><p>Hz
  18388. </p></dd>
  18389. <dt><samp class="option">q</samp></dt>
  18390. <dd><p>Q-Factor
  18391. </p></dd>
  18392. <dt><samp class="option">o</samp></dt>
  18393. <dd><p>octave
  18394. </p></dd>
  18395. <dt><samp class="option">s</samp></dt>
  18396. <dd><p>slope
  18397. </p></dd>
  18398. <dt><samp class="option">k</samp></dt>
  18399. <dd><p>kHz
  18400. </p></dd>
  18401. </dl>
  18402. </dd>
  18403. <dt><samp class="option">width, w</samp></dt>
  18404. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  18405. </p>
  18406. </dd>
  18407. <dt><samp class="option">poles, p</samp></dt>
  18408. <dd><p>Set number of poles. Default is 2.
  18409. </p>
  18410. </dd>
  18411. <dt><samp class="option">mix, m</samp></dt>
  18412. <dd><p>How much to use filtered signal in output. Default is 1.
  18413. Range is between 0 and 1.
  18414. </p>
  18415. </dd>
  18416. <dt><samp class="option">channels, c</samp></dt>
  18417. <dd><p>Specify which channels to filter, by default all available are filtered.
  18418. </p>
  18419. </dd>
  18420. <dt><samp class="option">normalize, n</samp></dt>
  18421. <dd><p>Normalize biquad coefficients, by default is disabled.
  18422. Enabling it will normalize magnitude response at DC to 0dB.
  18423. </p>
  18424. </dd>
  18425. <dt><samp class="option">transform, a</samp></dt>
  18426. <dd><p>Set transform type of IIR filter.
  18427. </p><dl class="table">
  18428. <dt><samp class="option">di</samp></dt>
  18429. <dt><samp class="option">dii</samp></dt>
  18430. <dt><samp class="option">tdi</samp></dt>
  18431. <dt><samp class="option">tdii</samp></dt>
  18432. <dt><samp class="option">latt</samp></dt>
  18433. <dt><samp class="option">svf</samp></dt>
  18434. <dt><samp class="option">zdf</samp></dt>
  18435. </dl>
  18436. </dd>
  18437. <dt><samp class="option">precision, r</samp></dt>
  18438. <dd><p>Set precision of filtering.
  18439. </p><dl class="table">
  18440. <dt><samp class="option">auto</samp></dt>
  18441. <dd><p>Pick automatic sample format depending on surround filters.
  18442. </p></dd>
  18443. <dt><samp class="option">s16</samp></dt>
  18444. <dd><p>Always use signed 16-bit.
  18445. </p></dd>
  18446. <dt><samp class="option">s32</samp></dt>
  18447. <dd><p>Always use signed 32-bit.
  18448. </p></dd>
  18449. <dt><samp class="option">f32</samp></dt>
  18450. <dd><p>Always use float 32-bit.
  18451. </p></dd>
  18452. <dt><samp class="option">f64</samp></dt>
  18453. <dd><p>Always use float 64-bit.
  18454. </p></dd>
  18455. </dl>
  18456. </dd>
  18457. <dt><samp class="option">block_size, b</samp></dt>
  18458. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  18459. value (higher than impulse response length truncated when reaches near zero values) filtering
  18460. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  18461. </p>
  18462. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  18463. </p></dd>
  18464. </dl>
  18465. <a name="Commands-31"></a>
  18466. <h4 class="subsection">29.71.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-31" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-31" aria-hidden="true">TOC</a></span></h4>
  18467. <p>This filter supports the following commands:
  18468. </p><dl class="table">
  18469. <dt><samp class="option">frequency, f</samp></dt>
  18470. <dd><p>Change bass frequency.
  18471. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  18472. </p>
  18473. </dd>
  18474. <dt><samp class="option">width_type, t</samp></dt>
  18475. <dd><p>Change bass width_type.
  18476. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  18477. </p>
  18478. </dd>
  18479. <dt><samp class="option">width, w</samp></dt>
  18480. <dd><p>Change bass width.
  18481. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  18482. </p>
  18483. </dd>
  18484. <dt><samp class="option">gain, g</samp></dt>
  18485. <dd><p>Change bass gain.
  18486. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  18487. </p>
  18488. </dd>
  18489. <dt><samp class="option">mix, m</samp></dt>
  18490. <dd><p>Change bass mix.
  18491. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  18492. </p></dd>
  18493. </dl>
  18494. <a name="biquad"></a>
  18495. <h3 class="section">29.72 biquad<span class="pull-right"><a class="anchor hidden-xs" href="#biquad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-biquad" aria-hidden="true">TOC</a></span></h3>
  18496. <p>Apply a biquad IIR filter with the given coefficients.
  18497. Where <var class="var">b0</var>, <var class="var">b1</var>, <var class="var">b2</var> and <var class="var">a0</var>, <var class="var">a1</var>, <var class="var">a2</var>
  18498. are the numerator and denominator coefficients respectively.
  18499. and <var class="var">channels</var>, <var class="var">c</var> specify which channels to filter, by default all
  18500. available are filtered.
  18501. </p>
  18502. <a name="Commands-32"></a>
  18503. <h4 class="subsection">29.72.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-32" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-32" aria-hidden="true">TOC</a></span></h4>
  18504. <p>This filter supports the following commands:
  18505. </p><dl class="table">
  18506. <dt><samp class="option">a0</samp></dt>
  18507. <dt><samp class="option">a1</samp></dt>
  18508. <dt><samp class="option">a2</samp></dt>
  18509. <dt><samp class="option">b0</samp></dt>
  18510. <dt><samp class="option">b1</samp></dt>
  18511. <dt><samp class="option">b2</samp></dt>
  18512. <dd><p>Change biquad parameter.
  18513. Syntax for the command is : &quot;<var class="var">value</var>&quot;
  18514. </p>
  18515. </dd>
  18516. <dt><samp class="option">mix, m</samp></dt>
  18517. <dd><p>How much to use filtered signal in output. Default is 1.
  18518. Range is between 0 and 1.
  18519. </p>
  18520. </dd>
  18521. <dt><samp class="option">channels, c</samp></dt>
  18522. <dd><p>Specify which channels to filter, by default all available are filtered.
  18523. </p>
  18524. </dd>
  18525. <dt><samp class="option">normalize, n</samp></dt>
  18526. <dd><p>Normalize biquad coefficients, by default is disabled.
  18527. Enabling it will normalize magnitude response at DC to 0dB.
  18528. </p>
  18529. </dd>
  18530. <dt><samp class="option">transform, a</samp></dt>
  18531. <dd><p>Set transform type of IIR filter.
  18532. </p><dl class="table">
  18533. <dt><samp class="option">di</samp></dt>
  18534. <dt><samp class="option">dii</samp></dt>
  18535. <dt><samp class="option">tdi</samp></dt>
  18536. <dt><samp class="option">tdii</samp></dt>
  18537. <dt><samp class="option">latt</samp></dt>
  18538. <dt><samp class="option">svf</samp></dt>
  18539. <dt><samp class="option">zdf</samp></dt>
  18540. </dl>
  18541. </dd>
  18542. <dt><samp class="option">precision, r</samp></dt>
  18543. <dd><p>Set precision of filtering.
  18544. </p><dl class="table">
  18545. <dt><samp class="option">auto</samp></dt>
  18546. <dd><p>Pick automatic sample format depending on surround filters.
  18547. </p></dd>
  18548. <dt><samp class="option">s16</samp></dt>
  18549. <dd><p>Always use signed 16-bit.
  18550. </p></dd>
  18551. <dt><samp class="option">s32</samp></dt>
  18552. <dd><p>Always use signed 32-bit.
  18553. </p></dd>
  18554. <dt><samp class="option">f32</samp></dt>
  18555. <dd><p>Always use float 32-bit.
  18556. </p></dd>
  18557. <dt><samp class="option">f64</samp></dt>
  18558. <dd><p>Always use float 64-bit.
  18559. </p></dd>
  18560. </dl>
  18561. </dd>
  18562. <dt><samp class="option">block_size, b</samp></dt>
  18563. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  18564. value (higher than impulse response length truncated when reaches near zero values) filtering
  18565. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  18566. </p>
  18567. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  18568. </p></dd>
  18569. </dl>
  18570. <a name="bs2b"></a>
  18571. <h3 class="section">29.73 bs2b<span class="pull-right"><a class="anchor hidden-xs" href="#bs2b" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bs2b" aria-hidden="true">TOC</a></span></h3>
  18572. <p>Bauer stereo to binaural transformation, which improves headphone listening of
  18573. stereo audio records.
  18574. </p>
  18575. <p>To enable compilation of this filter you need to configure FFmpeg with
  18576. <code class="code">--enable-libbs2b</code>.
  18577. </p>
  18578. <p>It accepts the following parameters:
  18579. </p><dl class="table">
  18580. <dt><samp class="option">profile</samp></dt>
  18581. <dd><p>Pre-defined crossfeed level.
  18582. </p><dl class="table">
  18583. <dt><samp class="option">default</samp></dt>
  18584. <dd><p>Default level (fcut=700, feed=50).
  18585. </p>
  18586. </dd>
  18587. <dt><samp class="option">cmoy</samp></dt>
  18588. <dd><p>Chu Moy circuit (fcut=700, feed=60).
  18589. </p>
  18590. </dd>
  18591. <dt><samp class="option">jmeier</samp></dt>
  18592. <dd><p>Jan Meier circuit (fcut=650, feed=95).
  18593. </p>
  18594. </dd>
  18595. </dl>
  18596. </dd>
  18597. <dt><samp class="option">fcut</samp></dt>
  18598. <dd><p>Cut frequency (in Hz).
  18599. </p>
  18600. </dd>
  18601. <dt><samp class="option">feed</samp></dt>
  18602. <dd><p>Feed level (in Hz).
  18603. </p>
  18604. </dd>
  18605. </dl>
  18606. <a name="channelmap"></a>
  18607. <h3 class="section">29.74 channelmap<span class="pull-right"><a class="anchor hidden-xs" href="#channelmap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-channelmap" aria-hidden="true">TOC</a></span></h3>
  18608. <p>Remap input channels to new locations.
  18609. </p>
  18610. <p>It accepts the following parameters:
  18611. </p><dl class="table">
  18612. <dt><samp class="option">map</samp></dt>
  18613. <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-separated list of
  18614. mappings, each in the <code class="code"><var class="var">in_channel</var>-<var class="var">out_channel</var></code> or
  18615. <code class="code"><var class="var">in_channel</var></code> form. <var class="var">in_channel</var> can be either the name of the
  18616. input channel (e.g. FL for front left) or its index in the input channel
  18617. layout. <var class="var">out_channel</var> is the name of the output channel or its index in the
  18618. output channel layout. If <var class="var">out_channel</var> is not given then it is implicitly
  18619. an index, starting with zero and increasing by one for each mapping. Mixing
  18620. different types of mappings is not allowed and will result in a parse error.
  18621. </p>
  18622. </dd>
  18623. <dt><samp class="option">channel_layout</samp></dt>
  18624. <dd><p>The channel layout of the output stream. If not specified, then filter will
  18625. guess it based on the <var class="var">out_channel</var> names or the number of mappings.
  18626. Guessed layouts will not necessarily contain channels in the order of the
  18627. mappings.
  18628. </p></dd>
  18629. </dl>
  18630. <p>If no mapping is present, the filter will implicitly map input channels to
  18631. output channels, preserving indices.
  18632. </p>
  18633. <a name="Examples-38"></a>
  18634. <h4 class="subsection">29.74.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-38" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-38" aria-hidden="true">TOC</a></span></h4>
  18635. <ul class="itemize mark-bullet">
  18636. <li>For example, assuming a 5.1+downmix input MOV file,
  18637. <div class="example">
  18638. <pre class="example-preformatted">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
  18639. </pre></div>
  18640. <p>will create an output WAV file tagged as stereo from the downmix channels of
  18641. the input.
  18642. </p>
  18643. </li><li>To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
  18644. <div class="example">
  18645. <pre class="example-preformatted">ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
  18646. </pre></div>
  18647. </li></ul>
  18648. <a name="channelsplit"></a>
  18649. <h3 class="section">29.75 channelsplit<span class="pull-right"><a class="anchor hidden-xs" href="#channelsplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-channelsplit" aria-hidden="true">TOC</a></span></h3>
  18650. <p>Split each channel from an input audio stream into a separate output stream.
  18651. </p>
  18652. <p>It accepts the following parameters:
  18653. </p><dl class="table">
  18654. <dt><samp class="option">channel_layout</samp></dt>
  18655. <dd><p>The channel layout of the input stream. The default is &quot;stereo&quot;.
  18656. </p></dd>
  18657. <dt><samp class="option">channels</samp></dt>
  18658. <dd><p>A channel layout describing the channels to be extracted as separate output streams
  18659. or &quot;all&quot; to extract each input channel as a separate stream. The default is &quot;all&quot;.
  18660. </p>
  18661. <p>Choosing channels not present in channel layout in the input will result in an error.
  18662. </p></dd>
  18663. </dl>
  18664. <a name="Examples-39"></a>
  18665. <h4 class="subsection">29.75.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-39" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-39" aria-hidden="true">TOC</a></span></h4>
  18666. <ul class="itemize mark-bullet">
  18667. <li>For example, assuming a stereo input MP3 file,
  18668. <div class="example">
  18669. <pre class="example-preformatted">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
  18670. </pre></div>
  18671. <p>will create an output Matroska file with two audio streams, one containing only
  18672. the left channel and the other the right channel.
  18673. </p>
  18674. </li><li>Split a 5.1 WAV file into per-channel files:
  18675. <div class="example">
  18676. <pre class="example-preformatted">ffmpeg -i in.wav -filter_complex
  18677. 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
  18678. -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
  18679. front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
  18680. side_right.wav
  18681. </pre></div>
  18682. </li><li>Extract only LFE from a 5.1 WAV file:
  18683. <div class="example">
  18684. <pre class="example-preformatted">ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
  18685. -map '[LFE]' lfe.wav
  18686. </pre></div>
  18687. </li></ul>
  18688. <a name="chorus"></a>
  18689. <h3 class="section">29.76 chorus<span class="pull-right"><a class="anchor hidden-xs" href="#chorus" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chorus" aria-hidden="true">TOC</a></span></h3>
  18690. <p>Add a chorus effect to the audio.
  18691. </p>
  18692. <p>Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
  18693. </p>
  18694. <p>Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
  18695. constant, with chorus, it is varied using sinusoidal or triangular modulation.
  18696. The modulation depth defines the range the modulated delay is played before or after
  18697. the delay. Hence the delayed sound will sound slower or faster, that is the delayed
  18698. sound tuned around the original one, like in a chorus where some vocals are slightly
  18699. off key.
  18700. </p>
  18701. <p>It accepts the following parameters:
  18702. </p><dl class="table">
  18703. <dt><samp class="option">in_gain</samp></dt>
  18704. <dd><p>Set input gain. Default is 0.4.
  18705. </p>
  18706. </dd>
  18707. <dt><samp class="option">out_gain</samp></dt>
  18708. <dd><p>Set output gain. Default is 0.4.
  18709. </p>
  18710. </dd>
  18711. <dt><samp class="option">delays</samp></dt>
  18712. <dd><p>Set delays. A typical delay is around 40ms to 60ms.
  18713. </p>
  18714. </dd>
  18715. <dt><samp class="option">decays</samp></dt>
  18716. <dd><p>Set decays.
  18717. </p>
  18718. </dd>
  18719. <dt><samp class="option">speeds</samp></dt>
  18720. <dd><p>Set speeds.
  18721. </p>
  18722. </dd>
  18723. <dt><samp class="option">depths</samp></dt>
  18724. <dd><p>Set depths.
  18725. </p></dd>
  18726. </dl>
  18727. <a name="Examples-40"></a>
  18728. <h4 class="subsection">29.76.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-40" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-40" aria-hidden="true">TOC</a></span></h4>
  18729. <ul class="itemize mark-bullet">
  18730. <li>A single delay:
  18731. <div class="example">
  18732. <pre class="example-preformatted">chorus=0.7:0.9:55:0.4:0.25:2
  18733. </pre></div>
  18734. </li><li>Two delays:
  18735. <div class="example">
  18736. <pre class="example-preformatted">chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
  18737. </pre></div>
  18738. </li><li>Fuller sounding chorus with three delays:
  18739. <div class="example">
  18740. <pre class="example-preformatted">chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3
  18741. </pre></div>
  18742. </li></ul>
  18743. <a name="compand"></a>
  18744. <h3 class="section">29.77 compand<span class="pull-right"><a class="anchor hidden-xs" href="#compand" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-compand" aria-hidden="true">TOC</a></span></h3>
  18745. <p>Compress or expand the audio&rsquo;s dynamic range.
  18746. </p>
  18747. <p>It accepts the following parameters:
  18748. </p>
  18749. <dl class="table">
  18750. <dt><samp class="option">attacks</samp></dt>
  18751. <dt><samp class="option">decays</samp></dt>
  18752. <dd><p>A list of times in seconds for each channel over which the instantaneous level
  18753. of the input signal is averaged to determine its volume. <var class="var">attacks</var> refers to
  18754. increase of volume and <var class="var">decays</var> refers to decrease of volume. For most
  18755. situations, the attack time (response to the audio getting louder) should be
  18756. shorter than the decay time, because the human ear is more sensitive to sudden
  18757. loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
  18758. a typical value for decay is 0.8 seconds.
  18759. If specified number of attacks &amp; decays is lower than number of channels, the last
  18760. set attack/decay will be used for all remaining channels.
  18761. </p>
  18762. </dd>
  18763. <dt><samp class="option">points</samp></dt>
  18764. <dd><p>A list of points for the transfer function, specified in dB relative to the
  18765. maximum possible signal amplitude. Each key points list must be defined using
  18766. the following syntax: <code class="code">x0/y0|x1/y1|x2/y2|....</code> or
  18767. <code class="code">x0/y0 x1/y1 x2/y2 ....</code>
  18768. </p>
  18769. <p>The input values must be in strictly increasing order but the transfer function
  18770. does not have to be monotonically rising. The point <code class="code">0/0</code> is assumed but
  18771. may be overridden (by <code class="code">0/out-dBn</code>). Typical values for the transfer
  18772. function are <code class="code">-70/-70|-60/-20|1/0</code>.
  18773. </p>
  18774. </dd>
  18775. <dt><samp class="option">soft-knee</samp></dt>
  18776. <dd><p>Set the curve radius in dB for all joints. It defaults to 0.01.
  18777. </p>
  18778. </dd>
  18779. <dt><samp class="option">gain</samp></dt>
  18780. <dd><p>Set the additional gain in dB to be applied at all points on the transfer
  18781. function. This allows for easy adjustment of the overall gain.
  18782. It defaults to 0.
  18783. </p>
  18784. </dd>
  18785. <dt><samp class="option">volume</samp></dt>
  18786. <dd><p>Set an initial volume, in dB, to be assumed for each channel when filtering
  18787. starts. This permits the user to supply a nominal level initially, so that, for
  18788. example, a very large gain is not applied to initial signal levels before the
  18789. companding has begun to operate. A typical value for audio which is initially
  18790. quiet is -90 dB. It defaults to 0.
  18791. </p>
  18792. </dd>
  18793. <dt><samp class="option">delay</samp></dt>
  18794. <dd><p>Set a delay, in seconds. The input audio is analyzed immediately, but audio is
  18795. delayed before being fed to the volume adjuster. Specifying a delay
  18796. approximately equal to the attack/decay times allows the filter to effectively
  18797. operate in predictive rather than reactive mode. It defaults to 0.
  18798. </p>
  18799. </dd>
  18800. </dl>
  18801. <a name="Examples-41"></a>
  18802. <h4 class="subsection">29.77.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-41" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-41" aria-hidden="true">TOC</a></span></h4>
  18803. <ul class="itemize mark-bullet">
  18804. <li>Make music with both quiet and loud passages suitable for listening to in a
  18805. noisy environment:
  18806. <div class="example">
  18807. <pre class="example-preformatted">compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
  18808. </pre></div>
  18809. <p>Another example for audio with whisper and explosion parts:
  18810. </p><div class="example">
  18811. <pre class="example-preformatted">compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
  18812. </pre></div>
  18813. </li><li>A noise gate for when the noise is at a lower level than the signal:
  18814. <div class="example">
  18815. <pre class="example-preformatted">compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
  18816. </pre></div>
  18817. </li><li>Here is another noise gate, this time for when the noise is at a higher level
  18818. than the signal (making it, in some ways, similar to squelch):
  18819. <div class="example">
  18820. <pre class="example-preformatted">compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
  18821. </pre></div>
  18822. </li><li>2:1 compression starting at -6dB:
  18823. <div class="example">
  18824. <pre class="example-preformatted">compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
  18825. </pre></div>
  18826. </li><li>2:1 compression starting at -9dB:
  18827. <div class="example">
  18828. <pre class="example-preformatted">compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
  18829. </pre></div>
  18830. </li><li>2:1 compression starting at -12dB:
  18831. <div class="example">
  18832. <pre class="example-preformatted">compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
  18833. </pre></div>
  18834. </li><li>2:1 compression starting at -18dB:
  18835. <div class="example">
  18836. <pre class="example-preformatted">compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
  18837. </pre></div>
  18838. </li><li>3:1 compression starting at -15dB:
  18839. <div class="example">
  18840. <pre class="example-preformatted">compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
  18841. </pre></div>
  18842. </li><li>Compressor/Gate:
  18843. <div class="example">
  18844. <pre class="example-preformatted">compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
  18845. </pre></div>
  18846. </li><li>Expander:
  18847. <div class="example">
  18848. <pre class="example-preformatted">compand=attacks=0:points=-80/-169|-54/-80|-49.5/-64.6|-41.1/-41.1|-25.8/-15|-10.8/-4.5|0/0|20/8.3
  18849. </pre></div>
  18850. </li><li>Hard limiter at -6dB:
  18851. <div class="example">
  18852. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-6/-6|20/-6
  18853. </pre></div>
  18854. </li><li>Hard limiter at -12dB:
  18855. <div class="example">
  18856. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-12/-12|20/-12
  18857. </pre></div>
  18858. </li><li>Hard noise gate at -35 dB:
  18859. <div class="example">
  18860. <pre class="example-preformatted">compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
  18861. </pre></div>
  18862. </li><li>Soft limiter:
  18863. <div class="example">
  18864. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
  18865. </pre></div>
  18866. </li></ul>
  18867. <a name="compensationdelay"></a>
  18868. <h3 class="section">29.78 compensationdelay<span class="pull-right"><a class="anchor hidden-xs" href="#compensationdelay" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-compensationdelay" aria-hidden="true">TOC</a></span></h3>
  18869. <p>Compensation Delay Line is a metric based delay to compensate differing
  18870. positions of microphones or speakers.
  18871. </p>
  18872. <p>For example, you have recorded guitar with two microphones placed in
  18873. different locations. Because the front of sound wave has fixed speed in
  18874. normal conditions, the phasing of microphones can vary and depends on
  18875. their location and interposition. The best sound mix can be achieved when
  18876. these microphones are in phase (synchronized). Note that a distance of
  18877. ~30 cm between microphones makes one microphone capture the signal in
  18878. antiphase to the other microphone. That makes the final mix sound moody.
  18879. This filter helps to solve phasing problems by adding different delays
  18880. to each microphone track and make them synchronized.
  18881. </p>
  18882. <p>The best result can be reached when you take one track as base and
  18883. synchronize other tracks one by one with it.
  18884. Remember that synchronization/delay tolerance depends on sample rate, too.
  18885. Higher sample rates will give more tolerance.
  18886. </p>
  18887. <p>The filter accepts the following parameters:
  18888. </p>
  18889. <dl class="table">
  18890. <dt><samp class="option">mm</samp></dt>
  18891. <dd><p>Set millimeters distance. This is compensation distance for fine tuning.
  18892. Default is 0.
  18893. </p>
  18894. </dd>
  18895. <dt><samp class="option">cm</samp></dt>
  18896. <dd><p>Set cm distance. This is compensation distance for tightening distance setup.
  18897. Default is 0.
  18898. </p>
  18899. </dd>
  18900. <dt><samp class="option">m</samp></dt>
  18901. <dd><p>Set meters distance. This is compensation distance for hard distance setup.
  18902. Default is 0.
  18903. </p>
  18904. </dd>
  18905. <dt><samp class="option">dry</samp></dt>
  18906. <dd><p>Set dry amount. Amount of unprocessed (dry) signal.
  18907. Default is 0.
  18908. </p>
  18909. </dd>
  18910. <dt><samp class="option">wet</samp></dt>
  18911. <dd><p>Set wet amount. Amount of processed (wet) signal.
  18912. Default is 1.
  18913. </p>
  18914. </dd>
  18915. <dt><samp class="option">temp</samp></dt>
  18916. <dd><p>Set temperature in degrees Celsius. This is the temperature of the environment.
  18917. Default is 20.
  18918. </p></dd>
  18919. </dl>
  18920. <a name="Commands-33"></a>
  18921. <h4 class="subsection">29.78.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-33" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-33" aria-hidden="true">TOC</a></span></h4>
  18922. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  18923. </p>
  18924. <a name="crossfeed"></a>
  18925. <h3 class="section">29.79 crossfeed<span class="pull-right"><a class="anchor hidden-xs" href="#crossfeed" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crossfeed" aria-hidden="true">TOC</a></span></h3>
  18926. <p>Apply headphone crossfeed filter.
  18927. </p>
  18928. <p>Crossfeed is the process of blending the left and right channels of stereo
  18929. audio recording.
  18930. It is mainly used to reduce extreme stereo separation of low frequencies.
  18931. </p>
  18932. <p>The intent is to produce more speaker like sound to the listener.
  18933. </p>
  18934. <p>The filter accepts the following options:
  18935. </p>
  18936. <dl class="table">
  18937. <dt><samp class="option">strength</samp></dt>
  18938. <dd><p>Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1.
  18939. This sets gain of low shelf filter for side part of stereo image.
  18940. Default is -6dB. Max allowed is -30db when strength is set to 1.
  18941. </p>
  18942. </dd>
  18943. <dt><samp class="option">range</samp></dt>
  18944. <dd><p>Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1.
  18945. This sets cut off frequency of low shelf filter. Default is cut off near
  18946. 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz.
  18947. </p>
  18948. </dd>
  18949. <dt><samp class="option">slope</samp></dt>
  18950. <dd><p>Set curve slope of low shelf filter. Default is 0.5.
  18951. Allowed range is from 0.01 to 1.
  18952. </p>
  18953. </dd>
  18954. <dt><samp class="option">level_in</samp></dt>
  18955. <dd><p>Set input gain. Default is 0.9.
  18956. </p>
  18957. </dd>
  18958. <dt><samp class="option">level_out</samp></dt>
  18959. <dd><p>Set output gain. Default is 1.
  18960. </p>
  18961. </dd>
  18962. <dt><samp class="option">block_size</samp></dt>
  18963. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  18964. value (higher than impulse response length truncated when reaches near zero values) filtering
  18965. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  18966. </p>
  18967. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  18968. </p></dd>
  18969. </dl>
  18970. <a name="Commands-34"></a>
  18971. <h4 class="subsection">29.79.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-34" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-34" aria-hidden="true">TOC</a></span></h4>
  18972. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  18973. </p>
  18974. <a name="crystalizer"></a>
  18975. <h3 class="section">29.80 crystalizer<span class="pull-right"><a class="anchor hidden-xs" href="#crystalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crystalizer" aria-hidden="true">TOC</a></span></h3>
  18976. <p>Simple algorithm for audio noise sharpening.
  18977. </p>
  18978. <p>This filter linearly increases differences between each audio sample.
  18979. </p>
  18980. <p>The filter accepts the following options:
  18981. </p>
  18982. <dl class="table">
  18983. <dt><samp class="option">i</samp></dt>
  18984. <dd><p>Sets the intensity of effect (default: 2.0). Must be in range between -10.0 to 0
  18985. (unchanged sound) to 10.0 (maximum effect).
  18986. To inverse filtering use negative value.
  18987. </p>
  18988. </dd>
  18989. <dt><samp class="option">c</samp></dt>
  18990. <dd><p>Enable clipping. By default is enabled.
  18991. </p></dd>
  18992. </dl>
  18993. <a name="Commands-35"></a>
  18994. <h4 class="subsection">29.80.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-35" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-35" aria-hidden="true">TOC</a></span></h4>
  18995. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  18996. </p>
  18997. <a name="dcshift"></a>
  18998. <h3 class="section">29.81 dcshift<span class="pull-right"><a class="anchor hidden-xs" href="#dcshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dcshift" aria-hidden="true">TOC</a></span></h3>
  18999. <p>Apply a DC shift to the audio.
  19000. </p>
  19001. <p>This can be useful to remove a DC offset (caused perhaps by a hardware problem
  19002. in the recording chain) from the audio. The effect of a DC offset is reduced
  19003. headroom and hence volume. The <a class="ref" href="#astats">astats</a> filter can be used to determine if
  19004. a signal has a DC offset.
  19005. </p>
  19006. <dl class="table">
  19007. <dt><samp class="option">shift</samp></dt>
  19008. <dd><p>Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
  19009. the audio.
  19010. </p>
  19011. </dd>
  19012. <dt><samp class="option">limitergain</samp></dt>
  19013. <dd><p>Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
  19014. used to prevent clipping.
  19015. </p></dd>
  19016. </dl>
  19017. <a name="deesser"></a>
  19018. <h3 class="section">29.82 deesser<span class="pull-right"><a class="anchor hidden-xs" href="#deesser" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deesser" aria-hidden="true">TOC</a></span></h3>
  19019. <p>Apply de-essing to the audio samples.
  19020. </p>
  19021. <dl class="table">
  19022. <dt><samp class="option">i</samp></dt>
  19023. <dd><p>Set intensity for triggering de-essing. Allowed range is from 0 to 1.
  19024. Default is 0.
  19025. </p>
  19026. </dd>
  19027. <dt><samp class="option">m</samp></dt>
  19028. <dd><p>Set amount of ducking on treble part of sound. Allowed range is from 0 to 1.
  19029. Default is 0.5.
  19030. </p>
  19031. </dd>
  19032. <dt><samp class="option">f</samp></dt>
  19033. <dd><p>How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1.
  19034. Default is 0.5.
  19035. </p>
  19036. </dd>
  19037. <dt><samp class="option">s</samp></dt>
  19038. <dd><p>Set the output mode.
  19039. </p>
  19040. <p>It accepts the following values:
  19041. </p><dl class="table">
  19042. <dt><samp class="option">i</samp></dt>
  19043. <dd><p>Pass input unchanged.
  19044. </p>
  19045. </dd>
  19046. <dt><samp class="option">o</samp></dt>
  19047. <dd><p>Pass ess filtered out.
  19048. </p>
  19049. </dd>
  19050. <dt><samp class="option">e</samp></dt>
  19051. <dd><p>Pass only ess.
  19052. </p>
  19053. <p>Default value is <var class="var">o</var>.
  19054. </p></dd>
  19055. </dl>
  19056. </dd>
  19057. </dl>
  19058. <a name="dialoguenhance"></a>
  19059. <h3 class="section">29.83 dialoguenhance<span class="pull-right"><a class="anchor hidden-xs" href="#dialoguenhance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dialoguenhance" aria-hidden="true">TOC</a></span></h3>
  19060. <p>Enhance dialogue in stereo audio.
  19061. </p>
  19062. <p>This filter accepts stereo input and produce surround (3.0) channels output.
  19063. The newly produced front center channel have enhanced speech dialogue originally
  19064. available in both stereo channels.
  19065. This filter outputs front left and front right channels same as available in stereo input.
  19066. </p>
  19067. <p>The filter accepts the following options:
  19068. </p>
  19069. <dl class="table">
  19070. <dt><samp class="option">original</samp></dt>
  19071. <dd><p>Set the original center factor to keep in front center channel output.
  19072. Allowed range is from 0 to 1. Default value is 1.
  19073. </p>
  19074. </dd>
  19075. <dt><samp class="option">enhance</samp></dt>
  19076. <dd><p>Set the dialogue enhance factor to put in front center channel output.
  19077. Allowed range is from 0 to 3. Default value is 1.
  19078. </p>
  19079. </dd>
  19080. <dt><samp class="option">voice</samp></dt>
  19081. <dd><p>Set the voice detection factor.
  19082. Allowed range is from 2 to 32. Default value is 2.
  19083. </p></dd>
  19084. </dl>
  19085. <a name="Commands-36"></a>
  19086. <h4 class="subsection">29.83.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-36" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-36" aria-hidden="true">TOC</a></span></h4>
  19087. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  19088. </p>
  19089. <a name="drmeter"></a>
  19090. <h3 class="section">29.84 drmeter<span class="pull-right"><a class="anchor hidden-xs" href="#drmeter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drmeter" aria-hidden="true">TOC</a></span></h3>
  19091. <p>Measure audio dynamic range.
  19092. </p>
  19093. <p>DR values of 14 and higher is found in very dynamic material. DR of 8 to 13
  19094. is found in transition material. And anything less that 8 have very poor dynamics
  19095. and is very compressed.
  19096. </p>
  19097. <p>The filter accepts the following options:
  19098. </p>
  19099. <dl class="table">
  19100. <dt><samp class="option">length</samp></dt>
  19101. <dd><p>Set window length in seconds used to split audio into segments of equal length.
  19102. Default is 3 seconds.
  19103. </p></dd>
  19104. </dl>
  19105. <a name="dynaudnorm"></a>
  19106. <h3 class="section">29.85 dynaudnorm<span class="pull-right"><a class="anchor hidden-xs" href="#dynaudnorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dynaudnorm" aria-hidden="true">TOC</a></span></h3>
  19107. <p>Dynamic Audio Normalizer.
  19108. </p>
  19109. <p>This filter applies a certain amount of gain to the input audio in order
  19110. to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
  19111. contrast to more &quot;simple&quot; normalization algorithms, the Dynamic Audio
  19112. Normalizer *dynamically* re-adjusts the gain factor to the input audio.
  19113. This allows for applying extra gain to the &quot;quiet&quot; sections of the audio
  19114. while avoiding distortions or clipping the &quot;loud&quot; sections. In other words:
  19115. The Dynamic Audio Normalizer will &quot;even out&quot; the volume of quiet and loud
  19116. sections, in the sense that the volume of each section is brought to the
  19117. same target level. Note, however, that the Dynamic Audio Normalizer achieves
  19118. this goal *without* applying &quot;dynamic range compressing&quot;. It will retain 100%
  19119. of the dynamic range *within* each section of the audio file.
  19120. </p>
  19121. <dl class="table">
  19122. <dt><samp class="option">framelen, f</samp></dt>
  19123. <dd><p>Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
  19124. Default is 500 milliseconds.
  19125. The Dynamic Audio Normalizer processes the input audio in small chunks,
  19126. referred to as frames. This is required, because a peak magnitude has no
  19127. meaning for just a single sample value. Instead, we need to determine the
  19128. peak magnitude for a contiguous sequence of sample values. While a &quot;standard&quot;
  19129. normalizer would simply use the peak magnitude of the complete file, the
  19130. Dynamic Audio Normalizer determines the peak magnitude individually for each
  19131. frame. The length of a frame is specified in milliseconds. By default, the
  19132. Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
  19133. been found to give good results with most files.
  19134. Note that the exact frame length, in number of samples, will be determined
  19135. automatically, based on the sampling rate of the individual input audio file.
  19136. </p>
  19137. </dd>
  19138. <dt><samp class="option">gausssize, g</samp></dt>
  19139. <dd><p>Set the Gaussian filter window size. In range from 3 to 301, must be odd
  19140. number. Default is 31.
  19141. Probably the most important parameter of the Dynamic Audio Normalizer is the
  19142. <code class="code">window size</code> of the Gaussian smoothing filter. The filter&rsquo;s window size
  19143. is specified in frames, centered around the current frame. For the sake of
  19144. simplicity, this must be an odd number. Consequently, the default value of 31
  19145. takes into account the current frame, as well as the 15 preceding frames and
  19146. the 15 subsequent frames. Using a larger window results in a stronger
  19147. smoothing effect and thus in less gain variation, i.e. slower gain
  19148. adaptation. Conversely, using a smaller window results in a weaker smoothing
  19149. effect and thus in more gain variation, i.e. faster gain adaptation.
  19150. In other words, the more you increase this value, the more the Dynamic Audio
  19151. Normalizer will behave like a &quot;traditional&quot; normalization filter. On the
  19152. contrary, the more you decrease this value, the more the Dynamic Audio
  19153. Normalizer will behave like a dynamic range compressor.
  19154. </p>
  19155. </dd>
  19156. <dt><samp class="option">peak, p</samp></dt>
  19157. <dd><p>Set the target peak value. This specifies the highest permissible magnitude
  19158. level for the normalized audio input. This filter will try to approach the
  19159. target peak magnitude as closely as possible, but at the same time it also
  19160. makes sure that the normalized signal will never exceed the peak magnitude.
  19161. A frame&rsquo;s maximum local gain factor is imposed directly by the target peak
  19162. magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
  19163. It is not recommended to go above this value.
  19164. </p>
  19165. </dd>
  19166. <dt><samp class="option">maxgain, m</samp></dt>
  19167. <dd><p>Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
  19168. The Dynamic Audio Normalizer determines the maximum possible (local) gain
  19169. factor for each input frame, i.e. the maximum gain factor that does not
  19170. result in clipping or distortion. The maximum gain factor is determined by
  19171. the frame&rsquo;s highest magnitude sample. However, the Dynamic Audio Normalizer
  19172. additionally bounds the frame&rsquo;s maximum gain factor by a predetermined
  19173. (global) maximum gain factor. This is done in order to avoid excessive gain
  19174. factors in &quot;silent&quot; or almost silent frames. By default, the maximum gain
  19175. factor is 10.0, For most inputs the default value should be sufficient and
  19176. it usually is not recommended to increase this value. Though, for input
  19177. with an extremely low overall volume level, it may be necessary to allow even
  19178. higher gain factors. Note, however, that the Dynamic Audio Normalizer does
  19179. not simply apply a &quot;hard&quot; threshold (i.e. cut off values above the threshold).
  19180. Instead, a &quot;sigmoid&quot; threshold function will be applied. This way, the
  19181. gain factors will smoothly approach the threshold value, but never exceed that
  19182. value.
  19183. </p>
  19184. </dd>
  19185. <dt><samp class="option">targetrms, r</samp></dt>
  19186. <dd><p>Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
  19187. By default, the Dynamic Audio Normalizer performs &quot;peak&quot; normalization.
  19188. This means that the maximum local gain factor for each frame is defined
  19189. (only) by the frame&rsquo;s highest magnitude sample. This way, the samples can
  19190. be amplified as much as possible without exceeding the maximum signal
  19191. level, i.e. without clipping. Optionally, however, the Dynamic Audio
  19192. Normalizer can also take into account the frame&rsquo;s root mean square,
  19193. abbreviated RMS. In electrical engineering, the RMS is commonly used to
  19194. determine the power of a time-varying signal. It is therefore considered
  19195. that the RMS is a better approximation of the &quot;perceived loudness&quot; than
  19196. just looking at the signal&rsquo;s peak magnitude. Consequently, by adjusting all
  19197. frames to a constant RMS value, a uniform &quot;perceived loudness&quot; can be
  19198. established. If a target RMS value has been specified, a frame&rsquo;s local gain
  19199. factor is defined as the factor that would result in exactly that RMS value.
  19200. Note, however, that the maximum local gain factor is still restricted by the
  19201. frame&rsquo;s highest magnitude sample, in order to prevent clipping.
  19202. </p>
  19203. </dd>
  19204. <dt><samp class="option">coupling, n</samp></dt>
  19205. <dd><p>Enable channels coupling. By default is enabled.
  19206. By default, the Dynamic Audio Normalizer will amplify all channels by the same
  19207. amount. This means the same gain factor will be applied to all channels, i.e.
  19208. the maximum possible gain factor is determined by the &quot;loudest&quot; channel.
  19209. However, in some recordings, it may happen that the volume of the different
  19210. channels is uneven, e.g. one channel may be &quot;quieter&quot; than the other one(s).
  19211. In this case, this option can be used to disable the channel coupling. This way,
  19212. the gain factor will be determined independently for each channel, depending
  19213. only on the individual channel&rsquo;s highest magnitude sample. This allows for
  19214. harmonizing the volume of the different channels.
  19215. </p>
  19216. </dd>
  19217. <dt><samp class="option">correctdc, c</samp></dt>
  19218. <dd><p>Enable DC bias correction. By default is disabled.
  19219. An audio signal (in the time domain) is a sequence of sample values.
  19220. In the Dynamic Audio Normalizer these sample values are represented in the
  19221. -1.0 to 1.0 range, regardless of the original input format. Normally, the
  19222. audio signal, or &quot;waveform&quot;, should be centered around the zero point.
  19223. That means if we calculate the mean value of all samples in a file, or in a
  19224. single frame, then the result should be 0.0 or at least very close to that
  19225. value. If, however, there is a significant deviation of the mean value from
  19226. 0.0, in either positive or negative direction, this is referred to as a
  19227. DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
  19228. Audio Normalizer provides optional DC bias correction.
  19229. With DC bias correction enabled, the Dynamic Audio Normalizer will determine
  19230. the mean value, or &quot;DC correction&quot; offset, of each input frame and subtract
  19231. that value from all of the frame&rsquo;s sample values which ensures those samples
  19232. are centered around 0.0 again. Also, in order to avoid &quot;gaps&quot; at the frame
  19233. boundaries, the DC correction offset values will be interpolated smoothly
  19234. between neighbouring frames.
  19235. </p>
  19236. </dd>
  19237. <dt><samp class="option">altboundary, b</samp></dt>
  19238. <dd><p>Enable alternative boundary mode. By default is disabled.
  19239. The Dynamic Audio Normalizer takes into account a certain neighbourhood
  19240. around each frame. This includes the preceding frames as well as the
  19241. subsequent frames. However, for the &quot;boundary&quot; frames, located at the very
  19242. beginning and at the very end of the audio file, not all neighbouring
  19243. frames are available. In particular, for the first few frames in the audio
  19244. file, the preceding frames are not known. And, similarly, for the last few
  19245. frames in the audio file, the subsequent frames are not known. Thus, the
  19246. question arises which gain factors should be assumed for the missing frames
  19247. in the &quot;boundary&quot; region. The Dynamic Audio Normalizer implements two modes
  19248. to deal with this situation. The default boundary mode assumes a gain factor
  19249. of exactly 1.0 for the missing frames, resulting in a smooth &quot;fade in&quot; and
  19250. &quot;fade out&quot; at the beginning and at the end of the input, respectively.
  19251. </p>
  19252. </dd>
  19253. <dt><samp class="option">compress, s</samp></dt>
  19254. <dd><p>Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
  19255. By default, the Dynamic Audio Normalizer does not apply &quot;traditional&quot;
  19256. compression. This means that signal peaks will not be pruned and thus the
  19257. full dynamic range will be retained within each local neighbourhood. However,
  19258. in some cases it may be desirable to combine the Dynamic Audio Normalizer&rsquo;s
  19259. normalization algorithm with a more &quot;traditional&quot; compression.
  19260. For this purpose, the Dynamic Audio Normalizer provides an optional compression
  19261. (thresholding) function. If (and only if) the compression feature is enabled,
  19262. all input frames will be processed by a soft knee thresholding function prior
  19263. to the actual normalization process. Put simply, the thresholding function is
  19264. going to prune all samples whose magnitude exceeds a certain threshold value.
  19265. However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
  19266. value. Instead, the threshold value will be adjusted for each individual
  19267. frame.
  19268. In general, smaller parameters result in stronger compression, and vice versa.
  19269. Values below 3.0 are not recommended, because audible distortion may appear.
  19270. </p>
  19271. </dd>
  19272. <dt><samp class="option">threshold, t</samp></dt>
  19273. <dd><p>Set the target threshold value. This specifies the lowest permissible
  19274. magnitude level for the audio input which will be normalized.
  19275. If input frame volume is above this value frame will be normalized.
  19276. Otherwise frame may not be normalized at all. The default value is set
  19277. to 0, which means all input frames will be normalized.
  19278. This option is mostly useful if digital noise is not wanted to be amplified.
  19279. </p>
  19280. </dd>
  19281. <dt><samp class="option">channels, h</samp></dt>
  19282. <dd><p>Specify which channels to filter, by default all available channels are filtered.
  19283. </p>
  19284. </dd>
  19285. <dt><samp class="option">overlap, o</samp></dt>
  19286. <dd><p>Specify overlap for frames. If set to 0 (default) no frame overlapping is done.
  19287. Using &gt;0 and &lt;1 values will make less conservative gain adjustments, like
  19288. when framelen option is set to smaller value, if framelen option value is
  19289. compensated for non-zero overlap then gain adjustments will be smoother across time
  19290. compared to zero overlap case.
  19291. </p>
  19292. </dd>
  19293. <dt><samp class="option">curve, v</samp></dt>
  19294. <dd><p>Specify the peak mapping curve expression which is going to be used when calculating
  19295. gain applied to frames. The max output frame gain will still be limited by other
  19296. options mentioned previously for this filter.
  19297. </p>
  19298. <p>The expression can contain the following constants:
  19299. </p>
  19300. <dl class="table">
  19301. <dt><samp class="option">ch</samp></dt>
  19302. <dd><p>current channel number
  19303. </p>
  19304. </dd>
  19305. <dt><samp class="option">sn</samp></dt>
  19306. <dd><p>current sample number
  19307. </p>
  19308. </dd>
  19309. <dt><samp class="option">nb_channels</samp></dt>
  19310. <dd><p>number of channels
  19311. </p>
  19312. </dd>
  19313. <dt><samp class="option">t</samp></dt>
  19314. <dd><p>timestamp expressed in seconds
  19315. </p>
  19316. </dd>
  19317. <dt><samp class="option">sr</samp></dt>
  19318. <dd><p>sample rate
  19319. </p>
  19320. </dd>
  19321. <dt><samp class="option">p</samp></dt>
  19322. <dd><p>current frame peak value
  19323. </p></dd>
  19324. </dl>
  19325. </dd>
  19326. </dl>
  19327. <a name="Commands-37"></a>
  19328. <h4 class="subsection">29.85.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-37" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-37" aria-hidden="true">TOC</a></span></h4>
  19329. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  19330. </p>
  19331. <a name="earwax"></a>
  19332. <h3 class="section">29.86 earwax<span class="pull-right"><a class="anchor hidden-xs" href="#earwax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-earwax" aria-hidden="true">TOC</a></span></h3>
  19333. <p>Make audio easier to listen to on headphones.
  19334. </p>
  19335. <p>This filter adds &lsquo;cues&rsquo; to 44.1kHz stereo (i.e. audio CD format) audio
  19336. so that when listened to on headphones the stereo image is moved from
  19337. inside your head (standard for headphones) to outside and in front of
  19338. the listener (standard for speakers).
  19339. </p>
  19340. <p>Ported from SoX.
  19341. </p>
  19342. <a name="equalizer"></a>
  19343. <h3 class="section">29.87 equalizer<span class="pull-right"><a class="anchor hidden-xs" href="#equalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-equalizer" aria-hidden="true">TOC</a></span></h3>
  19344. <p>Apply a two-pole peaking equalisation (EQ) filter. With this
  19345. filter, the signal-level at and around a selected frequency can
  19346. be increased or decreased, whilst (unlike bandpass and bandreject
  19347. filters) that at all other frequencies is unchanged.
  19348. </p>
  19349. <p>In order to produce complex equalisation curves, this filter can
  19350. be given several times, each with a different central frequency.
  19351. </p>
  19352. <p>The filter accepts the following options:
  19353. </p>
  19354. <dl class="table">
  19355. <dt><samp class="option">frequency, f</samp></dt>
  19356. <dd><p>Set the filter&rsquo;s central frequency in Hz.
  19357. </p>
  19358. </dd>
  19359. <dt><samp class="option">width_type, t</samp></dt>
  19360. <dd><p>Set method to specify band-width of filter.
  19361. </p><dl class="table">
  19362. <dt><samp class="option">h</samp></dt>
  19363. <dd><p>Hz
  19364. </p></dd>
  19365. <dt><samp class="option">q</samp></dt>
  19366. <dd><p>Q-Factor
  19367. </p></dd>
  19368. <dt><samp class="option">o</samp></dt>
  19369. <dd><p>octave
  19370. </p></dd>
  19371. <dt><samp class="option">s</samp></dt>
  19372. <dd><p>slope
  19373. </p></dd>
  19374. <dt><samp class="option">k</samp></dt>
  19375. <dd><p>kHz
  19376. </p></dd>
  19377. </dl>
  19378. </dd>
  19379. <dt><samp class="option">width, w</samp></dt>
  19380. <dd><p>Specify the band-width of a filter in width_type units.
  19381. </p>
  19382. </dd>
  19383. <dt><samp class="option">gain, g</samp></dt>
  19384. <dd><p>Set the required gain or attenuation in dB.
  19385. Beware of clipping when using a positive gain.
  19386. </p>
  19387. </dd>
  19388. <dt><samp class="option">mix, m</samp></dt>
  19389. <dd><p>How much to use filtered signal in output. Default is 1.
  19390. Range is between 0 and 1.
  19391. </p>
  19392. </dd>
  19393. <dt><samp class="option">channels, c</samp></dt>
  19394. <dd><p>Specify which channels to filter, by default all available are filtered.
  19395. </p>
  19396. </dd>
  19397. <dt><samp class="option">normalize, n</samp></dt>
  19398. <dd><p>Normalize biquad coefficients, by default is disabled.
  19399. Enabling it will normalize magnitude response at DC to 0dB.
  19400. </p>
  19401. </dd>
  19402. <dt><samp class="option">transform, a</samp></dt>
  19403. <dd><p>Set transform type of IIR filter.
  19404. </p><dl class="table">
  19405. <dt><samp class="option">di</samp></dt>
  19406. <dt><samp class="option">dii</samp></dt>
  19407. <dt><samp class="option">tdi</samp></dt>
  19408. <dt><samp class="option">tdii</samp></dt>
  19409. <dt><samp class="option">latt</samp></dt>
  19410. <dt><samp class="option">svf</samp></dt>
  19411. <dt><samp class="option">zdf</samp></dt>
  19412. </dl>
  19413. </dd>
  19414. <dt><samp class="option">precision, r</samp></dt>
  19415. <dd><p>Set precision of filtering.
  19416. </p><dl class="table">
  19417. <dt><samp class="option">auto</samp></dt>
  19418. <dd><p>Pick automatic sample format depending on surround filters.
  19419. </p></dd>
  19420. <dt><samp class="option">s16</samp></dt>
  19421. <dd><p>Always use signed 16-bit.
  19422. </p></dd>
  19423. <dt><samp class="option">s32</samp></dt>
  19424. <dd><p>Always use signed 32-bit.
  19425. </p></dd>
  19426. <dt><samp class="option">f32</samp></dt>
  19427. <dd><p>Always use float 32-bit.
  19428. </p></dd>
  19429. <dt><samp class="option">f64</samp></dt>
  19430. <dd><p>Always use float 64-bit.
  19431. </p></dd>
  19432. </dl>
  19433. </dd>
  19434. <dt><samp class="option">block_size, b</samp></dt>
  19435. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  19436. value (higher than impulse response length truncated when reaches near zero values) filtering
  19437. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  19438. </p>
  19439. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  19440. </p></dd>
  19441. </dl>
  19442. <a name="Examples-42"></a>
  19443. <h4 class="subsection">29.87.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-42" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-42" aria-hidden="true">TOC</a></span></h4>
  19444. <ul class="itemize mark-bullet">
  19445. <li>Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
  19446. <div class="example">
  19447. <pre class="example-preformatted">equalizer=f=1000:t=h:width=200:g=-10
  19448. </pre></div>
  19449. </li><li>Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
  19450. <div class="example">
  19451. <pre class="example-preformatted">equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
  19452. </pre></div>
  19453. </li></ul>
  19454. <a name="Commands-38"></a>
  19455. <h4 class="subsection">29.87.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-38" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-38" aria-hidden="true">TOC</a></span></h4>
  19456. <p>This filter supports the following commands:
  19457. </p><dl class="table">
  19458. <dt><samp class="option">frequency, f</samp></dt>
  19459. <dd><p>Change equalizer frequency.
  19460. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  19461. </p>
  19462. </dd>
  19463. <dt><samp class="option">width_type, t</samp></dt>
  19464. <dd><p>Change equalizer width_type.
  19465. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  19466. </p>
  19467. </dd>
  19468. <dt><samp class="option">width, w</samp></dt>
  19469. <dd><p>Change equalizer width.
  19470. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  19471. </p>
  19472. </dd>
  19473. <dt><samp class="option">gain, g</samp></dt>
  19474. <dd><p>Change equalizer gain.
  19475. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  19476. </p>
  19477. </dd>
  19478. <dt><samp class="option">mix, m</samp></dt>
  19479. <dd><p>Change equalizer mix.
  19480. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  19481. </p></dd>
  19482. </dl>
  19483. <a name="extrastereo"></a>
  19484. <h3 class="section">29.88 extrastereo<span class="pull-right"><a class="anchor hidden-xs" href="#extrastereo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-extrastereo" aria-hidden="true">TOC</a></span></h3>
  19485. <p>Linearly increases the difference between left and right channels which
  19486. adds some sort of &quot;live&quot; effect to playback.
  19487. </p>
  19488. <p>The filter accepts the following options:
  19489. </p>
  19490. <dl class="table">
  19491. <dt><samp class="option">m</samp></dt>
  19492. <dd><p>Sets the difference coefficient (default: 2.5). 0.0 means mono sound
  19493. (average of both channels), with 1.0 sound will be unchanged, with
  19494. -1.0 left and right channels will be swapped.
  19495. </p>
  19496. </dd>
  19497. <dt><samp class="option">c</samp></dt>
  19498. <dd><p>Enable clipping. By default is enabled.
  19499. </p></dd>
  19500. </dl>
  19501. <a name="Commands-39"></a>
  19502. <h4 class="subsection">29.88.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-39" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-39" aria-hidden="true">TOC</a></span></h4>
  19503. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  19504. </p>
  19505. <a name="firequalizer"></a>
  19506. <h3 class="section">29.89 firequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#firequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-firequalizer" aria-hidden="true">TOC</a></span></h3>
  19507. <p>Apply FIR Equalization using arbitrary frequency response.
  19508. </p>
  19509. <p>The filter accepts the following option:
  19510. </p>
  19511. <dl class="table">
  19512. <dt><samp class="option">gain</samp></dt>
  19513. <dd><p>Set gain curve equation (in dB). The expression can contain variables:
  19514. </p><dl class="table">
  19515. <dt><samp class="option">f</samp></dt>
  19516. <dd><p>the evaluated frequency
  19517. </p></dd>
  19518. <dt><samp class="option">sr</samp></dt>
  19519. <dd><p>sample rate
  19520. </p></dd>
  19521. <dt><samp class="option">ch</samp></dt>
  19522. <dd><p>channel number, set to 0 when multichannels evaluation is disabled
  19523. </p></dd>
  19524. <dt><samp class="option">chid</samp></dt>
  19525. <dd><p>channel id, see libavutil/channel_layout.h, set to the first channel id when
  19526. multichannels evaluation is disabled
  19527. </p></dd>
  19528. <dt><samp class="option">chs</samp></dt>
  19529. <dd><p>number of channels
  19530. </p></dd>
  19531. <dt><samp class="option">chlayout</samp></dt>
  19532. <dd><p>channel_layout, see libavutil/channel_layout.h
  19533. </p>
  19534. </dd>
  19535. </dl>
  19536. <p>and functions:
  19537. </p><dl class="table">
  19538. <dt><samp class="option">gain_interpolate(f)</samp></dt>
  19539. <dd><p>interpolate gain on frequency f based on gain_entry
  19540. </p></dd>
  19541. <dt><samp class="option">cubic_interpolate(f)</samp></dt>
  19542. <dd><p>same as gain_interpolate, but smoother
  19543. </p></dd>
  19544. </dl>
  19545. <p>This option is also available as command. Default is <code class="code">gain_interpolate(f)</code>.
  19546. </p>
  19547. </dd>
  19548. <dt><samp class="option">gain_entry</samp></dt>
  19549. <dd><p>Set gain entry for gain_interpolate function. The expression can
  19550. contain functions:
  19551. </p><dl class="table">
  19552. <dt><samp class="option">entry(f, g)</samp></dt>
  19553. <dd><p>store gain entry at frequency f with value g
  19554. </p></dd>
  19555. </dl>
  19556. <p>This option is also available as command.
  19557. </p>
  19558. </dd>
  19559. <dt><samp class="option">delay</samp></dt>
  19560. <dd><p>Set filter delay in seconds. Higher value means more accurate.
  19561. Default is <code class="code">0.01</code>.
  19562. </p>
  19563. </dd>
  19564. <dt><samp class="option">accuracy</samp></dt>
  19565. <dd><p>Set filter accuracy in Hz. Lower value means more accurate.
  19566. Default is <code class="code">5</code>.
  19567. </p>
  19568. </dd>
  19569. <dt><samp class="option">wfunc</samp></dt>
  19570. <dd><p>Set window function. Acceptable values are:
  19571. </p><dl class="table">
  19572. <dt><samp class="option">rectangular</samp></dt>
  19573. <dd><p>rectangular window, useful when gain curve is already smooth
  19574. </p></dd>
  19575. <dt><samp class="option">hann</samp></dt>
  19576. <dd><p>hann window (default)
  19577. </p></dd>
  19578. <dt><samp class="option">hamming</samp></dt>
  19579. <dd><p>hamming window
  19580. </p></dd>
  19581. <dt><samp class="option">blackman</samp></dt>
  19582. <dd><p>blackman window
  19583. </p></dd>
  19584. <dt><samp class="option">nuttall3</samp></dt>
  19585. <dd><p>3-terms continuous 1st derivative nuttall window
  19586. </p></dd>
  19587. <dt><samp class="option">mnuttall3</samp></dt>
  19588. <dd><p>minimum 3-terms discontinuous nuttall window
  19589. </p></dd>
  19590. <dt><samp class="option">nuttall</samp></dt>
  19591. <dd><p>4-terms continuous 1st derivative nuttall window
  19592. </p></dd>
  19593. <dt><samp class="option">bnuttall</samp></dt>
  19594. <dd><p>minimum 4-terms discontinuous nuttall (blackman-nuttall) window
  19595. </p></dd>
  19596. <dt><samp class="option">bharris</samp></dt>
  19597. <dd><p>blackman-harris window
  19598. </p></dd>
  19599. <dt><samp class="option">tukey</samp></dt>
  19600. <dd><p>tukey window
  19601. </p></dd>
  19602. </dl>
  19603. </dd>
  19604. <dt><samp class="option">fixed</samp></dt>
  19605. <dd><p>If enabled, use fixed number of audio samples. This improves speed when
  19606. filtering with large delay. Default is disabled.
  19607. </p>
  19608. </dd>
  19609. <dt><samp class="option">multi</samp></dt>
  19610. <dd><p>Enable multichannels evaluation on gain. Default is disabled.
  19611. </p>
  19612. </dd>
  19613. <dt><samp class="option">zero_phase</samp></dt>
  19614. <dd><p>Enable zero phase mode by subtracting timestamp to compensate delay.
  19615. Default is disabled.
  19616. </p>
  19617. </dd>
  19618. <dt><samp class="option">scale</samp></dt>
  19619. <dd><p>Set scale used by gain. Acceptable values are:
  19620. </p><dl class="table">
  19621. <dt><samp class="option">linlin</samp></dt>
  19622. <dd><p>linear frequency, linear gain
  19623. </p></dd>
  19624. <dt><samp class="option">linlog</samp></dt>
  19625. <dd><p>linear frequency, logarithmic (in dB) gain (default)
  19626. </p></dd>
  19627. <dt><samp class="option">loglin</samp></dt>
  19628. <dd><p>logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
  19629. </p></dd>
  19630. <dt><samp class="option">loglog</samp></dt>
  19631. <dd><p>logarithmic frequency, logarithmic gain
  19632. </p></dd>
  19633. </dl>
  19634. </dd>
  19635. <dt><samp class="option">dumpfile</samp></dt>
  19636. <dd><p>Set file for dumping, suitable for gnuplot.
  19637. </p>
  19638. </dd>
  19639. <dt><samp class="option">dumpscale</samp></dt>
  19640. <dd><p>Set scale for dumpfile. Acceptable values are same with scale option.
  19641. Default is linlog.
  19642. </p>
  19643. </dd>
  19644. <dt><samp class="option">fft2</samp></dt>
  19645. <dd><p>Enable 2-channel convolution using complex FFT. This improves speed significantly.
  19646. Default is disabled.
  19647. </p>
  19648. </dd>
  19649. <dt><samp class="option">min_phase</samp></dt>
  19650. <dd><p>Enable minimum phase impulse response. Default is disabled.
  19651. </p></dd>
  19652. </dl>
  19653. <a name="Examples-43"></a>
  19654. <h4 class="subsection">29.89.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-43" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-43" aria-hidden="true">TOC</a></span></h4>
  19655. <ul class="itemize mark-bullet">
  19656. <li>lowpass at 1000 Hz:
  19657. <div class="example">
  19658. <pre class="example-preformatted">firequalizer=gain='if(lt(f,1000), 0, -INF)'
  19659. </pre></div>
  19660. </li><li>lowpass at 1000 Hz with gain_entry:
  19661. <div class="example">
  19662. <pre class="example-preformatted">firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
  19663. </pre></div>
  19664. </li><li>custom equalization:
  19665. <div class="example">
  19666. <pre class="example-preformatted">firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
  19667. </pre></div>
  19668. </li><li>higher delay with zero phase to compensate delay:
  19669. <div class="example">
  19670. <pre class="example-preformatted">firequalizer=delay=0.1:fixed=on:zero_phase=on
  19671. </pre></div>
  19672. </li><li>lowpass on left channel, highpass on right channel:
  19673. <div class="example">
  19674. <pre class="example-preformatted">firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
  19675. :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
  19676. </pre></div>
  19677. </li></ul>
  19678. <a name="flanger"></a>
  19679. <h3 class="section">29.90 flanger<span class="pull-right"><a class="anchor hidden-xs" href="#flanger" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flanger" aria-hidden="true">TOC</a></span></h3>
  19680. <p>Apply a flanging effect to the audio.
  19681. </p>
  19682. <p>The filter accepts the following options:
  19683. </p>
  19684. <dl class="table">
  19685. <dt><samp class="option">delay</samp></dt>
  19686. <dd><p>Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
  19687. </p>
  19688. </dd>
  19689. <dt><samp class="option">depth</samp></dt>
  19690. <dd><p>Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2.
  19691. </p>
  19692. </dd>
  19693. <dt><samp class="option">regen</samp></dt>
  19694. <dd><p>Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
  19695. Default value is 0.
  19696. </p>
  19697. </dd>
  19698. <dt><samp class="option">width</samp></dt>
  19699. <dd><p>Set percentage of delayed signal mixed with original. Range from 0 to 100.
  19700. Default value is 71.
  19701. </p>
  19702. </dd>
  19703. <dt><samp class="option">speed</samp></dt>
  19704. <dd><p>Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
  19705. </p>
  19706. </dd>
  19707. <dt><samp class="option">shape</samp></dt>
  19708. <dd><p>Set swept wave shape, can be <var class="var">triangular</var> or <var class="var">sinusoidal</var>.
  19709. Default value is <var class="var">sinusoidal</var>.
  19710. </p>
  19711. </dd>
  19712. <dt><samp class="option">phase</samp></dt>
  19713. <dd><p>Set swept wave percentage-shift for multi channel. Range from 0 to 100.
  19714. Default value is 25.
  19715. </p>
  19716. </dd>
  19717. <dt><samp class="option">interp</samp></dt>
  19718. <dd><p>Set delay-line interpolation, <var class="var">linear</var> or <var class="var">quadratic</var>.
  19719. Default is <var class="var">linear</var>.
  19720. </p></dd>
  19721. </dl>
  19722. <a name="haas"></a>
  19723. <h3 class="section">29.91 haas<span class="pull-right"><a class="anchor hidden-xs" href="#haas" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-haas" aria-hidden="true">TOC</a></span></h3>
  19724. <p>Apply Haas effect to audio.
  19725. </p>
  19726. <p>Note that this makes most sense to apply on mono signals.
  19727. With this filter applied to mono signals it give some directionality and
  19728. stretches its stereo image.
  19729. </p>
  19730. <p>The filter accepts the following options:
  19731. </p>
  19732. <dl class="table">
  19733. <dt><samp class="option">level_in</samp></dt>
  19734. <dd><p>Set input level. By default is <var class="var">1</var>, or 0dB
  19735. </p>
  19736. </dd>
  19737. <dt><samp class="option">level_out</samp></dt>
  19738. <dd><p>Set output level. By default is <var class="var">1</var>, or 0dB.
  19739. </p>
  19740. </dd>
  19741. <dt><samp class="option">side_gain</samp></dt>
  19742. <dd><p>Set gain applied to side part of signal. By default is <var class="var">1</var>.
  19743. </p>
  19744. </dd>
  19745. <dt><samp class="option">middle_source</samp></dt>
  19746. <dd><p>Set kind of middle source. Can be one of the following:
  19747. </p>
  19748. <dl class="table">
  19749. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  19750. <dd><p>Pick left channel.
  19751. </p>
  19752. </dd>
  19753. <dt>&lsquo;<samp class="samp">right</samp>&rsquo;</dt>
  19754. <dd><p>Pick right channel.
  19755. </p>
  19756. </dd>
  19757. <dt>&lsquo;<samp class="samp">mid</samp>&rsquo;</dt>
  19758. <dd><p>Pick middle part signal of stereo image.
  19759. </p>
  19760. </dd>
  19761. <dt>&lsquo;<samp class="samp">side</samp>&rsquo;</dt>
  19762. <dd><p>Pick side part signal of stereo image.
  19763. </p></dd>
  19764. </dl>
  19765. </dd>
  19766. <dt><samp class="option">middle_phase</samp></dt>
  19767. <dd><p>Change middle phase. By default is disabled.
  19768. </p>
  19769. </dd>
  19770. <dt><samp class="option">left_delay</samp></dt>
  19771. <dd><p>Set left channel delay. By default is <var class="var">2.05</var> milliseconds.
  19772. </p>
  19773. </dd>
  19774. <dt><samp class="option">left_balance</samp></dt>
  19775. <dd><p>Set left channel balance. By default is <var class="var">-1</var>.
  19776. </p>
  19777. </dd>
  19778. <dt><samp class="option">left_gain</samp></dt>
  19779. <dd><p>Set left channel gain. By default is <var class="var">1</var>.
  19780. </p>
  19781. </dd>
  19782. <dt><samp class="option">left_phase</samp></dt>
  19783. <dd><p>Change left phase. By default is disabled.
  19784. </p>
  19785. </dd>
  19786. <dt><samp class="option">right_delay</samp></dt>
  19787. <dd><p>Set right channel delay. By defaults is <var class="var">2.12</var> milliseconds.
  19788. </p>
  19789. </dd>
  19790. <dt><samp class="option">right_balance</samp></dt>
  19791. <dd><p>Set right channel balance. By default is <var class="var">1</var>.
  19792. </p>
  19793. </dd>
  19794. <dt><samp class="option">right_gain</samp></dt>
  19795. <dd><p>Set right channel gain. By default is <var class="var">1</var>.
  19796. </p>
  19797. </dd>
  19798. <dt><samp class="option">right_phase</samp></dt>
  19799. <dd><p>Change right phase. By default is enabled.
  19800. </p></dd>
  19801. </dl>
  19802. <a name="hdcd"></a>
  19803. <h3 class="section">29.92 hdcd<span class="pull-right"><a class="anchor hidden-xs" href="#hdcd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hdcd" aria-hidden="true">TOC</a></span></h3>
  19804. <p>Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with
  19805. embedded HDCD codes is expanded into a 20-bit PCM stream.
  19806. </p>
  19807. <p>The filter supports the Peak Extend and Low-level Gain Adjustment features
  19808. of HDCD, and detects the Transient Filter flag.
  19809. </p>
  19810. <div class="example">
  19811. <pre class="example-preformatted">ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
  19812. </pre></div>
  19813. <p>When using the filter with wav, note the default encoding for wav is 16-bit,
  19814. so the resulting 20-bit stream will be truncated back to 16-bit. Use something
  19815. like <code class="command">-acodec pcm_s24le</code> after the filter to get 24-bit PCM output.
  19816. </p><div class="example">
  19817. <pre class="example-preformatted">ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
  19818. ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
  19819. </pre></div>
  19820. <p>The filter accepts the following options:
  19821. </p>
  19822. <dl class="table">
  19823. <dt><samp class="option">disable_autoconvert</samp></dt>
  19824. <dd><p>Disable any automatic format conversion or resampling in the filter graph.
  19825. </p>
  19826. </dd>
  19827. <dt><samp class="option">process_stereo</samp></dt>
  19828. <dd><p>Process the stereo channels together. If target_gain does not match between
  19829. channels, consider it invalid and use the last valid target_gain.
  19830. </p>
  19831. </dd>
  19832. <dt><samp class="option">cdt_ms</samp></dt>
  19833. <dd><p>Set the code detect timer period in ms.
  19834. </p>
  19835. </dd>
  19836. <dt><samp class="option">force_pe</samp></dt>
  19837. <dd><p>Always extend peaks above -3dBFS even if PE isn&rsquo;t signaled.
  19838. </p>
  19839. </dd>
  19840. <dt><samp class="option">analyze_mode</samp></dt>
  19841. <dd><p>Replace audio with a solid tone and adjust the amplitude to signal some
  19842. specific aspect of the decoding process. The output file can be loaded in
  19843. an audio editor alongside the original to aid analysis.
  19844. </p>
  19845. <p><code class="code">analyze_mode=pe:force_pe=true</code> can be used to see all samples above the PE level.
  19846. </p>
  19847. <p>Modes are:
  19848. </p><dl class="table">
  19849. <dt>&lsquo;<samp class="samp">0, off</samp>&rsquo;</dt>
  19850. <dd><p>Disabled
  19851. </p></dd>
  19852. <dt>&lsquo;<samp class="samp">1, lle</samp>&rsquo;</dt>
  19853. <dd><p>Gain adjustment level at each sample
  19854. </p></dd>
  19855. <dt>&lsquo;<samp class="samp">2, pe</samp>&rsquo;</dt>
  19856. <dd><p>Samples where peak extend occurs
  19857. </p></dd>
  19858. <dt>&lsquo;<samp class="samp">3, cdt</samp>&rsquo;</dt>
  19859. <dd><p>Samples where the code detect timer is active
  19860. </p></dd>
  19861. <dt>&lsquo;<samp class="samp">4, tgm</samp>&rsquo;</dt>
  19862. <dd><p>Samples where the target gain does not match between channels
  19863. </p></dd>
  19864. </dl>
  19865. </dd>
  19866. </dl>
  19867. <a name="headphone"></a>
  19868. <h3 class="section">29.93 headphone<span class="pull-right"><a class="anchor hidden-xs" href="#headphone" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-headphone" aria-hidden="true">TOC</a></span></h3>
  19869. <p>Apply head-related transfer functions (HRTFs) to create virtual
  19870. loudspeakers around the user for binaural listening via headphones.
  19871. The HRIRs are provided via additional streams, for each channel
  19872. one stereo input stream is needed.
  19873. </p>
  19874. <p>The filter accepts the following options:
  19875. </p>
  19876. <dl class="table">
  19877. <dt><samp class="option">map</samp></dt>
  19878. <dd><p>Set mapping of input streams for convolution.
  19879. The argument is a &rsquo;|&rsquo;-separated list of channel names in order as they
  19880. are given as additional stream inputs for filter.
  19881. This also specify number of input streams. Number of input streams
  19882. must be not less than number of channels in first stream plus one.
  19883. </p>
  19884. </dd>
  19885. <dt><samp class="option">gain</samp></dt>
  19886. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  19887. </p>
  19888. </dd>
  19889. <dt><samp class="option">type</samp></dt>
  19890. <dd><p>Set processing type. Can be <var class="var">time</var> or <var class="var">freq</var>. <var class="var">time</var> is
  19891. processing audio in time domain which is slow.
  19892. <var class="var">freq</var> is processing audio in frequency domain which is fast.
  19893. Default is <var class="var">freq</var>.
  19894. </p>
  19895. </dd>
  19896. <dt><samp class="option">lfe</samp></dt>
  19897. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  19898. </p>
  19899. </dd>
  19900. <dt><samp class="option">size</samp></dt>
  19901. <dd><p>Set size of frame in number of samples which will be processed at once.
  19902. Default value is <var class="var">1024</var>. Allowed range is from 1024 to 96000.
  19903. </p>
  19904. </dd>
  19905. <dt><samp class="option">hrir</samp></dt>
  19906. <dd><p>Set format of hrir stream.
  19907. Default value is <var class="var">stereo</var>. Alternative value is <var class="var">multich</var>.
  19908. If value is set to <var class="var">stereo</var>, number of additional streams should
  19909. be greater or equal to number of input channels in first input stream.
  19910. Also each additional stream should have stereo number of channels.
  19911. If value is set to <var class="var">multich</var>, number of additional streams should
  19912. be exactly one. Also number of input channels of additional stream
  19913. should be equal or greater than twice number of channels of first input
  19914. stream.
  19915. </p></dd>
  19916. </dl>
  19917. <a name="Examples-44"></a>
  19918. <h4 class="subsection">29.93.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-44" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-44" aria-hidden="true">TOC</a></span></h4>
  19919. <ul class="itemize mark-bullet">
  19920. <li>Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  19921. each amovie filter use stereo file with IR coefficients as input.
  19922. The files give coefficients for each position of virtual loudspeaker:
  19923. <div class="example">
  19924. <pre class="example-preformatted">ffmpeg -i input.wav
  19925. -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;
  19926. output.wav
  19927. </pre></div>
  19928. </li><li>Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  19929. but now in <var class="var">multich</var> <var class="var">hrir</var> format.
  19930. <div class="example">
  19931. <pre class="example-preformatted">ffmpeg -i input.wav -filter_complex &quot;amovie=minp.wav[hrirs];[0:a][hrirs]headphone=map=FL|FR|FC|LFE|BL|BR|SL|SR:hrir=multich&quot;
  19932. output.wav
  19933. </pre></div>
  19934. </li></ul>
  19935. <a name="highpass"></a>
  19936. <h3 class="section">29.94 highpass<span class="pull-right"><a class="anchor hidden-xs" href="#highpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-highpass" aria-hidden="true">TOC</a></span></h3>
  19937. <p>Apply a high-pass filter with 3dB point frequency.
  19938. The filter can be either single-pole, or double-pole (the default).
  19939. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  19940. </p>
  19941. <p>The filter accepts the following options:
  19942. </p>
  19943. <dl class="table">
  19944. <dt><samp class="option">frequency, f</samp></dt>
  19945. <dd><p>Set frequency in Hz. Default is 3000.
  19946. </p>
  19947. </dd>
  19948. <dt><samp class="option">poles, p</samp></dt>
  19949. <dd><p>Set number of poles. Default is 2.
  19950. </p>
  19951. </dd>
  19952. <dt><samp class="option">width_type, t</samp></dt>
  19953. <dd><p>Set method to specify band-width of filter.
  19954. </p><dl class="table">
  19955. <dt><samp class="option">h</samp></dt>
  19956. <dd><p>Hz
  19957. </p></dd>
  19958. <dt><samp class="option">q</samp></dt>
  19959. <dd><p>Q-Factor
  19960. </p></dd>
  19961. <dt><samp class="option">o</samp></dt>
  19962. <dd><p>octave
  19963. </p></dd>
  19964. <dt><samp class="option">s</samp></dt>
  19965. <dd><p>slope
  19966. </p></dd>
  19967. <dt><samp class="option">k</samp></dt>
  19968. <dd><p>kHz
  19969. </p></dd>
  19970. </dl>
  19971. </dd>
  19972. <dt><samp class="option">width, w</samp></dt>
  19973. <dd><p>Specify the band-width of a filter in width_type units.
  19974. Applies only to double-pole filter.
  19975. The default is 0.707q and gives a Butterworth response.
  19976. </p>
  19977. </dd>
  19978. <dt><samp class="option">mix, m</samp></dt>
  19979. <dd><p>How much to use filtered signal in output. Default is 1.
  19980. Range is between 0 and 1.
  19981. </p>
  19982. </dd>
  19983. <dt><samp class="option">channels, c</samp></dt>
  19984. <dd><p>Specify which channels to filter, by default all available are filtered.
  19985. </p>
  19986. </dd>
  19987. <dt><samp class="option">normalize, n</samp></dt>
  19988. <dd><p>Normalize biquad coefficients, by default is disabled.
  19989. Enabling it will normalize magnitude response at DC to 0dB.
  19990. </p>
  19991. </dd>
  19992. <dt><samp class="option">transform, a</samp></dt>
  19993. <dd><p>Set transform type of IIR filter.
  19994. </p><dl class="table">
  19995. <dt><samp class="option">di</samp></dt>
  19996. <dt><samp class="option">dii</samp></dt>
  19997. <dt><samp class="option">tdi</samp></dt>
  19998. <dt><samp class="option">tdii</samp></dt>
  19999. <dt><samp class="option">latt</samp></dt>
  20000. <dt><samp class="option">svf</samp></dt>
  20001. <dt><samp class="option">zdf</samp></dt>
  20002. </dl>
  20003. </dd>
  20004. <dt><samp class="option">precision, r</samp></dt>
  20005. <dd><p>Set precision of filtering.
  20006. </p><dl class="table">
  20007. <dt><samp class="option">auto</samp></dt>
  20008. <dd><p>Pick automatic sample format depending on surround filters.
  20009. </p></dd>
  20010. <dt><samp class="option">s16</samp></dt>
  20011. <dd><p>Always use signed 16-bit.
  20012. </p></dd>
  20013. <dt><samp class="option">s32</samp></dt>
  20014. <dd><p>Always use signed 32-bit.
  20015. </p></dd>
  20016. <dt><samp class="option">f32</samp></dt>
  20017. <dd><p>Always use float 32-bit.
  20018. </p></dd>
  20019. <dt><samp class="option">f64</samp></dt>
  20020. <dd><p>Always use float 64-bit.
  20021. </p></dd>
  20022. </dl>
  20023. </dd>
  20024. <dt><samp class="option">block_size, b</samp></dt>
  20025. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  20026. value (higher than impulse response length truncated when reaches near zero values) filtering
  20027. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  20028. </p>
  20029. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  20030. </p></dd>
  20031. </dl>
  20032. <a name="Commands-40"></a>
  20033. <h4 class="subsection">29.94.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-40" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-40" aria-hidden="true">TOC</a></span></h4>
  20034. <p>This filter supports the following commands:
  20035. </p><dl class="table">
  20036. <dt><samp class="option">frequency, f</samp></dt>
  20037. <dd><p>Change highpass frequency.
  20038. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  20039. </p>
  20040. </dd>
  20041. <dt><samp class="option">width_type, t</samp></dt>
  20042. <dd><p>Change highpass width_type.
  20043. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  20044. </p>
  20045. </dd>
  20046. <dt><samp class="option">width, w</samp></dt>
  20047. <dd><p>Change highpass width.
  20048. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  20049. </p>
  20050. </dd>
  20051. <dt><samp class="option">mix, m</samp></dt>
  20052. <dd><p>Change highpass mix.
  20053. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  20054. </p></dd>
  20055. </dl>
  20056. <a name="join"></a>
  20057. <h3 class="section">29.95 join<span class="pull-right"><a class="anchor hidden-xs" href="#join" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-join" aria-hidden="true">TOC</a></span></h3>
  20058. <p>Join multiple input streams into one multi-channel stream.
  20059. </p>
  20060. <p>It accepts the following parameters:
  20061. </p><dl class="table">
  20062. <dt><samp class="option">inputs</samp></dt>
  20063. <dd><p>The number of input streams. It defaults to 2.
  20064. </p>
  20065. </dd>
  20066. <dt><samp class="option">channel_layout</samp></dt>
  20067. <dd><p>The desired output channel layout. It defaults to stereo.
  20068. </p>
  20069. </dd>
  20070. <dt><samp class="option">map</samp></dt>
  20071. <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-separated list of
  20072. mappings, each in the <code class="code"><var class="var">input_idx</var>.<var class="var">in_channel</var>-<var class="var">out_channel</var></code>
  20073. form. <var class="var">input_idx</var> is the 0-based index of the input stream. <var class="var">in_channel</var>
  20074. can be either the name of the input channel (e.g. FL for front left) or its
  20075. index in the specified input stream. <var class="var">out_channel</var> is the name of the output
  20076. channel.
  20077. </p></dd>
  20078. </dl>
  20079. <p>The filter will attempt to guess the mappings when they are not specified
  20080. explicitly. It does so by first trying to find an unused matching input channel
  20081. and if that fails it picks the first unused input channel.
  20082. </p>
  20083. <p>Join 3 inputs (with properly set channel layouts):
  20084. </p><div class="example">
  20085. <pre class="example-preformatted">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
  20086. </pre></div>
  20087. <p>Build a 5.1 output from 6 single-channel streams:
  20088. </p><div class="example">
  20089. <pre class="example-preformatted">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
  20090. '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'
  20091. out
  20092. </pre></div>
  20093. <a name="ladspa"></a>
  20094. <h3 class="section">29.96 ladspa<span class="pull-right"><a class="anchor hidden-xs" href="#ladspa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ladspa" aria-hidden="true">TOC</a></span></h3>
  20095. <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
  20096. </p>
  20097. <p>To enable compilation of this filter you need to configure FFmpeg with
  20098. <code class="code">--enable-ladspa</code>.
  20099. </p>
  20100. <dl class="table">
  20101. <dt><samp class="option">file, f</samp></dt>
  20102. <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
  20103. variable <code class="env">LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
  20104. each one of the directories specified by the colon separated list in
  20105. <code class="env">LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
  20106. this order: <samp class="file">HOME/.ladspa/lib/</samp>, <samp class="file">/usr/local/lib/ladspa/</samp>,
  20107. <samp class="file">/usr/lib/ladspa/</samp>.
  20108. </p>
  20109. </dd>
  20110. <dt><samp class="option">plugin, p</samp></dt>
  20111. <dd><p>Specifies the plugin within the library. Some libraries contain only
  20112. one plugin, but others contain many of them. If this is not set filter
  20113. will list all available plugins within the specified library.
  20114. </p>
  20115. </dd>
  20116. <dt><samp class="option">controls, c</samp></dt>
  20117. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  20118. values that determine the behavior of the loaded plugin (for example delay,
  20119. threshold or gain).
  20120. Controls need to be defined using the following syntax:
  20121. c0=<var class="var">value0</var>|c1=<var class="var">value1</var>|c2=<var class="var">value2</var>|..., where
  20122. <var class="var">valuei</var> is the value set on the <var class="var">i</var>-th control.
  20123. Alternatively they can be also defined using the following syntax:
  20124. <var class="var">value0</var>|<var class="var">value1</var>|<var class="var">value2</var>|..., where
  20125. <var class="var">valuei</var> is the value set on the <var class="var">i</var>-th control.
  20126. If <samp class="option">controls</samp> is set to <code class="code">help</code>, all available controls and
  20127. their valid ranges are printed.
  20128. </p>
  20129. </dd>
  20130. <dt><samp class="option">sample_rate, s</samp></dt>
  20131. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  20132. zero inputs.
  20133. </p>
  20134. </dd>
  20135. <dt><samp class="option">nb_samples, n</samp></dt>
  20136. <dd><p>Set the number of samples per channel per each output frame, default
  20137. is 1024. Only used if plugin have zero inputs.
  20138. </p>
  20139. </dd>
  20140. <dt><samp class="option">duration, d</samp></dt>
  20141. <dd><p>Set the minimum duration of the sourced audio. See
  20142. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  20143. for the accepted syntax.
  20144. Note that the resulting duration may be greater than the specified duration,
  20145. as the generated audio is always cut at the end of a complete frame.
  20146. If not specified, or the expressed duration is negative, the audio is
  20147. supposed to be generated forever.
  20148. Only used if plugin have zero inputs.
  20149. </p>
  20150. </dd>
  20151. <dt><samp class="option">latency, l</samp></dt>
  20152. <dd><p>Enable latency compensation, by default is disabled.
  20153. Only used if plugin have inputs.
  20154. </p></dd>
  20155. </dl>
  20156. <a name="Examples-45"></a>
  20157. <h4 class="subsection">29.96.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-45" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-45" aria-hidden="true">TOC</a></span></h4>
  20158. <ul class="itemize mark-bullet">
  20159. <li>List all available plugins within amp (LADSPA example plugin) library:
  20160. <div class="example">
  20161. <pre class="example-preformatted">ladspa=file=amp
  20162. </pre></div>
  20163. </li><li>List all available controls and their valid ranges for <code class="code">vcf_notch</code>
  20164. plugin from <code class="code">VCF</code> library:
  20165. <div class="example">
  20166. <pre class="example-preformatted">ladspa=f=vcf:p=vcf_notch:c=help
  20167. </pre></div>
  20168. </li><li>Simulate low quality audio equipment using <code class="code">Computer Music Toolkit</code> (CMT)
  20169. plugin library:
  20170. <div class="example">
  20171. <pre class="example-preformatted">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
  20172. </pre></div>
  20173. </li><li>Add reverberation to the audio using TAP-plugins
  20174. (Tom&rsquo;s Audio Processing plugins):
  20175. <div class="example">
  20176. <pre class="example-preformatted">ladspa=file=tap_reverb:tap_reverb
  20177. </pre></div>
  20178. </li><li>Generate white noise, with 0.2 amplitude:
  20179. <div class="example">
  20180. <pre class="example-preformatted">ladspa=file=cmt:noise_source_white:c=c0=.2
  20181. </pre></div>
  20182. </li><li>Generate 20 bpm clicks using plugin <code class="code">C* Click - Metronome</code> from the
  20183. <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  20184. <div class="example">
  20185. <pre class="example-preformatted">ladspa=file=caps:Click:c=c1=20'
  20186. </pre></div>
  20187. </li><li>Apply <code class="code">C* Eq10X2 - Stereo 10-band equaliser</code> effect:
  20188. <div class="example">
  20189. <pre class="example-preformatted">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
  20190. </pre></div>
  20191. </li><li>Increase volume by 20dB using fast lookahead limiter from Steve Harris
  20192. <code class="code">SWH Plugins</code> collection:
  20193. <div class="example">
  20194. <pre class="example-preformatted">ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
  20195. </pre></div>
  20196. </li><li>Attenuate low frequencies using Multiband EQ from Steve Harris
  20197. <code class="code">SWH Plugins</code> collection:
  20198. <div class="example">
  20199. <pre class="example-preformatted">ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
  20200. </pre></div>
  20201. </li><li>Reduce stereo image using <code class="code">Narrower</code> from the <code class="code">C* Audio Plugin Suite</code>
  20202. (CAPS) library:
  20203. <div class="example">
  20204. <pre class="example-preformatted">ladspa=caps:Narrower
  20205. </pre></div>
  20206. </li><li>Another white noise, now using <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  20207. <div class="example">
  20208. <pre class="example-preformatted">ladspa=caps:White:.2
  20209. </pre></div>
  20210. </li><li>Some fractal noise, using <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  20211. <div class="example">
  20212. <pre class="example-preformatted">ladspa=caps:Fractal:c=c1=1
  20213. </pre></div>
  20214. </li><li>Dynamic volume normalization using <code class="code">VLevel</code> plugin:
  20215. <div class="example">
  20216. <pre class="example-preformatted">ladspa=vlevel-ladspa:vlevel_mono
  20217. </pre></div>
  20218. </li></ul>
  20219. <a name="Commands-41"></a>
  20220. <h4 class="subsection">29.96.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-41" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-41" aria-hidden="true">TOC</a></span></h4>
  20221. <p>This filter supports the following commands:
  20222. </p><dl class="table">
  20223. <dt><samp class="option">cN</samp></dt>
  20224. <dd><p>Modify the <var class="var">N</var>-th control value.
  20225. </p>
  20226. <p>If the specified value is not valid, it is ignored and prior one is kept.
  20227. </p></dd>
  20228. </dl>
  20229. <a name="loudnorm"></a>
  20230. <h3 class="section">29.97 loudnorm<span class="pull-right"><a class="anchor hidden-xs" href="#loudnorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-loudnorm" aria-hidden="true">TOC</a></span></h3>
  20231. <p>EBU R128 loudness normalization. Includes both dynamic and linear normalization modes.
  20232. Support for both single pass (livestreams, files) and double pass (files) modes.
  20233. This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately
  20234. detect true peaks, the audio stream will be upsampled to 192 kHz.
  20235. Use the <code class="code">-ar</code> option or <code class="code">aresample</code> filter to explicitly set an output sample rate.
  20236. </p>
  20237. <p>The filter accepts the following options:
  20238. </p>
  20239. <dl class="table">
  20240. <dt><samp class="option">I, i</samp></dt>
  20241. <dd><p>Set integrated loudness target.
  20242. Range is -70.0 - -5.0. Default value is -24.0.
  20243. </p>
  20244. </dd>
  20245. <dt><samp class="option">LRA, lra</samp></dt>
  20246. <dd><p>Set loudness range target.
  20247. Range is 1.0 - 50.0. Default value is 7.0.
  20248. </p>
  20249. </dd>
  20250. <dt><samp class="option">TP, tp</samp></dt>
  20251. <dd><p>Set maximum true peak.
  20252. Range is -9.0 - +0.0. Default value is -2.0.
  20253. </p>
  20254. </dd>
  20255. <dt><samp class="option">measured_I, measured_i</samp></dt>
  20256. <dd><p>Measured IL of input file.
  20257. Range is -99.0 - +0.0.
  20258. </p>
  20259. </dd>
  20260. <dt><samp class="option">measured_LRA, measured_lra</samp></dt>
  20261. <dd><p>Measured LRA of input file.
  20262. Range is 0.0 - 99.0.
  20263. </p>
  20264. </dd>
  20265. <dt><samp class="option">measured_TP, measured_tp</samp></dt>
  20266. <dd><p>Measured true peak of input file.
  20267. Range is -99.0 - +99.0.
  20268. </p>
  20269. </dd>
  20270. <dt><samp class="option">measured_thresh</samp></dt>
  20271. <dd><p>Measured threshold of input file.
  20272. Range is -99.0 - +0.0.
  20273. </p>
  20274. </dd>
  20275. <dt><samp class="option">offset</samp></dt>
  20276. <dd><p>Set offset gain. Gain is applied before the true-peak limiter.
  20277. Range is -99.0 - +99.0. Default is +0.0.
  20278. </p>
  20279. </dd>
  20280. <dt><samp class="option">linear</samp></dt>
  20281. <dd><p>Normalize by linearly scaling the source audio.
  20282. <code class="code">measured_I</code>, <code class="code">measured_LRA</code>, <code class="code">measured_TP</code>,
  20283. and <code class="code">measured_thresh</code> must all be specified. Target LRA shouldn&rsquo;t
  20284. be lower than source LRA and the change in integrated loudness shouldn&rsquo;t
  20285. result in a true peak which exceeds the target TP. If any of these
  20286. conditions aren&rsquo;t met, normalization mode will revert to <var class="var">dynamic</var>.
  20287. Options are <code class="code">true</code> or <code class="code">false</code>. Default is <code class="code">true</code>.
  20288. </p>
  20289. </dd>
  20290. <dt><samp class="option">dual_mono</samp></dt>
  20291. <dd><p>Treat mono input files as &quot;dual-mono&quot;. If a mono file is intended for playback
  20292. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  20293. If set to <code class="code">true</code>, this option will compensate for this effect.
  20294. Multi-channel input files are not affected by this option.
  20295. Options are true or false. Default is false.
  20296. </p>
  20297. </dd>
  20298. <dt><samp class="option">print_format</samp></dt>
  20299. <dd><p>Set print format for stats. Options are summary, json, or none.
  20300. Default value is none.
  20301. </p></dd>
  20302. </dl>
  20303. <a name="lowpass"></a>
  20304. <h3 class="section">29.98 lowpass<span class="pull-right"><a class="anchor hidden-xs" href="#lowpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lowpass" aria-hidden="true">TOC</a></span></h3>
  20305. <p>Apply a low-pass filter with 3dB point frequency.
  20306. The filter can be either single-pole or double-pole (the default).
  20307. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  20308. </p>
  20309. <p>The filter accepts the following options:
  20310. </p>
  20311. <dl class="table">
  20312. <dt><samp class="option">frequency, f</samp></dt>
  20313. <dd><p>Set frequency in Hz. Default is 500.
  20314. </p>
  20315. </dd>
  20316. <dt><samp class="option">poles, p</samp></dt>
  20317. <dd><p>Set number of poles. Default is 2.
  20318. </p>
  20319. </dd>
  20320. <dt><samp class="option">width_type, t</samp></dt>
  20321. <dd><p>Set method to specify band-width of filter.
  20322. </p><dl class="table">
  20323. <dt><samp class="option">h</samp></dt>
  20324. <dd><p>Hz
  20325. </p></dd>
  20326. <dt><samp class="option">q</samp></dt>
  20327. <dd><p>Q-Factor
  20328. </p></dd>
  20329. <dt><samp class="option">o</samp></dt>
  20330. <dd><p>octave
  20331. </p></dd>
  20332. <dt><samp class="option">s</samp></dt>
  20333. <dd><p>slope
  20334. </p></dd>
  20335. <dt><samp class="option">k</samp></dt>
  20336. <dd><p>kHz
  20337. </p></dd>
  20338. </dl>
  20339. </dd>
  20340. <dt><samp class="option">width, w</samp></dt>
  20341. <dd><p>Specify the band-width of a filter in width_type units.
  20342. Applies only to double-pole filter.
  20343. The default is 0.707q and gives a Butterworth response.
  20344. </p>
  20345. </dd>
  20346. <dt><samp class="option">mix, m</samp></dt>
  20347. <dd><p>How much to use filtered signal in output. Default is 1.
  20348. Range is between 0 and 1.
  20349. </p>
  20350. </dd>
  20351. <dt><samp class="option">channels, c</samp></dt>
  20352. <dd><p>Specify which channels to filter, by default all available are filtered.
  20353. </p>
  20354. </dd>
  20355. <dt><samp class="option">normalize, n</samp></dt>
  20356. <dd><p>Normalize biquad coefficients, by default is disabled.
  20357. Enabling it will normalize magnitude response at DC to 0dB.
  20358. </p>
  20359. </dd>
  20360. <dt><samp class="option">transform, a</samp></dt>
  20361. <dd><p>Set transform type of IIR filter.
  20362. </p><dl class="table">
  20363. <dt><samp class="option">di</samp></dt>
  20364. <dt><samp class="option">dii</samp></dt>
  20365. <dt><samp class="option">tdi</samp></dt>
  20366. <dt><samp class="option">tdii</samp></dt>
  20367. <dt><samp class="option">latt</samp></dt>
  20368. <dt><samp class="option">svf</samp></dt>
  20369. <dt><samp class="option">zdf</samp></dt>
  20370. </dl>
  20371. </dd>
  20372. <dt><samp class="option">precision, r</samp></dt>
  20373. <dd><p>Set precision of filtering.
  20374. </p><dl class="table">
  20375. <dt><samp class="option">auto</samp></dt>
  20376. <dd><p>Pick automatic sample format depending on surround filters.
  20377. </p></dd>
  20378. <dt><samp class="option">s16</samp></dt>
  20379. <dd><p>Always use signed 16-bit.
  20380. </p></dd>
  20381. <dt><samp class="option">s32</samp></dt>
  20382. <dd><p>Always use signed 32-bit.
  20383. </p></dd>
  20384. <dt><samp class="option">f32</samp></dt>
  20385. <dd><p>Always use float 32-bit.
  20386. </p></dd>
  20387. <dt><samp class="option">f64</samp></dt>
  20388. <dd><p>Always use float 64-bit.
  20389. </p></dd>
  20390. </dl>
  20391. </dd>
  20392. <dt><samp class="option">block_size, b</samp></dt>
  20393. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  20394. value (higher than impulse response length truncated when reaches near zero values) filtering
  20395. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  20396. </p>
  20397. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  20398. </p></dd>
  20399. </dl>
  20400. <a name="Examples-46"></a>
  20401. <h4 class="subsection">29.98.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-46" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-46" aria-hidden="true">TOC</a></span></h4>
  20402. <ul class="itemize mark-bullet">
  20403. <li>Lowpass only LFE channel, it LFE is not present it does nothing:
  20404. <div class="example">
  20405. <pre class="example-preformatted">lowpass=c=LFE
  20406. </pre></div>
  20407. </li></ul>
  20408. <a name="Commands-42"></a>
  20409. <h4 class="subsection">29.98.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-42" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-42" aria-hidden="true">TOC</a></span></h4>
  20410. <p>This filter supports the following commands:
  20411. </p><dl class="table">
  20412. <dt><samp class="option">frequency, f</samp></dt>
  20413. <dd><p>Change lowpass frequency.
  20414. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  20415. </p>
  20416. </dd>
  20417. <dt><samp class="option">width_type, t</samp></dt>
  20418. <dd><p>Change lowpass width_type.
  20419. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  20420. </p>
  20421. </dd>
  20422. <dt><samp class="option">width, w</samp></dt>
  20423. <dd><p>Change lowpass width.
  20424. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  20425. </p>
  20426. </dd>
  20427. <dt><samp class="option">mix, m</samp></dt>
  20428. <dd><p>Change lowpass mix.
  20429. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  20430. </p></dd>
  20431. </dl>
  20432. <a name="lv2"></a>
  20433. <h3 class="section">29.99 lv2<span class="pull-right"><a class="anchor hidden-xs" href="#lv2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lv2" aria-hidden="true">TOC</a></span></h3>
  20434. <p>Load a LV2 (LADSPA Version 2) plugin.
  20435. </p>
  20436. <p>To enable compilation of this filter you need to configure FFmpeg with
  20437. <code class="code">--enable-lv2</code>.
  20438. </p>
  20439. <dl class="table">
  20440. <dt><samp class="option">plugin, p</samp></dt>
  20441. <dd><p>Specifies the plugin URI. You may need to escape &rsquo;:&rsquo;.
  20442. </p>
  20443. </dd>
  20444. <dt><samp class="option">controls, c</samp></dt>
  20445. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  20446. values that determine the behavior of the loaded plugin (for example delay,
  20447. threshold or gain).
  20448. If <samp class="option">controls</samp> is set to <code class="code">help</code>, all available controls and
  20449. their valid ranges are printed.
  20450. </p>
  20451. </dd>
  20452. <dt><samp class="option">sample_rate, s</samp></dt>
  20453. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  20454. zero inputs.
  20455. </p>
  20456. </dd>
  20457. <dt><samp class="option">nb_samples, n</samp></dt>
  20458. <dd><p>Set the number of samples per channel per each output frame, default
  20459. is 1024. Only used if plugin have zero inputs.
  20460. </p>
  20461. </dd>
  20462. <dt><samp class="option">duration, d</samp></dt>
  20463. <dd><p>Set the minimum duration of the sourced audio. See
  20464. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  20465. for the accepted syntax.
  20466. Note that the resulting duration may be greater than the specified duration,
  20467. as the generated audio is always cut at the end of a complete frame.
  20468. If not specified, or the expressed duration is negative, the audio is
  20469. supposed to be generated forever.
  20470. Only used if plugin have zero inputs.
  20471. </p></dd>
  20472. </dl>
  20473. <a name="Examples-47"></a>
  20474. <h4 class="subsection">29.99.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-47" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-47" aria-hidden="true">TOC</a></span></h4>
  20475. <ul class="itemize mark-bullet">
  20476. <li>Apply bass enhancer plugin from Calf:
  20477. <div class="example">
  20478. <pre class="example-preformatted">lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
  20479. </pre></div>
  20480. </li><li>Apply vinyl plugin from Calf:
  20481. <div class="example">
  20482. <pre class="example-preformatted">lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
  20483. </pre></div>
  20484. </li><li>Apply bit crusher plugin from ArtyFX:
  20485. <div class="example">
  20486. <pre class="example-preformatted">lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
  20487. </pre></div>
  20488. </li></ul>
  20489. <a name="Commands-43"></a>
  20490. <h4 class="subsection">29.99.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-43" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-43" aria-hidden="true">TOC</a></span></h4>
  20491. <p>This filter supports all options that are exported by plugin as commands.
  20492. </p>
  20493. <a name="mcompand"></a>
  20494. <h3 class="section">29.100 mcompand<span class="pull-right"><a class="anchor hidden-xs" href="#mcompand" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mcompand" aria-hidden="true">TOC</a></span></h3>
  20495. <p>Multiband Compress or expand the audio&rsquo;s dynamic range.
  20496. </p>
  20497. <p>The input audio is divided into bands using 4th order Linkwitz-Riley IIRs.
  20498. This is akin to the crossover of a loudspeaker, and results in flat frequency
  20499. response when absent compander action.
  20500. </p>
  20501. <p>It accepts the following parameters:
  20502. </p>
  20503. <dl class="table">
  20504. <dt><samp class="option">args</samp></dt>
  20505. <dd><p>This option syntax is:
  20506. attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ...
  20507. For explanation of each item refer to compand filter documentation.
  20508. </p></dd>
  20509. </dl>
  20510. <a class="anchor" id="pan"></a><a name="pan-1"></a>
  20511. <h3 class="section">29.101 pan<span class="pull-right"><a class="anchor hidden-xs" href="#pan-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pan-1" aria-hidden="true">TOC</a></span></h3>
  20512. <p>Mix channels with specific gain levels. The filter accepts the output
  20513. channel layout followed by a set of channels definitions.
  20514. </p>
  20515. <p>This filter is also designed to efficiently remap the channels of an audio
  20516. stream.
  20517. </p>
  20518. <p>The filter accepts parameters of the form:
  20519. &quot;<var class="var">l</var>|<var class="var">outdef</var>|<var class="var">outdef</var>|...&quot;
  20520. </p>
  20521. <dl class="table">
  20522. <dt><samp class="option">l</samp></dt>
  20523. <dd><p>output channel layout or number of channels
  20524. </p>
  20525. </dd>
  20526. <dt><samp class="option">outdef</samp></dt>
  20527. <dd><p>output channel specification, of the form:
  20528. &quot;<var class="var">out_name</var>=[<var class="var">gain</var>*]<var class="var">in_name</var>[(+-)[<var class="var">gain</var>*]<var class="var">in_name</var>...]&quot;
  20529. </p>
  20530. </dd>
  20531. <dt><samp class="option">out_name</samp></dt>
  20532. <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
  20533. number (c0, c1, etc.)
  20534. </p>
  20535. </dd>
  20536. <dt><samp class="option">gain</samp></dt>
  20537. <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
  20538. </p>
  20539. </dd>
  20540. <dt><samp class="option">in_name</samp></dt>
  20541. <dd><p>input channel to use, see out_name for details; it is not possible to mix
  20542. named and numbered input channels
  20543. </p></dd>
  20544. </dl>
  20545. <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
  20546. that specification will be renormalized so that the total is 1, thus
  20547. avoiding clipping noise.
  20548. </p>
  20549. <a name="Mixing-examples"></a>
  20550. <h4 class="subsection">29.101.1 Mixing examples<span class="pull-right"><a class="anchor hidden-xs" href="#Mixing-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Mixing-examples" aria-hidden="true">TOC</a></span></h4>
  20551. <p>For example, if you want to down-mix from stereo to mono, but with a bigger
  20552. factor for the left channel:
  20553. </p><div class="example">
  20554. <pre class="example-preformatted">pan=1c|c0=0.9*c0+0.1*c1
  20555. </pre></div>
  20556. <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
  20557. 7-channels surround:
  20558. </p><div class="example">
  20559. <pre class="example-preformatted">pan=stereo| FL &lt; FL + 0.5*FC + 0.6*BL + 0.6*SL | FR &lt; FR + 0.5*FC + 0.6*BR + 0.6*SR
  20560. </pre></div>
  20561. <p>Note that <code class="command">ffmpeg</code> integrates a default down-mix (and up-mix) system
  20562. that should be preferred (see &quot;-ac&quot; option) unless you have very specific
  20563. needs.
  20564. </p>
  20565. <a name="Remapping-examples"></a>
  20566. <h4 class="subsection">29.101.2 Remapping examples<span class="pull-right"><a class="anchor hidden-xs" href="#Remapping-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Remapping-examples" aria-hidden="true">TOC</a></span></h4>
  20567. <p>The channel remapping will be effective if, and only if:
  20568. </p>
  20569. <ul class="itemize mark-bullet">
  20570. <li>gain coefficients are zeroes or ones,
  20571. </li><li>only one input per channel output,
  20572. </li></ul>
  20573. <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
  20574. channel mapping detected&quot;), and use an optimized and lossless method to do the
  20575. remapping.
  20576. </p>
  20577. <p>For example, if you have a 5.1 source and want a stereo audio stream by
  20578. dropping the extra channels:
  20579. </p><div class="example">
  20580. <pre class="example-preformatted">pan=&quot;stereo| c0=FL | c1=FR&quot;
  20581. </pre></div>
  20582. <p>Given the same source, you can also switch front left and front right channels
  20583. and keep the input channel layout:
  20584. </p><div class="example">
  20585. <pre class="example-preformatted">pan=&quot;5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5&quot;
  20586. </pre></div>
  20587. <p>If the input is a stereo audio stream, you can mute the front left channel (and
  20588. still keep the stereo channel layout) with:
  20589. </p><div class="example">
  20590. <pre class="example-preformatted">pan=&quot;stereo|c1=c1&quot;
  20591. </pre></div>
  20592. <p>Still with a stereo audio stream input, you can copy the right channel in both
  20593. front left and right:
  20594. </p><div class="example">
  20595. <pre class="example-preformatted">pan=&quot;stereo| c0=FR | c1=FR&quot;
  20596. </pre></div>
  20597. <a name="replaygain"></a>
  20598. <h3 class="section">29.102 replaygain<span class="pull-right"><a class="anchor hidden-xs" href="#replaygain" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-replaygain" aria-hidden="true">TOC</a></span></h3>
  20599. <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
  20600. outputs it unchanged.
  20601. At end of filtering it displays <code class="code">track_gain</code> and <code class="code">track_peak</code>.
  20602. </p>
  20603. <p>The filter accepts the following exported read-only options:
  20604. </p>
  20605. <dl class="table">
  20606. <dt><samp class="option">track_gain</samp></dt>
  20607. <dd><p>Exported track gain in dB at end of stream.
  20608. </p>
  20609. </dd>
  20610. <dt><samp class="option">track_peak</samp></dt>
  20611. <dd><p>Exported track peak at end of stream.
  20612. </p></dd>
  20613. </dl>
  20614. <a name="resample"></a>
  20615. <h3 class="section">29.103 resample<span class="pull-right"><a class="anchor hidden-xs" href="#resample" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-resample" aria-hidden="true">TOC</a></span></h3>
  20616. <p>Convert the audio sample format, sample rate and channel layout. It is
  20617. not meant to be used directly.
  20618. </p>
  20619. <a name="rubberband"></a>
  20620. <h3 class="section">29.104 rubberband<span class="pull-right"><a class="anchor hidden-xs" href="#rubberband" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rubberband" aria-hidden="true">TOC</a></span></h3>
  20621. <p>Apply time-stretching and pitch-shifting with librubberband.
  20622. </p>
  20623. <p>To enable compilation of this filter, you need to configure FFmpeg with
  20624. <code class="code">--enable-librubberband</code>.
  20625. </p>
  20626. <p>The filter accepts the following options:
  20627. </p>
  20628. <dl class="table">
  20629. <dt><samp class="option">tempo</samp></dt>
  20630. <dd><p>Set tempo scale factor.
  20631. </p>
  20632. </dd>
  20633. <dt><samp class="option">pitch</samp></dt>
  20634. <dd><p>Set pitch scale factor.
  20635. </p>
  20636. </dd>
  20637. <dt><samp class="option">transients</samp></dt>
  20638. <dd><p>Set transients detector.
  20639. Possible values are:
  20640. </p><dl class="table">
  20641. <dt><var class="var">crisp</var></dt>
  20642. <dt><var class="var">mixed</var></dt>
  20643. <dt><var class="var">smooth</var></dt>
  20644. </dl>
  20645. </dd>
  20646. <dt><samp class="option">detector</samp></dt>
  20647. <dd><p>Set detector.
  20648. Possible values are:
  20649. </p><dl class="table">
  20650. <dt><var class="var">compound</var></dt>
  20651. <dt><var class="var">percussive</var></dt>
  20652. <dt><var class="var">soft</var></dt>
  20653. </dl>
  20654. </dd>
  20655. <dt><samp class="option">phase</samp></dt>
  20656. <dd><p>Set phase.
  20657. Possible values are:
  20658. </p><dl class="table">
  20659. <dt><var class="var">laminar</var></dt>
  20660. <dt><var class="var">independent</var></dt>
  20661. </dl>
  20662. </dd>
  20663. <dt><samp class="option">window</samp></dt>
  20664. <dd><p>Set processing window size.
  20665. Possible values are:
  20666. </p><dl class="table">
  20667. <dt><var class="var">standard</var></dt>
  20668. <dt><var class="var">short</var></dt>
  20669. <dt><var class="var">long</var></dt>
  20670. </dl>
  20671. </dd>
  20672. <dt><samp class="option">smoothing</samp></dt>
  20673. <dd><p>Set smoothing.
  20674. Possible values are:
  20675. </p><dl class="table">
  20676. <dt><var class="var">off</var></dt>
  20677. <dt><var class="var">on</var></dt>
  20678. </dl>
  20679. </dd>
  20680. <dt><samp class="option">formant</samp></dt>
  20681. <dd><p>Enable formant preservation when shift pitching.
  20682. Possible values are:
  20683. </p><dl class="table">
  20684. <dt><var class="var">shifted</var></dt>
  20685. <dt><var class="var">preserved</var></dt>
  20686. </dl>
  20687. </dd>
  20688. <dt><samp class="option">pitchq</samp></dt>
  20689. <dd><p>Set pitch quality.
  20690. Possible values are:
  20691. </p><dl class="table">
  20692. <dt><var class="var">quality</var></dt>
  20693. <dt><var class="var">speed</var></dt>
  20694. <dt><var class="var">consistency</var></dt>
  20695. </dl>
  20696. </dd>
  20697. <dt><samp class="option">channels</samp></dt>
  20698. <dd><p>Set channels.
  20699. Possible values are:
  20700. </p><dl class="table">
  20701. <dt><var class="var">apart</var></dt>
  20702. <dt><var class="var">together</var></dt>
  20703. </dl>
  20704. </dd>
  20705. </dl>
  20706. <a name="Commands-44"></a>
  20707. <h4 class="subsection">29.104.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-44" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-44" aria-hidden="true">TOC</a></span></h4>
  20708. <p>This filter supports the following commands:
  20709. </p><dl class="table">
  20710. <dt><samp class="option">tempo</samp></dt>
  20711. <dd><p>Change filter tempo scale factor.
  20712. Syntax for the command is : &quot;<var class="var">tempo</var>&quot;
  20713. </p>
  20714. </dd>
  20715. <dt><samp class="option">pitch</samp></dt>
  20716. <dd><p>Change filter pitch scale factor.
  20717. Syntax for the command is : &quot;<var class="var">pitch</var>&quot;
  20718. </p></dd>
  20719. </dl>
  20720. <a name="sidechaincompress"></a>
  20721. <h3 class="section">29.105 sidechaincompress<span class="pull-right"><a class="anchor hidden-xs" href="#sidechaincompress" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sidechaincompress" aria-hidden="true">TOC</a></span></h3>
  20722. <p>This filter acts like normal compressor but has the ability to compress
  20723. detected signal using second input signal.
  20724. It needs two input streams and returns one output stream.
  20725. First input stream will be processed depending on second stream signal.
  20726. The filtered signal then can be filtered with other filters in later stages of
  20727. processing. See <a class="ref" href="#pan">pan</a> and <a class="ref" href="#amerge">amerge</a> filter.
  20728. </p>
  20729. <p>The filter accepts the following options:
  20730. </p>
  20731. <dl class="table">
  20732. <dt><samp class="option">level_in</samp></dt>
  20733. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  20734. </p>
  20735. </dd>
  20736. <dt><samp class="option">mode</samp></dt>
  20737. <dd><p>Set mode of compressor operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  20738. Default is <code class="code">downward</code>.
  20739. </p>
  20740. </dd>
  20741. <dt><samp class="option">threshold</samp></dt>
  20742. <dd><p>If a signal of second stream raises above this level it will affect the gain
  20743. reduction of first stream.
  20744. By default is 0.125. Range is between 0.00097563 and 1.
  20745. </p>
  20746. </dd>
  20747. <dt><samp class="option">ratio</samp></dt>
  20748. <dd><p>Set a ratio about which the signal is reduced. 1:2 means that if the level
  20749. raised 4dB above the threshold, it will be only 2dB above after the reduction.
  20750. Default is 2. Range is between 1 and 20.
  20751. </p>
  20752. </dd>
  20753. <dt><samp class="option">attack</samp></dt>
  20754. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  20755. reduction starts. Default is 20. Range is between 0.01 and 2000.
  20756. </p>
  20757. </dd>
  20758. <dt><samp class="option">release</samp></dt>
  20759. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  20760. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  20761. </p>
  20762. </dd>
  20763. <dt><samp class="option">makeup</samp></dt>
  20764. <dd><p>Set the amount by how much signal will be amplified after processing.
  20765. Default is 1. Range is from 1 to 64.
  20766. </p>
  20767. </dd>
  20768. <dt><samp class="option">knee</samp></dt>
  20769. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  20770. Default is 2.82843. Range is between 1 and 8.
  20771. </p>
  20772. </dd>
  20773. <dt><samp class="option">link</samp></dt>
  20774. <dd><p>Choose if the <code class="code">average</code> level between all channels of side-chain stream
  20775. or the louder(<code class="code">maximum</code>) channel of side-chain stream affects the
  20776. reduction. Default is <code class="code">average</code>.
  20777. </p>
  20778. </dd>
  20779. <dt><samp class="option">detection</samp></dt>
  20780. <dd><p>Should the exact signal be taken in case of <code class="code">peak</code> or an RMS one in case
  20781. of <code class="code">rms</code>. Default is <code class="code">rms</code> which is mainly smoother.
  20782. </p>
  20783. </dd>
  20784. <dt><samp class="option">level_sc</samp></dt>
  20785. <dd><p>Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
  20786. </p>
  20787. </dd>
  20788. <dt><samp class="option">mix</samp></dt>
  20789. <dd><p>How much to use compressed signal in output. Default is 1.
  20790. Range is between 0 and 1.
  20791. </p></dd>
  20792. </dl>
  20793. <a name="Commands-45"></a>
  20794. <h4 class="subsection">29.105.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-45" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-45" aria-hidden="true">TOC</a></span></h4>
  20795. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  20796. </p>
  20797. <a name="Examples-48"></a>
  20798. <h4 class="subsection">29.105.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-48" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-48" aria-hidden="true">TOC</a></span></h4>
  20799. <ul class="itemize mark-bullet">
  20800. <li>Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
  20801. depending on the signal of 2nd input and later compressed signal to be
  20802. merged with 2nd input:
  20803. <div class="example">
  20804. <pre class="example-preformatted">ffmpeg -i main.flac -i sidechain.flac -filter_complex &quot;[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge&quot;
  20805. </pre></div>
  20806. </li></ul>
  20807. <a name="sidechaingate"></a>
  20808. <h3 class="section">29.106 sidechaingate<span class="pull-right"><a class="anchor hidden-xs" href="#sidechaingate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sidechaingate" aria-hidden="true">TOC</a></span></h3>
  20809. <p>A sidechain gate acts like a normal (wideband) gate but has the ability to
  20810. filter the detected signal before sending it to the gain reduction stage.
  20811. Normally a gate uses the full range signal to detect a level above the
  20812. threshold.
  20813. For example: If you cut all lower frequencies from your sidechain signal
  20814. the gate will decrease the volume of your track only if not enough highs
  20815. appear. With this technique you are able to reduce the resonation of a
  20816. natural drum or remove &quot;rumbling&quot; of muted strokes from a heavily distorted
  20817. guitar.
  20818. It needs two input streams and returns one output stream.
  20819. First input stream will be processed depending on second stream signal.
  20820. </p>
  20821. <p>The filter accepts the following options:
  20822. </p>
  20823. <dl class="table">
  20824. <dt><samp class="option">level_in</samp></dt>
  20825. <dd><p>Set input level before filtering.
  20826. Default is 1. Allowed range is from 0.015625 to 64.
  20827. </p>
  20828. </dd>
  20829. <dt><samp class="option">mode</samp></dt>
  20830. <dd><p>Set the mode of operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  20831. Default is <code class="code">downward</code>. If set to <code class="code">upward</code> mode, higher parts of signal
  20832. will be amplified, expanding dynamic range in upward direction.
  20833. Otherwise, in case of <code class="code">downward</code> lower parts of signal will be reduced.
  20834. </p>
  20835. </dd>
  20836. <dt><samp class="option">range</samp></dt>
  20837. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  20838. Default is 0.06125. Allowed range is from 0 to 1.
  20839. Setting this to 0 disables reduction and then filter behaves like expander.
  20840. </p>
  20841. </dd>
  20842. <dt><samp class="option">threshold</samp></dt>
  20843. <dd><p>If a signal rises above this level the gain reduction is released.
  20844. Default is 0.125. Allowed range is from 0 to 1.
  20845. </p>
  20846. </dd>
  20847. <dt><samp class="option">ratio</samp></dt>
  20848. <dd><p>Set a ratio about which the signal is reduced.
  20849. Default is 2. Allowed range is from 1 to 9000.
  20850. </p>
  20851. </dd>
  20852. <dt><samp class="option">attack</samp></dt>
  20853. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  20854. reduction stops.
  20855. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  20856. </p>
  20857. </dd>
  20858. <dt><samp class="option">release</samp></dt>
  20859. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  20860. reduction is increased again. Default is 250 milliseconds.
  20861. Allowed range is from 0.01 to 9000.
  20862. </p>
  20863. </dd>
  20864. <dt><samp class="option">makeup</samp></dt>
  20865. <dd><p>Set amount of amplification of signal after processing.
  20866. Default is 1. Allowed range is from 1 to 64.
  20867. </p>
  20868. </dd>
  20869. <dt><samp class="option">knee</samp></dt>
  20870. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  20871. Default is 2.828427125. Allowed range is from 1 to 8.
  20872. </p>
  20873. </dd>
  20874. <dt><samp class="option">detection</samp></dt>
  20875. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  20876. Default is rms. Can be peak or rms.
  20877. </p>
  20878. </dd>
  20879. <dt><samp class="option">link</samp></dt>
  20880. <dd><p>Choose if the average level between all channels or the louder channel affects
  20881. the reduction.
  20882. Default is average. Can be average or maximum.
  20883. </p>
  20884. </dd>
  20885. <dt><samp class="option">level_sc</samp></dt>
  20886. <dd><p>Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
  20887. </p></dd>
  20888. </dl>
  20889. <a name="Commands-46"></a>
  20890. <h4 class="subsection">29.106.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-46" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-46" aria-hidden="true">TOC</a></span></h4>
  20891. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  20892. </p>
  20893. <a name="silencedetect"></a>
  20894. <h3 class="section">29.107 silencedetect<span class="pull-right"><a class="anchor hidden-xs" href="#silencedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-silencedetect" aria-hidden="true">TOC</a></span></h3>
  20895. <p>Detect silence in an audio stream.
  20896. </p>
  20897. <p>This filter logs a message when it detects that the input audio volume is less
  20898. or equal to a noise tolerance value for a duration greater or equal to the
  20899. minimum detected noise duration.
  20900. </p>
  20901. <p>The printed times and duration are expressed in seconds. The
  20902. <code class="code">lavfi.silence_start</code> or <code class="code">lavfi.silence_start.X</code> metadata key
  20903. is set on the first frame whose timestamp equals or exceeds the detection
  20904. duration and it contains the timestamp of the first frame of the silence.
  20905. </p>
  20906. <p>The <code class="code">lavfi.silence_duration</code> or <code class="code">lavfi.silence_duration.X</code>
  20907. and <code class="code">lavfi.silence_end</code> or <code class="code">lavfi.silence_end.X</code> metadata
  20908. keys are set on the first frame after the silence. If <samp class="option">mono</samp> is
  20909. enabled, and each channel is evaluated separately, the <code class="code">.X</code>
  20910. suffixed keys are used, and <code class="code">X</code> corresponds to the channel number.
  20911. </p>
  20912. <p>The filter accepts the following options:
  20913. </p>
  20914. <dl class="table">
  20915. <dt><samp class="option">noise, n</samp></dt>
  20916. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  20917. specified value) or amplitude ratio. Default is -60dB, or 0.001.
  20918. </p>
  20919. </dd>
  20920. <dt><samp class="option">duration, d</samp></dt>
  20921. <dd><p>Set silence duration until notification (default is 2 seconds). See
  20922. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  20923. for the accepted syntax.
  20924. </p>
  20925. </dd>
  20926. <dt><samp class="option">mono, m</samp></dt>
  20927. <dd><p>Process each channel separately, instead of combined. By default is disabled.
  20928. </p></dd>
  20929. </dl>
  20930. <a name="Examples-49"></a>
  20931. <h4 class="subsection">29.107.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-49" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-49" aria-hidden="true">TOC</a></span></h4>
  20932. <ul class="itemize mark-bullet">
  20933. <li>Detect 5 seconds of silence with -50dB noise tolerance:
  20934. <div class="example">
  20935. <pre class="example-preformatted">silencedetect=n=-50dB:d=5
  20936. </pre></div>
  20937. </li><li>Complete example with <code class="command">ffmpeg</code> to detect silence with 0.0001 noise
  20938. tolerance in <samp class="file">silence.mp3</samp>:
  20939. <div class="example">
  20940. <pre class="example-preformatted">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
  20941. </pre></div>
  20942. </li></ul>
  20943. <a name="silenceremove"></a>
  20944. <h3 class="section">29.108 silenceremove<span class="pull-right"><a class="anchor hidden-xs" href="#silenceremove" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-silenceremove" aria-hidden="true">TOC</a></span></h3>
  20945. <p>Remove silence from the beginning, middle or end of the audio.
  20946. </p>
  20947. <p>The filter accepts the following options:
  20948. </p>
  20949. <dl class="table">
  20950. <dt><samp class="option">start_periods</samp></dt>
  20951. <dd><p>This value is used to indicate if audio should be trimmed at beginning of
  20952. the audio. A value of zero indicates no silence should be trimmed from the
  20953. beginning. When specifying a non-zero value, it trims audio up until it
  20954. finds non-silence. Normally, when trimming silence from beginning of audio
  20955. the <var class="var">start_periods</var> will be <code class="code">1</code> but it can be increased to higher
  20956. values to trim all audio up to specific count of non-silence periods.
  20957. Default value is <code class="code">0</code>.
  20958. </p>
  20959. </dd>
  20960. <dt><samp class="option">start_duration</samp></dt>
  20961. <dd><p>Specify the amount of time that non-silence must be detected before it stops
  20962. trimming audio. By increasing the duration, bursts of noises can be treated
  20963. as silence and trimmed off. Default value is <code class="code">0</code>.
  20964. </p>
  20965. </dd>
  20966. <dt><samp class="option">start_threshold</samp></dt>
  20967. <dd><p>This indicates what sample value should be treated as silence. For digital
  20968. audio, a value of <code class="code">0</code> may be fine but for audio recorded from analog,
  20969. you may wish to increase the value to account for background noise.
  20970. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  20971. or amplitude ratio. Default value is <code class="code">0</code>.
  20972. </p>
  20973. </dd>
  20974. <dt><samp class="option">start_silence</samp></dt>
  20975. <dd><p>Specify max duration of silence at beginning that will be kept after
  20976. trimming. Default is 0, which is equal to trimming all samples detected
  20977. as silence.
  20978. </p>
  20979. </dd>
  20980. <dt><samp class="option">start_mode</samp></dt>
  20981. <dd><p>Specify mode of detection of silence end at start of multi-channel audio.
  20982. Can be <var class="var">any</var> or <var class="var">all</var>. Default is <var class="var">any</var>.
  20983. With <var class="var">any</var>, any sample from any channel that is detected as non-silence
  20984. will trigger end of silence trimming at start of audio stream.
  20985. With <var class="var">all</var>, only if every sample from every channel is detected as non-silence
  20986. will trigger end of silence trimming at start of audio stream, limited usage.
  20987. </p>
  20988. </dd>
  20989. <dt><samp class="option">stop_periods</samp></dt>
  20990. <dd><p>Set the count for trimming silence from the end of audio. When specifying a
  20991. positive value, it trims audio after it finds specified silence period.
  20992. To remove silence from the middle of a file, specify a <var class="var">stop_periods</var>
  20993. that is negative. This value is then treated as a positive value and is
  20994. used to indicate the effect should restart processing as specified by
  20995. <var class="var">stop_periods</var>, making it suitable for removing periods of silence
  20996. in the middle of the audio.
  20997. Default value is <code class="code">0</code>.
  20998. </p>
  20999. </dd>
  21000. <dt><samp class="option">stop_duration</samp></dt>
  21001. <dd><p>Specify a duration of silence that must exist before audio is not copied any
  21002. more. By specifying a higher duration, silence that is wanted can be left in
  21003. the audio.
  21004. Default value is <code class="code">0</code>.
  21005. </p>
  21006. </dd>
  21007. <dt><samp class="option">stop_threshold</samp></dt>
  21008. <dd><p>This is the same as <samp class="option">start_threshold</samp> but for trimming silence from
  21009. the end of audio.
  21010. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  21011. or amplitude ratio. Default value is <code class="code">0</code>.
  21012. </p>
  21013. </dd>
  21014. <dt><samp class="option">stop_silence</samp></dt>
  21015. <dd><p>Specify max duration of silence at end that will be kept after
  21016. trimming. Default is 0, which is equal to trimming all samples detected
  21017. as silence.
  21018. </p>
  21019. </dd>
  21020. <dt><samp class="option">stop_mode</samp></dt>
  21021. <dd><p>Specify mode of detection of silence start after start of multi-channel audio.
  21022. Can be <var class="var">any</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  21023. With <var class="var">any</var>, any sample from any channel that is detected as silence
  21024. will trigger start of silence trimming after start of audio stream, limited usage.
  21025. With <var class="var">all</var>, only if every sample from every channel is detected as silence
  21026. will trigger start of silence trimming after start of audio stream.
  21027. </p>
  21028. </dd>
  21029. <dt><samp class="option">detection</samp></dt>
  21030. <dd><p>Set how is silence detected.
  21031. </p><dl class="table">
  21032. <dt><samp class="option">avg</samp></dt>
  21033. <dd><p>Mean of absolute values of samples in moving window.
  21034. </p></dd>
  21035. <dt><samp class="option">rms</samp></dt>
  21036. <dd><p>Root squared mean of absolute values of samples in moving window.
  21037. </p></dd>
  21038. <dt><samp class="option">peak</samp></dt>
  21039. <dd><p>Maximum of absolute values of samples in moving window.
  21040. </p></dd>
  21041. <dt><samp class="option">median</samp></dt>
  21042. <dd><p>Median of absolute values of samples in moving window.
  21043. </p></dd>
  21044. <dt><samp class="option">ptp</samp></dt>
  21045. <dd><p>Absolute of max peak to min peak difference of samples in moving window.
  21046. </p></dd>
  21047. <dt><samp class="option">dev</samp></dt>
  21048. <dd><p>Standard deviation of values of samples in moving window.
  21049. </p></dd>
  21050. </dl>
  21051. <p>Default value is <code class="code">rms</code>.
  21052. </p>
  21053. </dd>
  21054. <dt><samp class="option">window</samp></dt>
  21055. <dd><p>Set duration in number of seconds used to calculate size of window in number
  21056. of samples for detecting silence. Using <code class="code">0</code> will effectively disable
  21057. any windowing and use only single sample per channel for silence detection.
  21058. In that case it may be needed to also set <samp class="option">start_silence</samp> and/or
  21059. <samp class="option">stop_silence</samp> to nonzero values with also <samp class="option">start_duration</samp> and/or
  21060. <samp class="option">stop_duration</samp> to nonzero values.
  21061. Default value is <code class="code">0.02</code>. Allowed range is from <code class="code">0</code> to <code class="code">10</code>.
  21062. </p>
  21063. </dd>
  21064. <dt><samp class="option">timestamp</samp></dt>
  21065. <dd><p>Set processing mode of every audio frame output timestamp.
  21066. </p><dl class="table">
  21067. <dt><samp class="option">write</samp></dt>
  21068. <dd><p>Full timestamps rewrite, keep only the start time for the first output frame.
  21069. </p></dd>
  21070. <dt><samp class="option">copy</samp></dt>
  21071. <dd><p>Non-dropped frames are left with same timestamp as input audio frame.
  21072. </p></dd>
  21073. </dl>
  21074. <p>Defaults value is <code class="code">write</code>.
  21075. </p></dd>
  21076. </dl>
  21077. <a name="Examples-50"></a>
  21078. <h4 class="subsection">29.108.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-50" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-50" aria-hidden="true">TOC</a></span></h4>
  21079. <ul class="itemize mark-bullet">
  21080. <li>The following example shows how this filter can be used to start a recording
  21081. that does not contain the delay at the start which usually occurs between
  21082. pressing the record button and the start of the performance:
  21083. <div class="example">
  21084. <pre class="example-preformatted">silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
  21085. </pre></div>
  21086. </li><li>Trim all silence encountered from beginning to end where there is more than 1
  21087. second of silence in audio:
  21088. <div class="example">
  21089. <pre class="example-preformatted">silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
  21090. </pre></div>
  21091. </li><li>Trim all digital silence samples, using peak detection, from beginning to end
  21092. where there is more than 0 samples of digital silence in audio and digital
  21093. silence is detected in all channels at same positions in stream:
  21094. <div class="example">
  21095. <pre class="example-preformatted">silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
  21096. </pre></div>
  21097. </li><li>Trim every 2nd encountered silence period from beginning to end where there is
  21098. more than 1 second of silence per silence period in audio:
  21099. <div class="example">
  21100. <pre class="example-preformatted">silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB
  21101. </pre></div>
  21102. </li><li>Similar as above, but keep maximum of 0.5 seconds of silence from each trimmed period:
  21103. <div class="example">
  21104. <pre class="example-preformatted">silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB:stop_silence=0.5
  21105. </pre></div>
  21106. </li><li>Similar as above, but keep maximum of 1.5 seconds of silence from start of audio:
  21107. <div class="example">
  21108. <pre class="example-preformatted">silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB:stop_silence=0.5:start_periods=1:start_duration=1:start_silence=1.5:stop_threshold=-90dB
  21109. </pre></div>
  21110. </li></ul>
  21111. <a name="Commands-47"></a>
  21112. <h4 class="subsection">29.108.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-47" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-47" aria-hidden="true">TOC</a></span></h4>
  21113. <p>This filter supports some above options as <a class="ref" href="#commands">commands</a>.
  21114. </p>
  21115. <a name="sofalizer"></a>
  21116. <h3 class="section">29.109 sofalizer<span class="pull-right"><a class="anchor hidden-xs" href="#sofalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sofalizer" aria-hidden="true">TOC</a></span></h3>
  21117. <p>SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
  21118. loudspeakers around the user for binaural listening via headphones (audio
  21119. formats up to 9 channels supported).
  21120. The HRTFs are stored in SOFA files (see <a class="url" href="http://www.sofacoustics.org/">http://www.sofacoustics.org/</a> for a database).
  21121. SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
  21122. Austrian Academy of Sciences.
  21123. </p>
  21124. <p>To enable compilation of this filter you need to configure FFmpeg with
  21125. <code class="code">--enable-libmysofa</code>.
  21126. </p>
  21127. <p>The filter accepts the following options:
  21128. </p>
  21129. <dl class="table">
  21130. <dt><samp class="option">sofa</samp></dt>
  21131. <dd><p>Set the SOFA file used for rendering.
  21132. </p>
  21133. </dd>
  21134. <dt><samp class="option">gain</samp></dt>
  21135. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  21136. </p>
  21137. </dd>
  21138. <dt><samp class="option">rotation</samp></dt>
  21139. <dd><p>Set rotation of virtual loudspeakers in deg. Default is 0.
  21140. </p>
  21141. </dd>
  21142. <dt><samp class="option">elevation</samp></dt>
  21143. <dd><p>Set elevation of virtual speakers in deg. Default is 0.
  21144. </p>
  21145. </dd>
  21146. <dt><samp class="option">radius</samp></dt>
  21147. <dd><p>Set distance in meters between loudspeakers and the listener with near-field
  21148. HRTFs. Default is 1.
  21149. </p>
  21150. </dd>
  21151. <dt><samp class="option">type</samp></dt>
  21152. <dd><p>Set processing type. Can be <var class="var">time</var> or <var class="var">freq</var>. <var class="var">time</var> is
  21153. processing audio in time domain which is slow.
  21154. <var class="var">freq</var> is processing audio in frequency domain which is fast.
  21155. Default is <var class="var">freq</var>.
  21156. </p>
  21157. </dd>
  21158. <dt><samp class="option">speakers</samp></dt>
  21159. <dd><p>Set custom positions of virtual loudspeakers. Syntax for this option is:
  21160. &lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;[|&lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;|...].
  21161. Each virtual loudspeaker is described with short channel name following with
  21162. azimuth and elevation in degrees.
  21163. Each virtual loudspeaker description is separated by &rsquo;|&rsquo;.
  21164. For example to override front left and front right channel positions use:
  21165. &rsquo;speakers=FL 45 15|FR 345 15&rsquo;.
  21166. Descriptions with unrecognised channel names are ignored.
  21167. </p>
  21168. </dd>
  21169. <dt><samp class="option">lfegain</samp></dt>
  21170. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  21171. </p>
  21172. </dd>
  21173. <dt><samp class="option">framesize</samp></dt>
  21174. <dd><p>Set custom frame size in number of samples. Default is 1024.
  21175. Allowed range is from 1024 to 96000. Only used if option &lsquo;<samp class="samp">type</samp>&rsquo;
  21176. is set to <var class="var">freq</var>.
  21177. </p>
  21178. </dd>
  21179. <dt><samp class="option">normalize</samp></dt>
  21180. <dd><p>Should all IRs be normalized upon importing SOFA file.
  21181. By default is enabled.
  21182. </p>
  21183. </dd>
  21184. <dt><samp class="option">interpolate</samp></dt>
  21185. <dd><p>Should nearest IRs be interpolated with neighbor IRs if exact position
  21186. does not match. By default is disabled.
  21187. </p>
  21188. </dd>
  21189. <dt><samp class="option">minphase</samp></dt>
  21190. <dd><p>Minphase all IRs upon loading of SOFA file. By default is disabled.
  21191. </p>
  21192. </dd>
  21193. <dt><samp class="option">anglestep</samp></dt>
  21194. <dd><p>Set neighbor search angle step. Only used if option <var class="var">interpolate</var> is enabled.
  21195. </p>
  21196. </dd>
  21197. <dt><samp class="option">radstep</samp></dt>
  21198. <dd><p>Set neighbor search radius step. Only used if option <var class="var">interpolate</var> is enabled.
  21199. </p></dd>
  21200. </dl>
  21201. <a name="Examples-51"></a>
  21202. <h4 class="subsection">29.109.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-51" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-51" aria-hidden="true">TOC</a></span></h4>
  21203. <ul class="itemize mark-bullet">
  21204. <li>Using ClubFritz6 sofa file:
  21205. <div class="example">
  21206. <pre class="example-preformatted">sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
  21207. </pre></div>
  21208. </li><li>Using ClubFritz12 sofa file and bigger radius with small rotation:
  21209. <div class="example">
  21210. <pre class="example-preformatted">sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
  21211. </pre></div>
  21212. </li><li>Similar as above but with custom speaker positions for front left, front right, back left and back right
  21213. and also with custom gain:
  21214. <div class="example">
  21215. <pre class="example-preformatted">&quot;sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|BL 135|BR 225:gain=28&quot;
  21216. </pre></div>
  21217. </li></ul>
  21218. <a name="speechnorm"></a>
  21219. <h3 class="section">29.110 speechnorm<span class="pull-right"><a class="anchor hidden-xs" href="#speechnorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-speechnorm" aria-hidden="true">TOC</a></span></h3>
  21220. <p>Speech Normalizer.
  21221. </p>
  21222. <p>This filter expands or compresses each half-cycle of audio samples
  21223. (local set of samples all above or all below zero and between two nearest zero crossings) depending
  21224. on threshold value, so audio reaches target peak value under conditions controlled by below options.
  21225. </p>
  21226. <p>The filter accepts the following options:
  21227. </p>
  21228. <dl class="table">
  21229. <dt><samp class="option">peak, p</samp></dt>
  21230. <dd><p>Set the expansion target peak value. This specifies the highest allowed absolute amplitude
  21231. level for the normalized audio input. Default value is 0.95. Allowed range is from 0.0 to 1.0.
  21232. </p>
  21233. </dd>
  21234. <dt><samp class="option">expansion, e</samp></dt>
  21235. <dd><p>Set the maximum expansion factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  21236. This option controls maximum local half-cycle of samples expansion. The maximum expansion
  21237. would be such that local peak value reaches target peak value but never to surpass it and that
  21238. ratio between new and previous peak value does not surpass this option value.
  21239. </p>
  21240. </dd>
  21241. <dt><samp class="option">compression, c</samp></dt>
  21242. <dd><p>Set the maximum compression factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  21243. This option controls maximum local half-cycle of samples compression. This option is used
  21244. only if <samp class="option">threshold</samp> option is set to value greater than 0.0, then in such cases
  21245. when local peak is lower or same as value set by <samp class="option">threshold</samp> all samples belonging to
  21246. that peak&rsquo;s half-cycle will be compressed by current compression factor.
  21247. </p>
  21248. </dd>
  21249. <dt><samp class="option">threshold, t</samp></dt>
  21250. <dd><p>Set the threshold value. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  21251. This option specifies which half-cycles of samples will be compressed and which will be expanded.
  21252. Any half-cycle samples with their local peak value below or same as this option value will be
  21253. compressed by current compression factor, otherwise, if greater than threshold value they will be
  21254. expanded with expansion factor so that it could reach peak target value but never surpass it.
  21255. </p>
  21256. </dd>
  21257. <dt><samp class="option">raise, r</samp></dt>
  21258. <dd><p>Set the expansion raising amount per each half-cycle of samples. Default value is 0.001.
  21259. Allowed range is from 0.0 to 1.0. This controls how fast expansion factor is raised per
  21260. each new half-cycle until it reaches <samp class="option">expansion</samp> value.
  21261. Setting this options too high may lead to distortions.
  21262. </p>
  21263. </dd>
  21264. <dt><samp class="option">fall, f</samp></dt>
  21265. <dd><p>Set the compression raising amount per each half-cycle of samples. Default value is 0.001.
  21266. Allowed range is from 0.0 to 1.0. This controls how fast compression factor is raised per
  21267. each new half-cycle until it reaches <samp class="option">compression</samp> value.
  21268. </p>
  21269. </dd>
  21270. <dt><samp class="option">channels, h</samp></dt>
  21271. <dd><p>Specify which channels to filter, by default all available channels are filtered.
  21272. </p>
  21273. </dd>
  21274. <dt><samp class="option">invert, i</samp></dt>
  21275. <dd><p>Enable inverted filtering, by default is disabled. This inverts interpretation of <samp class="option">threshold</samp>
  21276. option. When enabled any half-cycle of samples with their local peak value below or same as
  21277. <samp class="option">threshold</samp> option will be expanded otherwise it will be compressed.
  21278. </p>
  21279. </dd>
  21280. <dt><samp class="option">link, l</samp></dt>
  21281. <dd><p>Link channels when calculating gain applied to each filtered channel sample, by default is disabled.
  21282. When disabled each filtered channel gain calculation is independent, otherwise when this option
  21283. is enabled the minimum of all possible gains for each filtered channel is used.
  21284. </p>
  21285. </dd>
  21286. <dt><samp class="option">rms, m</samp></dt>
  21287. <dd><p>Set the expansion target RMS value. This specifies the highest allowed RMS level for the normalized
  21288. audio input. Default value is 0.0, thus disabled. Allowed range is from 0.0 to 1.0.
  21289. </p></dd>
  21290. </dl>
  21291. <a name="Commands-48"></a>
  21292. <h4 class="subsection">29.110.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-48" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-48" aria-hidden="true">TOC</a></span></h4>
  21293. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  21294. </p>
  21295. <a name="Examples-52"></a>
  21296. <h4 class="subsection">29.110.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-52" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-52" aria-hidden="true">TOC</a></span></h4>
  21297. <ul class="itemize mark-bullet">
  21298. <li>Weak and slow amplification:
  21299. <div class="example">
  21300. <pre class="example-preformatted">speechnorm=e=3:r=0.00001:l=1
  21301. </pre></div>
  21302. </li><li>Moderate and slow amplification:
  21303. <div class="example">
  21304. <pre class="example-preformatted">speechnorm=e=6.25:r=0.00001:l=1
  21305. </pre></div>
  21306. </li><li>Strong and fast amplification:
  21307. <div class="example">
  21308. <pre class="example-preformatted">speechnorm=e=12.5:r=0.0001:l=1
  21309. </pre></div>
  21310. </li><li>Very strong and fast amplification:
  21311. <div class="example">
  21312. <pre class="example-preformatted">speechnorm=e=25:r=0.0001:l=1
  21313. </pre></div>
  21314. </li><li>Extreme and fast amplification:
  21315. <div class="example">
  21316. <pre class="example-preformatted">speechnorm=e=50:r=0.0001:l=1
  21317. </pre></div>
  21318. </li></ul>
  21319. <a name="stereotools"></a>
  21320. <h3 class="section">29.111 stereotools<span class="pull-right"><a class="anchor hidden-xs" href="#stereotools" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-stereotools" aria-hidden="true">TOC</a></span></h3>
  21321. <p>This filter has some handy utilities to manage stereo signals, for converting
  21322. M/S stereo recordings to L/R signal while having control over the parameters
  21323. or spreading the stereo image of master track.
  21324. </p>
  21325. <p>The filter accepts the following options:
  21326. </p>
  21327. <dl class="table">
  21328. <dt><samp class="option">level_in</samp></dt>
  21329. <dd><p>Set input level before filtering for both channels. Defaults is 1.
  21330. Allowed range is from 0.015625 to 64.
  21331. </p>
  21332. </dd>
  21333. <dt><samp class="option">level_out</samp></dt>
  21334. <dd><p>Set output level after filtering for both channels. Defaults is 1.
  21335. Allowed range is from 0.015625 to 64.
  21336. </p>
  21337. </dd>
  21338. <dt><samp class="option">balance_in</samp></dt>
  21339. <dd><p>Set input balance between both channels. Default is 0.
  21340. Allowed range is from -1 to 1.
  21341. </p>
  21342. </dd>
  21343. <dt><samp class="option">balance_out</samp></dt>
  21344. <dd><p>Set output balance between both channels. Default is 0.
  21345. Allowed range is from -1 to 1.
  21346. </p>
  21347. </dd>
  21348. <dt><samp class="option">softclip</samp></dt>
  21349. <dd><p>Enable softclipping. Results in analog distortion instead of harsh digital 0dB
  21350. clipping. Disabled by default.
  21351. </p>
  21352. </dd>
  21353. <dt><samp class="option">mutel</samp></dt>
  21354. <dd><p>Mute the left channel. Disabled by default.
  21355. </p>
  21356. </dd>
  21357. <dt><samp class="option">muter</samp></dt>
  21358. <dd><p>Mute the right channel. Disabled by default.
  21359. </p>
  21360. </dd>
  21361. <dt><samp class="option">phasel</samp></dt>
  21362. <dd><p>Change the phase of the left channel. Disabled by default.
  21363. </p>
  21364. </dd>
  21365. <dt><samp class="option">phaser</samp></dt>
  21366. <dd><p>Change the phase of the right channel. Disabled by default.
  21367. </p>
  21368. </dd>
  21369. <dt><samp class="option">mode</samp></dt>
  21370. <dd><p>Set stereo mode. Available values are:
  21371. </p>
  21372. <dl class="table">
  21373. <dt>&lsquo;<samp class="samp">lr&gt;lr</samp>&rsquo;</dt>
  21374. <dd><p>Left/Right to Left/Right, this is default.
  21375. </p>
  21376. </dd>
  21377. <dt>&lsquo;<samp class="samp">lr&gt;ms</samp>&rsquo;</dt>
  21378. <dd><p>Left/Right to Mid/Side.
  21379. </p>
  21380. </dd>
  21381. <dt>&lsquo;<samp class="samp">ms&gt;lr</samp>&rsquo;</dt>
  21382. <dd><p>Mid/Side to Left/Right.
  21383. </p>
  21384. </dd>
  21385. <dt>&lsquo;<samp class="samp">lr&gt;ll</samp>&rsquo;</dt>
  21386. <dd><p>Left/Right to Left/Left.
  21387. </p>
  21388. </dd>
  21389. <dt>&lsquo;<samp class="samp">lr&gt;rr</samp>&rsquo;</dt>
  21390. <dd><p>Left/Right to Right/Right.
  21391. </p>
  21392. </dd>
  21393. <dt>&lsquo;<samp class="samp">lr&gt;l+r</samp>&rsquo;</dt>
  21394. <dd><p>Left/Right to Left + Right.
  21395. </p>
  21396. </dd>
  21397. <dt>&lsquo;<samp class="samp">lr&gt;rl</samp>&rsquo;</dt>
  21398. <dd><p>Left/Right to Right/Left.
  21399. </p>
  21400. </dd>
  21401. <dt>&lsquo;<samp class="samp">ms&gt;ll</samp>&rsquo;</dt>
  21402. <dd><p>Mid/Side to Left/Left.
  21403. </p>
  21404. </dd>
  21405. <dt>&lsquo;<samp class="samp">ms&gt;rr</samp>&rsquo;</dt>
  21406. <dd><p>Mid/Side to Right/Right.
  21407. </p>
  21408. </dd>
  21409. <dt>&lsquo;<samp class="samp">ms&gt;rl</samp>&rsquo;</dt>
  21410. <dd><p>Mid/Side to Right/Left.
  21411. </p>
  21412. </dd>
  21413. <dt>&lsquo;<samp class="samp">lr&gt;l-r</samp>&rsquo;</dt>
  21414. <dd><p>Left/Right to Left - Right.
  21415. </p></dd>
  21416. </dl>
  21417. </dd>
  21418. <dt><samp class="option">slev</samp></dt>
  21419. <dd><p>Set level of side signal. Default is 1.
  21420. Allowed range is from 0.015625 to 64.
  21421. </p>
  21422. </dd>
  21423. <dt><samp class="option">sbal</samp></dt>
  21424. <dd><p>Set balance of side signal. Default is 0.
  21425. Allowed range is from -1 to 1.
  21426. </p>
  21427. </dd>
  21428. <dt><samp class="option">mlev</samp></dt>
  21429. <dd><p>Set level of the middle signal. Default is 1.
  21430. Allowed range is from 0.015625 to 64.
  21431. </p>
  21432. </dd>
  21433. <dt><samp class="option">mpan</samp></dt>
  21434. <dd><p>Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
  21435. </p>
  21436. </dd>
  21437. <dt><samp class="option">base</samp></dt>
  21438. <dd><p>Set stereo base between mono and inversed channels. Default is 0.
  21439. Allowed range is from -1 to 1.
  21440. </p>
  21441. </dd>
  21442. <dt><samp class="option">delay</samp></dt>
  21443. <dd><p>Set delay in milliseconds how much to delay left from right channel and
  21444. vice versa. Default is 0. Allowed range is from -20 to 20.
  21445. </p>
  21446. </dd>
  21447. <dt><samp class="option">sclevel</samp></dt>
  21448. <dd><p>Set S/C level. Default is 1. Allowed range is from 1 to 100.
  21449. </p>
  21450. </dd>
  21451. <dt><samp class="option">phase</samp></dt>
  21452. <dd><p>Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
  21453. </p>
  21454. </dd>
  21455. <dt><samp class="option">bmode_in, bmode_out</samp></dt>
  21456. <dd><p>Set balance mode for balance_in/balance_out option.
  21457. </p>
  21458. <p>Can be one of the following:
  21459. </p>
  21460. <dl class="table">
  21461. <dt>&lsquo;<samp class="samp">balance</samp>&rsquo;</dt>
  21462. <dd><p>Classic balance mode. Attenuate one channel at time.
  21463. Gain is raised up to 1.
  21464. </p>
  21465. </dd>
  21466. <dt>&lsquo;<samp class="samp">amplitude</samp>&rsquo;</dt>
  21467. <dd><p>Similar as classic mode above but gain is raised up to 2.
  21468. </p>
  21469. </dd>
  21470. <dt>&lsquo;<samp class="samp">power</samp>&rsquo;</dt>
  21471. <dd><p>Equal power distribution, from -6dB to +6dB range.
  21472. </p></dd>
  21473. </dl>
  21474. </dd>
  21475. </dl>
  21476. <a name="Commands-49"></a>
  21477. <h4 class="subsection">29.111.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-49" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-49" aria-hidden="true">TOC</a></span></h4>
  21478. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  21479. </p>
  21480. <a name="Examples-53"></a>
  21481. <h4 class="subsection">29.111.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-53" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-53" aria-hidden="true">TOC</a></span></h4>
  21482. <ul class="itemize mark-bullet">
  21483. <li>Apply karaoke like effect:
  21484. <div class="example">
  21485. <pre class="example-preformatted">stereotools=mlev=0.015625
  21486. </pre></div>
  21487. </li><li>Convert M/S signal to L/R:
  21488. <div class="example">
  21489. <pre class="example-preformatted">&quot;stereotools=mode=ms&gt;lr&quot;
  21490. </pre></div>
  21491. </li></ul>
  21492. <a name="stereowiden"></a>
  21493. <h3 class="section">29.112 stereowiden<span class="pull-right"><a class="anchor hidden-xs" href="#stereowiden" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-stereowiden" aria-hidden="true">TOC</a></span></h3>
  21494. <p>This filter enhance the stereo effect by suppressing signal common to both
  21495. channels and by delaying the signal of left into right and vice versa,
  21496. thereby widening the stereo effect.
  21497. </p>
  21498. <p>The filter accepts the following options:
  21499. </p>
  21500. <dl class="table">
  21501. <dt><samp class="option">delay</samp></dt>
  21502. <dd><p>Time in milliseconds of the delay of left signal into right and vice versa.
  21503. Default is 20 milliseconds.
  21504. </p>
  21505. </dd>
  21506. <dt><samp class="option">feedback</samp></dt>
  21507. <dd><p>Amount of gain in delayed signal into right and vice versa. Gives a delay
  21508. effect of left signal in right output and vice versa which gives widening
  21509. effect. Default is 0.3.
  21510. </p>
  21511. </dd>
  21512. <dt><samp class="option">crossfeed</samp></dt>
  21513. <dd><p>Cross feed of left into right with inverted phase. This helps in suppressing
  21514. the mono. If the value is 1 it will cancel all the signal common to both
  21515. channels. Default is 0.3.
  21516. </p>
  21517. </dd>
  21518. <dt><samp class="option">drymix</samp></dt>
  21519. <dd><p>Set level of input signal of original channel. Default is 0.8.
  21520. </p></dd>
  21521. </dl>
  21522. <a name="Commands-50"></a>
  21523. <h4 class="subsection">29.112.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-50" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-50" aria-hidden="true">TOC</a></span></h4>
  21524. <p>This filter supports the all above options except <code class="code">delay</code> as <a class="ref" href="#commands">commands</a>.
  21525. </p>
  21526. <a name="superequalizer"></a>
  21527. <h3 class="section">29.113 superequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#superequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-superequalizer" aria-hidden="true">TOC</a></span></h3>
  21528. <p>Apply 18 band equalizer.
  21529. </p>
  21530. <p>The filter accepts the following options:
  21531. </p><dl class="table">
  21532. <dt><samp class="option">1b</samp></dt>
  21533. <dd><p>Set 65Hz band gain.
  21534. </p></dd>
  21535. <dt><samp class="option">2b</samp></dt>
  21536. <dd><p>Set 92Hz band gain.
  21537. </p></dd>
  21538. <dt><samp class="option">3b</samp></dt>
  21539. <dd><p>Set 131Hz band gain.
  21540. </p></dd>
  21541. <dt><samp class="option">4b</samp></dt>
  21542. <dd><p>Set 185Hz band gain.
  21543. </p></dd>
  21544. <dt><samp class="option">5b</samp></dt>
  21545. <dd><p>Set 262Hz band gain.
  21546. </p></dd>
  21547. <dt><samp class="option">6b</samp></dt>
  21548. <dd><p>Set 370Hz band gain.
  21549. </p></dd>
  21550. <dt><samp class="option">7b</samp></dt>
  21551. <dd><p>Set 523Hz band gain.
  21552. </p></dd>
  21553. <dt><samp class="option">8b</samp></dt>
  21554. <dd><p>Set 740Hz band gain.
  21555. </p></dd>
  21556. <dt><samp class="option">9b</samp></dt>
  21557. <dd><p>Set 1047Hz band gain.
  21558. </p></dd>
  21559. <dt><samp class="option">10b</samp></dt>
  21560. <dd><p>Set 1480Hz band gain.
  21561. </p></dd>
  21562. <dt><samp class="option">11b</samp></dt>
  21563. <dd><p>Set 2093Hz band gain.
  21564. </p></dd>
  21565. <dt><samp class="option">12b</samp></dt>
  21566. <dd><p>Set 2960Hz band gain.
  21567. </p></dd>
  21568. <dt><samp class="option">13b</samp></dt>
  21569. <dd><p>Set 4186Hz band gain.
  21570. </p></dd>
  21571. <dt><samp class="option">14b</samp></dt>
  21572. <dd><p>Set 5920Hz band gain.
  21573. </p></dd>
  21574. <dt><samp class="option">15b</samp></dt>
  21575. <dd><p>Set 8372Hz band gain.
  21576. </p></dd>
  21577. <dt><samp class="option">16b</samp></dt>
  21578. <dd><p>Set 11840Hz band gain.
  21579. </p></dd>
  21580. <dt><samp class="option">17b</samp></dt>
  21581. <dd><p>Set 16744Hz band gain.
  21582. </p></dd>
  21583. <dt><samp class="option">18b</samp></dt>
  21584. <dd><p>Set 20000Hz band gain.
  21585. </p></dd>
  21586. </dl>
  21587. <a name="surround"></a>
  21588. <h3 class="section">29.114 surround<span class="pull-right"><a class="anchor hidden-xs" href="#surround" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-surround" aria-hidden="true">TOC</a></span></h3>
  21589. <p>Apply audio surround upmix filter.
  21590. </p>
  21591. <p>This filter allows to produce multichannel output from audio stream.
  21592. </p>
  21593. <p>The filter accepts the following options:
  21594. </p>
  21595. <dl class="table">
  21596. <dt><samp class="option">chl_out</samp></dt>
  21597. <dd><p>Set output channel layout. By default, this is <var class="var">5.1</var>.
  21598. </p>
  21599. <p>See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#channel-layout-syntax">the Channel Layout section in the ffmpeg-utils(1) manual</a>
  21600. for the required syntax.
  21601. </p>
  21602. </dd>
  21603. <dt><samp class="option">chl_in</samp></dt>
  21604. <dd><p>Set input channel layout. By default, this is <var class="var">stereo</var>.
  21605. </p>
  21606. <p>See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#channel-layout-syntax">the Channel Layout section in the ffmpeg-utils(1) manual</a>
  21607. for the required syntax.
  21608. </p>
  21609. </dd>
  21610. <dt><samp class="option">level_in</samp></dt>
  21611. <dd><p>Set input volume level. By default, this is <var class="var">1</var>.
  21612. </p>
  21613. </dd>
  21614. <dt><samp class="option">level_out</samp></dt>
  21615. <dd><p>Set output volume level. By default, this is <var class="var">1</var>.
  21616. </p>
  21617. </dd>
  21618. <dt><samp class="option">lfe</samp></dt>
  21619. <dd><p>Enable LFE channel output if output channel layout has it. By default, this is enabled.
  21620. </p>
  21621. </dd>
  21622. <dt><samp class="option">lfe_low</samp></dt>
  21623. <dd><p>Set LFE low cut off frequency. By default, this is <var class="var">128</var> Hz.
  21624. </p>
  21625. </dd>
  21626. <dt><samp class="option">lfe_high</samp></dt>
  21627. <dd><p>Set LFE high cut off frequency. By default, this is <var class="var">256</var> Hz.
  21628. </p>
  21629. </dd>
  21630. <dt><samp class="option">lfe_mode</samp></dt>
  21631. <dd><p>Set LFE mode, can be <var class="var">add</var> or <var class="var">sub</var>. Default is <var class="var">add</var>.
  21632. In <var class="var">add</var> mode, LFE channel is created from input audio and added to output.
  21633. In <var class="var">sub</var> mode, LFE channel is created from input audio and added to output but
  21634. also all non-LFE output channels are subtracted with output LFE channel.
  21635. </p>
  21636. </dd>
  21637. <dt><samp class="option">smooth</samp></dt>
  21638. <dd><p>Set temporal smoothness strength, used to gradually change factors when transforming
  21639. stereo sound in time. Allowed range is from <var class="var">0.0</var> to <var class="var">1.0</var>.
  21640. Useful to improve output quality with <var class="var">focus</var> option values greater than <var class="var">0.0</var>.
  21641. Default is <var class="var">0.0</var>. Only values inside this range and without edges are effective.
  21642. </p>
  21643. </dd>
  21644. <dt><samp class="option">angle</samp></dt>
  21645. <dd><p>Set angle of stereo surround transform, Allowed range is from <var class="var">0</var> to <var class="var">360</var>.
  21646. Default is <var class="var">90</var>.
  21647. </p>
  21648. </dd>
  21649. <dt><samp class="option">focus</samp></dt>
  21650. <dd><p>Set focus of stereo surround transform, Allowed range is from <var class="var">-1</var> to <var class="var">1</var>.
  21651. Default is <var class="var">0</var>.
  21652. </p>
  21653. </dd>
  21654. <dt><samp class="option">fc_in</samp></dt>
  21655. <dd><p>Set front center input volume. By default, this is <var class="var">1</var>.
  21656. </p>
  21657. </dd>
  21658. <dt><samp class="option">fc_out</samp></dt>
  21659. <dd><p>Set front center output volume. By default, this is <var class="var">1</var>.
  21660. </p>
  21661. </dd>
  21662. <dt><samp class="option">fl_in</samp></dt>
  21663. <dd><p>Set front left input volume. By default, this is <var class="var">1</var>.
  21664. </p>
  21665. </dd>
  21666. <dt><samp class="option">fl_out</samp></dt>
  21667. <dd><p>Set front left output volume. By default, this is <var class="var">1</var>.
  21668. </p>
  21669. </dd>
  21670. <dt><samp class="option">fr_in</samp></dt>
  21671. <dd><p>Set front right input volume. By default, this is <var class="var">1</var>.
  21672. </p>
  21673. </dd>
  21674. <dt><samp class="option">fr_out</samp></dt>
  21675. <dd><p>Set front right output volume. By default, this is <var class="var">1</var>.
  21676. </p>
  21677. </dd>
  21678. <dt><samp class="option">sl_in</samp></dt>
  21679. <dd><p>Set side left input volume. By default, this is <var class="var">1</var>.
  21680. </p>
  21681. </dd>
  21682. <dt><samp class="option">sl_out</samp></dt>
  21683. <dd><p>Set side left output volume. By default, this is <var class="var">1</var>.
  21684. </p>
  21685. </dd>
  21686. <dt><samp class="option">sr_in</samp></dt>
  21687. <dd><p>Set side right input volume. By default, this is <var class="var">1</var>.
  21688. </p>
  21689. </dd>
  21690. <dt><samp class="option">sr_out</samp></dt>
  21691. <dd><p>Set side right output volume. By default, this is <var class="var">1</var>.
  21692. </p>
  21693. </dd>
  21694. <dt><samp class="option">bl_in</samp></dt>
  21695. <dd><p>Set back left input volume. By default, this is <var class="var">1</var>.
  21696. </p>
  21697. </dd>
  21698. <dt><samp class="option">bl_out</samp></dt>
  21699. <dd><p>Set back left output volume. By default, this is <var class="var">1</var>.
  21700. </p>
  21701. </dd>
  21702. <dt><samp class="option">br_in</samp></dt>
  21703. <dd><p>Set back right input volume. By default, this is <var class="var">1</var>.
  21704. </p>
  21705. </dd>
  21706. <dt><samp class="option">br_out</samp></dt>
  21707. <dd><p>Set back right output volume. By default, this is <var class="var">1</var>.
  21708. </p>
  21709. </dd>
  21710. <dt><samp class="option">bc_in</samp></dt>
  21711. <dd><p>Set back center input volume. By default, this is <var class="var">1</var>.
  21712. </p>
  21713. </dd>
  21714. <dt><samp class="option">bc_out</samp></dt>
  21715. <dd><p>Set back center output volume. By default, this is <var class="var">1</var>.
  21716. </p>
  21717. </dd>
  21718. <dt><samp class="option">lfe_in</samp></dt>
  21719. <dd><p>Set LFE input volume. By default, this is <var class="var">1</var>.
  21720. </p>
  21721. </dd>
  21722. <dt><samp class="option">lfe_out</samp></dt>
  21723. <dd><p>Set LFE output volume. By default, this is <var class="var">1</var>.
  21724. </p>
  21725. </dd>
  21726. <dt><samp class="option">allx</samp></dt>
  21727. <dd><p>Set spread usage of stereo image across X axis for all channels.
  21728. Allowed range is from <var class="var">-1</var> to <var class="var">15</var>.
  21729. By default this value is negative <var class="var">-1</var>, and thus unused.
  21730. </p>
  21731. </dd>
  21732. <dt><samp class="option">ally</samp></dt>
  21733. <dd><p>Set spread usage of stereo image across Y axis for all channels.
  21734. Allowed range is from <var class="var">-1</var> to <var class="var">15</var>.
  21735. By default this value is negative <var class="var">-1</var>, and thus unused.
  21736. </p>
  21737. </dd>
  21738. <dt><samp class="option">fcx, flx, frx, blx, brx, slx, srx, bcx</samp></dt>
  21739. <dd><p>Set spread usage of stereo image across X axis for each channel.
  21740. Allowed range is from <var class="var">0.06</var> to <var class="var">15</var>.
  21741. By default this value is <var class="var">0.5</var>.
  21742. </p>
  21743. </dd>
  21744. <dt><samp class="option">fcy, fly, fry, bly, bry, sly, sry, bcy</samp></dt>
  21745. <dd><p>Set spread usage of stereo image across Y axis for each channel.
  21746. Allowed range is from <var class="var">0.06</var> to <var class="var">15</var>.
  21747. By default this value is <var class="var">0.5</var>.
  21748. </p>
  21749. </dd>
  21750. <dt><samp class="option">win_size</samp></dt>
  21751. <dd><p>Set window size. Allowed range is from <var class="var">1024</var> to <var class="var">65536</var>. Default size is <var class="var">4096</var>.
  21752. </p>
  21753. </dd>
  21754. <dt><samp class="option">win_func</samp></dt>
  21755. <dd><p>Set window function.
  21756. </p>
  21757. <p>It accepts the following values:
  21758. </p><dl class="table">
  21759. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  21760. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  21761. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  21762. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  21763. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  21764. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  21765. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  21766. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  21767. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  21768. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  21769. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  21770. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  21771. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  21772. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  21773. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  21774. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  21775. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  21776. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  21777. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  21778. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  21779. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  21780. </dl>
  21781. <p>Default is <code class="code">hann</code>.
  21782. </p>
  21783. </dd>
  21784. <dt><samp class="option">overlap</samp></dt>
  21785. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  21786. window function will be picked. Default is <code class="code">0.5</code>.
  21787. </p></dd>
  21788. </dl>
  21789. <a name="tiltshelf"></a>
  21790. <h3 class="section">29.115 tiltshelf<span class="pull-right"><a class="anchor hidden-xs" href="#tiltshelf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tiltshelf" aria-hidden="true">TOC</a></span></h3>
  21791. <p>Boost or cut the lower frequencies and cut or boost higher frequencies
  21792. of the audio using a two-pole shelving filter with a response similar to
  21793. that of a standard hi-fi&rsquo;s tone-controls.
  21794. This is also known as shelving equalisation (EQ).
  21795. </p>
  21796. <p>The filter accepts the following options:
  21797. </p>
  21798. <dl class="table">
  21799. <dt><samp class="option">gain, g</samp></dt>
  21800. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  21801. (for a large cut) to +20 (for a large boost).
  21802. Beware of clipping when using a positive gain.
  21803. </p>
  21804. </dd>
  21805. <dt><samp class="option">frequency, f</samp></dt>
  21806. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  21807. to extend or reduce the frequency range to be boosted or cut.
  21808. The default value is <code class="code">3000</code> Hz.
  21809. </p>
  21810. </dd>
  21811. <dt><samp class="option">width_type, t</samp></dt>
  21812. <dd><p>Set method to specify band-width of filter.
  21813. </p><dl class="table">
  21814. <dt><samp class="option">h</samp></dt>
  21815. <dd><p>Hz
  21816. </p></dd>
  21817. <dt><samp class="option">q</samp></dt>
  21818. <dd><p>Q-Factor
  21819. </p></dd>
  21820. <dt><samp class="option">o</samp></dt>
  21821. <dd><p>octave
  21822. </p></dd>
  21823. <dt><samp class="option">s</samp></dt>
  21824. <dd><p>slope
  21825. </p></dd>
  21826. <dt><samp class="option">k</samp></dt>
  21827. <dd><p>kHz
  21828. </p></dd>
  21829. </dl>
  21830. </dd>
  21831. <dt><samp class="option">width, w</samp></dt>
  21832. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  21833. </p>
  21834. </dd>
  21835. <dt><samp class="option">poles, p</samp></dt>
  21836. <dd><p>Set number of poles. Default is 2.
  21837. </p>
  21838. </dd>
  21839. <dt><samp class="option">mix, m</samp></dt>
  21840. <dd><p>How much to use filtered signal in output. Default is 1.
  21841. Range is between 0 and 1.
  21842. </p>
  21843. </dd>
  21844. <dt><samp class="option">channels, c</samp></dt>
  21845. <dd><p>Specify which channels to filter, by default all available are filtered.
  21846. </p>
  21847. </dd>
  21848. <dt><samp class="option">normalize, n</samp></dt>
  21849. <dd><p>Normalize biquad coefficients, by default is disabled.
  21850. Enabling it will normalize magnitude response at DC to 0dB.
  21851. </p>
  21852. </dd>
  21853. <dt><samp class="option">transform, a</samp></dt>
  21854. <dd><p>Set transform type of IIR filter.
  21855. </p><dl class="table">
  21856. <dt><samp class="option">di</samp></dt>
  21857. <dt><samp class="option">dii</samp></dt>
  21858. <dt><samp class="option">tdi</samp></dt>
  21859. <dt><samp class="option">tdii</samp></dt>
  21860. <dt><samp class="option">latt</samp></dt>
  21861. <dt><samp class="option">svf</samp></dt>
  21862. <dt><samp class="option">zdf</samp></dt>
  21863. </dl>
  21864. </dd>
  21865. <dt><samp class="option">precision, r</samp></dt>
  21866. <dd><p>Set precision of filtering.
  21867. </p><dl class="table">
  21868. <dt><samp class="option">auto</samp></dt>
  21869. <dd><p>Pick automatic sample format depending on surround filters.
  21870. </p></dd>
  21871. <dt><samp class="option">s16</samp></dt>
  21872. <dd><p>Always use signed 16-bit.
  21873. </p></dd>
  21874. <dt><samp class="option">s32</samp></dt>
  21875. <dd><p>Always use signed 32-bit.
  21876. </p></dd>
  21877. <dt><samp class="option">f32</samp></dt>
  21878. <dd><p>Always use float 32-bit.
  21879. </p></dd>
  21880. <dt><samp class="option">f64</samp></dt>
  21881. <dd><p>Always use float 64-bit.
  21882. </p></dd>
  21883. </dl>
  21884. </dd>
  21885. <dt><samp class="option">block_size, b</samp></dt>
  21886. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  21887. value (higher than impulse response length truncated when reaches near zero values) filtering
  21888. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  21889. </p>
  21890. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  21891. </p></dd>
  21892. </dl>
  21893. <a name="Commands-51"></a>
  21894. <h4 class="subsection">29.115.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-51" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-51" aria-hidden="true">TOC</a></span></h4>
  21895. <p>This filter supports some options as <a class="ref" href="#commands">commands</a>.
  21896. </p>
  21897. <a name="treble_002c-highshelf"></a>
  21898. <h3 class="section">29.116 treble, highshelf<span class="pull-right"><a class="anchor hidden-xs" href="#treble_002c-highshelf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-treble_002c-highshelf" aria-hidden="true">TOC</a></span></h3>
  21899. <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
  21900. shelving filter with a response similar to that of a standard
  21901. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  21902. </p>
  21903. <p>The filter accepts the following options:
  21904. </p>
  21905. <dl class="table">
  21906. <dt><samp class="option">gain, g</samp></dt>
  21907. <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
  21908. Nyquist frequency. Its useful range is about -20 (for a large cut)
  21909. to +20 (for a large boost). Beware of clipping when using a positive gain.
  21910. </p>
  21911. </dd>
  21912. <dt><samp class="option">frequency, f</samp></dt>
  21913. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  21914. to extend or reduce the frequency range to be boosted or cut.
  21915. The default value is <code class="code">3000</code> Hz.
  21916. </p>
  21917. </dd>
  21918. <dt><samp class="option">width_type, t</samp></dt>
  21919. <dd><p>Set method to specify band-width of filter.
  21920. </p><dl class="table">
  21921. <dt><samp class="option">h</samp></dt>
  21922. <dd><p>Hz
  21923. </p></dd>
  21924. <dt><samp class="option">q</samp></dt>
  21925. <dd><p>Q-Factor
  21926. </p></dd>
  21927. <dt><samp class="option">o</samp></dt>
  21928. <dd><p>octave
  21929. </p></dd>
  21930. <dt><samp class="option">s</samp></dt>
  21931. <dd><p>slope
  21932. </p></dd>
  21933. <dt><samp class="option">k</samp></dt>
  21934. <dd><p>kHz
  21935. </p></dd>
  21936. </dl>
  21937. </dd>
  21938. <dt><samp class="option">width, w</samp></dt>
  21939. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  21940. </p>
  21941. </dd>
  21942. <dt><samp class="option">poles, p</samp></dt>
  21943. <dd><p>Set number of poles. Default is 2.
  21944. </p>
  21945. </dd>
  21946. <dt><samp class="option">mix, m</samp></dt>
  21947. <dd><p>How much to use filtered signal in output. Default is 1.
  21948. Range is between 0 and 1.
  21949. </p>
  21950. </dd>
  21951. <dt><samp class="option">channels, c</samp></dt>
  21952. <dd><p>Specify which channels to filter, by default all available are filtered.
  21953. </p>
  21954. </dd>
  21955. <dt><samp class="option">normalize, n</samp></dt>
  21956. <dd><p>Normalize biquad coefficients, by default is disabled.
  21957. Enabling it will normalize magnitude response at DC to 0dB.
  21958. </p>
  21959. </dd>
  21960. <dt><samp class="option">transform, a</samp></dt>
  21961. <dd><p>Set transform type of IIR filter.
  21962. </p><dl class="table">
  21963. <dt><samp class="option">di</samp></dt>
  21964. <dt><samp class="option">dii</samp></dt>
  21965. <dt><samp class="option">tdi</samp></dt>
  21966. <dt><samp class="option">tdii</samp></dt>
  21967. <dt><samp class="option">latt</samp></dt>
  21968. <dt><samp class="option">svf</samp></dt>
  21969. <dt><samp class="option">zdf</samp></dt>
  21970. </dl>
  21971. </dd>
  21972. <dt><samp class="option">precision, r</samp></dt>
  21973. <dd><p>Set precision of filtering.
  21974. </p><dl class="table">
  21975. <dt><samp class="option">auto</samp></dt>
  21976. <dd><p>Pick automatic sample format depending on surround filters.
  21977. </p></dd>
  21978. <dt><samp class="option">s16</samp></dt>
  21979. <dd><p>Always use signed 16-bit.
  21980. </p></dd>
  21981. <dt><samp class="option">s32</samp></dt>
  21982. <dd><p>Always use signed 32-bit.
  21983. </p></dd>
  21984. <dt><samp class="option">f32</samp></dt>
  21985. <dd><p>Always use float 32-bit.
  21986. </p></dd>
  21987. <dt><samp class="option">f64</samp></dt>
  21988. <dd><p>Always use float 64-bit.
  21989. </p></dd>
  21990. </dl>
  21991. </dd>
  21992. <dt><samp class="option">block_size, b</samp></dt>
  21993. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  21994. value (higher than impulse response length truncated when reaches near zero values) filtering
  21995. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  21996. </p>
  21997. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  21998. </p></dd>
  21999. </dl>
  22000. <a name="Commands-52"></a>
  22001. <h4 class="subsection">29.116.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-52" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-52" aria-hidden="true">TOC</a></span></h4>
  22002. <p>This filter supports the following commands:
  22003. </p><dl class="table">
  22004. <dt><samp class="option">frequency, f</samp></dt>
  22005. <dd><p>Change treble frequency.
  22006. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  22007. </p>
  22008. </dd>
  22009. <dt><samp class="option">width_type, t</samp></dt>
  22010. <dd><p>Change treble width_type.
  22011. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  22012. </p>
  22013. </dd>
  22014. <dt><samp class="option">width, w</samp></dt>
  22015. <dd><p>Change treble width.
  22016. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  22017. </p>
  22018. </dd>
  22019. <dt><samp class="option">gain, g</samp></dt>
  22020. <dd><p>Change treble gain.
  22021. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  22022. </p>
  22023. </dd>
  22024. <dt><samp class="option">mix, m</samp></dt>
  22025. <dd><p>Change treble mix.
  22026. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  22027. </p></dd>
  22028. </dl>
  22029. <a name="tremolo"></a>
  22030. <h3 class="section">29.117 tremolo<span class="pull-right"><a class="anchor hidden-xs" href="#tremolo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tremolo" aria-hidden="true">TOC</a></span></h3>
  22031. <p>Sinusoidal amplitude modulation.
  22032. </p>
  22033. <p>The filter accepts the following options:
  22034. </p>
  22035. <dl class="table">
  22036. <dt><samp class="option">f</samp></dt>
  22037. <dd><p>Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
  22038. (20 Hz or lower) will result in a tremolo effect.
  22039. This filter may also be used as a ring modulator by specifying
  22040. a modulation frequency higher than 20 Hz.
  22041. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  22042. </p>
  22043. </dd>
  22044. <dt><samp class="option">d</samp></dt>
  22045. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  22046. Default value is 0.5.
  22047. </p></dd>
  22048. </dl>
  22049. <a name="vibrato"></a>
  22050. <h3 class="section">29.118 vibrato<span class="pull-right"><a class="anchor hidden-xs" href="#vibrato" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vibrato" aria-hidden="true">TOC</a></span></h3>
  22051. <p>Sinusoidal phase modulation.
  22052. </p>
  22053. <p>The filter accepts the following options:
  22054. </p>
  22055. <dl class="table">
  22056. <dt><samp class="option">f</samp></dt>
  22057. <dd><p>Modulation frequency in Hertz.
  22058. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  22059. </p>
  22060. </dd>
  22061. <dt><samp class="option">d</samp></dt>
  22062. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  22063. Default value is 0.5.
  22064. </p></dd>
  22065. </dl>
  22066. <a name="virtualbass"></a>
  22067. <h3 class="section">29.119 virtualbass<span class="pull-right"><a class="anchor hidden-xs" href="#virtualbass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-virtualbass" aria-hidden="true">TOC</a></span></h3>
  22068. <p>Apply audio Virtual Bass filter.
  22069. </p>
  22070. <p>This filter accepts stereo input and produce stereo with LFE (2.1) channels output.
  22071. The newly produced LFE channel have enhanced virtual bass originally obtained from both stereo channels.
  22072. This filter outputs front left and front right channels unchanged as available in stereo input.
  22073. </p>
  22074. <p>The filter accepts the following options:
  22075. </p>
  22076. <dl class="table">
  22077. <dt><samp class="option">cutoff</samp></dt>
  22078. <dd><p>Set the virtual bass cutoff frequency. Default value is 250 Hz.
  22079. Allowed range is from 100 to 500 Hz.
  22080. </p>
  22081. </dd>
  22082. <dt><samp class="option">strength</samp></dt>
  22083. <dd><p>Set the virtual bass strength. Allowed range is from 0.5 to 3.
  22084. Default value is 3.
  22085. </p></dd>
  22086. </dl>
  22087. <a name="volume"></a>
  22088. <h3 class="section">29.120 volume<span class="pull-right"><a class="anchor hidden-xs" href="#volume" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-volume" aria-hidden="true">TOC</a></span></h3>
  22089. <p>Adjust the input audio volume.
  22090. </p>
  22091. <p>It accepts the following parameters:
  22092. </p><dl class="table">
  22093. <dt><samp class="option">volume</samp></dt>
  22094. <dd><p>Set audio volume expression.
  22095. </p>
  22096. <p>Output values are clipped to the maximum value.
  22097. </p>
  22098. <p>The output audio volume is given by the relation:
  22099. </p><div class="example">
  22100. <pre class="example-preformatted"><var class="var">output_volume</var> = <var class="var">volume</var> * <var class="var">input_volume</var>
  22101. </pre></div>
  22102. <p>The default value for <var class="var">volume</var> is &quot;1.0&quot;.
  22103. </p>
  22104. </dd>
  22105. <dt><samp class="option">precision</samp></dt>
  22106. <dd><p>This parameter represents the mathematical precision.
  22107. </p>
  22108. <p>It determines which input sample formats will be allowed, which affects the
  22109. precision of the volume scaling.
  22110. </p>
  22111. <dl class="table">
  22112. <dt><samp class="option">fixed</samp></dt>
  22113. <dd><p>8-bit fixed-point; this limits input sample format to U8, S16, and S32.
  22114. </p></dd>
  22115. <dt><samp class="option">float</samp></dt>
  22116. <dd><p>32-bit floating-point; this limits input sample format to FLT. (default)
  22117. </p></dd>
  22118. <dt><samp class="option">double</samp></dt>
  22119. <dd><p>64-bit floating-point; this limits input sample format to DBL.
  22120. </p></dd>
  22121. </dl>
  22122. </dd>
  22123. <dt><samp class="option">replaygain</samp></dt>
  22124. <dd><p>Choose the behaviour on encountering ReplayGain side data in input frames.
  22125. </p>
  22126. <dl class="table">
  22127. <dt><samp class="option">drop</samp></dt>
  22128. <dd><p>Remove ReplayGain side data, ignoring its contents (the default).
  22129. </p>
  22130. </dd>
  22131. <dt><samp class="option">ignore</samp></dt>
  22132. <dd><p>Ignore ReplayGain side data, but leave it in the frame.
  22133. </p>
  22134. </dd>
  22135. <dt><samp class="option">track</samp></dt>
  22136. <dd><p>Prefer the track gain, if present.
  22137. </p>
  22138. </dd>
  22139. <dt><samp class="option">album</samp></dt>
  22140. <dd><p>Prefer the album gain, if present.
  22141. </p></dd>
  22142. </dl>
  22143. </dd>
  22144. <dt><samp class="option">replaygain_preamp</samp></dt>
  22145. <dd><p>Pre-amplification gain in dB to apply to the selected replaygain gain.
  22146. </p>
  22147. <p>Default value for <var class="var">replaygain_preamp</var> is 0.0.
  22148. </p>
  22149. </dd>
  22150. <dt><samp class="option">replaygain_noclip</samp></dt>
  22151. <dd><p>Prevent clipping by limiting the gain applied.
  22152. </p>
  22153. <p>Default value for <var class="var">replaygain_noclip</var> is 1.
  22154. </p>
  22155. </dd>
  22156. <dt><samp class="option">eval</samp></dt>
  22157. <dd><p>Set when the volume expression is evaluated.
  22158. </p>
  22159. <p>It accepts the following values:
  22160. </p><dl class="table">
  22161. <dt>&lsquo;<samp class="samp">once</samp>&rsquo;</dt>
  22162. <dd><p>only evaluate expression once during the filter initialization, or
  22163. when the &lsquo;<samp class="samp">volume</samp>&rsquo; command is sent
  22164. </p>
  22165. </dd>
  22166. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  22167. <dd><p>evaluate expression for each incoming frame
  22168. </p></dd>
  22169. </dl>
  22170. <p>Default value is &lsquo;<samp class="samp">once</samp>&rsquo;.
  22171. </p></dd>
  22172. </dl>
  22173. <p>The volume expression can contain the following parameters.
  22174. </p>
  22175. <dl class="table">
  22176. <dt><samp class="option">n</samp></dt>
  22177. <dd><p>frame number (starting at zero)
  22178. </p></dd>
  22179. <dt><samp class="option">nb_channels</samp></dt>
  22180. <dd><p>number of channels
  22181. </p></dd>
  22182. <dt><samp class="option">nb_consumed_samples</samp></dt>
  22183. <dd><p>number of samples consumed by the filter
  22184. </p></dd>
  22185. <dt><samp class="option">nb_samples</samp></dt>
  22186. <dd><p>number of samples in the current frame
  22187. </p></dd>
  22188. <dt><samp class="option">pos</samp></dt>
  22189. <dd><p>original frame position in the file; deprecated, do not use
  22190. </p></dd>
  22191. <dt><samp class="option">pts</samp></dt>
  22192. <dd><p>frame PTS
  22193. </p></dd>
  22194. <dt><samp class="option">sample_rate</samp></dt>
  22195. <dd><p>sample rate
  22196. </p></dd>
  22197. <dt><samp class="option">startpts</samp></dt>
  22198. <dd><p>PTS at start of stream
  22199. </p></dd>
  22200. <dt><samp class="option">startt</samp></dt>
  22201. <dd><p>time at start of stream
  22202. </p></dd>
  22203. <dt><samp class="option">t</samp></dt>
  22204. <dd><p>frame time
  22205. </p></dd>
  22206. <dt><samp class="option">tb</samp></dt>
  22207. <dd><p>timestamp timebase
  22208. </p></dd>
  22209. <dt><samp class="option">volume</samp></dt>
  22210. <dd><p>last set volume value
  22211. </p></dd>
  22212. </dl>
  22213. <p>Note that when <samp class="option">eval</samp> is set to &lsquo;<samp class="samp">once</samp>&rsquo; only the
  22214. <var class="var">sample_rate</var> and <var class="var">tb</var> variables are available, all other
  22215. variables will evaluate to NAN.
  22216. </p>
  22217. <a name="Commands-53"></a>
  22218. <h4 class="subsection">29.120.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-53" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-53" aria-hidden="true">TOC</a></span></h4>
  22219. <p>This filter supports the following commands:
  22220. </p><dl class="table">
  22221. <dt><samp class="option">volume</samp></dt>
  22222. <dd><p>Modify the volume expression.
  22223. The command accepts the same syntax of the corresponding option.
  22224. </p>
  22225. <p>If the specified expression is not valid, it is kept at its current
  22226. value.
  22227. </p></dd>
  22228. </dl>
  22229. <a name="Examples-54"></a>
  22230. <h4 class="subsection">29.120.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-54" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-54" aria-hidden="true">TOC</a></span></h4>
  22231. <ul class="itemize mark-bullet">
  22232. <li>Halve the input audio volume:
  22233. <div class="example">
  22234. <pre class="example-preformatted">volume=volume=0.5
  22235. volume=volume=1/2
  22236. volume=volume=-6.0206dB
  22237. </pre></div>
  22238. <p>In all the above example the named key for <samp class="option">volume</samp> can be
  22239. omitted, for example like in:
  22240. </p><div class="example">
  22241. <pre class="example-preformatted">volume=0.5
  22242. </pre></div>
  22243. </li><li>Increase input audio power by 6 decibels using fixed-point precision:
  22244. <div class="example">
  22245. <pre class="example-preformatted">volume=volume=6dB:precision=fixed
  22246. </pre></div>
  22247. </li><li>Fade volume after time 10 with an annihilation period of 5 seconds:
  22248. <div class="example">
  22249. <pre class="example-preformatted">volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
  22250. </pre></div>
  22251. </li></ul>
  22252. <a name="volumedetect"></a>
  22253. <h3 class="section">29.121 volumedetect<span class="pull-right"><a class="anchor hidden-xs" href="#volumedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-volumedetect" aria-hidden="true">TOC</a></span></h3>
  22254. <p>Detect the volume of the input video.
  22255. </p>
  22256. <p>The filter has no parameters. It supports only 16-bit signed integer samples,
  22257. so the input will be converted when needed. Statistics about the volume will
  22258. be printed in the log when the input stream end is reached.
  22259. </p>
  22260. <p>In particular it will show the mean volume (root mean square), maximum
  22261. volume (on a per-sample basis), and the beginning of a histogram of the
  22262. registered volume values (from the maximum value to a cumulated 1/1000 of
  22263. the samples).
  22264. </p>
  22265. <p>All volumes are in decibels relative to the maximum PCM value.
  22266. </p>
  22267. <a name="Examples-55"></a>
  22268. <h4 class="subsection">29.121.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-55" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-55" aria-hidden="true">TOC</a></span></h4>
  22269. <p>Here is an excerpt of the output:
  22270. </p><div class="example">
  22271. <pre class="example-preformatted">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
  22272. [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
  22273. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
  22274. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
  22275. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
  22276. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
  22277. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
  22278. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
  22279. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
  22280. </pre></div>
  22281. <p>It means that:
  22282. </p><ul class="itemize mark-bullet">
  22283. <li>The mean square energy is approximately -27 dB, or 10^-2.7.
  22284. </li><li>The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
  22285. </li><li>There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
  22286. </li></ul>
  22287. <p>In other words, raising the volume by +4 dB does not cause any clipping,
  22288. raising it by +5 dB causes clipping for 6 samples, etc.
  22289. </p>
  22290. <a class="anchor" id="whisper"></a><a name="whisper-1"></a>
  22291. <h3 class="section">29.122 whisper<span class="pull-right"><a class="anchor hidden-xs" href="#whisper-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-whisper-1" aria-hidden="true">TOC</a></span></h3>
  22292. <p>It runs automatic speech recognition using the OpenAI&rsquo;s Whisper model.
  22293. </p>
  22294. <p>It requires the whisper.cpp library (https://github.com/ggml-org/whisper.cpp)
  22295. as a prerequisite. After installing the library it can be enabled using:
  22296. <code class="code">./configure --enable-whisper</code>.
  22297. </p>
  22298. <p>The filter has following options:
  22299. </p>
  22300. <dl class="table">
  22301. <dt><samp class="option">model</samp></dt>
  22302. <dd><p>The file path of the downloaded whisper.cpp model (mandatory).
  22303. </p>
  22304. </dd>
  22305. <dt><samp class="option">language</samp></dt>
  22306. <dd><p>The language to use for transcription (&rsquo;auto&rsquo; for auto-detect).
  22307. Default value: <code class="code">&quot;auto&quot;</code>
  22308. </p>
  22309. </dd>
  22310. <dt><samp class="option">queue</samp></dt>
  22311. <dd><p>The maximum size that will be queued into the filter before processing the audio
  22312. with whisper. Using a small value the audio stream will be processed more often,
  22313. but the transcription quality will be lower and the required processing power
  22314. will be higher. Using a large value (e.g. 10-20s) will produce more accurate
  22315. results using less CPU (as using the whisper-cli tool), but the transcription
  22316. latency will be higher, thus not useful to process real-time streams.
  22317. Consider using the vad_model option associated with a large queue value.
  22318. Default value: <code class="code">&quot;3&quot;</code>
  22319. </p>
  22320. </dd>
  22321. <dt><samp class="option">use_gpu</samp></dt>
  22322. <dd><p>If the GPU support should be enabled.
  22323. Default value: <code class="code">&quot;true&quot;</code>
  22324. </p>
  22325. </dd>
  22326. <dt><samp class="option">gpu_device</samp></dt>
  22327. <dd><p>The GPU device index to use.
  22328. Default value: <code class="code">&quot;0&quot;</code>
  22329. </p>
  22330. </dd>
  22331. <dt><samp class="option">destination</samp></dt>
  22332. <dd><p>If set, the transcription output will be sent to the specified file or URL
  22333. (use one of the FFmpeg AVIO protocols); otherwise, the output will be logged as
  22334. info messages.
  22335. The output will also be set in the &quot;lavfi.whisper.text&quot; frame metadata.
  22336. If the destination is a file and it already exists, it will be overwritten.
  22337. </p>
  22338. </dd>
  22339. <dt><samp class="option">format</samp></dt>
  22340. <dd><p>The destination format string; it could be &quot;text&quot; (only the transcribed text
  22341. will be sent to the destination), &quot;srt&quot; (subtitle format) or &quot;json&quot;.
  22342. Default value: <code class="code">&quot;text&quot;</code>
  22343. </p>
  22344. </dd>
  22345. <dt><samp class="option">vad_model</samp></dt>
  22346. <dd><p>Path to the VAD model file. If set, the filter will load an additional voice
  22347. activity detection module (https://github.com/snakers4/silero-vad) that will be
  22348. used to fragment the audio queue; use this option setting a valid path obtained
  22349. from the whisper.cpp repository (e.g. &quot;../whisper.cpp/models/ggml-silero-v5.1.2.bin&quot;)
  22350. and increase the queue parameter to a higher value (e.g. 20).
  22351. </p>
  22352. </dd>
  22353. <dt><samp class="option">vad_threshold</samp></dt>
  22354. <dd><p>The VAD threshold to use.
  22355. Default value: <code class="code">&quot;0.5&quot;</code>
  22356. </p>
  22357. </dd>
  22358. <dt><samp class="option">vad_min_speech_duration</samp></dt>
  22359. <dd><p>The minimum VAD speaking duration.
  22360. Default value: <code class="code">&quot;0.1&quot;</code>
  22361. </p>
  22362. </dd>
  22363. <dt><samp class="option">vad_min_silence_duration</samp></dt>
  22364. <dd><p>The minimum VAD silence duration.
  22365. Default value: <code class="code">&quot;0.5&quot;</code>
  22366. </p>
  22367. </dd>
  22368. </dl>
  22369. <a name="Examples-56"></a>
  22370. <h4 class="subsection">29.122.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-56" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-56" aria-hidden="true">TOC</a></span></h4>
  22371. <ul class="itemize mark-bullet">
  22372. <li>Run a transcription with srt file generation:
  22373. <div class="example">
  22374. <pre class="example-preformatted">ffmpeg -i input.mp4 -vn -af &quot;whisper=model=../whisper.cpp/models/ggml-base.en.bin\
  22375. :language=en\
  22376. :queue=3\
  22377. :destination=output.srt\
  22378. :format=srt&quot; -f null -
  22379. </pre></div>
  22380. </li><li>Run a transcription and send the output in JSON format to an HTTP service:
  22381. <div class="example">
  22382. <pre class="example-preformatted">ffmpeg -i input.mp4 -vn -af &quot;whisper=model=../whisper.cpp/models/ggml-base.en.bin\
  22383. :language=en\
  22384. :queue=3\
  22385. :destination=http\\://localhost\\:3000\
  22386. :format=json' -f null -
  22387. </pre></div>
  22388. </li><li>Transcribe the microphone input using the VAD option:
  22389. <div class="example">
  22390. <pre class="example-preformatted">ffmpeg -loglevel warning -f pulse -i default \
  22391. -af 'highpass=f=200,lowpass=f=3000,whisper=model=../whisper.cpp/models/ggml-medium.bin\
  22392. :language=en\
  22393. :queue=10\
  22394. :destination=-\
  22395. :format=json\
  22396. :vad_model=../whisper.cpp/models/ggml-silero-v5.1.2.bin' -f null -
  22397. </pre></div>
  22398. </li></ul>
  22399. <a name="Audio-Sources"></a>
  22400. <h2 class="chapter">30 Audio Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Sources" aria-hidden="true">TOC</a></span></h2>
  22401. <p>Below is a description of the currently available audio sources.
  22402. </p>
  22403. <a name="abuffer"></a>
  22404. <h3 class="section">30.1 abuffer<span class="pull-right"><a class="anchor hidden-xs" href="#abuffer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abuffer" aria-hidden="true">TOC</a></span></h3>
  22405. <p>Buffer audio frames, and make them available to the filter chain.
  22406. </p>
  22407. <p>This source is mainly intended for a programmatic use, in particular
  22408. through the interface defined in <samp class="file">libavfilter/buffersrc.h</samp>.
  22409. </p>
  22410. <p>It accepts the following parameters:
  22411. </p><dl class="table">
  22412. <dt><samp class="option">time_base</samp></dt>
  22413. <dd><p>The timebase which will be used for timestamps of submitted frames. It must be
  22414. either a floating-point number or in <var class="var">numerator</var>/<var class="var">denominator</var> form.
  22415. </p>
  22416. </dd>
  22417. <dt><samp class="option">sample_rate</samp></dt>
  22418. <dd><p>The sample rate of the incoming audio buffers.
  22419. </p>
  22420. </dd>
  22421. <dt><samp class="option">sample_fmt</samp></dt>
  22422. <dd><p>The sample format of the incoming audio buffers.
  22423. Either a sample format name or its corresponding integer representation from
  22424. the enum AVSampleFormat in <samp class="file">libavutil/samplefmt.h</samp>
  22425. </p>
  22426. </dd>
  22427. <dt><samp class="option">channel_layout</samp></dt>
  22428. <dd><p>The channel layout of the incoming audio buffers.
  22429. Either a channel layout name from channel_layout_map in
  22430. <samp class="file">libavutil/channel_layout.c</samp> or its corresponding integer representation
  22431. from the AV_CH_LAYOUT_* macros in <samp class="file">libavutil/channel_layout.h</samp>
  22432. </p>
  22433. </dd>
  22434. <dt><samp class="option">channels</samp></dt>
  22435. <dd><p>The number of channels of the incoming audio buffers.
  22436. If both <var class="var">channels</var> and <var class="var">channel_layout</var> are specified, then they
  22437. must be consistent.
  22438. </p>
  22439. </dd>
  22440. </dl>
  22441. <a name="Examples-57"></a>
  22442. <h4 class="subsection">30.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-57" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-57" aria-hidden="true">TOC</a></span></h4>
  22443. <div class="example">
  22444. <pre class="example-preformatted">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
  22445. </pre></div>
  22446. <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
  22447. Since the sample format with name &quot;s16p&quot; corresponds to the number
  22448. 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
  22449. equivalent to:
  22450. </p><div class="example">
  22451. <pre class="example-preformatted">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
  22452. </pre></div>
  22453. <a name="aevalsrc"></a>
  22454. <h3 class="section">30.2 aevalsrc<span class="pull-right"><a class="anchor hidden-xs" href="#aevalsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aevalsrc" aria-hidden="true">TOC</a></span></h3>
  22455. <p>Generate an audio signal specified by an expression.
  22456. </p>
  22457. <p>This source accepts in input one or more expressions (one for each
  22458. channel), which are evaluated and used to generate a corresponding
  22459. audio signal.
  22460. </p>
  22461. <p>This source accepts the following options:
  22462. </p>
  22463. <dl class="table">
  22464. <dt><samp class="option">exprs</samp></dt>
  22465. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
  22466. <samp class="option">channel_layout</samp> option is not specified, the selected channel layout
  22467. depends on the number of provided expressions. Otherwise the last
  22468. specified expression is applied to the remaining output channels.
  22469. </p>
  22470. </dd>
  22471. <dt><samp class="option">channel_layout, c</samp></dt>
  22472. <dd><p>Set the channel layout. The number of channels in the specified layout
  22473. must be equal to the number of specified expressions.
  22474. </p>
  22475. </dd>
  22476. <dt><samp class="option">duration, d</samp></dt>
  22477. <dd><p>Set the minimum duration of the sourced audio. See
  22478. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  22479. for the accepted syntax.
  22480. Note that the resulting duration may be greater than the specified
  22481. duration, as the generated audio is always cut at the end of a
  22482. complete frame.
  22483. </p>
  22484. <p>If not specified, or the expressed duration is negative, the audio is
  22485. supposed to be generated forever.
  22486. </p>
  22487. </dd>
  22488. <dt><samp class="option">nb_samples, n</samp></dt>
  22489. <dd><p>Set the number of samples per channel per each output frame,
  22490. default to 1024.
  22491. </p>
  22492. </dd>
  22493. <dt><samp class="option">sample_rate, s</samp></dt>
  22494. <dd><p>Specify the sample rate, default to 44100.
  22495. </p></dd>
  22496. </dl>
  22497. <p>Each expression in <var class="var">exprs</var> can contain the following constants:
  22498. </p>
  22499. <dl class="table">
  22500. <dt><samp class="option">n</samp></dt>
  22501. <dd><p>number of the evaluated sample, starting from 0
  22502. </p>
  22503. </dd>
  22504. <dt><samp class="option">t</samp></dt>
  22505. <dd><p>time of the evaluated sample expressed in seconds, starting from 0
  22506. </p>
  22507. </dd>
  22508. <dt><samp class="option">s</samp></dt>
  22509. <dd><p>sample rate
  22510. </p>
  22511. </dd>
  22512. </dl>
  22513. <a name="Examples-58"></a>
  22514. <h4 class="subsection">30.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-58" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-58" aria-hidden="true">TOC</a></span></h4>
  22515. <ul class="itemize mark-bullet">
  22516. <li>Generate silence:
  22517. <div class="example">
  22518. <pre class="example-preformatted">aevalsrc=0
  22519. </pre></div>
  22520. </li><li>Generate a sin signal with frequency of 440 Hz, set sample rate to
  22521. 8000 Hz:
  22522. <div class="example">
  22523. <pre class="example-preformatted">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
  22524. </pre></div>
  22525. </li><li>Generate a two channels signal, specify the channel layout (Front
  22526. Center + Back Center) explicitly:
  22527. <div class="example">
  22528. <pre class="example-preformatted">aevalsrc=&quot;sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC&quot;
  22529. </pre></div>
  22530. </li><li>Generate white noise:
  22531. <div class="example">
  22532. <pre class="example-preformatted">aevalsrc=&quot;-2+random(0)&quot;
  22533. </pre></div>
  22534. </li><li>Generate an amplitude modulated signal:
  22535. <div class="example">
  22536. <pre class="example-preformatted">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
  22537. </pre></div>
  22538. </li><li>Generate 2.5 Hz binaural beats on a 360 Hz carrier:
  22539. <div class="example">
  22540. <pre class="example-preformatted">aevalsrc=&quot;0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)&quot;
  22541. </pre></div>
  22542. </li></ul>
  22543. <a name="afdelaysrc"></a>
  22544. <h3 class="section">30.3 afdelaysrc<span class="pull-right"><a class="anchor hidden-xs" href="#afdelaysrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afdelaysrc" aria-hidden="true">TOC</a></span></h3>
  22545. <p>Generate a fractional delay FIR coefficients.
  22546. </p>
  22547. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  22548. </p>
  22549. <p>The filter accepts the following options:
  22550. </p>
  22551. <dl class="table">
  22552. <dt><samp class="option">delay, d</samp></dt>
  22553. <dd><p>Set the fractional delay. Default is 0.
  22554. </p>
  22555. </dd>
  22556. <dt><samp class="option">sample_rate, r</samp></dt>
  22557. <dd><p>Set the sample rate, default is 44100.
  22558. </p>
  22559. </dd>
  22560. <dt><samp class="option">nb_samples, n</samp></dt>
  22561. <dd><p>Set the number of samples per each frame. Default is 1024.
  22562. </p>
  22563. </dd>
  22564. <dt><samp class="option">taps, t</samp></dt>
  22565. <dd><p>Set the number of filter coefficients in output audio stream.
  22566. Default value is 0.
  22567. </p>
  22568. </dd>
  22569. <dt><samp class="option">channel_layout, c</samp></dt>
  22570. <dd><p>Specifies the channel layout, and can be a string representing a channel layout.
  22571. The default value of <var class="var">channel_layout</var> is &quot;stereo&quot;.
  22572. </p></dd>
  22573. </dl>
  22574. <a name="afireqsrc"></a>
  22575. <h3 class="section">30.4 afireqsrc<span class="pull-right"><a class="anchor hidden-xs" href="#afireqsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afireqsrc" aria-hidden="true">TOC</a></span></h3>
  22576. <p>Generate a FIR equalizer coefficients.
  22577. </p>
  22578. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  22579. </p>
  22580. <p>The filter accepts the following options:
  22581. </p>
  22582. <dl class="table">
  22583. <dt><samp class="option">preset, p</samp></dt>
  22584. <dd><p>Set equalizer preset.
  22585. Default preset is <code class="code">flat</code>.
  22586. </p>
  22587. <p>Available presets are:
  22588. </p><dl class="table">
  22589. <dt>&lsquo;<samp class="samp">custom</samp>&rsquo;</dt>
  22590. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  22591. <dt>&lsquo;<samp class="samp">acoustic</samp>&rsquo;</dt>
  22592. <dt>&lsquo;<samp class="samp">bass</samp>&rsquo;</dt>
  22593. <dt>&lsquo;<samp class="samp">beats</samp>&rsquo;</dt>
  22594. <dt>&lsquo;<samp class="samp">classic</samp>&rsquo;</dt>
  22595. <dt>&lsquo;<samp class="samp">clear</samp>&rsquo;</dt>
  22596. <dt>&lsquo;<samp class="samp">deep bass</samp>&rsquo;</dt>
  22597. <dt>&lsquo;<samp class="samp">dubstep</samp>&rsquo;</dt>
  22598. <dt>&lsquo;<samp class="samp">electronic</samp>&rsquo;</dt>
  22599. <dt>&lsquo;<samp class="samp">hard-style</samp>&rsquo;</dt>
  22600. <dt>&lsquo;<samp class="samp">hip-hop</samp>&rsquo;</dt>
  22601. <dt>&lsquo;<samp class="samp">jazz</samp>&rsquo;</dt>
  22602. <dt>&lsquo;<samp class="samp">metal</samp>&rsquo;</dt>
  22603. <dt>&lsquo;<samp class="samp">movie</samp>&rsquo;</dt>
  22604. <dt>&lsquo;<samp class="samp">pop</samp>&rsquo;</dt>
  22605. <dt>&lsquo;<samp class="samp">r&amp;b</samp>&rsquo;</dt>
  22606. <dt>&lsquo;<samp class="samp">rock</samp>&rsquo;</dt>
  22607. <dt>&lsquo;<samp class="samp">vocal booster</samp>&rsquo;</dt>
  22608. </dl>
  22609. </dd>
  22610. <dt><samp class="option">gains, g</samp></dt>
  22611. <dd><p>Set custom gains for each band. Only used if the preset option is set to <code class="code">custom</code>.
  22612. Gains are separated by white spaces and each gain is set in dBFS.
  22613. Default is <code class="code">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</code>.
  22614. </p>
  22615. </dd>
  22616. <dt><samp class="option">bands, b</samp></dt>
  22617. <dd><p>Set the custom bands from where custom equalizer gains are set.
  22618. This must be in strictly increasing order. Only used if the preset option is set to <code class="code">custom</code>.
  22619. Bands are separated by white spaces and each band represent frequency in Hz.
  22620. Default is <code class="code">25 40 63 100 160 250 400 630 1000 1600 2500 4000 6300 10000 16000 24000</code>.
  22621. </p>
  22622. </dd>
  22623. <dt><samp class="option">taps, t</samp></dt>
  22624. <dd><p>Set number of filter coefficients in output audio stream.
  22625. Default value is <code class="code">4096</code>.
  22626. </p>
  22627. </dd>
  22628. <dt><samp class="option">sample_rate, r</samp></dt>
  22629. <dd><p>Set sample rate of output audio stream, default is <code class="code">44100</code>.
  22630. </p>
  22631. </dd>
  22632. <dt><samp class="option">nb_samples, n</samp></dt>
  22633. <dd><p>Set number of samples per each frame in output audio stream. Default is <code class="code">1024</code>.
  22634. </p>
  22635. </dd>
  22636. <dt><samp class="option">interp, i</samp></dt>
  22637. <dd><p>Set interpolation method for FIR equalizer coefficients. Can be <code class="code">linear</code> or <code class="code">cubic</code>.
  22638. </p>
  22639. </dd>
  22640. <dt><samp class="option">phase, h</samp></dt>
  22641. <dd><p>Set phase type of FIR filter. Can be <code class="code">linear</code> or <code class="code">min</code>: minimum-phase.
  22642. Default is minimum-phase filter.
  22643. </p></dd>
  22644. </dl>
  22645. <a name="afirsrc"></a>
  22646. <h3 class="section">30.5 afirsrc<span class="pull-right"><a class="anchor hidden-xs" href="#afirsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afirsrc" aria-hidden="true">TOC</a></span></h3>
  22647. <p>Generate a FIR coefficients using frequency sampling method.
  22648. </p>
  22649. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  22650. </p>
  22651. <p>The filter accepts the following options:
  22652. </p>
  22653. <dl class="table">
  22654. <dt><samp class="option">taps, t</samp></dt>
  22655. <dd><p>Set number of filter coefficients in output audio stream.
  22656. Default value is 1025.
  22657. </p>
  22658. </dd>
  22659. <dt><samp class="option">frequency, f</samp></dt>
  22660. <dd><p>Set frequency points from where magnitude and phase are set.
  22661. This must be in non decreasing order, and first element must be 0, while last element
  22662. must be 1. Elements are separated by white spaces.
  22663. </p>
  22664. </dd>
  22665. <dt><samp class="option">magnitude, m</samp></dt>
  22666. <dd><p>Set magnitude value for every frequency point set by <samp class="option">frequency</samp>.
  22667. Number of values must be same as number of frequency points.
  22668. Values are separated by white spaces.
  22669. </p>
  22670. </dd>
  22671. <dt><samp class="option">phase, p</samp></dt>
  22672. <dd><p>Set phase value for every frequency point set by <samp class="option">frequency</samp>.
  22673. Number of values must be same as number of frequency points.
  22674. Values are separated by white spaces.
  22675. </p>
  22676. </dd>
  22677. <dt><samp class="option">sample_rate, r</samp></dt>
  22678. <dd><p>Set sample rate, default is 44100.
  22679. </p>
  22680. </dd>
  22681. <dt><samp class="option">nb_samples, n</samp></dt>
  22682. <dd><p>Set number of samples per each frame. Default is 1024.
  22683. </p>
  22684. </dd>
  22685. <dt><samp class="option">win_func, w</samp></dt>
  22686. <dd><p>Set window function. Default is blackman.
  22687. </p></dd>
  22688. </dl>
  22689. <a name="anullsrc"></a>
  22690. <h3 class="section">30.6 anullsrc<span class="pull-right"><a class="anchor hidden-xs" href="#anullsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anullsrc" aria-hidden="true">TOC</a></span></h3>
  22691. <p>The null audio source, return unprocessed audio frames. It is mainly useful
  22692. as a template and to be employed in analysis / debugging tools, or as
  22693. the source for filters which ignore the input data (for example the sox
  22694. synth filter).
  22695. </p>
  22696. <p>This source accepts the following options:
  22697. </p>
  22698. <dl class="table">
  22699. <dt><samp class="option">channel_layout, cl</samp></dt>
  22700. <dd>
  22701. <p>Specifies the channel layout, and can be either an integer or a string
  22702. representing a channel layout. The default value of <var class="var">channel_layout</var>
  22703. is &quot;stereo&quot;.
  22704. </p>
  22705. <p>Check the channel_layout_map definition in
  22706. <samp class="file">libavutil/channel_layout.c</samp> for the mapping between strings and
  22707. channel layout values.
  22708. </p>
  22709. </dd>
  22710. <dt><samp class="option">sample_rate, r</samp></dt>
  22711. <dd><p>Specifies the sample rate, and defaults to 44100.
  22712. </p>
  22713. </dd>
  22714. <dt><samp class="option">nb_samples, n</samp></dt>
  22715. <dd><p>Set the number of samples per requested frames.
  22716. </p>
  22717. </dd>
  22718. <dt><samp class="option">duration, d</samp></dt>
  22719. <dd><p>Set the duration of the sourced audio. See
  22720. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  22721. for the accepted syntax.
  22722. </p>
  22723. <p>If not specified, or the expressed duration is negative, the audio is
  22724. supposed to be generated forever.
  22725. </p></dd>
  22726. </dl>
  22727. <a name="Examples-59"></a>
  22728. <h4 class="subsection">30.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-59" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-59" aria-hidden="true">TOC</a></span></h4>
  22729. <ul class="itemize mark-bullet">
  22730. <li>Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
  22731. <div class="example">
  22732. <pre class="example-preformatted">anullsrc=r=48000:cl=4
  22733. </pre></div>
  22734. </li><li>Do the same operation with a more obvious syntax:
  22735. <div class="example">
  22736. <pre class="example-preformatted">anullsrc=r=48000:cl=mono
  22737. </pre></div>
  22738. </li></ul>
  22739. <p>All the parameters need to be explicitly defined.
  22740. </p>
  22741. <a name="flite"></a>
  22742. <h3 class="section">30.7 flite<span class="pull-right"><a class="anchor hidden-xs" href="#flite" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flite" aria-hidden="true">TOC</a></span></h3>
  22743. <p>Synthesize a voice utterance using the libflite library.
  22744. </p>
  22745. <p>To enable compilation of this filter you need to configure FFmpeg with
  22746. <code class="code">--enable-libflite</code>.
  22747. </p>
  22748. <p>Note that versions of the flite library prior to 2.0 are not thread-safe.
  22749. </p>
  22750. <p>The filter accepts the following options:
  22751. </p>
  22752. <dl class="table">
  22753. <dt><samp class="option">list_voices</samp></dt>
  22754. <dd><p>If set to 1, list the names of the available voices and exit
  22755. immediately. Default value is 0.
  22756. </p>
  22757. </dd>
  22758. <dt><samp class="option">nb_samples, n</samp></dt>
  22759. <dd><p>Set the maximum number of samples per frame. Default value is 512.
  22760. </p>
  22761. </dd>
  22762. <dt><samp class="option">textfile</samp></dt>
  22763. <dd><p>Set the filename containing the text to speak.
  22764. </p>
  22765. </dd>
  22766. <dt><samp class="option">text</samp></dt>
  22767. <dd><p>Set the text to speak.
  22768. </p>
  22769. </dd>
  22770. <dt><samp class="option">voice, v</samp></dt>
  22771. <dd><p>Set the voice to use for the speech synthesis. Default value is
  22772. <code class="code">kal</code>. See also the <var class="var">list_voices</var> option.
  22773. </p></dd>
  22774. </dl>
  22775. <a name="Examples-60"></a>
  22776. <h4 class="subsection">30.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-60" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-60" aria-hidden="true">TOC</a></span></h4>
  22777. <ul class="itemize mark-bullet">
  22778. <li>Read from file <samp class="file">speech.txt</samp>, and synthesize the text using the
  22779. standard flite voice:
  22780. <div class="example">
  22781. <pre class="example-preformatted">flite=textfile=speech.txt
  22782. </pre></div>
  22783. </li><li>Read the specified text selecting the <code class="code">slt</code> voice:
  22784. <div class="example">
  22785. <pre class="example-preformatted">flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  22786. </pre></div>
  22787. </li><li>Input text to ffmpeg:
  22788. <div class="example">
  22789. <pre class="example-preformatted">ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  22790. </pre></div>
  22791. </li><li>Make <samp class="file">ffplay</samp> speak the specified text, using <code class="code">flite</code> and
  22792. the <code class="code">lavfi</code> device:
  22793. <div class="example">
  22794. <pre class="example-preformatted">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
  22795. </pre></div>
  22796. </li></ul>
  22797. <p>For more information about libflite, check:
  22798. <a class="url" href="http://www.festvox.org/flite/">http://www.festvox.org/flite/</a>
  22799. </p>
  22800. <a name="anoisesrc"></a>
  22801. <h3 class="section">30.8 anoisesrc<span class="pull-right"><a class="anchor hidden-xs" href="#anoisesrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anoisesrc" aria-hidden="true">TOC</a></span></h3>
  22802. <p>Generate a noise audio signal.
  22803. </p>
  22804. <p>The filter accepts the following options:
  22805. </p>
  22806. <dl class="table">
  22807. <dt><samp class="option">sample_rate, r</samp></dt>
  22808. <dd><p>Specify the sample rate. Default value is 48000 Hz.
  22809. </p>
  22810. </dd>
  22811. <dt><samp class="option">amplitude, a</samp></dt>
  22812. <dd><p>Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value
  22813. is 1.0.
  22814. </p>
  22815. </dd>
  22816. <dt><samp class="option">duration, d</samp></dt>
  22817. <dd><p>Specify the duration of the generated audio stream. Not specifying this option
  22818. results in noise with an infinite length.
  22819. </p>
  22820. </dd>
  22821. <dt><samp class="option">color, colour, c</samp></dt>
  22822. <dd><p>Specify the color of noise. Available noise colors are white, pink, brown,
  22823. blue, violet and velvet. Default color is white.
  22824. </p>
  22825. </dd>
  22826. <dt><samp class="option">seed, s</samp></dt>
  22827. <dd><p>Specify a value used to seed the PRNG.
  22828. </p>
  22829. </dd>
  22830. <dt><samp class="option">nb_samples, n</samp></dt>
  22831. <dd><p>Set the number of samples per each output frame, default is 1024.
  22832. </p>
  22833. </dd>
  22834. <dt><samp class="option">density</samp></dt>
  22835. <dd><p>Set the density (0.0 - 1.0) for the velvet noise generator, default is 0.05.
  22836. </p></dd>
  22837. </dl>
  22838. <a name="Examples-61"></a>
  22839. <h4 class="subsection">30.8.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-61" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-61" aria-hidden="true">TOC</a></span></h4>
  22840. <ul class="itemize mark-bullet">
  22841. <li>Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5:
  22842. <div class="example">
  22843. <pre class="example-preformatted">anoisesrc=d=60:c=pink:r=44100:a=0.5
  22844. </pre></div>
  22845. </li></ul>
  22846. <a name="hilbert"></a>
  22847. <h3 class="section">30.9 hilbert<span class="pull-right"><a class="anchor hidden-xs" href="#hilbert" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hilbert" aria-hidden="true">TOC</a></span></h3>
  22848. <p>Generate odd-tap Hilbert transform FIR coefficients.
  22849. </p>
  22850. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for phase-shifting
  22851. the signal by 90 degrees.
  22852. </p>
  22853. <p>This is used in many matrix coding schemes and for analytic signal generation.
  22854. The process is often written as a multiplication by i (or j), the imaginary unit.
  22855. </p>
  22856. <p>The filter accepts the following options:
  22857. </p>
  22858. <dl class="table">
  22859. <dt><samp class="option">sample_rate, s</samp></dt>
  22860. <dd><p>Set sample rate, default is 44100.
  22861. </p>
  22862. </dd>
  22863. <dt><samp class="option">taps, t</samp></dt>
  22864. <dd><p>Set length of FIR filter, default is 22051.
  22865. </p>
  22866. </dd>
  22867. <dt><samp class="option">nb_samples, n</samp></dt>
  22868. <dd><p>Set number of samples per each frame.
  22869. </p>
  22870. </dd>
  22871. <dt><samp class="option">win_func, w</samp></dt>
  22872. <dd><p>Set window function to be used when generating FIR coefficients.
  22873. </p></dd>
  22874. </dl>
  22875. <a name="sinc"></a>
  22876. <h3 class="section">30.10 sinc<span class="pull-right"><a class="anchor hidden-xs" href="#sinc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sinc" aria-hidden="true">TOC</a></span></h3>
  22877. <p>Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients.
  22878. </p>
  22879. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  22880. </p>
  22881. <p>The filter accepts the following options:
  22882. </p>
  22883. <dl class="table">
  22884. <dt><samp class="option">sample_rate, r</samp></dt>
  22885. <dd><p>Set sample rate, default is 44100.
  22886. </p>
  22887. </dd>
  22888. <dt><samp class="option">nb_samples, n</samp></dt>
  22889. <dd><p>Set number of samples per each frame. Default is 1024.
  22890. </p>
  22891. </dd>
  22892. <dt><samp class="option">hp</samp></dt>
  22893. <dd><p>Set high-pass frequency. Default is 0.
  22894. </p>
  22895. </dd>
  22896. <dt><samp class="option">lp</samp></dt>
  22897. <dd><p>Set low-pass frequency. Default is 0.
  22898. If high-pass frequency is lower than low-pass frequency and low-pass frequency
  22899. is higher than 0 then filter will create band-pass filter coefficients,
  22900. otherwise band-reject filter coefficients.
  22901. </p>
  22902. </dd>
  22903. <dt><samp class="option">phase</samp></dt>
  22904. <dd><p>Set filter phase response. Default is 50. Allowed range is from 0 to 100.
  22905. </p>
  22906. </dd>
  22907. <dt><samp class="option">beta</samp></dt>
  22908. <dd><p>Set Kaiser window beta.
  22909. </p>
  22910. </dd>
  22911. <dt><samp class="option">att</samp></dt>
  22912. <dd><p>Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB.
  22913. </p>
  22914. </dd>
  22915. <dt><samp class="option">round</samp></dt>
  22916. <dd><p>Enable rounding, by default is disabled.
  22917. </p>
  22918. </dd>
  22919. <dt><samp class="option">hptaps</samp></dt>
  22920. <dd><p>Set number of taps for high-pass filter.
  22921. </p>
  22922. </dd>
  22923. <dt><samp class="option">lptaps</samp></dt>
  22924. <dd><p>Set number of taps for low-pass filter.
  22925. </p></dd>
  22926. </dl>
  22927. <a name="sine"></a>
  22928. <h3 class="section">30.11 sine<span class="pull-right"><a class="anchor hidden-xs" href="#sine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sine" aria-hidden="true">TOC</a></span></h3>
  22929. <p>Generate an audio signal made of a sine wave with amplitude 1/8.
  22930. </p>
  22931. <p>The audio signal is bit-exact.
  22932. </p>
  22933. <p>The filter accepts the following options:
  22934. </p>
  22935. <dl class="table">
  22936. <dt><samp class="option">frequency, f</samp></dt>
  22937. <dd><p>Set the carrier frequency. Default is 440 Hz.
  22938. </p>
  22939. </dd>
  22940. <dt><samp class="option">beep_factor, b</samp></dt>
  22941. <dd><p>Enable a periodic beep every second with frequency <var class="var">beep_factor</var> times
  22942. the carrier frequency. Default is 0, meaning the beep is disabled.
  22943. </p>
  22944. </dd>
  22945. <dt><samp class="option">sample_rate, r</samp></dt>
  22946. <dd><p>Specify the sample rate, default is 44100.
  22947. </p>
  22948. </dd>
  22949. <dt><samp class="option">duration, d</samp></dt>
  22950. <dd><p>Specify the duration of the generated audio stream.
  22951. </p>
  22952. </dd>
  22953. <dt><samp class="option">samples_per_frame</samp></dt>
  22954. <dd><p>Set the number of samples per output frame.
  22955. </p>
  22956. <p>The expression can contain the following constants:
  22957. </p>
  22958. <dl class="table">
  22959. <dt><samp class="option">n</samp></dt>
  22960. <dd><p>The (sequential) number of the output audio frame, starting from 0.
  22961. </p>
  22962. </dd>
  22963. <dt><samp class="option">pts</samp></dt>
  22964. <dd><p>The PTS (Presentation TimeStamp) of the output audio frame,
  22965. expressed in <var class="var">TB</var> units.
  22966. </p>
  22967. </dd>
  22968. <dt><samp class="option">t</samp></dt>
  22969. <dd><p>The PTS of the output audio frame, expressed in seconds.
  22970. </p>
  22971. </dd>
  22972. <dt><samp class="option">TB</samp></dt>
  22973. <dd><p>The timebase of the output audio frames.
  22974. </p></dd>
  22975. </dl>
  22976. <p>Default is <code class="code">1024</code>.
  22977. </p></dd>
  22978. </dl>
  22979. <a name="Examples-62"></a>
  22980. <h4 class="subsection">30.11.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-62" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-62" aria-hidden="true">TOC</a></span></h4>
  22981. <ul class="itemize mark-bullet">
  22982. <li>Generate a simple 440 Hz sine wave:
  22983. <div class="example">
  22984. <pre class="example-preformatted">sine
  22985. </pre></div>
  22986. </li><li>Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
  22987. <div class="example">
  22988. <pre class="example-preformatted">sine=220:4:d=5
  22989. sine=f=220:b=4:d=5
  22990. sine=frequency=220:beep_factor=4:duration=5
  22991. </pre></div>
  22992. </li><li>Generate a 1 kHz sine wave following <code class="code">1602,1601,1602,1601,1602</code> NTSC
  22993. pattern:
  22994. <div class="example">
  22995. <pre class="example-preformatted">sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
  22996. </pre></div>
  22997. </li></ul>
  22998. <a name="Audio-Sinks"></a>
  22999. <h2 class="chapter">31 Audio Sinks<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Sinks" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Sinks" aria-hidden="true">TOC</a></span></h2>
  23000. <p>Below is a description of the currently available audio sinks.
  23001. </p>
  23002. <a name="abuffersink"></a>
  23003. <h3 class="section">31.1 abuffersink<span class="pull-right"><a class="anchor hidden-xs" href="#abuffersink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abuffersink" aria-hidden="true">TOC</a></span></h3>
  23004. <p>Buffer audio frames, and make them available to the end of filter chain.
  23005. </p>
  23006. <p>This sink is mainly intended for programmatic use, in particular
  23007. through the interface defined in <samp class="file">libavfilter/buffersink.h</samp>
  23008. or the options system.
  23009. </p>
  23010. <p>It accepts a pointer to an AVABufferSinkContext structure, which
  23011. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  23012. parameter to <code class="code">avfilter_init_filter</code> for initialization.
  23013. </p><a name="anullsink"></a>
  23014. <h3 class="section">31.2 anullsink<span class="pull-right"><a class="anchor hidden-xs" href="#anullsink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anullsink" aria-hidden="true">TOC</a></span></h3>
  23015. <p>Null audio sink; do absolutely nothing with the input audio. It is
  23016. mainly useful as a template and for use in analysis / debugging
  23017. tools.
  23018. </p>
  23019. <a name="Video-Filters"></a>
  23020. <h2 class="chapter">32 Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  23021. <p>When you configure your FFmpeg build, you can disable any of the
  23022. existing filters using <code class="code">--disable-filters</code>.
  23023. The configure output will show the video filters included in your
  23024. build.
  23025. </p>
  23026. <p>Below is a description of the currently available video filters.
  23027. </p>
  23028. <a name="addroi"></a>
  23029. <h3 class="section">32.1 addroi<span class="pull-right"><a class="anchor hidden-xs" href="#addroi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-addroi" aria-hidden="true">TOC</a></span></h3>
  23030. <p>Mark a region of interest in a video frame.
  23031. </p>
  23032. <p>The frame data is passed through unchanged, but metadata is attached
  23033. to the frame indicating regions of interest which can affect the
  23034. behaviour of later encoding. Multiple regions can be marked by
  23035. applying the filter multiple times.
  23036. </p>
  23037. <dl class="table">
  23038. <dt><samp class="option">x</samp></dt>
  23039. <dd><p>Region distance in pixels from the left edge of the frame.
  23040. </p></dd>
  23041. <dt><samp class="option">y</samp></dt>
  23042. <dd><p>Region distance in pixels from the top edge of the frame.
  23043. </p></dd>
  23044. <dt><samp class="option">w</samp></dt>
  23045. <dd><p>Region width in pixels.
  23046. </p></dd>
  23047. <dt><samp class="option">h</samp></dt>
  23048. <dd><p>Region height in pixels.
  23049. </p>
  23050. <p>The parameters <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var> and <var class="var">h</var> are expressions,
  23051. and may contain the following variables:
  23052. </p><dl class="table">
  23053. <dt><samp class="option">iw</samp></dt>
  23054. <dd><p>Width of the input frame.
  23055. </p></dd>
  23056. <dt><samp class="option">ih</samp></dt>
  23057. <dd><p>Height of the input frame.
  23058. </p></dd>
  23059. </dl>
  23060. </dd>
  23061. <dt><samp class="option">qoffset</samp></dt>
  23062. <dd><p>Quantisation offset to apply within the region.
  23063. </p>
  23064. <p>This must be a real value in the range -1 to +1. A value of zero
  23065. indicates no quality change. A negative value asks for better quality
  23066. (less quantisation), while a positive value asks for worse quality
  23067. (greater quantisation).
  23068. </p>
  23069. <p>The range is calibrated so that the extreme values indicate the
  23070. largest possible offset - if the rest of the frame is encoded with the
  23071. worst possible quality, an offset of -1 indicates that this region
  23072. should be encoded with the best possible quality anyway. Intermediate
  23073. values are then interpolated in some codec-dependent way.
  23074. </p>
  23075. <p>For example, in 10-bit H.264 the quantisation parameter varies between
  23076. -12 and 51. A typical qoffset value of -1/10 therefore indicates that
  23077. this region should be encoded with a QP around one-tenth of the full
  23078. range better than the rest of the frame. So, if most of the frame
  23079. were to be encoded with a QP of around 30, this region would get a QP
  23080. of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3).
  23081. An extreme value of -1 would indicate that this region should be
  23082. encoded with the best possible quality regardless of the treatment of
  23083. the rest of the frame - that is, should be encoded at a QP of -12.
  23084. </p></dd>
  23085. <dt><samp class="option">clear</samp></dt>
  23086. <dd><p>If set to true, remove any existing regions of interest marked on the
  23087. frame before adding the new one.
  23088. </p></dd>
  23089. </dl>
  23090. <a name="Examples-63"></a>
  23091. <h4 class="subsection">32.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-63" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-63" aria-hidden="true">TOC</a></span></h4>
  23092. <ul class="itemize mark-bullet">
  23093. <li>Mark the centre quarter of the frame as interesting.
  23094. <div class="example">
  23095. <pre class="example-preformatted">addroi=iw/4:ih/4:iw/2:ih/2:-1/10
  23096. </pre></div>
  23097. </li><li>Mark the 100-pixel-wide region on the left edge of the frame as very
  23098. uninteresting (to be encoded at much lower quality than the rest of
  23099. the frame).
  23100. <div class="example">
  23101. <pre class="example-preformatted">addroi=0:0:100:ih:+1/5
  23102. </pre></div>
  23103. </li></ul>
  23104. <a name="alphaextract"></a>
  23105. <h3 class="section">32.2 alphaextract<span class="pull-right"><a class="anchor hidden-xs" href="#alphaextract" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alphaextract" aria-hidden="true">TOC</a></span></h3>
  23106. <p>Extract the alpha component from the input as a grayscale video. This
  23107. is especially useful with the <var class="var">alphamerge</var> filter.
  23108. </p>
  23109. <a name="alphamerge"></a>
  23110. <h3 class="section">32.3 alphamerge<span class="pull-right"><a class="anchor hidden-xs" href="#alphamerge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alphamerge" aria-hidden="true">TOC</a></span></h3>
  23111. <p>Add or replace the alpha component of the primary input with the
  23112. grayscale value of a second input. This is intended for use with
  23113. <var class="var">alphaextract</var> to allow the transmission or storage of frame
  23114. sequences that have alpha in a format that doesn&rsquo;t support an alpha
  23115. channel.
  23116. </p>
  23117. <p>For example, to reconstruct full frames from a normal YUV-encoded video
  23118. and a separate video created with <var class="var">alphaextract</var>, you might use:
  23119. </p><div class="example">
  23120. <pre class="example-preformatted">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
  23121. </pre></div>
  23122. <a name="amplify"></a>
  23123. <h3 class="section">32.4 amplify<span class="pull-right"><a class="anchor hidden-xs" href="#amplify" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amplify" aria-hidden="true">TOC</a></span></h3>
  23124. <p>Amplify differences between current pixel and pixels of adjacent frames in
  23125. same pixel location.
  23126. </p>
  23127. <p>This filter accepts the following options:
  23128. </p>
  23129. <dl class="table">
  23130. <dt><samp class="option">radius</samp></dt>
  23131. <dd><p>Set frame radius. Default is 2. Allowed range is from 1 to 63.
  23132. For example radius of 3 will instruct filter to calculate average of 7 frames.
  23133. </p>
  23134. </dd>
  23135. <dt><samp class="option">factor</samp></dt>
  23136. <dd><p>Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535.
  23137. </p>
  23138. </dd>
  23139. <dt><samp class="option">threshold</samp></dt>
  23140. <dd><p>Set threshold for difference amplification. Any difference greater or equal to
  23141. this value will not alter source pixel. Default is 10.
  23142. Allowed range is from 0 to 65535.
  23143. </p>
  23144. </dd>
  23145. <dt><samp class="option">tolerance</samp></dt>
  23146. <dd><p>Set tolerance for difference amplification. Any difference lower to
  23147. this value will not alter source pixel. Default is 0.
  23148. Allowed range is from 0 to 65535.
  23149. </p>
  23150. </dd>
  23151. <dt><samp class="option">low</samp></dt>
  23152. <dd><p>Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  23153. This option controls maximum possible value that will decrease source pixel value.
  23154. </p>
  23155. </dd>
  23156. <dt><samp class="option">high</samp></dt>
  23157. <dd><p>Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  23158. This option controls maximum possible value that will increase source pixel value.
  23159. </p>
  23160. </dd>
  23161. <dt><samp class="option">planes</samp></dt>
  23162. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  23163. </p></dd>
  23164. </dl>
  23165. <a name="Commands-54"></a>
  23166. <h4 class="subsection">32.4.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-54" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-54" aria-hidden="true">TOC</a></span></h4>
  23167. <p>This filter supports the following <a class="ref" href="#commands">commands</a> that corresponds to option of same name:
  23168. </p><dl class="table">
  23169. <dt><samp class="option">factor</samp></dt>
  23170. <dt><samp class="option">threshold</samp></dt>
  23171. <dt><samp class="option">tolerance</samp></dt>
  23172. <dt><samp class="option">low</samp></dt>
  23173. <dt><samp class="option">high</samp></dt>
  23174. <dt><samp class="option">planes</samp></dt>
  23175. </dl>
  23176. <a name="ass"></a>
  23177. <h3 class="section">32.5 ass<span class="pull-right"><a class="anchor hidden-xs" href="#ass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ass" aria-hidden="true">TOC</a></span></h3>
  23178. <p>Same as the <a class="ref" href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
  23179. and libavformat to work. On the other hand, it is limited to ASS (Advanced
  23180. Substation Alpha) subtitles files.
  23181. </p>
  23182. <p>This filter accepts the following option in addition to the common options from
  23183. the <a class="ref" href="#subtitles">subtitles</a> filter:
  23184. </p>
  23185. <dl class="table">
  23186. <dt><samp class="option">shaping</samp></dt>
  23187. <dd><p>Set the shaping engine
  23188. </p>
  23189. <p>Available values are:
  23190. </p><dl class="table">
  23191. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  23192. <dd><p>The default libass shaping engine, which is the best available.
  23193. </p></dd>
  23194. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  23195. <dd><p>Fast, font-agnostic shaper that can do only substitutions
  23196. </p></dd>
  23197. <dt>&lsquo;<samp class="samp">complex</samp>&rsquo;</dt>
  23198. <dd><p>Slower shaper using OpenType for substitutions and positioning
  23199. </p></dd>
  23200. </dl>
  23201. <p>The default is <code class="code">auto</code>.
  23202. </p></dd>
  23203. </dl>
  23204. <a name="atadenoise"></a>
  23205. <h3 class="section">32.6 atadenoise<span class="pull-right"><a class="anchor hidden-xs" href="#atadenoise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atadenoise" aria-hidden="true">TOC</a></span></h3>
  23206. <p>Apply an Adaptive Temporal Averaging Denoiser to the video input.
  23207. </p>
  23208. <p>The filter accepts the following options:
  23209. </p>
  23210. <dl class="table">
  23211. <dt><samp class="option">0a</samp></dt>
  23212. <dd><p>Set threshold A for 1st plane. Default is 0.02.
  23213. Valid range is 0 to 0.3.
  23214. </p>
  23215. </dd>
  23216. <dt><samp class="option">0b</samp></dt>
  23217. <dd><p>Set threshold B for 1st plane. Default is 0.04.
  23218. Valid range is 0 to 5.
  23219. </p>
  23220. </dd>
  23221. <dt><samp class="option">1a</samp></dt>
  23222. <dd><p>Set threshold A for 2nd plane. Default is 0.02.
  23223. Valid range is 0 to 0.3.
  23224. </p>
  23225. </dd>
  23226. <dt><samp class="option">1b</samp></dt>
  23227. <dd><p>Set threshold B for 2nd plane. Default is 0.04.
  23228. Valid range is 0 to 5.
  23229. </p>
  23230. </dd>
  23231. <dt><samp class="option">2a</samp></dt>
  23232. <dd><p>Set threshold A for 3rd plane. Default is 0.02.
  23233. Valid range is 0 to 0.3.
  23234. </p>
  23235. </dd>
  23236. <dt><samp class="option">2b</samp></dt>
  23237. <dd><p>Set threshold B for 3rd plane. Default is 0.04.
  23238. Valid range is 0 to 5.
  23239. </p>
  23240. <p>Threshold A is designed to react on abrupt changes in the input signal and
  23241. threshold B is designed to react on continuous changes in the input signal.
  23242. </p>
  23243. </dd>
  23244. <dt><samp class="option">s</samp></dt>
  23245. <dd><p>Set number of frames filter will use for averaging. Default is 9. Must be odd
  23246. number in range [5, 129].
  23247. </p>
  23248. </dd>
  23249. <dt><samp class="option">p</samp></dt>
  23250. <dd><p>Set what planes of frame filter will use for averaging. Default is all.
  23251. </p>
  23252. </dd>
  23253. <dt><samp class="option">a</samp></dt>
  23254. <dd><p>Set what variant of algorithm filter will use for averaging. Default is <code class="code">p</code> parallel.
  23255. Alternatively can be set to <code class="code">s</code> serial.
  23256. </p>
  23257. <p>Parallel can be faster then serial, while other way around is never true.
  23258. Parallel will abort early on first change being greater then thresholds, while serial
  23259. will continue processing other side of frames if they are equal or below thresholds.
  23260. </p>
  23261. </dd>
  23262. <dt><samp class="option">0s</samp></dt>
  23263. <dt><samp class="option">1s</samp></dt>
  23264. <dt><samp class="option">2s</samp></dt>
  23265. <dd><p>Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767.
  23266. Valid range is from 0 to 32767.
  23267. This options controls weight for each pixel in radius defined by size.
  23268. Default value means every pixel have same weight.
  23269. Setting this option to 0 effectively disables filtering.
  23270. </p></dd>
  23271. </dl>
  23272. <a name="Commands-55"></a>
  23273. <h4 class="subsection">32.6.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-55" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-55" aria-hidden="true">TOC</a></span></h4>
  23274. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options except option <code class="code">s</code>.
  23275. The command accepts the same syntax of the corresponding option.
  23276. </p>
  23277. <a name="avgblur"></a>
  23278. <h3 class="section">32.7 avgblur<span class="pull-right"><a class="anchor hidden-xs" href="#avgblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avgblur" aria-hidden="true">TOC</a></span></h3>
  23279. <p>Apply average blur filter.
  23280. </p>
  23281. <p>The filter accepts the following options:
  23282. </p>
  23283. <dl class="table">
  23284. <dt><samp class="option">sizeX</samp></dt>
  23285. <dd><p>Set horizontal radius size.
  23286. </p>
  23287. </dd>
  23288. <dt><samp class="option">planes</samp></dt>
  23289. <dd><p>Set which planes to filter. By default all planes are filtered.
  23290. </p>
  23291. </dd>
  23292. <dt><samp class="option">sizeY</samp></dt>
  23293. <dd><p>Set vertical radius size, if zero it will be same as <code class="code">sizeX</code>.
  23294. Default is <code class="code">0</code>.
  23295. </p></dd>
  23296. </dl>
  23297. <a name="Commands-56"></a>
  23298. <h4 class="subsection">32.7.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-56" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-56" aria-hidden="true">TOC</a></span></h4>
  23299. <p>This filter supports same commands as options.
  23300. The command accepts the same syntax of the corresponding option.
  23301. </p>
  23302. <p>If the specified expression is not valid, it is kept at its current
  23303. value.
  23304. </p>
  23305. <a name="backgroundkey"></a>
  23306. <h3 class="section">32.8 backgroundkey<span class="pull-right"><a class="anchor hidden-xs" href="#backgroundkey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-backgroundkey" aria-hidden="true">TOC</a></span></h3>
  23307. <p>Turns a static background into transparency.
  23308. </p>
  23309. <p>The filter accepts the following option:
  23310. </p>
  23311. <dl class="table">
  23312. <dt><samp class="option">threshold</samp></dt>
  23313. <dd><p>Threshold for scene change detection.
  23314. </p></dd>
  23315. <dt><samp class="option">similarity</samp></dt>
  23316. <dd><p>Similarity percentage with the background.
  23317. </p></dd>
  23318. <dt><samp class="option">blend</samp></dt>
  23319. <dd><p>Set the blend amount for pixels that are not similar.
  23320. </p></dd>
  23321. </dl>
  23322. <a name="Commands-57"></a>
  23323. <h4 class="subsection">32.8.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-57" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-57" aria-hidden="true">TOC</a></span></h4>
  23324. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  23325. </p>
  23326. <a name="bbox"></a>
  23327. <h3 class="section">32.9 bbox<span class="pull-right"><a class="anchor hidden-xs" href="#bbox" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bbox" aria-hidden="true">TOC</a></span></h3>
  23328. <p>Compute the bounding box for the non-black pixels in the input frame
  23329. luma plane.
  23330. </p>
  23331. <p>This filter computes the bounding box containing all the pixels with a
  23332. luma value greater than the minimum allowed value.
  23333. The parameters describing the bounding box are printed on the filter
  23334. log.
  23335. </p>
  23336. <p>The filter accepts the following option:
  23337. </p>
  23338. <dl class="table">
  23339. <dt><samp class="option">min_val</samp></dt>
  23340. <dd><p>Set the minimal luma value. Default is <code class="code">16</code>.
  23341. </p></dd>
  23342. </dl>
  23343. <a name="Commands-58"></a>
  23344. <h4 class="subsection">32.9.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-58" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-58" aria-hidden="true">TOC</a></span></h4>
  23345. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  23346. </p>
  23347. <a name="bilateral"></a>
  23348. <h3 class="section">32.10 bilateral<span class="pull-right"><a class="anchor hidden-xs" href="#bilateral" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bilateral" aria-hidden="true">TOC</a></span></h3>
  23349. <p>Apply bilateral filter, spatial smoothing while preserving edges.
  23350. </p>
  23351. <p>The filter accepts the following options:
  23352. </p><dl class="table">
  23353. <dt><samp class="option">sigmaS</samp></dt>
  23354. <dd><p>Set sigma of gaussian function to calculate spatial weight.
  23355. Allowed range is 0 to 512. Default is 0.1.
  23356. </p>
  23357. </dd>
  23358. <dt><samp class="option">sigmaR</samp></dt>
  23359. <dd><p>Set sigma of gaussian function to calculate range weight.
  23360. Allowed range is 0 to 1. Default is 0.1.
  23361. </p>
  23362. </dd>
  23363. <dt><samp class="option">planes</samp></dt>
  23364. <dd><p>Set planes to filter. Default is first only.
  23365. </p></dd>
  23366. </dl>
  23367. <a name="Commands-59"></a>
  23368. <h4 class="subsection">32.10.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-59" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-59" aria-hidden="true">TOC</a></span></h4>
  23369. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  23370. </p>
  23371. <a name="bitplanenoise"></a>
  23372. <h3 class="section">32.11 bitplanenoise<span class="pull-right"><a class="anchor hidden-xs" href="#bitplanenoise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bitplanenoise" aria-hidden="true">TOC</a></span></h3>
  23373. <p>Show and measure bit plane noise.
  23374. </p>
  23375. <p>The filter accepts the following options:
  23376. </p>
  23377. <dl class="table">
  23378. <dt><samp class="option">bitplane</samp></dt>
  23379. <dd><p>Set which plane to analyze. Default is <code class="code">1</code>.
  23380. </p>
  23381. </dd>
  23382. <dt><samp class="option">filter</samp></dt>
  23383. <dd><p>Filter out noisy pixels from <code class="code">bitplane</code> set above.
  23384. Default is disabled.
  23385. </p></dd>
  23386. </dl>
  23387. <a name="blackdetect_002c-blackdetect_005fvulkan"></a>
  23388. <h3 class="section">32.12 blackdetect, blackdetect_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#blackdetect_002c-blackdetect_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blackdetect_002c-blackdetect_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  23389. <p>Detect video intervals that are (almost) completely black. Can be
  23390. useful to detect chapter transitions, commercials, or invalid
  23391. recordings.
  23392. </p>
  23393. <p>The filter outputs its detection analysis to both the log as well as
  23394. frame metadata. If a black segment of at least the specified minimum
  23395. duration is found, a line with the start and end timestamps as well
  23396. as duration is printed to the log with level <code class="code">info</code>. In addition,
  23397. a log line with level <code class="code">debug</code> is printed per frame showing the
  23398. black amount detected for that frame.
  23399. </p>
  23400. <p>The filter also attaches metadata to the first frame of a black
  23401. segment with key <code class="code">lavfi.black_start</code> and to the first frame
  23402. after the black segment ends with key <code class="code">lavfi.black_end</code>. The
  23403. value is the frame&rsquo;s timestamp. This metadata is added regardless
  23404. of the minimum duration specified.
  23405. </p>
  23406. <p>The filter accepts the following options:
  23407. </p>
  23408. <dl class="table">
  23409. <dt><samp class="option">black_min_duration, d</samp></dt>
  23410. <dd><p>Set the minimum detected black duration expressed in seconds. It must
  23411. be a non-negative floating point number.
  23412. </p>
  23413. <p>Default value is 2.0.
  23414. </p>
  23415. </dd>
  23416. <dt><samp class="option">picture_black_ratio_th, pic_th</samp></dt>
  23417. <dd><p>Set the threshold for considering a picture &quot;black&quot;.
  23418. Express the minimum value for the ratio:
  23419. </p><div class="example">
  23420. <pre class="example-preformatted"><var class="var">nb_black_pixels</var> / <var class="var">nb_pixels</var>
  23421. </pre></div>
  23422. <p>for which a picture is considered black.
  23423. Default value is 0.98.
  23424. </p>
  23425. </dd>
  23426. <dt><samp class="option">pixel_black_th, pix_th</samp></dt>
  23427. <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
  23428. </p>
  23429. <p>The threshold expresses the maximum pixel luma value for which a
  23430. pixel is considered &quot;black&quot;. The provided value is scaled according to
  23431. the following equation:
  23432. </p><div class="example">
  23433. <pre class="example-preformatted"><var class="var">absolute_threshold</var> = <var class="var">luma_minimum_value</var> + <var class="var">pixel_black_th</var> * <var class="var">luma_range_size</var>
  23434. </pre></div>
  23435. <p><var class="var">luma_range_size</var> and <var class="var">luma_minimum_value</var> depend on
  23436. the input video format, the range is [0-255] for YUV full-range
  23437. formats and [16-235] for YUV non full-range formats.
  23438. </p>
  23439. <p>Default value is 0.10.
  23440. </p>
  23441. </dd>
  23442. <dt><samp class="option">alpha</samp></dt>
  23443. <dd><p>If true, check the alpha channel instead of the luma channel. Detects frames
  23444. which are (almost) transparent, instead of frames which are almost black.
  23445. </p>
  23446. <p>Default value is disabled.
  23447. </p></dd>
  23448. </dl>
  23449. <p>The following example sets the maximum pixel threshold to the minimum
  23450. value, and detects only black intervals of 2 or more seconds:
  23451. </p><div class="example">
  23452. <pre class="example-preformatted">blackdetect=d=2:pix_th=0.00
  23453. </pre></div>
  23454. <a name="blackframe"></a>
  23455. <h3 class="section">32.13 blackframe<span class="pull-right"><a class="anchor hidden-xs" href="#blackframe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blackframe" aria-hidden="true">TOC</a></span></h3>
  23456. <p>Detect frames that are (almost) completely black. Can be useful to
  23457. detect chapter transitions or commercials. Output lines consist of
  23458. the frame number of the detected frame, the percentage of blackness,
  23459. the position in the file if known or -1 and the timestamp in seconds.
  23460. </p>
  23461. <p>In order to display the output lines, you need to set the loglevel at
  23462. least to the AV_LOG_INFO value.
  23463. </p>
  23464. <p>This filter exports frame metadata <code class="code">lavfi.blackframe.pblack</code>.
  23465. The value represents the percentage of pixels in the picture that
  23466. are below the threshold value.
  23467. </p>
  23468. <p>It accepts the following parameters:
  23469. </p>
  23470. <dl class="table">
  23471. <dt><samp class="option">amount</samp></dt>
  23472. <dd><p>The percentage of the pixels that have to be below the threshold; it defaults to
  23473. <code class="code">98</code>.
  23474. </p>
  23475. </dd>
  23476. <dt><samp class="option">threshold, thresh</samp></dt>
  23477. <dd><p>The threshold below which a pixel value is considered black; it defaults to
  23478. <code class="code">32</code>.
  23479. </p>
  23480. </dd>
  23481. </dl>
  23482. <a class="anchor" id="blend"></a><a name="blend-1"></a>
  23483. <h3 class="section">32.14 blend<span class="pull-right"><a class="anchor hidden-xs" href="#blend-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blend-1" aria-hidden="true">TOC</a></span></h3>
  23484. <p>Blend two video frames into each other.
  23485. </p>
  23486. <p>The <code class="code">blend</code> filter takes two input streams and outputs one
  23487. stream, the first input is the &quot;top&quot; layer and second input is
  23488. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  23489. </p>
  23490. <p>The <code class="code">tblend</code> (time blend) filter takes two consecutive frames
  23491. from one single stream, and outputs the result obtained by blending
  23492. the new frame on top of the old frame.
  23493. </p>
  23494. <p>A description of the accepted options follows.
  23495. </p>
  23496. <dl class="table">
  23497. <dt><samp class="option">c0_mode</samp></dt>
  23498. <dt><samp class="option">c1_mode</samp></dt>
  23499. <dt><samp class="option">c2_mode</samp></dt>
  23500. <dt><samp class="option">c3_mode</samp></dt>
  23501. <dt><samp class="option">all_mode</samp></dt>
  23502. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  23503. of <var class="var">all_mode</var>. Default value is <code class="code">normal</code>.
  23504. </p>
  23505. <p>Available values for component modes are:
  23506. </p><dl class="table">
  23507. <dt>&lsquo;<samp class="samp">addition</samp>&rsquo;</dt>
  23508. <dt>&lsquo;<samp class="samp">and</samp>&rsquo;</dt>
  23509. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  23510. <dt>&lsquo;<samp class="samp">bleach</samp>&rsquo;</dt>
  23511. <dt>&lsquo;<samp class="samp">burn</samp>&rsquo;</dt>
  23512. <dt>&lsquo;<samp class="samp">darken</samp>&rsquo;</dt>
  23513. <dt>&lsquo;<samp class="samp">difference</samp>&rsquo;</dt>
  23514. <dt>&lsquo;<samp class="samp">divide</samp>&rsquo;</dt>
  23515. <dt>&lsquo;<samp class="samp">dodge</samp>&rsquo;</dt>
  23516. <dt>&lsquo;<samp class="samp">exclusion</samp>&rsquo;</dt>
  23517. <dt>&lsquo;<samp class="samp">extremity</samp>&rsquo;</dt>
  23518. <dt>&lsquo;<samp class="samp">freeze</samp>&rsquo;</dt>
  23519. <dt>&lsquo;<samp class="samp">geometric</samp>&rsquo;</dt>
  23520. <dt>&lsquo;<samp class="samp">glow</samp>&rsquo;</dt>
  23521. <dt>&lsquo;<samp class="samp">grainextract</samp>&rsquo;</dt>
  23522. <dt>&lsquo;<samp class="samp">grainmerge</samp>&rsquo;</dt>
  23523. <dt>&lsquo;<samp class="samp">hardlight</samp>&rsquo;</dt>
  23524. <dt>&lsquo;<samp class="samp">hardmix</samp>&rsquo;</dt>
  23525. <dt>&lsquo;<samp class="samp">hardoverlay</samp>&rsquo;</dt>
  23526. <dt>&lsquo;<samp class="samp">harmonic</samp>&rsquo;</dt>
  23527. <dt>&lsquo;<samp class="samp">heat</samp>&rsquo;</dt>
  23528. <dt>&lsquo;<samp class="samp">interpolate</samp>&rsquo;</dt>
  23529. <dt>&lsquo;<samp class="samp">lighten</samp>&rsquo;</dt>
  23530. <dt>&lsquo;<samp class="samp">linearlight</samp>&rsquo;</dt>
  23531. <dt>&lsquo;<samp class="samp">multiply</samp>&rsquo;</dt>
  23532. <dt>&lsquo;<samp class="samp">multiply128</samp>&rsquo;</dt>
  23533. <dt>&lsquo;<samp class="samp">negation</samp>&rsquo;</dt>
  23534. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  23535. <dt>&lsquo;<samp class="samp">or</samp>&rsquo;</dt>
  23536. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  23537. <dt>&lsquo;<samp class="samp">phoenix</samp>&rsquo;</dt>
  23538. <dt>&lsquo;<samp class="samp">pinlight</samp>&rsquo;</dt>
  23539. <dt>&lsquo;<samp class="samp">reflect</samp>&rsquo;</dt>
  23540. <dt>&lsquo;<samp class="samp">screen</samp>&rsquo;</dt>
  23541. <dt>&lsquo;<samp class="samp">softdifference</samp>&rsquo;</dt>
  23542. <dt>&lsquo;<samp class="samp">softlight</samp>&rsquo;</dt>
  23543. <dt>&lsquo;<samp class="samp">stain</samp>&rsquo;</dt>
  23544. <dt>&lsquo;<samp class="samp">subtract</samp>&rsquo;</dt>
  23545. <dt>&lsquo;<samp class="samp">vividlight</samp>&rsquo;</dt>
  23546. <dt>&lsquo;<samp class="samp">xor</samp>&rsquo;</dt>
  23547. </dl>
  23548. </dd>
  23549. <dt><samp class="option">c0_opacity</samp></dt>
  23550. <dt><samp class="option">c1_opacity</samp></dt>
  23551. <dt><samp class="option">c2_opacity</samp></dt>
  23552. <dt><samp class="option">c3_opacity</samp></dt>
  23553. <dt><samp class="option">all_opacity</samp></dt>
  23554. <dd><p>Set blend opacity for specific pixel component or all pixel components in case
  23555. of <var class="var">all_opacity</var>. Only used in combination with pixel component blend modes.
  23556. </p>
  23557. </dd>
  23558. <dt><samp class="option">c0_expr</samp></dt>
  23559. <dt><samp class="option">c1_expr</samp></dt>
  23560. <dt><samp class="option">c2_expr</samp></dt>
  23561. <dt><samp class="option">c3_expr</samp></dt>
  23562. <dt><samp class="option">all_expr</samp></dt>
  23563. <dd><p>Set blend expression for specific pixel component or all pixel components in case
  23564. of <var class="var">all_expr</var>. Note that related mode options will be ignored if those are set.
  23565. </p>
  23566. <p>The expressions can use the following variables:
  23567. </p>
  23568. <dl class="table">
  23569. <dt><samp class="option">N</samp></dt>
  23570. <dd><p>The sequential number of the filtered frame, starting from <code class="code">0</code>.
  23571. </p>
  23572. </dd>
  23573. <dt><samp class="option">X</samp></dt>
  23574. <dt><samp class="option">Y</samp></dt>
  23575. <dd><p>the coordinates of the current sample
  23576. </p>
  23577. </dd>
  23578. <dt><samp class="option">W</samp></dt>
  23579. <dt><samp class="option">H</samp></dt>
  23580. <dd><p>the width and height of currently filtered plane
  23581. </p>
  23582. </dd>
  23583. <dt><samp class="option">SW</samp></dt>
  23584. <dt><samp class="option">SH</samp></dt>
  23585. <dd><p>Width and height scale for the plane being filtered. It is the
  23586. ratio between the dimensions of the current plane to the luma plane,
  23587. e.g. for a <code class="code">yuv420p</code> frame, the values are <code class="code">1,1</code> for
  23588. the luma plane and <code class="code">0.5,0.5</code> for the chroma planes.
  23589. </p>
  23590. </dd>
  23591. <dt><samp class="option">T</samp></dt>
  23592. <dd><p>Time of the current frame, expressed in seconds.
  23593. </p>
  23594. </dd>
  23595. <dt><samp class="option">TOP, A</samp></dt>
  23596. <dd><p>Value of pixel component at current location for first video frame (top layer).
  23597. </p>
  23598. </dd>
  23599. <dt><samp class="option">BOTTOM, B</samp></dt>
  23600. <dd><p>Value of pixel component at current location for second video frame (bottom layer).
  23601. </p></dd>
  23602. </dl>
  23603. </dd>
  23604. </dl>
  23605. <p>The <code class="code">blend</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  23606. </p>
  23607. <a name="Examples-64"></a>
  23608. <h4 class="subsection">32.14.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-64" aria-hidden="true">TOC</a></span></h4>
  23609. <ul class="itemize mark-bullet">
  23610. <li>Apply transition from bottom layer to top layer in first 10 seconds:
  23611. <div class="example">
  23612. <pre class="example-preformatted">blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
  23613. </pre></div>
  23614. </li><li>Apply linear horizontal transition from top layer to bottom layer:
  23615. <div class="example">
  23616. <pre class="example-preformatted">blend=all_expr='A*(X/W)+B*(1-X/W)'
  23617. </pre></div>
  23618. </li><li>Apply 1x1 checkerboard effect:
  23619. <div class="example">
  23620. <pre class="example-preformatted">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
  23621. </pre></div>
  23622. </li><li>Apply uncover left effect:
  23623. <div class="example">
  23624. <pre class="example-preformatted">blend=all_expr='if(gte(N*SW+X,W),A,B)'
  23625. </pre></div>
  23626. </li><li>Apply uncover down effect:
  23627. <div class="example">
  23628. <pre class="example-preformatted">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
  23629. </pre></div>
  23630. </li><li>Apply uncover up-left effect:
  23631. <div class="example">
  23632. <pre class="example-preformatted">blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
  23633. </pre></div>
  23634. </li><li>Split diagonally video and shows top and bottom layer on each side:
  23635. <div class="example">
  23636. <pre class="example-preformatted">blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
  23637. </pre></div>
  23638. </li><li>Display differences between the current and the previous frame:
  23639. <div class="example">
  23640. <pre class="example-preformatted">tblend=all_mode=grainextract
  23641. </pre></div>
  23642. </li></ul>
  23643. <a name="Commands-60"></a>
  23644. <h4 class="subsection">32.14.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-60" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-60" aria-hidden="true">TOC</a></span></h4>
  23645. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  23646. </p>
  23647. <a class="anchor" id="blockdetect"></a><a name="blockdetect-1"></a>
  23648. <h3 class="section">32.15 blockdetect<span class="pull-right"><a class="anchor hidden-xs" href="#blockdetect-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blockdetect-1" aria-hidden="true">TOC</a></span></h3>
  23649. <p>Determines blockiness of frames without altering the input frames.
  23650. </p>
  23651. <p>Based on Remco Muijs and Ihor Kirenko: &quot;A no-reference blocking artifact measure for adaptive video processing.&quot; 2005 13th European signal processing conference.
  23652. </p>
  23653. <p>The filter accepts the following options:
  23654. </p>
  23655. <dl class="table">
  23656. <dt><samp class="option">period_min</samp></dt>
  23657. <dt><samp class="option">period_max</samp></dt>
  23658. <dd><p>Set minimum and maximum values for determining pixel grids (periods).
  23659. Default values are [3,24].
  23660. </p>
  23661. </dd>
  23662. <dt><samp class="option">planes</samp></dt>
  23663. <dd><p>Set planes to filter. Default is first only.
  23664. </p></dd>
  23665. </dl>
  23666. <a name="Examples-65"></a>
  23667. <h4 class="subsection">32.15.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-65" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-65" aria-hidden="true">TOC</a></span></h4>
  23668. <ul class="itemize mark-bullet">
  23669. <li>Determine blockiness for the first plane and search for periods within [8,32]:
  23670. <div class="example">
  23671. <pre class="example-preformatted">blockdetect=period_min=8:period_max=32:planes=1
  23672. </pre></div>
  23673. </li></ul>
  23674. <a class="anchor" id="blurdetect"></a><a name="blurdetect-1"></a>
  23675. <h3 class="section">32.16 blurdetect<span class="pull-right"><a class="anchor hidden-xs" href="#blurdetect-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blurdetect-1" aria-hidden="true">TOC</a></span></h3>
  23676. <p>Determines blurriness of frames without altering the input frames.
  23677. </p>
  23678. <p>Based on Marziliano, Pina, et al. &quot;A no-reference perceptual blur metric.&quot;
  23679. Allows for a block-based abbreviation.
  23680. </p>
  23681. <p>The filter accepts the following options:
  23682. </p>
  23683. <dl class="table">
  23684. <dt><samp class="option">low</samp></dt>
  23685. <dt><samp class="option">high</samp></dt>
  23686. <dd><p>Set low and high threshold values used by the Canny thresholding
  23687. algorithm.
  23688. </p>
  23689. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  23690. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  23691. by the low threshold.
  23692. </p>
  23693. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  23694. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  23695. </p>
  23696. <p>Default value for <var class="var">low</var> is <code class="code">20/255</code>, and default value for <var class="var">high</var>
  23697. is <code class="code">50/255</code>.
  23698. </p>
  23699. </dd>
  23700. <dt><samp class="option">radius</samp></dt>
  23701. <dd><p>Define the radius to search around an edge pixel for local maxima.
  23702. </p>
  23703. </dd>
  23704. <dt><samp class="option">block_pct</samp></dt>
  23705. <dd><p>Determine blurriness only for the most significant blocks, given in percentage.
  23706. </p>
  23707. </dd>
  23708. <dt><samp class="option">block_width</samp></dt>
  23709. <dd><p>Determine blurriness for blocks of width <var class="var">block_width</var>. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of <var class="var">block_height</var>.
  23710. </p>
  23711. </dd>
  23712. <dt><samp class="option">block_height</samp></dt>
  23713. <dd><p>Determine blurriness for blocks of height <var class="var">block_height</var>. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of <var class="var">block_width</var>.
  23714. </p>
  23715. </dd>
  23716. <dt><samp class="option">planes</samp></dt>
  23717. <dd><p>Set planes to filter. Default is first only.
  23718. </p></dd>
  23719. </dl>
  23720. <a name="Examples-66"></a>
  23721. <h4 class="subsection">32.16.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-66" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-66" aria-hidden="true">TOC</a></span></h4>
  23722. <ul class="itemize mark-bullet">
  23723. <li>Determine blur for 80% of most significant 32x32 blocks:
  23724. <div class="example">
  23725. <pre class="example-preformatted">blurdetect=block_width=32:block_height=32:block_pct=80
  23726. </pre></div>
  23727. </li></ul>
  23728. <a name="bm3d"></a>
  23729. <h3 class="section">32.17 bm3d<span class="pull-right"><a class="anchor hidden-xs" href="#bm3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bm3d" aria-hidden="true">TOC</a></span></h3>
  23730. <p>Denoise frames using Block-Matching 3D algorithm.
  23731. </p>
  23732. <p>The filter accepts the following options.
  23733. </p>
  23734. <dl class="table">
  23735. <dt><samp class="option">sigma</samp></dt>
  23736. <dd><p>Set denoising strength. Default value is 1.
  23737. Allowed range is from 0 to 999.9.
  23738. The denoising algorithm is very sensitive to sigma, so adjust it
  23739. according to the source.
  23740. </p>
  23741. </dd>
  23742. <dt><samp class="option">block</samp></dt>
  23743. <dd><p>Set local patch size. This sets dimensions in 2D.
  23744. </p>
  23745. </dd>
  23746. <dt><samp class="option">bstep</samp></dt>
  23747. <dd><p>Set sliding step for processing blocks. Default value is 4.
  23748. Allowed range is from 1 to 64.
  23749. Smaller values allows processing more reference blocks and is slower.
  23750. </p>
  23751. </dd>
  23752. <dt><samp class="option">group</samp></dt>
  23753. <dd><p>Set maximal number of similar blocks for 3rd dimension. Default value is 1.
  23754. When set to 1, no block matching is done. Larger values allows more blocks
  23755. in single group.
  23756. Allowed range is from 1 to 256.
  23757. </p>
  23758. </dd>
  23759. <dt><samp class="option">range</samp></dt>
  23760. <dd><p>Set radius for search block matching. Default is 9.
  23761. Allowed range is from 1 to INT32_MAX.
  23762. </p>
  23763. </dd>
  23764. <dt><samp class="option">mstep</samp></dt>
  23765. <dd><p>Set step between two search locations for block matching. Default is 1.
  23766. Allowed range is from 1 to 64. Smaller is slower.
  23767. </p>
  23768. </dd>
  23769. <dt><samp class="option">thmse</samp></dt>
  23770. <dd><p>Set threshold of mean square error for block matching. Valid range is 0 to
  23771. INT32_MAX.
  23772. </p>
  23773. </dd>
  23774. <dt><samp class="option">hdthr</samp></dt>
  23775. <dd><p>Set thresholding parameter for hard thresholding in 3D transformed domain.
  23776. Larger values results in stronger hard-thresholding filtering in frequency
  23777. domain.
  23778. </p>
  23779. </dd>
  23780. <dt><samp class="option">estim</samp></dt>
  23781. <dd><p>Set filtering estimation mode. Can be <code class="code">basic</code> or <code class="code">final</code>.
  23782. Default is <code class="code">basic</code>.
  23783. </p>
  23784. </dd>
  23785. <dt><samp class="option">ref</samp></dt>
  23786. <dd><p>If enabled, filter will use 2nd stream for block matching.
  23787. Default is disabled for <code class="code">basic</code> value of <var class="var">estim</var> option,
  23788. and always enabled if value of <var class="var">estim</var> is <code class="code">final</code>.
  23789. </p>
  23790. </dd>
  23791. <dt><samp class="option">planes</samp></dt>
  23792. <dd><p>Set planes to filter. Default is all available except alpha.
  23793. </p></dd>
  23794. </dl>
  23795. <a name="Examples-67"></a>
  23796. <h4 class="subsection">32.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-67" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-67" aria-hidden="true">TOC</a></span></h4>
  23797. <ul class="itemize mark-bullet">
  23798. <li>Basic filtering with bm3d:
  23799. <div class="example">
  23800. <pre class="example-preformatted">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
  23801. </pre></div>
  23802. </li><li>Same as above, but filtering only luma:
  23803. <div class="example">
  23804. <pre class="example-preformatted">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
  23805. </pre></div>
  23806. </li><li>Same as above, but with both estimation modes:
  23807. <div class="example">
  23808. <pre class="example-preformatted">split[a][b],[a]bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
  23809. </pre></div>
  23810. </li><li>Same as above, but prefilter with <a class="ref" href="#nlmeans">nlmeans</a> filter instead:
  23811. <div class="example">
  23812. <pre class="example-preformatted">split[a][b],[a]nlmeans=s=3:r=7:p=3[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
  23813. </pre></div>
  23814. </li></ul>
  23815. <a name="boxblur"></a>
  23816. <h3 class="section">32.18 boxblur<span class="pull-right"><a class="anchor hidden-xs" href="#boxblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-boxblur" aria-hidden="true">TOC</a></span></h3>
  23817. <p>Apply a boxblur algorithm to the input video.
  23818. </p>
  23819. <p>It accepts the following parameters:
  23820. </p>
  23821. <dl class="table">
  23822. <dt><samp class="option">luma_radius, lr</samp></dt>
  23823. <dt><samp class="option">luma_power, lp</samp></dt>
  23824. <dt><samp class="option">chroma_radius, cr</samp></dt>
  23825. <dt><samp class="option">chroma_power, cp</samp></dt>
  23826. <dt><samp class="option">alpha_radius, ar</samp></dt>
  23827. <dt><samp class="option">alpha_power, ap</samp></dt>
  23828. </dl>
  23829. <p>A description of the accepted options follows.
  23830. </p>
  23831. <dl class="table">
  23832. <dt><samp class="option">luma_radius, lr</samp></dt>
  23833. <dt><samp class="option">chroma_radius, cr</samp></dt>
  23834. <dt><samp class="option">alpha_radius, ar</samp></dt>
  23835. <dd><p>Set an expression for the box radius in pixels used for blurring the
  23836. corresponding input plane.
  23837. </p>
  23838. <p>The radius value must be a non-negative number, and must not be
  23839. greater than the value of the expression <code class="code">min(w,h)/2</code> for the
  23840. luma and alpha planes, and of <code class="code">min(cw,ch)/2</code> for the chroma
  23841. planes.
  23842. </p>
  23843. <p>Default value for <samp class="option">luma_radius</samp> is &quot;2&quot;. If not specified,
  23844. <samp class="option">chroma_radius</samp> and <samp class="option">alpha_radius</samp> default to the
  23845. corresponding value set for <samp class="option">luma_radius</samp>.
  23846. </p>
  23847. <p>The expressions can contain the following constants:
  23848. </p><dl class="table">
  23849. <dt><samp class="option">w</samp></dt>
  23850. <dt><samp class="option">h</samp></dt>
  23851. <dd><p>The input width and height in pixels.
  23852. </p>
  23853. </dd>
  23854. <dt><samp class="option">cw</samp></dt>
  23855. <dt><samp class="option">ch</samp></dt>
  23856. <dd><p>The input chroma image width and height in pixels.
  23857. </p>
  23858. </dd>
  23859. <dt><samp class="option">hsub</samp></dt>
  23860. <dt><samp class="option">vsub</samp></dt>
  23861. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  23862. pixel format &quot;yuv422p&quot;, <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  23863. </p></dd>
  23864. </dl>
  23865. </dd>
  23866. <dt><samp class="option">luma_power, lp</samp></dt>
  23867. <dt><samp class="option">chroma_power, cp</samp></dt>
  23868. <dt><samp class="option">alpha_power, ap</samp></dt>
  23869. <dd><p>Specify how many times the boxblur filter is applied to the
  23870. corresponding plane.
  23871. </p>
  23872. <p>Default value for <samp class="option">luma_power</samp> is 2. If not specified,
  23873. <samp class="option">chroma_power</samp> and <samp class="option">alpha_power</samp> default to the
  23874. corresponding value set for <samp class="option">luma_power</samp>.
  23875. </p>
  23876. <p>A value of 0 will disable the effect.
  23877. </p></dd>
  23878. </dl>
  23879. <a name="Examples-68"></a>
  23880. <h4 class="subsection">32.18.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-68" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-68" aria-hidden="true">TOC</a></span></h4>
  23881. <ul class="itemize mark-bullet">
  23882. <li>Apply a boxblur filter with the luma, chroma, and alpha radii
  23883. set to 2:
  23884. <div class="example">
  23885. <pre class="example-preformatted">boxblur=luma_radius=2:luma_power=1
  23886. boxblur=2:1
  23887. </pre></div>
  23888. </li><li>Set the luma radius to 2, and alpha and chroma radius to 0:
  23889. <div class="example">
  23890. <pre class="example-preformatted">boxblur=2:1:cr=0:ar=0
  23891. </pre></div>
  23892. </li><li>Set the luma and chroma radii to a fraction of the video dimension:
  23893. <div class="example">
  23894. <pre class="example-preformatted">boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
  23895. </pre></div>
  23896. </li></ul>
  23897. <a class="anchor" id="bwdif"></a><a name="bwdif-1"></a>
  23898. <h3 class="section">32.19 bwdif<span class="pull-right"><a class="anchor hidden-xs" href="#bwdif-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bwdif-1" aria-hidden="true">TOC</a></span></h3>
  23899. <p>Deinterlace the input video (&quot;bwdif&quot; stands for &quot;Bob Weaver
  23900. Deinterlacing Filter&quot;).
  23901. </p>
  23902. <p>Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic
  23903. interpolation algorithms.
  23904. It accepts the following parameters:
  23905. </p>
  23906. <dl class="table">
  23907. <dt><samp class="option">mode</samp></dt>
  23908. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  23909. </p>
  23910. <dl class="table">
  23911. <dt><samp class="option">0, send_frame</samp></dt>
  23912. <dd><p>Output one frame for each frame.
  23913. </p></dd>
  23914. <dt><samp class="option">1, send_field</samp></dt>
  23915. <dd><p>Output one frame for each field.
  23916. </p></dd>
  23917. </dl>
  23918. <p>The default value is <code class="code">send_field</code>.
  23919. </p>
  23920. </dd>
  23921. <dt><samp class="option">parity</samp></dt>
  23922. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  23923. of the following values:
  23924. </p>
  23925. <dl class="table">
  23926. <dt><samp class="option">0, tff</samp></dt>
  23927. <dd><p>Assume the top field is first.
  23928. </p></dd>
  23929. <dt><samp class="option">1, bff</samp></dt>
  23930. <dd><p>Assume the bottom field is first.
  23931. </p></dd>
  23932. <dt><samp class="option">-1, auto</samp></dt>
  23933. <dd><p>Enable automatic detection of field parity.
  23934. </p></dd>
  23935. </dl>
  23936. <p>The default value is <code class="code">auto</code>.
  23937. If the interlacing is unknown or the decoder does not export this information,
  23938. top field first will be assumed.
  23939. </p>
  23940. </dd>
  23941. <dt><samp class="option">deint</samp></dt>
  23942. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  23943. values:
  23944. </p>
  23945. <dl class="table">
  23946. <dt><samp class="option">0, all</samp></dt>
  23947. <dd><p>Deinterlace all frames.
  23948. </p></dd>
  23949. <dt><samp class="option">1, interlaced</samp></dt>
  23950. <dd><p>Only deinterlace frames marked as interlaced.
  23951. </p></dd>
  23952. </dl>
  23953. <p>The default value is <code class="code">all</code>.
  23954. </p></dd>
  23955. </dl>
  23956. <a name="ccrepack"></a>
  23957. <h3 class="section">32.20 ccrepack<span class="pull-right"><a class="anchor hidden-xs" href="#ccrepack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ccrepack" aria-hidden="true">TOC</a></span></h3>
  23958. <p>Repack CEA-708 closed captioning side data
  23959. </p>
  23960. <p>This filter fixes various issues seen with commercial encoders
  23961. related to upstream malformed CEA-708 payloads, specifically
  23962. incorrect number of tuples (wrong cc_count for the target FPS),
  23963. and incorrect ordering of tuples (i.e. the CEA-608 tuples are not at
  23964. the first entries in the payload).
  23965. </p>
  23966. <a name="cas"></a>
  23967. <h3 class="section">32.21 cas<span class="pull-right"><a class="anchor hidden-xs" href="#cas" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cas" aria-hidden="true">TOC</a></span></h3>
  23968. <p>Apply Contrast Adaptive Sharpen filter to video stream.
  23969. </p>
  23970. <p>The filter accepts the following options:
  23971. </p>
  23972. <dl class="table">
  23973. <dt><samp class="option">strength</samp></dt>
  23974. <dd><p>Set the sharpening strength. Default value is 0.
  23975. </p>
  23976. </dd>
  23977. <dt><samp class="option">planes</samp></dt>
  23978. <dd><p>Set planes to filter. Default value is to filter all
  23979. planes except alpha plane.
  23980. </p></dd>
  23981. </dl>
  23982. <a name="Commands-61"></a>
  23983. <h4 class="subsection">32.21.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-61" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-61" aria-hidden="true">TOC</a></span></h4>
  23984. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  23985. </p>
  23986. <a name="chromahold"></a>
  23987. <h3 class="section">32.22 chromahold<span class="pull-right"><a class="anchor hidden-xs" href="#chromahold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromahold" aria-hidden="true">TOC</a></span></h3>
  23988. <p>Remove all color information for all colors except for certain one.
  23989. </p>
  23990. <p>The filter accepts the following options:
  23991. </p>
  23992. <dl class="table">
  23993. <dt><samp class="option">color</samp></dt>
  23994. <dd><p>The color which will not be replaced with neutral chroma.
  23995. </p>
  23996. </dd>
  23997. <dt><samp class="option">similarity</samp></dt>
  23998. <dd><p>Similarity percentage with the above color.
  23999. 0.01 matches only the exact key color, while 1.0 matches everything.
  24000. </p>
  24001. </dd>
  24002. <dt><samp class="option">blend</samp></dt>
  24003. <dd><p>Blend percentage.
  24004. 0.0 makes pixels either fully gray, or not gray at all.
  24005. Higher values result in more preserved color.
  24006. </p>
  24007. </dd>
  24008. <dt><samp class="option">yuv</samp></dt>
  24009. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  24010. </p>
  24011. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  24012. This can be used to pass exact YUV values as hexadecimal numbers.
  24013. </p></dd>
  24014. </dl>
  24015. <a name="Commands-62"></a>
  24016. <h4 class="subsection">32.22.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-62" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-62" aria-hidden="true">TOC</a></span></h4>
  24017. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  24018. The command accepts the same syntax of the corresponding option.
  24019. </p>
  24020. <p>If the specified expression is not valid, it is kept at its current
  24021. value.
  24022. </p>
  24023. <a class="anchor" id="chromakey"></a><a name="chromakey-1"></a>
  24024. <h3 class="section">32.23 chromakey<span class="pull-right"><a class="anchor hidden-xs" href="#chromakey-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromakey-1" aria-hidden="true">TOC</a></span></h3>
  24025. <p>YUV colorspace color/chroma keying.
  24026. </p>
  24027. <p>The filter accepts the following options:
  24028. </p>
  24029. <dl class="table">
  24030. <dt><samp class="option">color</samp></dt>
  24031. <dd><p>The color which will be replaced with transparency.
  24032. </p>
  24033. </dd>
  24034. <dt><samp class="option">similarity</samp></dt>
  24035. <dd><p>Similarity percentage with the key color.
  24036. </p>
  24037. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  24038. </p>
  24039. </dd>
  24040. <dt><samp class="option">blend</samp></dt>
  24041. <dd><p>Blend percentage.
  24042. </p>
  24043. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  24044. </p>
  24045. <p>Higher values result in semi-transparent pixels, with a higher transparency
  24046. the more similar the pixels color is to the key color.
  24047. </p>
  24048. </dd>
  24049. <dt><samp class="option">yuv</samp></dt>
  24050. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  24051. </p>
  24052. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  24053. This can be used to pass exact YUV values as hexadecimal numbers.
  24054. </p></dd>
  24055. </dl>
  24056. <a name="Commands-63"></a>
  24057. <h4 class="subsection">32.23.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-63" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-63" aria-hidden="true">TOC</a></span></h4>
  24058. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  24059. The command accepts the same syntax of the corresponding option.
  24060. </p>
  24061. <p>If the specified expression is not valid, it is kept at its current
  24062. value.
  24063. </p>
  24064. <a name="Examples-69"></a>
  24065. <h4 class="subsection">32.23.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-69" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-69" aria-hidden="true">TOC</a></span></h4>
  24066. <ul class="itemize mark-bullet">
  24067. <li>Make every green pixel in the input image transparent:
  24068. <div class="example">
  24069. <pre class="example-preformatted">ffmpeg -i input.png -vf chromakey=green out.png
  24070. </pre></div>
  24071. </li><li>Overlay a greenscreen-video on top of a static black background.
  24072. <div class="example">
  24073. <pre class="example-preformatted">ffmpeg -f lavfi -i color=c=black:s=1280x720 -i video.mp4 -shortest -filter_complex &quot;[1:v]chromakey=0x70de77:0.1:0.2[ckout];[0:v][ckout]overlay[out]&quot; -map &quot;[out]&quot; output.mkv
  24074. </pre></div>
  24075. </li></ul>
  24076. <a name="chromanr"></a>
  24077. <h3 class="section">32.24 chromanr<span class="pull-right"><a class="anchor hidden-xs" href="#chromanr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromanr" aria-hidden="true">TOC</a></span></h3>
  24078. <p>Reduce chrominance noise.
  24079. </p>
  24080. <p>The filter accepts the following options:
  24081. </p>
  24082. <dl class="table">
  24083. <dt><samp class="option">thres</samp></dt>
  24084. <dd><p>Set threshold for averaging chrominance values.
  24085. Sum of absolute difference of Y, U and V pixel components of current
  24086. pixel and neighbour pixels lower than this threshold will be used in
  24087. averaging. Luma component is left unchanged and is copied to output.
  24088. Default value is 30. Allowed range is from 1 to 200.
  24089. </p>
  24090. </dd>
  24091. <dt><samp class="option">sizew</samp></dt>
  24092. <dd><p>Set horizontal radius of rectangle used for averaging.
  24093. Allowed range is from 1 to 100. Default value is 5.
  24094. </p>
  24095. </dd>
  24096. <dt><samp class="option">sizeh</samp></dt>
  24097. <dd><p>Set vertical radius of rectangle used for averaging.
  24098. Allowed range is from 1 to 100. Default value is 5.
  24099. </p>
  24100. </dd>
  24101. <dt><samp class="option">stepw</samp></dt>
  24102. <dd><p>Set horizontal step when averaging. Default value is 1.
  24103. Allowed range is from 1 to 50.
  24104. Mostly useful to speed-up filtering.
  24105. </p>
  24106. </dd>
  24107. <dt><samp class="option">steph</samp></dt>
  24108. <dd><p>Set vertical step when averaging. Default value is 1.
  24109. Allowed range is from 1 to 50.
  24110. Mostly useful to speed-up filtering.
  24111. </p>
  24112. </dd>
  24113. <dt><samp class="option">threy</samp></dt>
  24114. <dd><p>Set Y threshold for averaging chrominance values.
  24115. Set finer control for max allowed difference between Y components
  24116. of current pixel and neighbour pixels.
  24117. Default value is 200. Allowed range is from 1 to 200.
  24118. </p>
  24119. </dd>
  24120. <dt><samp class="option">threu</samp></dt>
  24121. <dd><p>Set U threshold for averaging chrominance values.
  24122. Set finer control for max allowed difference between U components
  24123. of current pixel and neighbour pixels.
  24124. Default value is 200. Allowed range is from 1 to 200.
  24125. </p>
  24126. </dd>
  24127. <dt><samp class="option">threv</samp></dt>
  24128. <dd><p>Set V threshold for averaging chrominance values.
  24129. Set finer control for max allowed difference between V components
  24130. of current pixel and neighbour pixels.
  24131. Default value is 200. Allowed range is from 1 to 200.
  24132. </p>
  24133. </dd>
  24134. <dt><samp class="option">distance</samp></dt>
  24135. <dd><p>Set distance type used in calculations.
  24136. </p>
  24137. <dl class="table">
  24138. <dt>&lsquo;<samp class="samp">manhattan</samp>&rsquo;</dt>
  24139. <dd><p>Absolute difference.
  24140. </p></dd>
  24141. <dt>&lsquo;<samp class="samp">euclidean</samp>&rsquo;</dt>
  24142. <dd><p>Difference squared.
  24143. </p></dd>
  24144. </dl>
  24145. <p>Default distance type is manhattan.
  24146. </p></dd>
  24147. </dl>
  24148. <a name="Commands-64"></a>
  24149. <h4 class="subsection">32.24.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-64" aria-hidden="true">TOC</a></span></h4>
  24150. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  24151. The command accepts the same syntax of the corresponding option.
  24152. </p>
  24153. <a name="chromashift"></a>
  24154. <h3 class="section">32.25 chromashift<span class="pull-right"><a class="anchor hidden-xs" href="#chromashift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromashift" aria-hidden="true">TOC</a></span></h3>
  24155. <p>Shift chroma pixels horizontally and/or vertically.
  24156. </p>
  24157. <p>The filter accepts the following options:
  24158. </p><dl class="table">
  24159. <dt><samp class="option">cbh</samp></dt>
  24160. <dd><p>Set amount to shift chroma-blue horizontally.
  24161. </p></dd>
  24162. <dt><samp class="option">cbv</samp></dt>
  24163. <dd><p>Set amount to shift chroma-blue vertically.
  24164. </p></dd>
  24165. <dt><samp class="option">crh</samp></dt>
  24166. <dd><p>Set amount to shift chroma-red horizontally.
  24167. </p></dd>
  24168. <dt><samp class="option">crv</samp></dt>
  24169. <dd><p>Set amount to shift chroma-red vertically.
  24170. </p></dd>
  24171. <dt><samp class="option">edge</samp></dt>
  24172. <dd><p>Set edge mode, can be <var class="var">smear</var>, default, or <var class="var">warp</var>.
  24173. </p></dd>
  24174. </dl>
  24175. <a name="Commands-65"></a>
  24176. <h4 class="subsection">32.25.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-65" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-65" aria-hidden="true">TOC</a></span></h4>
  24177. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  24178. </p>
  24179. <a name="ciescope"></a>
  24180. <h3 class="section">32.26 ciescope<span class="pull-right"><a class="anchor hidden-xs" href="#ciescope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ciescope" aria-hidden="true">TOC</a></span></h3>
  24181. <p>Display CIE color diagram with pixels overlaid onto it.
  24182. </p>
  24183. <p>The filter accepts the following options:
  24184. </p>
  24185. <dl class="table">
  24186. <dt><samp class="option">system</samp></dt>
  24187. <dd><p>Set color system.
  24188. </p>
  24189. <dl class="table">
  24190. <dt>&lsquo;<samp class="samp">ntsc, 470m</samp>&rsquo;</dt>
  24191. <dt>&lsquo;<samp class="samp">ebu, 470bg</samp>&rsquo;</dt>
  24192. <dt>&lsquo;<samp class="samp">smpte</samp>&rsquo;</dt>
  24193. <dt>&lsquo;<samp class="samp">240m</samp>&rsquo;</dt>
  24194. <dt>&lsquo;<samp class="samp">apple</samp>&rsquo;</dt>
  24195. <dt>&lsquo;<samp class="samp">widergb</samp>&rsquo;</dt>
  24196. <dt>&lsquo;<samp class="samp">cie1931</samp>&rsquo;</dt>
  24197. <dt>&lsquo;<samp class="samp">rec709, hdtv</samp>&rsquo;</dt>
  24198. <dt>&lsquo;<samp class="samp">uhdtv, rec2020</samp>&rsquo;</dt>
  24199. <dt>&lsquo;<samp class="samp">dcip3</samp>&rsquo;</dt>
  24200. </dl>
  24201. </dd>
  24202. <dt><samp class="option">cie</samp></dt>
  24203. <dd><p>Set CIE system.
  24204. </p>
  24205. <dl class="table">
  24206. <dt>&lsquo;<samp class="samp">xyy</samp>&rsquo;</dt>
  24207. <dt>&lsquo;<samp class="samp">ucs</samp>&rsquo;</dt>
  24208. <dt>&lsquo;<samp class="samp">luv</samp>&rsquo;</dt>
  24209. </dl>
  24210. </dd>
  24211. <dt><samp class="option">gamuts</samp></dt>
  24212. <dd><p>Set what gamuts to draw.
  24213. </p>
  24214. <p>See <code class="code">system</code> option for available values.
  24215. </p>
  24216. </dd>
  24217. <dt><samp class="option">size, s</samp></dt>
  24218. <dd><p>Set ciescope size, by default set to 512.
  24219. </p>
  24220. </dd>
  24221. <dt><samp class="option">intensity, i</samp></dt>
  24222. <dd><p>Set intensity used to map input pixel values to CIE diagram.
  24223. </p>
  24224. </dd>
  24225. <dt><samp class="option">contrast</samp></dt>
  24226. <dd><p>Set contrast used to draw tongue colors that are out of active color system gamut.
  24227. </p>
  24228. </dd>
  24229. <dt><samp class="option">corrgamma</samp></dt>
  24230. <dd><p>Correct gamma displayed on scope, by default enabled.
  24231. </p>
  24232. </dd>
  24233. <dt><samp class="option">showwhite</samp></dt>
  24234. <dd><p>Show white point on CIE diagram, by default disabled.
  24235. </p>
  24236. </dd>
  24237. <dt><samp class="option">gamma</samp></dt>
  24238. <dd><p>Set input gamma. Used only with XYZ input color space.
  24239. </p>
  24240. </dd>
  24241. <dt><samp class="option">fill</samp></dt>
  24242. <dd><p>Fill with CIE colors. By default is enabled.
  24243. </p></dd>
  24244. </dl>
  24245. <a name="codecview"></a>
  24246. <h3 class="section">32.27 codecview<span class="pull-right"><a class="anchor hidden-xs" href="#codecview" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-codecview" aria-hidden="true">TOC</a></span></h3>
  24247. <p>Visualize information exported by some codecs.
  24248. </p>
  24249. <p>Some codecs can export information through frames using side-data or other
  24250. means. For example, some MPEG based codecs export motion vectors through the
  24251. <var class="var">export_mvs</var> flag in the codec <samp class="option">flags2</samp> option.
  24252. </p>
  24253. <p>The filter accepts the following option:
  24254. </p>
  24255. <dl class="table">
  24256. <dt><samp class="option">block</samp></dt>
  24257. <dd><p>Display block partition structure using the luma plane.
  24258. </p>
  24259. </dd>
  24260. <dt><samp class="option">mv</samp></dt>
  24261. <dd><p>Set motion vectors to visualize.
  24262. </p>
  24263. <p>Available flags for <var class="var">mv</var> are:
  24264. </p>
  24265. <dl class="table">
  24266. <dt>&lsquo;<samp class="samp">pf</samp>&rsquo;</dt>
  24267. <dd><p>forward predicted MVs of P-frames
  24268. </p></dd>
  24269. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  24270. <dd><p>forward predicted MVs of B-frames
  24271. </p></dd>
  24272. <dt>&lsquo;<samp class="samp">bb</samp>&rsquo;</dt>
  24273. <dd><p>backward predicted MVs of B-frames
  24274. </p></dd>
  24275. </dl>
  24276. </dd>
  24277. <dt><samp class="option">qp</samp></dt>
  24278. <dd><p>Display quantization parameters using the chroma planes.
  24279. </p>
  24280. </dd>
  24281. <dt><samp class="option">mv_type, mvt</samp></dt>
  24282. <dd><p>Set motion vectors type to visualize. Includes MVs from all frames unless specified by <var class="var">frame_type</var> option.
  24283. </p>
  24284. <p>Available flags for <var class="var">mv_type</var> are:
  24285. </p>
  24286. <dl class="table">
  24287. <dt>&lsquo;<samp class="samp">fp</samp>&rsquo;</dt>
  24288. <dd><p>forward predicted MVs
  24289. </p></dd>
  24290. <dt>&lsquo;<samp class="samp">bp</samp>&rsquo;</dt>
  24291. <dd><p>backward predicted MVs
  24292. </p></dd>
  24293. </dl>
  24294. </dd>
  24295. <dt><samp class="option">frame_type, ft</samp></dt>
  24296. <dd><p>Set frame type to visualize motion vectors of.
  24297. </p>
  24298. <p>Available flags for <var class="var">frame_type</var> are:
  24299. </p>
  24300. <dl class="table">
  24301. <dt>&lsquo;<samp class="samp">if</samp>&rsquo;</dt>
  24302. <dd><p>intra-coded frames (I-frames)
  24303. </p></dd>
  24304. <dt>&lsquo;<samp class="samp">pf</samp>&rsquo;</dt>
  24305. <dd><p>predicted frames (P-frames)
  24306. </p></dd>
  24307. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  24308. <dd><p>bi-directionally predicted frames (B-frames)
  24309. </p></dd>
  24310. </dl>
  24311. </dd>
  24312. </dl>
  24313. <a name="Examples-70"></a>
  24314. <h4 class="subsection">32.27.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-70" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-70" aria-hidden="true">TOC</a></span></h4>
  24315. <ul class="itemize mark-bullet">
  24316. <li>Visualize forward predicted MVs of all frames using <code class="command">ffplay</code>:
  24317. <div class="example">
  24318. <pre class="example-preformatted">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
  24319. </pre></div>
  24320. </li><li>Visualize multi-directionals MVs of P and B-Frames using <code class="command">ffplay</code>:
  24321. <div class="example">
  24322. <pre class="example-preformatted">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
  24323. </pre></div>
  24324. </li></ul>
  24325. <a name="colorbalance"></a>
  24326. <h3 class="section">32.28 colorbalance<span class="pull-right"><a class="anchor hidden-xs" href="#colorbalance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorbalance" aria-hidden="true">TOC</a></span></h3>
  24327. <p>Modify intensity of primary colors (red, green and blue) of input frames.
  24328. </p>
  24329. <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
  24330. regions for the red-cyan, green-magenta or blue-yellow balance.
  24331. </p>
  24332. <p>A positive adjustment value shifts the balance towards the primary color, a negative
  24333. value towards the complementary color.
  24334. </p>
  24335. <p>The filter accepts the following options:
  24336. </p>
  24337. <dl class="table">
  24338. <dt><samp class="option">rs</samp></dt>
  24339. <dt><samp class="option">gs</samp></dt>
  24340. <dt><samp class="option">bs</samp></dt>
  24341. <dd><p>Adjust red, green and blue shadows (darkest pixels).
  24342. </p>
  24343. </dd>
  24344. <dt><samp class="option">rm</samp></dt>
  24345. <dt><samp class="option">gm</samp></dt>
  24346. <dt><samp class="option">bm</samp></dt>
  24347. <dd><p>Adjust red, green and blue midtones (medium pixels).
  24348. </p>
  24349. </dd>
  24350. <dt><samp class="option">rh</samp></dt>
  24351. <dt><samp class="option">gh</samp></dt>
  24352. <dt><samp class="option">bh</samp></dt>
  24353. <dd><p>Adjust red, green and blue highlights (brightest pixels).
  24354. </p>
  24355. <p>Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">0</code>.
  24356. </p>
  24357. </dd>
  24358. <dt><samp class="option">pl</samp></dt>
  24359. <dd><p>Preserve lightness when changing color balance. Default is disabled.
  24360. </p></dd>
  24361. </dl>
  24362. <a name="Examples-71"></a>
  24363. <h4 class="subsection">32.28.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-71" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-71" aria-hidden="true">TOC</a></span></h4>
  24364. <ul class="itemize mark-bullet">
  24365. <li>Add red color cast to shadows:
  24366. <div class="example">
  24367. <pre class="example-preformatted">colorbalance=rs=.3
  24368. </pre></div>
  24369. </li></ul>
  24370. <a name="Commands-66"></a>
  24371. <h4 class="subsection">32.28.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-66" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-66" aria-hidden="true">TOC</a></span></h4>
  24372. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  24373. </p>
  24374. <a name="colorcontrast"></a>
  24375. <h3 class="section">32.29 colorcontrast<span class="pull-right"><a class="anchor hidden-xs" href="#colorcontrast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorcontrast" aria-hidden="true">TOC</a></span></h3>
  24376. <p>Adjust color contrast between RGB components.
  24377. </p>
  24378. <p>The filter accepts the following options:
  24379. </p>
  24380. <dl class="table">
  24381. <dt><samp class="option">rc</samp></dt>
  24382. <dd><p>Set the red-cyan contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  24383. </p>
  24384. </dd>
  24385. <dt><samp class="option">gm</samp></dt>
  24386. <dd><p>Set the green-magenta contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  24387. </p>
  24388. </dd>
  24389. <dt><samp class="option">by</samp></dt>
  24390. <dd><p>Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  24391. </p>
  24392. </dd>
  24393. <dt><samp class="option">rcw</samp></dt>
  24394. <dt><samp class="option">gmw</samp></dt>
  24395. <dt><samp class="option">byw</samp></dt>
  24396. <dd><p>Set the weight of each <code class="code">rc</code>, <code class="code">gm</code>, <code class="code">by</code> option value. Default value is 0.0.
  24397. Allowed range is from 0.0 to 1.0. If all weights are 0.0 filtering is disabled.
  24398. </p>
  24399. </dd>
  24400. <dt><samp class="option">pl</samp></dt>
  24401. <dd><p>Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  24402. </p></dd>
  24403. </dl>
  24404. <a name="Commands-67"></a>
  24405. <h4 class="subsection">32.29.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-67" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-67" aria-hidden="true">TOC</a></span></h4>
  24406. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  24407. </p>
  24408. <a name="colorcorrect"></a>
  24409. <h3 class="section">32.30 colorcorrect<span class="pull-right"><a class="anchor hidden-xs" href="#colorcorrect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorcorrect" aria-hidden="true">TOC</a></span></h3>
  24410. <p>Adjust color white balance selectively for blacks and whites.
  24411. This filter operates in YUV colorspace.
  24412. </p>
  24413. <p>The filter accepts the following options:
  24414. </p>
  24415. <dl class="table">
  24416. <dt><samp class="option">rl</samp></dt>
  24417. <dd><p>Set the red shadow spot. Allowed range is from -1.0 to 1.0.
  24418. Default value is 0.
  24419. </p>
  24420. </dd>
  24421. <dt><samp class="option">bl</samp></dt>
  24422. <dd><p>Set the blue shadow spot. Allowed range is from -1.0 to 1.0.
  24423. Default value is 0.
  24424. </p>
  24425. </dd>
  24426. <dt><samp class="option">rh</samp></dt>
  24427. <dd><p>Set the red highlight spot. Allowed range is from -1.0 to 1.0.
  24428. Default value is 0.
  24429. </p>
  24430. </dd>
  24431. <dt><samp class="option">bh</samp></dt>
  24432. <dd><p>Set the blue highlight spot. Allowed range is from -1.0 to 1.0.
  24433. Default value is 0.
  24434. </p>
  24435. </dd>
  24436. <dt><samp class="option">saturation</samp></dt>
  24437. <dd><p>Set the amount of saturation. Allowed range is from -3.0 to 3.0.
  24438. Default value is 1.
  24439. </p>
  24440. </dd>
  24441. <dt><samp class="option">analyze</samp></dt>
  24442. <dd><p>If set to anything other than <code class="code">manual</code> it will analyze every frame and use derived
  24443. parameters for filtering output frame.
  24444. </p>
  24445. <p>Possible values are:
  24446. </p><dl class="table">
  24447. <dt>&lsquo;<samp class="samp">manual</samp>&rsquo;</dt>
  24448. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  24449. <dt>&lsquo;<samp class="samp">minmax</samp>&rsquo;</dt>
  24450. <dt>&lsquo;<samp class="samp">median</samp>&rsquo;</dt>
  24451. </dl>
  24452. <p>Default value is <code class="code">manual</code>.
  24453. </p></dd>
  24454. </dl>
  24455. <a name="Commands-68"></a>
  24456. <h4 class="subsection">32.30.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-68" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-68" aria-hidden="true">TOC</a></span></h4>
  24457. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  24458. </p>
  24459. <a name="colorchannelmixer"></a>
  24460. <h3 class="section">32.31 colorchannelmixer<span class="pull-right"><a class="anchor hidden-xs" href="#colorchannelmixer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorchannelmixer" aria-hidden="true">TOC</a></span></h3>
  24461. <p>Adjust video input frames by re-mixing color channels.
  24462. </p>
  24463. <p>This filter modifies a color channel by adding the values associated to
  24464. the other channels of the same pixels. For example if the value to
  24465. modify is red, the output value will be:
  24466. </p><div class="example">
  24467. <pre class="example-preformatted"><var class="var">red</var>=<var class="var">red</var>*<var class="var">rr</var> + <var class="var">blue</var>*<var class="var">rb</var> + <var class="var">green</var>*<var class="var">rg</var> + <var class="var">alpha</var>*<var class="var">ra</var>
  24468. </pre></div>
  24469. <p>The filter accepts the following options:
  24470. </p>
  24471. <dl class="table">
  24472. <dt><samp class="option">rr</samp></dt>
  24473. <dt><samp class="option">rg</samp></dt>
  24474. <dt><samp class="option">rb</samp></dt>
  24475. <dt><samp class="option">ra</samp></dt>
  24476. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
  24477. Default is <code class="code">1</code> for <var class="var">rr</var>, and <code class="code">0</code> for <var class="var">rg</var>, <var class="var">rb</var> and <var class="var">ra</var>.
  24478. </p>
  24479. </dd>
  24480. <dt><samp class="option">gr</samp></dt>
  24481. <dt><samp class="option">gg</samp></dt>
  24482. <dt><samp class="option">gb</samp></dt>
  24483. <dt><samp class="option">ga</samp></dt>
  24484. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
  24485. Default is <code class="code">1</code> for <var class="var">gg</var>, and <code class="code">0</code> for <var class="var">gr</var>, <var class="var">gb</var> and <var class="var">ga</var>.
  24486. </p>
  24487. </dd>
  24488. <dt><samp class="option">br</samp></dt>
  24489. <dt><samp class="option">bg</samp></dt>
  24490. <dt><samp class="option">bb</samp></dt>
  24491. <dt><samp class="option">ba</samp></dt>
  24492. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
  24493. Default is <code class="code">1</code> for <var class="var">bb</var>, and <code class="code">0</code> for <var class="var">br</var>, <var class="var">bg</var> and <var class="var">ba</var>.
  24494. </p>
  24495. </dd>
  24496. <dt><samp class="option">ar</samp></dt>
  24497. <dt><samp class="option">ag</samp></dt>
  24498. <dt><samp class="option">ab</samp></dt>
  24499. <dt><samp class="option">aa</samp></dt>
  24500. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
  24501. Default is <code class="code">1</code> for <var class="var">aa</var>, and <code class="code">0</code> for <var class="var">ar</var>, <var class="var">ag</var> and <var class="var">ab</var>.
  24502. </p>
  24503. <p>Allowed ranges for options are <code class="code">[-2.0, 2.0]</code>.
  24504. </p>
  24505. </dd>
  24506. <dt><samp class="option">pc</samp></dt>
  24507. <dd><p>Set preserve color mode. The accepted values are:
  24508. </p><dl class="table">
  24509. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  24510. <dd><p>Disable color preserving, this is default.
  24511. </p></dd>
  24512. <dt>&lsquo;<samp class="samp">lum</samp>&rsquo;</dt>
  24513. <dd><p>Preserve luminance.
  24514. </p></dd>
  24515. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  24516. <dd><p>Preserve max value of RGB triplet.
  24517. </p></dd>
  24518. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  24519. <dd><p>Preserve average value of RGB triplet.
  24520. </p></dd>
  24521. <dt>&lsquo;<samp class="samp">sum</samp>&rsquo;</dt>
  24522. <dd><p>Preserve sum value of RGB triplet.
  24523. </p></dd>
  24524. <dt>&lsquo;<samp class="samp">nrm</samp>&rsquo;</dt>
  24525. <dd><p>Preserve normalized value of RGB triplet.
  24526. </p></dd>
  24527. <dt>&lsquo;<samp class="samp">pwr</samp>&rsquo;</dt>
  24528. <dd><p>Preserve power value of RGB triplet.
  24529. </p></dd>
  24530. </dl>
  24531. </dd>
  24532. <dt><samp class="option">pa</samp></dt>
  24533. <dd><p>Set the preserve color amount when changing colors. Allowed range is from <code class="code">[0.0, 1.0]</code>.
  24534. Default is <code class="code">0.0</code>, thus disabled.
  24535. </p></dd>
  24536. </dl>
  24537. <a name="Examples-72"></a>
  24538. <h4 class="subsection">32.31.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-72" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-72" aria-hidden="true">TOC</a></span></h4>
  24539. <ul class="itemize mark-bullet">
  24540. <li>Convert source to grayscale:
  24541. <div class="example">
  24542. <pre class="example-preformatted">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
  24543. </pre></div>
  24544. </li><li>Simulate sepia tones:
  24545. <div class="example">
  24546. <pre class="example-preformatted">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
  24547. </pre></div>
  24548. </li></ul>
  24549. <a name="Commands-69"></a>
  24550. <h4 class="subsection">32.31.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-69" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-69" aria-hidden="true">TOC</a></span></h4>
  24551. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  24552. </p>
  24553. <a name="colordetect"></a>
  24554. <h3 class="section">32.32 colordetect<span class="pull-right"><a class="anchor hidden-xs" href="#colordetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colordetect" aria-hidden="true">TOC</a></span></h3>
  24555. <p>Analyze the video frames to determine the effective value range and alpha
  24556. mode.
  24557. </p>
  24558. <p>The filter accepts the following options:
  24559. </p>
  24560. <dl class="table">
  24561. <dt><samp class="option">mode</samp></dt>
  24562. <dd><p>Set of properties to detect. Unavailable properties, such as alpha mode for
  24563. an input image without an alpha channel, will be ignored automatically.
  24564. </p>
  24565. <p>Accepts a combination of the following flags:
  24566. </p>
  24567. <dl class="table">
  24568. <dt>&lsquo;<samp class="samp">color_range</samp>&rsquo;</dt>
  24569. <dd><p>Detect if the source contains luma pixels outside the limited (MPEG) range,
  24570. which indicates that this is a full range YUV source.
  24571. </p></dd>
  24572. <dt>&lsquo;<samp class="samp">alpha_mode</samp>&rsquo;</dt>
  24573. <dd><p>Detect if the source contains color values above the alpha channel, which
  24574. indicates that the alpha channel is independent (straight), rather than
  24575. premultiplied. Also detects if the alpha plane is fully opaque or not.
  24576. </p></dd>
  24577. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  24578. <dd><p>Enable detection of all of the above properties. This is the default.
  24579. </p></dd>
  24580. </dl>
  24581. </dd>
  24582. </dl>
  24583. <a name="colorize"></a>
  24584. <h3 class="section">32.33 colorize<span class="pull-right"><a class="anchor hidden-xs" href="#colorize" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorize" aria-hidden="true">TOC</a></span></h3>
  24585. <p>Overlay a solid color on the video stream.
  24586. </p>
  24587. <p>The filter accepts the following options:
  24588. </p>
  24589. <dl class="table">
  24590. <dt><samp class="option">hue</samp></dt>
  24591. <dd><p>Set the color hue. Allowed range is from 0 to 360.
  24592. Default value is 0.
  24593. </p>
  24594. </dd>
  24595. <dt><samp class="option">saturation</samp></dt>
  24596. <dd><p>Set the color saturation. Allowed range is from 0 to 1.
  24597. Default value is 0.5.
  24598. </p>
  24599. </dd>
  24600. <dt><samp class="option">lightness</samp></dt>
  24601. <dd><p>Set the color lightness. Allowed range is from 0 to 1.
  24602. Default value is 0.5.
  24603. </p>
  24604. </dd>
  24605. <dt><samp class="option">mix</samp></dt>
  24606. <dd><p>Set the mix of source lightness. By default is set to 1.0.
  24607. Allowed range is from 0.0 to 1.0.
  24608. </p></dd>
  24609. </dl>
  24610. <a name="Commands-70"></a>
  24611. <h4 class="subsection">32.33.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-70" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-70" aria-hidden="true">TOC</a></span></h4>
  24612. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  24613. </p>
  24614. <a name="colorkey"></a>
  24615. <h3 class="section">32.34 colorkey<span class="pull-right"><a class="anchor hidden-xs" href="#colorkey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorkey" aria-hidden="true">TOC</a></span></h3>
  24616. <p>RGB colorspace color keying.
  24617. This filter operates on 8-bit RGB format frames by setting the alpha component of each pixel
  24618. which falls within the similarity radius of the key color to 0. The alpha value for pixels outside
  24619. the similarity radius depends on the value of the blend option.
  24620. </p>
  24621. <p>The filter accepts the following options:
  24622. </p>
  24623. <dl class="table">
  24624. <dt><samp class="option">color</samp></dt>
  24625. <dd><p>Set the color for which alpha will be set to 0 (full transparency).
  24626. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  24627. Default is <code class="code">black</code>.
  24628. </p>
  24629. </dd>
  24630. <dt><samp class="option">similarity</samp></dt>
  24631. <dd><p>Set the radius from the key color within which other colors also have full transparency.
  24632. The computed distance is related to the unit fractional distance in 3D space between the RGB values
  24633. of the key color and the pixel&rsquo;s color. Range is 0.01 to 1.0. 0.01 matches within a very small radius
  24634. around the exact key color, while 1.0 matches everything.
  24635. Default is <code class="code">0.01</code>.
  24636. </p>
  24637. </dd>
  24638. <dt><samp class="option">blend</samp></dt>
  24639. <dd><p>Set how the alpha value for pixels that fall outside the similarity radius is computed.
  24640. 0.0 makes pixels either fully transparent or fully opaque.
  24641. Higher values result in semi-transparent pixels, with greater transparency
  24642. the more similar the pixel color is to the key color.
  24643. Range is 0.0 to 1.0. Default is <code class="code">0.0</code>.
  24644. </p></dd>
  24645. </dl>
  24646. <a name="Examples-73"></a>
  24647. <h4 class="subsection">32.34.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-73" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-73" aria-hidden="true">TOC</a></span></h4>
  24648. <ul class="itemize mark-bullet">
  24649. <li>Make every green pixel in the input image transparent:
  24650. <div class="example">
  24651. <pre class="example-preformatted">ffmpeg -i input.png -vf colorkey=green out.png
  24652. </pre></div>
  24653. </li><li>Overlay a greenscreen-video on top of a static background image.
  24654. <div class="example">
  24655. <pre class="example-preformatted">ffmpeg -i background.png -i video.mp4 -filter_complex &quot;[1:v]colorkey=0x3BBD1E:0.3:0.2[ckout];[0:v][ckout]overlay[out]&quot; -map &quot;[out]&quot; output.flv
  24656. </pre></div>
  24657. </li></ul>
  24658. <a name="Commands-71"></a>
  24659. <h4 class="subsection">32.34.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-71" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-71" aria-hidden="true">TOC</a></span></h4>
  24660. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  24661. The command accepts the same syntax of the corresponding option.
  24662. </p>
  24663. <p>If the specified expression is not valid, it is kept at its current
  24664. value.
  24665. </p>
  24666. <a name="colorhold"></a>
  24667. <h3 class="section">32.35 colorhold<span class="pull-right"><a class="anchor hidden-xs" href="#colorhold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorhold" aria-hidden="true">TOC</a></span></h3>
  24668. <p>Remove all color information for all RGB colors except for certain one.
  24669. </p>
  24670. <p>The filter accepts the following options:
  24671. </p>
  24672. <dl class="table">
  24673. <dt><samp class="option">color</samp></dt>
  24674. <dd><p>The color which will not be replaced with neutral gray.
  24675. </p>
  24676. </dd>
  24677. <dt><samp class="option">similarity</samp></dt>
  24678. <dd><p>Similarity percentage with the above color.
  24679. 0.01 matches only the exact key color, while 1.0 matches everything.
  24680. </p>
  24681. </dd>
  24682. <dt><samp class="option">blend</samp></dt>
  24683. <dd><p>Blend percentage. 0.0 makes pixels fully gray.
  24684. Higher values result in more preserved color.
  24685. </p></dd>
  24686. </dl>
  24687. <a name="Commands-72"></a>
  24688. <h4 class="subsection">32.35.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-72" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-72" aria-hidden="true">TOC</a></span></h4>
  24689. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  24690. The command accepts the same syntax of the corresponding option.
  24691. </p>
  24692. <p>If the specified expression is not valid, it is kept at its current
  24693. value.
  24694. </p>
  24695. <a name="colorlevels"></a>
  24696. <h3 class="section">32.36 colorlevels<span class="pull-right"><a class="anchor hidden-xs" href="#colorlevels" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorlevels" aria-hidden="true">TOC</a></span></h3>
  24697. <p>Adjust video input frames using levels.
  24698. </p>
  24699. <p>The filter accepts the following options:
  24700. </p>
  24701. <dl class="table">
  24702. <dt><samp class="option">rimin</samp></dt>
  24703. <dt><samp class="option">gimin</samp></dt>
  24704. <dt><samp class="option">bimin</samp></dt>
  24705. <dt><samp class="option">aimin</samp></dt>
  24706. <dd><p>Adjust red, green, blue and alpha input black point.
  24707. Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">0</code>.
  24708. </p>
  24709. </dd>
  24710. <dt><samp class="option">rimax</samp></dt>
  24711. <dt><samp class="option">gimax</samp></dt>
  24712. <dt><samp class="option">bimax</samp></dt>
  24713. <dt><samp class="option">aimax</samp></dt>
  24714. <dd><p>Adjust red, green, blue and alpha input white point.
  24715. Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">1</code>.
  24716. </p>
  24717. <p>Input levels are used to lighten highlights (bright tones), darken shadows
  24718. (dark tones), change the balance of bright and dark tones.
  24719. </p>
  24720. </dd>
  24721. <dt><samp class="option">romin</samp></dt>
  24722. <dt><samp class="option">gomin</samp></dt>
  24723. <dt><samp class="option">bomin</samp></dt>
  24724. <dt><samp class="option">aomin</samp></dt>
  24725. <dd><p>Adjust red, green, blue and alpha output black point.
  24726. Allowed ranges for options are <code class="code">[0, 1.0]</code>. Defaults are <code class="code">0</code>.
  24727. </p>
  24728. </dd>
  24729. <dt><samp class="option">romax</samp></dt>
  24730. <dt><samp class="option">gomax</samp></dt>
  24731. <dt><samp class="option">bomax</samp></dt>
  24732. <dt><samp class="option">aomax</samp></dt>
  24733. <dd><p>Adjust red, green, blue and alpha output white point.
  24734. Allowed ranges for options are <code class="code">[0, 1.0]</code>. Defaults are <code class="code">1</code>.
  24735. </p>
  24736. <p>Output levels allows manual selection of a constrained output level range.
  24737. </p>
  24738. </dd>
  24739. <dt><samp class="option">preserve</samp></dt>
  24740. <dd><p>Set preserve color mode. The accepted values are:
  24741. </p><dl class="table">
  24742. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  24743. <dd><p>Disable color preserving, this is default.
  24744. </p></dd>
  24745. <dt>&lsquo;<samp class="samp">lum</samp>&rsquo;</dt>
  24746. <dd><p>Preserve luminance.
  24747. </p></dd>
  24748. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  24749. <dd><p>Preserve max value of RGB triplet.
  24750. </p></dd>
  24751. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  24752. <dd><p>Preserve average value of RGB triplet.
  24753. </p></dd>
  24754. <dt>&lsquo;<samp class="samp">sum</samp>&rsquo;</dt>
  24755. <dd><p>Preserve sum value of RGB triplet.
  24756. </p></dd>
  24757. <dt>&lsquo;<samp class="samp">nrm</samp>&rsquo;</dt>
  24758. <dd><p>Preserve normalized value of RGB triplet.
  24759. </p></dd>
  24760. <dt>&lsquo;<samp class="samp">pwr</samp>&rsquo;</dt>
  24761. <dd><p>Preserve power value of RGB triplet.
  24762. </p></dd>
  24763. </dl>
  24764. </dd>
  24765. </dl>
  24766. <a name="Examples-74"></a>
  24767. <h4 class="subsection">32.36.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-74" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-74" aria-hidden="true">TOC</a></span></h4>
  24768. <ul class="itemize mark-bullet">
  24769. <li>Make video output darker:
  24770. <div class="example">
  24771. <pre class="example-preformatted">colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
  24772. </pre></div>
  24773. </li><li>Increase contrast:
  24774. <div class="example">
  24775. <pre class="example-preformatted">colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
  24776. </pre></div>
  24777. </li><li>Make video output lighter:
  24778. <div class="example">
  24779. <pre class="example-preformatted">colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
  24780. </pre></div>
  24781. </li><li>Increase brightness:
  24782. <div class="example">
  24783. <pre class="example-preformatted">colorlevels=romin=0.5:gomin=0.5:bomin=0.5
  24784. </pre></div>
  24785. </li></ul>
  24786. <a name="Commands-73"></a>
  24787. <h4 class="subsection">32.36.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-73" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-73" aria-hidden="true">TOC</a></span></h4>
  24788. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  24789. </p>
  24790. <a name="colormap"></a>
  24791. <h3 class="section">32.37 colormap<span class="pull-right"><a class="anchor hidden-xs" href="#colormap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colormap" aria-hidden="true">TOC</a></span></h3>
  24792. <p>Apply custom color maps to video stream.
  24793. </p>
  24794. <p>This filter needs three input video streams.
  24795. First stream is video stream that is going to be filtered out.
  24796. Second and third video stream specify color patches for source
  24797. color to target color mapping.
  24798. </p>
  24799. <p>The filter accepts the following options:
  24800. </p>
  24801. <dl class="table">
  24802. <dt><samp class="option">patch_size</samp></dt>
  24803. <dd><p>Set the source and target video stream patch size in pixels.
  24804. </p>
  24805. </dd>
  24806. <dt><samp class="option">nb_patches</samp></dt>
  24807. <dd><p>Set the max number of used patches from source and target video stream.
  24808. Default value is number of patches available in additional video streams.
  24809. Max allowed number of patches is <code class="code">64</code>.
  24810. </p>
  24811. </dd>
  24812. <dt><samp class="option">type</samp></dt>
  24813. <dd><p>Set the adjustments used for target colors. Can be <code class="code">relative</code> or <code class="code">absolute</code>.
  24814. Defaults is <code class="code">absolute</code>.
  24815. </p>
  24816. </dd>
  24817. <dt><samp class="option">kernel</samp></dt>
  24818. <dd><p>Set the kernel used to measure color differences between mapped colors.
  24819. </p>
  24820. <p>The accepted values are:
  24821. </p><dl class="table">
  24822. <dt>&lsquo;<samp class="samp">euclidean</samp>&rsquo;</dt>
  24823. <dt>&lsquo;<samp class="samp">weuclidean</samp>&rsquo;</dt>
  24824. </dl>
  24825. <p>Default is <code class="code">euclidean</code>.
  24826. </p></dd>
  24827. </dl>
  24828. <a name="colormatrix"></a>
  24829. <h3 class="section">32.38 colormatrix<span class="pull-right"><a class="anchor hidden-xs" href="#colormatrix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colormatrix" aria-hidden="true">TOC</a></span></h3>
  24830. <p>Convert color matrix.
  24831. </p>
  24832. <p>The filter accepts the following options:
  24833. </p>
  24834. <dl class="table">
  24835. <dt><samp class="option">src</samp></dt>
  24836. <dt><samp class="option">dst</samp></dt>
  24837. <dd><p>Specify the source and destination color matrix. Both values must be
  24838. specified.
  24839. </p>
  24840. <p>The accepted values are:
  24841. </p><dl class="table">
  24842. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  24843. <dd><p>BT.709
  24844. </p>
  24845. </dd>
  24846. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  24847. <dd><p>FCC
  24848. </p>
  24849. </dd>
  24850. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  24851. <dd><p>BT.601
  24852. </p>
  24853. </dd>
  24854. <dt>&lsquo;<samp class="samp">bt470</samp>&rsquo;</dt>
  24855. <dd><p>BT.470
  24856. </p>
  24857. </dd>
  24858. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  24859. <dd><p>BT.470BG
  24860. </p>
  24861. </dd>
  24862. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  24863. <dd><p>SMPTE-170M
  24864. </p>
  24865. </dd>
  24866. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  24867. <dd><p>SMPTE-240M
  24868. </p>
  24869. </dd>
  24870. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  24871. <dd><p>BT.2020
  24872. </p></dd>
  24873. </dl>
  24874. </dd>
  24875. </dl>
  24876. <p>For example to convert from BT.601 to SMPTE-240M, use the command:
  24877. </p><div class="example">
  24878. <pre class="example-preformatted">colormatrix=bt601:smpte240m
  24879. </pre></div>
  24880. <a name="colorspace"></a>
  24881. <h3 class="section">32.39 colorspace<span class="pull-right"><a class="anchor hidden-xs" href="#colorspace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorspace" aria-hidden="true">TOC</a></span></h3>
  24882. <p>Convert colorspace, transfer characteristics or color primaries.
  24883. Input video needs to have an even size.
  24884. </p>
  24885. <p>The filter accepts the following options:
  24886. </p>
  24887. <dl class="table">
  24888. <dd><a class="anchor" id="all"></a></dd>
  24889. <dt><samp class="option">all</samp></dt>
  24890. <dd><p>Specify all color properties at once.
  24891. </p>
  24892. <p>The accepted values are:
  24893. </p><dl class="table">
  24894. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  24895. <dd><p>BT.470M
  24896. </p>
  24897. </dd>
  24898. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  24899. <dd><p>BT.470BG
  24900. </p>
  24901. </dd>
  24902. <dt>&lsquo;<samp class="samp">bt601-6-525</samp>&rsquo;</dt>
  24903. <dd><p>BT.601-6 525
  24904. </p>
  24905. </dd>
  24906. <dt>&lsquo;<samp class="samp">bt601-6-625</samp>&rsquo;</dt>
  24907. <dd><p>BT.601-6 625
  24908. </p>
  24909. </dd>
  24910. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  24911. <dd><p>BT.709
  24912. </p>
  24913. </dd>
  24914. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  24915. <dd><p>SMPTE-170M
  24916. </p>
  24917. </dd>
  24918. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  24919. <dd><p>SMPTE-240M
  24920. </p>
  24921. </dd>
  24922. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  24923. <dd><p>BT.2020
  24924. </p>
  24925. </dd>
  24926. </dl>
  24927. <a class="anchor" id="space"></a></dd>
  24928. <dt><samp class="option">space</samp></dt>
  24929. <dd><p>Specify output colorspace.
  24930. </p>
  24931. <p>The accepted values are:
  24932. </p><dl class="table">
  24933. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  24934. <dd><p>BT.709
  24935. </p>
  24936. </dd>
  24937. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  24938. <dd><p>FCC
  24939. </p>
  24940. </dd>
  24941. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  24942. <dd><p>BT.470BG or BT.601-6 625
  24943. </p>
  24944. </dd>
  24945. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  24946. <dd><p>SMPTE-170M or BT.601-6 525
  24947. </p>
  24948. </dd>
  24949. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  24950. <dd><p>SMPTE-240M
  24951. </p>
  24952. </dd>
  24953. <dt>&lsquo;<samp class="samp">ycgco</samp>&rsquo;</dt>
  24954. <dd><p>YCgCo
  24955. </p>
  24956. </dd>
  24957. <dt>&lsquo;<samp class="samp">bt2020ncl</samp>&rsquo;</dt>
  24958. <dd><p>BT.2020 with non-constant luminance
  24959. </p>
  24960. </dd>
  24961. </dl>
  24962. <a class="anchor" id="trc"></a></dd>
  24963. <dt><samp class="option">trc</samp></dt>
  24964. <dd><p>Specify output transfer characteristics.
  24965. </p>
  24966. <p>The accepted values are:
  24967. </p><dl class="table">
  24968. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  24969. <dd><p>BT.709
  24970. </p>
  24971. </dd>
  24972. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  24973. <dd><p>BT.470M
  24974. </p>
  24975. </dd>
  24976. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  24977. <dd><p>BT.470BG
  24978. </p>
  24979. </dd>
  24980. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  24981. <dd><p>Constant gamma of 2.2
  24982. </p>
  24983. </dd>
  24984. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  24985. <dd><p>Constant gamma of 2.8
  24986. </p>
  24987. </dd>
  24988. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  24989. <dd><p>SMPTE-170M, BT.601-6 625 or BT.601-6 525
  24990. </p>
  24991. </dd>
  24992. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  24993. <dd><p>SMPTE-240M
  24994. </p>
  24995. </dd>
  24996. <dt>&lsquo;<samp class="samp">srgb</samp>&rsquo;</dt>
  24997. <dd><p>SRGB
  24998. </p>
  24999. </dd>
  25000. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  25001. <dd><p>iec61966-2-1
  25002. </p>
  25003. </dd>
  25004. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  25005. <dd><p>iec61966-2-4
  25006. </p>
  25007. </dd>
  25008. <dt>&lsquo;<samp class="samp">xvycc</samp>&rsquo;</dt>
  25009. <dd><p>xvycc
  25010. </p>
  25011. </dd>
  25012. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  25013. <dd><p>BT.2020 for 10-bits content
  25014. </p>
  25015. </dd>
  25016. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  25017. <dd><p>BT.2020 for 12-bits content
  25018. </p>
  25019. </dd>
  25020. </dl>
  25021. <a class="anchor" id="primaries"></a></dd>
  25022. <dt><samp class="option">primaries</samp></dt>
  25023. <dd><p>Specify output color primaries.
  25024. </p>
  25025. <p>The accepted values are:
  25026. </p><dl class="table">
  25027. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  25028. <dd><p>BT.709
  25029. </p>
  25030. </dd>
  25031. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  25032. <dd><p>BT.470M
  25033. </p>
  25034. </dd>
  25035. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  25036. <dd><p>BT.470BG or BT.601-6 625
  25037. </p>
  25038. </dd>
  25039. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  25040. <dd><p>SMPTE-170M or BT.601-6 525
  25041. </p>
  25042. </dd>
  25043. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  25044. <dd><p>SMPTE-240M
  25045. </p>
  25046. </dd>
  25047. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  25048. <dd><p>film
  25049. </p>
  25050. </dd>
  25051. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  25052. <dd><p>SMPTE-431
  25053. </p>
  25054. </dd>
  25055. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  25056. <dd><p>SMPTE-432
  25057. </p>
  25058. </dd>
  25059. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  25060. <dd><p>BT.2020
  25061. </p>
  25062. </dd>
  25063. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  25064. <dd><p>JEDEC P22 phosphors
  25065. </p>
  25066. </dd>
  25067. </dl>
  25068. <a class="anchor" id="range"></a></dd>
  25069. <dt><samp class="option">range</samp></dt>
  25070. <dd><p>Specify output color range.
  25071. </p>
  25072. <p>The accepted values are:
  25073. </p><dl class="table">
  25074. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  25075. <dd><p>TV (restricted) range
  25076. </p>
  25077. </dd>
  25078. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  25079. <dd><p>MPEG (restricted) range
  25080. </p>
  25081. </dd>
  25082. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  25083. <dd><p>PC (full) range
  25084. </p>
  25085. </dd>
  25086. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  25087. <dd><p>JPEG (full) range
  25088. </p>
  25089. </dd>
  25090. </dl>
  25091. </dd>
  25092. <dt><samp class="option">format</samp></dt>
  25093. <dd><p>Specify output color format.
  25094. </p>
  25095. <p>The accepted values are:
  25096. </p><dl class="table">
  25097. <dt>&lsquo;<samp class="samp">yuv420p</samp>&rsquo;</dt>
  25098. <dd><p>YUV 4:2:0 planar 8-bits
  25099. </p>
  25100. </dd>
  25101. <dt>&lsquo;<samp class="samp">yuv420p10</samp>&rsquo;</dt>
  25102. <dd><p>YUV 4:2:0 planar 10-bits
  25103. </p>
  25104. </dd>
  25105. <dt>&lsquo;<samp class="samp">yuv420p12</samp>&rsquo;</dt>
  25106. <dd><p>YUV 4:2:0 planar 12-bits
  25107. </p>
  25108. </dd>
  25109. <dt>&lsquo;<samp class="samp">yuv422p</samp>&rsquo;</dt>
  25110. <dd><p>YUV 4:2:2 planar 8-bits
  25111. </p>
  25112. </dd>
  25113. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  25114. <dd><p>YUV 4:2:2 planar 10-bits
  25115. </p>
  25116. </dd>
  25117. <dt>&lsquo;<samp class="samp">yuv422p12</samp>&rsquo;</dt>
  25118. <dd><p>YUV 4:2:2 planar 12-bits
  25119. </p>
  25120. </dd>
  25121. <dt>&lsquo;<samp class="samp">yuv444p</samp>&rsquo;</dt>
  25122. <dd><p>YUV 4:4:4 planar 8-bits
  25123. </p>
  25124. </dd>
  25125. <dt>&lsquo;<samp class="samp">yuv444p10</samp>&rsquo;</dt>
  25126. <dd><p>YUV 4:4:4 planar 10-bits
  25127. </p>
  25128. </dd>
  25129. <dt>&lsquo;<samp class="samp">yuv444p12</samp>&rsquo;</dt>
  25130. <dd><p>YUV 4:4:4 planar 12-bits
  25131. </p>
  25132. </dd>
  25133. </dl>
  25134. </dd>
  25135. <dt><samp class="option">fast</samp></dt>
  25136. <dd><p>Do a fast conversion, which skips gamma/primary correction. This will take
  25137. significantly less CPU, but will be mathematically incorrect. To get output
  25138. compatible with that produced by the colormatrix filter, use fast=1.
  25139. </p>
  25140. </dd>
  25141. <dt><samp class="option">dither</samp></dt>
  25142. <dd><p>Specify dithering mode.
  25143. </p>
  25144. <p>The accepted values are:
  25145. </p><dl class="table">
  25146. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  25147. <dd><p>No dithering
  25148. </p>
  25149. </dd>
  25150. <dt>&lsquo;<samp class="samp">fsb</samp>&rsquo;</dt>
  25151. <dd><p>Floyd-Steinberg dithering
  25152. </p></dd>
  25153. </dl>
  25154. </dd>
  25155. <dt><samp class="option">wpadapt</samp></dt>
  25156. <dd><p>Whitepoint adaptation mode.
  25157. </p>
  25158. <p>The accepted values are:
  25159. </p><dl class="table">
  25160. <dt>&lsquo;<samp class="samp">bradford</samp>&rsquo;</dt>
  25161. <dd><p>Bradford whitepoint adaptation
  25162. </p>
  25163. </dd>
  25164. <dt>&lsquo;<samp class="samp">vonkries</samp>&rsquo;</dt>
  25165. <dd><p>von Kries whitepoint adaptation
  25166. </p>
  25167. </dd>
  25168. <dt>&lsquo;<samp class="samp">identity</samp>&rsquo;</dt>
  25169. <dd><p>identity whitepoint adaptation (i.e. no whitepoint adaptation)
  25170. </p></dd>
  25171. </dl>
  25172. </dd>
  25173. <dt><samp class="option">clipgamut</samp></dt>
  25174. <dd><p>Controls how to clip out-of-gamut colors that arise as a result of colorspace conversion.
  25175. </p>
  25176. <p>The accepted values are:
  25177. </p><dl class="table">
  25178. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  25179. <dd><p>No clipping of out of gamut colors.
  25180. </p>
  25181. </dd>
  25182. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  25183. <dd><p>Clips the RGB values to the [0, 1] range when building the gamma transfer LUTs.
  25184. </p></dd>
  25185. </dl>
  25186. </dd>
  25187. <dt><samp class="option">iall</samp></dt>
  25188. <dd><p>Override all input properties at once. Same accepted values as <a class="ref" href="#all">all</a>.
  25189. </p>
  25190. </dd>
  25191. <dt><samp class="option">ispace</samp></dt>
  25192. <dd><p>Override input colorspace. Same accepted values as <a class="ref" href="#space">space</a>.
  25193. </p>
  25194. </dd>
  25195. <dt><samp class="option">iprimaries</samp></dt>
  25196. <dd><p>Override input color primaries. Same accepted values as <a class="ref" href="#primaries">primaries</a>.
  25197. </p>
  25198. </dd>
  25199. <dt><samp class="option">itrc</samp></dt>
  25200. <dd><p>Override input transfer characteristics. Same accepted values as <a class="ref" href="#trc">trc</a>.
  25201. </p>
  25202. </dd>
  25203. <dt><samp class="option">irange</samp></dt>
  25204. <dd><p>Override input color range. Same accepted values as <a class="ref" href="#range">range</a>.
  25205. </p>
  25206. </dd>
  25207. </dl>
  25208. <p>The filter converts the transfer characteristics, color space and color
  25209. primaries to the specified user values. The output value, if not specified,
  25210. is set to a default value based on the &quot;all&quot; property. If that property is
  25211. also not specified, the filter will log an error. The output color range and
  25212. format default to the same value as the input color range and format. The
  25213. input transfer characteristics, color space, color primaries and color range
  25214. should be set on the input data. If any of these are missing, the filter will
  25215. log an error and no conversion will take place.
  25216. </p>
  25217. <p>For example to convert the input to SMPTE-240M, use the command:
  25218. </p><div class="example">
  25219. <pre class="example-preformatted">colorspace=smpte240m
  25220. </pre></div>
  25221. <a name="colortemperature"></a>
  25222. <h3 class="section">32.40 colortemperature<span class="pull-right"><a class="anchor hidden-xs" href="#colortemperature" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colortemperature" aria-hidden="true">TOC</a></span></h3>
  25223. <p>Adjust color temperature in video to simulate variations in ambient color temperature.
  25224. </p>
  25225. <p>The filter accepts the following options:
  25226. </p>
  25227. <dl class="table">
  25228. <dt><samp class="option">temperature</samp></dt>
  25229. <dd><p>Set the temperature in Kelvin. Allowed range is from 1000 to 40000.
  25230. Default value is 6500 K.
  25231. </p>
  25232. </dd>
  25233. <dt><samp class="option">mix</samp></dt>
  25234. <dd><p>Set mixing with filtered output. Allowed range is from 0 to 1.
  25235. Default value is 1.
  25236. </p>
  25237. </dd>
  25238. <dt><samp class="option">pl</samp></dt>
  25239. <dd><p>Set the amount of preserving lightness. Allowed range is from 0 to 1.
  25240. Default value is 0.
  25241. </p></dd>
  25242. </dl>
  25243. <a name="Commands-74"></a>
  25244. <h4 class="subsection">32.40.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-74" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-74" aria-hidden="true">TOC</a></span></h4>
  25245. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  25246. </p>
  25247. <a name="convolution"></a>
  25248. <h3 class="section">32.41 convolution<span class="pull-right"><a class="anchor hidden-xs" href="#convolution" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-convolution" aria-hidden="true">TOC</a></span></h3>
  25249. <p>Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements.
  25250. </p>
  25251. <p>The filter accepts the following options:
  25252. </p>
  25253. <dl class="table">
  25254. <dt><samp class="option">0m</samp></dt>
  25255. <dt><samp class="option">1m</samp></dt>
  25256. <dt><samp class="option">2m</samp></dt>
  25257. <dt><samp class="option">3m</samp></dt>
  25258. <dd><p>Set matrix for each plane.
  25259. Matrix is sequence of 9, 25 or 49 signed integers in <var class="var">square</var> mode,
  25260. and from 1 to 49 odd number of signed integers in <var class="var">row</var> mode.
  25261. </p>
  25262. </dd>
  25263. <dt><samp class="option">0rdiv</samp></dt>
  25264. <dt><samp class="option">1rdiv</samp></dt>
  25265. <dt><samp class="option">2rdiv</samp></dt>
  25266. <dt><samp class="option">3rdiv</samp></dt>
  25267. <dd><p>Set multiplier for calculated value for each plane.
  25268. If unset or 0, it will be 1/sum of all matrix elements.
  25269. </p>
  25270. </dd>
  25271. <dt><samp class="option">0bias</samp></dt>
  25272. <dt><samp class="option">1bias</samp></dt>
  25273. <dt><samp class="option">2bias</samp></dt>
  25274. <dt><samp class="option">3bias</samp></dt>
  25275. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  25276. Useful for making the overall image brighter or darker. Default is 0.0.
  25277. </p>
  25278. </dd>
  25279. <dt><samp class="option">0mode</samp></dt>
  25280. <dt><samp class="option">1mode</samp></dt>
  25281. <dt><samp class="option">2mode</samp></dt>
  25282. <dt><samp class="option">3mode</samp></dt>
  25283. <dd><p>Set matrix mode for each plane. Can be <var class="var">square</var>, <var class="var">row</var> or <var class="var">column</var>.
  25284. Default is <var class="var">square</var>.
  25285. </p></dd>
  25286. </dl>
  25287. <a name="Commands-75"></a>
  25288. <h4 class="subsection">32.41.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-75" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-75" aria-hidden="true">TOC</a></span></h4>
  25289. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  25290. </p>
  25291. <a name="Examples-75"></a>
  25292. <h4 class="subsection">32.41.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-75" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-75" aria-hidden="true">TOC</a></span></h4>
  25293. <ul class="itemize mark-bullet">
  25294. <li>Apply sharpen:
  25295. <div class="example">
  25296. <pre class="example-preformatted">convolution=&quot;0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0&quot;
  25297. </pre></div>
  25298. </li><li>Apply blur:
  25299. <div class="example">
  25300. <pre class="example-preformatted">convolution=&quot;1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9&quot;
  25301. </pre></div>
  25302. </li><li>Apply edge enhance:
  25303. <div class="example">
  25304. <pre class="example-preformatted">convolution=&quot;0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128&quot;
  25305. </pre></div>
  25306. </li><li>Apply edge detect:
  25307. <div class="example">
  25308. <pre class="example-preformatted">convolution=&quot;0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128&quot;
  25309. </pre></div>
  25310. </li><li>Apply laplacian edge detector which includes diagonals:
  25311. <div class="example">
  25312. <pre class="example-preformatted">convolution=&quot;1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0&quot;
  25313. </pre></div>
  25314. </li><li>Apply emboss:
  25315. <div class="example">
  25316. <pre class="example-preformatted">convolution=&quot;-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2&quot;
  25317. </pre></div>
  25318. </li></ul>
  25319. <a name="convolve"></a>
  25320. <h3 class="section">32.42 convolve<span class="pull-right"><a class="anchor hidden-xs" href="#convolve" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-convolve" aria-hidden="true">TOC</a></span></h3>
  25321. <p>Apply 2D convolution of video stream in frequency domain using second stream
  25322. as impulse.
  25323. </p>
  25324. <p>The filter accepts the following options:
  25325. </p>
  25326. <dl class="table">
  25327. <dt><samp class="option">planes</samp></dt>
  25328. <dd><p>Set which planes to process.
  25329. </p>
  25330. </dd>
  25331. <dt><samp class="option">impulse</samp></dt>
  25332. <dd><p>Set which impulse video frames will be processed, can be <var class="var">first</var>
  25333. or <var class="var">all</var>. Default is <var class="var">all</var>.
  25334. </p></dd>
  25335. </dl>
  25336. <p>The <code class="code">convolve</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  25337. </p>
  25338. <a name="copy"></a>
  25339. <h3 class="section">32.43 copy<span class="pull-right"><a class="anchor hidden-xs" href="#copy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-copy" aria-hidden="true">TOC</a></span></h3>
  25340. <p>Copy the input video source unchanged to the output. This is mainly useful for
  25341. testing purposes.
  25342. </p>
  25343. <a class="anchor" id="coreimage"></a><a name="coreimage-1"></a>
  25344. <h3 class="section">32.44 coreimage<span class="pull-right"><a class="anchor hidden-xs" href="#coreimage-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-coreimage-1" aria-hidden="true">TOC</a></span></h3>
  25345. <p>Video filtering on GPU using Apple&rsquo;s CoreImage API on OSX.
  25346. </p>
  25347. <p>Hardware acceleration is based on an OpenGL context. Usually, this means it is
  25348. processed by video hardware. However, software-based OpenGL implementations
  25349. exist which means there is no guarantee for hardware processing. It depends on
  25350. the respective OSX.
  25351. </p>
  25352. <p>There are many filters and image generators provided by Apple that come with a
  25353. large variety of options. The filter has to be referenced by its name along
  25354. with its options.
  25355. </p>
  25356. <p>The coreimage filter accepts the following options:
  25357. </p><dl class="table">
  25358. <dt><samp class="option">list_filters</samp></dt>
  25359. <dd><p>List all available filters and generators along with all their respective
  25360. options as well as possible minimum and maximum values along with the default
  25361. values.
  25362. </p><div class="example">
  25363. <pre class="example-preformatted">list_filters=true
  25364. </pre></div>
  25365. </dd>
  25366. <dt><samp class="option">filter</samp></dt>
  25367. <dd><p>Specify all filters by their respective name and options.
  25368. Use <var class="var">list_filters</var> to determine all valid filter names and options.
  25369. Numerical options are specified by a float value and are automatically clamped
  25370. to their respective value range. Vector and color options have to be specified
  25371. by a list of space separated float values. Character escaping has to be done.
  25372. A special option name <code class="code">default</code> is available to use default options for a
  25373. filter.
  25374. </p>
  25375. <p>It is required to specify either <code class="code">default</code> or at least one of the filter options.
  25376. All omitted options are used with their default values.
  25377. The syntax of the filter string is as follows:
  25378. </p><div class="example">
  25379. <pre class="example-preformatted">filter=&lt;NAME&gt;@&lt;OPTION&gt;=&lt;VALUE&gt;[@&lt;OPTION&gt;=&lt;VALUE&gt;][@...][#&lt;NAME&gt;@&lt;OPTION&gt;=&lt;VALUE&gt;[@&lt;OPTION&gt;=&lt;VALUE&gt;][@...]][#...]
  25380. </pre></div>
  25381. </dd>
  25382. <dt><samp class="option">output_rect</samp></dt>
  25383. <dd><p>Specify a rectangle where the output of the filter chain is copied into the
  25384. input image. It is given by a list of space separated float values:
  25385. </p><div class="example">
  25386. <pre class="example-preformatted">output_rect=x\ y\ width\ height
  25387. </pre></div>
  25388. <p>If not given, the output rectangle equals the dimensions of the input image.
  25389. The output rectangle is automatically cropped at the borders of the input
  25390. image. Negative values are valid for each component.
  25391. </p><div class="example">
  25392. <pre class="example-preformatted">output_rect=25\ 25\ 100\ 100
  25393. </pre></div>
  25394. </dd>
  25395. </dl>
  25396. <p>Several filters can be chained for successive processing without GPU-HOST
  25397. transfers allowing for fast processing of complex filter chains.
  25398. Currently, only filters with zero (generators) or exactly one (filters) input
  25399. image and one output image are supported. Also, transition filters are not yet
  25400. usable as intended.
  25401. </p>
  25402. <p>Some filters generate output images with additional padding depending on the
  25403. respective filter kernel. The padding is automatically removed to ensure the
  25404. filter output has the same size as the input image.
  25405. </p>
  25406. <p>For image generators, the size of the output image is determined by the
  25407. previous output image of the filter chain or the input image of the whole
  25408. filterchain, respectively. The generators do not use the pixel information of
  25409. this image to generate their output. However, the generated output is
  25410. blended onto this image, resulting in partial or complete coverage of the
  25411. output image.
  25412. </p>
  25413. <p>The <a class="ref" href="#coreimagesrc">coreimagesrc</a> video source can be used for generating input images
  25414. which are directly fed into the filter chain. By using it, providing input
  25415. images by another video source or an input video is not required.
  25416. </p>
  25417. <a name="Examples-76"></a>
  25418. <h4 class="subsection">32.44.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-76" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-76" aria-hidden="true">TOC</a></span></h4>
  25419. <ul class="itemize mark-bullet">
  25420. <li>List all filters available:
  25421. <div class="example">
  25422. <pre class="example-preformatted">coreimage=list_filters=true
  25423. </pre></div>
  25424. </li><li>Use the CIBoxBlur filter with default options to blur an image:
  25425. <div class="example">
  25426. <pre class="example-preformatted">coreimage=filter=CIBoxBlur@default
  25427. </pre></div>
  25428. </li><li>Use a filter chain with CISepiaTone at default values and CIVignetteEffect with
  25429. its center at 100x100 and a radius of 50 pixels:
  25430. <div class="example">
  25431. <pre class="example-preformatted">coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
  25432. </pre></div>
  25433. </li><li>Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  25434. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  25435. <div class="example">
  25436. <pre class="example-preformatted">ffmpeg -f lavfi -i nullsrc=s=100x100,coreimage=filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  25437. </pre></div>
  25438. </li></ul>
  25439. <a name="corr"></a>
  25440. <h3 class="section">32.45 corr<span class="pull-right"><a class="anchor hidden-xs" href="#corr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-corr" aria-hidden="true">TOC</a></span></h3>
  25441. <p>Obtain the correlation between two input videos.
  25442. </p>
  25443. <p>This filter takes two input videos.
  25444. </p>
  25445. <p>Both input videos must have the same resolution and pixel format for
  25446. this filter to work correctly. Also it assumes that both inputs
  25447. have the same number of frames, which are compared one by one.
  25448. </p>
  25449. <p>The obtained per component, average, min and max correlation is printed through
  25450. the logging system.
  25451. </p>
  25452. <p>The filter stores the calculated correlation of each frame in frame metadata.
  25453. </p>
  25454. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  25455. </p>
  25456. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  25457. with the reference file <samp class="file">ref.mpg</samp>.
  25458. </p>
  25459. <div class="example">
  25460. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi corr -f null -
  25461. </pre></div>
  25462. <a name="cover_005frect"></a>
  25463. <h3 class="section">32.46 cover_rect<span class="pull-right"><a class="anchor hidden-xs" href="#cover_005frect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cover_005frect" aria-hidden="true">TOC</a></span></h3>
  25464. <p>Cover a rectangular object
  25465. </p>
  25466. <p>It accepts the following options:
  25467. </p>
  25468. <dl class="table">
  25469. <dt><samp class="option">cover</samp></dt>
  25470. <dd><p>Filepath of the optional cover image, needs to be in yuv420.
  25471. </p>
  25472. </dd>
  25473. <dt><samp class="option">mode</samp></dt>
  25474. <dd><p>Set covering mode.
  25475. </p>
  25476. <p>It accepts the following values:
  25477. </p><dl class="table">
  25478. <dt>&lsquo;<samp class="samp">cover</samp>&rsquo;</dt>
  25479. <dd><p>cover it by the supplied image
  25480. </p></dd>
  25481. <dt>&lsquo;<samp class="samp">blur</samp>&rsquo;</dt>
  25482. <dd><p>cover it by interpolating the surrounding pixels
  25483. </p></dd>
  25484. </dl>
  25485. <p>Default value is <var class="var">blur</var>.
  25486. </p></dd>
  25487. </dl>
  25488. <a name="Examples-77"></a>
  25489. <h4 class="subsection">32.46.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-77" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-77" aria-hidden="true">TOC</a></span></h4>
  25490. <ul class="itemize mark-bullet">
  25491. <li>Cover a rectangular object by the supplied image of a given video using <code class="command">ffmpeg</code>:
  25492. <div class="example">
  25493. <pre class="example-preformatted">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  25494. </pre></div>
  25495. </li></ul>
  25496. <a name="crop"></a>
  25497. <h3 class="section">32.47 crop<span class="pull-right"><a class="anchor hidden-xs" href="#crop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crop" aria-hidden="true">TOC</a></span></h3>
  25498. <p>Crop the input video to given dimensions.
  25499. </p>
  25500. <p>It accepts the following parameters:
  25501. </p>
  25502. <dl class="table">
  25503. <dt><samp class="option">w, out_w</samp></dt>
  25504. <dd><p>The width of the output video. It defaults to <code class="code">iw</code>.
  25505. This expression is evaluated only once during the filter
  25506. configuration, or when the &lsquo;<samp class="samp">w</samp>&rsquo; or &lsquo;<samp class="samp">out_w</samp>&rsquo; command is sent.
  25507. </p>
  25508. </dd>
  25509. <dt><samp class="option">h, out_h</samp></dt>
  25510. <dd><p>The height of the output video. It defaults to <code class="code">ih</code>.
  25511. This expression is evaluated only once during the filter
  25512. configuration, or when the &lsquo;<samp class="samp">h</samp>&rsquo; or &lsquo;<samp class="samp">out_h</samp>&rsquo; command is sent.
  25513. </p>
  25514. </dd>
  25515. <dt><samp class="option">x</samp></dt>
  25516. <dd><p>The horizontal position, in the input video, of the left edge of the output
  25517. video. It defaults to <code class="code">(in_w-out_w)/2</code>.
  25518. This expression is evaluated per-frame.
  25519. </p>
  25520. </dd>
  25521. <dt><samp class="option">y</samp></dt>
  25522. <dd><p>The vertical position, in the input video, of the top edge of the output video.
  25523. It defaults to <code class="code">(in_h-out_h)/2</code>.
  25524. This expression is evaluated per-frame.
  25525. </p>
  25526. </dd>
  25527. <dt><samp class="option">keep_aspect</samp></dt>
  25528. <dd><p>If set to 1 will force the output display aspect ratio
  25529. to be the same of the input, by changing the output sample aspect
  25530. ratio. It defaults to 0.
  25531. </p>
  25532. </dd>
  25533. <dt><samp class="option">exact</samp></dt>
  25534. <dd><p>Enable exact cropping. If enabled, subsampled videos will be cropped at exact
  25535. width/height/x/y as specified and will not be rounded to nearest smaller value.
  25536. It defaults to 0.
  25537. </p></dd>
  25538. </dl>
  25539. <p>The <var class="var">out_w</var>, <var class="var">out_h</var>, <var class="var">x</var>, <var class="var">y</var> parameters are
  25540. expressions containing the following constants:
  25541. </p>
  25542. <dl class="table">
  25543. <dt><samp class="option">x</samp></dt>
  25544. <dt><samp class="option">y</samp></dt>
  25545. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  25546. each new frame.
  25547. </p>
  25548. </dd>
  25549. <dt><samp class="option">in_w</samp></dt>
  25550. <dt><samp class="option">in_h</samp></dt>
  25551. <dd><p>The input width and height.
  25552. </p>
  25553. </dd>
  25554. <dt><samp class="option">iw</samp></dt>
  25555. <dt><samp class="option">ih</samp></dt>
  25556. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  25557. </p>
  25558. </dd>
  25559. <dt><samp class="option">out_w</samp></dt>
  25560. <dt><samp class="option">out_h</samp></dt>
  25561. <dd><p>The output (cropped) width and height.
  25562. </p>
  25563. </dd>
  25564. <dt><samp class="option">ow</samp></dt>
  25565. <dt><samp class="option">oh</samp></dt>
  25566. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  25567. </p>
  25568. </dd>
  25569. <dt><samp class="option">a</samp></dt>
  25570. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  25571. </p>
  25572. </dd>
  25573. <dt><samp class="option">sar</samp></dt>
  25574. <dd><p>input sample aspect ratio
  25575. </p>
  25576. </dd>
  25577. <dt><samp class="option">dar</samp></dt>
  25578. <dd><p>input display aspect ratio, it is the same as (<var class="var">iw</var> / <var class="var">ih</var>) * <var class="var">sar</var>
  25579. </p>
  25580. </dd>
  25581. <dt><samp class="option">hsub</samp></dt>
  25582. <dt><samp class="option">vsub</samp></dt>
  25583. <dd><p>horizontal and vertical chroma subsample values. For example for the
  25584. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  25585. </p>
  25586. </dd>
  25587. <dt><samp class="option">n</samp></dt>
  25588. <dd><p>The number of the input frame, starting from 0.
  25589. </p>
  25590. </dd>
  25591. <dt><samp class="option">pos</samp></dt>
  25592. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  25593. do not use
  25594. </p>
  25595. </dd>
  25596. <dt><samp class="option">t</samp></dt>
  25597. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  25598. </p>
  25599. </dd>
  25600. </dl>
  25601. <p>The expression for <var class="var">out_w</var> may depend on the value of <var class="var">out_h</var>,
  25602. and the expression for <var class="var">out_h</var> may depend on <var class="var">out_w</var>, but they
  25603. cannot depend on <var class="var">x</var> and <var class="var">y</var>, as <var class="var">x</var> and <var class="var">y</var> are
  25604. evaluated after <var class="var">out_w</var> and <var class="var">out_h</var>.
  25605. </p>
  25606. <p>The <var class="var">x</var> and <var class="var">y</var> parameters specify the expressions for the
  25607. position of the top-left corner of the output (non-cropped) area. They
  25608. are evaluated for each frame. If the evaluated value is not valid, it
  25609. is approximated to the nearest valid value.
  25610. </p>
  25611. <p>The expression for <var class="var">x</var> may depend on <var class="var">y</var>, and the expression
  25612. for <var class="var">y</var> may depend on <var class="var">x</var>.
  25613. </p>
  25614. <a name="Examples-78"></a>
  25615. <h4 class="subsection">32.47.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-78" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-78" aria-hidden="true">TOC</a></span></h4>
  25616. <ul class="itemize mark-bullet">
  25617. <li>Crop area with size 100x100 at position (12,34).
  25618. <div class="example">
  25619. <pre class="example-preformatted">crop=100:100:12:34
  25620. </pre></div>
  25621. <p>Using named options, the example above becomes:
  25622. </p><div class="example">
  25623. <pre class="example-preformatted">crop=w=100:h=100:x=12:y=34
  25624. </pre></div>
  25625. </li><li>Crop the central input area with size 100x100:
  25626. <div class="example">
  25627. <pre class="example-preformatted">crop=100:100
  25628. </pre></div>
  25629. </li><li>Crop the central input area with size 2/3 of the input video:
  25630. <div class="example">
  25631. <pre class="example-preformatted">crop=2/3*in_w:2/3*in_h
  25632. </pre></div>
  25633. </li><li>Crop the input video central square:
  25634. <div class="example">
  25635. <pre class="example-preformatted">crop=out_w=in_h
  25636. crop=in_h
  25637. </pre></div>
  25638. </li><li>Delimit the rectangle with the top-left corner placed at position
  25639. 100:100 and the right-bottom corner corresponding to the right-bottom
  25640. corner of the input image.
  25641. <div class="example">
  25642. <pre class="example-preformatted">crop=in_w-100:in_h-100:100:100
  25643. </pre></div>
  25644. </li><li>Crop 10 pixels from the left and right borders, and 20 pixels from
  25645. the top and bottom borders
  25646. <div class="example">
  25647. <pre class="example-preformatted">crop=in_w-2*10:in_h-2*20
  25648. </pre></div>
  25649. </li><li>Keep only the bottom right quarter of the input image:
  25650. <div class="example">
  25651. <pre class="example-preformatted">crop=in_w/2:in_h/2:in_w/2:in_h/2
  25652. </pre></div>
  25653. </li><li>Crop height for getting Greek harmony:
  25654. <div class="example">
  25655. <pre class="example-preformatted">crop=in_w:1/PHI*in_w
  25656. </pre></div>
  25657. </li><li>Apply trembling effect:
  25658. <div class="example">
  25659. <pre class="example-preformatted">crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)
  25660. </pre></div>
  25661. </li><li>Apply erratic camera effect depending on timestamp:
  25662. <div class="example">
  25663. <pre class="example-preformatted">crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)
  25664. </pre></div>
  25665. </li><li>Set x depending on the value of y:
  25666. <div class="example">
  25667. <pre class="example-preformatted">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
  25668. </pre></div>
  25669. </li></ul>
  25670. <a name="Commands-76"></a>
  25671. <h4 class="subsection">32.47.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-76" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-76" aria-hidden="true">TOC</a></span></h4>
  25672. <p>This filter supports the following commands:
  25673. </p><dl class="table">
  25674. <dt><samp class="option">w, out_w</samp></dt>
  25675. <dt><samp class="option">h, out_h</samp></dt>
  25676. <dt><samp class="option">x</samp></dt>
  25677. <dt><samp class="option">y</samp></dt>
  25678. <dd><p>Set width/height of the output video and the horizontal/vertical position
  25679. in the input video.
  25680. The command accepts the same syntax of the corresponding option.
  25681. </p>
  25682. <p>If the specified expression is not valid, it is kept at its current
  25683. value.
  25684. </p></dd>
  25685. </dl>
  25686. <a name="cropdetect"></a>
  25687. <h3 class="section">32.48 cropdetect<span class="pull-right"><a class="anchor hidden-xs" href="#cropdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cropdetect" aria-hidden="true">TOC</a></span></h3>
  25688. <p>Auto-detect the crop size.
  25689. </p>
  25690. <p>It calculates the necessary cropping parameters and prints the
  25691. recommended parameters via the logging system. The detected dimensions
  25692. correspond to the non-black or video area of the input video according to <var class="var">mode</var>.
  25693. </p>
  25694. <p>It accepts the following parameters:
  25695. </p>
  25696. <dl class="table">
  25697. <dt><samp class="option">mode</samp></dt>
  25698. <dd><p>Depending on <var class="var">mode</var> crop detection is based on either the mere black value of surrounding pixels or a combination of motion vectors and edge pixels.
  25699. </p>
  25700. <dl class="table">
  25701. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  25702. <dd><p>Detect black pixels surrounding the playing video. For fine control use option <var class="var">limit</var>.
  25703. </p>
  25704. </dd>
  25705. <dt>&lsquo;<samp class="samp">mvedges</samp>&rsquo;</dt>
  25706. <dd><p>Detect the playing video by the motion vectors inside the video and scanning for edge pixels typically forming the border of a playing video.
  25707. </p></dd>
  25708. </dl>
  25709. </dd>
  25710. <dt><samp class="option">limit</samp></dt>
  25711. <dd><p>Set higher black value threshold, which can be optionally specified
  25712. from nothing (0) to everything (255 for 8-bit based formats). An intensity
  25713. value greater to the set value is considered non-black. It defaults to 24.
  25714. You can also specify a value between 0.0 and 1.0 which will be scaled depending
  25715. on the bitdepth of the pixel format.
  25716. </p>
  25717. </dd>
  25718. <dt><samp class="option">round</samp></dt>
  25719. <dd><p>The value which the width/height should be divisible by. It defaults to
  25720. 16. The offset is automatically adjusted to center the video. Use 2 to
  25721. get only even dimensions (needed for 4:2:2 video). 16 is best when
  25722. encoding to most video codecs.
  25723. </p>
  25724. </dd>
  25725. <dt><samp class="option">skip</samp></dt>
  25726. <dd><p>Set the number of initial frames for which evaluation is skipped.
  25727. Default is 2. Range is 0 to INT_MAX.
  25728. </p>
  25729. </dd>
  25730. <dt><samp class="option">reset_count, reset</samp></dt>
  25731. <dd><p>Set the counter that determines after how many frames cropdetect will
  25732. reset the previously detected largest video area and start over to
  25733. detect the current optimal crop area. Default value is 0.
  25734. </p>
  25735. <p>This can be useful when channel logos distort the video area. 0
  25736. indicates &rsquo;never reset&rsquo;, and returns the largest area encountered during
  25737. playback.
  25738. </p>
  25739. </dd>
  25740. <dt><samp class="option">mv_threshold</samp></dt>
  25741. <dd><p>Set motion in pixel units as threshold for motion detection. It defaults to 8.
  25742. </p>
  25743. </dd>
  25744. <dt><samp class="option">low</samp></dt>
  25745. <dt><samp class="option">high</samp></dt>
  25746. <dd><p>Set low and high threshold values used by the Canny thresholding
  25747. algorithm.
  25748. </p>
  25749. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  25750. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  25751. by the low threshold.
  25752. </p>
  25753. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  25754. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  25755. </p>
  25756. <p>Default value for <var class="var">low</var> is <code class="code">5/255</code>, and default value for <var class="var">high</var>
  25757. is <code class="code">15/255</code>.
  25758. </p></dd>
  25759. </dl>
  25760. <a name="Examples-79"></a>
  25761. <h4 class="subsection">32.48.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-79" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-79" aria-hidden="true">TOC</a></span></h4>
  25762. <ul class="itemize mark-bullet">
  25763. <li>Find video area surrounded by black borders:
  25764. <div class="example">
  25765. <pre class="example-preformatted">ffmpeg -i file.mp4 -vf cropdetect,metadata=mode=print -f null -
  25766. </pre></div>
  25767. </li><li>Find an embedded video area, generate motion vectors beforehand:
  25768. <div class="example">
  25769. <pre class="example-preformatted">ffmpeg -i file.mp4 -vf mestimate,cropdetect=mode=mvedges,metadata=mode=print -f null -
  25770. </pre></div>
  25771. </li><li>Find an embedded video area, use motion vectors from decoder:
  25772. <div class="example">
  25773. <pre class="example-preformatted">ffmpeg -flags2 +export_mvs -i file.mp4 -vf cropdetect=mode=mvedges,metadata=mode=print -f null -
  25774. </pre></div>
  25775. </li></ul>
  25776. <a name="Commands-77"></a>
  25777. <h4 class="subsection">32.48.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-77" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-77" aria-hidden="true">TOC</a></span></h4>
  25778. <p>This filter supports the following commands:
  25779. </p>
  25780. <dl class="table">
  25781. <dt><samp class="option">limit</samp></dt>
  25782. <dd><p>The command accepts the same syntax of the corresponding option.
  25783. If the specified expression is not valid, it is kept at its current value.
  25784. </p></dd>
  25785. </dl>
  25786. <a class="anchor" id="cue"></a><a name="cue-1"></a>
  25787. <h3 class="section">32.49 cue<span class="pull-right"><a class="anchor hidden-xs" href="#cue-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cue-1" aria-hidden="true">TOC</a></span></h3>
  25788. <p>Delay video filtering until a given wallclock timestamp. The filter first
  25789. passes on <samp class="option">preroll</samp> amount of frames, then it buffers at most
  25790. <samp class="option">buffer</samp> amount of frames and waits for the cue. After reaching the cue
  25791. it forwards the buffered frames and also any subsequent frames coming in its
  25792. input.
  25793. </p>
  25794. <p>The filter can be used synchronize the output of multiple ffmpeg processes for
  25795. realtime output devices like decklink. By putting the delay in the filtering
  25796. chain and pre-buffering frames the process can pass on data to output almost
  25797. immediately after the target wallclock timestamp is reached.
  25798. </p>
  25799. <p>Perfect frame accuracy cannot be guaranteed, but the result is good enough for
  25800. some use cases.
  25801. </p>
  25802. <dl class="table">
  25803. <dt><samp class="option">cue</samp></dt>
  25804. <dd><p>The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0.
  25805. </p>
  25806. </dd>
  25807. <dt><samp class="option">preroll</samp></dt>
  25808. <dd><p>The duration of content to pass on as preroll expressed in seconds. Default is 0.
  25809. </p>
  25810. </dd>
  25811. <dt><samp class="option">buffer</samp></dt>
  25812. <dd><p>The maximum duration of content to buffer before waiting for the cue expressed
  25813. in seconds. Default is 0.
  25814. </p>
  25815. </dd>
  25816. </dl>
  25817. <a class="anchor" id="curves"></a><a name="curves-1"></a>
  25818. <h3 class="section">32.50 curves<span class="pull-right"><a class="anchor hidden-xs" href="#curves-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-curves-1" aria-hidden="true">TOC</a></span></h3>
  25819. <p>Apply color adjustments using curves.
  25820. </p>
  25821. <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
  25822. component (red, green and blue) has its values defined by <var class="var">N</var> key points
  25823. tied from each other using a smooth curve. The x-axis represents the pixel
  25824. values from the input frame, and the y-axis the new pixel values to be set for
  25825. the output frame.
  25826. </p>
  25827. <p>By default, a component curve is defined by the two points <var class="var">(0;0)</var> and
  25828. <var class="var">(1;1)</var>. This creates a straight line where each original pixel value is
  25829. &quot;adjusted&quot; to its own value, which means no change to the image.
  25830. </p>
  25831. <p>The filter allows you to redefine these two points and add some more. A new
  25832. curve will be defined to pass smoothly through all these new coordinates. The
  25833. new defined points need to be strictly increasing over the x-axis, and their
  25834. <var class="var">x</var> and <var class="var">y</var> values must be in the <var class="var">[0;1]</var> interval. The curve is
  25835. formed by using a natural or monotonic cubic spline interpolation, depending
  25836. on the <var class="var">interp</var> option (default: <code class="code">natural</code>). The <code class="code">natural</code>
  25837. spline produces a smoother curve in general while the monotonic (<code class="code">pchip</code>)
  25838. spline guarantees the transitions between the specified points to be
  25839. monotonic. If the computed curves happened to go outside the vector spaces,
  25840. the values will be clipped accordingly.
  25841. </p>
  25842. <p>The filter accepts the following options:
  25843. </p>
  25844. <dl class="table">
  25845. <dt><samp class="option">preset</samp></dt>
  25846. <dd><p>Select one of the available color presets. This option can be used in addition
  25847. to the <samp class="option">r</samp>, <samp class="option">g</samp>, <samp class="option">b</samp> parameters; in this case, the later
  25848. options takes priority on the preset values.
  25849. Available presets are:
  25850. </p><dl class="table">
  25851. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  25852. <dt>&lsquo;<samp class="samp">color_negative</samp>&rsquo;</dt>
  25853. <dt>&lsquo;<samp class="samp">cross_process</samp>&rsquo;</dt>
  25854. <dt>&lsquo;<samp class="samp">darker</samp>&rsquo;</dt>
  25855. <dt>&lsquo;<samp class="samp">increase_contrast</samp>&rsquo;</dt>
  25856. <dt>&lsquo;<samp class="samp">lighter</samp>&rsquo;</dt>
  25857. <dt>&lsquo;<samp class="samp">linear_contrast</samp>&rsquo;</dt>
  25858. <dt>&lsquo;<samp class="samp">medium_contrast</samp>&rsquo;</dt>
  25859. <dt>&lsquo;<samp class="samp">negative</samp>&rsquo;</dt>
  25860. <dt>&lsquo;<samp class="samp">strong_contrast</samp>&rsquo;</dt>
  25861. <dt>&lsquo;<samp class="samp">vintage</samp>&rsquo;</dt>
  25862. </dl>
  25863. <p>Default is <code class="code">none</code>.
  25864. </p></dd>
  25865. <dt><samp class="option">master, m</samp></dt>
  25866. <dd><p>Set the master key points. These points will define a second pass mapping. It
  25867. is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
  25868. <samp class="option">r</samp>, <samp class="option">g</samp>, <samp class="option">b</samp> or <samp class="option">all</samp> since it acts like a
  25869. post-processing LUT.
  25870. </p></dd>
  25871. <dt><samp class="option">red, r</samp></dt>
  25872. <dd><p>Set the key points for the red component.
  25873. </p></dd>
  25874. <dt><samp class="option">green, g</samp></dt>
  25875. <dd><p>Set the key points for the green component.
  25876. </p></dd>
  25877. <dt><samp class="option">blue, b</samp></dt>
  25878. <dd><p>Set the key points for the blue component.
  25879. </p></dd>
  25880. <dt><samp class="option">all</samp></dt>
  25881. <dd><p>Set the key points for all components (not including master).
  25882. Can be used in addition to the other key points component
  25883. options. In this case, the unset component(s) will fallback on this
  25884. <samp class="option">all</samp> setting.
  25885. </p></dd>
  25886. <dt><samp class="option">psfile</samp></dt>
  25887. <dd><p>Specify a Photoshop curves file (<code class="code">.acv</code>) to import the settings from.
  25888. </p></dd>
  25889. <dt><samp class="option">plot</samp></dt>
  25890. <dd><p>Save Gnuplot script of the curves in specified file.
  25891. </p></dd>
  25892. <dt><samp class="option">interp</samp></dt>
  25893. <dd><p>Specify the kind of interpolation. Available algorithms are:
  25894. </p><dl class="table">
  25895. <dt>&lsquo;<samp class="samp">natural</samp>&rsquo;</dt>
  25896. <dd><p>Natural cubic spline using a piece-wise cubic polynomial that is twice continuously differentiable.
  25897. </p></dd>
  25898. <dt>&lsquo;<samp class="samp">pchip</samp>&rsquo;</dt>
  25899. <dd><p>Monotonic cubic spline using a piecewise cubic Hermite interpolating polynomial (PCHIP).
  25900. </p></dd>
  25901. </dl>
  25902. </dd>
  25903. </dl>
  25904. <p>To avoid some filtergraph syntax conflicts, each key points list need to be
  25905. defined using the following syntax: <code class="code">x0/y0 x1/y1 x2/y2 ...</code>.
  25906. </p>
  25907. <a name="Commands-78"></a>
  25908. <h4 class="subsection">32.50.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-78" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-78" aria-hidden="true">TOC</a></span></h4>
  25909. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  25910. </p>
  25911. <a name="Examples-80"></a>
  25912. <h4 class="subsection">32.50.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-80" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-80" aria-hidden="true">TOC</a></span></h4>
  25913. <ul class="itemize mark-bullet">
  25914. <li>Increase slightly the middle level of blue:
  25915. <div class="example">
  25916. <pre class="example-preformatted">curves=blue='0/0 0.5/0.58 1/1'
  25917. </pre></div>
  25918. </li><li>Vintage effect:
  25919. <div class="example">
  25920. <pre class="example-preformatted">curves=r='0/0.11 .42/.51 1/0.95':g='0/0 0.50/0.48 1/1':b='0/0.22 .49/.44 1/0.8'
  25921. </pre></div>
  25922. <p>Here we obtain the following coordinates for each components:
  25923. </p><dl class="table">
  25924. <dt><var class="var">red</var></dt>
  25925. <dd><p><code class="code">(0;0.11) (0.42;0.51) (1;0.95)</code>
  25926. </p></dd>
  25927. <dt><var class="var">green</var></dt>
  25928. <dd><p><code class="code">(0;0) (0.50;0.48) (1;1)</code>
  25929. </p></dd>
  25930. <dt><var class="var">blue</var></dt>
  25931. <dd><p><code class="code">(0;0.22) (0.49;0.44) (1;0.80)</code>
  25932. </p></dd>
  25933. </dl>
  25934. </li><li>The previous example can also be achieved with the associated built-in preset:
  25935. <div class="example">
  25936. <pre class="example-preformatted">curves=preset=vintage
  25937. </pre></div>
  25938. </li><li>Or simply:
  25939. <div class="example">
  25940. <pre class="example-preformatted">curves=vintage
  25941. </pre></div>
  25942. </li><li>Use a Photoshop preset and redefine the points of the green component:
  25943. <div class="example">
  25944. <pre class="example-preformatted">curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
  25945. </pre></div>
  25946. </li><li>Check out the curves of the <code class="code">cross_process</code> profile using <code class="command">ffmpeg</code>
  25947. and <code class="command">gnuplot</code>:
  25948. <div class="example">
  25949. <pre class="example-preformatted">ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
  25950. gnuplot -p /tmp/curves.plt
  25951. </pre></div>
  25952. </li></ul>
  25953. <a name="datascope"></a>
  25954. <h3 class="section">32.51 datascope<span class="pull-right"><a class="anchor hidden-xs" href="#datascope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-datascope" aria-hidden="true">TOC</a></span></h3>
  25955. <p>Video data analysis filter.
  25956. </p>
  25957. <p>This filter shows hexadecimal pixel values of part of video.
  25958. </p>
  25959. <p>The filter accepts the following options:
  25960. </p>
  25961. <dl class="table">
  25962. <dt><samp class="option">size, s</samp></dt>
  25963. <dd><p>Set output video size.
  25964. </p>
  25965. </dd>
  25966. <dt><samp class="option">x</samp></dt>
  25967. <dd><p>Set x offset from where to pick pixels.
  25968. </p>
  25969. </dd>
  25970. <dt><samp class="option">y</samp></dt>
  25971. <dd><p>Set y offset from where to pick pixels.
  25972. </p>
  25973. </dd>
  25974. <dt><samp class="option">mode</samp></dt>
  25975. <dd><p>Set scope mode, can be one of the following:
  25976. </p><dl class="table">
  25977. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  25978. <dd><p>Draw hexadecimal pixel values with white color on black background.
  25979. </p>
  25980. </dd>
  25981. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  25982. <dd><p>Draw hexadecimal pixel values with input video pixel color on black
  25983. background.
  25984. </p>
  25985. </dd>
  25986. <dt>&lsquo;<samp class="samp">color2</samp>&rsquo;</dt>
  25987. <dd><p>Draw hexadecimal pixel values on color background picked from input video,
  25988. the text color is picked in such way so its always visible.
  25989. </p></dd>
  25990. </dl>
  25991. </dd>
  25992. <dt><samp class="option">axis</samp></dt>
  25993. <dd><p>Draw rows and columns numbers on left and top of video.
  25994. </p>
  25995. </dd>
  25996. <dt><samp class="option">opacity</samp></dt>
  25997. <dd><p>Set background opacity.
  25998. </p>
  25999. </dd>
  26000. <dt><samp class="option">format</samp></dt>
  26001. <dd><p>Set display number format. Can be <code class="code">hex</code>, or <code class="code">dec</code>. Default is <code class="code">hex</code>.
  26002. </p>
  26003. </dd>
  26004. <dt><samp class="option">components</samp></dt>
  26005. <dd><p>Set pixel components to display. By default all pixel components are displayed.
  26006. </p></dd>
  26007. </dl>
  26008. <a name="Commands-79"></a>
  26009. <h4 class="subsection">32.51.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-79" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-79" aria-hidden="true">TOC</a></span></h4>
  26010. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options excluding <code class="code">size</code> option.
  26011. </p>
  26012. <a name="dblur"></a>
  26013. <h3 class="section">32.52 dblur<span class="pull-right"><a class="anchor hidden-xs" href="#dblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dblur" aria-hidden="true">TOC</a></span></h3>
  26014. <p>Apply Directional blur filter.
  26015. </p>
  26016. <p>The filter accepts the following options:
  26017. </p>
  26018. <dl class="table">
  26019. <dt><samp class="option">angle</samp></dt>
  26020. <dd><p>Set angle of directional blur. Default is <code class="code">45</code>.
  26021. </p>
  26022. </dd>
  26023. <dt><samp class="option">radius</samp></dt>
  26024. <dd><p>Set radius of directional blur. Default is <code class="code">5</code>.
  26025. </p>
  26026. </dd>
  26027. <dt><samp class="option">planes</samp></dt>
  26028. <dd><p>Set which planes to filter. By default all planes are filtered.
  26029. </p></dd>
  26030. </dl>
  26031. <a name="Commands-80"></a>
  26032. <h4 class="subsection">32.52.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-80" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-80" aria-hidden="true">TOC</a></span></h4>
  26033. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  26034. The command accepts the same syntax of the corresponding option.
  26035. </p>
  26036. <p>If the specified expression is not valid, it is kept at its current
  26037. value.
  26038. </p>
  26039. <a name="dctdnoiz"></a>
  26040. <h3 class="section">32.53 dctdnoiz<span class="pull-right"><a class="anchor hidden-xs" href="#dctdnoiz" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dctdnoiz" aria-hidden="true">TOC</a></span></h3>
  26041. <p>Denoise frames using 2D DCT (frequency domain filtering).
  26042. </p>
  26043. <p>This filter is not designed for real time.
  26044. </p>
  26045. <p>The filter accepts the following options:
  26046. </p>
  26047. <dl class="table">
  26048. <dt><samp class="option">sigma, s</samp></dt>
  26049. <dd><p>Set the noise sigma constant.
  26050. </p>
  26051. <p>This <var class="var">sigma</var> defines a hard threshold of <code class="code">3 * sigma</code>; every DCT
  26052. coefficient (absolute value) below this threshold with be dropped.
  26053. </p>
  26054. <p>If you need a more advanced filtering, see <samp class="option">expr</samp>.
  26055. </p>
  26056. <p>Default is <code class="code">0</code>.
  26057. </p>
  26058. </dd>
  26059. <dt><samp class="option">overlap</samp></dt>
  26060. <dd><p>Set number overlapping pixels for each block. Since the filter can be slow, you
  26061. may want to reduce this value, at the cost of a less effective filter and the
  26062. risk of various artefacts.
  26063. </p>
  26064. <p>If the overlapping value doesn&rsquo;t permit processing the whole input width or
  26065. height, a warning will be displayed and according borders won&rsquo;t be denoised.
  26066. </p>
  26067. <p>Default value is <var class="var">blocksize</var>-1, which is the best possible setting.
  26068. </p>
  26069. </dd>
  26070. <dt><samp class="option">expr, e</samp></dt>
  26071. <dd><p>Set the coefficient factor expression.
  26072. </p>
  26073. <p>For each coefficient of a DCT block, this expression will be evaluated as a
  26074. multiplier value for the coefficient.
  26075. </p>
  26076. <p>If this is option is set, the <samp class="option">sigma</samp> option will be ignored.
  26077. </p>
  26078. <p>The absolute value of the coefficient can be accessed through the <var class="var">c</var>
  26079. variable.
  26080. </p>
  26081. </dd>
  26082. <dt><samp class="option">n</samp></dt>
  26083. <dd><p>Set the <var class="var">blocksize</var> using the number of bits. <code class="code">1&lt;&lt;<var class="var">n</var></code> defines the
  26084. <var class="var">blocksize</var>, which is the width and height of the processed blocks.
  26085. </p>
  26086. <p>The default value is <var class="var">3</var> (8x8) and can be raised to <var class="var">4</var> for a
  26087. <var class="var">blocksize</var> of 16x16. Note that changing this setting has huge consequences
  26088. on the speed processing. Also, a larger block size does not necessarily means a
  26089. better de-noising.
  26090. </p></dd>
  26091. </dl>
  26092. <a name="Examples-81"></a>
  26093. <h4 class="subsection">32.53.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-81" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-81" aria-hidden="true">TOC</a></span></h4>
  26094. <p>Apply a denoise with a <samp class="option">sigma</samp> of <code class="code">4.5</code>:
  26095. </p><div class="example">
  26096. <pre class="example-preformatted">dctdnoiz=4.5
  26097. </pre></div>
  26098. <p>The same operation can be achieved using the expression system:
  26099. </p><div class="example">
  26100. <pre class="example-preformatted">dctdnoiz=e='gte(c, 4.5*3)'
  26101. </pre></div>
  26102. <p>Violent denoise using a block size of <code class="code">16x16</code>:
  26103. </p><div class="example">
  26104. <pre class="example-preformatted">dctdnoiz=15:n=4
  26105. </pre></div>
  26106. <a name="deband"></a>
  26107. <h3 class="section">32.54 deband<span class="pull-right"><a class="anchor hidden-xs" href="#deband" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deband" aria-hidden="true">TOC</a></span></h3>
  26108. <p>Remove banding artifacts from input video.
  26109. It works by replacing banded pixels with average value of referenced pixels.
  26110. </p>
  26111. <p>The filter accepts the following options:
  26112. </p>
  26113. <dl class="table">
  26114. <dt><samp class="option">1thr</samp></dt>
  26115. <dt><samp class="option">2thr</samp></dt>
  26116. <dt><samp class="option">3thr</samp></dt>
  26117. <dt><samp class="option">4thr</samp></dt>
  26118. <dd><p>Set banding detection threshold for each plane. Default is 0.02.
  26119. Valid range is 0.00003 to 0.5.
  26120. If difference between current pixel and reference pixel is less than threshold,
  26121. it will be considered as banded.
  26122. </p>
  26123. </dd>
  26124. <dt><samp class="option">range, r</samp></dt>
  26125. <dd><p>Banding detection range in pixels. Default is 16. If positive, random number
  26126. in range 0 to set value will be used. If negative, exact absolute value
  26127. will be used.
  26128. The range defines square of four pixels around current pixel.
  26129. </p>
  26130. </dd>
  26131. <dt><samp class="option">direction, d</samp></dt>
  26132. <dd><p>Set direction in radians from which four pixel will be compared. If positive,
  26133. random direction from 0 to set direction will be picked. If negative, exact of
  26134. absolute value will be picked. For example direction 0, -PI or -2*PI radians
  26135. will pick only pixels on same row and -PI/2 will pick only pixels on same
  26136. column.
  26137. </p>
  26138. </dd>
  26139. <dt><samp class="option">blur, b</samp></dt>
  26140. <dd><p>If enabled, current pixel is compared with average value of all four
  26141. surrounding pixels. The default is enabled. If disabled current pixel is
  26142. compared with all four surrounding pixels. The pixel is considered banded
  26143. if only all four differences with surrounding pixels are less than threshold.
  26144. </p>
  26145. </dd>
  26146. <dt><samp class="option">coupling, c</samp></dt>
  26147. <dd><p>If enabled, current pixel is changed if and only if all pixel components are banded,
  26148. e.g. banding detection threshold is triggered for all color components.
  26149. The default is disabled.
  26150. </p></dd>
  26151. </dl>
  26152. <a name="Commands-81"></a>
  26153. <h4 class="subsection">32.54.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-81" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-81" aria-hidden="true">TOC</a></span></h4>
  26154. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  26155. </p>
  26156. <a name="deblock"></a>
  26157. <h3 class="section">32.55 deblock<span class="pull-right"><a class="anchor hidden-xs" href="#deblock" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deblock" aria-hidden="true">TOC</a></span></h3>
  26158. <p>Remove blocking artifacts from input video.
  26159. </p>
  26160. <p>The filter accepts the following options:
  26161. </p>
  26162. <dl class="table">
  26163. <dt><samp class="option">filter</samp></dt>
  26164. <dd><p>Set filter type, can be <var class="var">weak</var> or <var class="var">strong</var>. Default is <var class="var">strong</var>.
  26165. This controls what kind of deblocking is applied.
  26166. </p>
  26167. </dd>
  26168. <dt><samp class="option">block</samp></dt>
  26169. <dd><p>Set size of block, allowed range is from 4 to 512. Default is <var class="var">8</var>.
  26170. </p>
  26171. </dd>
  26172. <dt><samp class="option">alpha</samp></dt>
  26173. <dt><samp class="option">beta</samp></dt>
  26174. <dt><samp class="option">gamma</samp></dt>
  26175. <dt><samp class="option">delta</samp></dt>
  26176. <dd><p>Set blocking detection thresholds. Allowed range is 0 to 1.
  26177. Defaults are: <var class="var">0.098</var> for <var class="var">alpha</var> and <var class="var">0.05</var> for the rest.
  26178. Using higher threshold gives more deblocking strength.
  26179. Setting <var class="var">alpha</var> controls threshold detection at exact edge of block.
  26180. Remaining options controls threshold detection near the edge. Each one for
  26181. below/above or left/right. Setting any of those to <var class="var">0</var> disables
  26182. deblocking.
  26183. </p>
  26184. </dd>
  26185. <dt><samp class="option">planes</samp></dt>
  26186. <dd><p>Set planes to filter. Default is to filter all available planes.
  26187. </p></dd>
  26188. </dl>
  26189. <a name="Examples-82"></a>
  26190. <h4 class="subsection">32.55.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-82" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-82" aria-hidden="true">TOC</a></span></h4>
  26191. <ul class="itemize mark-bullet">
  26192. <li>Deblock using weak filter and block size of 4 pixels.
  26193. <div class="example">
  26194. <pre class="example-preformatted">deblock=filter=weak:block=4
  26195. </pre></div>
  26196. </li><li>Deblock using strong filter, block size of 4 pixels and custom thresholds for
  26197. deblocking more edges.
  26198. <div class="example">
  26199. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
  26200. </pre></div>
  26201. </li><li>Similar as above, but filter only first plane.
  26202. <div class="example">
  26203. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
  26204. </pre></div>
  26205. </li><li>Similar as above, but filter only second and third plane.
  26206. <div class="example">
  26207. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
  26208. </pre></div>
  26209. </li></ul>
  26210. <a name="Commands-82"></a>
  26211. <h4 class="subsection">32.55.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-82" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-82" aria-hidden="true">TOC</a></span></h4>
  26212. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  26213. </p>
  26214. <a class="anchor" id="decimate"></a><a name="decimate-1"></a>
  26215. <h3 class="section">32.56 decimate<span class="pull-right"><a class="anchor hidden-xs" href="#decimate-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decimate-1" aria-hidden="true">TOC</a></span></h3>
  26216. <p>Drop duplicated frames at regular intervals.
  26217. </p>
  26218. <p>The filter accepts the following options:
  26219. </p>
  26220. <dl class="table">
  26221. <dt><samp class="option">cycle</samp></dt>
  26222. <dd><p>Set the number of frames from which one will be dropped. Setting this to
  26223. <var class="var">N</var> means one frame in every batch of <var class="var">N</var> frames will be dropped.
  26224. Default is <code class="code">5</code>.
  26225. </p>
  26226. </dd>
  26227. <dt><samp class="option">dupthresh</samp></dt>
  26228. <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
  26229. is less than or equal to this value, then it is declared as duplicate. Default
  26230. is <code class="code">1.1</code>
  26231. </p>
  26232. </dd>
  26233. <dt><samp class="option">scthresh</samp></dt>
  26234. <dd><p>Set scene change threshold. Default is <code class="code">15</code>.
  26235. </p>
  26236. </dd>
  26237. <dt><samp class="option">blockx</samp></dt>
  26238. <dt><samp class="option">blocky</samp></dt>
  26239. <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
  26240. Larger blocks give better noise suppression, but also give worse detection of
  26241. small movements. Must be a power of two. Default is <code class="code">32</code>.
  26242. </p>
  26243. </dd>
  26244. <dt><samp class="option">ppsrc</samp></dt>
  26245. <dd><p>Mark main input as a pre-processed input and activate clean source input
  26246. stream. This allows the input to be pre-processed with various filters to help
  26247. the metrics calculation while keeping the frame selection lossless. When set to
  26248. <code class="code">1</code>, the first stream is for the pre-processed input, and the second
  26249. stream is the clean source from where the kept frames are chosen. Default is
  26250. <code class="code">0</code>.
  26251. </p>
  26252. </dd>
  26253. <dt><samp class="option">chroma</samp></dt>
  26254. <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
  26255. <code class="code">1</code>.
  26256. </p>
  26257. </dd>
  26258. <dt><samp class="option">mixed</samp></dt>
  26259. <dd><p>Set whether or not the input only partially contains content to be decimated.
  26260. Default is <code class="code">false</code>.
  26261. If enabled video output stream will be in variable frame rate.
  26262. </p></dd>
  26263. </dl>
  26264. <a name="deconvolve"></a>
  26265. <h3 class="section">32.57 deconvolve<span class="pull-right"><a class="anchor hidden-xs" href="#deconvolve" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deconvolve" aria-hidden="true">TOC</a></span></h3>
  26266. <p>Apply 2D deconvolution of video stream in frequency domain using second stream
  26267. as impulse.
  26268. </p>
  26269. <p>The filter accepts the following options:
  26270. </p>
  26271. <dl class="table">
  26272. <dt><samp class="option">planes</samp></dt>
  26273. <dd><p>Set which planes to process.
  26274. </p>
  26275. </dd>
  26276. <dt><samp class="option">impulse</samp></dt>
  26277. <dd><p>Set which impulse video frames will be processed, can be <var class="var">first</var>
  26278. or <var class="var">all</var>. Default is <var class="var">all</var>.
  26279. </p>
  26280. </dd>
  26281. <dt><samp class="option">noise</samp></dt>
  26282. <dd><p>Set noise when doing divisions. Default is <var class="var">0.0000001</var>. Useful when width
  26283. and height are not same and not power of 2 or if stream prior to convolving
  26284. had noise.
  26285. </p></dd>
  26286. </dl>
  26287. <p>The <code class="code">deconvolve</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  26288. </p>
  26289. <a name="dedot"></a>
  26290. <h3 class="section">32.58 dedot<span class="pull-right"><a class="anchor hidden-xs" href="#dedot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dedot" aria-hidden="true">TOC</a></span></h3>
  26291. <p>Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video.
  26292. </p>
  26293. <p>It accepts the following options:
  26294. </p>
  26295. <dl class="table">
  26296. <dt><samp class="option">m</samp></dt>
  26297. <dd><p>Set mode of operation. Can be combination of <var class="var">dotcrawl</var> for cross-luminance reduction and/or
  26298. <var class="var">rainbows</var> for cross-color reduction.
  26299. </p>
  26300. </dd>
  26301. <dt><samp class="option">lt</samp></dt>
  26302. <dd><p>Set spatial luma threshold. Lower values increases reduction of cross-luminance.
  26303. </p>
  26304. </dd>
  26305. <dt><samp class="option">tl</samp></dt>
  26306. <dd><p>Set tolerance for temporal luma. Higher values increases reduction of cross-luminance.
  26307. </p>
  26308. </dd>
  26309. <dt><samp class="option">tc</samp></dt>
  26310. <dd><p>Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color.
  26311. </p>
  26312. </dd>
  26313. <dt><samp class="option">ct</samp></dt>
  26314. <dd><p>Set temporal chroma threshold. Lower values increases reduction of cross-color.
  26315. </p></dd>
  26316. </dl>
  26317. <a name="deflate"></a>
  26318. <h3 class="section">32.59 deflate<span class="pull-right"><a class="anchor hidden-xs" href="#deflate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deflate" aria-hidden="true">TOC</a></span></h3>
  26319. <p>Apply deflate effect to the video.
  26320. </p>
  26321. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  26322. only values lower than the pixel.
  26323. </p>
  26324. <p>It accepts the following options:
  26325. </p>
  26326. <dl class="table">
  26327. <dt><samp class="option">threshold0</samp></dt>
  26328. <dt><samp class="option">threshold1</samp></dt>
  26329. <dt><samp class="option">threshold2</samp></dt>
  26330. <dt><samp class="option">threshold3</samp></dt>
  26331. <dd><p>Limit the maximum change for each plane, default is 65535.
  26332. If 0, plane will remain unchanged.
  26333. </p></dd>
  26334. </dl>
  26335. <a name="Commands-83"></a>
  26336. <h4 class="subsection">32.59.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-83" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-83" aria-hidden="true">TOC</a></span></h4>
  26337. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  26338. </p>
  26339. <a name="deflicker"></a>
  26340. <h3 class="section">32.60 deflicker<span class="pull-right"><a class="anchor hidden-xs" href="#deflicker" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deflicker" aria-hidden="true">TOC</a></span></h3>
  26341. <p>Remove temporal frame luminance variations.
  26342. </p>
  26343. <p>It accepts the following options:
  26344. </p>
  26345. <dl class="table">
  26346. <dt><samp class="option">size, s</samp></dt>
  26347. <dd><p>Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129.
  26348. </p>
  26349. </dd>
  26350. <dt><samp class="option">mode, m</samp></dt>
  26351. <dd><p>Set averaging mode to smooth temporal luminance variations.
  26352. </p>
  26353. <p>Available values are:
  26354. </p><dl class="table">
  26355. <dt>&lsquo;<samp class="samp">am</samp>&rsquo;</dt>
  26356. <dd><p>Arithmetic mean
  26357. </p>
  26358. </dd>
  26359. <dt>&lsquo;<samp class="samp">gm</samp>&rsquo;</dt>
  26360. <dd><p>Geometric mean
  26361. </p>
  26362. </dd>
  26363. <dt>&lsquo;<samp class="samp">hm</samp>&rsquo;</dt>
  26364. <dd><p>Harmonic mean
  26365. </p>
  26366. </dd>
  26367. <dt>&lsquo;<samp class="samp">qm</samp>&rsquo;</dt>
  26368. <dd><p>Quadratic mean
  26369. </p>
  26370. </dd>
  26371. <dt>&lsquo;<samp class="samp">cm</samp>&rsquo;</dt>
  26372. <dd><p>Cubic mean
  26373. </p>
  26374. </dd>
  26375. <dt>&lsquo;<samp class="samp">pm</samp>&rsquo;</dt>
  26376. <dd><p>Power mean
  26377. </p>
  26378. </dd>
  26379. <dt>&lsquo;<samp class="samp">median</samp>&rsquo;</dt>
  26380. <dd><p>Median
  26381. </p></dd>
  26382. </dl>
  26383. </dd>
  26384. <dt><samp class="option">bypass</samp></dt>
  26385. <dd><p>Do not actually modify frame. Useful when one only wants metadata.
  26386. </p></dd>
  26387. </dl>
  26388. <a name="dejudder"></a>
  26389. <h3 class="section">32.61 dejudder<span class="pull-right"><a class="anchor hidden-xs" href="#dejudder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dejudder" aria-hidden="true">TOC</a></span></h3>
  26390. <p>Remove judder produced by partially interlaced telecined content.
  26391. </p>
  26392. <p>Judder can be introduced, for instance, by <a class="ref" href="#pullup">pullup</a> filter. If the original
  26393. source was partially telecined content then the output of <code class="code">pullup,dejudder</code>
  26394. will have a variable frame rate. May change the recorded frame rate of the
  26395. container. Aside from that change, this filter will not affect constant frame
  26396. rate video.
  26397. </p>
  26398. <p>The option available in this filter is:
  26399. </p><dl class="table">
  26400. <dt><samp class="option">cycle</samp></dt>
  26401. <dd><p>Specify the length of the window over which the judder repeats.
  26402. </p>
  26403. <p>Accepts any integer greater than 1. Useful values are:
  26404. </p><dl class="table">
  26405. <dt>&lsquo;<samp class="samp">4</samp>&rsquo;</dt>
  26406. <dd><p>If the original was telecined from 24 to 30 fps (Film to NTSC).
  26407. </p>
  26408. </dd>
  26409. <dt>&lsquo;<samp class="samp">5</samp>&rsquo;</dt>
  26410. <dd><p>If the original was telecined from 25 to 30 fps (PAL to NTSC).
  26411. </p>
  26412. </dd>
  26413. <dt>&lsquo;<samp class="samp">20</samp>&rsquo;</dt>
  26414. <dd><p>If a mixture of the two.
  26415. </p></dd>
  26416. </dl>
  26417. <p>The default is &lsquo;<samp class="samp">4</samp>&rsquo;.
  26418. </p></dd>
  26419. </dl>
  26420. <a name="delogo"></a>
  26421. <h3 class="section">32.62 delogo<span class="pull-right"><a class="anchor hidden-xs" href="#delogo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-delogo" aria-hidden="true">TOC</a></span></h3>
  26422. <p>Suppress a TV station logo by a simple interpolation of the surrounding
  26423. pixels. Just set a rectangle covering the logo and watch it disappear
  26424. (and sometimes something even uglier appear - your mileage may vary).
  26425. </p>
  26426. <p>It accepts the following parameters:
  26427. </p><dl class="table">
  26428. <dt><samp class="option">x</samp></dt>
  26429. <dt><samp class="option">y</samp></dt>
  26430. <dd><p>Specify the top left corner coordinates of the logo. They must be
  26431. specified.
  26432. </p>
  26433. </dd>
  26434. <dt><samp class="option">w</samp></dt>
  26435. <dt><samp class="option">h</samp></dt>
  26436. <dd><p>Specify the width and height of the logo to clear. They must be
  26437. specified.
  26438. </p>
  26439. </dd>
  26440. <dt><samp class="option">show</samp></dt>
  26441. <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
  26442. finding the right <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var>, and <var class="var">h</var> parameters.
  26443. The default value is 0.
  26444. </p>
  26445. <p>The rectangle is drawn on the outermost pixels which will be (partly)
  26446. replaced with interpolated values. The values of the next pixels
  26447. immediately outside this rectangle in each direction will be used to
  26448. compute the interpolated pixel values inside the rectangle.
  26449. </p>
  26450. </dd>
  26451. </dl>
  26452. <a name="Examples-83"></a>
  26453. <h4 class="subsection">32.62.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-83" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-83" aria-hidden="true">TOC</a></span></h4>
  26454. <ul class="itemize mark-bullet">
  26455. <li>Set a rectangle covering the area with top left corner coordinates 0,0
  26456. and size 100x77:
  26457. <div class="example">
  26458. <pre class="example-preformatted">delogo=x=0:y=0:w=100:h=77
  26459. </pre></div>
  26460. </li></ul>
  26461. <a class="anchor" id="derain"></a><a name="derain-1"></a>
  26462. <h3 class="section">32.63 derain<span class="pull-right"><a class="anchor hidden-xs" href="#derain-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-derain-1" aria-hidden="true">TOC</a></span></h3>
  26463. <p>Remove the rain in the input image/video by applying the derain methods based on
  26464. convolutional neural networks. Supported models:
  26465. </p>
  26466. <ul class="itemize mark-bullet">
  26467. <li>Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN).
  26468. See <a class="url" href="http://openaccess.thecvf.com/content_ECCV_2018/papers/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.pdf">http://openaccess.thecvf.com/content_ECCV_2018/papers/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.pdf</a>.
  26469. </li></ul>
  26470. <p>Training as well as model generation scripts are provided in
  26471. the repository at <a class="url" href="https://github.com/XueweiMeng/derain_filter.git">https://github.com/XueweiMeng/derain_filter.git</a>.
  26472. </p>
  26473. <p>The filter accepts the following options:
  26474. </p>
  26475. <dl class="table">
  26476. <dt><samp class="option">filter_type</samp></dt>
  26477. <dd><p>Specify which filter to use. This option accepts the following values:
  26478. </p>
  26479. <dl class="table">
  26480. <dt>&lsquo;<samp class="samp">derain</samp>&rsquo;</dt>
  26481. <dd><p>Derain filter. To conduct derain filter, you need to use a derain model.
  26482. </p>
  26483. </dd>
  26484. <dt>&lsquo;<samp class="samp">dehaze</samp>&rsquo;</dt>
  26485. <dd><p>Dehaze filter. To conduct dehaze filter, you need to use a dehaze model.
  26486. </p></dd>
  26487. </dl>
  26488. <p>Default value is &lsquo;<samp class="samp">derain</samp>&rsquo;.
  26489. </p>
  26490. </dd>
  26491. <dt><samp class="option">dnn_backend</samp></dt>
  26492. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  26493. the following values:
  26494. </p>
  26495. <dl class="table">
  26496. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  26497. <dd><p>TensorFlow backend. To enable this backend you
  26498. need to install the TensorFlow for C library (see
  26499. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  26500. <code class="code">--enable-libtensorflow</code>
  26501. </p></dd>
  26502. </dl>
  26503. </dd>
  26504. <dt><samp class="option">model</samp></dt>
  26505. <dd><p>Set path to model file specifying network architecture and its parameters.
  26506. Note that different backends use different file formats. TensorFlow can load files for only its format.
  26507. </p></dd>
  26508. </dl>
  26509. <p>To get full functionality (such as async execution), please use the <a class="ref" href="#dnn_005fprocessing">dnn_processing</a> filter.
  26510. </p>
  26511. <a name="deshake"></a>
  26512. <h3 class="section">32.64 deshake<span class="pull-right"><a class="anchor hidden-xs" href="#deshake" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deshake" aria-hidden="true">TOC</a></span></h3>
  26513. <p>Attempt to fix small changes in horizontal and/or vertical shift. This
  26514. filter helps remove camera shake from hand-holding a camera, bumping a
  26515. tripod, moving on a vehicle, etc.
  26516. </p>
  26517. <p>The filter accepts the following options:
  26518. </p>
  26519. <dl class="table">
  26520. <dt><samp class="option">x</samp></dt>
  26521. <dt><samp class="option">y</samp></dt>
  26522. <dt><samp class="option">w</samp></dt>
  26523. <dt><samp class="option">h</samp></dt>
  26524. <dd><p>Specify a rectangular area where to limit the search for motion
  26525. vectors.
  26526. If desired the search for motion vectors can be limited to a
  26527. rectangular area of the frame defined by its top left corner, width
  26528. and height. These parameters have the same meaning as the drawbox
  26529. filter which can be used to visualise the position of the bounding
  26530. box.
  26531. </p>
  26532. <p>This is useful when simultaneous movement of subjects within the frame
  26533. might be confused for camera motion by the motion vector search.
  26534. </p>
  26535. <p>If any or all of <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var> and <var class="var">h</var> are set to -1
  26536. then the full frame is used. This allows later options to be set
  26537. without specifying the bounding box for the motion vector search.
  26538. </p>
  26539. <p>Default - search the whole frame.
  26540. </p>
  26541. </dd>
  26542. <dt><samp class="option">rx</samp></dt>
  26543. <dt><samp class="option">ry</samp></dt>
  26544. <dd><p>Specify the maximum extent of movement in x and y directions in the
  26545. range 0-64 pixels. Default 16.
  26546. </p>
  26547. </dd>
  26548. <dt><samp class="option">edge</samp></dt>
  26549. <dd><p>Specify how to generate pixels to fill blanks at the edge of the
  26550. frame. Available values are:
  26551. </p><dl class="table">
  26552. <dt>&lsquo;<samp class="samp">blank, 0</samp>&rsquo;</dt>
  26553. <dd><p>Fill zeroes at blank locations
  26554. </p></dd>
  26555. <dt>&lsquo;<samp class="samp">original, 1</samp>&rsquo;</dt>
  26556. <dd><p>Original image at blank locations
  26557. </p></dd>
  26558. <dt>&lsquo;<samp class="samp">clamp, 2</samp>&rsquo;</dt>
  26559. <dd><p>Extruded edge value at blank locations
  26560. </p></dd>
  26561. <dt>&lsquo;<samp class="samp">mirror, 3</samp>&rsquo;</dt>
  26562. <dd><p>Mirrored edge at blank locations
  26563. </p></dd>
  26564. </dl>
  26565. <p>Default value is &lsquo;<samp class="samp">mirror</samp>&rsquo;.
  26566. </p>
  26567. </dd>
  26568. <dt><samp class="option">blocksize</samp></dt>
  26569. <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
  26570. default 8.
  26571. </p>
  26572. </dd>
  26573. <dt><samp class="option">contrast</samp></dt>
  26574. <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
  26575. the specified contrast (difference between darkest and lightest
  26576. pixels) will be considered. Range 1-255, default 125.
  26577. </p>
  26578. </dd>
  26579. <dt><samp class="option">search</samp></dt>
  26580. <dd><p>Specify the search strategy. Available values are:
  26581. </p><dl class="table">
  26582. <dt>&lsquo;<samp class="samp">exhaustive, 0</samp>&rsquo;</dt>
  26583. <dd><p>Set exhaustive search
  26584. </p></dd>
  26585. <dt>&lsquo;<samp class="samp">less, 1</samp>&rsquo;</dt>
  26586. <dd><p>Set less exhaustive search.
  26587. </p></dd>
  26588. </dl>
  26589. <p>Default value is &lsquo;<samp class="samp">exhaustive</samp>&rsquo;.
  26590. </p>
  26591. </dd>
  26592. <dt><samp class="option">filename</samp></dt>
  26593. <dd><p>If set then a detailed log of the motion search is written to the
  26594. specified file.
  26595. </p>
  26596. </dd>
  26597. </dl>
  26598. <a name="despill"></a>
  26599. <h3 class="section">32.65 despill<span class="pull-right"><a class="anchor hidden-xs" href="#despill" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-despill" aria-hidden="true">TOC</a></span></h3>
  26600. <p>Remove unwanted contamination of foreground colors, caused by reflected color of
  26601. greenscreen or bluescreen.
  26602. </p>
  26603. <p>This filter accepts the following options:
  26604. </p>
  26605. <dl class="table">
  26606. <dt><samp class="option">type</samp></dt>
  26607. <dd><p>Set what type of despill to use.
  26608. </p>
  26609. </dd>
  26610. <dt><samp class="option">mix</samp></dt>
  26611. <dd><p>Set how spillmap will be generated.
  26612. </p>
  26613. </dd>
  26614. <dt><samp class="option">expand</samp></dt>
  26615. <dd><p>Set how much to get rid of still remaining spill.
  26616. </p>
  26617. </dd>
  26618. <dt><samp class="option">red</samp></dt>
  26619. <dd><p>Controls amount of red in spill area.
  26620. </p>
  26621. </dd>
  26622. <dt><samp class="option">green</samp></dt>
  26623. <dd><p>Controls amount of green in spill area.
  26624. Should be -1 for greenscreen.
  26625. </p>
  26626. </dd>
  26627. <dt><samp class="option">blue</samp></dt>
  26628. <dd><p>Controls amount of blue in spill area.
  26629. Should be -1 for bluescreen.
  26630. </p>
  26631. </dd>
  26632. <dt><samp class="option">brightness</samp></dt>
  26633. <dd><p>Controls brightness of spill area, preserving colors.
  26634. </p>
  26635. </dd>
  26636. <dt><samp class="option">alpha</samp></dt>
  26637. <dd><p>Modify alpha from generated spillmap.
  26638. </p></dd>
  26639. </dl>
  26640. <a name="Commands-84"></a>
  26641. <h4 class="subsection">32.65.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-84" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-84" aria-hidden="true">TOC</a></span></h4>
  26642. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  26643. </p>
  26644. <a name="detelecine"></a>
  26645. <h3 class="section">32.66 detelecine<span class="pull-right"><a class="anchor hidden-xs" href="#detelecine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-detelecine" aria-hidden="true">TOC</a></span></h3>
  26646. <p>Apply an exact inverse of the telecine operation. It requires a predefined
  26647. pattern specified using the pattern option which must be the same as that passed
  26648. to the telecine filter.
  26649. </p>
  26650. <p>This filter accepts the following options:
  26651. </p>
  26652. <dl class="table">
  26653. <dt><samp class="option">first_field</samp></dt>
  26654. <dd><dl class="table">
  26655. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  26656. <dd><p>top field first
  26657. </p></dd>
  26658. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  26659. <dd><p>bottom field first
  26660. The default value is <code class="code">top</code>.
  26661. </p></dd>
  26662. </dl>
  26663. </dd>
  26664. <dt><samp class="option">pattern</samp></dt>
  26665. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  26666. The default value is <code class="code">23</code>.
  26667. </p>
  26668. </dd>
  26669. <dt><samp class="option">start_frame</samp></dt>
  26670. <dd><p>A number representing position of the first frame with respect to the telecine
  26671. pattern. This is to be used if the stream is cut. The default value is <code class="code">0</code>.
  26672. </p></dd>
  26673. </dl>
  26674. <a class="anchor" id="dilation"></a><a name="dilation-1"></a>
  26675. <h3 class="section">32.67 dilation<span class="pull-right"><a class="anchor hidden-xs" href="#dilation-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilation-1" aria-hidden="true">TOC</a></span></h3>
  26676. <p>Apply dilation effect to the video.
  26677. </p>
  26678. <p>This filter replaces the pixel by the local(3x3) maximum.
  26679. </p>
  26680. <p>It accepts the following options:
  26681. </p>
  26682. <dl class="table">
  26683. <dt><samp class="option">threshold0</samp></dt>
  26684. <dt><samp class="option">threshold1</samp></dt>
  26685. <dt><samp class="option">threshold2</samp></dt>
  26686. <dt><samp class="option">threshold3</samp></dt>
  26687. <dd><p>Limit the maximum change for each plane, default is 65535.
  26688. If 0, plane will remain unchanged.
  26689. </p>
  26690. </dd>
  26691. <dt><samp class="option">coordinates</samp></dt>
  26692. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  26693. pixels are used.
  26694. </p>
  26695. <p>Flags to local 3x3 coordinates maps like this:
  26696. </p>
  26697. <p>1 2 3
  26698. 4 5
  26699. 6 7 8
  26700. </p></dd>
  26701. </dl>
  26702. <a name="Commands-85"></a>
  26703. <h4 class="subsection">32.67.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-85" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-85" aria-hidden="true">TOC</a></span></h4>
  26704. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  26705. </p>
  26706. <a name="displace"></a>
  26707. <h3 class="section">32.68 displace<span class="pull-right"><a class="anchor hidden-xs" href="#displace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-displace" aria-hidden="true">TOC</a></span></h3>
  26708. <p>Displace pixels as indicated by second and third input stream.
  26709. </p>
  26710. <p>It takes three input streams and outputs one stream, the first input is the
  26711. source, and second and third input are displacement maps.
  26712. </p>
  26713. <p>The second input specifies how much to displace pixels along the
  26714. x-axis, while the third input specifies how much to displace pixels
  26715. along the y-axis.
  26716. If one of displacement map streams terminates, last frame from that
  26717. displacement map will be used.
  26718. </p>
  26719. <p>Note that once generated, displacements maps can be reused over and over again.
  26720. </p>
  26721. <p>A description of the accepted options follows.
  26722. </p>
  26723. <dl class="table">
  26724. <dt><samp class="option">edge</samp></dt>
  26725. <dd><p>Set displace behavior for pixels that are out of range.
  26726. </p>
  26727. <p>Available values are:
  26728. </p><dl class="table">
  26729. <dt>&lsquo;<samp class="samp">blank</samp>&rsquo;</dt>
  26730. <dd><p>Missing pixels are replaced by black pixels.
  26731. </p>
  26732. </dd>
  26733. <dt>&lsquo;<samp class="samp">smear</samp>&rsquo;</dt>
  26734. <dd><p>Adjacent pixels will spread out to replace missing pixels.
  26735. </p>
  26736. </dd>
  26737. <dt>&lsquo;<samp class="samp">wrap</samp>&rsquo;</dt>
  26738. <dd><p>Out of range pixels are wrapped so they point to pixels of other side.
  26739. </p>
  26740. </dd>
  26741. <dt>&lsquo;<samp class="samp">mirror</samp>&rsquo;</dt>
  26742. <dd><p>Out of range pixels will be replaced with mirrored pixels.
  26743. </p></dd>
  26744. </dl>
  26745. <p>Default is &lsquo;<samp class="samp">smear</samp>&rsquo;.
  26746. </p>
  26747. </dd>
  26748. </dl>
  26749. <a name="Examples-84"></a>
  26750. <h4 class="subsection">32.68.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-84" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-84" aria-hidden="true">TOC</a></span></h4>
  26751. <ul class="itemize mark-bullet">
  26752. <li>Add ripple effect to rgb input of video size hd720:
  26753. <div class="example">
  26754. <pre class="example-preformatted">ffmpeg -i INPUT -f lavfi -i nullsrc=s=hd720,lutrgb=128:128:128 -f lavfi -i nullsrc=s=hd720,geq='r=128+30*sin(2*PI*X/400+T):g=128+30*sin(2*PI*X/400+T):b=128+30*sin(2*PI*X/400+T)' -lavfi '[0][1][2]displace' OUTPUT
  26755. </pre></div>
  26756. </li><li>Add wave effect to rgb input of video size hd720:
  26757. <div class="example">
  26758. <pre class="example-preformatted">ffmpeg -i INPUT -f lavfi -i nullsrc=hd720,geq='r=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):g=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):b=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T))' -lavfi '[1]split[x][y],[0][x][y]displace' OUTPUT
  26759. </pre></div>
  26760. </li></ul>
  26761. <a name="dnn_005fclassify"></a>
  26762. <h3 class="section">32.69 dnn_classify<span class="pull-right"><a class="anchor hidden-xs" href="#dnn_005fclassify" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dnn_005fclassify" aria-hidden="true">TOC</a></span></h3>
  26763. <p>Do classification with deep neural networks based on bounding boxes.
  26764. </p>
  26765. <p>The filter accepts the following options:
  26766. </p>
  26767. <dl class="table">
  26768. <dt><samp class="option">dnn_backend</samp></dt>
  26769. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  26770. only openvino now, tensorflow backends will be added.
  26771. </p>
  26772. </dd>
  26773. <dt><samp class="option">model</samp></dt>
  26774. <dd><p>Set path to model file specifying network architecture and its parameters.
  26775. Note that different backends use different file formats.
  26776. </p>
  26777. </dd>
  26778. <dt><samp class="option">input</samp></dt>
  26779. <dd><p>Set the input name of the dnn network.
  26780. </p>
  26781. </dd>
  26782. <dt><samp class="option">output</samp></dt>
  26783. <dd><p>Set the output name of the dnn network.
  26784. </p>
  26785. </dd>
  26786. <dt><samp class="option">confidence</samp></dt>
  26787. <dd><p>Set the confidence threshold (default: 0.5).
  26788. </p>
  26789. </dd>
  26790. <dt><samp class="option">labels</samp></dt>
  26791. <dd><p>Set path to label file specifying the mapping between label id and name.
  26792. Each label name is written in one line, tailing spaces and empty lines are skipped.
  26793. The first line is the name of label id 0,
  26794. and the second line is the name of label id 1, etc.
  26795. The label id is considered as name if the label file is not provided.
  26796. </p>
  26797. </dd>
  26798. <dt><samp class="option">backend_configs</samp></dt>
  26799. <dd><p>Set the configs to be passed into backend
  26800. </p>
  26801. <p>For tensorflow backend, you can set its configs with <samp class="option">sess_config</samp> options,
  26802. please use tools/python/tf_sess_config.py to get the configs for your system.
  26803. </p>
  26804. </dd>
  26805. </dl>
  26806. <a name="dnn_005fdetect"></a>
  26807. <h3 class="section">32.70 dnn_detect<span class="pull-right"><a class="anchor hidden-xs" href="#dnn_005fdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dnn_005fdetect" aria-hidden="true">TOC</a></span></h3>
  26808. <p>Do object detection with deep neural networks.
  26809. </p>
  26810. <p>The filter accepts the following options:
  26811. </p>
  26812. <dl class="table">
  26813. <dt><samp class="option">dnn_backend</samp></dt>
  26814. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  26815. only openvino now, tensorflow backends will be added.
  26816. </p>
  26817. </dd>
  26818. <dt><samp class="option">model</samp></dt>
  26819. <dd><p>Set path to model file specifying network architecture and its parameters.
  26820. Note that different backends use different file formats.
  26821. </p>
  26822. </dd>
  26823. <dt><samp class="option">input</samp></dt>
  26824. <dd><p>Set the input name of the dnn network.
  26825. </p>
  26826. </dd>
  26827. <dt><samp class="option">output</samp></dt>
  26828. <dd><p>Set the output name of the dnn network.
  26829. </p>
  26830. </dd>
  26831. <dt><samp class="option">confidence</samp></dt>
  26832. <dd><p>Set the confidence threshold (default: 0.5).
  26833. </p>
  26834. </dd>
  26835. <dt><samp class="option">labels</samp></dt>
  26836. <dd><p>Set path to label file specifying the mapping between label id and name.
  26837. Each label name is written in one line, tailing spaces and empty lines are skipped.
  26838. The first line is the name of label id 0 (usually it is &rsquo;background&rsquo;),
  26839. and the second line is the name of label id 1, etc.
  26840. The label id is considered as name if the label file is not provided.
  26841. </p>
  26842. </dd>
  26843. <dt><samp class="option">backend_configs</samp></dt>
  26844. <dd><p>Set the configs to be passed into backend. To use async execution, set async (default: set).
  26845. Roll back to sync execution if the backend does not support async.
  26846. </p>
  26847. </dd>
  26848. </dl>
  26849. <a class="anchor" id="dnn_005fprocessing"></a><a name="dnn_005fprocessing-1"></a>
  26850. <h3 class="section">32.71 dnn_processing<span class="pull-right"><a class="anchor hidden-xs" href="#dnn_005fprocessing-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dnn_005fprocessing-1" aria-hidden="true">TOC</a></span></h3>
  26851. <p>Do image processing with deep neural networks. It works together with another filter
  26852. which converts the pixel format of the Frame to what the dnn network requires.
  26853. </p>
  26854. <p>The filter accepts the following options:
  26855. </p>
  26856. <dl class="table">
  26857. <dt><samp class="option">dnn_backend</samp></dt>
  26858. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  26859. the following values:
  26860. </p>
  26861. <dl class="table">
  26862. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  26863. <dd><p>TensorFlow backend. To enable this backend you
  26864. need to install the TensorFlow for C library (see
  26865. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  26866. <code class="code">--enable-libtensorflow</code>
  26867. </p>
  26868. </dd>
  26869. <dt>&lsquo;<samp class="samp">openvino</samp>&rsquo;</dt>
  26870. <dd><p>OpenVINO backend. To enable this backend you
  26871. need to build and install the OpenVINO for C library (see
  26872. <a class="url" href="https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md">https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md</a>) and configure FFmpeg with
  26873. <code class="code">--enable-libopenvino</code> (&ndash;extra-cflags=-I... &ndash;extra-ldflags=-L... might
  26874. be needed if the header files and libraries are not installed into system path)
  26875. </p>
  26876. </dd>
  26877. <dt>&lsquo;<samp class="samp">torch</samp>&rsquo;</dt>
  26878. <dd><p>Libtorch backend. To enable this backend you need to build and install Libtroch
  26879. for C++ library. Please download cxx11 ABI version (see
  26880. <a class="url" href="https://pytorch.org/get-started/locally">https://pytorch.org/get-started/locally</a>)
  26881. and configure FFmpeg with <code class="code">--enable-libtorch
  26882. --extra-cflags=-I/libtorch_root/libtorch/include
  26883. --extra-cflags=-I/libtorch_root/libtorch/include/torch/csrc/api/include
  26884. --extra-ldflags=-L/libtorch_root/libtorch/lib/</code>
  26885. </p>
  26886. </dd>
  26887. </dl>
  26888. </dd>
  26889. <dt><samp class="option">model</samp></dt>
  26890. <dd><p>Set path to model file specifying network architecture and its parameters.
  26891. Note that different backends use different file formats. TensorFlow, OpenVINO
  26892. and Libtorch backend can load files for only its format.
  26893. </p>
  26894. </dd>
  26895. <dt><samp class="option">input</samp></dt>
  26896. <dd><p>Set the input name of the dnn network.
  26897. </p>
  26898. </dd>
  26899. <dt><samp class="option">output</samp></dt>
  26900. <dd><p>Set the output name of the dnn network.
  26901. </p>
  26902. </dd>
  26903. <dt><samp class="option">backend_configs</samp></dt>
  26904. <dd><p>Set the configs to be passed into backend. To use async execution, set async (default: set).
  26905. Roll back to sync execution if the backend does not support async.
  26906. </p>
  26907. <p>For tensorflow backend, you can set its configs with <samp class="option">sess_config</samp> options,
  26908. please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system.
  26909. </p>
  26910. </dd>
  26911. </dl>
  26912. <a name="Examples-85"></a>
  26913. <h4 class="subsection">32.71.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-85" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-85" aria-hidden="true">TOC</a></span></h4>
  26914. <ul class="itemize mark-bullet">
  26915. <li>Remove rain in rgb24 frame with can.pb (see <a class="ref" href="#derain">derain</a> filter):
  26916. <div class="example">
  26917. <pre class="example-preformatted">./ffmpeg -i rain.jpg -vf format=rgb24,dnn_processing=dnn_backend=tensorflow:model=can.pb:input=x:output=y derain.jpg
  26918. </pre></div>
  26919. </li><li>Handle the Y channel with srcnn.pb (see <a class="ref" href="#sr">sr</a> filter) for frame with yuv420p (planar YUV formats supported):
  26920. <div class="example">
  26921. <pre class="example-preformatted">./ffmpeg -i 480p.jpg -vf format=yuv420p,scale=w=iw*2:h=ih*2,dnn_processing=dnn_backend=tensorflow:model=srcnn.pb:input=x:output=y -y srcnn.jpg
  26922. </pre></div>
  26923. </li><li>Handle the Y channel with espcn.pb (see <a class="ref" href="#sr">sr</a> filter), which changes frame size, for format yuv420p (planar YUV formats supported),
  26924. please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system.
  26925. <div class="example">
  26926. <pre class="example-preformatted">./ffmpeg -i 480p.jpg -vf format=yuv420p,dnn_processing=dnn_backend=tensorflow:model=espcn.pb:input=x:output=y:backend_configs=sess_config=0x10022805320e09cdccccccccccec3f20012a01303801 -y tmp.espcn.jpg
  26927. </pre></div>
  26928. </li></ul>
  26929. <a name="drawbox"></a>
  26930. <h3 class="section">32.72 drawbox<span class="pull-right"><a class="anchor hidden-xs" href="#drawbox" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawbox" aria-hidden="true">TOC</a></span></h3>
  26931. <p>Draw a colored box on the input image.
  26932. </p>
  26933. <p>It accepts the following parameters:
  26934. </p>
  26935. <dl class="table">
  26936. <dt><samp class="option">x</samp></dt>
  26937. <dt><samp class="option">y</samp></dt>
  26938. <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
  26939. </p>
  26940. </dd>
  26941. <dt><samp class="option">width, w</samp></dt>
  26942. <dt><samp class="option">height, h</samp></dt>
  26943. <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
  26944. the input width and height. It defaults to 0.
  26945. </p>
  26946. </dd>
  26947. <dt><samp class="option">color, c</samp></dt>
  26948. <dd><p>Specify the color of the box to write. For the general syntax of this option,
  26949. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  26950. value <code class="code">invert</code> is used, the box edge color is the same as the
  26951. video with inverted luma.
  26952. </p>
  26953. </dd>
  26954. <dt><samp class="option">thickness, t</samp></dt>
  26955. <dd><p>The expression which sets the thickness of the box edge.
  26956. A value of <code class="code">fill</code> will create a filled box. Default value is <code class="code">3</code>.
  26957. </p>
  26958. <p>See below for the list of accepted constants.
  26959. </p>
  26960. </dd>
  26961. <dt><samp class="option">replace</samp></dt>
  26962. <dd><p>Applicable if the input has alpha. With value <code class="code">1</code>, the pixels of the painted box
  26963. will overwrite the video&rsquo;s color and alpha pixels.
  26964. Default is <code class="code">0</code>, which composites the box onto the input, leaving the video&rsquo;s alpha intact.
  26965. </p></dd>
  26966. </dl>
  26967. <p>The parameters for <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var> and <var class="var">h</var> and <var class="var">t</var> are expressions containing the
  26968. following constants:
  26969. </p>
  26970. <dl class="table">
  26971. <dt><samp class="option">dar</samp></dt>
  26972. <dd><p>The input display aspect ratio, it is the same as (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>.
  26973. </p>
  26974. </dd>
  26975. <dt><samp class="option">hsub</samp></dt>
  26976. <dt><samp class="option">vsub</samp></dt>
  26977. <dd><p>horizontal and vertical chroma subsample values. For example for the
  26978. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  26979. </p>
  26980. </dd>
  26981. <dt><samp class="option">in_h, ih</samp></dt>
  26982. <dt><samp class="option">in_w, iw</samp></dt>
  26983. <dd><p>The input width and height.
  26984. </p>
  26985. </dd>
  26986. <dt><samp class="option">sar</samp></dt>
  26987. <dd><p>The input sample aspect ratio.
  26988. </p>
  26989. </dd>
  26990. <dt><samp class="option">x</samp></dt>
  26991. <dt><samp class="option">y</samp></dt>
  26992. <dd><p>The x and y offset coordinates where the box is drawn.
  26993. </p>
  26994. </dd>
  26995. <dt><samp class="option">w</samp></dt>
  26996. <dt><samp class="option">h</samp></dt>
  26997. <dd><p>The width and height of the drawn box.
  26998. </p>
  26999. </dd>
  27000. <dt><samp class="option">box_source</samp></dt>
  27001. <dd><p>Box source can be set as side_data_detection_bboxes if you want to use box data in
  27002. detection bboxes of side data.
  27003. </p>
  27004. <p>If <var class="var">box_source</var> is set, the <var class="var">x</var>, <var class="var">y</var>, <var class="var">width</var> and <var class="var">height</var> will be ignored and
  27005. still use box data in detection bboxes of side data. So please do not use this parameter if you were
  27006. not sure about the box source.
  27007. </p>
  27008. </dd>
  27009. <dt><samp class="option">t</samp></dt>
  27010. <dd><p>The thickness of the drawn box.
  27011. </p>
  27012. <p>These constants allow the <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var>, <var class="var">h</var> and <var class="var">t</var> expressions to refer to
  27013. each other, so you may for example specify <code class="code">y=x/dar</code> or <code class="code">h=w/dar</code>.
  27014. </p>
  27015. </dd>
  27016. </dl>
  27017. <a name="Examples-86"></a>
  27018. <h4 class="subsection">32.72.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-86" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-86" aria-hidden="true">TOC</a></span></h4>
  27019. <ul class="itemize mark-bullet">
  27020. <li>Draw a black box around the edge of the input image:
  27021. <div class="example">
  27022. <pre class="example-preformatted">drawbox
  27023. </pre></div>
  27024. </li><li>Draw a box with color red and an opacity of 50%:
  27025. <div class="example">
  27026. <pre class="example-preformatted">drawbox=10:20:200:60:red@0.5
  27027. </pre></div>
  27028. <p>The previous example can be specified as:
  27029. </p><div class="example">
  27030. <pre class="example-preformatted">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
  27031. </pre></div>
  27032. </li><li>Fill the box with pink color:
  27033. <div class="example">
  27034. <pre class="example-preformatted">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
  27035. </pre></div>
  27036. </li><li>Draw a 2-pixel red 2.40:1 mask:
  27037. <div class="example">
  27038. <pre class="example-preformatted">drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
  27039. </pre></div>
  27040. </li></ul>
  27041. <a name="Commands-86"></a>
  27042. <h4 class="subsection">32.72.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-86" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-86" aria-hidden="true">TOC</a></span></h4>
  27043. <p>This filter supports same commands as options.
  27044. The command accepts the same syntax of the corresponding option.
  27045. </p>
  27046. <p>If the specified expression is not valid, it is kept at its current
  27047. value.
  27048. </p>
  27049. <a class="anchor" id="drawgraph"></a><a name="drawgraph-1"></a>
  27050. <h3 class="section">32.73 drawgraph<span class="pull-right"><a class="anchor hidden-xs" href="#drawgraph-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawgraph-1" aria-hidden="true">TOC</a></span></h3>
  27051. <p>Draw a graph using input video metadata.
  27052. </p>
  27053. <p>It accepts the following parameters:
  27054. </p>
  27055. <dl class="table">
  27056. <dt><samp class="option">m1</samp></dt>
  27057. <dd><p>Set 1st frame metadata key from which metadata values will be used to draw a graph.
  27058. </p>
  27059. </dd>
  27060. <dt><samp class="option">fg1</samp></dt>
  27061. <dd><p>Set 1st foreground color expression.
  27062. </p>
  27063. </dd>
  27064. <dt><samp class="option">m2</samp></dt>
  27065. <dd><p>Set 2nd frame metadata key from which metadata values will be used to draw a graph.
  27066. </p>
  27067. </dd>
  27068. <dt><samp class="option">fg2</samp></dt>
  27069. <dd><p>Set 2nd foreground color expression.
  27070. </p>
  27071. </dd>
  27072. <dt><samp class="option">m3</samp></dt>
  27073. <dd><p>Set 3rd frame metadata key from which metadata values will be used to draw a graph.
  27074. </p>
  27075. </dd>
  27076. <dt><samp class="option">fg3</samp></dt>
  27077. <dd><p>Set 3rd foreground color expression.
  27078. </p>
  27079. </dd>
  27080. <dt><samp class="option">m4</samp></dt>
  27081. <dd><p>Set 4th frame metadata key from which metadata values will be used to draw a graph.
  27082. </p>
  27083. </dd>
  27084. <dt><samp class="option">fg4</samp></dt>
  27085. <dd><p>Set 4th foreground color expression.
  27086. </p>
  27087. </dd>
  27088. <dt><samp class="option">min</samp></dt>
  27089. <dd><p>Set minimal value of metadata value.
  27090. </p>
  27091. </dd>
  27092. <dt><samp class="option">max</samp></dt>
  27093. <dd><p>Set maximal value of metadata value.
  27094. </p>
  27095. </dd>
  27096. <dt><samp class="option">bg</samp></dt>
  27097. <dd><p>Set graph background color. Default is white.
  27098. </p>
  27099. </dd>
  27100. <dt><samp class="option">mode</samp></dt>
  27101. <dd><p>Set graph mode.
  27102. </p>
  27103. <p>Available values for mode is:
  27104. </p><dl class="table">
  27105. <dt>&lsquo;<samp class="samp">bar</samp>&rsquo;</dt>
  27106. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  27107. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  27108. </dl>
  27109. <p>Default is <code class="code">line</code>.
  27110. </p>
  27111. </dd>
  27112. <dt><samp class="option">slide</samp></dt>
  27113. <dd><p>Set slide mode.
  27114. </p>
  27115. <p>Available values for slide is:
  27116. </p><dl class="table">
  27117. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  27118. <dd><p>Draw new frame when right border is reached.
  27119. </p>
  27120. </dd>
  27121. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  27122. <dd><p>Replace old columns with new ones.
  27123. </p>
  27124. </dd>
  27125. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  27126. <dd><p>Scroll from right to left.
  27127. </p>
  27128. </dd>
  27129. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  27130. <dd><p>Scroll from left to right.
  27131. </p>
  27132. </dd>
  27133. <dt>&lsquo;<samp class="samp">picture</samp>&rsquo;</dt>
  27134. <dd><p>Draw single picture.
  27135. </p></dd>
  27136. </dl>
  27137. <p>Default is <code class="code">frame</code>.
  27138. </p>
  27139. </dd>
  27140. <dt><samp class="option">size</samp></dt>
  27141. <dd><p>Set size of graph video. For the syntax of this option, check the
  27142. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  27143. The default value is <code class="code">900x256</code>.
  27144. </p>
  27145. </dd>
  27146. <dt><samp class="option">rate, r</samp></dt>
  27147. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  27148. </p>
  27149. <p>The foreground color expressions can use the following variables:
  27150. </p><dl class="table">
  27151. <dt><samp class="option">MIN</samp></dt>
  27152. <dd><p>Minimal value of metadata value.
  27153. </p>
  27154. </dd>
  27155. <dt><samp class="option">MAX</samp></dt>
  27156. <dd><p>Maximal value of metadata value.
  27157. </p>
  27158. </dd>
  27159. <dt><samp class="option">VAL</samp></dt>
  27160. <dd><p>Current metadata key value.
  27161. </p></dd>
  27162. </dl>
  27163. <p>The color is defined as 0xAABBGGRR.
  27164. </p></dd>
  27165. </dl>
  27166. <p>Example using metadata from <a class="ref" href="#signalstats">signalstats</a> filter:
  27167. </p><div class="example">
  27168. <pre class="example-preformatted">signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
  27169. </pre></div>
  27170. <p>Example using metadata from <a class="ref" href="#ebur128">ebur128</a> filter:
  27171. </p><div class="example">
  27172. <pre class="example-preformatted">ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
  27173. </pre></div>
  27174. <a name="drawgrid"></a>
  27175. <h3 class="section">32.74 drawgrid<span class="pull-right"><a class="anchor hidden-xs" href="#drawgrid" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawgrid" aria-hidden="true">TOC</a></span></h3>
  27176. <p>Draw a grid on the input image.
  27177. </p>
  27178. <p>It accepts the following parameters:
  27179. </p>
  27180. <dl class="table">
  27181. <dt><samp class="option">x</samp></dt>
  27182. <dt><samp class="option">y</samp></dt>
  27183. <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
  27184. </p>
  27185. </dd>
  27186. <dt><samp class="option">width, w</samp></dt>
  27187. <dt><samp class="option">height, h</samp></dt>
  27188. <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
  27189. input width and height, respectively, minus <code class="code">thickness</code>, so image gets
  27190. framed. Default to 0.
  27191. </p>
  27192. </dd>
  27193. <dt><samp class="option">color, c</samp></dt>
  27194. <dd><p>Specify the color of the grid. For the general syntax of this option,
  27195. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  27196. value <code class="code">invert</code> is used, the grid color is the same as the
  27197. video with inverted luma.
  27198. </p>
  27199. </dd>
  27200. <dt><samp class="option">thickness, t</samp></dt>
  27201. <dd><p>The expression which sets the thickness of the grid line. Default value is <code class="code">1</code>.
  27202. </p>
  27203. <p>See below for the list of accepted constants.
  27204. </p>
  27205. </dd>
  27206. <dt><samp class="option">replace</samp></dt>
  27207. <dd><p>Applicable if the input has alpha. With <code class="code">1</code> the pixels of the painted grid
  27208. will overwrite the video&rsquo;s color and alpha pixels.
  27209. Default is <code class="code">0</code>, which composites the grid onto the input, leaving the video&rsquo;s alpha intact.
  27210. </p></dd>
  27211. </dl>
  27212. <p>The parameters for <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var> and <var class="var">h</var> and <var class="var">t</var> are expressions containing the
  27213. following constants:
  27214. </p>
  27215. <dl class="table">
  27216. <dt><samp class="option">dar</samp></dt>
  27217. <dd><p>The input display aspect ratio, it is the same as (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>.
  27218. </p>
  27219. </dd>
  27220. <dt><samp class="option">hsub</samp></dt>
  27221. <dt><samp class="option">vsub</samp></dt>
  27222. <dd><p>horizontal and vertical chroma subsample values. For example for the
  27223. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  27224. </p>
  27225. </dd>
  27226. <dt><samp class="option">in_h, ih</samp></dt>
  27227. <dt><samp class="option">in_w, iw</samp></dt>
  27228. <dd><p>The input grid cell width and height.
  27229. </p>
  27230. </dd>
  27231. <dt><samp class="option">sar</samp></dt>
  27232. <dd><p>The input sample aspect ratio.
  27233. </p>
  27234. </dd>
  27235. <dt><samp class="option">x</samp></dt>
  27236. <dt><samp class="option">y</samp></dt>
  27237. <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
  27238. </p>
  27239. </dd>
  27240. <dt><samp class="option">w</samp></dt>
  27241. <dt><samp class="option">h</samp></dt>
  27242. <dd><p>The width and height of the drawn cell.
  27243. </p>
  27244. </dd>
  27245. <dt><samp class="option">t</samp></dt>
  27246. <dd><p>The thickness of the drawn cell.
  27247. </p>
  27248. <p>These constants allow the <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var>, <var class="var">h</var> and <var class="var">t</var> expressions to refer to
  27249. each other, so you may for example specify <code class="code">y=x/dar</code> or <code class="code">h=w/dar</code>.
  27250. </p>
  27251. </dd>
  27252. </dl>
  27253. <a name="Examples-87"></a>
  27254. <h4 class="subsection">32.74.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-87" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-87" aria-hidden="true">TOC</a></span></h4>
  27255. <ul class="itemize mark-bullet">
  27256. <li>Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
  27257. <div class="example">
  27258. <pre class="example-preformatted">drawgrid=width=100:height=100:thickness=2:color=red@0.5
  27259. </pre></div>
  27260. </li><li>Draw a white 3x3 grid with an opacity of 50%:
  27261. <div class="example">
  27262. <pre class="example-preformatted">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
  27263. </pre></div>
  27264. </li></ul>
  27265. <a name="Commands-87"></a>
  27266. <h4 class="subsection">32.74.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-87" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-87" aria-hidden="true">TOC</a></span></h4>
  27267. <p>This filter supports same commands as options.
  27268. The command accepts the same syntax of the corresponding option.
  27269. </p>
  27270. <p>If the specified expression is not valid, it is kept at its current
  27271. value.
  27272. </p>
  27273. <a class="anchor" id="drawtext"></a><a name="drawtext-1"></a>
  27274. <h3 class="section">32.75 drawtext<span class="pull-right"><a class="anchor hidden-xs" href="#drawtext-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawtext-1" aria-hidden="true">TOC</a></span></h3>
  27275. <p>Draw a text string or text from a specified file on top of a video, using the
  27276. libfreetype library.
  27277. </p>
  27278. <p>To enable compilation of this filter, you need to configure FFmpeg with
  27279. <code class="code">--enable-libfreetype</code> and <code class="code">--enable-libharfbuzz</code>.
  27280. To enable default font fallback and the <var class="var">font</var> option you need to
  27281. configure FFmpeg with <code class="code">--enable-libfontconfig</code>.
  27282. To enable the <var class="var">text_shaping</var> option, you need to configure FFmpeg with
  27283. <code class="code">--enable-libfribidi</code>.
  27284. </p>
  27285. <a name="Syntax-2"></a>
  27286. <h4 class="subsection">32.75.1 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax-2" aria-hidden="true">TOC</a></span></h4>
  27287. <p>It accepts the following parameters:
  27288. </p>
  27289. <dl class="table">
  27290. <dt><samp class="option">box</samp></dt>
  27291. <dd><p>Used to draw a box around text using the background color.
  27292. The value must be either 1 (enable) or 0 (disable).
  27293. The default value of <var class="var">box</var> is 0.
  27294. </p>
  27295. </dd>
  27296. <dt><samp class="option">boxborderw</samp></dt>
  27297. <dd><p>Set the width of the border to be drawn around the box using <var class="var">boxcolor</var>.
  27298. The value must be specified using one of the following formats:
  27299. </p><ul class="itemize mark-bullet">
  27300. <li><code class="code">boxborderw=10</code> set the width of all the borders to 10
  27301. </li><li><code class="code">boxborderw=10|20</code> set the width of the top and bottom borders to 10
  27302. and the width of the left and right borders to 20
  27303. </li><li><code class="code">boxborderw=10|20|30</code> set the width of the top border to 10, the width
  27304. of the bottom border to 30 and the width of the left and right borders to 20
  27305. </li><li><code class="code">boxborderw=10|20|30|40</code> set the borders width to 10 (top), 20 (right),
  27306. 30 (bottom), 40 (left)
  27307. </li></ul>
  27308. <p>The default value of <var class="var">boxborderw</var> is &quot;0&quot;.
  27309. </p>
  27310. </dd>
  27311. <dt><samp class="option">boxcolor</samp></dt>
  27312. <dd><p>The color to be used for drawing box around text. For the syntax of this
  27313. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  27314. </p>
  27315. <p>The default value of <var class="var">boxcolor</var> is &quot;white&quot;.
  27316. </p>
  27317. </dd>
  27318. <dt><samp class="option">line_spacing</samp></dt>
  27319. <dd><p>Set the line spacing in pixels. The default value of <var class="var">line_spacing</var> is 0.
  27320. </p>
  27321. </dd>
  27322. <dt><samp class="option">text_align</samp></dt>
  27323. <dd><p>Set the vertical and horizontal alignment of the text with respect to the box boundaries.
  27324. The value is combination of flags, one for the vertical alignment (T=top,
  27325. M=middle, B=bottom) and one for the horizontal alignment (L=left, C=center, R=right).
  27326. Please note that tab characters are only supported with the left horizontal alignment.
  27327. </p>
  27328. </dd>
  27329. <dt><samp class="option">y_align</samp></dt>
  27330. <dd><p>Specify what the <var class="var">y</var> value is referred to. Possible values are:
  27331. </p><ul class="itemize mark-bullet">
  27332. <li><code class="code">text</code> the top of the highest glyph of the first text line is placed at <var class="var">y</var>
  27333. </li><li><code class="code">baseline</code> the baseline of the first text line is placed at <var class="var">y</var>
  27334. </li><li><code class="code">font</code> the baseline of the first text line is placed at <var class="var">y</var> plus the
  27335. ascent (in pixels) defined in the font metrics
  27336. </li></ul>
  27337. <p>The default value of <var class="var">y_align</var> is &quot;text&quot; for backward compatibility.
  27338. </p>
  27339. </dd>
  27340. <dt><samp class="option">borderw</samp></dt>
  27341. <dd><p>Set the width of the border to be drawn around the text using <var class="var">bordercolor</var>.
  27342. The default value of <var class="var">borderw</var> is 0.
  27343. </p>
  27344. </dd>
  27345. <dt><samp class="option">bordercolor</samp></dt>
  27346. <dd><p>Set the color to be used for drawing border around text. For the syntax of this
  27347. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  27348. </p>
  27349. <p>The default value of <var class="var">bordercolor</var> is &quot;black&quot;.
  27350. </p>
  27351. </dd>
  27352. <dt><samp class="option">expansion</samp></dt>
  27353. <dd><p>Select how the <var class="var">text</var> is expanded. Can be either <code class="code">none</code>,
  27354. <code class="code">strftime</code> (deprecated) or <code class="code">normal</code> (default). See the
  27355. <a class="ref" href="#drawtext_005fexpansion">Text expansion</a> section below for details.
  27356. </p>
  27357. </dd>
  27358. <dt><samp class="option">basetime</samp></dt>
  27359. <dd><p>Set a start time for the count. Value is in microseconds. Only applied
  27360. in the deprecated <code class="code">strftime</code> expansion mode. To emulate in normal expansion
  27361. mode use the <code class="code">pts</code> function, supplying the start time (in seconds)
  27362. as the second argument.
  27363. </p>
  27364. </dd>
  27365. <dt><samp class="option">fix_bounds</samp></dt>
  27366. <dd><p>If true, check and fix text coords to avoid clipping.
  27367. </p>
  27368. </dd>
  27369. <dt><samp class="option">fontcolor</samp></dt>
  27370. <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
  27371. the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  27372. </p>
  27373. <p>The default value of <var class="var">fontcolor</var> is &quot;black&quot;.
  27374. </p>
  27375. </dd>
  27376. <dt><samp class="option">fontcolor_expr</samp></dt>
  27377. <dd><p>String which is expanded the same way as <var class="var">text</var> to obtain dynamic
  27378. <var class="var">fontcolor</var> value. By default this option has empty value and is not
  27379. processed. When this option is set, it overrides <var class="var">fontcolor</var> option.
  27380. </p>
  27381. </dd>
  27382. <dt><samp class="option">font</samp></dt>
  27383. <dd><p>The font family to be used for drawing text. By default Sans.
  27384. </p>
  27385. </dd>
  27386. <dt><samp class="option">fontfile</samp></dt>
  27387. <dd><p>The font file to be used for drawing text. The path must be included.
  27388. This parameter is mandatory if the fontconfig support is disabled.
  27389. </p>
  27390. </dd>
  27391. <dt><samp class="option">alpha</samp></dt>
  27392. <dd><p>Draw the text applying alpha blending. The value can
  27393. be a number between 0.0 and 1.0.
  27394. The expression accepts the same variables <var class="var">x, y</var> as well.
  27395. The default value is 1.
  27396. Please see <var class="var">fontcolor_expr</var>.
  27397. </p>
  27398. </dd>
  27399. <dt><samp class="option">fontsize</samp></dt>
  27400. <dd><p>The font size to be used for drawing text.
  27401. The default value of <var class="var">fontsize</var> is 16.
  27402. </p>
  27403. </dd>
  27404. <dt><samp class="option">text_shaping</samp></dt>
  27405. <dd><p>If set to 1, attempt to shape the text (for example, reverse the order of
  27406. right-to-left text and join Arabic characters) before drawing it.
  27407. Otherwise, just draw the text exactly as given.
  27408. By default 1 (if supported).
  27409. </p>
  27410. </dd>
  27411. <dt><samp class="option">ft_load_flags</samp></dt>
  27412. <dd><p>The flags to be used for loading the fonts.
  27413. </p>
  27414. <p>The flags map the corresponding flags supported by libfreetype, and are
  27415. a combination of the following values:
  27416. </p><dl class="table">
  27417. <dt><var class="var">default</var></dt>
  27418. <dt><var class="var">no_scale</var></dt>
  27419. <dt><var class="var">no_hinting</var></dt>
  27420. <dt><var class="var">render</var></dt>
  27421. <dt><var class="var">no_bitmap</var></dt>
  27422. <dt><var class="var">vertical_layout</var></dt>
  27423. <dt><var class="var">force_autohint</var></dt>
  27424. <dt><var class="var">crop_bitmap</var></dt>
  27425. <dt><var class="var">pedantic</var></dt>
  27426. <dt><var class="var">ignore_global_advance_width</var></dt>
  27427. <dt><var class="var">no_recurse</var></dt>
  27428. <dt><var class="var">ignore_transform</var></dt>
  27429. <dt><var class="var">monochrome</var></dt>
  27430. <dt><var class="var">linear_design</var></dt>
  27431. <dt><var class="var">no_autohint</var></dt>
  27432. </dl>
  27433. <p>Default value is &quot;default&quot;.
  27434. </p>
  27435. <p>For more information consult the documentation for the FT_LOAD_*
  27436. libfreetype flags.
  27437. </p>
  27438. </dd>
  27439. <dt><samp class="option">shadowcolor</samp></dt>
  27440. <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
  27441. syntax of this option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the
  27442. ffmpeg-utils manual</a>.
  27443. </p>
  27444. <p>The default value of <var class="var">shadowcolor</var> is &quot;black&quot;.
  27445. </p>
  27446. </dd>
  27447. <dt><samp class="option">boxw</samp></dt>
  27448. <dd><p>Set the width of the box to be drawn around text.
  27449. The default value of <var class="var">boxw</var> is computed automatically to match the text width
  27450. </p>
  27451. </dd>
  27452. <dt><samp class="option">boxh</samp></dt>
  27453. <dd><p>Set the height of the box to be drawn around text.
  27454. The default value of <var class="var">boxh</var> is computed automatically to match the text height
  27455. </p>
  27456. </dd>
  27457. <dt><samp class="option">shadowx</samp></dt>
  27458. <dt><samp class="option">shadowy</samp></dt>
  27459. <dd><p>The x and y offsets for the text shadow position with respect to the
  27460. position of the text. They can be either positive or negative
  27461. values. The default value for both is &quot;0&quot;.
  27462. </p>
  27463. </dd>
  27464. <dt><samp class="option">start_number</samp></dt>
  27465. <dd><p>The starting frame number for the n/frame_num variable. The default value
  27466. is &quot;0&quot;.
  27467. </p>
  27468. </dd>
  27469. <dt><samp class="option">tabsize</samp></dt>
  27470. <dd><p>The size in number of spaces to use for rendering the tab.
  27471. Default value is 4.
  27472. </p>
  27473. </dd>
  27474. <dt><samp class="option">timecode</samp></dt>
  27475. <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
  27476. format. It can be used with or without text parameter. <var class="var">timecode_rate</var>
  27477. option must be specified.
  27478. </p>
  27479. </dd>
  27480. <dt><samp class="option">timecode_rate, rate, r</samp></dt>
  27481. <dd><p>Set the timecode frame rate (timecode only). Value will be rounded to nearest
  27482. integer. Minimum value is &quot;1&quot;.
  27483. Drop-frame timecode is supported for frame rates 30 &amp; 60.
  27484. </p>
  27485. </dd>
  27486. <dt><samp class="option">tc24hmax</samp></dt>
  27487. <dd><p>If set to 1, the output of the timecode option will wrap around at 24 hours.
  27488. Default is 0 (disabled).
  27489. </p>
  27490. </dd>
  27491. <dt><samp class="option">text</samp></dt>
  27492. <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
  27493. encoded characters.
  27494. This parameter is mandatory if no file is specified with the parameter
  27495. <var class="var">textfile</var>.
  27496. </p>
  27497. </dd>
  27498. <dt><samp class="option">textfile</samp></dt>
  27499. <dd><p>A text file containing text to be drawn. The text must be a sequence
  27500. of UTF-8 encoded characters.
  27501. </p>
  27502. <p>This parameter is mandatory if no text string is specified with the
  27503. parameter <var class="var">text</var>.
  27504. </p>
  27505. <p>If both <var class="var">text</var> and <var class="var">textfile</var> are specified, an error is thrown.
  27506. </p>
  27507. </dd>
  27508. <dt><samp class="option">text_source</samp></dt>
  27509. <dd><p>Text source should be set as side_data_detection_bboxes if you want to use text data in
  27510. detection bboxes of side data.
  27511. </p>
  27512. <p>If text source is set, <var class="var">text</var> and <var class="var">textfile</var> will be ignored and still use
  27513. text data in detection bboxes of side data. So please do not use this parameter
  27514. if you are not sure about the text source.
  27515. </p>
  27516. </dd>
  27517. <dt><samp class="option">reload</samp></dt>
  27518. <dd><p>The <var class="var">textfile</var> will be reloaded at specified frame interval.
  27519. Be sure to update <var class="var">textfile</var> atomically, or it may be read partially,
  27520. or even fail.
  27521. Range is 0 to INT_MAX. Default is 0.
  27522. </p>
  27523. </dd>
  27524. <dt><samp class="option">x</samp></dt>
  27525. <dt><samp class="option">y</samp></dt>
  27526. <dd><p>The expressions which specify the offsets where text will be drawn
  27527. within the video frame. They are relative to the top/left border of the
  27528. output image.
  27529. </p>
  27530. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is &quot;0&quot;.
  27531. </p>
  27532. <p>See below for the list of accepted constants and functions.
  27533. </p></dd>
  27534. </dl>
  27535. <p>The parameters for <var class="var">x</var> and <var class="var">y</var> are expressions containing the
  27536. following constants and functions:
  27537. </p>
  27538. <dl class="table">
  27539. <dt><samp class="option">dar</samp></dt>
  27540. <dd><p>input display aspect ratio, it is the same as (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>
  27541. </p>
  27542. </dd>
  27543. <dt><samp class="option">hsub</samp></dt>
  27544. <dt><samp class="option">vsub</samp></dt>
  27545. <dd><p>horizontal and vertical chroma subsample values. For example for the
  27546. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  27547. </p>
  27548. </dd>
  27549. <dt><samp class="option">line_h, lh</samp></dt>
  27550. <dd><p>the height of each text line
  27551. </p>
  27552. </dd>
  27553. <dt><samp class="option">main_h, h, H</samp></dt>
  27554. <dd><p>the input height
  27555. </p>
  27556. </dd>
  27557. <dt><samp class="option">main_w, w, W</samp></dt>
  27558. <dd><p>the input width
  27559. </p>
  27560. </dd>
  27561. <dt><samp class="option">max_glyph_a, ascent</samp></dt>
  27562. <dd><p>the maximum distance from the baseline to the highest/upper grid
  27563. coordinate used to place a glyph outline point, for all the rendered
  27564. glyphs.
  27565. It is a positive value, due to the grid&rsquo;s orientation with the Y axis
  27566. upwards.
  27567. </p>
  27568. </dd>
  27569. <dt><samp class="option">max_glyph_d, descent</samp></dt>
  27570. <dd><p>the maximum distance from the baseline to the lowest grid coordinate
  27571. used to place a glyph outline point, for all the rendered glyphs.
  27572. This is a negative value, due to the grid&rsquo;s orientation, with the Y axis
  27573. upwards.
  27574. </p>
  27575. </dd>
  27576. <dt><samp class="option">max_glyph_h</samp></dt>
  27577. <dd><p>maximum glyph height, that is the maximum height for all the glyphs
  27578. contained in the rendered text, it is equivalent to <var class="var">ascent</var> -
  27579. <var class="var">descent</var>.
  27580. </p>
  27581. </dd>
  27582. <dt><samp class="option">max_glyph_w</samp></dt>
  27583. <dd><p>maximum glyph width, that is the maximum width for all the glyphs
  27584. contained in the rendered text
  27585. </p>
  27586. </dd>
  27587. <dt><samp class="option">font_a</samp></dt>
  27588. <dd><p>the ascent size defined in the font metrics
  27589. </p>
  27590. </dd>
  27591. <dt><samp class="option">font_d</samp></dt>
  27592. <dd><p>the descent size defined in the font metrics
  27593. </p>
  27594. </dd>
  27595. <dt><samp class="option">top_a</samp></dt>
  27596. <dd><p>the maximum ascender of the glyphs of the first text line
  27597. </p>
  27598. </dd>
  27599. <dt><samp class="option">bottom_d</samp></dt>
  27600. <dd><p>the maximum descender of the glyphs of the last text line
  27601. </p>
  27602. </dd>
  27603. <dt><samp class="option">n</samp></dt>
  27604. <dd><p>the number of input frame, starting from 0
  27605. </p>
  27606. </dd>
  27607. <dt><samp class="option">rand(min, max)</samp></dt>
  27608. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  27609. </p>
  27610. </dd>
  27611. <dt><samp class="option">sar</samp></dt>
  27612. <dd><p>The input sample aspect ratio.
  27613. </p>
  27614. </dd>
  27615. <dt><samp class="option">t</samp></dt>
  27616. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  27617. </p>
  27618. </dd>
  27619. <dt><samp class="option">text_h, th</samp></dt>
  27620. <dd><p>the height of the rendered text
  27621. </p>
  27622. </dd>
  27623. <dt><samp class="option">text_w, tw</samp></dt>
  27624. <dd><p>the width of the rendered text
  27625. </p>
  27626. </dd>
  27627. <dt><samp class="option">x</samp></dt>
  27628. <dt><samp class="option">y</samp></dt>
  27629. <dd><p>the x and y offset coordinates where the text is drawn.
  27630. </p>
  27631. <p>These parameters allow the <var class="var">x</var> and <var class="var">y</var> expressions to refer
  27632. to each other, so you can for example specify <code class="code">y=x/dar</code>.
  27633. </p>
  27634. </dd>
  27635. <dt><samp class="option">pict_type</samp></dt>
  27636. <dd><p>A one character description of the current frame&rsquo;s picture type.
  27637. </p>
  27638. </dd>
  27639. <dt><samp class="option">pkt_pos</samp></dt>
  27640. <dd><p>The current packet&rsquo;s position in the input file or stream
  27641. (in bytes, from the start of the input). A value of -1 indicates
  27642. this info is not available.
  27643. </p>
  27644. </dd>
  27645. <dt><samp class="option">duration</samp></dt>
  27646. <dd><p>The current packet&rsquo;s duration, in seconds.
  27647. </p>
  27648. </dd>
  27649. <dt><samp class="option">pkt_size</samp></dt>
  27650. <dd><p>The current packet&rsquo;s size (in bytes).
  27651. </p></dd>
  27652. </dl>
  27653. <a class="anchor" id="drawtext_005fexpansion"></a><a name="Text-expansion"></a>
  27654. <h4 class="subsection">32.75.2 Text expansion<span class="pull-right"><a class="anchor hidden-xs" href="#Text-expansion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Text-expansion" aria-hidden="true">TOC</a></span></h4>
  27655. <p>If <samp class="option">expansion</samp> is set to <code class="code">strftime</code>, the filter recognizes
  27656. sequences accepted by the <code class="code">strftime</code> C function in the provided
  27657. text and expands them accordingly. Check the documentation of
  27658. <code class="code">strftime</code>. This feature is deprecated in favor of <code class="code">normal</code>
  27659. expansion with the <code class="code">gmtime</code> or <code class="code">localtime</code> expansion
  27660. functions.
  27661. </p>
  27662. <p>If <samp class="option">expansion</samp> is set to <code class="code">none</code>, the text is printed verbatim.
  27663. </p>
  27664. <p>If <samp class="option">expansion</samp> is set to <code class="code">normal</code> (which is the default),
  27665. the following expansion mechanism is used.
  27666. </p>
  27667. <p>The backslash character &lsquo;<samp class="samp">\</samp>&rsquo;, followed by any character, always expands to
  27668. the second character.
  27669. </p>
  27670. <p>Sequences of the form <code class="code">%{...}</code> are expanded. The text between the
  27671. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  27672. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  27673. they should be escaped.
  27674. </p>
  27675. <p>Note that they probably must also be escaped as the value for the <samp class="option">text</samp>
  27676. option in the filter argument string and as the filter argument in the
  27677. filtergraph description, and possibly also for the shell, that makes up to four
  27678. levels of escaping; using a text file with the <samp class="option">textfile</samp> option avoids
  27679. these problems.
  27680. </p>
  27681. <p>The following functions are available:
  27682. </p>
  27683. <dl class="table">
  27684. <dt><code class="command">expr, e</code></dt>
  27685. <dd><p>The expression evaluation result.
  27686. </p>
  27687. <p>It must take one argument specifying the expression to be evaluated,
  27688. which accepts the same constants and functions as the <var class="var">x</var> and
  27689. <var class="var">y</var> values. Note that not all constants should be used, for
  27690. example the text size is not known when evaluating the expression, so
  27691. the constants <var class="var">text_w</var> and <var class="var">text_h</var> will have an undefined
  27692. value.
  27693. </p>
  27694. </dd>
  27695. <dt><code class="command">expr_int_format, eif</code></dt>
  27696. <dd><p>Evaluate the expression&rsquo;s value and output as formatted integer.
  27697. </p>
  27698. <p>The first argument is the expression to be evaluated, just as for the <var class="var">expr</var> function.
  27699. The second argument specifies the output format. Allowed values are &lsquo;<samp class="samp">x</samp>&rsquo;,
  27700. &lsquo;<samp class="samp">X</samp>&rsquo;, &lsquo;<samp class="samp">d</samp>&rsquo; and &lsquo;<samp class="samp">u</samp>&rsquo;. They are treated exactly as in the
  27701. <code class="code">printf</code> function.
  27702. The third parameter is optional and sets the number of positions taken by the output.
  27703. It can be used to add padding with zeros from the left.
  27704. </p>
  27705. </dd>
  27706. <dt><code class="command">gmtime</code></dt>
  27707. <dd><p>The time at which the filter is running, expressed in UTC.
  27708. It can accept an argument: a <code class="code">strftime</code> C function format string.
  27709. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  27710. which prints fractions of the second with optionally specified number of digits.
  27711. </p>
  27712. </dd>
  27713. <dt><code class="command">localtime</code></dt>
  27714. <dd><p>The time at which the filter is running, expressed in the local time zone.
  27715. It can accept an argument: a <code class="code">strftime</code> C function format string.
  27716. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  27717. which prints fractions of the second with optionally specified number of digits.
  27718. </p>
  27719. </dd>
  27720. <dt><code class="command">metadata</code></dt>
  27721. <dd><p>Frame metadata. Takes one or two arguments.
  27722. </p>
  27723. <p>The first argument is mandatory and specifies the metadata key.
  27724. </p>
  27725. <p>The second argument is optional and specifies a default value, used when the
  27726. metadata key is not found or empty.
  27727. </p>
  27728. <p>Available metadata can be identified by inspecting entries
  27729. starting with TAG included within each frame section
  27730. printed by running <code class="code">ffprobe -show_frames</code>.
  27731. </p>
  27732. <p>String metadata generated in filters leading to
  27733. the drawtext filter are also available.
  27734. </p>
  27735. </dd>
  27736. <dt><code class="command">n, frame_num</code></dt>
  27737. <dd><p>The frame number, starting from 0.
  27738. </p>
  27739. </dd>
  27740. <dt><code class="command">pict_type</code></dt>
  27741. <dd><p>A one character description of the current picture type.
  27742. </p>
  27743. </dd>
  27744. <dt><code class="command">pts</code></dt>
  27745. <dd><p>The timestamp of the current frame.
  27746. It can take up to three arguments.
  27747. </p>
  27748. <p>The first argument is the format of the timestamp; it defaults to <code class="code">flt</code>
  27749. for seconds as a decimal number with microsecond accuracy; <code class="code">hms</code> stands
  27750. for a formatted <var class="var">[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  27751. <code class="code">gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  27752. <code class="code">localtime</code> stands for the timestamp of the frame formatted as
  27753. local time zone time.
  27754. </p>
  27755. <p>The second argument is an offset added to the timestamp.
  27756. </p>
  27757. <p>If the format is set to <code class="code">hms</code>, a third argument <code class="code">24HH</code> may be
  27758. supplied to present the hour part of the formatted timestamp in 24h format
  27759. (00-23).
  27760. </p>
  27761. <p>If the format is set to <code class="code">localtime</code> or <code class="code">gmtime</code>, a third
  27762. argument may be supplied: a <code class="code">strftime</code> C function format string.
  27763. By default, <var class="var">YYYY-MM-DD HH:MM:SS</var> format will be used.
  27764. </p></dd>
  27765. </dl>
  27766. <a name="Commands-88"></a>
  27767. <h4 class="subsection">32.75.3 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-88" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-88" aria-hidden="true">TOC</a></span></h4>
  27768. <p>This filter supports altering parameters via commands:
  27769. </p><dl class="table">
  27770. <dt><samp class="option">reinit</samp></dt>
  27771. <dd><p>Alter existing filter parameters.
  27772. </p>
  27773. <p>Syntax for the argument is the same as for filter invocation, e.g.
  27774. </p>
  27775. <div class="example">
  27776. <pre class="example-preformatted">fontsize=56:fontcolor=green:text='Hello World'
  27777. </pre></div>
  27778. <p>Full filter invocation with sendcmd would look like this:
  27779. </p>
  27780. <div class="example">
  27781. <pre class="example-preformatted">sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
  27782. </pre></div>
  27783. <p>If the entire argument can&rsquo;t be parsed or applied as valid values then the filter will
  27784. continue with its existing parameters.
  27785. </p>
  27786. </dd>
  27787. </dl>
  27788. <p>The following options are also supported as <a class="ref" href="#commands">commands</a>:
  27789. </p>
  27790. <ul class="itemize mark-bullet">
  27791. <li>x
  27792. </li><li>y
  27793. </li><li>alpha
  27794. </li><li>fontsize
  27795. </li><li>fontcolor
  27796. </li><li>boxcolor
  27797. </li><li>bordercolor
  27798. </li><li>shadowcolor
  27799. </li><li>box
  27800. </li><li>boxw
  27801. </li><li>boxh
  27802. </li><li>boxborderw
  27803. </li><li>line_spacing
  27804. </li><li>text_align
  27805. </li><li>shadowx
  27806. </li><li>shadowy
  27807. </li><li>borderw
  27808. </li></ul>
  27809. <a name="Examples-88"></a>
  27810. <h4 class="subsection">32.75.4 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-88" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-88" aria-hidden="true">TOC</a></span></h4>
  27811. <ul class="itemize mark-bullet">
  27812. <li>Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
  27813. optional parameters.
  27814. <div class="example">
  27815. <pre class="example-preformatted">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
  27816. </pre></div>
  27817. </li><li>Draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
  27818. and y=50 (counting from the top-left corner of the screen), text is
  27819. yellow with a red box around it. Both the text and the box have an
  27820. opacity of 20%.
  27821. <div class="example">
  27822. <pre class="example-preformatted">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
  27823. x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
  27824. </pre></div>
  27825. <p>Note that the double quotes are not necessary if spaces are not used
  27826. within the parameter list.
  27827. </p>
  27828. </li><li>Show the text at the center of the video frame:
  27829. <div class="example">
  27830. <pre class="example-preformatted">drawtext=&quot;fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2&quot;
  27831. </pre></div>
  27832. </li><li>Show the text at a random position, switching to a new position every 30 seconds:
  27833. <div class="example">
  27834. <pre class="example-preformatted">drawtext=&quot;fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=if(eq(mod(t\,30)\,0)\,rand(0\,(w-text_w))\,x):y=if(eq(mod(t\,30)\,0)\,rand(0\,(h-text_h))\,y)&quot;
  27835. </pre></div>
  27836. </li><li>Show a text line sliding from right to left in the last row of the video
  27837. frame. The file <samp class="file">LONG_LINE</samp> is assumed to contain a single line
  27838. with no newlines.
  27839. <div class="example">
  27840. <pre class="example-preformatted">drawtext=&quot;fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t&quot;
  27841. </pre></div>
  27842. </li><li>Show the content of file <samp class="file">CREDITS</samp> off the bottom of the frame and scroll up.
  27843. <div class="example">
  27844. <pre class="example-preformatted">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
  27845. </pre></div>
  27846. </li><li>Draw a single green letter &quot;g&quot;, at the center of the input video.
  27847. The glyph baseline is placed at half screen height.
  27848. <div class="example">
  27849. <pre class="example-preformatted">drawtext=&quot;fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent&quot;
  27850. </pre></div>
  27851. </li><li>Show text for 1 second every 3 seconds:
  27852. <div class="example">
  27853. <pre class="example-preformatted">drawtext=&quot;fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'&quot;
  27854. </pre></div>
  27855. </li><li>Use fontconfig to set the font. Note that the colons need to be escaped.
  27856. <div class="example">
  27857. <pre class="example-preformatted">drawtext='fontfile=Linux Libertine O-40\\:style=Semibold:text=FFmpeg'
  27858. </pre></div>
  27859. </li><li>Draw &quot;Test Text&quot; with font size dependent on height of the video.
  27860. <div class="example">
  27861. <pre class="example-preformatted">drawtext=&quot;text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)&quot;
  27862. </pre></div>
  27863. </li><li>Print the date of a real-time encoding (see documentation for the
  27864. <code class="code">strftime</code> C function):
  27865. <div class="example">
  27866. <pre class="example-preformatted">drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
  27867. </pre></div>
  27868. </li><li>Show text fading in and out (appearing/disappearing):
  27869. <div class="example">
  27870. <pre class="example-preformatted">#!/bin/sh
  27871. DS=1.0 # display start
  27872. DE=10.0 # display end
  27873. FID=1.5 # fade in duration
  27874. FOD=5 # fade out duration
  27875. 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;
  27876. </pre></div>
  27877. </li><li>Horizontally align multiple separate texts. Note that <samp class="option">max_glyph_a</samp>
  27878. and the <samp class="option">fontsize</samp> value are included in the <samp class="option">y</samp> offset.
  27879. <div class="example">
  27880. <pre class="example-preformatted">drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
  27881. drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
  27882. </pre></div>
  27883. </li><li>Plot special <var class="var">lavf.image2dec.source_basename</var> metadata onto each frame if
  27884. such metadata exists. Otherwise, plot the string &quot;NA&quot;. Note that image2 demuxer
  27885. must have option <samp class="option">-export_path_metadata 1</samp> for the special metadata fields
  27886. to be available for filters.
  27887. <div class="example">
  27888. <pre class="example-preformatted">drawtext=&quot;fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=10:y=10&quot;
  27889. </pre></div>
  27890. </li></ul>
  27891. <p>For more information about libfreetype, check:
  27892. <a class="url" href="http://www.freetype.org/">http://www.freetype.org/</a>.
  27893. </p>
  27894. <p>For more information about fontconfig, check:
  27895. <a class="url" href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
  27896. </p>
  27897. <p>For more information about libfribidi, check:
  27898. <a class="url" href="http://fribidi.org/">http://fribidi.org/</a>.
  27899. </p>
  27900. <p>For more information about libharfbuzz, check:
  27901. <a class="url" href="https://github.com/harfbuzz/harfbuzz">https://github.com/harfbuzz/harfbuzz</a>.
  27902. </p>
  27903. <a class="anchor" id="drawvg"></a><a name="drawvg-1"></a>
  27904. <h3 class="section">32.76 drawvg<span class="pull-right"><a class="anchor hidden-xs" href="#drawvg-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawvg-1" aria-hidden="true">TOC</a></span></h3>
  27905. <p>Draw vector graphics on top of video frames, by executing a script written in
  27906. a custom language called VGS (<em class="emph">Vector Graphics Script</em>).
  27907. </p>
  27908. <p>The documentation for the language can be found in
  27909. <a data-manual="drawvg-reference" href="drawvg-reference.html#Top">drawvg - Language Reference</a>. A version of this reference
  27910. with rendered examples can be found at the
  27911. <a class="uref" href="https://ayosec.github.io/ffmpeg-drawvg/playground/docs/langref.html">author&rsquo;s site</a>.
  27912. </p>
  27913. <p>Graphics are rendered using the <a class="uref" href="https://cairographics.org/">cario 2D
  27914. graphics library</a>.
  27915. </p>
  27916. <p>To enable compilation of this filter, you need to configure FFmpeg with
  27917. <code class="code">--enable-cairo</code>.
  27918. </p>
  27919. <a name="Parameters"></a>
  27920. <h4 class="subsection">32.76.1 Parameters<span class="pull-right"><a class="anchor hidden-xs" href="#Parameters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Parameters" aria-hidden="true">TOC</a></span></h4>
  27921. <p>Either <code class="code">script</code> or <code class="code">file</code> must be set.
  27922. </p>
  27923. <dl class="table">
  27924. <dt><samp class="option">s, script</samp></dt>
  27925. <dd><p>Script source to draw the graphics.
  27926. </p>
  27927. </dd>
  27928. <dt><samp class="option">file</samp></dt>
  27929. <dd><p>Path of the file to load the script source.
  27930. </p>
  27931. </dd>
  27932. </dl>
  27933. <a name="Pixel-Formats"></a>
  27934. <h4 class="subsection">32.76.2 Pixel Formats<span class="pull-right"><a class="anchor hidden-xs" href="#Pixel-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Pixel-Formats" aria-hidden="true">TOC</a></span></h4>
  27935. <p>Since Cairo only supports RGB images, if the input video is something else (like
  27936. YUV 4:2:0), before executing the script the video is converted to a format
  27937. compatible with Cairo. Then, you have to use either the <a class="ref" href="#format">format</a> filter,
  27938. or the <code class="code">-pix_fmt</code> option, to convert it to the expected format in the
  27939. output.
  27940. </p>
  27941. <a name="Examples-89"></a>
  27942. <h4 class="subsection">32.76.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-89" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-89" aria-hidden="true">TOC</a></span></h4>
  27943. <ul class="itemize mark-bullet">
  27944. <li>Draw the outline of an ellipse.
  27945. <div class="example">
  27946. <pre class="example-preformatted">ffmpeg -i input.webm \
  27947. -vf 'drawvg=ellipse (w/2) (h/2) (w/3) (h/3) stroke' \
  27948. -pix_fmt yuv420p \
  27949. output.webm
  27950. </pre></div>
  27951. </li><li>
  27952. Draw a square rotating in the middle of the frame.
  27953. <p>The script for drawvg is in a file <code class="code">draw.vgs</code>:
  27954. </p>
  27955. <div class="example">
  27956. <pre class="example-preformatted">translate (w/2) (h/2)
  27957. rotate t
  27958. rect -100 -100 200 200
  27959. setcolor red@0.5
  27960. fill
  27961. </pre></div>
  27962. <p>Then:
  27963. </p>
  27964. <div class="example">
  27965. <pre class="example-preformatted">ffmpeg -i input.webm -vf 'drawvg=file=draw.vgs,format=yuv420p' output.webm
  27966. </pre></div>
  27967. </li></ul>
  27968. <a name="edgedetect"></a>
  27969. <h3 class="section">32.77 edgedetect<span class="pull-right"><a class="anchor hidden-xs" href="#edgedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-edgedetect" aria-hidden="true">TOC</a></span></h3>
  27970. <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
  27971. </p>
  27972. <p>The filter accepts the following options:
  27973. </p>
  27974. <dl class="table">
  27975. <dt><samp class="option">low</samp></dt>
  27976. <dt><samp class="option">high</samp></dt>
  27977. <dd><p>Set low and high threshold values used by the Canny thresholding
  27978. algorithm.
  27979. </p>
  27980. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  27981. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  27982. by the low threshold.
  27983. </p>
  27984. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  27985. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  27986. </p>
  27987. <p>Default value for <var class="var">low</var> is <code class="code">20/255</code>, and default value for <var class="var">high</var>
  27988. is <code class="code">50/255</code>.
  27989. </p>
  27990. </dd>
  27991. <dt><samp class="option">mode</samp></dt>
  27992. <dd><p>Define the drawing mode.
  27993. </p>
  27994. <dl class="table">
  27995. <dt>&lsquo;<samp class="samp">wires</samp>&rsquo;</dt>
  27996. <dd><p>Draw white/gray wires on black background.
  27997. </p>
  27998. </dd>
  27999. <dt>&lsquo;<samp class="samp">colormix</samp>&rsquo;</dt>
  28000. <dd><p>Mix the colors to create a paint/cartoon effect.
  28001. </p>
  28002. </dd>
  28003. <dt>&lsquo;<samp class="samp">canny</samp>&rsquo;</dt>
  28004. <dd><p>Apply Canny edge detector on all selected planes.
  28005. </p></dd>
  28006. </dl>
  28007. <p>Default value is <var class="var">wires</var>.
  28008. </p>
  28009. </dd>
  28010. <dt><samp class="option">planes</samp></dt>
  28011. <dd><p>Select planes for filtering. By default all available planes are filtered.
  28012. </p></dd>
  28013. </dl>
  28014. <a name="Examples-90"></a>
  28015. <h4 class="subsection">32.77.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-90" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-90" aria-hidden="true">TOC</a></span></h4>
  28016. <ul class="itemize mark-bullet">
  28017. <li>Standard edge detection with custom values for the hysteresis thresholding:
  28018. <div class="example">
  28019. <pre class="example-preformatted">edgedetect=low=0.1:high=0.4
  28020. </pre></div>
  28021. </li><li>Painting effect without thresholding:
  28022. <div class="example">
  28023. <pre class="example-preformatted">edgedetect=mode=colormix:high=0
  28024. </pre></div>
  28025. </li></ul>
  28026. <a name="elbg"></a>
  28027. <h3 class="section">32.78 elbg<span class="pull-right"><a class="anchor hidden-xs" href="#elbg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-elbg" aria-hidden="true">TOC</a></span></h3>
  28028. <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
  28029. </p>
  28030. <p>For each input image, the filter will compute the optimal mapping from
  28031. the input to the output given the codebook length, that is the number
  28032. of distinct output colors.
  28033. </p>
  28034. <p>This filter accepts the following options.
  28035. </p>
  28036. <dl class="table">
  28037. <dt><samp class="option">codebook_length, l</samp></dt>
  28038. <dd><p>Set codebook length. The value must be a positive integer, and
  28039. represents the number of distinct output colors. Default value is 256.
  28040. </p>
  28041. </dd>
  28042. <dt><samp class="option">nb_steps, n</samp></dt>
  28043. <dd><p>Set the maximum number of iterations to apply for computing the optimal
  28044. mapping. The higher the value the better the result and the higher the
  28045. computation time. Default value is 1.
  28046. </p>
  28047. </dd>
  28048. <dt><samp class="option">seed, s</samp></dt>
  28049. <dd><p>Set a random seed, must be an integer included between 0 and
  28050. UINT32_MAX. If not specified, or if explicitly set to -1, the filter
  28051. will try to use a good random seed on a best effort basis.
  28052. </p>
  28053. </dd>
  28054. <dt><samp class="option">pal8</samp></dt>
  28055. <dd><p>Set pal8 output pixel format. This option does not work with codebook
  28056. length greater than 256. Default is disabled.
  28057. </p>
  28058. </dd>
  28059. <dt><samp class="option">use_alpha</samp></dt>
  28060. <dd><p>Include alpha values in the quantization calculation. Allows creating
  28061. palettized output images (e.g. PNG8) with multiple alpha smooth blending.
  28062. </p></dd>
  28063. </dl>
  28064. <a name="entropy"></a>
  28065. <h3 class="section">32.79 entropy<span class="pull-right"><a class="anchor hidden-xs" href="#entropy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-entropy" aria-hidden="true">TOC</a></span></h3>
  28066. <p>Measure graylevel entropy in histogram of color channels of video frames.
  28067. </p>
  28068. <p>It accepts the following parameters:
  28069. </p>
  28070. <dl class="table">
  28071. <dt><samp class="option">mode</samp></dt>
  28072. <dd><p>Can be either <var class="var">normal</var> or <var class="var">diff</var>. Default is <var class="var">normal</var>.
  28073. </p>
  28074. <p><var class="var">diff</var> mode measures entropy of histogram delta values, absolute differences
  28075. between neighbour histogram values.
  28076. </p></dd>
  28077. </dl>
  28078. <a name="epx"></a>
  28079. <h3 class="section">32.80 epx<span class="pull-right"><a class="anchor hidden-xs" href="#epx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-epx" aria-hidden="true">TOC</a></span></h3>
  28080. <p>Apply the EPX magnification filter which is designed for pixel art.
  28081. </p>
  28082. <p>It accepts the following option:
  28083. </p>
  28084. <dl class="table">
  28085. <dt><samp class="option">n</samp></dt>
  28086. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">2xEPX</code>, <code class="code">3</code> for
  28087. <code class="code">3xEPX</code>.
  28088. Default is <code class="code">3</code>.
  28089. </p></dd>
  28090. </dl>
  28091. <a name="eq"></a>
  28092. <h3 class="section">32.81 eq<span class="pull-right"><a class="anchor hidden-xs" href="#eq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eq" aria-hidden="true">TOC</a></span></h3>
  28093. <p>Set brightness, contrast, saturation and approximate gamma adjustment.
  28094. </p>
  28095. <p>The filter accepts the following options:
  28096. </p>
  28097. <dl class="table">
  28098. <dt><samp class="option">contrast</samp></dt>
  28099. <dd><p>Set the contrast expression. The value must be a float value in range
  28100. <code class="code">-1000.0</code> to <code class="code">1000.0</code>. The default value is &quot;1&quot;.
  28101. </p>
  28102. </dd>
  28103. <dt><samp class="option">brightness</samp></dt>
  28104. <dd><p>Set the brightness expression. The value must be a float value in
  28105. range <code class="code">-1.0</code> to <code class="code">1.0</code>. The default value is &quot;0&quot;.
  28106. </p>
  28107. </dd>
  28108. <dt><samp class="option">saturation</samp></dt>
  28109. <dd><p>Set the saturation expression. The value must be a float in
  28110. range <code class="code">0.0</code> to <code class="code">3.0</code>. The default value is &quot;1&quot;.
  28111. </p>
  28112. </dd>
  28113. <dt><samp class="option">gamma</samp></dt>
  28114. <dd><p>Set the gamma expression. The value must be a float in range
  28115. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  28116. </p>
  28117. </dd>
  28118. <dt><samp class="option">gamma_r</samp></dt>
  28119. <dd><p>Set the gamma expression for red. The value must be a float in
  28120. range <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  28121. </p>
  28122. </dd>
  28123. <dt><samp class="option">gamma_g</samp></dt>
  28124. <dd><p>Set the gamma expression for green. The value must be a float in range
  28125. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  28126. </p>
  28127. </dd>
  28128. <dt><samp class="option">gamma_b</samp></dt>
  28129. <dd><p>Set the gamma expression for blue. The value must be a float in range
  28130. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  28131. </p>
  28132. </dd>
  28133. <dt><samp class="option">gamma_weight</samp></dt>
  28134. <dd><p>Set the gamma weight expression. It can be used to reduce the effect
  28135. of a high gamma value on bright image areas, e.g. keep them from
  28136. getting overamplified and just plain white. The value must be a float
  28137. in range <code class="code">0.0</code> to <code class="code">1.0</code>. A value of <code class="code">0.0</code> turns the
  28138. gamma correction all the way down while <code class="code">1.0</code> leaves it at its
  28139. full strength. Default is &quot;1&quot;.
  28140. </p>
  28141. </dd>
  28142. <dt><samp class="option">eval</samp></dt>
  28143. <dd><p>Set when the expressions for brightness, contrast, saturation and
  28144. gamma expressions are evaluated.
  28145. </p>
  28146. <p>It accepts the following values:
  28147. </p><dl class="table">
  28148. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  28149. <dd><p>only evaluate expressions once during the filter initialization or
  28150. when a command is processed
  28151. </p>
  28152. </dd>
  28153. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  28154. <dd><p>evaluate expressions for each incoming frame
  28155. </p></dd>
  28156. </dl>
  28157. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  28158. </p></dd>
  28159. </dl>
  28160. <p>The expressions accept the following parameters:
  28161. </p><dl class="table">
  28162. <dt><samp class="option">n</samp></dt>
  28163. <dd><p>frame count of the input frame starting from 0
  28164. </p>
  28165. </dd>
  28166. <dt><samp class="option">pos</samp></dt>
  28167. <dd><p>byte position of the corresponding packet in the input file, NAN if
  28168. unspecified; deprecated, do not use
  28169. </p>
  28170. </dd>
  28171. <dt><samp class="option">r</samp></dt>
  28172. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  28173. </p>
  28174. </dd>
  28175. <dt><samp class="option">t</samp></dt>
  28176. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  28177. </p></dd>
  28178. </dl>
  28179. <a name="Commands-89"></a>
  28180. <h4 class="subsection">32.81.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-89" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-89" aria-hidden="true">TOC</a></span></h4>
  28181. <p>The filter supports the following commands:
  28182. </p>
  28183. <dl class="table">
  28184. <dt><samp class="option">contrast</samp></dt>
  28185. <dd><p>Set the contrast expression.
  28186. </p>
  28187. </dd>
  28188. <dt><samp class="option">brightness</samp></dt>
  28189. <dd><p>Set the brightness expression.
  28190. </p>
  28191. </dd>
  28192. <dt><samp class="option">saturation</samp></dt>
  28193. <dd><p>Set the saturation expression.
  28194. </p>
  28195. </dd>
  28196. <dt><samp class="option">gamma</samp></dt>
  28197. <dd><p>Set the gamma expression.
  28198. </p>
  28199. </dd>
  28200. <dt><samp class="option">gamma_r</samp></dt>
  28201. <dd><p>Set the gamma_r expression.
  28202. </p>
  28203. </dd>
  28204. <dt><samp class="option">gamma_g</samp></dt>
  28205. <dd><p>Set gamma_g expression.
  28206. </p>
  28207. </dd>
  28208. <dt><samp class="option">gamma_b</samp></dt>
  28209. <dd><p>Set gamma_b expression.
  28210. </p>
  28211. </dd>
  28212. <dt><samp class="option">gamma_weight</samp></dt>
  28213. <dd><p>Set gamma_weight expression.
  28214. </p>
  28215. <p>The command accepts the same syntax of the corresponding option.
  28216. </p>
  28217. <p>If the specified expression is not valid, it is kept at its current
  28218. value.
  28219. </p>
  28220. </dd>
  28221. </dl>
  28222. <a class="anchor" id="erosion"></a><a name="erosion-1"></a>
  28223. <h3 class="section">32.82 erosion<span class="pull-right"><a class="anchor hidden-xs" href="#erosion-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erosion-1" aria-hidden="true">TOC</a></span></h3>
  28224. <p>Apply erosion effect to the video.
  28225. </p>
  28226. <p>This filter replaces the pixel by the local(3x3) minimum.
  28227. </p>
  28228. <p>It accepts the following options:
  28229. </p>
  28230. <dl class="table">
  28231. <dt><samp class="option">threshold0</samp></dt>
  28232. <dt><samp class="option">threshold1</samp></dt>
  28233. <dt><samp class="option">threshold2</samp></dt>
  28234. <dt><samp class="option">threshold3</samp></dt>
  28235. <dd><p>Limit the maximum change for each plane, default is 65535.
  28236. If 0, plane will remain unchanged.
  28237. </p>
  28238. </dd>
  28239. <dt><samp class="option">coordinates</samp></dt>
  28240. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  28241. pixels are used.
  28242. </p>
  28243. <p>Flags to local 3x3 coordinates maps like this:
  28244. </p>
  28245. <p>1 2 3
  28246. 4 5
  28247. 6 7 8
  28248. </p></dd>
  28249. </dl>
  28250. <a name="Commands-90"></a>
  28251. <h4 class="subsection">32.82.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-90" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-90" aria-hidden="true">TOC</a></span></h4>
  28252. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28253. </p>
  28254. <a name="estdif"></a>
  28255. <h3 class="section">32.83 estdif<span class="pull-right"><a class="anchor hidden-xs" href="#estdif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-estdif" aria-hidden="true">TOC</a></span></h3>
  28256. <p>Deinterlace the input video (&quot;estdif&quot; stands for &quot;Edge Slope
  28257. Tracing Deinterlacing Filter&quot;).
  28258. </p>
  28259. <p>Spatial only filter that uses edge slope tracing algorithm
  28260. to interpolate missing lines.
  28261. It accepts the following parameters:
  28262. </p>
  28263. <dl class="table">
  28264. <dt><samp class="option">mode</samp></dt>
  28265. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  28266. </p>
  28267. <dl class="table">
  28268. <dt><samp class="option">frame</samp></dt>
  28269. <dd><p>Output one frame for each frame.
  28270. </p></dd>
  28271. <dt><samp class="option">field</samp></dt>
  28272. <dd><p>Output one frame for each field.
  28273. </p></dd>
  28274. </dl>
  28275. <p>The default value is <code class="code">field</code>.
  28276. </p>
  28277. </dd>
  28278. <dt><samp class="option">parity</samp></dt>
  28279. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  28280. of the following values:
  28281. </p>
  28282. <dl class="table">
  28283. <dt><samp class="option">tff</samp></dt>
  28284. <dd><p>Assume the top field is first.
  28285. </p></dd>
  28286. <dt><samp class="option">bff</samp></dt>
  28287. <dd><p>Assume the bottom field is first.
  28288. </p></dd>
  28289. <dt><samp class="option">auto</samp></dt>
  28290. <dd><p>Enable automatic detection of field parity.
  28291. </p></dd>
  28292. </dl>
  28293. <p>The default value is <code class="code">auto</code>.
  28294. If the interlacing is unknown or the decoder does not export this information,
  28295. top field first will be assumed.
  28296. </p>
  28297. </dd>
  28298. <dt><samp class="option">deint</samp></dt>
  28299. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  28300. values:
  28301. </p>
  28302. <dl class="table">
  28303. <dt><samp class="option">all</samp></dt>
  28304. <dd><p>Deinterlace all frames.
  28305. </p></dd>
  28306. <dt><samp class="option">interlaced</samp></dt>
  28307. <dd><p>Only deinterlace frames marked as interlaced.
  28308. </p></dd>
  28309. </dl>
  28310. <p>The default value is <code class="code">all</code>.
  28311. </p>
  28312. </dd>
  28313. <dt><samp class="option">rslope</samp></dt>
  28314. <dd><p>Specify the search radius for edge slope tracing. Default value is 1.
  28315. Allowed range is from 1 to 15.
  28316. </p>
  28317. </dd>
  28318. <dt><samp class="option">redge</samp></dt>
  28319. <dd><p>Specify the search radius for best edge matching. Default value is 2.
  28320. Allowed range is from 0 to 15.
  28321. </p>
  28322. </dd>
  28323. <dt><samp class="option">ecost</samp></dt>
  28324. <dd><p>Specify the edge cost for edge matching. Default value is 2.
  28325. Allowed range is from 0 to 50.
  28326. </p>
  28327. </dd>
  28328. <dt><samp class="option">mcost</samp></dt>
  28329. <dd><p>Specify the middle cost for edge matching. Default value is 1.
  28330. Allowed range is from 0 to 50.
  28331. </p>
  28332. </dd>
  28333. <dt><samp class="option">dcost</samp></dt>
  28334. <dd><p>Specify the distance cost for edge matching. Default value is 1.
  28335. Allowed range is from 0 to 50.
  28336. </p>
  28337. </dd>
  28338. <dt><samp class="option">interp</samp></dt>
  28339. <dd><p>Specify the interpolation used. Default is 4-point interpolation. It accepts one
  28340. of the following values:
  28341. </p>
  28342. <dl class="table">
  28343. <dt><samp class="option">2p</samp></dt>
  28344. <dd><p>Two-point interpolation.
  28345. </p></dd>
  28346. <dt><samp class="option">4p</samp></dt>
  28347. <dd><p>Four-point interpolation.
  28348. </p></dd>
  28349. <dt><samp class="option">6p</samp></dt>
  28350. <dd><p>Six-point interpolation.
  28351. </p></dd>
  28352. </dl>
  28353. </dd>
  28354. </dl>
  28355. <a name="Commands-91"></a>
  28356. <h4 class="subsection">32.83.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-91" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-91" aria-hidden="true">TOC</a></span></h4>
  28357. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  28358. </p>
  28359. <a name="exposure"></a>
  28360. <h3 class="section">32.84 exposure<span class="pull-right"><a class="anchor hidden-xs" href="#exposure" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-exposure" aria-hidden="true">TOC</a></span></h3>
  28361. <p>Adjust exposure of the video stream.
  28362. </p>
  28363. <p>The filter accepts the following options:
  28364. </p>
  28365. <dl class="table">
  28366. <dt><samp class="option">exposure</samp></dt>
  28367. <dd><p>Set the exposure correction in EV. Allowed range is from -3.0 to 3.0 EV
  28368. Default value is 0 EV.
  28369. </p>
  28370. </dd>
  28371. <dt><samp class="option">black</samp></dt>
  28372. <dd><p>Set the black level correction. Allowed range is from -1.0 to 1.0.
  28373. Default value is 0.
  28374. </p></dd>
  28375. </dl>
  28376. <a name="Commands-92"></a>
  28377. <h4 class="subsection">32.84.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-92" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-92" aria-hidden="true">TOC</a></span></h4>
  28378. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  28379. </p>
  28380. <a name="extractplanes"></a>
  28381. <h3 class="section">32.85 extractplanes<span class="pull-right"><a class="anchor hidden-xs" href="#extractplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-extractplanes" aria-hidden="true">TOC</a></span></h3>
  28382. <p>Extract color channel components from input video stream into
  28383. separate grayscale video streams.
  28384. </p>
  28385. <p>The filter accepts the following option:
  28386. </p>
  28387. <dl class="table">
  28388. <dt><samp class="option">planes</samp></dt>
  28389. <dd><p>Set plane(s) to extract.
  28390. </p>
  28391. <p>Available values for planes are:
  28392. </p><dl class="table">
  28393. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  28394. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  28395. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  28396. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  28397. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  28398. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  28399. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  28400. </dl>
  28401. <p>Choosing planes not available in the input will result in an error.
  28402. That means you cannot select <code class="code">r</code>, <code class="code">g</code>, <code class="code">b</code> planes
  28403. with <code class="code">y</code>, <code class="code">u</code>, <code class="code">v</code> planes at same time.
  28404. </p></dd>
  28405. </dl>
  28406. <a name="Examples-91"></a>
  28407. <h4 class="subsection">32.85.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-91" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-91" aria-hidden="true">TOC</a></span></h4>
  28408. <ul class="itemize mark-bullet">
  28409. <li>Extract luma, u and v color channel component from input video frame
  28410. into 3 grayscale outputs:
  28411. <div class="example">
  28412. <pre class="example-preformatted">ffmpeg -i video.avi -filter_complex 'extractplanes=y+u+v[y][u][v]' -map '[y]' y.avi -map '[u]' u.avi -map '[v]' v.avi
  28413. </pre></div>
  28414. </li></ul>
  28415. <a name="fade"></a>
  28416. <h3 class="section">32.86 fade<span class="pull-right"><a class="anchor hidden-xs" href="#fade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fade" aria-hidden="true">TOC</a></span></h3>
  28417. <p>Apply a fade-in/out effect to the input video.
  28418. </p>
  28419. <p>It accepts the following parameters:
  28420. </p>
  28421. <dl class="table">
  28422. <dt><samp class="option">type, t</samp></dt>
  28423. <dd><p>The effect type can be either &quot;in&quot; for a fade-in, or &quot;out&quot; for a fade-out
  28424. effect.
  28425. Default is <code class="code">in</code>.
  28426. </p>
  28427. </dd>
  28428. <dt><samp class="option">start_frame, s</samp></dt>
  28429. <dd><p>Specify the number of the frame to start applying the fade
  28430. effect at. Default is 0.
  28431. </p>
  28432. </dd>
  28433. <dt><samp class="option">nb_frames, n</samp></dt>
  28434. <dd><p>The number of frames that the fade effect lasts. At the end of the
  28435. fade-in effect, the output video will have the same intensity as the input video.
  28436. At the end of the fade-out transition, the output video will be filled with the
  28437. selected <samp class="option">color</samp>.
  28438. Default is 25.
  28439. </p>
  28440. </dd>
  28441. <dt><samp class="option">alpha</samp></dt>
  28442. <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
  28443. Default value is 0.
  28444. </p>
  28445. </dd>
  28446. <dt><samp class="option">start_time, st</samp></dt>
  28447. <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
  28448. effect. If both start_frame and start_time are specified, the fade will start at
  28449. whichever comes last. Default is 0.
  28450. </p>
  28451. </dd>
  28452. <dt><samp class="option">duration, d</samp></dt>
  28453. <dd><p>The number of seconds for which the fade effect has to last. At the end of the
  28454. fade-in effect the output video will have the same intensity as the input video,
  28455. at the end of the fade-out transition the output video will be filled with the
  28456. selected <samp class="option">color</samp>.
  28457. If both duration and nb_frames are specified, duration is used. Default is 0
  28458. (nb_frames is used by default).
  28459. </p>
  28460. </dd>
  28461. <dt><samp class="option">color, c</samp></dt>
  28462. <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
  28463. </p></dd>
  28464. </dl>
  28465. <a name="Examples-92"></a>
  28466. <h4 class="subsection">32.86.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-92" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-92" aria-hidden="true">TOC</a></span></h4>
  28467. <ul class="itemize mark-bullet">
  28468. <li>Fade in the first 30 frames of video:
  28469. <div class="example">
  28470. <pre class="example-preformatted">fade=in:0:30
  28471. </pre></div>
  28472. <p>The command above is equivalent to:
  28473. </p><div class="example">
  28474. <pre class="example-preformatted">fade=t=in:s=0:n=30
  28475. </pre></div>
  28476. </li><li>Fade out the last 45 frames of a 200-frame video:
  28477. <div class="example">
  28478. <pre class="example-preformatted">fade=out:155:45
  28479. fade=type=out:start_frame=155:nb_frames=45
  28480. </pre></div>
  28481. </li><li>Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video:
  28482. <div class="example">
  28483. <pre class="example-preformatted">fade=in:0:25, fade=out:975:25
  28484. </pre></div>
  28485. </li><li>Make the first 5 frames yellow, then fade in from frame 5-24:
  28486. <div class="example">
  28487. <pre class="example-preformatted">fade=in:5:20:color=yellow
  28488. </pre></div>
  28489. </li><li>Fade in alpha over first 25 frames of video:
  28490. <div class="example">
  28491. <pre class="example-preformatted">fade=in:0:25:alpha=1
  28492. </pre></div>
  28493. </li><li>Make the first 5.5 seconds black, then fade in for 0.5 seconds:
  28494. <div class="example">
  28495. <pre class="example-preformatted">fade=t=in:st=5.5:d=0.5
  28496. </pre></div>
  28497. </li></ul>
  28498. <a name="feedback"></a>
  28499. <h3 class="section">32.87 feedback<span class="pull-right"><a class="anchor hidden-xs" href="#feedback" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-feedback" aria-hidden="true">TOC</a></span></h3>
  28500. <p>Apply feedback video filter.
  28501. </p>
  28502. <p>This filter pass cropped input frames to 2nd output.
  28503. From there it can be filtered with other video filters.
  28504. After filter receives frame from 2nd input, that frame
  28505. is combined on top of original frame from 1st input and passed
  28506. to 1st output.
  28507. </p>
  28508. <p>The typical usage is filter only part of frame.
  28509. </p>
  28510. <p>The filter accepts the following options:
  28511. </p><dl class="table">
  28512. <dt><samp class="option">x</samp></dt>
  28513. <dt><samp class="option">y</samp></dt>
  28514. <dd><p>Set the top left crop position.
  28515. </p>
  28516. </dd>
  28517. <dt><samp class="option">w</samp></dt>
  28518. <dt><samp class="option">h</samp></dt>
  28519. <dd><p>Set the crop size.
  28520. </p></dd>
  28521. </dl>
  28522. <a name="Examples-93"></a>
  28523. <h4 class="subsection">32.87.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-93" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-93" aria-hidden="true">TOC</a></span></h4>
  28524. <ul class="itemize mark-bullet">
  28525. <li>Blur only top left rectangular part of video frame size 100x100 with gblur filter.
  28526. <div class="example">
  28527. <pre class="example-preformatted">[in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]gblur=8[blurin]
  28528. </pre></div>
  28529. </li><li>Draw black box on top left part of video frame of size 100x100 with drawbox filter.
  28530. <div class="example">
  28531. <pre class="example-preformatted">[in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]drawbox=x=0:y=0:w=100:h=100:t=100[blurin]
  28532. </pre></div>
  28533. </li><li>Pixelize rectangular part of video frame of size 100x100 with pixelize filter.
  28534. <div class="example">
  28535. <pre class="example-preformatted">[in][blurin]feedback=x=320:y=240:w=100:h=100[out][blurout];[blurout]pixelize[blurin]
  28536. </pre></div>
  28537. </li></ul>
  28538. <a name="fftdnoiz"></a>
  28539. <h3 class="section">32.88 fftdnoiz<span class="pull-right"><a class="anchor hidden-xs" href="#fftdnoiz" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fftdnoiz" aria-hidden="true">TOC</a></span></h3>
  28540. <p>Denoise frames using 3D FFT (frequency domain filtering).
  28541. </p>
  28542. <p>The filter accepts the following options:
  28543. </p>
  28544. <dl class="table">
  28545. <dt><samp class="option">sigma</samp></dt>
  28546. <dd><p>Set the noise sigma constant. This sets denoising strength.
  28547. Default value is 1. Allowed range is from 0 to 30.
  28548. Using very high sigma with low overlap may give blocking artifacts.
  28549. </p>
  28550. </dd>
  28551. <dt><samp class="option">amount</samp></dt>
  28552. <dd><p>Set amount of denoising. By default all detected noise is reduced.
  28553. Default value is 1. Allowed range is from 0 to 1.
  28554. </p>
  28555. </dd>
  28556. <dt><samp class="option">block</samp></dt>
  28557. <dd><p>Set size of block in pixels, Default is 32, can be 8 to 256.
  28558. </p>
  28559. </dd>
  28560. <dt><samp class="option">overlap</samp></dt>
  28561. <dd><p>Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8.
  28562. </p>
  28563. </dd>
  28564. <dt><samp class="option">method</samp></dt>
  28565. <dd><p>Set denoising method. Default is <code class="code">wiener</code>, can also be <code class="code">hard</code>.
  28566. </p>
  28567. </dd>
  28568. <dt><samp class="option">prev</samp></dt>
  28569. <dd><p>Set number of previous frames to use for denoising. By default is set to 0.
  28570. </p>
  28571. </dd>
  28572. <dt><samp class="option">next</samp></dt>
  28573. <dd><p>Set number of next frames to to use for denoising. By default is set to 0.
  28574. </p>
  28575. </dd>
  28576. <dt><samp class="option">planes</samp></dt>
  28577. <dd><p>Set planes which will be filtered, by default are all available filtered
  28578. except alpha.
  28579. </p></dd>
  28580. </dl>
  28581. <a name="fftfilt"></a>
  28582. <h3 class="section">32.89 fftfilt<span class="pull-right"><a class="anchor hidden-xs" href="#fftfilt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fftfilt" aria-hidden="true">TOC</a></span></h3>
  28583. <p>Apply arbitrary expressions to samples in frequency domain
  28584. </p>
  28585. <dl class="table">
  28586. <dt><samp class="option">dc_Y</samp></dt>
  28587. <dd><p>Adjust the dc value (gain) of the luma plane of the image. The filter
  28588. accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The default
  28589. value is set to <code class="code">0</code>.
  28590. </p>
  28591. </dd>
  28592. <dt><samp class="option">dc_U</samp></dt>
  28593. <dd><p>Adjust the dc value (gain) of the 1st chroma plane of the image. The
  28594. filter accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The
  28595. default value is set to <code class="code">0</code>.
  28596. </p>
  28597. </dd>
  28598. <dt><samp class="option">dc_V</samp></dt>
  28599. <dd><p>Adjust the dc value (gain) of the 2nd chroma plane of the image. The
  28600. filter accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The
  28601. default value is set to <code class="code">0</code>.
  28602. </p>
  28603. </dd>
  28604. <dt><samp class="option">weight_Y</samp></dt>
  28605. <dd><p>Set the frequency domain weight expression for the luma plane.
  28606. </p>
  28607. </dd>
  28608. <dt><samp class="option">weight_U</samp></dt>
  28609. <dd><p>Set the frequency domain weight expression for the 1st chroma plane.
  28610. </p>
  28611. </dd>
  28612. <dt><samp class="option">weight_V</samp></dt>
  28613. <dd><p>Set the frequency domain weight expression for the 2nd chroma plane.
  28614. </p>
  28615. </dd>
  28616. <dt><samp class="option">eval</samp></dt>
  28617. <dd><p>Set when the expressions are evaluated.
  28618. </p>
  28619. <p>It accepts the following values:
  28620. </p><dl class="table">
  28621. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  28622. <dd><p>Only evaluate expressions once during the filter initialization.
  28623. </p>
  28624. </dd>
  28625. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  28626. <dd><p>Evaluate expressions for each incoming frame.
  28627. </p></dd>
  28628. </dl>
  28629. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  28630. </p>
  28631. <p>The filter accepts the following variables:
  28632. </p></dd>
  28633. <dt><samp class="option">X</samp></dt>
  28634. <dt><samp class="option">Y</samp></dt>
  28635. <dd><p>The coordinates of the current sample.
  28636. </p>
  28637. </dd>
  28638. <dt><samp class="option">W</samp></dt>
  28639. <dt><samp class="option">H</samp></dt>
  28640. <dd><p>The width and height of the image.
  28641. </p>
  28642. </dd>
  28643. <dt><samp class="option">N</samp></dt>
  28644. <dd><p>The number of input frame, starting from 0.
  28645. </p>
  28646. </dd>
  28647. <dt><samp class="option">WS</samp></dt>
  28648. <dt><samp class="option">HS</samp></dt>
  28649. <dd><p>The size of FFT array for horizontal and vertical processing.
  28650. </p></dd>
  28651. </dl>
  28652. <a name="Examples-94"></a>
  28653. <h4 class="subsection">32.89.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-94" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-94" aria-hidden="true">TOC</a></span></h4>
  28654. <ul class="itemize mark-bullet">
  28655. <li>High-pass:
  28656. <div class="example">
  28657. <pre class="example-preformatted">fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
  28658. </pre></div>
  28659. </li><li>Low-pass:
  28660. <div class="example">
  28661. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
  28662. </pre></div>
  28663. </li><li>Sharpen:
  28664. <div class="example">
  28665. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
  28666. </pre></div>
  28667. </li><li>Blur:
  28668. <div class="example">
  28669. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
  28670. </pre></div>
  28671. </li></ul>
  28672. <a name="field"></a>
  28673. <h3 class="section">32.90 field<span class="pull-right"><a class="anchor hidden-xs" href="#field" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-field" aria-hidden="true">TOC</a></span></h3>
  28674. <p>Extract a single field from an interlaced image using stride
  28675. arithmetic to avoid wasting CPU time. The output frames are marked as
  28676. non-interlaced.
  28677. </p>
  28678. <p>The filter accepts the following options:
  28679. </p>
  28680. <dl class="table">
  28681. <dt><samp class="option">type</samp></dt>
  28682. <dd><p>Specify whether to extract the top (if the value is <code class="code">0</code> or
  28683. <code class="code">top</code>) or the bottom field (if the value is <code class="code">1</code> or
  28684. <code class="code">bottom</code>).
  28685. </p></dd>
  28686. </dl>
  28687. <a name="fieldhint"></a>
  28688. <h3 class="section">32.91 fieldhint<span class="pull-right"><a class="anchor hidden-xs" href="#fieldhint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldhint" aria-hidden="true">TOC</a></span></h3>
  28689. <p>Create new frames by copying the top and bottom fields from surrounding frames
  28690. supplied as numbers by the hint file.
  28691. </p>
  28692. <dl class="table">
  28693. <dt><samp class="option">hint</samp></dt>
  28694. <dd><p>Set file containing hints: absolute/relative frame numbers.
  28695. </p>
  28696. <p>There must be one line for each frame in a clip. Each line must contain two
  28697. numbers separated by the comma, optionally followed by <code class="code">-</code> or <code class="code">+</code>.
  28698. Numbers supplied on each line of file can not be out of [N-1,N+1] where N
  28699. is current frame number for <code class="code">absolute</code> mode or out of [-1, 1] range
  28700. for <code class="code">relative</code> mode. First number tells from which frame to pick up top
  28701. field and second number tells from which frame to pick up bottom field.
  28702. </p>
  28703. <p>If optionally followed by <code class="code">+</code> output frame will be marked as interlaced,
  28704. else if followed by <code class="code">-</code> output frame will be marked as progressive, else
  28705. it will be marked same as input frame.
  28706. If optionally followed by <code class="code">t</code> output frame will use only top field, or in
  28707. case of <code class="code">b</code> it will use only bottom field.
  28708. If line starts with <code class="code">#</code> or <code class="code">;</code> that line is skipped.
  28709. </p>
  28710. </dd>
  28711. <dt><samp class="option">mode</samp></dt>
  28712. <dd><p>Can be item <code class="code">absolute</code> or <code class="code">relative</code> or <code class="code">pattern</code>. Default is <code class="code">absolute</code>.
  28713. The <code class="code">pattern</code> mode is same as <code class="code">relative</code> mode, except at last entry of file if there
  28714. are more frames to process than <code class="code">hint</code> file is seek back to start.
  28715. </p></dd>
  28716. </dl>
  28717. <p>Example of first several lines of <code class="code">hint</code> file for <code class="code">relative</code> mode:
  28718. </p><div class="example">
  28719. <pre class="example-preformatted">0,0 - # first frame
  28720. 1,0 - # second frame, use third's frame top field and second's frame bottom field
  28721. 1,0 - # third frame, use fourth's frame top field and third's frame bottom field
  28722. 1,0 -
  28723. 0,0 -
  28724. 0,0 -
  28725. 1,0 -
  28726. 1,0 -
  28727. 1,0 -
  28728. 0,0 -
  28729. 0,0 -
  28730. 1,0 -
  28731. 1,0 -
  28732. 1,0 -
  28733. 0,0 -
  28734. </pre></div>
  28735. <a name="fieldmatch"></a>
  28736. <h3 class="section">32.92 fieldmatch<span class="pull-right"><a class="anchor hidden-xs" href="#fieldmatch" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldmatch" aria-hidden="true">TOC</a></span></h3>
  28737. <p>Field matching filter for inverse telecine. It is meant to reconstruct the
  28738. progressive frames from a telecined stream. The filter does not drop duplicated
  28739. frames, so to achieve a complete inverse telecine <code class="code">fieldmatch</code> needs to be
  28740. followed by a decimation filter such as <a class="ref" href="#decimate">decimate</a> in the filtergraph.
  28741. </p>
  28742. <p>The separation of the field matching and the decimation is notably motivated by
  28743. the possibility of inserting a de-interlacing filter fallback between the two.
  28744. If the source has mixed telecined and real interlaced content,
  28745. <code class="code">fieldmatch</code> will not be able to match fields for the interlaced parts.
  28746. But these remaining combed frames will be marked as interlaced, and thus can be
  28747. de-interlaced by a later filter such as <a class="ref" href="#yadif">yadif</a> before decimation.
  28748. </p>
  28749. <p>In addition to the various configuration options, <code class="code">fieldmatch</code> can take an
  28750. optional second stream, activated through the <samp class="option">ppsrc</samp> option. If
  28751. enabled, the frames reconstruction will be based on the fields and frames from
  28752. this second stream. This allows the first input to be pre-processed in order to
  28753. help the various algorithms of the filter, while keeping the output lossless
  28754. (assuming the fields are matched properly). Typically, a field-aware denoiser,
  28755. or brightness/contrast adjustments can help.
  28756. </p>
  28757. <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
  28758. and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
  28759. which <code class="code">fieldmatch</code> is based on. While the semantic and usage are very
  28760. close, some behaviour and options names can differ.
  28761. </p>
  28762. <p>The <a class="ref" href="#decimate">decimate</a> filter currently only works for constant frame rate input.
  28763. If your input has mixed telecined (30fps) and progressive content with a lower
  28764. framerate like 24fps use the following filterchain to produce the necessary cfr
  28765. stream: <code class="code">dejudder,fps=30000/1001,fieldmatch,decimate</code>.
  28766. </p>
  28767. <p>The filter accepts the following options:
  28768. </p>
  28769. <dl class="table">
  28770. <dt><samp class="option">order</samp></dt>
  28771. <dd><p>Specify the assumed field order of the input stream. Available values are:
  28772. </p>
  28773. <dl class="table">
  28774. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  28775. <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
  28776. </p></dd>
  28777. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  28778. <dd><p>Assume bottom field first.
  28779. </p></dd>
  28780. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  28781. <dd><p>Assume top field first.
  28782. </p></dd>
  28783. </dl>
  28784. <p>Note that it is sometimes recommended not to trust the parity announced by the
  28785. stream.
  28786. </p>
  28787. <p>Default value is <var class="var">auto</var>.
  28788. </p>
  28789. </dd>
  28790. <dt><samp class="option">mode</samp></dt>
  28791. <dd><p>Set the matching mode or strategy to use. <samp class="option">pc</samp> mode is the safest in the
  28792. sense that it won&rsquo;t risk creating jerkiness due to duplicate frames when
  28793. possible, but if there are bad edits or blended fields it will end up
  28794. outputting combed frames when a good match might actually exist. On the other
  28795. hand, <samp class="option">pcn_ub</samp> mode is the most risky in terms of creating jerkiness,
  28796. but will almost always find a good frame if there is one. The other values are
  28797. all somewhere in between <samp class="option">pc</samp> and <samp class="option">pcn_ub</samp> in terms of risking
  28798. jerkiness and creating duplicate frames versus finding good matches in sections
  28799. with bad edits, orphaned fields, blended fields, etc.
  28800. </p>
  28801. <p>More details about p/c/n/u/b are available in <a class="ref" href="#p_002fc_002fn_002fu_002fb-meaning">p/c/n/u/b meaning</a> section.
  28802. </p>
  28803. <p>Available values are:
  28804. </p>
  28805. <dl class="table">
  28806. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  28807. <dd><p>2-way matching (p/c)
  28808. </p></dd>
  28809. <dt>&lsquo;<samp class="samp">pc_n</samp>&rsquo;</dt>
  28810. <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
  28811. </p></dd>
  28812. <dt>&lsquo;<samp class="samp">pc_u</samp>&rsquo;</dt>
  28813. <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
  28814. </p></dd>
  28815. <dt>&lsquo;<samp class="samp">pc_n_ub</samp>&rsquo;</dt>
  28816. <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
  28817. still combed (p/c + n + u/b)
  28818. </p></dd>
  28819. <dt>&lsquo;<samp class="samp">pcn</samp>&rsquo;</dt>
  28820. <dd><p>3-way matching (p/c/n)
  28821. </p></dd>
  28822. <dt>&lsquo;<samp class="samp">pcn_ub</samp>&rsquo;</dt>
  28823. <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
  28824. detected as combed (p/c/n + u/b)
  28825. </p></dd>
  28826. </dl>
  28827. <p>The parenthesis at the end indicate the matches that would be used for that
  28828. mode assuming <samp class="option">order</samp>=<var class="var">tff</var> (and <samp class="option">field</samp> on <var class="var">auto</var> or
  28829. <var class="var">top</var>).
  28830. </p>
  28831. <p>In terms of speed <samp class="option">pc</samp> mode is by far the fastest and <samp class="option">pcn_ub</samp> is
  28832. the slowest.
  28833. </p>
  28834. <p>Default value is <var class="var">pc_n</var>.
  28835. </p>
  28836. </dd>
  28837. <dt><samp class="option">ppsrc</samp></dt>
  28838. <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
  28839. input stream as the clean source to pick the fields from. See the filter
  28840. introduction for more details. It is similar to the <samp class="option">clip2</samp> feature from
  28841. VFM/TFM.
  28842. </p>
  28843. <p>Default value is <code class="code">0</code> (disabled).
  28844. </p>
  28845. </dd>
  28846. <dt><samp class="option">field</samp></dt>
  28847. <dd><p>Set the field to match from. It is recommended to set this to the same value as
  28848. <samp class="option">order</samp> unless you experience matching failures with that setting. In
  28849. certain circumstances changing the field that is used to match from can have a
  28850. large impact on matching performance. Available values are:
  28851. </p>
  28852. <dl class="table">
  28853. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  28854. <dd><p>Automatic (same value as <samp class="option">order</samp>).
  28855. </p></dd>
  28856. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  28857. <dd><p>Match from the bottom field.
  28858. </p></dd>
  28859. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  28860. <dd><p>Match from the top field.
  28861. </p></dd>
  28862. </dl>
  28863. <p>Default value is <var class="var">auto</var>.
  28864. </p>
  28865. </dd>
  28866. <dt><samp class="option">mchroma</samp></dt>
  28867. <dd><p>Set whether or not chroma is included during the match comparisons. In most
  28868. cases it is recommended to leave this enabled. You should set this to <code class="code">0</code>
  28869. only if your clip has bad chroma problems such as heavy rainbowing or other
  28870. artifacts. Setting this to <code class="code">0</code> could also be used to speed things up at
  28871. the cost of some accuracy.
  28872. </p>
  28873. <p>Default value is <code class="code">1</code>.
  28874. </p>
  28875. </dd>
  28876. <dt><samp class="option">y0</samp></dt>
  28877. <dt><samp class="option">y1</samp></dt>
  28878. <dd><p>These define an exclusion band which excludes the lines between <samp class="option">y0</samp> and
  28879. <samp class="option">y1</samp> from being included in the field matching decision. An exclusion
  28880. band can be used to ignore subtitles, a logo, or other things that may
  28881. interfere with the matching. <samp class="option">y0</samp> sets the starting scan line and
  28882. <samp class="option">y1</samp> sets the ending line; all lines in between <samp class="option">y0</samp> and
  28883. <samp class="option">y1</samp> (including <samp class="option">y0</samp> and <samp class="option">y1</samp>) will be ignored. Setting
  28884. <samp class="option">y0</samp> and <samp class="option">y1</samp> to the same value will disable the feature.
  28885. <samp class="option">y0</samp> and <samp class="option">y1</samp> defaults to <code class="code">0</code>.
  28886. </p>
  28887. </dd>
  28888. <dt><samp class="option">scthresh</samp></dt>
  28889. <dd><p>Set the scene change detection threshold as a percentage of maximum change on
  28890. the luma plane. Good values are in the <code class="code">[8.0, 14.0]</code> range. Scene change
  28891. detection is only relevant in case <samp class="option">combmatch</samp>=<var class="var">sc</var>. The range for
  28892. <samp class="option">scthresh</samp> is <code class="code">[0.0, 100.0]</code>.
  28893. </p>
  28894. <p>Default value is <code class="code">12.0</code>.
  28895. </p>
  28896. </dd>
  28897. <dt><samp class="option">combmatch</samp></dt>
  28898. <dd><p>When <samp class="option">combatch</samp> is not <var class="var">none</var>, <code class="code">fieldmatch</code> will take into
  28899. account the combed scores of matches when deciding what match to use as the
  28900. final match. Available values are:
  28901. </p>
  28902. <dl class="table">
  28903. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  28904. <dd><p>No final matching based on combed scores.
  28905. </p></dd>
  28906. <dt>&lsquo;<samp class="samp">sc</samp>&rsquo;</dt>
  28907. <dd><p>Combed scores are only used when a scene change is detected.
  28908. </p></dd>
  28909. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  28910. <dd><p>Use combed scores all the time.
  28911. </p></dd>
  28912. </dl>
  28913. <p>Default is <var class="var">sc</var>.
  28914. </p>
  28915. </dd>
  28916. <dt><samp class="option">combdbg</samp></dt>
  28917. <dd><p>Force <code class="code">fieldmatch</code> to calculate the combed metrics for certain matches and
  28918. print them. This setting is known as <samp class="option">micout</samp> in TFM/VFM vocabulary.
  28919. Available values are:
  28920. </p>
  28921. <dl class="table">
  28922. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  28923. <dd><p>No forced calculation.
  28924. </p></dd>
  28925. <dt>&lsquo;<samp class="samp">pcn</samp>&rsquo;</dt>
  28926. <dd><p>Force p/c/n calculations.
  28927. </p></dd>
  28928. <dt>&lsquo;<samp class="samp">pcnub</samp>&rsquo;</dt>
  28929. <dd><p>Force p/c/n/u/b calculations.
  28930. </p></dd>
  28931. </dl>
  28932. <p>Default value is <var class="var">none</var>.
  28933. </p>
  28934. </dd>
  28935. <dt><samp class="option">cthresh</samp></dt>
  28936. <dd><p>This is the area combing threshold used for combed frame detection. This
  28937. essentially controls how &quot;strong&quot; or &quot;visible&quot; combing must be to be detected.
  28938. Larger values mean combing must be more visible and smaller values mean combing
  28939. can be less visible or strong and still be detected. Valid settings are from
  28940. <code class="code">-1</code> (every pixel will be detected as combed) to <code class="code">255</code> (no pixel will
  28941. be detected as combed). This is basically a pixel difference value. A good
  28942. range is <code class="code">[8, 12]</code>.
  28943. </p>
  28944. <p>Default value is <code class="code">9</code>.
  28945. </p>
  28946. </dd>
  28947. <dt><samp class="option">chroma</samp></dt>
  28948. <dd><p>Sets whether or not chroma is considered in the combed frame decision. Only
  28949. disable this if your source has chroma problems (rainbowing, etc.) that are
  28950. causing problems for the combed frame detection with chroma enabled. Actually,
  28951. using <samp class="option">chroma</samp>=<var class="var">0</var> is usually more reliable, except for the case
  28952. where there is chroma only combing in the source.
  28953. </p>
  28954. <p>Default value is <code class="code">0</code>.
  28955. </p>
  28956. </dd>
  28957. <dt><samp class="option">blockx</samp></dt>
  28958. <dt><samp class="option">blocky</samp></dt>
  28959. <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
  28960. frame detection. This has to do with the size of the area in which
  28961. <samp class="option">combpel</samp> pixels are required to be detected as combed for a frame to be
  28962. declared combed. See the <samp class="option">combpel</samp> parameter description for more info.
  28963. Possible values are any number that is a power of 2 starting at 4 and going up
  28964. to 512.
  28965. </p>
  28966. <p>Default value is <code class="code">16</code>.
  28967. </p>
  28968. </dd>
  28969. <dt><samp class="option">combpel</samp></dt>
  28970. <dd><p>The number of combed pixels inside any of the <samp class="option">blocky</samp> by
  28971. <samp class="option">blockx</samp> size blocks on the frame for the frame to be detected as
  28972. combed. While <samp class="option">cthresh</samp> controls how &quot;visible&quot; the combing must be, this
  28973. setting controls &quot;how much&quot; combing there must be in any localized area (a
  28974. window defined by the <samp class="option">blockx</samp> and <samp class="option">blocky</samp> settings) on the
  28975. frame. Minimum value is <code class="code">0</code> and maximum is <code class="code">blocky x blockx</code> (at
  28976. which point no frames will ever be detected as combed). This setting is known
  28977. as <samp class="option">MI</samp> in TFM/VFM vocabulary.
  28978. </p>
  28979. <p>Default value is <code class="code">80</code>.
  28980. </p></dd>
  28981. </dl>
  28982. <a class="anchor" id="p_002fc_002fn_002fu_002fb-meaning"></a><a name="p_002fc_002fn_002fu_002fb-meaning-1"></a>
  28983. <h4 class="subsection">32.92.1 p/c/n/u/b meaning<span class="pull-right"><a class="anchor hidden-xs" href="#p_002fc_002fn_002fu_002fb-meaning-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-p_002fc_002fn_002fu_002fb-meaning-1" aria-hidden="true">TOC</a></span></h4>
  28984. <a name="p_002fc_002fn"></a>
  28985. <h4 class="subsubsection">32.92.1.1 p/c/n<span class="pull-right"><a class="anchor hidden-xs" href="#p_002fc_002fn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-p_002fc_002fn" aria-hidden="true">TOC</a></span></h4>
  28986. <p>We assume the following telecined stream:
  28987. </p>
  28988. <div class="example">
  28989. <pre class="example-preformatted">Top fields: 1 2 2 3 4
  28990. Bottom fields: 1 2 3 4 4
  28991. </pre></div>
  28992. <p>The numbers correspond to the progressive frame the fields relate to. Here, the
  28993. first two frames are progressive, the 3rd and 4th are combed, and so on.
  28994. </p>
  28995. <p>When <code class="code">fieldmatch</code> is configured to run a matching from bottom
  28996. (<samp class="option">field</samp>=<var class="var">bottom</var>) this is how this input stream get transformed:
  28997. </p>
  28998. <div class="example">
  28999. <pre class="example-preformatted">Input stream:
  29000. T 1 2 2 3 4
  29001. B 1 2 3 4 4 &lt;-- matching reference
  29002. Matches: c c n n c
  29003. Output stream:
  29004. T 1 2 3 4 4
  29005. B 1 2 3 4 4
  29006. </pre></div>
  29007. <p>As a result of the field matching, we can see that some frames get duplicated.
  29008. To perform a complete inverse telecine, you need to rely on a decimation filter
  29009. after this operation. See for instance the <a class="ref" href="#decimate">decimate</a> filter.
  29010. </p>
  29011. <p>The same operation now matching from top fields (<samp class="option">field</samp>=<var class="var">top</var>)
  29012. looks like this:
  29013. </p>
  29014. <div class="example">
  29015. <pre class="example-preformatted">Input stream:
  29016. T 1 2 2 3 4 &lt;-- matching reference
  29017. B 1 2 3 4 4
  29018. Matches: c c p p c
  29019. Output stream:
  29020. T 1 2 2 3 4
  29021. B 1 2 2 3 4
  29022. </pre></div>
  29023. <p>In these examples, we can see what <var class="var">p</var>, <var class="var">c</var> and <var class="var">n</var> mean;
  29024. basically, they refer to the frame and field of the opposite parity:
  29025. </p>
  29026. <ul class="itemize mark-bullet">
  29027. <li><var class="var">p</var> matches the field of the opposite parity in the previous frame
  29028. </li><li><var class="var">c</var> matches the field of the opposite parity in the current frame
  29029. </li><li><var class="var">n</var> matches the field of the opposite parity in the next frame
  29030. </li></ul>
  29031. <a name="u_002fb"></a>
  29032. <h4 class="subsubsection">32.92.1.2 u/b<span class="pull-right"><a class="anchor hidden-xs" href="#u_002fb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-u_002fb" aria-hidden="true">TOC</a></span></h4>
  29033. <p>The <var class="var">u</var> and <var class="var">b</var> matching are a bit special in the sense that they match
  29034. from the opposite parity flag. In the following examples, we assume that we are
  29035. currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
  29036. &rsquo;x&rsquo; is placed above and below each matched fields.
  29037. </p>
  29038. <p>With bottom matching (<samp class="option">field</samp>=<var class="var">bottom</var>):
  29039. </p><div class="example">
  29040. <pre class="example-preformatted">Match: c p n b u
  29041. x x x x x
  29042. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  29043. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  29044. x x x x x
  29045. Output frames:
  29046. 2 1 2 2 2
  29047. 2 2 2 1 3
  29048. </pre></div>
  29049. <p>With top matching (<samp class="option">field</samp>=<var class="var">top</var>):
  29050. </p><div class="example">
  29051. <pre class="example-preformatted">Match: c p n b u
  29052. x x x x x
  29053. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  29054. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  29055. x x x x x
  29056. Output frames:
  29057. 2 2 2 1 2
  29058. 2 1 3 2 2
  29059. </pre></div>
  29060. <a name="Examples-95"></a>
  29061. <h4 class="subsection">32.92.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-95" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-95" aria-hidden="true">TOC</a></span></h4>
  29062. <p>Simple IVTC of a top field first telecined stream:
  29063. </p><div class="example">
  29064. <pre class="example-preformatted">fieldmatch=order=tff:combmatch=none, decimate
  29065. </pre></div>
  29066. <p>Advanced IVTC, with fallback on <a class="ref" href="#yadif">yadif</a> for still combed frames:
  29067. </p><div class="example">
  29068. <pre class="example-preformatted">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
  29069. </pre></div>
  29070. <a name="fieldorder"></a>
  29071. <h3 class="section">32.93 fieldorder<span class="pull-right"><a class="anchor hidden-xs" href="#fieldorder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldorder" aria-hidden="true">TOC</a></span></h3>
  29072. <p>Transform the field order of the input video.
  29073. </p>
  29074. <p>It accepts the following parameters:
  29075. </p>
  29076. <dl class="table">
  29077. <dt><samp class="option">order</samp></dt>
  29078. <dd><p>The output field order. Valid values are <var class="var">tff</var> for top field first or <var class="var">bff</var>
  29079. for bottom field first.
  29080. </p></dd>
  29081. </dl>
  29082. <p>The default value is &lsquo;<samp class="samp">tff</samp>&rsquo;.
  29083. </p>
  29084. <p>The transformation is done by shifting the picture content up or down
  29085. by one line, and filling the remaining line with appropriate picture content.
  29086. This method is consistent with most broadcast field order converters.
  29087. </p>
  29088. <p>If the input video is not flagged as being interlaced, or it is already
  29089. flagged as being of the required output field order, then this filter does
  29090. not alter the incoming video.
  29091. </p>
  29092. <p>It is very useful when converting to or from PAL DV material,
  29093. which is bottom field first.
  29094. </p>
  29095. <p>For example:
  29096. </p><div class="example">
  29097. <pre class="example-preformatted">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
  29098. </pre></div>
  29099. <a name="fillborders"></a>
  29100. <h3 class="section">32.94 fillborders<span class="pull-right"><a class="anchor hidden-xs" href="#fillborders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fillborders" aria-hidden="true">TOC</a></span></h3>
  29101. <p>Fill borders of the input video, without changing video stream dimensions.
  29102. Sometimes video can have garbage at the four edges and you may not want to
  29103. crop video input to keep size multiple of some number.
  29104. </p>
  29105. <p>This filter accepts the following options:
  29106. </p>
  29107. <dl class="table">
  29108. <dt><samp class="option">left</samp></dt>
  29109. <dd><p>Number of pixels to fill from left border.
  29110. </p>
  29111. </dd>
  29112. <dt><samp class="option">right</samp></dt>
  29113. <dd><p>Number of pixels to fill from right border.
  29114. </p>
  29115. </dd>
  29116. <dt><samp class="option">top</samp></dt>
  29117. <dd><p>Number of pixels to fill from top border.
  29118. </p>
  29119. </dd>
  29120. <dt><samp class="option">bottom</samp></dt>
  29121. <dd><p>Number of pixels to fill from bottom border.
  29122. </p>
  29123. </dd>
  29124. <dt><samp class="option">mode</samp></dt>
  29125. <dd><p>Set fill mode.
  29126. </p>
  29127. <p>It accepts the following values:
  29128. </p><dl class="table">
  29129. <dt>&lsquo;<samp class="samp">smear</samp>&rsquo;</dt>
  29130. <dd><p>fill pixels using outermost pixels
  29131. </p>
  29132. </dd>
  29133. <dt>&lsquo;<samp class="samp">mirror</samp>&rsquo;</dt>
  29134. <dd><p>fill pixels using mirroring (half sample symmetric)
  29135. </p>
  29136. </dd>
  29137. <dt>&lsquo;<samp class="samp">fixed</samp>&rsquo;</dt>
  29138. <dd><p>fill pixels with constant value
  29139. </p>
  29140. </dd>
  29141. <dt>&lsquo;<samp class="samp">reflect</samp>&rsquo;</dt>
  29142. <dd><p>fill pixels using reflecting (whole sample symmetric)
  29143. </p>
  29144. </dd>
  29145. <dt>&lsquo;<samp class="samp">wrap</samp>&rsquo;</dt>
  29146. <dd><p>fill pixels using wrapping
  29147. </p>
  29148. </dd>
  29149. <dt>&lsquo;<samp class="samp">fade</samp>&rsquo;</dt>
  29150. <dd><p>fade pixels to constant value
  29151. </p>
  29152. </dd>
  29153. <dt>&lsquo;<samp class="samp">margins</samp>&rsquo;</dt>
  29154. <dd><p>fill pixels at top and bottom with weighted averages pixels near borders
  29155. </p></dd>
  29156. </dl>
  29157. <p>Default is <var class="var">smear</var>.
  29158. </p>
  29159. </dd>
  29160. <dt><samp class="option">color</samp></dt>
  29161. <dd><p>Set color for pixels in fixed or fade mode. Default is <var class="var">black</var>.
  29162. </p></dd>
  29163. </dl>
  29164. <a name="Commands-93"></a>
  29165. <h4 class="subsection">32.94.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-93" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-93" aria-hidden="true">TOC</a></span></h4>
  29166. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  29167. The command accepts the same syntax of the corresponding option.
  29168. </p>
  29169. <p>If the specified expression is not valid, it is kept at its current
  29170. value.
  29171. </p>
  29172. <a name="find_005frect"></a>
  29173. <h3 class="section">32.95 find_rect<span class="pull-right"><a class="anchor hidden-xs" href="#find_005frect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-find_005frect" aria-hidden="true">TOC</a></span></h3>
  29174. <p>Find a rectangular object in the input video.
  29175. </p>
  29176. <p>The object to search for must be specified as a gray8 image specified with the
  29177. <samp class="option">object</samp> option.
  29178. </p>
  29179. <p>For each possible match, a score is computed. If the score reaches the specified
  29180. threshold, the object is considered found.
  29181. </p>
  29182. <p>If the input video contains multiple instances of the object, the filter will
  29183. find only one of them.
  29184. </p>
  29185. <p>When an object is found, the following metadata entries are set in the matching
  29186. frame:
  29187. </p><dl class="table">
  29188. <dt><samp class="option">lavfi.rect.w</samp></dt>
  29189. <dd><p>width of object
  29190. </p>
  29191. </dd>
  29192. <dt><samp class="option">lavfi.rect.h</samp></dt>
  29193. <dd><p>height of object
  29194. </p>
  29195. </dd>
  29196. <dt><samp class="option">lavfi.rect.x</samp></dt>
  29197. <dd><p>x position of object
  29198. </p>
  29199. </dd>
  29200. <dt><samp class="option">lavfi.rect.y</samp></dt>
  29201. <dd><p>y position of object
  29202. </p>
  29203. </dd>
  29204. <dt><samp class="option">lavfi.rect.score</samp></dt>
  29205. <dd><p>match score of the found object
  29206. </p></dd>
  29207. </dl>
  29208. <p>It accepts the following options:
  29209. </p>
  29210. <dl class="table">
  29211. <dt><samp class="option">object</samp></dt>
  29212. <dd><p>Filepath of the object image, needs to be in gray8.
  29213. </p>
  29214. </dd>
  29215. <dt><samp class="option">threshold</samp></dt>
  29216. <dd><p>Detection threshold, expressed as a decimal number in the range 0-1.
  29217. </p>
  29218. <p>A threshold value of 0.01 means only exact matches, a threshold of 0.99 means
  29219. almost everything matches.
  29220. </p>
  29221. <p>Default value is 0.5.
  29222. </p>
  29223. </dd>
  29224. <dt><samp class="option">mipmaps</samp></dt>
  29225. <dd><p>Number of mipmaps, default is 3.
  29226. </p>
  29227. </dd>
  29228. <dt><samp class="option">xmin, ymin, xmax, ymax</samp></dt>
  29229. <dd><p>Specifies the rectangle in which to search.
  29230. </p>
  29231. </dd>
  29232. <dt><samp class="option">discard</samp></dt>
  29233. <dd><p>Discard frames where object is not detected. Default is disabled.
  29234. </p></dd>
  29235. </dl>
  29236. <a name="Examples-96"></a>
  29237. <h4 class="subsection">32.95.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-96" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-96" aria-hidden="true">TOC</a></span></h4>
  29238. <ul class="itemize mark-bullet">
  29239. <li>Cover a rectangular object by the supplied image of a given video using <code class="command">ffmpeg</code>:
  29240. <div class="example">
  29241. <pre class="example-preformatted">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  29242. </pre></div>
  29243. </li><li>Find the position of an object in each frame using <code class="command">ffprobe</code> and write
  29244. it to a log file:
  29245. <div class="example">
  29246. <pre class="example-preformatted">ffprobe -f lavfi movie=test.mp4,find_rect=object=object.pgm:threshold=0.3 \
  29247. -show_entries frame=pkt_pts_time:frame_tags=lavfi.rect.x,lavfi.rect.y \
  29248. -of csv -o find_rect.csv
  29249. </pre></div>
  29250. </li></ul>
  29251. <a name="floodfill"></a>
  29252. <h3 class="section">32.96 floodfill<span class="pull-right"><a class="anchor hidden-xs" href="#floodfill" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-floodfill" aria-hidden="true">TOC</a></span></h3>
  29253. <p>Flood area with values of same pixel components with another values.
  29254. </p>
  29255. <p>It accepts the following options:
  29256. </p><dl class="table">
  29257. <dt><samp class="option">x</samp></dt>
  29258. <dd><p>Set pixel x coordinate.
  29259. </p>
  29260. </dd>
  29261. <dt><samp class="option">y</samp></dt>
  29262. <dd><p>Set pixel y coordinate.
  29263. </p>
  29264. </dd>
  29265. <dt><samp class="option">s0</samp></dt>
  29266. <dd><p>Set source #0 component value.
  29267. </p>
  29268. </dd>
  29269. <dt><samp class="option">s1</samp></dt>
  29270. <dd><p>Set source #1 component value.
  29271. </p>
  29272. </dd>
  29273. <dt><samp class="option">s2</samp></dt>
  29274. <dd><p>Set source #2 component value.
  29275. </p>
  29276. </dd>
  29277. <dt><samp class="option">s3</samp></dt>
  29278. <dd><p>Set source #3 component value.
  29279. </p>
  29280. </dd>
  29281. <dt><samp class="option">d0</samp></dt>
  29282. <dd><p>Set destination #0 component value.
  29283. </p>
  29284. </dd>
  29285. <dt><samp class="option">d1</samp></dt>
  29286. <dd><p>Set destination #1 component value.
  29287. </p>
  29288. </dd>
  29289. <dt><samp class="option">d2</samp></dt>
  29290. <dd><p>Set destination #2 component value.
  29291. </p>
  29292. </dd>
  29293. <dt><samp class="option">d3</samp></dt>
  29294. <dd><p>Set destination #3 component value.
  29295. </p></dd>
  29296. </dl>
  29297. <a class="anchor" id="format"></a><a name="format-1"></a>
  29298. <h3 class="section">32.97 format<span class="pull-right"><a class="anchor hidden-xs" href="#format-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-format-1" aria-hidden="true">TOC</a></span></h3>
  29299. <p>Convert the input video to one of the specified pixel formats.
  29300. Libavfilter will try to pick one that is suitable as input to
  29301. the next filter.
  29302. </p>
  29303. <p>It accepts the following parameters:
  29304. </p><dl class="table">
  29305. <dt><samp class="option">pix_fmts</samp></dt>
  29306. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  29307. &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
  29308. </p>
  29309. </dd>
  29310. <dt><samp class="option">color_spaces</samp></dt>
  29311. <dd><p>A &rsquo;|&rsquo;-separated list of color space names, such as
  29312. &quot;color_spaces=bt709|bt470bg|bt2020nc&quot;.
  29313. </p>
  29314. </dd>
  29315. <dt><samp class="option">color_ranges</samp></dt>
  29316. <dd><p>A &rsquo;|&rsquo;-separated list of color range names, such as
  29317. &quot;color_ranges=tv|pc&quot;.
  29318. </p>
  29319. </dd>
  29320. <dt><samp class="option">alpha_modes</samp></dt>
  29321. <dd><p>A &rsquo;|&rsquo;-separated list of color range names, such as
  29322. &quot;alpha_modes=straight|premultiplied&quot;.
  29323. </p>
  29324. </dd>
  29325. </dl>
  29326. <a name="Examples-97"></a>
  29327. <h4 class="subsection">32.97.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-97" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-97" aria-hidden="true">TOC</a></span></h4>
  29328. <ul class="itemize mark-bullet">
  29329. <li>Convert the input video to the <var class="var">yuv420p</var> format
  29330. <div class="example">
  29331. <pre class="example-preformatted">format=pix_fmts=yuv420p
  29332. </pre></div>
  29333. <p>Convert the input video to any of the formats in the list
  29334. </p><div class="example">
  29335. <pre class="example-preformatted">format=pix_fmts=yuv420p|yuv444p|yuv410p
  29336. </pre></div>
  29337. </li></ul>
  29338. <a class="anchor" id="fps"></a><a name="fps-1"></a>
  29339. <h3 class="section">32.98 fps<span class="pull-right"><a class="anchor hidden-xs" href="#fps-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fps-1" aria-hidden="true">TOC</a></span></h3>
  29340. <p>Convert the video to specified constant frame rate by duplicating or dropping
  29341. frames as necessary.
  29342. </p>
  29343. <p>It accepts the following parameters:
  29344. </p><dl class="table">
  29345. <dt><samp class="option">fps</samp></dt>
  29346. <dd><p>The desired output frame rate. It accepts expressions containing the following
  29347. constants:
  29348. </p>
  29349. <dl class="table">
  29350. <dt>&lsquo;<samp class="samp">source_fps</samp>&rsquo;</dt>
  29351. <dd><p>The input&rsquo;s frame rate
  29352. </p>
  29353. </dd>
  29354. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  29355. <dd><p>NTSC frame rate of <code class="code">30000/1001</code>
  29356. </p>
  29357. </dd>
  29358. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  29359. <dd><p>PAL frame rate of <code class="code">25.0</code>
  29360. </p>
  29361. </dd>
  29362. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  29363. <dd><p>Film frame rate of <code class="code">24.0</code>
  29364. </p>
  29365. </dd>
  29366. <dt>&lsquo;<samp class="samp">ntsc_film</samp>&rsquo;</dt>
  29367. <dd><p>NTSC-film frame rate of <code class="code">24000/1001</code>
  29368. </p></dd>
  29369. </dl>
  29370. <p>The default is <code class="code">25</code>.
  29371. </p>
  29372. </dd>
  29373. <dt><samp class="option">start_time</samp></dt>
  29374. <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
  29375. padding/trimming at the start of stream. By default, no assumption is made
  29376. about the first frame&rsquo;s expected PTS, so no padding or trimming is done.
  29377. For example, this could be set to 0 to pad the beginning with duplicates of
  29378. the first frame if a video stream starts after the audio stream or to trim any
  29379. frames with a negative PTS.
  29380. </p>
  29381. </dd>
  29382. <dt><samp class="option">round</samp></dt>
  29383. <dd><p>Timestamp (PTS) rounding method.
  29384. </p>
  29385. <p>Possible values are:
  29386. </p><dl class="table">
  29387. <dt><samp class="option">zero</samp></dt>
  29388. <dd><p>round towards 0
  29389. </p></dd>
  29390. <dt><samp class="option">inf</samp></dt>
  29391. <dd><p>round away from 0
  29392. </p></dd>
  29393. <dt><samp class="option">down</samp></dt>
  29394. <dd><p>round towards -infinity
  29395. </p></dd>
  29396. <dt><samp class="option">up</samp></dt>
  29397. <dd><p>round towards +infinity
  29398. </p></dd>
  29399. <dt><samp class="option">near</samp></dt>
  29400. <dd><p>round to nearest
  29401. </p></dd>
  29402. </dl>
  29403. <p>The default is <code class="code">near</code>.
  29404. </p>
  29405. </dd>
  29406. <dt><samp class="option">eof_action</samp></dt>
  29407. <dd><p>Action performed when reading the last frame.
  29408. </p>
  29409. <p>Possible values are:
  29410. </p><dl class="table">
  29411. <dt><samp class="option">round</samp></dt>
  29412. <dd><p>Use same timestamp rounding method as used for other frames.
  29413. </p></dd>
  29414. <dt><samp class="option">pass</samp></dt>
  29415. <dd><p>Pass through last frame if input duration has not been reached yet.
  29416. </p></dd>
  29417. </dl>
  29418. <p>The default is <code class="code">round</code>.
  29419. </p>
  29420. </dd>
  29421. </dl>
  29422. <p>Alternatively, the options can be specified as a flat string:
  29423. <var class="var">fps</var>[:<var class="var">start_time</var>[:<var class="var">round</var>]].
  29424. </p>
  29425. <p>See also the <a class="ref" href="#setpts">setpts</a> filter.
  29426. </p>
  29427. <a name="Examples-98"></a>
  29428. <h4 class="subsection">32.98.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-98" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-98" aria-hidden="true">TOC</a></span></h4>
  29429. <ul class="itemize mark-bullet">
  29430. <li>A typical usage in order to set the fps to 25:
  29431. <div class="example">
  29432. <pre class="example-preformatted">fps=fps=25
  29433. </pre></div>
  29434. </li><li>Sets the fps to 24, using abbreviation and rounding method to round to nearest:
  29435. <div class="example">
  29436. <pre class="example-preformatted">fps=fps=film:round=near
  29437. </pre></div>
  29438. </li></ul>
  29439. <a name="framepack"></a>
  29440. <h3 class="section">32.99 framepack<span class="pull-right"><a class="anchor hidden-xs" href="#framepack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framepack" aria-hidden="true">TOC</a></span></h3>
  29441. <p>Pack two different video streams into a stereoscopic video, setting proper
  29442. metadata on supported codecs. The two views should have the same size and
  29443. framerate and processing will stop when the shorter video ends. Please note
  29444. that you may conveniently adjust view properties with the <a class="ref" href="#scale">scale</a> and
  29445. <a class="ref" href="#fps">fps</a> filters.
  29446. </p>
  29447. <p>It accepts the following parameters:
  29448. </p><dl class="table">
  29449. <dt><samp class="option">format</samp></dt>
  29450. <dd><p>The desired packing format. Supported values are:
  29451. </p>
  29452. <dl class="table">
  29453. <dt><samp class="option">sbs</samp></dt>
  29454. <dd><p>The views are next to each other (default).
  29455. </p>
  29456. </dd>
  29457. <dt><samp class="option">tab</samp></dt>
  29458. <dd><p>The views are on top of each other.
  29459. </p>
  29460. </dd>
  29461. <dt><samp class="option">lines</samp></dt>
  29462. <dd><p>The views are packed by line.
  29463. </p>
  29464. </dd>
  29465. <dt><samp class="option">columns</samp></dt>
  29466. <dd><p>The views are packed by column.
  29467. </p>
  29468. </dd>
  29469. <dt><samp class="option">frameseq</samp></dt>
  29470. <dd><p>The views are temporally interleaved.
  29471. </p>
  29472. </dd>
  29473. </dl>
  29474. </dd>
  29475. </dl>
  29476. <p>Some examples:
  29477. </p>
  29478. <div class="example">
  29479. <pre class="example-preformatted"># Convert left and right views into a frame-sequential video
  29480. ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
  29481. # Convert views into a side-by-side video with the same output resolution as the input
  29482. 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
  29483. </pre></div>
  29484. <a name="framerate"></a>
  29485. <h3 class="section">32.100 framerate<span class="pull-right"><a class="anchor hidden-xs" href="#framerate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framerate" aria-hidden="true">TOC</a></span></h3>
  29486. <p>Change the frame rate by interpolating new video output frames from the source
  29487. frames.
  29488. </p>
  29489. <p>This filter is not designed to function correctly with interlaced media. If
  29490. you wish to change the frame rate of interlaced media then you are required
  29491. to deinterlace before this filter and re-interlace after this filter.
  29492. </p>
  29493. <p>A description of the accepted options follows.
  29494. </p>
  29495. <dl class="table">
  29496. <dt><samp class="option">fps</samp></dt>
  29497. <dd><p>Specify the output frames per second. This option can also be specified
  29498. as a value alone. The default is <code class="code">50</code>.
  29499. </p>
  29500. </dd>
  29501. <dt><samp class="option">interp_start</samp></dt>
  29502. <dd><p>Specify the start of a range where the output frame will be created as a
  29503. linear interpolation of two frames. The range is [<code class="code">0</code>-<code class="code">255</code>],
  29504. the default is <code class="code">15</code>.
  29505. </p>
  29506. </dd>
  29507. <dt><samp class="option">interp_end</samp></dt>
  29508. <dd><p>Specify the end of a range where the output frame will be created as a
  29509. linear interpolation of two frames. The range is [<code class="code">0</code>-<code class="code">255</code>],
  29510. the default is <code class="code">240</code>.
  29511. </p>
  29512. </dd>
  29513. <dt><samp class="option">scene</samp></dt>
  29514. <dd><p>Specify the level at which a scene change is detected as a value between
  29515. 0 and 100 to indicate a new scene; a low value reflects a low
  29516. probability for the current frame to introduce a new scene, while a higher
  29517. value means the current frame is more likely to be one.
  29518. The default is <code class="code">8.2</code>.
  29519. </p>
  29520. </dd>
  29521. <dt><samp class="option">flags</samp></dt>
  29522. <dd><p>Specify flags influencing the filter process.
  29523. </p>
  29524. <p>Available value for <var class="var">flags</var> is:
  29525. </p>
  29526. <dl class="table">
  29527. <dt><samp class="option">scene_change_detect, scd</samp></dt>
  29528. <dd><p>Enable scene change detection using the value of the option <var class="var">scene</var>.
  29529. This flag is enabled by default.
  29530. </p></dd>
  29531. </dl>
  29532. </dd>
  29533. </dl>
  29534. <a name="framestep"></a>
  29535. <h3 class="section">32.101 framestep<span class="pull-right"><a class="anchor hidden-xs" href="#framestep" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framestep" aria-hidden="true">TOC</a></span></h3>
  29536. <p>Select one frame every N-th frame.
  29537. </p>
  29538. <p>This filter accepts the following option:
  29539. </p><dl class="table">
  29540. <dt><samp class="option">step</samp></dt>
  29541. <dd><p>Select frame after every <code class="code">step</code> frames.
  29542. Allowed values are positive integers higher than 0. Default value is <code class="code">1</code>.
  29543. </p></dd>
  29544. </dl>
  29545. <a name="freezedetect"></a>
  29546. <h3 class="section">32.102 freezedetect<span class="pull-right"><a class="anchor hidden-xs" href="#freezedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-freezedetect" aria-hidden="true">TOC</a></span></h3>
  29547. <p>Detect frozen video.
  29548. </p>
  29549. <p>This filter logs a message and sets frame metadata when it detects that the
  29550. input video has no significant change in content during a specified duration.
  29551. Video freeze detection calculates the mean average absolute difference of all
  29552. the components of video frames and compares it to a noise floor.
  29553. </p>
  29554. <p>The printed times and duration are expressed in seconds. The
  29555. <code class="code">lavfi.freezedetect.freeze_start</code> metadata key is set on the first frame
  29556. whose timestamp equals or exceeds the detection duration and it contains the
  29557. timestamp of the first frame of the freeze. The
  29558. <code class="code">lavfi.freezedetect.freeze_duration</code> and
  29559. <code class="code">lavfi.freezedetect.freeze_end</code> metadata keys are set on the first frame
  29560. after the freeze.
  29561. </p>
  29562. <p>The filter accepts the following options:
  29563. </p>
  29564. <dl class="table">
  29565. <dt><samp class="option">noise, n</samp></dt>
  29566. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  29567. specified value) or as a difference ratio between 0 and 1. Default is -60dB, or
  29568. 0.001.
  29569. </p>
  29570. </dd>
  29571. <dt><samp class="option">duration, d</samp></dt>
  29572. <dd><p>Set freeze duration until notification (default is 2 seconds).
  29573. </p></dd>
  29574. </dl>
  29575. <a name="freezeframes"></a>
  29576. <h3 class="section">32.103 freezeframes<span class="pull-right"><a class="anchor hidden-xs" href="#freezeframes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-freezeframes" aria-hidden="true">TOC</a></span></h3>
  29577. <p>Freeze video frames.
  29578. </p>
  29579. <p>This filter freezes video frames using frame from 2nd input.
  29580. </p>
  29581. <p>The filter accepts the following options:
  29582. </p>
  29583. <dl class="table">
  29584. <dt><samp class="option">first</samp></dt>
  29585. <dd><p>Set number of first frame from which to start freeze.
  29586. </p>
  29587. </dd>
  29588. <dt><samp class="option">last</samp></dt>
  29589. <dd><p>Set number of last frame from which to end freeze.
  29590. </p>
  29591. </dd>
  29592. <dt><samp class="option">replace</samp></dt>
  29593. <dd><p>Set number of frame from 2nd input which will be used instead of replaced frames.
  29594. </p></dd>
  29595. </dl>
  29596. <a class="anchor" id="frei0r"></a><a name="frei0r-1"></a>
  29597. <h3 class="section">32.104 frei0r<span class="pull-right"><a class="anchor hidden-xs" href="#frei0r-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-frei0r-1" aria-hidden="true">TOC</a></span></h3>
  29598. <p>Apply a frei0r effect to the input video.
  29599. </p>
  29600. <p>To enable the compilation of this filter, you need to install the frei0r
  29601. header and configure FFmpeg with <code class="code">--enable-frei0r</code>.
  29602. </p>
  29603. <p>It accepts the following parameters:
  29604. </p>
  29605. <dl class="table">
  29606. <dt><samp class="option">filter_name</samp></dt>
  29607. <dd><p>The name of the frei0r effect to load. If the environment variable
  29608. <code class="env">FREI0R_PATH</code> is defined, the frei0r effect is searched for in each of the
  29609. directories specified by the colon-separated list in <code class="env">FREI0R_PATH</code>.
  29610. Otherwise, the standard frei0r paths are searched, in this order:
  29611. <samp class="file">HOME/.frei0r-1/lib/</samp>, <samp class="file">/usr/local/lib/frei0r-1/</samp>,
  29612. <samp class="file">/usr/lib/frei0r-1/</samp>.
  29613. </p>
  29614. </dd>
  29615. <dt><samp class="option">filter_params</samp></dt>
  29616. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
  29617. </p>
  29618. </dd>
  29619. </dl>
  29620. <p>A frei0r effect parameter can be a boolean (its value is either
  29621. &quot;y&quot; or &quot;n&quot;), a double, a color (specified as
  29622. <var class="var">R</var>/<var class="var">G</var>/<var class="var">B</var>, where <var class="var">R</var>, <var class="var">G</var>, and <var class="var">B</var> are floating point
  29623. numbers between 0.0 and 1.0, inclusive) or a color description as specified in the
  29624. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>,
  29625. a position (specified as <var class="var">X</var>/<var class="var">Y</var>, where
  29626. <var class="var">X</var> and <var class="var">Y</var> are floating point numbers) and/or a string.
  29627. </p>
  29628. <p>The number and types of parameters depend on the loaded effect. If an
  29629. effect parameter is not specified, the default value is set.
  29630. </p>
  29631. <a name="Examples-99"></a>
  29632. <h4 class="subsection">32.104.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-99" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-99" aria-hidden="true">TOC</a></span></h4>
  29633. <ul class="itemize mark-bullet">
  29634. <li>Apply the distort0r effect, setting the first two double parameters:
  29635. <div class="example">
  29636. <pre class="example-preformatted">frei0r=filter_name=distort0r:filter_params=0.5|0.01
  29637. </pre></div>
  29638. </li><li>Apply the colordistance effect, taking a color as the first parameter:
  29639. <div class="example">
  29640. <pre class="example-preformatted">frei0r=colordistance:0.2/0.3/0.4
  29641. frei0r=colordistance:violet
  29642. frei0r=colordistance:0x112233
  29643. </pre></div>
  29644. </li><li>Apply the perspective effect, specifying the top left and top right image
  29645. positions:
  29646. <div class="example">
  29647. <pre class="example-preformatted">frei0r=perspective:0.2/0.2|0.8/0.2
  29648. </pre></div>
  29649. </li></ul>
  29650. <p>For more information, see
  29651. <a class="url" href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
  29652. </p>
  29653. <a name="Commands-94"></a>
  29654. <h4 class="subsection">32.104.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-94" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-94" aria-hidden="true">TOC</a></span></h4>
  29655. <p>This filter supports the <samp class="option">filter_params</samp> option as <a class="ref" href="#commands">commands</a>.
  29656. </p>
  29657. <a name="fspp"></a>
  29658. <h3 class="section">32.105 fspp<span class="pull-right"><a class="anchor hidden-xs" href="#fspp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fspp" aria-hidden="true">TOC</a></span></h3>
  29659. <p>Apply fast and simple postprocessing. It is a faster version of <a class="ref" href="#spp">spp</a>.
  29660. </p>
  29661. <p>It splits (I)DCT into horizontal/vertical passes. Unlike the simple post-
  29662. processing filter, one of them is performed once per block, not per pixel.
  29663. This allows for much higher speed.
  29664. </p>
  29665. <p>The filter accepts the following options:
  29666. </p>
  29667. <dl class="table">
  29668. <dt><samp class="option">quality</samp></dt>
  29669. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  29670. an integer in the range 4-5. Default value is <code class="code">4</code>.
  29671. </p>
  29672. </dd>
  29673. <dt><samp class="option">qp</samp></dt>
  29674. <dd><p>Force a constant quantization parameter. It accepts an integer in range 0-63.
  29675. If not set, the filter will use the QP from the video stream (if available).
  29676. </p>
  29677. </dd>
  29678. <dt><samp class="option">strength</samp></dt>
  29679. <dd><p>Set filter strength. It accepts an integer in range -15 to 32. Lower values mean
  29680. more details but also more artifacts, while higher values make the image smoother
  29681. but also blurrier. Default value is <code class="code">0</code> − PSNR optimal.
  29682. </p>
  29683. </dd>
  29684. <dt><samp class="option">use_bframe_qp</samp></dt>
  29685. <dd><p>Enable the use of the QP from the B-Frames if set to <code class="code">1</code>. Using this
  29686. option may cause flicker since the B-Frames have often larger QP. Default is
  29687. <code class="code">0</code> (not enabled).
  29688. </p>
  29689. </dd>
  29690. </dl>
  29691. <a class="anchor" id="fsync"></a><a name="fsync-1"></a>
  29692. <h3 class="section">32.106 fsync<span class="pull-right"><a class="anchor hidden-xs" href="#fsync-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fsync-1" aria-hidden="true">TOC</a></span></h3>
  29693. <p>Synchronize video frames with an external mapping from a file.
  29694. </p>
  29695. <p>For each input PTS given in the map file it either drops or creates as many
  29696. frames as necessary to recreate the sequence of output frames given in the
  29697. map file.
  29698. </p>
  29699. <p>This filter is useful to recreate the output frames of a framerate conversion
  29700. by the <a class="ref" href="#fps">fps</a> filter, recorded into a map file using the ffmpeg option
  29701. <code class="code">-stats_mux_pre</code>, and do further processing to the corresponding frames
  29702. e.g. quality comparison.
  29703. </p>
  29704. <p>Each line of the map file must contain three items per input frame, the input
  29705. PTS (decimal), the output PTS (decimal) and the
  29706. output TIMEBASE (decimal/decimal), separated by a space.
  29707. This file format corresponds to the output
  29708. of <code class="code">-stats_mux_pre_fmt=&quot;{ptsi} {pts} {tb}&quot;</code>.
  29709. </p>
  29710. <p>The filter assumes the map file is sorted by increasing input PTS.
  29711. </p>
  29712. <p>The filter accepts the following options:
  29713. </p><dl class="table">
  29714. <dt><samp class="option">file, f</samp></dt>
  29715. <dd><p>The filename of the map file to be used.
  29716. </p></dd>
  29717. </dl>
  29718. <p>Example:
  29719. </p><div class="example">
  29720. <pre class="example-preformatted"># Convert a video to 25 fps and record a MAP_FILE file with the default format of this filter
  29721. ffmpeg -i INPUT -vf fps=fps=25 -stats_mux_pre MAP_FILE -stats_mux_pre_fmt &quot;{ptsi} {pts} {tb}&quot; OUTPUT
  29722. # Sort MAP_FILE by increasing input PTS
  29723. sort -n MAP_FILE
  29724. # Use INPUT, OUTPUT and the MAP_FILE from above to compare the corresponding frames in INPUT and OUTPUT via SSIM
  29725. ffmpeg -i INPUT -i OUTPUT -filter_complex '[0:v]fsync=file=MAP_FILE[ref];[1:v][ref]ssim' -f null -
  29726. </pre></div>
  29727. <a name="gblur"></a>
  29728. <h3 class="section">32.107 gblur<span class="pull-right"><a class="anchor hidden-xs" href="#gblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gblur" aria-hidden="true">TOC</a></span></h3>
  29729. <p>Apply Gaussian blur filter.
  29730. </p>
  29731. <p>The filter accepts the following options:
  29732. </p>
  29733. <dl class="table">
  29734. <dt><samp class="option">sigma</samp></dt>
  29735. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code class="code">0.5</code>.
  29736. </p>
  29737. </dd>
  29738. <dt><samp class="option">steps</samp></dt>
  29739. <dd><p>Set number of steps for Gaussian approximation. Default is <code class="code">1</code>.
  29740. </p>
  29741. </dd>
  29742. <dt><samp class="option">planes</samp></dt>
  29743. <dd><p>Set which planes to filter. By default all planes are filtered.
  29744. </p>
  29745. </dd>
  29746. <dt><samp class="option">sigmaV</samp></dt>
  29747. <dd><p>Set vertical sigma, if negative it will be same as <code class="code">sigma</code>.
  29748. Default is <code class="code">-1</code>.
  29749. </p></dd>
  29750. </dl>
  29751. <a name="Commands-95"></a>
  29752. <h4 class="subsection">32.107.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-95" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-95" aria-hidden="true">TOC</a></span></h4>
  29753. <p>This filter supports same commands as options.
  29754. The command accepts the same syntax of the corresponding option.
  29755. </p>
  29756. <p>If the specified expression is not valid, it is kept at its current
  29757. value.
  29758. </p>
  29759. <a name="geq"></a>
  29760. <h3 class="section">32.108 geq<span class="pull-right"><a class="anchor hidden-xs" href="#geq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-geq" aria-hidden="true">TOC</a></span></h3>
  29761. <p>Apply generic equation to each pixel.
  29762. </p>
  29763. <p>The filter accepts the following options:
  29764. </p>
  29765. <dl class="table">
  29766. <dt><samp class="option">lum_expr, lum</samp></dt>
  29767. <dd><p>Set the luma expression.
  29768. </p></dd>
  29769. <dt><samp class="option">cb_expr, cb</samp></dt>
  29770. <dd><p>Set the chrominance blue expression.
  29771. </p></dd>
  29772. <dt><samp class="option">cr_expr, cr</samp></dt>
  29773. <dd><p>Set the chrominance red expression.
  29774. </p></dd>
  29775. <dt><samp class="option">alpha_expr, a</samp></dt>
  29776. <dd><p>Set the alpha expression.
  29777. </p></dd>
  29778. <dt><samp class="option">red_expr, r</samp></dt>
  29779. <dd><p>Set the red expression.
  29780. </p></dd>
  29781. <dt><samp class="option">green_expr, g</samp></dt>
  29782. <dd><p>Set the green expression.
  29783. </p></dd>
  29784. <dt><samp class="option">blue_expr, b</samp></dt>
  29785. <dd><p>Set the blue expression.
  29786. </p></dd>
  29787. </dl>
  29788. <p>The colorspace is selected according to the specified options. If one
  29789. of the <samp class="option">lum_expr</samp>, <samp class="option">cb_expr</samp>, or <samp class="option">cr_expr</samp>
  29790. options is specified, the filter will automatically select a YCbCr
  29791. colorspace. If one of the <samp class="option">red_expr</samp>, <samp class="option">green_expr</samp>, or
  29792. <samp class="option">blue_expr</samp> options is specified, it will select an RGB
  29793. colorspace.
  29794. </p>
  29795. <p>If one of the chrominance expression is not defined, it falls back on the other
  29796. one. If no alpha expression is specified it will evaluate to opaque value.
  29797. If none of chrominance expressions are specified, they will evaluate
  29798. to the luma expression.
  29799. </p>
  29800. <p>The expressions can use the following variables and functions:
  29801. </p>
  29802. <dl class="table">
  29803. <dt><samp class="option">N</samp></dt>
  29804. <dd><p>The sequential number of the filtered frame, starting from <code class="code">0</code>.
  29805. </p>
  29806. </dd>
  29807. <dt><samp class="option">X</samp></dt>
  29808. <dt><samp class="option">Y</samp></dt>
  29809. <dd><p>The coordinates of the current sample.
  29810. </p>
  29811. </dd>
  29812. <dt><samp class="option">W</samp></dt>
  29813. <dt><samp class="option">H</samp></dt>
  29814. <dd><p>The width and height of the image.
  29815. </p>
  29816. </dd>
  29817. <dt><samp class="option">SW</samp></dt>
  29818. <dt><samp class="option">SH</samp></dt>
  29819. <dd><p>Width and height scale depending on the currently filtered plane. It is the
  29820. ratio between the corresponding luma plane number of pixels and the current
  29821. plane ones. E.g. for YUV4:2:0 the values are <code class="code">1,1</code> for the luma plane, and
  29822. <code class="code">0.5,0.5</code> for chroma planes.
  29823. </p>
  29824. </dd>
  29825. <dt><samp class="option">T</samp></dt>
  29826. <dd><p>Time of the current frame, expressed in seconds.
  29827. </p>
  29828. </dd>
  29829. <dt><samp class="option">p(x, y)</samp></dt>
  29830. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the current
  29831. plane.
  29832. </p>
  29833. </dd>
  29834. <dt><samp class="option">lum(x, y)</samp></dt>
  29835. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the luma
  29836. plane.
  29837. </p>
  29838. </dd>
  29839. <dt><samp class="option">cb(x, y)</samp></dt>
  29840. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  29841. blue-difference chroma plane. Return 0 if there is no such plane.
  29842. </p>
  29843. </dd>
  29844. <dt><samp class="option">cr(x, y)</samp></dt>
  29845. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  29846. red-difference chroma plane. Return 0 if there is no such plane.
  29847. </p>
  29848. </dd>
  29849. <dt><samp class="option">r(x, y)</samp></dt>
  29850. <dt><samp class="option">g(x, y)</samp></dt>
  29851. <dt><samp class="option">b(x, y)</samp></dt>
  29852. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  29853. red/green/blue component. Return 0 if there is no such component.
  29854. </p>
  29855. </dd>
  29856. <dt><samp class="option">alpha(x, y)</samp></dt>
  29857. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the alpha
  29858. plane. Return 0 if there is no such plane.
  29859. </p>
  29860. </dd>
  29861. <dt><samp class="option">psum(x,y), lumsum(x, y), cbsum(x,y), crsum(x,y), rsum(x,y), gsum(x,y), bsum(x,y), alphasum(x,y)</samp></dt>
  29862. <dd><p>Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining
  29863. sums of samples within a rectangle. See the functions without the sum postfix.
  29864. </p>
  29865. </dd>
  29866. <dt><samp class="option">interpolation</samp></dt>
  29867. <dd><p>Set one of interpolation methods:
  29868. </p><dl class="table">
  29869. <dt><samp class="option">nearest, n</samp></dt>
  29870. <dt><samp class="option">bilinear, b</samp></dt>
  29871. </dl>
  29872. <p>Default is bilinear.
  29873. </p></dd>
  29874. </dl>
  29875. <p>For functions, if <var class="var">x</var> and <var class="var">y</var> are outside the area, the value will be
  29876. automatically clipped to the closer edge.
  29877. </p>
  29878. <p>Please note that this filter can use multiple threads in which case each slice
  29879. will have its own expression state. If you want to use only a single expression
  29880. state because your expressions depend on previous state then you should limit
  29881. the number of filter threads to 1.
  29882. </p>
  29883. <a name="Examples-100"></a>
  29884. <h4 class="subsection">32.108.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-100" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-100" aria-hidden="true">TOC</a></span></h4>
  29885. <ul class="itemize mark-bullet">
  29886. <li>Flip the image horizontally:
  29887. <div class="example">
  29888. <pre class="example-preformatted">geq=p(W-X\,Y)
  29889. </pre></div>
  29890. </li><li>Generate a bidimensional sine wave, with angle <code class="code">PI/3</code> and a
  29891. wavelength of 100 pixels:
  29892. <div class="example">
  29893. <pre class="example-preformatted">geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
  29894. </pre></div>
  29895. </li><li>Generate a fancy enigmatic moving light:
  29896. <div class="example">
  29897. <pre class="example-preformatted">nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128
  29898. </pre></div>
  29899. </li><li>Generate a quick emboss effect:
  29900. <div class="example">
  29901. <pre class="example-preformatted">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
  29902. </pre></div>
  29903. </li><li>Modify RGB components depending on pixel position:
  29904. <div class="example">
  29905. <pre class="example-preformatted">geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
  29906. </pre></div>
  29907. </li><li>Create a radial gradient that is the same size as the input (also see
  29908. the <a class="ref" href="#vignette">vignette</a> filter):
  29909. <div class="example">
  29910. <pre class="example-preformatted">geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
  29911. </pre></div>
  29912. </li></ul>
  29913. <a name="gradfun"></a>
  29914. <h3 class="section">32.109 gradfun<span class="pull-right"><a class="anchor hidden-xs" href="#gradfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gradfun" aria-hidden="true">TOC</a></span></h3>
  29915. <p>Fix the banding artifacts that are sometimes introduced into nearly flat
  29916. regions by truncation to 8-bit color depth.
  29917. Interpolate the gradients that should go where the bands are, and
  29918. dither them.
  29919. </p>
  29920. <p>It is designed for playback only. Do not use it prior to
  29921. lossy compression, because compression tends to lose the dither and
  29922. bring back the bands.
  29923. </p>
  29924. <p>It accepts the following parameters:
  29925. </p>
  29926. <dl class="table">
  29927. <dt><samp class="option">strength</samp></dt>
  29928. <dd><p>The maximum amount by which the filter will change any one pixel. This is also
  29929. the threshold for detecting nearly flat regions. Acceptable values range from
  29930. .51 to 64; the default value is 1.2. Out-of-range values will be clipped to the
  29931. valid range.
  29932. </p>
  29933. </dd>
  29934. <dt><samp class="option">radius</samp></dt>
  29935. <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
  29936. gradients, but also prevents the filter from modifying the pixels near detailed
  29937. regions. Acceptable values are 8-32; the default value is 16. Out-of-range
  29938. values will be clipped to the valid range.
  29939. </p>
  29940. </dd>
  29941. </dl>
  29942. <p>Alternatively, the options can be specified as a flat string:
  29943. <var class="var">strength</var>[:<var class="var">radius</var>]
  29944. </p>
  29945. <a name="Examples-101"></a>
  29946. <h4 class="subsection">32.109.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-101" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-101" aria-hidden="true">TOC</a></span></h4>
  29947. <ul class="itemize mark-bullet">
  29948. <li>Apply the filter with a <code class="code">3.5</code> strength and radius of <code class="code">8</code>:
  29949. <div class="example">
  29950. <pre class="example-preformatted">gradfun=3.5:8
  29951. </pre></div>
  29952. </li><li>Specify radius, omitting the strength (which will fall-back to the default
  29953. value):
  29954. <div class="example">
  29955. <pre class="example-preformatted">gradfun=radius=8
  29956. </pre></div>
  29957. </li></ul>
  29958. <a class="anchor" id="graphmonitor"></a><a name="graphmonitor-1"></a>
  29959. <h3 class="section">32.110 graphmonitor<span class="pull-right"><a class="anchor hidden-xs" href="#graphmonitor-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-graphmonitor-1" aria-hidden="true">TOC</a></span></h3>
  29960. <p>Show various filtergraph stats.
  29961. </p>
  29962. <p>With this filter one can debug complete filtergraph.
  29963. Especially issues with links filling with queued frames.
  29964. </p>
  29965. <p>The filter accepts the following options:
  29966. </p>
  29967. <dl class="table">
  29968. <dt><samp class="option">size, s</samp></dt>
  29969. <dd><p>Set video output size. Default is <var class="var">hd720</var>.
  29970. </p>
  29971. </dd>
  29972. <dt><samp class="option">opacity, o</samp></dt>
  29973. <dd><p>Set video opacity. Default is <var class="var">0.9</var>. Allowed range is from <var class="var">0</var> to <var class="var">1</var>.
  29974. </p>
  29975. </dd>
  29976. <dt><samp class="option">mode, m</samp></dt>
  29977. <dd><p>Set output mode flags.
  29978. </p>
  29979. <p>Available values for flags are:
  29980. </p><dl class="table">
  29981. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  29982. <dd><p>No any filtering. Default.
  29983. </p></dd>
  29984. <dt>&lsquo;<samp class="samp">compact</samp>&rsquo;</dt>
  29985. <dd><p>Show only filters with queued frames.
  29986. </p></dd>
  29987. <dt>&lsquo;<samp class="samp">nozero</samp>&rsquo;</dt>
  29988. <dd><p>Show only filters with non-zero stats.
  29989. </p></dd>
  29990. <dt>&lsquo;<samp class="samp">noeof</samp>&rsquo;</dt>
  29991. <dd><p>Show only filters with non-eof stat.
  29992. </p></dd>
  29993. <dt>&lsquo;<samp class="samp">nodisabled</samp>&rsquo;</dt>
  29994. <dd><p>Show only filters that are enabled in timeline.
  29995. </p></dd>
  29996. </dl>
  29997. </dd>
  29998. <dt><samp class="option">flags, f</samp></dt>
  29999. <dd><p>Set flags which enable which stats are shown in video.
  30000. </p>
  30001. <p>Available values for flags are:
  30002. </p><dl class="table">
  30003. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  30004. <dd><p>All flags turned off.
  30005. </p>
  30006. </dd>
  30007. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  30008. <dd><p>All flags turned on.
  30009. </p>
  30010. </dd>
  30011. <dt>&lsquo;<samp class="samp">queue</samp>&rsquo;</dt>
  30012. <dd><p>Display number of queued frames in each link.
  30013. </p>
  30014. </dd>
  30015. <dt>&lsquo;<samp class="samp">frame_count_in</samp>&rsquo;</dt>
  30016. <dd><p>Display number of frames taken from filter.
  30017. </p>
  30018. </dd>
  30019. <dt>&lsquo;<samp class="samp">frame_count_out</samp>&rsquo;</dt>
  30020. <dd><p>Display number of frames given out from filter.
  30021. </p>
  30022. </dd>
  30023. <dt>&lsquo;<samp class="samp">frame_count_delta</samp>&rsquo;</dt>
  30024. <dd><p>Display delta number of frames between above two values.
  30025. </p>
  30026. </dd>
  30027. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  30028. <dd><p>Display current filtered frame pts.
  30029. </p>
  30030. </dd>
  30031. <dt>&lsquo;<samp class="samp">pts_delta</samp>&rsquo;</dt>
  30032. <dd><p>Display pts delta between current and previous frame.
  30033. </p>
  30034. </dd>
  30035. <dt>&lsquo;<samp class="samp">time</samp>&rsquo;</dt>
  30036. <dd><p>Display current filtered frame time.
  30037. </p>
  30038. </dd>
  30039. <dt>&lsquo;<samp class="samp">time_delta</samp>&rsquo;</dt>
  30040. <dd><p>Display time delta between current and previous frame.
  30041. </p>
  30042. </dd>
  30043. <dt>&lsquo;<samp class="samp">timebase</samp>&rsquo;</dt>
  30044. <dd><p>Display time base for filter link.
  30045. </p>
  30046. </dd>
  30047. <dt>&lsquo;<samp class="samp">format</samp>&rsquo;</dt>
  30048. <dd><p>Display used format for filter link.
  30049. </p>
  30050. </dd>
  30051. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  30052. <dd><p>Display video size or number of audio channels in case of audio used by filter link.
  30053. </p>
  30054. </dd>
  30055. <dt>&lsquo;<samp class="samp">rate</samp>&rsquo;</dt>
  30056. <dd><p>Display video frame rate or sample rate in case of audio used by filter link.
  30057. </p>
  30058. </dd>
  30059. <dt>&lsquo;<samp class="samp">eof</samp>&rsquo;</dt>
  30060. <dd><p>Display link output status.
  30061. </p>
  30062. </dd>
  30063. <dt>&lsquo;<samp class="samp">sample_count_in</samp>&rsquo;</dt>
  30064. <dd><p>Display number of samples taken from filter.
  30065. </p>
  30066. </dd>
  30067. <dt>&lsquo;<samp class="samp">sample_count_out</samp>&rsquo;</dt>
  30068. <dd><p>Display number of samples given out from filter.
  30069. </p>
  30070. </dd>
  30071. <dt>&lsquo;<samp class="samp">sample_count_delta</samp>&rsquo;</dt>
  30072. <dd><p>Display delta number of samples between above two values.
  30073. </p>
  30074. </dd>
  30075. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  30076. <dd><p>Show the timeline filter status.
  30077. </p></dd>
  30078. </dl>
  30079. </dd>
  30080. <dt><samp class="option">rate, r</samp></dt>
  30081. <dd><p>Set upper limit for video rate of output stream, Default value is <var class="var">25</var>.
  30082. This guarantee that output video frame rate will not be higher than this value.
  30083. </p></dd>
  30084. </dl>
  30085. <a name="grayworld"></a>
  30086. <h3 class="section">32.111 grayworld<span class="pull-right"><a class="anchor hidden-xs" href="#grayworld" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-grayworld" aria-hidden="true">TOC</a></span></h3>
  30087. <p>A color constancy filter that applies color correction based on the grayworld assumption
  30088. </p>
  30089. <p>See: <a class="url" href="https://www.researchgate.net/publication/275213614_A_New_Color_Correction_Method_for_Underwater_Imaging">https://www.researchgate.net/publication/275213614_A_New_Color_Correction_Method_for_Underwater_Imaging</a>
  30090. </p>
  30091. <p>The algorithm uses linear light, so input
  30092. data should be linearized beforehand (and possibly correctly tagged).
  30093. </p>
  30094. <div class="example">
  30095. <pre class="example-preformatted">ffmpeg -i INPUT -vf zscale=transfer=linear,grayworld,zscale=transfer=bt709,format=yuv420p OUTPUT
  30096. </pre></div>
  30097. <a name="greyedge"></a>
  30098. <h3 class="section">32.112 greyedge<span class="pull-right"><a class="anchor hidden-xs" href="#greyedge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-greyedge" aria-hidden="true">TOC</a></span></h3>
  30099. <p>A color constancy variation filter which estimates scene illumination via grey edge algorithm
  30100. and corrects the scene colors accordingly.
  30101. </p>
  30102. <p>See: <a class="url" href="https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf">https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf</a>
  30103. </p>
  30104. <p>The filter accepts the following options:
  30105. </p>
  30106. <dl class="table">
  30107. <dt><samp class="option">difford</samp></dt>
  30108. <dd><p>The order of differentiation to be applied on the scene. Must be chosen in the range
  30109. [0,2] and default value is 1.
  30110. </p>
  30111. </dd>
  30112. <dt><samp class="option">minknorm</samp></dt>
  30113. <dd><p>The Minkowski parameter to be used for calculating the Minkowski distance. Must
  30114. be chosen in the range [0,20] and default value is 1. Set to 0 for getting
  30115. max value instead of calculating Minkowski distance.
  30116. </p>
  30117. </dd>
  30118. <dt><samp class="option">sigma</samp></dt>
  30119. <dd><p>The standard deviation of Gaussian blur to be applied on the scene. Must be
  30120. chosen in the range [0,1024.0] and default value = 1. floor( <var class="var">sigma</var> * break_off_sigma(3) )
  30121. can&rsquo;t be equal to 0 if <var class="var">difford</var> is greater than 0.
  30122. </p></dd>
  30123. </dl>
  30124. <a name="Examples-102"></a>
  30125. <h4 class="subsection">32.112.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-102" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-102" aria-hidden="true">TOC</a></span></h4>
  30126. <ul class="itemize mark-bullet">
  30127. <li>Grey Edge:
  30128. <div class="example">
  30129. <pre class="example-preformatted">greyedge=difford=1:minknorm=5:sigma=2
  30130. </pre></div>
  30131. </li><li>Max Edge:
  30132. <div class="example">
  30133. <pre class="example-preformatted">greyedge=difford=1:minknorm=0:sigma=2
  30134. </pre></div>
  30135. </li></ul>
  30136. <a name="guided"></a>
  30137. <h3 class="section">32.113 guided<span class="pull-right"><a class="anchor hidden-xs" href="#guided" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-guided" aria-hidden="true">TOC</a></span></h3>
  30138. <p>Apply guided filter for edge-preserving smoothing, dehazing and so on.
  30139. </p>
  30140. <p>The filter accepts the following options:
  30141. </p><dl class="table">
  30142. <dt><samp class="option">radius</samp></dt>
  30143. <dd><p>Set the box radius in pixels.
  30144. Allowed range is 1 to 20. Default is 3.
  30145. </p>
  30146. </dd>
  30147. <dt><samp class="option">eps</samp></dt>
  30148. <dd><p>Set regularization parameter (with square).
  30149. Allowed range is 0 to 1. Default is 0.01.
  30150. </p>
  30151. </dd>
  30152. <dt><samp class="option">mode</samp></dt>
  30153. <dd><p>Set filter mode. Can be <code class="code">basic</code> or <code class="code">fast</code>.
  30154. Default is <code class="code">basic</code>.
  30155. </p>
  30156. </dd>
  30157. <dt><samp class="option">sub</samp></dt>
  30158. <dd><p>Set subsampling ratio for <code class="code">fast</code> mode.
  30159. Range is 2 to 64. Default is 4.
  30160. No subsampling occurs in <code class="code">basic</code> mode.
  30161. </p>
  30162. </dd>
  30163. <dt><samp class="option">guidance</samp></dt>
  30164. <dd><p>Set guidance mode. Can be <code class="code">off</code> or <code class="code">on</code>. Default is <code class="code">off</code>.
  30165. If <code class="code">off</code>, single input is required.
  30166. If <code class="code">on</code>, two inputs of the same resolution and pixel format are required.
  30167. The second input serves as the guidance.
  30168. </p>
  30169. </dd>
  30170. <dt><samp class="option">planes</samp></dt>
  30171. <dd><p>Set planes to filter. Default is first only.
  30172. </p></dd>
  30173. </dl>
  30174. <a name="Commands-96"></a>
  30175. <h4 class="subsection">32.113.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-96" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-96" aria-hidden="true">TOC</a></span></h4>
  30176. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  30177. </p>
  30178. <a name="Examples-103"></a>
  30179. <h4 class="subsection">32.113.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-103" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-103" aria-hidden="true">TOC</a></span></h4>
  30180. <ul class="itemize mark-bullet">
  30181. <li>Edge-preserving smoothing with guided filter:
  30182. <div class="example">
  30183. <pre class="example-preformatted">ffmpeg -i in.png -vf guided out.png
  30184. </pre></div>
  30185. </li><li>Dehazing, structure-transferring filtering, detail enhancement with guided filter.
  30186. For the generation of guidance image, refer to paper &quot;Guided Image Filtering&quot;.
  30187. See: <a class="url" href="http://kaiminghe.com/publications/pami12guidedfilter.pdf">http://kaiminghe.com/publications/pami12guidedfilter.pdf</a>.
  30188. <div class="example">
  30189. <pre class="example-preformatted">ffmpeg -i in.png -i guidance.png -filter_complex guided=guidance=on out.png
  30190. </pre></div>
  30191. </li></ul>
  30192. <a class="anchor" id="haldclut"></a><a name="haldclut-1"></a>
  30193. <h3 class="section">32.114 haldclut<span class="pull-right"><a class="anchor hidden-xs" href="#haldclut-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-haldclut-1" aria-hidden="true">TOC</a></span></h3>
  30194. <p>Apply a Hald CLUT to a video stream.
  30195. </p>
  30196. <p>First input is the video stream to process, and second one is the Hald CLUT.
  30197. The Hald CLUT input can be a simple picture or a complete video stream.
  30198. </p>
  30199. <p>The filter accepts the following options:
  30200. </p>
  30201. <dl class="table">
  30202. <dt><samp class="option">clut</samp></dt>
  30203. <dd><p>Set which CLUT video frames will be processed from second input stream,
  30204. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  30205. </p>
  30206. </dd>
  30207. <dt><samp class="option">shortest</samp></dt>
  30208. <dd><p>Force termination when the shortest input terminates. Default is <code class="code">0</code>.
  30209. </p></dd>
  30210. <dt><samp class="option">repeatlast</samp></dt>
  30211. <dd><p>Continue applying the last CLUT after the end of the stream. A value of
  30212. <code class="code">0</code> disable the filter after the last frame of the CLUT is reached.
  30213. Default is <code class="code">1</code>.
  30214. </p></dd>
  30215. </dl>
  30216. <p><code class="code">haldclut</code> also has the same interpolation options as <a class="ref" href="#lut3d">lut3d</a> (both
  30217. filters share the same internals).
  30218. </p>
  30219. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  30220. </p>
  30221. <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
  30222. (Hald CLUT author) at <a class="url" href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
  30223. </p>
  30224. <a name="Commands-97"></a>
  30225. <h4 class="subsection">32.114.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-97" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-97" aria-hidden="true">TOC</a></span></h4>
  30226. <p>This filter supports the <code class="code">interp</code> option as <a class="ref" href="#commands">commands</a>.
  30227. </p>
  30228. <a name="Workflow-examples"></a>
  30229. <h4 class="subsection">32.114.2 Workflow examples<span class="pull-right"><a class="anchor hidden-xs" href="#Workflow-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Workflow-examples" aria-hidden="true">TOC</a></span></h4>
  30230. <a name="Hald-CLUT-video-stream"></a>
  30231. <h4 class="subsubsection">32.114.2.1 Hald CLUT video stream<span class="pull-right"><a class="anchor hidden-xs" href="#Hald-CLUT-video-stream" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Hald-CLUT-video-stream" aria-hidden="true">TOC</a></span></h4>
  30232. <p>Generate an identity Hald CLUT stream altered with various effects:
  30233. </p><div class="example">
  30234. <pre class="example-preformatted">ffmpeg -f lavfi -i <a class="ref" href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;hue=H=2*PI*t:s=sin(2*PI*t)+1, curves=cross_process&quot; -t 10 -c:v ffv1 clut.nut
  30235. </pre></div>
  30236. <p>Note: make sure you use a lossless codec.
  30237. </p>
  30238. <p>Then use it with <code class="code">haldclut</code> to apply it on some random stream:
  30239. </p><div class="example">
  30240. <pre class="example-preformatted">ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
  30241. </pre></div>
  30242. <p>The Hald CLUT will be applied to the 10 first seconds (duration of
  30243. <samp class="file">clut.nut</samp>), then the latest picture of that CLUT stream will be applied
  30244. to the remaining frames of the <code class="code">mandelbrot</code> stream.
  30245. </p>
  30246. <a name="Hald-CLUT-with-preview"></a>
  30247. <h4 class="subsubsection">32.114.2.2 Hald CLUT with preview<span class="pull-right"><a class="anchor hidden-xs" href="#Hald-CLUT-with-preview" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Hald-CLUT-with-preview" aria-hidden="true">TOC</a></span></h4>
  30248. <p>A Hald CLUT is supposed to be a squared image of <code class="code">Level*Level*Level</code> by
  30249. <code class="code">Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
  30250. biggest possible square starting at the top left of the picture. The remaining
  30251. padding pixels (bottom or right) will be ignored. This area can be used to add
  30252. a preview of the Hald CLUT.
  30253. </p>
  30254. <p>Typically, the following generated Hald CLUT will be supported by the
  30255. <code class="code">haldclut</code> filter:
  30256. </p>
  30257. <div class="example">
  30258. <pre class="example-preformatted">ffmpeg -f lavfi -i <a class="ref" href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
  30259. pad=iw+320 [padded_clut];
  30260. smptebars=s=320x256, split [a][b];
  30261. [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
  30262. [main][b] overlay=W-320&quot; -frames:v 1 clut.png
  30263. </pre></div>
  30264. <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
  30265. bars are displayed on the right-top, and below the same color bars processed by
  30266. the color changes.
  30267. </p>
  30268. <p>Then, the effect of this Hald CLUT can be visualized with:
  30269. </p><div class="example">
  30270. <pre class="example-preformatted">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
  30271. </pre></div>
  30272. <a name="hflip"></a>
  30273. <h3 class="section">32.115 hflip<span class="pull-right"><a class="anchor hidden-xs" href="#hflip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hflip" aria-hidden="true">TOC</a></span></h3>
  30274. <p>Flip the input video horizontally.
  30275. </p>
  30276. <p>For example, to horizontally flip the input video with <code class="command">ffmpeg</code>:
  30277. </p><div class="example">
  30278. <pre class="example-preformatted">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
  30279. </pre></div>
  30280. <a name="histeq"></a>
  30281. <h3 class="section">32.116 histeq<span class="pull-right"><a class="anchor hidden-xs" href="#histeq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-histeq" aria-hidden="true">TOC</a></span></h3>
  30282. <p>This filter applies a global color histogram equalization on a
  30283. per-frame basis.
  30284. </p>
  30285. <p>It can be used to correct video that has a compressed range of pixel
  30286. intensities. The filter redistributes the pixel intensities to
  30287. equalize their distribution across the intensity range. It may be
  30288. viewed as an &quot;automatically adjusting contrast filter&quot;. This filter is
  30289. useful only for correcting degraded or poorly captured source
  30290. video.
  30291. </p>
  30292. <p>The filter accepts the following options:
  30293. </p>
  30294. <dl class="table">
  30295. <dt><samp class="option">strength</samp></dt>
  30296. <dd><p>Determine the amount of equalization to be applied. As the strength
  30297. is reduced, the distribution of pixel intensities more-and-more
  30298. approaches that of the input frame. The value must be a float number
  30299. in the range [0,1] and defaults to 0.200.
  30300. </p>
  30301. </dd>
  30302. <dt><samp class="option">intensity</samp></dt>
  30303. <dd><p>Set the maximum intensity that can generated and scale the output
  30304. values appropriately. The strength should be set as desired and then
  30305. the intensity can be limited if needed to avoid washing-out. The value
  30306. must be a float number in the range [0,1] and defaults to 0.210.
  30307. </p>
  30308. </dd>
  30309. <dt><samp class="option">antibanding</samp></dt>
  30310. <dd><p>Set the antibanding level. If enabled the filter will randomly vary
  30311. the luminance of output pixels by a small amount to avoid banding of
  30312. the histogram. Possible values are <code class="code">none</code>, <code class="code">weak</code> or
  30313. <code class="code">strong</code>. It defaults to <code class="code">none</code>.
  30314. </p></dd>
  30315. </dl>
  30316. <a class="anchor" id="histogram"></a><a name="histogram-1"></a>
  30317. <h3 class="section">32.117 histogram<span class="pull-right"><a class="anchor hidden-xs" href="#histogram-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-histogram-1" aria-hidden="true">TOC</a></span></h3>
  30318. <p>Compute and draw a color distribution histogram for the input video.
  30319. </p>
  30320. <p>The computed histogram is a representation of the color component
  30321. distribution in an image.
  30322. </p>
  30323. <p>Standard histogram displays the color components distribution in an image.
  30324. Displays color graph for each color component. Shows distribution of
  30325. the Y, U, V, A or R, G, B components, depending on input format, in the
  30326. current frame. Below each graph a color component scale meter is shown.
  30327. </p>
  30328. <p>The filter accepts the following options:
  30329. </p>
  30330. <dl class="table">
  30331. <dt><samp class="option">level_height</samp></dt>
  30332. <dd><p>Set height of level. Default value is <code class="code">200</code>.
  30333. Allowed range is [50, 2048].
  30334. </p>
  30335. </dd>
  30336. <dt><samp class="option">scale_height</samp></dt>
  30337. <dd><p>Set height of color scale. Default value is <code class="code">12</code>.
  30338. Allowed range is [0, 40].
  30339. </p>
  30340. </dd>
  30341. <dt><samp class="option">display_mode</samp></dt>
  30342. <dd><p>Set display mode.
  30343. It accepts the following values:
  30344. </p><dl class="table">
  30345. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  30346. <dd><p>Per color component graphs are placed below each other.
  30347. </p>
  30348. </dd>
  30349. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  30350. <dd><p>Per color component graphs are placed side by side.
  30351. </p>
  30352. </dd>
  30353. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  30354. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  30355. that the graphs representing color components are superimposed directly
  30356. over one another.
  30357. </p></dd>
  30358. </dl>
  30359. <p>Default is <code class="code">stack</code>.
  30360. </p>
  30361. </dd>
  30362. <dt><samp class="option">levels_mode</samp></dt>
  30363. <dd><p>Set mode. Can be either <code class="code">linear</code>, or <code class="code">logarithmic</code>.
  30364. Default is <code class="code">linear</code>.
  30365. </p>
  30366. </dd>
  30367. <dt><samp class="option">components</samp></dt>
  30368. <dd><p>Set what color components to display.
  30369. Default is <code class="code">7</code>.
  30370. </p>
  30371. </dd>
  30372. <dt><samp class="option">fgopacity</samp></dt>
  30373. <dd><p>Set foreground opacity. Default is <code class="code">0.7</code>.
  30374. </p>
  30375. </dd>
  30376. <dt><samp class="option">bgopacity</samp></dt>
  30377. <dd><p>Set background opacity. Default is <code class="code">0.5</code>.
  30378. </p>
  30379. </dd>
  30380. <dt><samp class="option">colors_mode</samp></dt>
  30381. <dd><p>Set colors mode.
  30382. It accepts the following values:
  30383. </p><dl class="table">
  30384. <dt>&lsquo;<samp class="samp">whiteonblack</samp>&rsquo;</dt>
  30385. <dt>&lsquo;<samp class="samp">blackonwhite</samp>&rsquo;</dt>
  30386. <dt>&lsquo;<samp class="samp">whiteongray</samp>&rsquo;</dt>
  30387. <dt>&lsquo;<samp class="samp">blackongray</samp>&rsquo;</dt>
  30388. <dt>&lsquo;<samp class="samp">coloronblack</samp>&rsquo;</dt>
  30389. <dt>&lsquo;<samp class="samp">coloronwhite</samp>&rsquo;</dt>
  30390. <dt>&lsquo;<samp class="samp">colorongray</samp>&rsquo;</dt>
  30391. <dt>&lsquo;<samp class="samp">blackoncolor</samp>&rsquo;</dt>
  30392. <dt>&lsquo;<samp class="samp">whiteoncolor</samp>&rsquo;</dt>
  30393. <dt>&lsquo;<samp class="samp">grayoncolor</samp>&rsquo;</dt>
  30394. </dl>
  30395. <p>Default is <code class="code">whiteonblack</code>.
  30396. </p></dd>
  30397. </dl>
  30398. <a name="Examples-104"></a>
  30399. <h4 class="subsection">32.117.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-104" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-104" aria-hidden="true">TOC</a></span></h4>
  30400. <ul class="itemize mark-bullet">
  30401. <li>Calculate and draw histogram:
  30402. <div class="example">
  30403. <pre class="example-preformatted">ffplay -i input -vf histogram
  30404. </pre></div>
  30405. </li></ul>
  30406. <a class="anchor" id="hqdn3d"></a><a name="hqdn3d-1"></a>
  30407. <h3 class="section">32.118 hqdn3d<span class="pull-right"><a class="anchor hidden-xs" href="#hqdn3d-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hqdn3d-1" aria-hidden="true">TOC</a></span></h3>
  30408. <p>This is a high precision/quality 3d denoise filter. It aims to reduce
  30409. image noise, producing smooth images and making still images really
  30410. still. It should enhance compressibility.
  30411. </p>
  30412. <p>It accepts the following optional parameters:
  30413. </p>
  30414. <dl class="table">
  30415. <dt><samp class="option">luma_spatial</samp></dt>
  30416. <dd><p>A non-negative floating point number which specifies spatial luma strength.
  30417. It defaults to 4.0.
  30418. </p>
  30419. </dd>
  30420. <dt><samp class="option">chroma_spatial</samp></dt>
  30421. <dd><p>A non-negative floating point number which specifies spatial chroma strength.
  30422. It defaults to 3.0*<var class="var">luma_spatial</var>/4.0.
  30423. </p>
  30424. </dd>
  30425. <dt><samp class="option">luma_tmp</samp></dt>
  30426. <dd><p>A floating point number which specifies luma temporal strength. It defaults to
  30427. 6.0*<var class="var">luma_spatial</var>/4.0.
  30428. </p>
  30429. </dd>
  30430. <dt><samp class="option">chroma_tmp</samp></dt>
  30431. <dd><p>A floating point number which specifies chroma temporal strength. It defaults to
  30432. <var class="var">luma_tmp</var>*<var class="var">chroma_spatial</var>/<var class="var">luma_spatial</var>.
  30433. </p></dd>
  30434. </dl>
  30435. <a name="Commands-98"></a>
  30436. <h4 class="subsection">32.118.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-98" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-98" aria-hidden="true">TOC</a></span></h4>
  30437. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  30438. The command accepts the same syntax of the corresponding option.
  30439. </p>
  30440. <p>If the specified expression is not valid, it is kept at its current
  30441. value.
  30442. </p>
  30443. <a class="anchor" id="hwdownload"></a><a name="hwdownload-1"></a>
  30444. <h3 class="section">32.119 hwdownload<span class="pull-right"><a class="anchor hidden-xs" href="#hwdownload-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwdownload-1" aria-hidden="true">TOC</a></span></h3>
  30445. <p>Download hardware frames to system memory.
  30446. </p>
  30447. <p>The input must be in hardware frames, and the output a non-hardware format.
  30448. Not all formats will be supported on the output - it may be necessary to insert
  30449. an additional <samp class="option">format</samp> filter immediately following in the graph to get
  30450. the output in a supported format.
  30451. </p>
  30452. <a name="hwmap"></a>
  30453. <h3 class="section">32.120 hwmap<span class="pull-right"><a class="anchor hidden-xs" href="#hwmap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwmap" aria-hidden="true">TOC</a></span></h3>
  30454. <p>Map hardware frames to system memory or to another device.
  30455. </p>
  30456. <p>This filter has several different modes of operation; which one is used depends
  30457. on the input and output formats:
  30458. </p><ul class="itemize mark-bullet">
  30459. <li>Hardware frame input, normal frame output
  30460. <p>Map the input frames to system memory and pass them to the output. If the
  30461. original hardware frame is later required (for example, after overlaying
  30462. something else on part of it), the <samp class="option">hwmap</samp> filter can be used again
  30463. in the next mode to retrieve it.
  30464. </p></li><li>Normal frame input, hardware frame output
  30465. <p>If the input is actually a software-mapped hardware frame, then unmap it -
  30466. that is, return the original hardware frame.
  30467. </p>
  30468. <p>Otherwise, a device must be provided. Create new hardware surfaces on that
  30469. device for the output, then map them back to the software format at the input
  30470. and give those frames to the preceding filter. This will then act like the
  30471. <samp class="option">hwupload</samp> filter, but may be able to avoid an additional copy when
  30472. the input is already in a compatible format.
  30473. </p></li><li>Hardware frame input and output
  30474. <p>A device must be supplied for the output, either directly or with the
  30475. <samp class="option">derive_device</samp> option. The input and output devices must be of
  30476. different types and compatible - the exact meaning of this is
  30477. system-dependent, but typically it means that they must refer to the same
  30478. underlying hardware context (for example, refer to the same graphics card).
  30479. </p>
  30480. <p>If the input frames were originally created on the output device, then unmap
  30481. to retrieve the original frames.
  30482. </p>
  30483. <p>Otherwise, map the frames to the output device - create new hardware frames
  30484. on the output corresponding to the frames on the input.
  30485. </p></li></ul>
  30486. <p>The following additional parameters are accepted:
  30487. </p>
  30488. <dl class="table">
  30489. <dt><samp class="option">mode</samp></dt>
  30490. <dd><p>Set the frame mapping mode. Some combination of:
  30491. </p><dl class="table">
  30492. <dt><var class="var">read</var></dt>
  30493. <dd><p>The mapped frame should be readable.
  30494. </p></dd>
  30495. <dt><var class="var">write</var></dt>
  30496. <dd><p>The mapped frame should be writeable.
  30497. </p></dd>
  30498. <dt><var class="var">overwrite</var></dt>
  30499. <dd><p>The mapping will always overwrite the entire frame.
  30500. </p>
  30501. <p>This may improve performance in some cases, as the original contents of the
  30502. frame need not be loaded.
  30503. </p></dd>
  30504. <dt><var class="var">direct</var></dt>
  30505. <dd><p>The mapping must not involve any copying.
  30506. </p>
  30507. <p>Indirect mappings to copies of frames are created in some cases where either
  30508. direct mapping is not possible or it would have unexpected properties.
  30509. Setting this flag ensures that the mapping is direct and will fail if that is
  30510. not possible.
  30511. </p></dd>
  30512. </dl>
  30513. <p>Defaults to <var class="var">read+write</var> if not specified.
  30514. </p>
  30515. </dd>
  30516. <dt><samp class="option">derive_device <var class="var">type</var></samp></dt>
  30517. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  30518. device of type <var class="var">type</var> from the device the input frames exist on.
  30519. </p>
  30520. </dd>
  30521. <dt><samp class="option">reverse</samp></dt>
  30522. <dd><p>In a hardware to hardware mapping, map in reverse - create frames in the sink
  30523. and map them back to the source. This may be necessary in some cases where
  30524. a mapping in one direction is required but only the opposite direction is
  30525. supported by the devices being used.
  30526. </p>
  30527. <p>This option is dangerous - it may break the preceding filter in undefined
  30528. ways if there are any additional constraints on that filter&rsquo;s output.
  30529. Do not use it without fully understanding the implications of its use.
  30530. </p></dd>
  30531. </dl>
  30532. <a class="anchor" id="hwupload"></a><a name="hwupload-1"></a>
  30533. <h3 class="section">32.121 hwupload<span class="pull-right"><a class="anchor hidden-xs" href="#hwupload-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwupload-1" aria-hidden="true">TOC</a></span></h3>
  30534. <p>Upload system memory frames to hardware surfaces.
  30535. </p>
  30536. <p>The device to upload to must be supplied when the filter is initialised. If
  30537. using ffmpeg, select the appropriate device with the <samp class="option">-filter_hw_device</samp>
  30538. option or with the <samp class="option">derive_device</samp> option. The input and output devices
  30539. must be of different types and compatible - the exact meaning of this is
  30540. system-dependent, but typically it means that they must refer to the same
  30541. underlying hardware context (for example, refer to the same graphics card).
  30542. </p>
  30543. <p>The following additional parameters are accepted:
  30544. </p>
  30545. <dl class="table">
  30546. <dt><samp class="option">derive_device <var class="var">type</var></samp></dt>
  30547. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  30548. device of type <var class="var">type</var> from the device the input frames exist on.
  30549. </p></dd>
  30550. </dl>
  30551. <a class="anchor" id="hwupload_005fcuda"></a><a name="hwupload_005fcuda-1"></a>
  30552. <h3 class="section">32.122 hwupload_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#hwupload_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwupload_005fcuda-1" aria-hidden="true">TOC</a></span></h3>
  30553. <p>Upload system memory frames to a CUDA device.
  30554. </p>
  30555. <p>It accepts the following optional parameters:
  30556. </p>
  30557. <dl class="table">
  30558. <dt><samp class="option">device</samp></dt>
  30559. <dd><p>The number of the CUDA device to use
  30560. </p></dd>
  30561. </dl>
  30562. <a name="hqx"></a>
  30563. <h3 class="section">32.123 hqx<span class="pull-right"><a class="anchor hidden-xs" href="#hqx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hqx" aria-hidden="true">TOC</a></span></h3>
  30564. <p>Apply a high-quality magnification filter designed for pixel art. This filter
  30565. was originally created by Maxim Stepin.
  30566. </p>
  30567. <p>It accepts the following option:
  30568. </p>
  30569. <dl class="table">
  30570. <dt><samp class="option">n</samp></dt>
  30571. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">hq2x</code>, <code class="code">3</code> for
  30572. <code class="code">hq3x</code> and <code class="code">4</code> for <code class="code">hq4x</code>.
  30573. Default is <code class="code">3</code>.
  30574. </p></dd>
  30575. </dl>
  30576. <a class="anchor" id="hstack"></a><a name="hstack-1"></a>
  30577. <h3 class="section">32.124 hstack<span class="pull-right"><a class="anchor hidden-xs" href="#hstack-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hstack-1" aria-hidden="true">TOC</a></span></h3>
  30578. <p>Stack input videos horizontally.
  30579. </p>
  30580. <p>All streams must be of same pixel format and of same height.
  30581. </p>
  30582. <p>Note that this filter is faster than using <a class="ref" href="#overlay">overlay</a> and <a class="ref" href="#pad">pad</a> filter
  30583. to create same output.
  30584. </p>
  30585. <p>The filter accepts the following option:
  30586. </p>
  30587. <dl class="table">
  30588. <dt><samp class="option">inputs</samp></dt>
  30589. <dd><p>Set number of input streams. Default is 2.
  30590. </p>
  30591. </dd>
  30592. <dt><samp class="option">shortest</samp></dt>
  30593. <dd><p>If set to 1, force the output to terminate when the shortest input
  30594. terminates. Default value is 0.
  30595. </p></dd>
  30596. </dl>
  30597. <a name="hsvhold"></a>
  30598. <h3 class="section">32.125 hsvhold<span class="pull-right"><a class="anchor hidden-xs" href="#hsvhold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hsvhold" aria-hidden="true">TOC</a></span></h3>
  30599. <p>Turns a certain HSV range into gray values.
  30600. </p>
  30601. <p>This filter measures color difference between set HSV color in options
  30602. and ones measured in video stream. Depending on options, output
  30603. colors can be changed to be gray or not.
  30604. </p>
  30605. <p>The filter accepts the following options:
  30606. </p>
  30607. <dl class="table">
  30608. <dt><samp class="option">hue</samp></dt>
  30609. <dd><p>Set the hue value which will be used in color difference calculation.
  30610. Allowed range is from -360 to 360. Default value is 0.
  30611. </p>
  30612. </dd>
  30613. <dt><samp class="option">sat</samp></dt>
  30614. <dd><p>Set the saturation value which will be used in color difference calculation.
  30615. Allowed range is from -1 to 1. Default value is 0.
  30616. </p>
  30617. </dd>
  30618. <dt><samp class="option">val</samp></dt>
  30619. <dd><p>Set the value which will be used in color difference calculation.
  30620. Allowed range is from -1 to 1. Default value is 0.
  30621. </p>
  30622. </dd>
  30623. <dt><samp class="option">similarity</samp></dt>
  30624. <dd><p>Set similarity percentage with the key color.
  30625. Allowed range is from 0 to 1. Default value is 0.01.
  30626. </p>
  30627. <p>0.00001 matches only the exact key color, while 1.0 matches everything.
  30628. </p>
  30629. </dd>
  30630. <dt><samp class="option">blend</samp></dt>
  30631. <dd><p>Blend percentage.
  30632. Allowed range is from 0 to 1. Default value is 0.
  30633. </p>
  30634. <p>0.0 makes pixels either fully gray, or not gray at all.
  30635. </p>
  30636. <p>Higher values result in more gray pixels, with a higher gray pixel
  30637. the more similar the pixels color is to the key color.
  30638. </p></dd>
  30639. </dl>
  30640. <a name="hsvkey"></a>
  30641. <h3 class="section">32.126 hsvkey<span class="pull-right"><a class="anchor hidden-xs" href="#hsvkey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hsvkey" aria-hidden="true">TOC</a></span></h3>
  30642. <p>Turns a certain HSV range into transparency.
  30643. </p>
  30644. <p>This filter measures color difference between set HSV color in options
  30645. and ones measured in video stream. Depending on options, output
  30646. colors can be changed to transparent by adding alpha channel.
  30647. </p>
  30648. <p>The filter accepts the following options:
  30649. </p>
  30650. <dl class="table">
  30651. <dt><samp class="option">hue</samp></dt>
  30652. <dd><p>Set the hue value which will be used in color difference calculation.
  30653. Allowed range is from -360 to 360. Default value is 0.
  30654. </p>
  30655. </dd>
  30656. <dt><samp class="option">sat</samp></dt>
  30657. <dd><p>Set the saturation value which will be used in color difference calculation.
  30658. Allowed range is from -1 to 1. Default value is 0.
  30659. </p>
  30660. </dd>
  30661. <dt><samp class="option">val</samp></dt>
  30662. <dd><p>Set the value which will be used in color difference calculation.
  30663. Allowed range is from -1 to 1. Default value is 0.
  30664. </p>
  30665. </dd>
  30666. <dt><samp class="option">similarity</samp></dt>
  30667. <dd><p>Set similarity percentage with the key color.
  30668. Allowed range is from 0 to 1. Default value is 0.01.
  30669. </p>
  30670. <p>0.00001 matches only the exact key color, while 1.0 matches everything.
  30671. </p>
  30672. </dd>
  30673. <dt><samp class="option">blend</samp></dt>
  30674. <dd><p>Blend percentage.
  30675. Allowed range is from 0 to 1. Default value is 0.
  30676. </p>
  30677. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  30678. </p>
  30679. <p>Higher values result in semi-transparent pixels, with a higher transparency
  30680. the more similar the pixels color is to the key color.
  30681. </p></dd>
  30682. </dl>
  30683. <a name="hue"></a>
  30684. <h3 class="section">32.127 hue<span class="pull-right"><a class="anchor hidden-xs" href="#hue" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hue" aria-hidden="true">TOC</a></span></h3>
  30685. <p>Modify the hue and/or the saturation of the input.
  30686. </p>
  30687. <p>It accepts the following parameters:
  30688. </p>
  30689. <dl class="table">
  30690. <dt><samp class="option">h</samp></dt>
  30691. <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
  30692. and defaults to &quot;0&quot;.
  30693. </p>
  30694. </dd>
  30695. <dt><samp class="option">s</samp></dt>
  30696. <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
  30697. defaults to &quot;1&quot;.
  30698. </p>
  30699. </dd>
  30700. <dt><samp class="option">H</samp></dt>
  30701. <dd><p>Specify the hue angle as a number of radians. It accepts an
  30702. expression, and defaults to &quot;0&quot;.
  30703. </p>
  30704. </dd>
  30705. <dt><samp class="option">b</samp></dt>
  30706. <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
  30707. defaults to &quot;0&quot;.
  30708. </p></dd>
  30709. </dl>
  30710. <p><samp class="option">h</samp> and <samp class="option">H</samp> are mutually exclusive, and can&rsquo;t be
  30711. specified at the same time.
  30712. </p>
  30713. <p>The <samp class="option">b</samp>, <samp class="option">h</samp>, <samp class="option">H</samp> and <samp class="option">s</samp> option values are
  30714. expressions containing the following constants:
  30715. </p>
  30716. <dl class="table">
  30717. <dt><samp class="option">n</samp></dt>
  30718. <dd><p>frame count of the input frame starting from 0
  30719. </p>
  30720. </dd>
  30721. <dt><samp class="option">pts</samp></dt>
  30722. <dd><p>presentation timestamp of the input frame expressed in time base units
  30723. </p>
  30724. </dd>
  30725. <dt><samp class="option">r</samp></dt>
  30726. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  30727. </p>
  30728. </dd>
  30729. <dt><samp class="option">t</samp></dt>
  30730. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  30731. </p>
  30732. </dd>
  30733. <dt><samp class="option">tb</samp></dt>
  30734. <dd><p>time base of the input video
  30735. </p></dd>
  30736. </dl>
  30737. <a name="Examples-105"></a>
  30738. <h4 class="subsection">32.127.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-105" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-105" aria-hidden="true">TOC</a></span></h4>
  30739. <ul class="itemize mark-bullet">
  30740. <li>Set the hue to 90 degrees and the saturation to 1.0:
  30741. <div class="example">
  30742. <pre class="example-preformatted">hue=h=90:s=1
  30743. </pre></div>
  30744. </li><li>Same command but expressing the hue in radians:
  30745. <div class="example">
  30746. <pre class="example-preformatted">hue=H=PI/2:s=1
  30747. </pre></div>
  30748. </li><li>Rotate hue and make the saturation swing between 0
  30749. and 2 over a period of 1 second:
  30750. <div class="example">
  30751. <pre class="example-preformatted">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
  30752. </pre></div>
  30753. </li><li>Apply a 3 seconds saturation fade-in effect starting at 0:
  30754. <div class="example">
  30755. <pre class="example-preformatted">hue=&quot;s=min(t/3\,1)&quot;
  30756. </pre></div>
  30757. <p>The general fade-in expression can be written as:
  30758. </p><div class="example">
  30759. <pre class="example-preformatted">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
  30760. </pre></div>
  30761. </li><li>Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
  30762. <div class="example">
  30763. <pre class="example-preformatted">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
  30764. </pre></div>
  30765. <p>The general fade-out expression can be written as:
  30766. </p><div class="example">
  30767. <pre class="example-preformatted">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
  30768. </pre></div>
  30769. </li></ul>
  30770. <a name="Commands-99"></a>
  30771. <h4 class="subsection">32.127.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-99" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-99" aria-hidden="true">TOC</a></span></h4>
  30772. <p>This filter supports the following commands:
  30773. </p><dl class="table">
  30774. <dt><samp class="option">b</samp></dt>
  30775. <dt><samp class="option">s</samp></dt>
  30776. <dt><samp class="option">h</samp></dt>
  30777. <dt><samp class="option">H</samp></dt>
  30778. <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
  30779. The command accepts the same syntax of the corresponding option.
  30780. </p>
  30781. <p>If the specified expression is not valid, it is kept at its current
  30782. value.
  30783. </p></dd>
  30784. </dl>
  30785. <a name="huesaturation"></a>
  30786. <h3 class="section">32.128 huesaturation<span class="pull-right"><a class="anchor hidden-xs" href="#huesaturation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-huesaturation" aria-hidden="true">TOC</a></span></h3>
  30787. <p>Apply hue-saturation-intensity adjustments to input video stream.
  30788. </p>
  30789. <p>This filter operates in RGB colorspace.
  30790. </p>
  30791. <p>This filter accepts the following options:
  30792. </p>
  30793. <dl class="table">
  30794. <dt><samp class="option">hue</samp></dt>
  30795. <dd><p>Set the hue shift in degrees to apply. Default is 0.
  30796. Allowed range is from -180 to 180.
  30797. </p>
  30798. </dd>
  30799. <dt><samp class="option">saturation</samp></dt>
  30800. <dd><p>Set the saturation shift. Default is 0.
  30801. Allowed range is from -1 to 1.
  30802. </p>
  30803. </dd>
  30804. <dt><samp class="option">intensity</samp></dt>
  30805. <dd><p>Set the intensity shift. Default is 0.
  30806. Allowed range is from -1 to 1.
  30807. </p>
  30808. </dd>
  30809. <dt><samp class="option">colors</samp></dt>
  30810. <dd><p>Set which primary and complementary colors are going to be adjusted.
  30811. This options is set by providing one or multiple values.
  30812. This can select multiple colors at once. By default all colors are selected.
  30813. </p><dl class="table">
  30814. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  30815. <dd><p>Adjust reds.
  30816. </p></dd>
  30817. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  30818. <dd><p>Adjust yellows.
  30819. </p></dd>
  30820. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  30821. <dd><p>Adjust greens.
  30822. </p></dd>
  30823. <dt>&lsquo;<samp class="samp">c</samp>&rsquo;</dt>
  30824. <dd><p>Adjust cyans.
  30825. </p></dd>
  30826. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  30827. <dd><p>Adjust blues.
  30828. </p></dd>
  30829. <dt>&lsquo;<samp class="samp">m</samp>&rsquo;</dt>
  30830. <dd><p>Adjust magentas.
  30831. </p></dd>
  30832. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  30833. <dd><p>Adjust all colors.
  30834. </p></dd>
  30835. </dl>
  30836. </dd>
  30837. <dt><samp class="option">strength</samp></dt>
  30838. <dd><p>Set strength of filtering. Allowed range is from 0 to 100.
  30839. Default value is 1.
  30840. </p>
  30841. </dd>
  30842. <dt><samp class="option">rw, gw, bw</samp></dt>
  30843. <dd><p>Set weight for each RGB component. Allowed range is from 0 to 1.
  30844. By default is set to 0.333, 0.334, 0.333.
  30845. Those options are used in saturation and lightess processing.
  30846. </p>
  30847. </dd>
  30848. <dt><samp class="option">lightness</samp></dt>
  30849. <dd><p>Set preserving lightness, by default is disabled.
  30850. Adjusting hues can change lightness from original RGB triplet,
  30851. with this option enabled lightness is kept at same value.
  30852. </p></dd>
  30853. </dl>
  30854. <a name="hysteresis"></a>
  30855. <h3 class="section">32.129 hysteresis<span class="pull-right"><a class="anchor hidden-xs" href="#hysteresis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hysteresis" aria-hidden="true">TOC</a></span></h3>
  30856. <p>Grow first stream into second stream by connecting components.
  30857. This makes it possible to build more robust edge masks.
  30858. </p>
  30859. <p>This filter accepts the following options:
  30860. </p>
  30861. <dl class="table">
  30862. <dt><samp class="option">planes</samp></dt>
  30863. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  30864. copied from first stream.
  30865. By default value 0xf, all planes will be processed.
  30866. </p>
  30867. </dd>
  30868. <dt><samp class="option">threshold</samp></dt>
  30869. <dd><p>Set threshold which is used in filtering. If pixel component value is higher than
  30870. this value filter algorithm for connecting components is activated.
  30871. By default value is 0.
  30872. </p></dd>
  30873. </dl>
  30874. <p>The <code class="code">hysteresis</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  30875. </p>
  30876. <a name="iccdetect"></a>
  30877. <h3 class="section">32.130 iccdetect<span class="pull-right"><a class="anchor hidden-xs" href="#iccdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-iccdetect" aria-hidden="true">TOC</a></span></h3>
  30878. <p>Detect the colorspace from an embedded ICC profile (if present), and update
  30879. the frame&rsquo;s tags accordingly.
  30880. </p>
  30881. <p>This filter accepts the following options:
  30882. </p>
  30883. <dl class="table">
  30884. <dt><samp class="option">force</samp></dt>
  30885. <dd><p>If true, the frame&rsquo;s existing colorspace tags will always be overridden by
  30886. values detected from an ICC profile. Otherwise, they will only be assigned if
  30887. they contain <code class="code">unknown</code>. Enabled by default.
  30888. </p></dd>
  30889. </dl>
  30890. <a name="iccgen"></a>
  30891. <h3 class="section">32.131 iccgen<span class="pull-right"><a class="anchor hidden-xs" href="#iccgen" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-iccgen" aria-hidden="true">TOC</a></span></h3>
  30892. <p>Generate ICC profiles and attach them to frames.
  30893. </p>
  30894. <p>This filter accepts the following options:
  30895. </p>
  30896. <dl class="table">
  30897. <dt><samp class="option">color_primaries</samp></dt>
  30898. <dt><samp class="option">color_trc</samp></dt>
  30899. <dd><p>Configure the colorspace that the ICC profile will be generated for. The
  30900. default value of <code class="code">auto</code> infers the value from the input frame&rsquo;s metadata,
  30901. defaulting to BT.709/sRGB as appropriate.
  30902. </p>
  30903. <p>See the <a class="ref" href="#setparams">setparams</a> filter for a list of possible values, but note that
  30904. <code class="code">unknown</code> are not valid values for this filter.
  30905. </p>
  30906. </dd>
  30907. <dt><samp class="option">force</samp></dt>
  30908. <dd><p>If true, an ICC profile will be generated even if it would overwrite an
  30909. already existing ICC profile. Disabled by default.
  30910. </p></dd>
  30911. </dl>
  30912. <a name="identity"></a>
  30913. <h3 class="section">32.132 identity<span class="pull-right"><a class="anchor hidden-xs" href="#identity" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-identity" aria-hidden="true">TOC</a></span></h3>
  30914. <p>Obtain the identity score between two input videos.
  30915. </p>
  30916. <p>This filter takes two input videos.
  30917. </p>
  30918. <p>Both input videos must have the same resolution and pixel format for
  30919. this filter to work correctly. Also it assumes that both inputs
  30920. have the same number of frames, which are compared one by one.
  30921. </p>
  30922. <p>The obtained per component, average, min and max identity score is printed through
  30923. the logging system.
  30924. </p>
  30925. <p>The filter stores the calculated identity scores of each frame in frame metadata.
  30926. </p>
  30927. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  30928. </p>
  30929. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  30930. with the reference file <samp class="file">ref.mpg</samp>.
  30931. </p>
  30932. <div class="example">
  30933. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi identity -f null -
  30934. </pre></div>
  30935. <a name="idet"></a>
  30936. <h3 class="section">32.133 idet<span class="pull-right"><a class="anchor hidden-xs" href="#idet" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-idet" aria-hidden="true">TOC</a></span></h3>
  30937. <p>Detect video interlacing type.
  30938. </p>
  30939. <p>This filter tries to detect if the input frames are interlaced, progressive,
  30940. top or bottom field first. It will also try to detect fields that are
  30941. repeated between adjacent frames (a sign of telecine).
  30942. </p>
  30943. <p>Single frame detection considers only immediately adjacent frames when classifying each frame.
  30944. Multiple frame detection incorporates the classification history of previous frames.
  30945. </p>
  30946. <p>The filter will log these metadata values:
  30947. </p>
  30948. <dl class="table">
  30949. <dt><samp class="option">single.current_frame</samp></dt>
  30950. <dd><p>Detected type of current frame using single-frame detection. One of:
  30951. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  30952. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  30953. </p>
  30954. </dd>
  30955. <dt><samp class="option">single.tff</samp></dt>
  30956. <dd><p>Cumulative number of frames detected as top field first using single-frame detection.
  30957. </p>
  30958. </dd>
  30959. <dt><samp class="option">multiple.tff</samp></dt>
  30960. <dd><p>Cumulative number of frames detected as top field first using multiple-frame detection.
  30961. </p>
  30962. </dd>
  30963. <dt><samp class="option">single.bff</samp></dt>
  30964. <dd><p>Cumulative number of frames detected as bottom field first using single-frame detection.
  30965. </p>
  30966. </dd>
  30967. <dt><samp class="option">multiple.current_frame</samp></dt>
  30968. <dd><p>Detected type of current frame using multiple-frame detection. One of:
  30969. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  30970. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  30971. </p>
  30972. </dd>
  30973. <dt><samp class="option">multiple.bff</samp></dt>
  30974. <dd><p>Cumulative number of frames detected as bottom field first using multiple-frame detection.
  30975. </p>
  30976. </dd>
  30977. <dt><samp class="option">single.progressive</samp></dt>
  30978. <dd><p>Cumulative number of frames detected as progressive using single-frame detection.
  30979. </p>
  30980. </dd>
  30981. <dt><samp class="option">multiple.progressive</samp></dt>
  30982. <dd><p>Cumulative number of frames detected as progressive using multiple-frame detection.
  30983. </p>
  30984. </dd>
  30985. <dt><samp class="option">single.undetermined</samp></dt>
  30986. <dd><p>Cumulative number of frames that could not be classified using single-frame detection.
  30987. </p>
  30988. </dd>
  30989. <dt><samp class="option">multiple.undetermined</samp></dt>
  30990. <dd><p>Cumulative number of frames that could not be classified using multiple-frame detection.
  30991. </p>
  30992. </dd>
  30993. <dt><samp class="option">repeated.current_frame</samp></dt>
  30994. <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;.
  30995. </p>
  30996. </dd>
  30997. <dt><samp class="option">repeated.neither</samp></dt>
  30998. <dd><p>Cumulative number of frames with no repeated field.
  30999. </p>
  31000. </dd>
  31001. <dt><samp class="option">repeated.top</samp></dt>
  31002. <dd><p>Cumulative number of frames with the top field repeated from the previous frame&rsquo;s top field.
  31003. </p>
  31004. </dd>
  31005. <dt><samp class="option">repeated.bottom</samp></dt>
  31006. <dd><p>Cumulative number of frames with the bottom field repeated from the previous frame&rsquo;s bottom field.
  31007. </p></dd>
  31008. </dl>
  31009. <p>The filter accepts the following options:
  31010. </p>
  31011. <dl class="table">
  31012. <dt><samp class="option">intl_thres</samp></dt>
  31013. <dd><p>Set interlacing threshold.
  31014. </p></dd>
  31015. <dt><samp class="option">prog_thres</samp></dt>
  31016. <dd><p>Set progressive threshold.
  31017. </p></dd>
  31018. <dt><samp class="option">rep_thres</samp></dt>
  31019. <dd><p>Threshold for repeated field detection.
  31020. </p></dd>
  31021. <dt><samp class="option">half_life</samp></dt>
  31022. <dd><p>Number of frames after which a given frame&rsquo;s contribution to the
  31023. statistics is halved (i.e., it contributes only 0.5 to its
  31024. classification). The default of 0 means that all frames seen are given
  31025. full weight of 1.0 forever.
  31026. </p></dd>
  31027. <dt><samp class="option">analyze_interlaced_flag</samp></dt>
  31028. <dd><p>When this is not 0 then idet will use the specified number of frames to determine
  31029. if the interlaced flag is accurate, it will not count undetermined frames.
  31030. If the flag is found to be accurate it will be used without any further
  31031. computations, if it is found to be inaccurate it will be cleared without any
  31032. further computations. This allows inserting the idet filter as a low computational
  31033. method to clean up the interlaced flag
  31034. </p></dd>
  31035. </dl>
  31036. <a name="Examples-106"></a>
  31037. <h4 class="subsection">32.133.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-106" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-106" aria-hidden="true">TOC</a></span></h4>
  31038. <p>Inspect the field order of the first 360 frames in a video, in verbose detail:
  31039. </p><div class="example">
  31040. <pre class="example-preformatted">ffmpeg -i INPUT -filter:v idet,metadata=mode=print -frames:v 360 -an -f null -
  31041. </pre></div>
  31042. <p>The idet filter will add analysis metadata to each frame, which will then be
  31043. discarded. At the end, the filter will also print a final report with statistics.
  31044. </p>
  31045. <a name="il"></a>
  31046. <h3 class="section">32.134 il<span class="pull-right"><a class="anchor hidden-xs" href="#il" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-il" aria-hidden="true">TOC</a></span></h3>
  31047. <p>Deinterleave or interleave fields.
  31048. </p>
  31049. <p>This filter allows one to process interlaced images fields without
  31050. deinterlacing them. Deinterleaving splits the input frame into 2
  31051. fields (so called half pictures). Odd lines are moved to the top
  31052. half of the output image, even lines to the bottom half.
  31053. You can process (filter) them independently and then re-interleave them.
  31054. </p>
  31055. <p>The filter accepts the following options:
  31056. </p>
  31057. <dl class="table">
  31058. <dt><samp class="option">luma_mode, l</samp></dt>
  31059. <dt><samp class="option">chroma_mode, c</samp></dt>
  31060. <dt><samp class="option">alpha_mode, a</samp></dt>
  31061. <dd><p>Available values for <var class="var">luma_mode</var>, <var class="var">chroma_mode</var> and
  31062. <var class="var">alpha_mode</var> are:
  31063. </p>
  31064. <dl class="table">
  31065. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  31066. <dd><p>Do nothing.
  31067. </p>
  31068. </dd>
  31069. <dt>&lsquo;<samp class="samp">deinterleave, d</samp>&rsquo;</dt>
  31070. <dd><p>Deinterleave fields, placing one above the other.
  31071. </p>
  31072. </dd>
  31073. <dt>&lsquo;<samp class="samp">interleave, i</samp>&rsquo;</dt>
  31074. <dd><p>Interleave fields. Reverse the effect of deinterleaving.
  31075. </p></dd>
  31076. </dl>
  31077. <p>Default value is <code class="code">none</code>.
  31078. </p>
  31079. </dd>
  31080. <dt><samp class="option">luma_swap, ls</samp></dt>
  31081. <dt><samp class="option">chroma_swap, cs</samp></dt>
  31082. <dt><samp class="option">alpha_swap, as</samp></dt>
  31083. <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code class="code">0</code>.
  31084. </p></dd>
  31085. </dl>
  31086. <a name="Commands-100"></a>
  31087. <h4 class="subsection">32.134.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-100" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-100" aria-hidden="true">TOC</a></span></h4>
  31088. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31089. </p>
  31090. <a name="inflate"></a>
  31091. <h3 class="section">32.135 inflate<span class="pull-right"><a class="anchor hidden-xs" href="#inflate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-inflate" aria-hidden="true">TOC</a></span></h3>
  31092. <p>Apply inflate effect to the video.
  31093. </p>
  31094. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  31095. only values higher than the pixel.
  31096. </p>
  31097. <p>It accepts the following options:
  31098. </p>
  31099. <dl class="table">
  31100. <dt><samp class="option">threshold0</samp></dt>
  31101. <dt><samp class="option">threshold1</samp></dt>
  31102. <dt><samp class="option">threshold2</samp></dt>
  31103. <dt><samp class="option">threshold3</samp></dt>
  31104. <dd><p>Limit the maximum change for each plane, default is 65535.
  31105. If 0, plane will remain unchanged.
  31106. </p></dd>
  31107. </dl>
  31108. <a name="Commands-101"></a>
  31109. <h4 class="subsection">32.135.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-101" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-101" aria-hidden="true">TOC</a></span></h4>
  31110. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31111. </p>
  31112. <a name="interlace_002c-interlace_005fvulkan"></a>
  31113. <h3 class="section">32.136 interlace, interlace_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#interlace_002c-interlace_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-interlace_002c-interlace_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  31114. <p>Simple interlacing filter from progressive contents. This interleaves upper (or
  31115. lower) lines from odd frames with lower (or upper) lines from even frames,
  31116. halving the frame rate and preserving image height.
  31117. </p>
  31118. <div class="example">
  31119. <pre class="example-preformatted"> Original Original New Frame
  31120. Frame 'j' Frame 'j+1' (tff)
  31121. ========== =========== ==================
  31122. Line 0 --------------------&gt; Frame 'j' Line 0
  31123. Line 1 Line 1 ----&gt; Frame 'j+1' Line 1
  31124. Line 2 ---------------------&gt; Frame 'j' Line 2
  31125. Line 3 Line 3 ----&gt; Frame 'j+1' Line 3
  31126. ... ... ...
  31127. New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
  31128. </pre></div>
  31129. <p>It accepts the following optional parameters:
  31130. </p>
  31131. <dl class="table">
  31132. <dt><samp class="option">scan</samp></dt>
  31133. <dd><p>This determines whether the interlaced frame is taken from the even
  31134. (tff - default) or odd (bff) lines of the progressive frame.
  31135. </p>
  31136. </dd>
  31137. <dt><samp class="option">lowpass</samp></dt>
  31138. <dd><p>Vertical lowpass filter to avoid twitter interlacing and
  31139. reduce moire patterns.
  31140. </p>
  31141. <dl class="table">
  31142. <dt>&lsquo;<samp class="samp">0, off</samp>&rsquo;</dt>
  31143. <dd><p>Disable vertical lowpass filter
  31144. </p>
  31145. </dd>
  31146. <dt>&lsquo;<samp class="samp">1, linear</samp>&rsquo;</dt>
  31147. <dd><p>Enable linear filter (default)
  31148. </p>
  31149. </dd>
  31150. <dt>&lsquo;<samp class="samp">2, complex</samp>&rsquo;</dt>
  31151. <dd><p>Enable complex filter. This will slightly less reduce twitter and moire
  31152. but better retain detail and subjective sharpness impression.
  31153. </p>
  31154. </dd>
  31155. </dl>
  31156. </dd>
  31157. </dl>
  31158. <a name="kerndeint"></a>
  31159. <h3 class="section">32.137 kerndeint<span class="pull-right"><a class="anchor hidden-xs" href="#kerndeint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kerndeint" aria-hidden="true">TOC</a></span></h3>
  31160. <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
  31161. deinterling. Work on interlaced parts of a video to produce
  31162. progressive frames.
  31163. </p>
  31164. <p>The description of the accepted parameters follows.
  31165. </p>
  31166. <dl class="table">
  31167. <dt><samp class="option">thresh</samp></dt>
  31168. <dd><p>Set the threshold which affects the filter&rsquo;s tolerance when
  31169. determining if a pixel line must be processed. It must be an integer
  31170. in the range [0,255] and defaults to 10. A value of 0 will result in
  31171. applying the process on every pixels.
  31172. </p>
  31173. </dd>
  31174. <dt><samp class="option">map</samp></dt>
  31175. <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
  31176. Default is 0.
  31177. </p>
  31178. </dd>
  31179. <dt><samp class="option">order</samp></dt>
  31180. <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
  31181. 0. Default is 0.
  31182. </p>
  31183. </dd>
  31184. <dt><samp class="option">sharp</samp></dt>
  31185. <dd><p>Enable additional sharpening if set to 1. Default is 0.
  31186. </p>
  31187. </dd>
  31188. <dt><samp class="option">twoway</samp></dt>
  31189. <dd><p>Enable twoway sharpening if set to 1. Default is 0.
  31190. </p></dd>
  31191. </dl>
  31192. <a name="Examples-107"></a>
  31193. <h4 class="subsection">32.137.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-107" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-107" aria-hidden="true">TOC</a></span></h4>
  31194. <ul class="itemize mark-bullet">
  31195. <li>Apply default values:
  31196. <div class="example">
  31197. <pre class="example-preformatted">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
  31198. </pre></div>
  31199. </li><li>Enable additional sharpening:
  31200. <div class="example">
  31201. <pre class="example-preformatted">kerndeint=sharp=1
  31202. </pre></div>
  31203. </li><li>Paint processed pixels in white:
  31204. <div class="example">
  31205. <pre class="example-preformatted">kerndeint=map=1
  31206. </pre></div>
  31207. </li></ul>
  31208. <a name="kirsch"></a>
  31209. <h3 class="section">32.138 kirsch<span class="pull-right"><a class="anchor hidden-xs" href="#kirsch" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kirsch" aria-hidden="true">TOC</a></span></h3>
  31210. <p>Apply kirsch operator to input video stream.
  31211. </p>
  31212. <p>The filter accepts the following option:
  31213. </p>
  31214. <dl class="table">
  31215. <dt><samp class="option">planes</samp></dt>
  31216. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  31217. By default value 0xf, all planes will be processed.
  31218. </p>
  31219. </dd>
  31220. <dt><samp class="option">scale</samp></dt>
  31221. <dd><p>Set value which will be multiplied with filtered result.
  31222. </p>
  31223. </dd>
  31224. <dt><samp class="option">delta</samp></dt>
  31225. <dd><p>Set value which will be added to filtered result.
  31226. </p></dd>
  31227. </dl>
  31228. <a name="Commands-102"></a>
  31229. <h4 class="subsection">32.138.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-102" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-102" aria-hidden="true">TOC</a></span></h4>
  31230. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31231. </p>
  31232. <a name="lagfun"></a>
  31233. <h3 class="section">32.139 lagfun<span class="pull-right"><a class="anchor hidden-xs" href="#lagfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lagfun" aria-hidden="true">TOC</a></span></h3>
  31234. <p>Slowly update darker pixels.
  31235. </p>
  31236. <p>This filter makes short flashes of light appear longer.
  31237. This filter accepts the following options:
  31238. </p>
  31239. <dl class="table">
  31240. <dt><samp class="option">decay</samp></dt>
  31241. <dd><p>Set factor for decaying. Default is .95. Allowed range is from 0 to 1.
  31242. </p>
  31243. </dd>
  31244. <dt><samp class="option">planes</samp></dt>
  31245. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  31246. </p></dd>
  31247. </dl>
  31248. <a name="Commands-103"></a>
  31249. <h4 class="subsection">32.139.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-103" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-103" aria-hidden="true">TOC</a></span></h4>
  31250. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31251. </p>
  31252. <a name="lenscorrection"></a>
  31253. <h3 class="section">32.140 lenscorrection<span class="pull-right"><a class="anchor hidden-xs" href="#lenscorrection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lenscorrection" aria-hidden="true">TOC</a></span></h3>
  31254. <p>Correct radial lens distortion
  31255. </p>
  31256. <p>This filter can be used to correct for radial distortion as can result from the use
  31257. of wide angle lenses, and thereby re-rectify the image. To find the right parameters
  31258. one can use tools available for example as part of opencv or simply trial-and-error.
  31259. To use opencv use the calibration sample (under samples/cpp) from the opencv sources
  31260. and extract the k1 and k2 coefficients from the resulting matrix.
  31261. </p>
  31262. <p>Note that effectively the same filter is available in the open-source tools Krita and
  31263. Digikam from the KDE project.
  31264. </p>
  31265. <p>In contrast to the <a class="ref" href="#vignette">vignette</a> filter, which can also be used to compensate lens errors,
  31266. this filter corrects the distortion of the image, whereas <a class="ref" href="#vignette">vignette</a> corrects the
  31267. brightness distribution, so you may want to use both filters together in certain
  31268. cases, though you will have to take care of ordering, i.e. whether vignetting should
  31269. be applied before or after lens correction.
  31270. </p>
  31271. <a name="Options-37"></a>
  31272. <h4 class="subsection">32.140.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-37" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-37" aria-hidden="true">TOC</a></span></h4>
  31273. <p>The filter accepts the following options:
  31274. </p>
  31275. <dl class="table">
  31276. <dt><samp class="option">cx</samp></dt>
  31277. <dd><p>Relative x-coordinate of the focal point of the image, and thereby the center of the
  31278. distortion. This value has a range [0,1] and is expressed as fractions of the image
  31279. width. Default is 0.5.
  31280. </p></dd>
  31281. <dt><samp class="option">cy</samp></dt>
  31282. <dd><p>Relative y-coordinate of the focal point of the image, and thereby the center of the
  31283. distortion. This value has a range [0,1] and is expressed as fractions of the image
  31284. height. Default is 0.5.
  31285. </p></dd>
  31286. <dt><samp class="option">k1</samp></dt>
  31287. <dd><p>Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means
  31288. no correction. Default is 0.
  31289. </p></dd>
  31290. <dt><samp class="option">k2</samp></dt>
  31291. <dd><p>Coefficient of the double quadratic correction term. This value has a range [-1,1].
  31292. 0 means no correction. Default is 0.
  31293. </p></dd>
  31294. <dt><samp class="option">i</samp></dt>
  31295. <dd><p>Set interpolation type. Can be <code class="code">nearest</code> or <code class="code">bilinear</code>.
  31296. Default is <code class="code">nearest</code>.
  31297. </p></dd>
  31298. <dt><samp class="option">fc</samp></dt>
  31299. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  31300. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  31301. manual</a>. Default color is <code class="code">black@0</code>.
  31302. </p></dd>
  31303. </dl>
  31304. <p>The formula that generates the correction is:
  31305. </p>
  31306. <p><var class="var">r_src</var> = <var class="var">r_tgt</var> * (1 + <var class="var">k1</var> * (<var class="var">r_tgt</var> / <var class="var">r_0</var>)^2 + <var class="var">k2</var> * (<var class="var">r_tgt</var> / <var class="var">r_0</var>)^4)
  31307. </p>
  31308. <p>where <var class="var">r_0</var> is halve of the image diagonal and <var class="var">r_src</var> and <var class="var">r_tgt</var> are the
  31309. distances from the focal point in the source and target images, respectively.
  31310. </p>
  31311. <a name="Commands-104"></a>
  31312. <h4 class="subsection">32.140.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-104" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-104" aria-hidden="true">TOC</a></span></h4>
  31313. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31314. </p>
  31315. <a name="lensfun"></a>
  31316. <h3 class="section">32.141 lensfun<span class="pull-right"><a class="anchor hidden-xs" href="#lensfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lensfun" aria-hidden="true">TOC</a></span></h3>
  31317. <p>Apply lens correction via the lensfun library (<a class="url" href="http://lensfun.sourceforge.net/">http://lensfun.sourceforge.net/</a>).
  31318. </p>
  31319. <p>The <code class="code">lensfun</code> filter requires the camera make, camera model, and lens model
  31320. to apply the lens correction. The filter will load the lensfun database and
  31321. query it to find the corresponding camera and lens entries in the database. As
  31322. long as these entries can be found with the given options, the filter can
  31323. perform corrections on frames. Note that incomplete strings will result in the
  31324. filter choosing the best match with the given options, and the filter will
  31325. output the chosen camera and lens models (logged with level &quot;info&quot;). You must
  31326. provide the make, camera model, and lens model as they are required.
  31327. </p>
  31328. <p>To obtain a list of available makes and models, leave out one or both of <code class="code">make</code> and
  31329. <code class="code">model</code> options. The filter will send the full list to the log with level <code class="code">INFO</code>.
  31330. The first column is the make and the second column is the model.
  31331. To obtain a list of available lenses, set any values for make and model and leave out the
  31332. <code class="code">lens_model</code> option. The filter will send the full list of lenses in the log with level
  31333. <code class="code">INFO</code>. The ffmpeg tool will exit after the list is printed.
  31334. </p>
  31335. <p>The filter accepts the following options:
  31336. </p>
  31337. <dl class="table">
  31338. <dt><samp class="option">make</samp></dt>
  31339. <dd><p>The make of the camera (for example, &quot;Canon&quot;). This option is required.
  31340. </p>
  31341. </dd>
  31342. <dt><samp class="option">model</samp></dt>
  31343. <dd><p>The model of the camera (for example, &quot;Canon EOS 100D&quot;). This option is
  31344. required.
  31345. </p>
  31346. </dd>
  31347. <dt><samp class="option">lens_model</samp></dt>
  31348. <dd><p>The model of the lens (for example, &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;). This
  31349. option is required.
  31350. </p>
  31351. </dd>
  31352. <dt><samp class="option">db_path</samp></dt>
  31353. <dd><p>The full path to the lens database folder. If not set, the filter will attempt to
  31354. load the database from the install path when the library was built. Default is unset.
  31355. </p>
  31356. </dd>
  31357. <dt><samp class="option">mode</samp></dt>
  31358. <dd><p>The type of correction to apply. The following values are valid options:
  31359. </p>
  31360. <dl class="table">
  31361. <dt>&lsquo;<samp class="samp">vignetting</samp>&rsquo;</dt>
  31362. <dd><p>Enables fixing lens vignetting.
  31363. </p>
  31364. </dd>
  31365. <dt>&lsquo;<samp class="samp">geometry</samp>&rsquo;</dt>
  31366. <dd><p>Enables fixing lens geometry. This is the default.
  31367. </p>
  31368. </dd>
  31369. <dt>&lsquo;<samp class="samp">subpixel</samp>&rsquo;</dt>
  31370. <dd><p>Enables fixing chromatic aberrations.
  31371. </p>
  31372. </dd>
  31373. <dt>&lsquo;<samp class="samp">vig_geo</samp>&rsquo;</dt>
  31374. <dd><p>Enables fixing lens vignetting and lens geometry.
  31375. </p>
  31376. </dd>
  31377. <dt>&lsquo;<samp class="samp">vig_subpixel</samp>&rsquo;</dt>
  31378. <dd><p>Enables fixing lens vignetting and chromatic aberrations.
  31379. </p>
  31380. </dd>
  31381. <dt>&lsquo;<samp class="samp">distortion</samp>&rsquo;</dt>
  31382. <dd><p>Enables fixing both lens geometry and chromatic aberrations.
  31383. </p>
  31384. </dd>
  31385. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  31386. <dd><p>Enables all possible corrections.
  31387. </p>
  31388. </dd>
  31389. </dl>
  31390. </dd>
  31391. <dt><samp class="option">focal_length</samp></dt>
  31392. <dd><p>The focal length of the image/video (zoom; expected constant for video). For
  31393. example, a 18&ndash;55mm lens has focal length range of [18&ndash;55], so a value in that
  31394. range should be chosen when using that lens. Default 18.
  31395. </p>
  31396. </dd>
  31397. <dt><samp class="option">aperture</samp></dt>
  31398. <dd><p>The aperture of the image/video (expected constant for video). Note that
  31399. aperture is only used for vignetting correction. Default 3.5.
  31400. </p>
  31401. </dd>
  31402. <dt><samp class="option">focus_distance</samp></dt>
  31403. <dd><p>The focus distance of the image/video (expected constant for video). Note that
  31404. focus distance is only used for vignetting and only slightly affects the
  31405. vignetting correction process. If unknown, leave it at the default value (which
  31406. is 1000).
  31407. </p>
  31408. </dd>
  31409. <dt><samp class="option">scale</samp></dt>
  31410. <dd><p>The scale factor which is applied after transformation. After correction the
  31411. video is no longer necessarily rectangular. This parameter controls how much of
  31412. the resulting image is visible. The value 0 means that a value will be chosen
  31413. automatically such that there is little or no unmapped area in the output
  31414. image. 1.0 means that no additional scaling is done. Lower values may result
  31415. in more of the corrected image being visible, while higher values may avoid
  31416. unmapped areas in the output.
  31417. </p>
  31418. </dd>
  31419. <dt><samp class="option">target_geometry</samp></dt>
  31420. <dd><p>The target geometry of the output image/video. The following values are valid
  31421. options:
  31422. </p>
  31423. <dl class="table">
  31424. <dt>&lsquo;<samp class="samp">rectilinear (default)</samp>&rsquo;</dt>
  31425. <dt>&lsquo;<samp class="samp">fisheye</samp>&rsquo;</dt>
  31426. <dt>&lsquo;<samp class="samp">panoramic</samp>&rsquo;</dt>
  31427. <dt>&lsquo;<samp class="samp">equirectangular</samp>&rsquo;</dt>
  31428. <dt>&lsquo;<samp class="samp">fisheye_orthographic</samp>&rsquo;</dt>
  31429. <dt>&lsquo;<samp class="samp">fisheye_stereographic</samp>&rsquo;</dt>
  31430. <dt>&lsquo;<samp class="samp">fisheye_equisolid</samp>&rsquo;</dt>
  31431. <dt>&lsquo;<samp class="samp">fisheye_thoby</samp>&rsquo;</dt>
  31432. </dl>
  31433. </dd>
  31434. <dt><samp class="option">reverse</samp></dt>
  31435. <dd><p>Apply the reverse of image correction (instead of correcting distortion, apply
  31436. it).
  31437. </p>
  31438. </dd>
  31439. <dt><samp class="option">interpolation</samp></dt>
  31440. <dd><p>The type of interpolation used when correcting distortion. The following values
  31441. are valid options:
  31442. </p>
  31443. <dl class="table">
  31444. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  31445. <dt>&lsquo;<samp class="samp">linear (default)</samp>&rsquo;</dt>
  31446. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  31447. </dl>
  31448. </dd>
  31449. </dl>
  31450. <a name="Examples-108"></a>
  31451. <h4 class="subsection">32.141.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-108" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-108" aria-hidden="true">TOC</a></span></h4>
  31452. <ul class="itemize mark-bullet">
  31453. <li>Apply lens correction with make &quot;Canon&quot;, camera model &quot;Canon EOS 100D&quot;, and lens
  31454. model &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot; with focal length of &quot;18&quot; and
  31455. aperture of &quot;8.0&quot;.
  31456. <div class="example">
  31457. <pre class="example-preformatted">ffmpeg -i input.mov -vf lensfun=make=Canon:model=&quot;Canon EOS 100D&quot;:lens_model=&quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;:focal_length=18:aperture=8 -c:v h264 -b:v 8000k output.mov
  31458. </pre></div>
  31459. </li><li>Apply the same as before, but only for the first 5 seconds of video.
  31460. <div class="example">
  31461. <pre class="example-preformatted">ffmpeg -i input.mov -vf lensfun=make=Canon:model=&quot;Canon EOS 100D&quot;:lens_model=&quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;:focal_length=18:aperture=8:enable='lte(t\,5)' -c:v h264 -b:v 8000k output.mov
  31462. </pre></div>
  31463. </li></ul>
  31464. <a name="lcevc"></a>
  31465. <h3 class="section">32.142 lcevc<span class="pull-right"><a class="anchor hidden-xs" href="#lcevc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lcevc" aria-hidden="true">TOC</a></span></h3>
  31466. <p>Low Complexity Enhancement Video Codec filter based on liblcevc_dec
  31467. (<a class="url" href="https://github.com/v-novaltd/LCEVCdec">https://github.com/v-novaltd/LCEVCdec</a>).
  31468. </p>
  31469. <a name="libplacebo"></a>
  31470. <h3 class="section">32.143 libplacebo<span class="pull-right"><a class="anchor hidden-xs" href="#libplacebo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libplacebo" aria-hidden="true">TOC</a></span></h3>
  31471. <p>Flexible GPU-accelerated processing filter based on libplacebo
  31472. (<a class="url" href="https://code.videolan.org/videolan/libplacebo">https://code.videolan.org/videolan/libplacebo</a>).
  31473. </p>
  31474. <a name="Options-38"></a>
  31475. <h4 class="subsection">32.143.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-38" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-38" aria-hidden="true">TOC</a></span></h4>
  31476. <p>The options for this filter are divided into the following sections:
  31477. </p>
  31478. <a name="Output-mode"></a>
  31479. <h4 class="subsubsection">32.143.1.1 Output mode<span class="pull-right"><a class="anchor hidden-xs" href="#Output-mode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Output-mode" aria-hidden="true">TOC</a></span></h4>
  31480. <p>These options control the overall output mode. By default, libplacebo will try
  31481. to preserve the source colorimetry and size as best as it can, but it will
  31482. apply any embedded film grain, dolby vision metadata or anamorphic SAR present
  31483. in source frames.
  31484. </p><dl class="table">
  31485. <dt><samp class="option">inputs</samp></dt>
  31486. <dd><p>Set the number of inputs. This can be used, alongside the <code class="code">idx</code> variable,
  31487. to allow placing/blending multiple inputs inside the output frame. This
  31488. effectively enables functionality similar to <a class="ref" href="#hstack">hstack</a>, <a class="ref" href="#overlay">overlay</a>, etc.
  31489. </p>
  31490. </dd>
  31491. <dt><samp class="option">w</samp></dt>
  31492. <dt><samp class="option">h</samp></dt>
  31493. <dd><p>Set the output video dimension expression. Default values are <code class="code">iw</code> and
  31494. <code class="code">ih</code>.
  31495. </p>
  31496. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  31497. </p>
  31498. </dd>
  31499. <dt><samp class="option">crop_x</samp></dt>
  31500. <dt><samp class="option">crop_y</samp></dt>
  31501. <dd><p>Set the input crop x/y expressions, default values are <code class="code">(iw-cw)/2</code> and
  31502. <code class="code">(ih-ch)/2</code>.
  31503. </p>
  31504. </dd>
  31505. <dt><samp class="option">crop_w</samp></dt>
  31506. <dt><samp class="option">crop_h</samp></dt>
  31507. <dd><p>Set the input crop width/height expressions, default values are <code class="code">iw</code> and
  31508. <code class="code">ih</code>.
  31509. </p>
  31510. </dd>
  31511. <dt><samp class="option">pos_x</samp></dt>
  31512. <dt><samp class="option">pos_y</samp></dt>
  31513. <dd><p>Set the output placement x/y expressions, default values are <code class="code">(ow-pw)/2</code>
  31514. and <code class="code">(oh-ph)/2</code>.
  31515. </p>
  31516. </dd>
  31517. <dt><samp class="option">pos_w</samp></dt>
  31518. <dt><samp class="option">pos_h</samp></dt>
  31519. <dd><p>Set the output placement width/height expressions, default values are <code class="code">ow</code>
  31520. and <code class="code">oh</code>.
  31521. </p>
  31522. </dd>
  31523. <dt><samp class="option">rotate</samp></dt>
  31524. <dd><p>Rotate the input frame clockwise by the specified angle.
  31525. </p>
  31526. <dl class="table">
  31527. <dt>&lsquo;<samp class="samp">0, 360</samp>&rsquo;</dt>
  31528. <dt>&lsquo;<samp class="samp">90</samp>&rsquo;</dt>
  31529. <dt>&lsquo;<samp class="samp">180</samp>&rsquo;</dt>
  31530. <dt>&lsquo;<samp class="samp">270</samp>&rsquo;</dt>
  31531. </dl>
  31532. </dd>
  31533. <dt><samp class="option">fps</samp></dt>
  31534. <dd><p>Set the output frame rate. This can be rational, e.g. <code class="code">60000/1001</code>. If
  31535. set to the special string <code class="code">none</code> (the default), input timestamps will
  31536. instead be passed through to the output unmodified. Otherwise, the input video
  31537. frames will be interpolated as necessary to rescale the video to the specified
  31538. target framerate, in a manner as determined by the <samp class="option">frame_mixer</samp> option.
  31539. </p>
  31540. </dd>
  31541. <dt><samp class="option">format</samp></dt>
  31542. <dd><p>Set the output format override. If unset (the default), frames will be output
  31543. in the same format as the respective input frames. Otherwise, format conversion
  31544. will be performed.
  31545. </p>
  31546. </dd>
  31547. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  31548. <dt><samp class="option">force_divisible_by</samp></dt>
  31549. <dd><p>Work the same as the identical <a class="ref" href="#scale">scale</a> filter options. Note that
  31550. <samp class="option">force_divisible_by</samp> also works with <code class="code">fit_sense=constraint</code>.
  31551. </p>
  31552. </dd>
  31553. <dt><samp class="option">reset_sar</samp></dt>
  31554. <dd><p>If enabled, output frames will always have a pixel aspect ratio of 1:1. If
  31555. disabled (the default), any aspect ratio mismatches, including those from
  31556. e.g. anamorphic video sources, are forwarded to the output pixel aspect ratio.
  31557. </p>
  31558. </dd>
  31559. <dt><samp class="option">normalize_sar</samp></dt>
  31560. <dd><p>Like <samp class="option">reset_sar</samp>, but instead of stretching the video content to fill
  31561. the new output aspect ratio, the content is instead padded or cropped as
  31562. necessary. Mutually exclusive with <samp class="option">fit_mode</samp>. Disabled by default.
  31563. </p>
  31564. </dd>
  31565. <dt><samp class="option">pad_crop_ratio</samp></dt>
  31566. <dd><p>Specifies a ratio (between <code class="code">0.0</code> and <code class="code">1.0</code>) between padding and
  31567. cropping when the input aspect ratio does not match the output aspect ratio and
  31568. <samp class="option">normalize_sar</samp> is in effect. The default of <code class="code">0.0</code> always pads the
  31569. content with black borders, while a value of <code class="code">1.0</code> always crops off parts
  31570. of the content. Intermediate values are possible, leading to a mix of the two
  31571. approaches.
  31572. </p>
  31573. </dd>
  31574. <dt><samp class="option">fit_mode</samp></dt>
  31575. <dd><p>Specify the content fit strategy according to a list of predefined modes.
  31576. Determines how the input image is to be placed inside the destination crop
  31577. rectangle (as defined by <code class="code">pos_x/y</code> and <code class="code">pos_w/h</code>). The names and
  31578. their implementations are taken from the CSS &rsquo;object-fit&rsquo; property. Note that
  31579. this option is mutually exclusive with <samp class="option">normalize_sar</samp>. Defaults to
  31580. <code class="code">fill</code>. Valid values are:
  31581. </p>
  31582. <dl class="table">
  31583. <dt>&lsquo;<samp class="samp">fill</samp>&rsquo;</dt>
  31584. <dd><p>Stretch the input to the output rectangle, ignoring aspect ratio mismatches.
  31585. Note that unless <samp class="option">reset_sar</samp> is also enabled, the output will still
  31586. have the correct pixel aspect ratio tagged.
  31587. </p>
  31588. </dd>
  31589. <dt>&lsquo;<samp class="samp">contain</samp>&rsquo;</dt>
  31590. <dd><p>Scale the input to fit inside the output, preserving aspect ratio by padding.
  31591. Equivalent to <samp class="option">normalize_sar</samp> with <samp class="option">pad_crop_ratio</samp> set to
  31592. <code class="code">0.0</code>.
  31593. </p>
  31594. </dd>
  31595. <dt>&lsquo;<samp class="samp">cover</samp>&rsquo;</dt>
  31596. <dd><p>Scale the input to fill the output, preserving aspect ratio by cropping.
  31597. Equivalent to <samp class="option">normalize_sar</samp> with <samp class="option">pad_crop_ratio</samp> set to
  31598. <code class="code">1.0</code>.
  31599. </p>
  31600. </dd>
  31601. <dt>&lsquo;<samp class="samp">none, place</samp>&rsquo;</dt>
  31602. <dd><p>Don&rsquo;t scale the input. The input will be placed inside the output rectangle at
  31603. its natural size; which may result in additional padding or cropping.
  31604. </p>
  31605. </dd>
  31606. <dt>&lsquo;<samp class="samp">scale_down</samp>&rsquo;</dt>
  31607. <dd><p>Scale the input down as much as needed to fit inside the output. Equivalent
  31608. to either <code class="code">contain</code> or <code class="code">none</code>, depending on whether the input is
  31609. larger than the output or not.
  31610. </p></dd>
  31611. </dl>
  31612. </dd>
  31613. <dt><samp class="option">fit_sense</samp></dt>
  31614. <dd><p>When <samp class="option">fit_mode</samp> is in use, this option controls how the fit strategy
  31615. is applied against the specified output resolution. Mutually exclusive with
  31616. <samp class="option">force_original_aspect_ratio</samp>. Valid values are:
  31617. </p>
  31618. <dl class="table">
  31619. <dt>&lsquo;<samp class="samp">target</samp>&rsquo;</dt>
  31620. <dd><p>The computed output resolution is taken as the exact size of the output frame.
  31621. This is the default behavior.
  31622. </p>
  31623. </dd>
  31624. <dt>&lsquo;<samp class="samp">constraint</samp>&rsquo;</dt>
  31625. <dd><p>The computed output resolution is a size reference against which the fit mode
  31626. is applied, enlarging or decreasing the true frame size as needed to fit the
  31627. content.
  31628. </p></dd>
  31629. </dl>
  31630. </dd>
  31631. <dt><samp class="option">fillcolor</samp></dt>
  31632. <dd><p>Set the color used to fill the output area not covered by the output image, for
  31633. example as a result of <samp class="option">normalize_sar</samp>. For the general syntax of this
  31634. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  31635. manual</a>. Defaults to <code class="code">black@0</code>.
  31636. </p>
  31637. </dd>
  31638. <dt><samp class="option">corner_rounding</samp></dt>
  31639. <dd><p>Render frames with rounded corners. The value, given as a float ranging from
  31640. <code class="code">0.0</code> to <code class="code">1.0</code>, indicates the relative degree of rounding, from fully
  31641. square to fully circular. In other words, it gives the radius divided by half
  31642. the smaller side length. Defaults to <code class="code">0.0</code>.
  31643. </p>
  31644. </dd>
  31645. <dt><samp class="option">lut</samp></dt>
  31646. <dd><p>Specifies a custom LUT (in Adobe .cube format) to apply to the colors
  31647. as part of color conversion. The exact interpretation depends on the value
  31648. of <samp class="option">lut_type</samp>.
  31649. </p>
  31650. </dd>
  31651. <dt><samp class="option">lut_type</samp></dt>
  31652. <dd><p>Controls the interpretation of color values fed to and from the LUT
  31653. specified as <samp class="option">lut</samp>. Valid values are:
  31654. </p>
  31655. <dl class="table">
  31656. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  31657. <dd><p>Chooses the interpretation of the LUT automatically from tagged
  31658. metadata, and otherwise falls back to &lsquo;<samp class="samp">native</samp>&rsquo;. (Default)
  31659. </p>
  31660. </dd>
  31661. <dt>&lsquo;<samp class="samp">native</samp>&rsquo;</dt>
  31662. <dd><p>Applied to raw image contents in its native RGB colorspace (non-linear
  31663. light), before conversion to the output color space.
  31664. </p>
  31665. </dd>
  31666. <dt>&lsquo;<samp class="samp">normalized</samp>&rsquo;</dt>
  31667. <dd><p>Applied to the normalized RGB image contents, in linear light, before
  31668. conversion to the output color space.
  31669. </p>
  31670. </dd>
  31671. <dt>&lsquo;<samp class="samp">conversion</samp>&rsquo;</dt>
  31672. <dd><p>Fully replaces the conversion from the image color space to the output
  31673. color space. If such a LUT is present, it has the highest priority, and
  31674. overrides any ICC profiles, as well as options related to tone mapping
  31675. and output colorimetry (<samp class="option">color_primaries</samp>, <samp class="option">color_trc</samp>).
  31676. </p>
  31677. </dd>
  31678. </dl>
  31679. </dd>
  31680. <dt><samp class="option">extra_opts</samp></dt>
  31681. <dd><p>Pass extra libplacebo internal configuration options. These can be specified
  31682. as a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;. The following example
  31683. shows how to configure a custom filter kernel (&quot;EWA LanczosSharp&quot;) and use it
  31684. to double the input image resolution:
  31685. </p>
  31686. <div class="example">
  31687. <pre class="example-preformatted">-vf &quot;libplacebo=w=iw*2:h=ih*2:extra_opts='upscaler=custom\:upscaler_preset=ewa_lanczos\:upscaler_blur=0.9812505644269356'&quot;
  31688. </pre></div>
  31689. </dd>
  31690. <dt><samp class="option">shader_cache</samp></dt>
  31691. <dd><p>File path of a cache directory that libplacebo will use to store and load
  31692. cached shader objects. This cache is not cleaned up automatically. If the
  31693. path does not end in a directory separator, the generated filenames will be
  31694. effectively prefixed by the last path component. All directories must already
  31695. exist.
  31696. </p>
  31697. <div class="example">
  31698. <pre class="example-preformatted">-vf &quot;libplacebo=shader_cache=/tmp/pl-shader-&quot;
  31699. </pre></div>
  31700. </dd>
  31701. <dt><samp class="option">colorspace</samp></dt>
  31702. <dt><samp class="option">color_primaries</samp></dt>
  31703. <dt><samp class="option">color_trc</samp></dt>
  31704. <dt><samp class="option">range</samp></dt>
  31705. <dt><samp class="option">chroma_location</samp></dt>
  31706. <dd><p>Configure the colorspace that output frames will be delivered in. The default
  31707. value of <code class="code">auto</code> outputs frames in the same format as the input frames,
  31708. leading to no change. For any other value, conversion will be performed.
  31709. </p>
  31710. <p>See the <a class="ref" href="#setparams">setparams</a> filter for a list of possible values.
  31711. </p>
  31712. </dd>
  31713. <dt><samp class="option">alpha_mode</samp></dt>
  31714. <dd><p>Choose the desired output alpha mode, when the output format has an alpha
  31715. channel. See the <a class="ref" href="#setparams">setparams</a> filter for a list of possible values.
  31716. </p>
  31717. </dd>
  31718. <dt><samp class="option">apply_filmgrain</samp></dt>
  31719. <dd><p>Apply film grain (e.g. AV1 or H.274) if present in source frames, and strip
  31720. it from the output. Enabled by default.
  31721. </p>
  31722. </dd>
  31723. <dt><samp class="option">apply_dolbyvision</samp></dt>
  31724. <dd><p>Apply Dolby Vision RPU metadata if present in source frames, and strip it from
  31725. the output. Enabled by default. Note that Dolby Vision will always output
  31726. BT.2020+PQ, overriding the usual input frame metadata. These will also be
  31727. picked as the values of <code class="code">auto</code> for the respective frame output options.
  31728. </p></dd>
  31729. </dl>
  31730. <p>In addition to the expression constants documented for the <a class="ref" href="#scale">scale</a> filter,
  31731. the <samp class="option">crop_w</samp>, <samp class="option">crop_h</samp>, <samp class="option">crop_x</samp>, <samp class="option">crop_y</samp>,
  31732. <samp class="option">pos_w</samp>, <samp class="option">pos_h</samp>, <samp class="option">pos_x</samp> and <samp class="option">pos_y</samp> options can
  31733. also contain the following constants:
  31734. </p>
  31735. <dl class="table">
  31736. <dt><samp class="option">in_idx, idx</samp></dt>
  31737. <dd><p>The (0-based) numeric index of the currently active input stream.
  31738. </p></dd>
  31739. <dt><samp class="option">crop_w, cw</samp></dt>
  31740. <dt><samp class="option">crop_h, ch</samp></dt>
  31741. <dd><p>The computed values of <samp class="option">crop_w</samp> and <samp class="option">crop_h</samp>.
  31742. </p>
  31743. </dd>
  31744. <dt><samp class="option">pos_w, pw</samp></dt>
  31745. <dt><samp class="option">pos_h, ph</samp></dt>
  31746. <dd><p>The computed values of <samp class="option">pos_w</samp> and <samp class="option">pos_h</samp>.
  31747. </p>
  31748. </dd>
  31749. <dt><samp class="option">in_t, t</samp></dt>
  31750. <dd><p>The input frame timestamp, in seconds. NAN if input timestamp is unknown.
  31751. </p>
  31752. </dd>
  31753. <dt><samp class="option">out_t, ot</samp></dt>
  31754. <dd><p>The input frame timestamp, in seconds. NAN if input timestamp is unknown.
  31755. </p>
  31756. </dd>
  31757. <dt><samp class="option">n</samp></dt>
  31758. <dd><p>The input frame number, starting with 0.
  31759. </p></dd>
  31760. </dl>
  31761. <a name="Scaling"></a>
  31762. <h4 class="subsubsection">32.143.1.2 Scaling<span class="pull-right"><a class="anchor hidden-xs" href="#Scaling" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Scaling" aria-hidden="true">TOC</a></span></h4>
  31763. <p>The options in this section control how libplacebo performs upscaling and (if
  31764. necessary) downscaling. Note that libplacebo will always internally operate on
  31765. 4:4:4 content, so any sub-sampled chroma formats such as <code class="code">yuv420p</code> will
  31766. necessarily be upsampled and downsampled as part of the rendering process. That
  31767. means scaling might be in effect even if the source and destination resolution
  31768. are the same.
  31769. </p><dl class="table">
  31770. <dt><samp class="option">upscaler</samp></dt>
  31771. <dt><samp class="option">downscaler</samp></dt>
  31772. <dd><p>Configure the filter kernel used for upscaling and downscaling. The respective
  31773. defaults are <code class="code">spline36</code> and <code class="code">mitchell</code>. For a full list of possible
  31774. values, pass <code class="code">help</code> to these options. The most important values are:
  31775. </p><dl class="table">
  31776. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  31777. <dd><p>Forces the use of built-in GPU texture sampling (typically bilinear). Extremely
  31778. fast but poor quality, especially when downscaling.
  31779. </p>
  31780. </dd>
  31781. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  31782. <dd><p>Bilinear interpolation. Can generally be done for free on GPUs, except when
  31783. doing so would lead to aliasing. Fast and low quality.
  31784. </p>
  31785. </dd>
  31786. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  31787. <dd><p>Nearest-neighbour interpolation. Sharp but highly aliasing.
  31788. </p>
  31789. </dd>
  31790. <dt>&lsquo;<samp class="samp">oversample</samp>&rsquo;</dt>
  31791. <dd><p>Algorithm that looks visually similar to nearest-neighbour interpolation but
  31792. tries to preserve pixel aspect ratio. Good for pixel art, since it results in
  31793. minimal distortion of the artistic appearance.
  31794. </p>
  31795. </dd>
  31796. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  31797. <dd><p>Standard sinc-sinc interpolation kernel.
  31798. </p>
  31799. </dd>
  31800. <dt>&lsquo;<samp class="samp">spline36</samp>&rsquo;</dt>
  31801. <dd><p>Cubic spline approximation of lanczos. No difference in performance, but has
  31802. very slightly less ringing.
  31803. </p>
  31804. </dd>
  31805. <dt>&lsquo;<samp class="samp">ewa_lanczos</samp>&rsquo;</dt>
  31806. <dd><p>Elliptically weighted average version of lanczos, based on a jinc-jinc kernel.
  31807. This is also popularly referred to as just &quot;Jinc scaling&quot;. Slow but very high
  31808. quality.
  31809. </p>
  31810. </dd>
  31811. <dt>&lsquo;<samp class="samp">gaussian</samp>&rsquo;</dt>
  31812. <dd><p>Gaussian kernel. Has certain ideal mathematical properties, but subjectively
  31813. very blurry.
  31814. </p>
  31815. </dd>
  31816. <dt>&lsquo;<samp class="samp">mitchell</samp>&rsquo;</dt>
  31817. <dd><p>Cubic BC spline with parameters recommended by Mitchell and Netravali. Very
  31818. little ringing.
  31819. </p></dd>
  31820. </dl>
  31821. </dd>
  31822. <dt><samp class="option">frame_mixer</samp></dt>
  31823. <dd><p>Controls the kernel used for mixing frames temporally. The default value is
  31824. <code class="code">none</code>, which disables frame mixing. For a full list of possible values,
  31825. pass <code class="code">help</code> to this option. The most important values are:
  31826. </p><dl class="table">
  31827. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  31828. <dd><p>Disables frame mixing, giving a result equivalent to &quot;nearest neighbour&quot;
  31829. semantics.
  31830. </p>
  31831. </dd>
  31832. <dt>&lsquo;<samp class="samp">oversample</samp>&rsquo;</dt>
  31833. <dd><p>Oversamples the input video to create a &quot;Smooth Motion&quot;-type effect: if an
  31834. output frame would exactly fall on the transition between two video frames, it
  31835. is blended according to the relative overlap. This is the recommended option
  31836. whenever preserving the original subjective appearance is desired.
  31837. </p>
  31838. </dd>
  31839. <dt>&lsquo;<samp class="samp">mitchell_clamp</samp>&rsquo;</dt>
  31840. <dd><p>Larger filter kernel that smoothly interpolates multiple frames in a manner
  31841. designed to eliminate ringing and other artefacts as much as possible. This is
  31842. the recommended option wherever maximum visual smoothness is desired.
  31843. </p>
  31844. </dd>
  31845. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  31846. <dd><p>Linear blend/fade between frames. Especially useful for constructing e.g.
  31847. slideshows.
  31848. </p></dd>
  31849. </dl>
  31850. </dd>
  31851. <dt><samp class="option">antiringing</samp></dt>
  31852. <dd><p>Enables anti-ringing (for non-EWA filters). The value (between <code class="code">0.0</code> and
  31853. <code class="code">1.0</code>) configures the strength of the anti-ringing algorithm. May increase
  31854. aliasing if set too high. Disabled by default.
  31855. </p>
  31856. </dd>
  31857. <dt><samp class="option">sigmoid</samp></dt>
  31858. <dd><p>Enable sigmoidal compression during upscaling. Reduces ringing slightly.
  31859. Enabled by default.
  31860. </p></dd>
  31861. </dl>
  31862. <a name="Deinterlacing"></a>
  31863. <h4 class="subsubsection">32.143.1.3 Deinterlacing<span class="pull-right"><a class="anchor hidden-xs" href="#Deinterlacing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Deinterlacing" aria-hidden="true">TOC</a></span></h4>
  31864. <p>Deinterlacing is automatically supported when frames are tagged as interlaced,
  31865. however frames are not deinterlaced unless a deinterlacing algorithm is chosen.
  31866. </p><dl class="table">
  31867. <dt><samp class="option">deinterlace</samp></dt>
  31868. <dd><p>The the deinterlacing algorithm to use.
  31869. </p><dl class="table">
  31870. <dt>&lsquo;<samp class="samp">weave</samp>&rsquo;</dt>
  31871. <dd><p>No deinterlacing, weave fields together into a single frame. This is the default.
  31872. </p></dd>
  31873. <dt>&lsquo;<samp class="samp">bob</samp>&rsquo;</dt>
  31874. <dd><p>Naive bob deinterlacing, simply repeat each field line twice.
  31875. </p></dd>
  31876. <dt>&lsquo;<samp class="samp">yadif</samp>&rsquo;</dt>
  31877. <dd><p>Yet another deinterlacing filter. See the <a class="ref" href="#yadif">yadif</a> filter for more details.
  31878. </p></dd>
  31879. <dt>&lsquo;<samp class="samp">bwdif</samp>&rsquo;</dt>
  31880. <dd><p>Bob weaver deinterlacing filter. See the <a class="ref" href="#bwdif">bwdif</a> filter for more details.
  31881. </p></dd>
  31882. </dl>
  31883. </dd>
  31884. <dt><samp class="option">skip_spatial_check</samp></dt>
  31885. <dd><p>Skip the spatial deinterlacing check when using <code class="code">yadif</code> deinterlacing.
  31886. </p>
  31887. </dd>
  31888. <dt><samp class="option">send_fields</samp></dt>
  31889. <dd><p>Output a frame for each field, rather than for each frame. Note that this will
  31890. always double the tagged output frame rate, even if the input does not contain
  31891. any interlaced frames. Disabled by default.
  31892. </p></dd>
  31893. </dl>
  31894. <a name="Debanding"></a>
  31895. <h4 class="subsubsection">32.143.1.4 Debanding<span class="pull-right"><a class="anchor hidden-xs" href="#Debanding" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Debanding" aria-hidden="true">TOC</a></span></h4>
  31896. <p>Libplacebo comes with a built-in debanding filter that is good at counteracting
  31897. many common sources of banding and blocking. Turning this on is highly
  31898. recommended whenever quality is desired.
  31899. </p><dl class="table">
  31900. <dt><samp class="option">deband</samp></dt>
  31901. <dd><p>Enable (fast) debanding algorithm. Disabled by default.
  31902. </p>
  31903. </dd>
  31904. <dt><samp class="option">deband_iterations</samp></dt>
  31905. <dd><p>Number of deband iterations of the debanding algorithm. Each iteration is
  31906. performed with progressively increased radius (and diminished threshold).
  31907. Recommended values are in the range <code class="code">1</code> to <code class="code">4</code>. Defaults to <code class="code">1</code>.
  31908. </p>
  31909. </dd>
  31910. <dt><samp class="option">deband_threshold</samp></dt>
  31911. <dd><p>Debanding filter strength. Higher numbers lead to more aggressive debanding.
  31912. Defaults to <code class="code">4.0</code>.
  31913. </p>
  31914. </dd>
  31915. <dt><samp class="option">deband_radius</samp></dt>
  31916. <dd><p>Debanding filter radius. A higher radius is better for slow gradients, while
  31917. a lower radius is better for steep gradients. Defaults to <code class="code">16.0</code>.
  31918. </p>
  31919. </dd>
  31920. <dt><samp class="option">deband_grain</samp></dt>
  31921. <dd><p>Amount of extra output grain to add. Helps hide imperfections. Defaults to
  31922. <code class="code">6.0</code>.
  31923. </p></dd>
  31924. </dl>
  31925. <a name="Color-adjustment"></a>
  31926. <h4 class="subsubsection">32.143.1.5 Color adjustment<span class="pull-right"><a class="anchor hidden-xs" href="#Color-adjustment" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Color-adjustment" aria-hidden="true">TOC</a></span></h4>
  31927. <p>A collection of subjective color controls. Not very rigorous, so the exact
  31928. effect will vary somewhat depending on the input primaries and colorspace.
  31929. </p><dl class="table">
  31930. <dt><samp class="option">brightness</samp></dt>
  31931. <dd><p>Brightness boost, between <code class="code">-1.0</code> and <code class="code">1.0</code>. Defaults to <code class="code">0.0</code>.
  31932. </p>
  31933. </dd>
  31934. <dt><samp class="option">contrast</samp></dt>
  31935. <dd><p>Contrast gain, between <code class="code">0.0</code> and <code class="code">16.0</code>. Defaults to <code class="code">1.0</code>.
  31936. </p>
  31937. </dd>
  31938. <dt><samp class="option">saturation</samp></dt>
  31939. <dd><p>Saturation gain, between <code class="code">0.0</code> and <code class="code">16.0</code>. Defaults to <code class="code">1.0</code>.
  31940. </p>
  31941. </dd>
  31942. <dt><samp class="option">hue</samp></dt>
  31943. <dd><p>Hue shift in radians, between <code class="code">-3.14</code> and <code class="code">3.14</code>. Defaults to
  31944. <code class="code">0.0</code>. This will rotate the UV subvector, defaulting to BT.709
  31945. coefficients for RGB inputs.
  31946. </p>
  31947. </dd>
  31948. <dt><samp class="option">gamma</samp></dt>
  31949. <dd><p>Gamma adjustment, between <code class="code">0.0</code> and <code class="code">16.0</code>. Defaults to <code class="code">1.0</code>.
  31950. </p>
  31951. </dd>
  31952. <dt><samp class="option">temperature</samp></dt>
  31953. <dd><p>Color temperature adjustment. Lower values make the output warmer/redder,
  31954. down to <code class="code">1667</code>, while higher values make the output cooler/bluer, up to
  31955. <code class="code">25000</code>. Defaults to <code class="code">6500</code> (neutral white).
  31956. </p>
  31957. </dd>
  31958. <dt><samp class="option">cones</samp></dt>
  31959. <dd><p>Cone model to use for color blindness simulation. Accepts any combination of
  31960. <code class="code">l</code>, <code class="code">m</code> and <code class="code">s</code>. Here are some examples:
  31961. </p><dl class="table">
  31962. <dt>&lsquo;<samp class="samp">m</samp>&rsquo;</dt>
  31963. <dd><p>Deuteranomaly / deuteranopia (affecting 3%-4% of the population)
  31964. </p></dd>
  31965. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  31966. <dd><p>Protanomaly / protanopia (affecting 1%-2% of the population)
  31967. </p></dd>
  31968. <dt>&lsquo;<samp class="samp">l+m</samp>&rsquo;</dt>
  31969. <dd><p>Monochromacy (very rare)
  31970. </p></dd>
  31971. <dt>&lsquo;<samp class="samp">l+m+s</samp>&rsquo;</dt>
  31972. <dd><p>Achromatopsy (complete loss of daytime vision, extremely rare)
  31973. </p></dd>
  31974. </dl>
  31975. </dd>
  31976. <dt><samp class="option">cone-strength</samp></dt>
  31977. <dd><p>Gain factor for the cones specified by <code class="code">cones</code>, between <code class="code">0.0</code> and
  31978. <code class="code">10.0</code>. A value of <code class="code">1.0</code> results in no change to color vision. A
  31979. value of <code class="code">0.0</code> (the default) simulates complete loss of those cones. Values
  31980. above <code class="code">1.0</code> result in exaggerating the differences between cones, which
  31981. may help compensate for reduced color vision.
  31982. </p></dd>
  31983. </dl>
  31984. <a name="Peak-detection"></a>
  31985. <h4 class="subsubsection">32.143.1.6 Peak detection<span class="pull-right"><a class="anchor hidden-xs" href="#Peak-detection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Peak-detection" aria-hidden="true">TOC</a></span></h4>
  31986. <p>To help deal with sources that only have static HDR10 metadata (or no tagging
  31987. whatsoever), libplacebo uses its own internal frame analysis compute shader to
  31988. analyze source frames and adapt the tone mapping function in realtime. If this
  31989. is too slow, or if exactly reproducible frame-perfect results are needed, it&rsquo;s
  31990. recommended to turn this feature off.
  31991. </p><dl class="table">
  31992. <dt><samp class="option">peak_detect</samp></dt>
  31993. <dd><p>Enable HDR peak detection. Ignores static MaxCLL/MaxFALL values in favor of
  31994. dynamic detection from the input. Note that the detected values do not get
  31995. written back to the output frames, they merely guide the internal tone mapping
  31996. process. Enabled by default.
  31997. </p>
  31998. </dd>
  31999. <dt><samp class="option">smoothing_period</samp></dt>
  32000. <dd><p>Peak detection smoothing period, between <code class="code">0.0</code> and <code class="code">1000.0</code>. Higher
  32001. values result in peak detection becoming less responsive to changes in the
  32002. input. Defaults to <code class="code">100.0</code>.
  32003. </p>
  32004. </dd>
  32005. <dt><samp class="option">scene_threshold_low</samp></dt>
  32006. <dt><samp class="option">scene_threshold_high</samp></dt>
  32007. <dd><p>Lower and upper thresholds for scene change detection. Expressed in a
  32008. logarithmic scale between <code class="code">0.0</code> and <code class="code">100.0</code>. Default to <code class="code">5.5</code>
  32009. and <code class="code">10.0</code>, respectively. Setting either to a negative value disables
  32010. this functionality.
  32011. </p>
  32012. </dd>
  32013. <dt><samp class="option">percentile</samp></dt>
  32014. <dd><p>Which percentile of the frame brightness histogram to use as the source peak
  32015. for tone-mapping. Defaults to <code class="code">99.995</code>, a fairly conservative value.
  32016. Setting this to <code class="code">100.0</code> disables frame histogram measurement and instead
  32017. uses the true peak brightness for tone-mapping.
  32018. </p></dd>
  32019. </dl>
  32020. <a name="Tone-mapping"></a>
  32021. <h4 class="subsubsection">32.143.1.7 Tone mapping<span class="pull-right"><a class="anchor hidden-xs" href="#Tone-mapping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Tone-mapping" aria-hidden="true">TOC</a></span></h4>
  32022. <p>The options in this section control how libplacebo performs tone-mapping and
  32023. gamut-mapping when dealing with mismatches between wide-gamut or HDR content.
  32024. In general, libplacebo relies on accurate source tagging and mastering display
  32025. gamut information to produce the best results.
  32026. </p><dl class="table">
  32027. <dt><samp class="option">gamut_mode</samp></dt>
  32028. <dd><p>How to handle out-of-gamut colors that can occur as a result of colorimetric
  32029. gamut mapping.
  32030. </p><dl class="table">
  32031. <dt>&lsquo;<samp class="samp">clip</samp>&rsquo;</dt>
  32032. <dd><p>Do nothing, simply clip out-of-range colors to the RGB volume. Low quality but
  32033. extremely fast.
  32034. </p></dd>
  32035. <dt>&lsquo;<samp class="samp">perceptual</samp>&rsquo;</dt>
  32036. <dd><p>Perceptually soft-clip colors to the gamut volume. This is the default.
  32037. </p></dd>
  32038. <dt>&lsquo;<samp class="samp">relative</samp>&rsquo;</dt>
  32039. <dd><p>Relative colorimetric hard-clip. Similar to <code class="code">perceptual</code> but without
  32040. the soft knee.
  32041. </p></dd>
  32042. <dt>&lsquo;<samp class="samp">saturation</samp>&rsquo;</dt>
  32043. <dd><p>Saturation mapping, maps primaries directly to primaries in RGB space.
  32044. Not recommended except for artificial computer graphics for which a bright,
  32045. saturated display is desired.
  32046. </p></dd>
  32047. <dt>&lsquo;<samp class="samp">absolute</samp>&rsquo;</dt>
  32048. <dd><p>Absolute colorimetric hard-clip. Performs no adjustment of the white point.
  32049. </p></dd>
  32050. <dt>&lsquo;<samp class="samp">desaturate</samp>&rsquo;</dt>
  32051. <dd><p>Hard-desaturates out-of-gamut colors towards white, while preserving the
  32052. luminance. Has a tendency to distort the visual appearance of bright objects.
  32053. </p></dd>
  32054. <dt>&lsquo;<samp class="samp">darken</samp>&rsquo;</dt>
  32055. <dd><p>Linearly reduces content brightness to preserves saturated details, followed by
  32056. clipping the remaining out-of-gamut colors.
  32057. </p></dd>
  32058. <dt>&lsquo;<samp class="samp">warn</samp>&rsquo;</dt>
  32059. <dd><p>Highlight out-of-gamut pixels (by inverting/marking them).
  32060. </p></dd>
  32061. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  32062. <dd><p>Linearly reduces chromaticity of the entire image to make it fit within the
  32063. target color volume. Be careful when using this on BT.2020 sources without
  32064. proper mastering metadata, as doing so will lead to excessive desaturation.
  32065. </p></dd>
  32066. </dl>
  32067. </dd>
  32068. <dt><samp class="option">tonemapping</samp></dt>
  32069. <dd><p>Tone-mapping algorithm to use. Available values are:
  32070. </p><dl class="table">
  32071. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  32072. <dd><p>Automatic selection based on internal heuristics. This is the default.
  32073. </p></dd>
  32074. <dt>&lsquo;<samp class="samp">clip</samp>&rsquo;</dt>
  32075. <dd><p>Performs no tone-mapping, just clips out-of-range colors. Retains perfect color
  32076. accuracy for in-range colors but completely destroys out-of-range information.
  32077. Does not perform any black point adaptation. Not configurable.
  32078. </p></dd>
  32079. <dt>&lsquo;<samp class="samp">st2094-40</samp>&rsquo;</dt>
  32080. <dd><p>EETF from SMPTE ST 2094-40 Annex B, which applies the Bezier curves from HDR10+
  32081. dynamic metadata based on Bezier curves to perform tone-mapping. The OOTF used
  32082. is adjusted based on the ratio between the targeted and actual display peak
  32083. luminances.
  32084. </p></dd>
  32085. <dt>&lsquo;<samp class="samp">st2094-10</samp>&rsquo;</dt>
  32086. <dd><p>EETF from SMPTE ST 2094-10 Annex B.2, which takes into account the input signal
  32087. average luminance in addition to the maximum/minimum. The configurable contrast
  32088. parameter influences the slope of the linear output segment, defaulting to
  32089. <code class="code">1.0</code> for no increase/decrease in contrast. Note that this does not
  32090. currently include the subjective gain/offset/gamma controls defined in Annex
  32091. B.3.
  32092. </p></dd>
  32093. <dt>&lsquo;<samp class="samp">bt.2390</samp>&rsquo;</dt>
  32094. <dd><p>EETF from the ITU-R Report BT.2390, a hermite spline roll-off with linear
  32095. segment. The knee point offset is configurable. Note that this parameter
  32096. defaults to <code class="code">1.0</code>, rather than the value of <code class="code">0.5</code> from the ITU-R
  32097. spec.
  32098. </p></dd>
  32099. <dt>&lsquo;<samp class="samp">bt.2446a</samp>&rsquo;</dt>
  32100. <dd><p>EETF from ITU-R Report BT.2446, method A. Designed for well-mastered HDR
  32101. sources. Can be used for both forward and inverse tone mapping. Not
  32102. configurable.
  32103. </p></dd>
  32104. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  32105. <dd><p>Simple spline consisting of two polynomials, joined by a single pivot point.
  32106. The parameter gives the pivot point (in PQ space), defaulting to <code class="code">0.30</code>.
  32107. Can be used for both forward and inverse tone mapping.
  32108. </p></dd>
  32109. <dt>&lsquo;<samp class="samp">reinhard</samp>&rsquo;</dt>
  32110. <dd><p>Simple non-linear, global tone mapping algorithm. The parameter specifies the
  32111. local contrast coefficient at the display peak. Essentially, a parameter of
  32112. <code class="code">0.5</code> implies that the reference white will be about half as bright as
  32113. when clipping. Defaults to <code class="code">0.5</code>, which results in the simplest
  32114. formulation of this function.
  32115. </p></dd>
  32116. <dt>&lsquo;<samp class="samp">mobius</samp>&rsquo;</dt>
  32117. <dd><p>Generalization of the reinhard tone mapping algorithm to support an additional
  32118. linear slope near black. The tone mapping parameter indicates the trade-off
  32119. between the linear section and the non-linear section. Essentially, for a given
  32120. parameter <var class="var">x</var>, every color value below <var class="var">x</var> will be mapped linearly,
  32121. while higher values get non-linearly tone-mapped. Values near <code class="code">1.0</code> make
  32122. this curve behave like <code class="code">clip</code>, while values near <code class="code">0.0</code> make this
  32123. curve behave like <code class="code">reinhard</code>. The default value is <code class="code">0.3</code>, which
  32124. provides a good balance between colorimetric accuracy and preserving
  32125. out-of-gamut details.
  32126. </p></dd>
  32127. <dt>&lsquo;<samp class="samp">hable</samp>&rsquo;</dt>
  32128. <dd><p>Piece-wise, filmic tone-mapping algorithm developed by John Hable for use in
  32129. Uncharted 2, inspired by a similar tone-mapping algorithm used by Kodak.
  32130. Popularized by its use in video games with HDR rendering. Preserves both dark
  32131. and bright details very well, but comes with the drawback of changing the
  32132. average brightness quite significantly. This is sort of similar to
  32133. <code class="code">reinhard</code> with parameter <code class="code">0.24</code>.
  32134. </p></dd>
  32135. <dt>&lsquo;<samp class="samp">gamma</samp>&rsquo;</dt>
  32136. <dd><p>Fits a gamma (power) function to transfer between the source and target color
  32137. spaces, effectively resulting in a perceptual hard-knee joining two roughly
  32138. linear sections. This preserves details at all scales fairly accurately, but
  32139. can result in an image with a muted or dull appearance. The parameter is used
  32140. as the cutoff point, defaulting to <code class="code">0.5</code>.
  32141. </p></dd>
  32142. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  32143. <dd><p>Linearly stretches the input range to the output range, in PQ space. This will
  32144. preserve all details accurately, but results in a significantly different
  32145. average brightness. Can be used for inverse tone-mapping in addition to regular
  32146. tone-mapping. The parameter can be used as an additional linear gain
  32147. coefficient (defaulting to <code class="code">1.0</code>).
  32148. </p></dd>
  32149. </dl>
  32150. </dd>
  32151. <dt><samp class="option">tonemapping_param</samp></dt>
  32152. <dd><p>For tunable tone mapping functions, this parameter can be used to fine-tune the
  32153. curve behavior. Refer to the documentation of <code class="code">tonemapping</code>. The default
  32154. value of <code class="code">0.0</code> is replaced by the curve&rsquo;s preferred default setting.
  32155. </p>
  32156. </dd>
  32157. <dt><samp class="option">inverse_tonemapping</samp></dt>
  32158. <dd><p>If enabled, this filter will also attempt stretching SDR signals to fill HDR
  32159. output color volumes. Disabled by default.
  32160. </p>
  32161. </dd>
  32162. <dt><samp class="option">tonemapping_lut_size</samp></dt>
  32163. <dd><p>Size of the tone-mapping LUT, between <code class="code">2</code> and <code class="code">1024</code>. Defaults to
  32164. <code class="code">256</code>. Note that this figure is squared when combined with
  32165. <code class="code">peak_detect</code>.
  32166. </p>
  32167. </dd>
  32168. <dt><samp class="option">contrast_recovery</samp></dt>
  32169. <dd><p>Contrast recovery strength. If set to a value above <code class="code">0.0</code>, the source
  32170. image will be divided into high-frequency and low-frequency components, and a
  32171. portion of the high-frequency image is added back onto the tone-mapped output.
  32172. May cause excessive ringing artifacts for some HDR sources, but can improve the
  32173. subjective sharpness and detail left over in the image after tone-mapping.
  32174. Defaults to <code class="code">0.30</code>.
  32175. </p>
  32176. </dd>
  32177. <dt><samp class="option">contrast_smoothness</samp></dt>
  32178. <dd><p>Contrast recovery lowpass kernel size. Defaults to <code class="code">3.5</code>. Increasing or
  32179. decreasing this will affect the visual appearance substantially. Has no effect
  32180. when <code class="code">contrast_recovery</code> is disabled.
  32181. </p></dd>
  32182. </dl>
  32183. <a name="Dithering"></a>
  32184. <h4 class="subsubsection">32.143.1.8 Dithering<span class="pull-right"><a class="anchor hidden-xs" href="#Dithering" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Dithering" aria-hidden="true">TOC</a></span></h4>
  32185. <p>By default, libplacebo will dither whenever necessary, which includes rendering
  32186. to any integer format below 16-bit precision. It&rsquo;s recommended to always leave
  32187. this on, since not doing so may result in visible banding in the output, even
  32188. if the <code class="code">debanding</code> filter is enabled. If maximum performance is needed,
  32189. use <code class="code">ordered_fixed</code> instead of disabling dithering.
  32190. </p><dl class="table">
  32191. <dt><samp class="option">dithering</samp></dt>
  32192. <dd><p>Dithering method to use. Accepts the following values:
  32193. </p><dl class="table">
  32194. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  32195. <dd><p>Disables dithering completely. May result in visible banding.
  32196. </p></dd>
  32197. <dt>&lsquo;<samp class="samp">blue</samp>&rsquo;</dt>
  32198. <dd><p>Dither with pseudo-blue noise. This is the default.
  32199. </p></dd>
  32200. <dt>&lsquo;<samp class="samp">ordered</samp>&rsquo;</dt>
  32201. <dd><p>Tunable ordered dither pattern.
  32202. </p></dd>
  32203. <dt>&lsquo;<samp class="samp">ordered_fixed</samp>&rsquo;</dt>
  32204. <dd><p>Faster ordered dither with a fixed size of <code class="code">6</code>. Texture-less.
  32205. </p></dd>
  32206. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  32207. <dd><p>Dither with white noise. Texture-less.
  32208. </p></dd>
  32209. </dl>
  32210. </dd>
  32211. <dt><samp class="option">dither_lut_size</samp></dt>
  32212. <dd><p>Dither LUT size, as log base2 between <code class="code">1</code> and <code class="code">8</code>. Defaults to
  32213. <code class="code">6</code>, corresponding to a LUT size of <code class="code">64x64</code>.
  32214. </p>
  32215. </dd>
  32216. <dt><samp class="option">dither_temporal</samp></dt>
  32217. <dd><p>Enables temporal dithering. Disabled by default.
  32218. </p></dd>
  32219. </dl>
  32220. <a name="Custom-shaders"></a>
  32221. <h4 class="subsubsection">32.143.1.9 Custom shaders<span class="pull-right"><a class="anchor hidden-xs" href="#Custom-shaders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Custom-shaders" aria-hidden="true">TOC</a></span></h4>
  32222. <p>libplacebo supports a number of custom shaders based on the mpv .hook GLSL
  32223. syntax. A collection of such shaders can be found here:
  32224. <a class="url" href="https://github.com/mpv-player/mpv/wiki/User-Scripts#user-shaders">https://github.com/mpv-player/mpv/wiki/User-Scripts#user-shaders</a>
  32225. </p>
  32226. <p>A full description of the mpv shader format is beyond the scope of this
  32227. section, but a summary can be found here:
  32228. <a class="url" href="https://mpv.io/manual/master/#options-glsl-shader">https://mpv.io/manual/master/#options-glsl-shader</a>
  32229. </p><dl class="table">
  32230. <dt><samp class="option">custom_shader_path</samp></dt>
  32231. <dd><p>Specifies a path to a custom shader file to load at runtime.
  32232. </p>
  32233. </dd>
  32234. <dt><samp class="option">custom_shader_bin</samp></dt>
  32235. <dd><p>Specifies a complete custom shader as a raw string.
  32236. </p></dd>
  32237. </dl>
  32238. <a name="Debugging-_002f-performance"></a>
  32239. <h4 class="subsubsection">32.143.1.10 Debugging / performance<span class="pull-right"><a class="anchor hidden-xs" href="#Debugging-_002f-performance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Debugging-_002f-performance" aria-hidden="true">TOC</a></span></h4>
  32240. <p>All of the options in this section default off. They may be of assistance when
  32241. attempting to squeeze the maximum performance at the cost of quality.
  32242. </p><dl class="table">
  32243. <dt><samp class="option">skip_aa</samp></dt>
  32244. <dd><p>Disable anti-aliasing when downscaling.
  32245. </p>
  32246. </dd>
  32247. <dt><samp class="option">disable_linear</samp></dt>
  32248. <dd><p>Disable linear light scaling.
  32249. </p>
  32250. </dd>
  32251. <dt><samp class="option">disable_builtin</samp></dt>
  32252. <dd><p>Disable built-in GPU sampling (forces LUT).
  32253. </p>
  32254. </dd>
  32255. <dt><samp class="option">disable_fbos</samp></dt>
  32256. <dd><p>Forcibly disable FBOs, resulting in loss of almost all functionality, but
  32257. offering the maximum possible speed.
  32258. </p></dd>
  32259. </dl>
  32260. <a name="Commands-105"></a>
  32261. <h4 class="subsection">32.143.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-105" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-105" aria-hidden="true">TOC</a></span></h4>
  32262. <p>This filter supports almost all of the above options as <a class="ref" href="#commands">commands</a>.
  32263. </p>
  32264. <a name="Examples-109"></a>
  32265. <h4 class="subsection">32.143.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-109" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-109" aria-hidden="true">TOC</a></span></h4>
  32266. <ul class="itemize mark-bullet">
  32267. <li>Tone-map input to standard gamut BT.709 output:
  32268. <div class="example">
  32269. <pre class="example-preformatted">libplacebo=colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv
  32270. </pre></div>
  32271. </li><li>Rescale input to fit into standard 1080p, with high quality scaling:
  32272. <div class="example">
  32273. <pre class="example-preformatted">libplacebo=w=1920:h=1080:force_original_aspect_ratio=decrease:normalize_sar=true:upscaler=ewa_lanczos:downscaler=ewa_lanczos
  32274. </pre></div>
  32275. </li><li>Interpolate low FPS / VFR input to smoothed constant 60 fps output:
  32276. <div class="example">
  32277. <pre class="example-preformatted">libplacebo=fps=60:frame_mixer=mitchell_clamp
  32278. </pre></div>
  32279. </li><li>Convert input to standard sRGB JPEG:
  32280. <div class="example">
  32281. <pre class="example-preformatted">libplacebo=format=yuv420p:colorspace=bt470bg:color_primaries=bt709:color_trc=iec61966-2-1:range=pc
  32282. </pre></div>
  32283. </li><li>Use higher quality debanding settings:
  32284. <div class="example">
  32285. <pre class="example-preformatted">libplacebo=deband=true:deband_iterations=3:deband_radius=8:deband_threshold=6
  32286. </pre></div>
  32287. </li><li>Run this filter on the CPU, on systems with Mesa installed (and with the most
  32288. expensive options disabled):
  32289. <div class="example">
  32290. <pre class="example-preformatted">ffmpeg ... -init_hw_device vulkan:llvmpipe ... -vf libplacebo=upscaler=none:downscaler=none:peak_detect=false
  32291. </pre></div>
  32292. </li><li>Suppress CPU-based AV1/H.274 film grain application in the decoder, in favor of
  32293. doing it with this filter. Note that this is only a gain if the frames are
  32294. either already on the GPU, or if you&rsquo;re using libplacebo for other purposes,
  32295. since otherwise the VRAM roundtrip will more than offset any expected speedup.
  32296. <div class="example">
  32297. <pre class="example-preformatted">ffmpeg -export_side_data +film_grain ... -vf libplacebo=apply_filmgrain=true
  32298. </pre></div>
  32299. </li><li>Interop with VAAPI hwdec to avoid round-tripping through RAM:
  32300. <div class="example">
  32301. <pre class="example-preformatted">ffmpeg -init_hw_device vulkan -hwaccel vaapi -hwaccel_output_format vaapi ... -vf libplacebo
  32302. </pre></div>
  32303. </li></ul>
  32304. <a class="anchor" id="libvmaf"></a><a name="libvmaf-1"></a>
  32305. <h3 class="section">32.144 libvmaf<span class="pull-right"><a class="anchor hidden-xs" href="#libvmaf-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvmaf-1" aria-hidden="true">TOC</a></span></h3>
  32306. <p>Calculate the VMAF (Video Multi-Method Assessment Fusion) score for a
  32307. reference/distorted pair of input videos.
  32308. </p>
  32309. <p>The first input is the distorted video, and the second input is the reference video.
  32310. </p>
  32311. <p>The obtained VMAF score is printed through the logging system.
  32312. </p>
  32313. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  32314. After installing the library it can be enabled using:
  32315. <code class="code">./configure --enable-libvmaf</code>.
  32316. </p>
  32317. <p>The filter has following options:
  32318. </p>
  32319. <dl class="table">
  32320. <dt><samp class="option">model</samp></dt>
  32321. <dd><p>A &lsquo;|&lsquo; delimited list of vmaf models. Each model can be configured with a number of parameters.
  32322. Default value: <code class="code">&quot;version=vmaf_v0.6.1&quot;</code>
  32323. </p>
  32324. </dd>
  32325. <dt><samp class="option">feature</samp></dt>
  32326. <dd><p>A &lsquo;|&lsquo; delimited list of features. Each feature can be configured with a number of parameters.
  32327. </p>
  32328. </dd>
  32329. <dt><samp class="option">log_path</samp></dt>
  32330. <dd><p>Set the file path to be used to store log files.
  32331. </p>
  32332. </dd>
  32333. <dt><samp class="option">log_fmt</samp></dt>
  32334. <dd><p>Set the format of the log file (xml, json, csv, or sub).
  32335. </p>
  32336. </dd>
  32337. <dt><samp class="option">pool</samp></dt>
  32338. <dd><p>Set the pool method to be used for computing vmaf.
  32339. Options are <code class="code">min</code>, <code class="code">harmonic_mean</code> or <code class="code">mean</code> (default).
  32340. </p>
  32341. </dd>
  32342. <dt><samp class="option">n_threads</samp></dt>
  32343. <dd><p>Set number of threads to be used when initializing libvmaf.
  32344. Default value: <code class="code">0</code>, no threads.
  32345. </p>
  32346. </dd>
  32347. <dt><samp class="option">n_subsample</samp></dt>
  32348. <dd><p>Set frame subsampling interval to be used.
  32349. </p></dd>
  32350. </dl>
  32351. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  32352. </p>
  32353. <a name="Examples-110"></a>
  32354. <h4 class="subsection">32.144.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-110" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-110" aria-hidden="true">TOC</a></span></h4>
  32355. <ul class="itemize mark-bullet">
  32356. <li>In the examples below, a distorted video <samp class="file">distorted.mpg</samp> is
  32357. compared with a reference file <samp class="file">reference.mpg</samp>.
  32358. </li><li>Basic usage:
  32359. <div class="example">
  32360. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf=log_path=output.xml -f null -
  32361. </pre></div>
  32362. </li><li>Example with multiple models:
  32363. <div class="example">
  32364. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='model=version=vmaf_v0.6.1\\:name=vmaf|version=vmaf_v0.6.1neg\\:name=vmaf_neg' -f null -
  32365. </pre></div>
  32366. </li><li>Example with multiple additional features:
  32367. <div class="example">
  32368. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='feature=name=psnr|name=ciede' -f null -
  32369. </pre></div>
  32370. </li><li>Example with options and different containers:
  32371. <div class="example">
  32372. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mkv -lavfi &quot;[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]libvmaf=log_fmt=json:log_path=output.json&quot; -f null -
  32373. </pre></div>
  32374. </li></ul>
  32375. <a name="libvmaf_005fcuda"></a>
  32376. <h3 class="section">32.145 libvmaf_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#libvmaf_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvmaf_005fcuda" aria-hidden="true">TOC</a></span></h3>
  32377. <p>This is the CUDA variant of the <a class="ref" href="#libvmaf">libvmaf</a> filter. It only accepts CUDA frames.
  32378. </p>
  32379. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  32380. After installing the library it can be enabled using:
  32381. <code class="code">./configure --enable-nonfree --enable-ffnvcodec --enable-libvmaf</code>.
  32382. </p>
  32383. <a name="Examples-111"></a>
  32384. <h4 class="subsection">32.145.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-111" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-111" aria-hidden="true">TOC</a></span></h4>
  32385. <ul class="itemize mark-bullet">
  32386. <li>Basic usage showing CUVID hardware decoding and CUDA scaling with <a class="ref" href="#scale_005fcuda">scale_cuda</a>:
  32387. <div class="example">
  32388. <pre class="example-preformatted">ffmpeg \
  32389. -hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i dis.obu \
  32390. -hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i ref.obu \
  32391. -filter_complex &quot;
  32392. [0:v]scale_cuda=format=yuv420p[dis]; \
  32393. [1:v]scale_cuda=format=yuv420p[ref]; \
  32394. [dis][ref]libvmaf_cuda=log_fmt=json:log_path=output.json
  32395. &quot; \
  32396. -f null -
  32397. </pre></div>
  32398. </li></ul>
  32399. <a name="limitdiff"></a>
  32400. <h3 class="section">32.146 limitdiff<span class="pull-right"><a class="anchor hidden-xs" href="#limitdiff" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-limitdiff" aria-hidden="true">TOC</a></span></h3>
  32401. <p>Apply limited difference filter using second and optionally third video stream.
  32402. </p>
  32403. <p>The filter accepts the following options:
  32404. </p>
  32405. <dl class="table">
  32406. <dt><samp class="option">threshold</samp></dt>
  32407. <dd><p>Set the threshold to use when allowing certain differences between video streams.
  32408. Any absolute difference value lower or exact than this threshold will pick pixel components from
  32409. first video stream.
  32410. </p>
  32411. </dd>
  32412. <dt><samp class="option">elasticity</samp></dt>
  32413. <dd><p>Set the elasticity of soft thresholding when processing video streams.
  32414. This value multiplied with first one sets second threshold.
  32415. Any absolute difference value greater or exact than second threshold will pick pixel components
  32416. from second video stream. For values between those two threshold
  32417. linear interpolation between first and second video stream will be used.
  32418. </p>
  32419. </dd>
  32420. <dt><samp class="option">reference</samp></dt>
  32421. <dd><p>Enable the reference (third) video stream processing. By default is disabled.
  32422. If set, this video stream will be used for calculating absolute difference with first video
  32423. stream.
  32424. </p>
  32425. </dd>
  32426. <dt><samp class="option">planes</samp></dt>
  32427. <dd><p>Specify which planes will be processed. Defaults to all available.
  32428. </p></dd>
  32429. </dl>
  32430. <a name="Commands-106"></a>
  32431. <h4 class="subsection">32.146.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-106" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-106" aria-hidden="true">TOC</a></span></h4>
  32432. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a> except option &lsquo;<samp class="samp">reference</samp>&rsquo;.
  32433. </p>
  32434. <a name="limiter"></a>
  32435. <h3 class="section">32.147 limiter<span class="pull-right"><a class="anchor hidden-xs" href="#limiter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-limiter" aria-hidden="true">TOC</a></span></h3>
  32436. <p>Limits the pixel components values to the specified range [min, max].
  32437. </p>
  32438. <p>The filter accepts the following options:
  32439. </p>
  32440. <dl class="table">
  32441. <dt><samp class="option">min</samp></dt>
  32442. <dd><p>Lower bound. Defaults to the lowest allowed value for the input.
  32443. </p>
  32444. </dd>
  32445. <dt><samp class="option">max</samp></dt>
  32446. <dd><p>Upper bound. Defaults to the highest allowed value for the input.
  32447. </p>
  32448. </dd>
  32449. <dt><samp class="option">planes</samp></dt>
  32450. <dd><p>Specify which planes will be processed. Defaults to all available.
  32451. </p></dd>
  32452. </dl>
  32453. <a name="Commands-107"></a>
  32454. <h4 class="subsection">32.147.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-107" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-107" aria-hidden="true">TOC</a></span></h4>
  32455. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32456. </p>
  32457. <a name="loop"></a>
  32458. <h3 class="section">32.148 loop<span class="pull-right"><a class="anchor hidden-xs" href="#loop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-loop" aria-hidden="true">TOC</a></span></h3>
  32459. <p>Loop video frames.
  32460. </p>
  32461. <p>The filter accepts the following options:
  32462. </p>
  32463. <dl class="table">
  32464. <dt><samp class="option">loop</samp></dt>
  32465. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  32466. Default is 0.
  32467. </p>
  32468. </dd>
  32469. <dt><samp class="option">size</samp></dt>
  32470. <dd><p>Set maximal size in number of frames. Default is 0.
  32471. </p>
  32472. </dd>
  32473. <dt><samp class="option">start</samp></dt>
  32474. <dd><p>Set first frame of loop. Default is 0.
  32475. </p>
  32476. </dd>
  32477. <dt><samp class="option">time</samp></dt>
  32478. <dd><p>Set the time of loop start in seconds.
  32479. Only used if option named <var class="var">start</var> is set to <code class="code">-1</code>.
  32480. </p></dd>
  32481. </dl>
  32482. <a name="Examples-112"></a>
  32483. <h4 class="subsection">32.148.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-112" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-112" aria-hidden="true">TOC</a></span></h4>
  32484. <ul class="itemize mark-bullet">
  32485. <li>Loop single first frame infinitely:
  32486. <div class="example">
  32487. <pre class="example-preformatted">loop=loop=-1:size=1:start=0
  32488. </pre></div>
  32489. </li><li>Loop single first frame 10 times:
  32490. <div class="example">
  32491. <pre class="example-preformatted">loop=loop=10:size=1:start=0
  32492. </pre></div>
  32493. </li><li>Loop 10 first frames 5 times:
  32494. <div class="example">
  32495. <pre class="example-preformatted">loop=loop=5:size=10:start=0
  32496. </pre></div>
  32497. </li></ul>
  32498. <a name="lut1d"></a>
  32499. <h3 class="section">32.149 lut1d<span class="pull-right"><a class="anchor hidden-xs" href="#lut1d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut1d" aria-hidden="true">TOC</a></span></h3>
  32500. <p>Apply a 1D LUT to an input video.
  32501. </p>
  32502. <p>The filter accepts the following options:
  32503. </p>
  32504. <dl class="table">
  32505. <dt><samp class="option">file</samp></dt>
  32506. <dd><p>Set the 1D LUT file name.
  32507. </p>
  32508. <p>Currently supported formats:
  32509. </p><dl class="table">
  32510. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  32511. <dd><p>Iridas
  32512. </p></dd>
  32513. <dt>&lsquo;<samp class="samp">csp</samp>&rsquo;</dt>
  32514. <dd><p>cineSpace
  32515. </p></dd>
  32516. </dl>
  32517. </dd>
  32518. <dt><samp class="option">interp</samp></dt>
  32519. <dd><p>Select interpolation mode.
  32520. </p>
  32521. <p>Available values are:
  32522. </p>
  32523. <dl class="table">
  32524. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  32525. <dd><p>Use values from the nearest defined point.
  32526. </p></dd>
  32527. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  32528. <dd><p>Interpolate values using the linear interpolation.
  32529. </p></dd>
  32530. <dt>&lsquo;<samp class="samp">cosine</samp>&rsquo;</dt>
  32531. <dd><p>Interpolate values using the cosine interpolation.
  32532. </p></dd>
  32533. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  32534. <dd><p>Interpolate values using the cubic interpolation.
  32535. </p></dd>
  32536. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  32537. <dd><p>Interpolate values using the spline interpolation.
  32538. </p></dd>
  32539. </dl>
  32540. </dd>
  32541. </dl>
  32542. <a name="Commands-108"></a>
  32543. <h4 class="subsection">32.149.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-108" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-108" aria-hidden="true">TOC</a></span></h4>
  32544. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32545. </p>
  32546. <a class="anchor" id="lut3d"></a><a name="lut3d-1"></a>
  32547. <h3 class="section">32.150 lut3d<span class="pull-right"><a class="anchor hidden-xs" href="#lut3d-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut3d-1" aria-hidden="true">TOC</a></span></h3>
  32548. <p>Apply a 3D LUT to an input video.
  32549. </p>
  32550. <p>The filter accepts the following options:
  32551. </p>
  32552. <dl class="table">
  32553. <dt><samp class="option">file</samp></dt>
  32554. <dd><p>Set the 3D LUT file name.
  32555. </p>
  32556. <p>Currently supported formats:
  32557. </p><dl class="table">
  32558. <dt>&lsquo;<samp class="samp">3dl</samp>&rsquo;</dt>
  32559. <dd><p>AfterEffects
  32560. </p></dd>
  32561. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  32562. <dd><p>Iridas
  32563. </p></dd>
  32564. <dt>&lsquo;<samp class="samp">dat</samp>&rsquo;</dt>
  32565. <dd><p>DaVinci
  32566. </p></dd>
  32567. <dt>&lsquo;<samp class="samp">m3d</samp>&rsquo;</dt>
  32568. <dd><p>Pandora
  32569. </p></dd>
  32570. <dt>&lsquo;<samp class="samp">csp</samp>&rsquo;</dt>
  32571. <dd><p>cineSpace
  32572. </p></dd>
  32573. </dl>
  32574. </dd>
  32575. <dt><samp class="option">interp</samp></dt>
  32576. <dd><p>Select interpolation mode.
  32577. </p>
  32578. <p>Available values are:
  32579. </p>
  32580. <dl class="table">
  32581. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  32582. <dd><p>Use values from the nearest defined point.
  32583. </p></dd>
  32584. <dt>&lsquo;<samp class="samp">trilinear</samp>&rsquo;</dt>
  32585. <dd><p>Interpolate values using the 8 points defining a cube.
  32586. </p></dd>
  32587. <dt>&lsquo;<samp class="samp">tetrahedral</samp>&rsquo;</dt>
  32588. <dd><p>Interpolate values using a tetrahedron.
  32589. </p></dd>
  32590. <dt>&lsquo;<samp class="samp">pyramid</samp>&rsquo;</dt>
  32591. <dd><p>Interpolate values using a pyramid.
  32592. </p></dd>
  32593. <dt>&lsquo;<samp class="samp">prism</samp>&rsquo;</dt>
  32594. <dd><p>Interpolate values using a prism.
  32595. </p></dd>
  32596. </dl>
  32597. </dd>
  32598. </dl>
  32599. <a name="Commands-109"></a>
  32600. <h4 class="subsection">32.150.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-109" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-109" aria-hidden="true">TOC</a></span></h4>
  32601. <p>This filter supports the <code class="code">interp</code> option as <a class="ref" href="#commands">commands</a>.
  32602. </p>
  32603. <a name="lumakey"></a>
  32604. <h3 class="section">32.151 lumakey<span class="pull-right"><a class="anchor hidden-xs" href="#lumakey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lumakey" aria-hidden="true">TOC</a></span></h3>
  32605. <p>Turn certain luma values into transparency.
  32606. </p>
  32607. <p>The filter accepts the following options:
  32608. </p>
  32609. <dl class="table">
  32610. <dt><samp class="option">threshold</samp></dt>
  32611. <dd><p>Set the luma which will be used as base for transparency.
  32612. Default value is <code class="code">0</code>.
  32613. </p>
  32614. </dd>
  32615. <dt><samp class="option">tolerance</samp></dt>
  32616. <dd><p>Set the range of luma values to be keyed out.
  32617. Default value is <code class="code">0.01</code>.
  32618. </p>
  32619. </dd>
  32620. <dt><samp class="option">softness</samp></dt>
  32621. <dd><p>Set the range of softness. Default value is <code class="code">0</code>.
  32622. Use this to control gradual transition from zero to full transparency.
  32623. </p></dd>
  32624. </dl>
  32625. <a name="Commands-110"></a>
  32626. <h4 class="subsection">32.151.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-110" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-110" aria-hidden="true">TOC</a></span></h4>
  32627. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  32628. The command accepts the same syntax of the corresponding option.
  32629. </p>
  32630. <p>If the specified expression is not valid, it is kept at its current
  32631. value.
  32632. </p>
  32633. <a class="anchor" id="lutrgb"></a><a class="anchor" id="lutyuv"></a><a class="anchor" id="lut"></a><a name="lut_002c-lutrgb_002c-lutyuv"></a>
  32634. <h3 class="section">32.152 lut, lutrgb, lutyuv<span class="pull-right"><a class="anchor hidden-xs" href="#lut_002c-lutrgb_002c-lutyuv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut_002c-lutrgb_002c-lutyuv" aria-hidden="true">TOC</a></span></h3>
  32635. <p>Compute a look-up table for binding each pixel component input value
  32636. to an output value, and apply it to the input video.
  32637. </p>
  32638. <p><var class="var">lutyuv</var> applies a lookup table to a YUV input video, <var class="var">lutrgb</var>
  32639. to an RGB input video.
  32640. </p>
  32641. <p>These filters accept the following parameters:
  32642. </p><dl class="table">
  32643. <dt><samp class="option">c0</samp></dt>
  32644. <dd><p>set first pixel component expression
  32645. </p></dd>
  32646. <dt><samp class="option">c1</samp></dt>
  32647. <dd><p>set second pixel component expression
  32648. </p></dd>
  32649. <dt><samp class="option">c2</samp></dt>
  32650. <dd><p>set third pixel component expression
  32651. </p></dd>
  32652. <dt><samp class="option">c3</samp></dt>
  32653. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  32654. </p>
  32655. </dd>
  32656. <dt><samp class="option">r</samp></dt>
  32657. <dd><p>set red component expression
  32658. </p></dd>
  32659. <dt><samp class="option">g</samp></dt>
  32660. <dd><p>set green component expression
  32661. </p></dd>
  32662. <dt><samp class="option">b</samp></dt>
  32663. <dd><p>set blue component expression
  32664. </p></dd>
  32665. <dt><samp class="option">a</samp></dt>
  32666. <dd><p>alpha component expression
  32667. </p>
  32668. </dd>
  32669. <dt><samp class="option">y</samp></dt>
  32670. <dd><p>set Y/luma component expression
  32671. </p></dd>
  32672. <dt><samp class="option">u</samp></dt>
  32673. <dd><p>set U/Cb component expression
  32674. </p></dd>
  32675. <dt><samp class="option">v</samp></dt>
  32676. <dd><p>set V/Cr component expression
  32677. </p></dd>
  32678. </dl>
  32679. <p>Each of them specifies the expression to use for computing the lookup table for
  32680. the corresponding pixel component values.
  32681. </p>
  32682. <p>The exact component associated to each of the <var class="var">c*</var> options depends on the
  32683. format in input.
  32684. </p>
  32685. <p>The <var class="var">lut</var> filter requires either YUV or RGB pixel formats in input,
  32686. <var class="var">lutrgb</var> requires RGB pixel formats in input, and <var class="var">lutyuv</var> requires YUV.
  32687. </p>
  32688. <p>The expressions can contain the following constants and functions:
  32689. </p>
  32690. <dl class="table">
  32691. <dt><samp class="option">w</samp></dt>
  32692. <dt><samp class="option">h</samp></dt>
  32693. <dd><p>The input width and height.
  32694. </p>
  32695. </dd>
  32696. <dt><samp class="option">val</samp></dt>
  32697. <dd><p>The input value for the pixel component.
  32698. </p>
  32699. </dd>
  32700. <dt><samp class="option">clipval</samp></dt>
  32701. <dd><p>The input value, clipped to the <var class="var">minval</var>-<var class="var">maxval</var> range.
  32702. </p>
  32703. </dd>
  32704. <dt><samp class="option">maxval</samp></dt>
  32705. <dd><p>The maximum value for the pixel component.
  32706. </p>
  32707. </dd>
  32708. <dt><samp class="option">minval</samp></dt>
  32709. <dd><p>The minimum value for the pixel component.
  32710. </p>
  32711. </dd>
  32712. <dt><samp class="option">negval</samp></dt>
  32713. <dd><p>The negated value for the pixel component value, clipped to the
  32714. <var class="var">minval</var>-<var class="var">maxval</var> range; it corresponds to the expression
  32715. &quot;maxval-clipval+minval&quot;.
  32716. </p>
  32717. </dd>
  32718. <dt><samp class="option">clip(val)</samp></dt>
  32719. <dd><p>The computed value in <var class="var">val</var>, clipped to the
  32720. <var class="var">minval</var>-<var class="var">maxval</var> range.
  32721. </p>
  32722. </dd>
  32723. <dt><samp class="option">gammaval(gamma)</samp></dt>
  32724. <dd><p>The computed gamma correction value of the pixel component value,
  32725. clipped to the <var class="var">minval</var>-<var class="var">maxval</var> range. It corresponds to the
  32726. expression
  32727. &quot;pow((clipval-minval)/(maxval-minval)\,<var class="var">gamma</var>)*(maxval-minval)+minval&quot;
  32728. </p>
  32729. </dd>
  32730. </dl>
  32731. <p>All expressions default to &quot;clipval&quot;.
  32732. </p>
  32733. <a name="Commands-111"></a>
  32734. <h4 class="subsection">32.152.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-111" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-111" aria-hidden="true">TOC</a></span></h4>
  32735. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  32736. </p>
  32737. <a name="Examples-113"></a>
  32738. <h4 class="subsection">32.152.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-113" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-113" aria-hidden="true">TOC</a></span></h4>
  32739. <ul class="itemize mark-bullet">
  32740. <li>Negate input video:
  32741. <div class="example">
  32742. <pre class="example-preformatted">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
  32743. lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
  32744. </pre></div>
  32745. <p>The above is the same as:
  32746. </p><div class="example">
  32747. <pre class="example-preformatted">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
  32748. lutyuv=&quot;y=negval:u=negval:v=negval&quot;
  32749. </pre></div>
  32750. </li><li>Negate luma:
  32751. <div class="example">
  32752. <pre class="example-preformatted">lutyuv=y=negval
  32753. </pre></div>
  32754. </li><li>Remove chroma components, turning the video into a graytone image:
  32755. <div class="example">
  32756. <pre class="example-preformatted">lutyuv=&quot;u=128:v=128&quot;
  32757. </pre></div>
  32758. </li><li>Apply a luma burning effect:
  32759. <div class="example">
  32760. <pre class="example-preformatted">lutyuv=&quot;y=2*val&quot;
  32761. </pre></div>
  32762. </li><li>Remove green and blue components:
  32763. <div class="example">
  32764. <pre class="example-preformatted">lutrgb=&quot;g=0:b=0&quot;
  32765. </pre></div>
  32766. </li><li>Set a constant alpha channel value on input:
  32767. <div class="example">
  32768. <pre class="example-preformatted">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
  32769. </pre></div>
  32770. </li><li>Correct luma gamma by a factor of 0.5:
  32771. <div class="example">
  32772. <pre class="example-preformatted">lutyuv=y=gammaval(0.5)
  32773. </pre></div>
  32774. </li><li>Discard least significant bits of luma:
  32775. <div class="example">
  32776. <pre class="example-preformatted">lutyuv=y='bitand(val, 128+64+32)'
  32777. </pre></div>
  32778. </li><li>Technicolor like effect:
  32779. <div class="example">
  32780. <pre class="example-preformatted">lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
  32781. </pre></div>
  32782. </li></ul>
  32783. <a name="lut2_002c-tlut2"></a>
  32784. <h3 class="section">32.153 lut2, tlut2<span class="pull-right"><a class="anchor hidden-xs" href="#lut2_002c-tlut2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut2_002c-tlut2" aria-hidden="true">TOC</a></span></h3>
  32785. <p>The <code class="code">lut2</code> filter takes two input streams and outputs one
  32786. stream.
  32787. </p>
  32788. <p>The <code class="code">tlut2</code> (time lut2) filter takes two consecutive frames
  32789. from one single stream.
  32790. </p>
  32791. <p>This filter accepts the following parameters:
  32792. </p><dl class="table">
  32793. <dt><samp class="option">c0</samp></dt>
  32794. <dd><p>set first pixel component expression
  32795. </p></dd>
  32796. <dt><samp class="option">c1</samp></dt>
  32797. <dd><p>set second pixel component expression
  32798. </p></dd>
  32799. <dt><samp class="option">c2</samp></dt>
  32800. <dd><p>set third pixel component expression
  32801. </p></dd>
  32802. <dt><samp class="option">c3</samp></dt>
  32803. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  32804. </p>
  32805. </dd>
  32806. <dt><samp class="option">d</samp></dt>
  32807. <dd><p>set output bit depth, only available for <code class="code">lut2</code> filter. By default is 0,
  32808. which means bit depth is automatically picked from first input format.
  32809. </p></dd>
  32810. </dl>
  32811. <p>The <code class="code">lut2</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  32812. </p>
  32813. <p>Each of them specifies the expression to use for computing the lookup table for
  32814. the corresponding pixel component values.
  32815. </p>
  32816. <p>The exact component associated to each of the <var class="var">c*</var> options depends on the
  32817. format in inputs.
  32818. </p>
  32819. <p>The expressions can contain the following constants:
  32820. </p>
  32821. <dl class="table">
  32822. <dt><samp class="option">w</samp></dt>
  32823. <dt><samp class="option">h</samp></dt>
  32824. <dd><p>The input width and height.
  32825. </p>
  32826. </dd>
  32827. <dt><samp class="option">x</samp></dt>
  32828. <dd><p>The first input value for the pixel component.
  32829. </p>
  32830. </dd>
  32831. <dt><samp class="option">y</samp></dt>
  32832. <dd><p>The second input value for the pixel component.
  32833. </p>
  32834. </dd>
  32835. <dt><samp class="option">bdx</samp></dt>
  32836. <dd><p>The first input video bit depth.
  32837. </p>
  32838. </dd>
  32839. <dt><samp class="option">bdy</samp></dt>
  32840. <dd><p>The second input video bit depth.
  32841. </p></dd>
  32842. </dl>
  32843. <p>All expressions default to &quot;x&quot;.
  32844. </p>
  32845. <a name="Commands-112"></a>
  32846. <h4 class="subsection">32.153.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-112" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-112" aria-hidden="true">TOC</a></span></h4>
  32847. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a> except option <code class="code">d</code>.
  32848. </p>
  32849. <a name="Examples-114"></a>
  32850. <h4 class="subsection">32.153.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-114" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-114" aria-hidden="true">TOC</a></span></h4>
  32851. <ul class="itemize mark-bullet">
  32852. <li>Highlight differences between two RGB video streams:
  32853. <div class="example">
  32854. <pre class="example-preformatted">lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1)'
  32855. </pre></div>
  32856. </li><li>Highlight differences between two YUV video streams:
  32857. <div class="example">
  32858. <pre class="example-preformatted">lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1)'
  32859. </pre></div>
  32860. </li><li>Show max difference between two video streams:
  32861. <div class="example">
  32862. <pre class="example-preformatted">lut2='if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1)))'
  32863. </pre></div>
  32864. </li></ul>
  32865. <a name="maskedclamp"></a>
  32866. <h3 class="section">32.154 maskedclamp<span class="pull-right"><a class="anchor hidden-xs" href="#maskedclamp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedclamp" aria-hidden="true">TOC</a></span></h3>
  32867. <p>Clamp the first input stream with the second input and third input stream.
  32868. </p>
  32869. <p>Returns the value of first stream to be between second input
  32870. stream - <code class="code">undershoot</code> and third input stream + <code class="code">overshoot</code>.
  32871. </p>
  32872. <p>This filter accepts the following options:
  32873. </p><dl class="table">
  32874. <dt><samp class="option">undershoot</samp></dt>
  32875. <dd><p>Default value is <code class="code">0</code>.
  32876. </p>
  32877. </dd>
  32878. <dt><samp class="option">overshoot</samp></dt>
  32879. <dd><p>Default value is <code class="code">0</code>.
  32880. </p>
  32881. </dd>
  32882. <dt><samp class="option">planes</samp></dt>
  32883. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  32884. copied from first stream.
  32885. By default value 0xf, all planes will be processed.
  32886. </p></dd>
  32887. </dl>
  32888. <a name="Commands-113"></a>
  32889. <h4 class="subsection">32.154.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-113" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-113" aria-hidden="true">TOC</a></span></h4>
  32890. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32891. </p>
  32892. <a name="maskedmax"></a>
  32893. <h3 class="section">32.155 maskedmax<span class="pull-right"><a class="anchor hidden-xs" href="#maskedmax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedmax" aria-hidden="true">TOC</a></span></h3>
  32894. <p>Merge the second and third input stream into output stream using absolute differences
  32895. between second input stream and first input stream and absolute difference between
  32896. third input stream and first input stream. The picked value will be from second input
  32897. stream if second absolute difference is greater than first one or from third input stream
  32898. otherwise.
  32899. </p>
  32900. <p>This filter accepts the following options:
  32901. </p><dl class="table">
  32902. <dt><samp class="option">planes</samp></dt>
  32903. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  32904. copied from first stream.
  32905. By default value 0xf, all planes will be processed.
  32906. </p></dd>
  32907. </dl>
  32908. <a name="Commands-114"></a>
  32909. <h4 class="subsection">32.155.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-114" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-114" aria-hidden="true">TOC</a></span></h4>
  32910. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32911. </p>
  32912. <a name="maskedmerge"></a>
  32913. <h3 class="section">32.156 maskedmerge<span class="pull-right"><a class="anchor hidden-xs" href="#maskedmerge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedmerge" aria-hidden="true">TOC</a></span></h3>
  32914. <p>Merge the first input stream with the second input stream using per pixel
  32915. weights in the third input stream.
  32916. </p>
  32917. <p>A value of 0 in the third stream pixel component means that pixel component
  32918. from first stream is returned unchanged, while maximum value (eg. 255 for
  32919. 8-bit videos) means that pixel component from second stream is returned
  32920. unchanged. Intermediate values define the amount of merging between both
  32921. input stream&rsquo;s pixel components.
  32922. </p>
  32923. <p>This filter accepts the following options:
  32924. </p><dl class="table">
  32925. <dt><samp class="option">planes</samp></dt>
  32926. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  32927. copied from first stream.
  32928. By default value 0xf, all planes will be processed.
  32929. </p></dd>
  32930. </dl>
  32931. <a name="Commands-115"></a>
  32932. <h4 class="subsection">32.156.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-115" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-115" aria-hidden="true">TOC</a></span></h4>
  32933. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32934. </p>
  32935. <a name="maskedmin"></a>
  32936. <h3 class="section">32.157 maskedmin<span class="pull-right"><a class="anchor hidden-xs" href="#maskedmin" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedmin" aria-hidden="true">TOC</a></span></h3>
  32937. <p>Merge the second and third input stream into output stream using absolute differences
  32938. between second input stream and first input stream and absolute difference between
  32939. third input stream and first input stream. The picked value will be from second input
  32940. stream if second absolute difference is less than first one or from third input stream
  32941. otherwise.
  32942. </p>
  32943. <p>This filter accepts the following options:
  32944. </p><dl class="table">
  32945. <dt><samp class="option">planes</samp></dt>
  32946. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  32947. copied from first stream.
  32948. By default value 0xf, all planes will be processed.
  32949. </p></dd>
  32950. </dl>
  32951. <a name="Commands-116"></a>
  32952. <h4 class="subsection">32.157.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-116" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-116" aria-hidden="true">TOC</a></span></h4>
  32953. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32954. </p>
  32955. <a name="maskedthreshold"></a>
  32956. <h3 class="section">32.158 maskedthreshold<span class="pull-right"><a class="anchor hidden-xs" href="#maskedthreshold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedthreshold" aria-hidden="true">TOC</a></span></h3>
  32957. <p>Pick pixels comparing absolute difference of two video streams with fixed
  32958. threshold.
  32959. </p>
  32960. <p>If absolute difference between pixel component of first and second video
  32961. stream is equal or lower than user supplied threshold than pixel component
  32962. from first video stream is picked, otherwise pixel component from second
  32963. video stream is picked.
  32964. </p>
  32965. <p>This filter accepts the following options:
  32966. </p><dl class="table">
  32967. <dt><samp class="option">threshold</samp></dt>
  32968. <dd><p>Set threshold used when picking pixels from absolute difference from two input
  32969. video streams.
  32970. </p>
  32971. </dd>
  32972. <dt><samp class="option">planes</samp></dt>
  32973. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  32974. copied from second stream.
  32975. By default value 0xf, all planes will be processed.
  32976. </p>
  32977. </dd>
  32978. <dt><samp class="option">mode</samp></dt>
  32979. <dd><p>Set mode of filter operation. Can be <code class="code">abs</code> or <code class="code">diff</code>.
  32980. Default is <code class="code">abs</code>.
  32981. </p></dd>
  32982. </dl>
  32983. <a name="Commands-117"></a>
  32984. <h4 class="subsection">32.158.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-117" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-117" aria-hidden="true">TOC</a></span></h4>
  32985. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32986. </p>
  32987. <a name="maskfun"></a>
  32988. <h3 class="section">32.159 maskfun<span class="pull-right"><a class="anchor hidden-xs" href="#maskfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskfun" aria-hidden="true">TOC</a></span></h3>
  32989. <p>Create mask from input video.
  32990. </p>
  32991. <p>For example it is useful to create motion masks after <code class="code">tblend</code> filter.
  32992. </p>
  32993. <p>This filter accepts the following options:
  32994. </p>
  32995. <dl class="table">
  32996. <dt><samp class="option">low</samp></dt>
  32997. <dd><p>Set low threshold. Any pixel component lower or exact than this value will be set to 0.
  32998. </p>
  32999. </dd>
  33000. <dt><samp class="option">high</samp></dt>
  33001. <dd><p>Set high threshold. Any pixel component higher than this value will be set to max value
  33002. allowed for current pixel format.
  33003. </p>
  33004. </dd>
  33005. <dt><samp class="option">planes</samp></dt>
  33006. <dd><p>Set planes to filter, by default all available planes are filtered.
  33007. </p>
  33008. </dd>
  33009. <dt><samp class="option">fill</samp></dt>
  33010. <dd><p>Fill all frame pixels with this value.
  33011. </p>
  33012. </dd>
  33013. <dt><samp class="option">sum</samp></dt>
  33014. <dd><p>Set max average pixel value for frame. If sum of all pixel components is higher that this
  33015. average, output frame will be completely filled with value set by <var class="var">fill</var> option.
  33016. Typically useful for scene changes when used in combination with <code class="code">tblend</code> filter.
  33017. </p></dd>
  33018. </dl>
  33019. <a name="Commands-118"></a>
  33020. <h4 class="subsection">32.159.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-118" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-118" aria-hidden="true">TOC</a></span></h4>
  33021. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  33022. </p>
  33023. <a name="mcdeint"></a>
  33024. <h3 class="section">32.160 mcdeint<span class="pull-right"><a class="anchor hidden-xs" href="#mcdeint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mcdeint" aria-hidden="true">TOC</a></span></h3>
  33025. <p>Apply motion-compensation deinterlacing.
  33026. </p>
  33027. <p>It needs one field per frame as input and must thus be used together
  33028. with yadif=1/3 or equivalent.
  33029. </p>
  33030. <p>This filter accepts the following options:
  33031. </p><dl class="table">
  33032. <dt><samp class="option">mode</samp></dt>
  33033. <dd><p>Set the deinterlacing mode.
  33034. </p>
  33035. <p>It accepts one of the following values:
  33036. </p><dl class="table">
  33037. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  33038. <dt>&lsquo;<samp class="samp">medium</samp>&rsquo;</dt>
  33039. <dt>&lsquo;<samp class="samp">slow</samp>&rsquo;</dt>
  33040. <dd><p>use iterative motion estimation
  33041. </p></dd>
  33042. <dt>&lsquo;<samp class="samp">extra_slow</samp>&rsquo;</dt>
  33043. <dd><p>like &lsquo;<samp class="samp">slow</samp>&rsquo;, but use multiple reference frames.
  33044. </p></dd>
  33045. </dl>
  33046. <p>Default value is &lsquo;<samp class="samp">fast</samp>&rsquo;.
  33047. </p>
  33048. </dd>
  33049. <dt><samp class="option">parity</samp></dt>
  33050. <dd><p>Set the picture field parity assumed for the input video. It must be
  33051. one of the following values:
  33052. </p>
  33053. <dl class="table">
  33054. <dt>&lsquo;<samp class="samp">0, tff</samp>&rsquo;</dt>
  33055. <dd><p>assume top field first
  33056. </p></dd>
  33057. <dt>&lsquo;<samp class="samp">1, bff</samp>&rsquo;</dt>
  33058. <dd><p>assume bottom field first
  33059. </p></dd>
  33060. </dl>
  33061. <p>Default value is &lsquo;<samp class="samp">bff</samp>&rsquo;.
  33062. </p>
  33063. </dd>
  33064. <dt><samp class="option">qp</samp></dt>
  33065. <dd><p>Set per-block quantization parameter (QP) used by the internal
  33066. encoder.
  33067. </p>
  33068. <p>Higher values should result in a smoother motion vector field but less
  33069. optimal individual vectors. Default value is 1.
  33070. </p></dd>
  33071. </dl>
  33072. <a name="median"></a>
  33073. <h3 class="section">32.161 median<span class="pull-right"><a class="anchor hidden-xs" href="#median" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-median" aria-hidden="true">TOC</a></span></h3>
  33074. <p>Pick median pixel from certain rectangle defined by radius.
  33075. </p>
  33076. <p>This filter accepts the following options:
  33077. </p>
  33078. <dl class="table">
  33079. <dt><samp class="option">radius</samp></dt>
  33080. <dd><p>Set horizontal radius size. Default value is <code class="code">1</code>.
  33081. Allowed range is integer from 1 to 127.
  33082. </p>
  33083. </dd>
  33084. <dt><samp class="option">planes</samp></dt>
  33085. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  33086. </p>
  33087. </dd>
  33088. <dt><samp class="option">radiusV</samp></dt>
  33089. <dd><p>Set vertical radius size. Default value is <code class="code">0</code>.
  33090. Allowed range is integer from 0 to 127.
  33091. If it is 0, value will be picked from horizontal <code class="code">radius</code> option.
  33092. </p>
  33093. </dd>
  33094. <dt><samp class="option">percentile</samp></dt>
  33095. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  33096. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  33097. minimum values, and <code class="code">1</code> maximum values.
  33098. </p></dd>
  33099. </dl>
  33100. <a name="Commands-119"></a>
  33101. <h4 class="subsection">32.161.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-119" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-119" aria-hidden="true">TOC</a></span></h4>
  33102. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  33103. The command accepts the same syntax of the corresponding option.
  33104. </p>
  33105. <p>If the specified expression is not valid, it is kept at its current
  33106. value.
  33107. </p>
  33108. <a name="mergeplanes"></a>
  33109. <h3 class="section">32.162 mergeplanes<span class="pull-right"><a class="anchor hidden-xs" href="#mergeplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mergeplanes" aria-hidden="true">TOC</a></span></h3>
  33110. <p>Merge color channel components from several video streams.
  33111. </p>
  33112. <p>The filter accepts up to 4 input streams, and merge selected input
  33113. planes to the output video.
  33114. </p>
  33115. <p>This filter accepts the following options:
  33116. </p><dl class="table">
  33117. <dt><samp class="option">mapping</samp></dt>
  33118. <dd><p>Set input to output plane mapping. Default is <code class="code">0</code>.
  33119. </p>
  33120. <p>The mappings is specified as a bitmap. It should be specified as a
  33121. hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. &rsquo;Aa&rsquo; describes the
  33122. mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
  33123. the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
  33124. corresponding input to use (from 0 to 3). The rest of the mappings is
  33125. similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
  33126. plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
  33127. &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
  33128. </p>
  33129. </dd>
  33130. <dt><samp class="option">format</samp></dt>
  33131. <dd><p>Set output pixel format. Default is <code class="code">yuva444p</code>.
  33132. </p>
  33133. </dd>
  33134. <dt><samp class="option">map0s</samp></dt>
  33135. <dt><samp class="option">map1s</samp></dt>
  33136. <dt><samp class="option">map2s</samp></dt>
  33137. <dt><samp class="option">map3s</samp></dt>
  33138. <dd><p>Set input to output stream mapping for output Nth plane. Default is <code class="code">0</code>.
  33139. </p>
  33140. </dd>
  33141. <dt><samp class="option">map0p</samp></dt>
  33142. <dt><samp class="option">map1p</samp></dt>
  33143. <dt><samp class="option">map2p</samp></dt>
  33144. <dt><samp class="option">map3p</samp></dt>
  33145. <dd><p>Set input to output plane mapping for output Nth plane. Default is <code class="code">0</code>.
  33146. </p></dd>
  33147. </dl>
  33148. <a name="Examples-115"></a>
  33149. <h4 class="subsection">32.162.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-115" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-115" aria-hidden="true">TOC</a></span></h4>
  33150. <ul class="itemize mark-bullet">
  33151. <li>Merge three gray video streams of same width and height into single video stream:
  33152. <div class="example">
  33153. <pre class="example-preformatted">[a0][a1][a2]mergeplanes=0x001020:yuv444p
  33154. </pre></div>
  33155. </li><li>Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
  33156. <div class="example">
  33157. <pre class="example-preformatted">[a0][a1]mergeplanes=0x00010210:yuva444p
  33158. </pre></div>
  33159. </li><li>Swap Y and A plane in yuva444p stream:
  33160. <div class="example">
  33161. <pre class="example-preformatted">format=yuva444p,mergeplanes=0x03010200:yuva444p
  33162. </pre></div>
  33163. </li><li>Swap U and V plane in yuv420p stream:
  33164. <div class="example">
  33165. <pre class="example-preformatted">format=yuv420p,mergeplanes=0x000201:yuv420p
  33166. </pre></div>
  33167. </li><li>Cast a rgb24 clip to yuv444p:
  33168. <div class="example">
  33169. <pre class="example-preformatted">format=rgb24,mergeplanes=0x000102:yuv444p
  33170. </pre></div>
  33171. </li></ul>
  33172. <a name="mestimate"></a>
  33173. <h3 class="section">32.163 mestimate<span class="pull-right"><a class="anchor hidden-xs" href="#mestimate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mestimate" aria-hidden="true">TOC</a></span></h3>
  33174. <p>Estimate and export motion vectors using block matching algorithms.
  33175. Motion vectors are stored in frame side data to be used by other filters.
  33176. </p>
  33177. <p>This filter accepts the following options:
  33178. </p><dl class="table">
  33179. <dt><samp class="option">method</samp></dt>
  33180. <dd><p>Specify the motion estimation method. Accepts one of the following values:
  33181. </p>
  33182. <dl class="table">
  33183. <dt>&lsquo;<samp class="samp">esa</samp>&rsquo;</dt>
  33184. <dd><p>Exhaustive search algorithm.
  33185. </p></dd>
  33186. <dt>&lsquo;<samp class="samp">tss</samp>&rsquo;</dt>
  33187. <dd><p>Three step search algorithm.
  33188. </p></dd>
  33189. <dt>&lsquo;<samp class="samp">tdls</samp>&rsquo;</dt>
  33190. <dd><p>Two dimensional logarithmic search algorithm.
  33191. </p></dd>
  33192. <dt>&lsquo;<samp class="samp">ntss</samp>&rsquo;</dt>
  33193. <dd><p>New three step search algorithm.
  33194. </p></dd>
  33195. <dt>&lsquo;<samp class="samp">fss</samp>&rsquo;</dt>
  33196. <dd><p>Four step search algorithm.
  33197. </p></dd>
  33198. <dt>&lsquo;<samp class="samp">ds</samp>&rsquo;</dt>
  33199. <dd><p>Diamond search algorithm.
  33200. </p></dd>
  33201. <dt>&lsquo;<samp class="samp">hexbs</samp>&rsquo;</dt>
  33202. <dd><p>Hexagon-based search algorithm.
  33203. </p></dd>
  33204. <dt>&lsquo;<samp class="samp">epzs</samp>&rsquo;</dt>
  33205. <dd><p>Enhanced predictive zonal search algorithm.
  33206. </p></dd>
  33207. <dt>&lsquo;<samp class="samp">umh</samp>&rsquo;</dt>
  33208. <dd><p>Uneven multi-hexagon search algorithm.
  33209. </p></dd>
  33210. </dl>
  33211. <p>Default value is &lsquo;<samp class="samp">esa</samp>&rsquo;.
  33212. </p>
  33213. </dd>
  33214. <dt><samp class="option">mb_size</samp></dt>
  33215. <dd><p>Macroblock size. Default <code class="code">16</code>.
  33216. </p>
  33217. </dd>
  33218. <dt><samp class="option">search_param</samp></dt>
  33219. <dd><p>Search parameter. Default <code class="code">7</code>.
  33220. </p></dd>
  33221. </dl>
  33222. <a name="midequalizer"></a>
  33223. <h3 class="section">32.164 midequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#midequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-midequalizer" aria-hidden="true">TOC</a></span></h3>
  33224. <p>Apply Midway Image Equalization effect using two video streams.
  33225. </p>
  33226. <p>Midway Image Equalization adjusts a pair of images to have the same
  33227. histogram, while maintaining their dynamics as much as possible. It&rsquo;s
  33228. useful for e.g. matching exposures from a pair of stereo cameras.
  33229. </p>
  33230. <p>This filter has two inputs and one output, which must be of same pixel format, but
  33231. may be of different sizes. The output of filter is first input adjusted with
  33232. midway histogram of both inputs.
  33233. </p>
  33234. <p>This filter accepts the following option:
  33235. </p>
  33236. <dl class="table">
  33237. <dt><samp class="option">planes</samp></dt>
  33238. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  33239. </p></dd>
  33240. </dl>
  33241. <a name="minterpolate"></a>
  33242. <h3 class="section">32.165 minterpolate<span class="pull-right"><a class="anchor hidden-xs" href="#minterpolate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-minterpolate" aria-hidden="true">TOC</a></span></h3>
  33243. <p>Convert the video to specified frame rate using motion interpolation.
  33244. </p>
  33245. <p>This filter accepts the following options:
  33246. </p><dl class="table">
  33247. <dt><samp class="option">fps</samp></dt>
  33248. <dd><p>Specify the output frame rate. This can be rational e.g. <code class="code">60000/1001</code>. Frames are dropped if <var class="var">fps</var> is lower than source fps. Default <code class="code">60</code>.
  33249. </p>
  33250. </dd>
  33251. <dt><samp class="option">mi_mode</samp></dt>
  33252. <dd><p>Motion interpolation mode. Following values are accepted:
  33253. </p><dl class="table">
  33254. <dt>&lsquo;<samp class="samp">dup</samp>&rsquo;</dt>
  33255. <dd><p>Duplicate previous or next frame for interpolating new ones.
  33256. </p></dd>
  33257. <dt>&lsquo;<samp class="samp">blend</samp>&rsquo;</dt>
  33258. <dd><p>Blend source frames. Interpolated frame is mean of previous and next frames.
  33259. </p></dd>
  33260. <dt>&lsquo;<samp class="samp">mci</samp>&rsquo;</dt>
  33261. <dd><p>Motion compensated interpolation. Following options are effective when this mode is selected:
  33262. </p>
  33263. <dl class="table">
  33264. <dt>&lsquo;<samp class="samp">mc_mode</samp>&rsquo;</dt>
  33265. <dd><p>Motion compensation mode. Following values are accepted:
  33266. </p><dl class="table">
  33267. <dt>&lsquo;<samp class="samp">obmc</samp>&rsquo;</dt>
  33268. <dd><p>Overlapped block motion compensation.
  33269. </p></dd>
  33270. <dt>&lsquo;<samp class="samp">aobmc</samp>&rsquo;</dt>
  33271. <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.
  33272. </p></dd>
  33273. </dl>
  33274. <p>Default mode is &lsquo;<samp class="samp">obmc</samp>&rsquo;.
  33275. </p>
  33276. </dd>
  33277. <dt>&lsquo;<samp class="samp">me_mode</samp>&rsquo;</dt>
  33278. <dd><p>Motion estimation mode. Following values are accepted:
  33279. </p><dl class="table">
  33280. <dt>&lsquo;<samp class="samp">bidir</samp>&rsquo;</dt>
  33281. <dd><p>Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions.
  33282. </p></dd>
  33283. <dt>&lsquo;<samp class="samp">bilat</samp>&rsquo;</dt>
  33284. <dd><p>Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame.
  33285. </p></dd>
  33286. </dl>
  33287. <p>Default mode is &lsquo;<samp class="samp">bilat</samp>&rsquo;.
  33288. </p>
  33289. </dd>
  33290. <dt>&lsquo;<samp class="samp">me</samp>&rsquo;</dt>
  33291. <dd><p>The algorithm to be used for motion estimation. Following values are accepted:
  33292. </p><dl class="table">
  33293. <dt>&lsquo;<samp class="samp">esa</samp>&rsquo;</dt>
  33294. <dd><p>Exhaustive search algorithm.
  33295. </p></dd>
  33296. <dt>&lsquo;<samp class="samp">tss</samp>&rsquo;</dt>
  33297. <dd><p>Three step search algorithm.
  33298. </p></dd>
  33299. <dt>&lsquo;<samp class="samp">tdls</samp>&rsquo;</dt>
  33300. <dd><p>Two dimensional logarithmic search algorithm.
  33301. </p></dd>
  33302. <dt>&lsquo;<samp class="samp">ntss</samp>&rsquo;</dt>
  33303. <dd><p>New three step search algorithm.
  33304. </p></dd>
  33305. <dt>&lsquo;<samp class="samp">fss</samp>&rsquo;</dt>
  33306. <dd><p>Four step search algorithm.
  33307. </p></dd>
  33308. <dt>&lsquo;<samp class="samp">ds</samp>&rsquo;</dt>
  33309. <dd><p>Diamond search algorithm.
  33310. </p></dd>
  33311. <dt>&lsquo;<samp class="samp">hexbs</samp>&rsquo;</dt>
  33312. <dd><p>Hexagon-based search algorithm.
  33313. </p></dd>
  33314. <dt>&lsquo;<samp class="samp">epzs</samp>&rsquo;</dt>
  33315. <dd><p>Enhanced predictive zonal search algorithm.
  33316. </p></dd>
  33317. <dt>&lsquo;<samp class="samp">umh</samp>&rsquo;</dt>
  33318. <dd><p>Uneven multi-hexagon search algorithm.
  33319. </p></dd>
  33320. </dl>
  33321. <p>Default algorithm is &lsquo;<samp class="samp">epzs</samp>&rsquo;.
  33322. </p>
  33323. </dd>
  33324. <dt>&lsquo;<samp class="samp">mb_size</samp>&rsquo;</dt>
  33325. <dd><p>Macroblock size. Default <code class="code">16</code>.
  33326. </p>
  33327. </dd>
  33328. <dt>&lsquo;<samp class="samp">search_param</samp>&rsquo;</dt>
  33329. <dd><p>Motion estimation search parameter. Default <code class="code">32</code>.
  33330. </p>
  33331. </dd>
  33332. <dt>&lsquo;<samp class="samp">vsbmc</samp>&rsquo;</dt>
  33333. <dd><p>Enable variable-size block motion compensation. Motion estimation is applied with smaller block sizes at object boundaries in order to make them less blurry. Default is <code class="code">0</code> (disabled).
  33334. </p></dd>
  33335. </dl>
  33336. </dd>
  33337. </dl>
  33338. </dd>
  33339. <dt><samp class="option">scd</samp></dt>
  33340. <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:
  33341. </p><dl class="table">
  33342. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  33343. <dd><p>Disable scene change detection.
  33344. </p></dd>
  33345. <dt>&lsquo;<samp class="samp">fdiff</samp>&rsquo;</dt>
  33346. <dd><p>Frame difference. Corresponding pixel values are compared and if it satisfies <var class="var">scd_threshold</var> scene change is detected.
  33347. </p></dd>
  33348. </dl>
  33349. <p>Default method is &lsquo;<samp class="samp">fdiff</samp>&rsquo;.
  33350. </p>
  33351. </dd>
  33352. <dt><samp class="option">scd_threshold</samp></dt>
  33353. <dd><p>Scene change detection threshold. Default is <code class="code">10.</code>.
  33354. </p></dd>
  33355. </dl>
  33356. <a name="mix"></a>
  33357. <h3 class="section">32.166 mix<span class="pull-right"><a class="anchor hidden-xs" href="#mix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mix" aria-hidden="true">TOC</a></span></h3>
  33358. <p>Mix several video input streams into one video stream.
  33359. </p>
  33360. <p>A description of the accepted options follows.
  33361. </p>
  33362. <dl class="table">
  33363. <dt><samp class="option">inputs</samp></dt>
  33364. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  33365. </p>
  33366. </dd>
  33367. <dt><samp class="option">weights</samp></dt>
  33368. <dd><p>Specify weight of each input video stream as sequence.
  33369. Each weight is separated by space. If number of weights
  33370. is smaller than number of <var class="var">frames</var> last specified
  33371. weight will be used for all remaining unset weights.
  33372. </p>
  33373. </dd>
  33374. <dt><samp class="option">scale</samp></dt>
  33375. <dd><p>Specify scale, if it is set it will be multiplied with sum
  33376. of each weight multiplied with pixel values to give final destination
  33377. pixel value. By default <var class="var">scale</var> is auto scaled to sum of weights.
  33378. </p>
  33379. </dd>
  33380. <dt><samp class="option">planes</samp></dt>
  33381. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  33382. </p>
  33383. </dd>
  33384. <dt><samp class="option">duration</samp></dt>
  33385. <dd><p>Specify how end of stream is determined.
  33386. </p><dl class="table">
  33387. <dt>&lsquo;<samp class="samp">longest</samp>&rsquo;</dt>
  33388. <dd><p>The duration of the longest input. (default)
  33389. </p>
  33390. </dd>
  33391. <dt>&lsquo;<samp class="samp">shortest</samp>&rsquo;</dt>
  33392. <dd><p>The duration of the shortest input.
  33393. </p>
  33394. </dd>
  33395. <dt>&lsquo;<samp class="samp">first</samp>&rsquo;</dt>
  33396. <dd><p>The duration of the first input.
  33397. </p></dd>
  33398. </dl>
  33399. </dd>
  33400. </dl>
  33401. <a name="Commands-120"></a>
  33402. <h4 class="subsection">32.166.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-120" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-120" aria-hidden="true">TOC</a></span></h4>
  33403. <p>This filter supports the following commands:
  33404. </p><dl class="table">
  33405. <dt><samp class="option">weights</samp></dt>
  33406. <dt><samp class="option">scale</samp></dt>
  33407. <dt><samp class="option">planes</samp></dt>
  33408. <dd><p>Syntax is same as option with same name.
  33409. </p></dd>
  33410. </dl>
  33411. <a name="monochrome"></a>
  33412. <h3 class="section">32.167 monochrome<span class="pull-right"><a class="anchor hidden-xs" href="#monochrome" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-monochrome" aria-hidden="true">TOC</a></span></h3>
  33413. <p>Convert video to gray using custom color filter.
  33414. </p>
  33415. <p>A description of the accepted options follows.
  33416. </p>
  33417. <dl class="table">
  33418. <dt><samp class="option">cb</samp></dt>
  33419. <dd><p>Set the chroma blue spot. Allowed range is from -1 to 1.
  33420. Default value is 0.
  33421. </p>
  33422. </dd>
  33423. <dt><samp class="option">cr</samp></dt>
  33424. <dd><p>Set the chroma red spot. Allowed range is from -1 to 1.
  33425. Default value is 0.
  33426. </p>
  33427. </dd>
  33428. <dt><samp class="option">size</samp></dt>
  33429. <dd><p>Set the color filter size. Allowed range is from .1 to 10.
  33430. Default value is 1.
  33431. </p>
  33432. </dd>
  33433. <dt><samp class="option">high</samp></dt>
  33434. <dd><p>Set the highlights strength. Allowed range is from 0 to 1.
  33435. Default value is 0.
  33436. </p></dd>
  33437. </dl>
  33438. <a name="Commands-121"></a>
  33439. <h4 class="subsection">32.167.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-121" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-121" aria-hidden="true">TOC</a></span></h4>
  33440. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  33441. </p>
  33442. <a name="morpho"></a>
  33443. <h3 class="section">32.168 morpho<span class="pull-right"><a class="anchor hidden-xs" href="#morpho" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-morpho" aria-hidden="true">TOC</a></span></h3>
  33444. <p>This filter allows to apply main morphological grayscale transforms,
  33445. erode and dilate with arbitrary structures set in second input stream.
  33446. </p>
  33447. <p>Unlike naive implementation and much slower performance in <a class="ref" href="#erosion">erosion</a>
  33448. and <a class="ref" href="#dilation">dilation</a> filters, when speed is critical <code class="code">morpho</code> filter
  33449. should be used instead.
  33450. </p>
  33451. <p>A description of accepted options follows,
  33452. </p>
  33453. <dl class="table">
  33454. <dt><samp class="option">mode</samp></dt>
  33455. <dd><p>Set morphological transform to apply, can be:
  33456. </p>
  33457. <dl class="table">
  33458. <dt>&lsquo;<samp class="samp">erode</samp>&rsquo;</dt>
  33459. <dt>&lsquo;<samp class="samp">dilate</samp>&rsquo;</dt>
  33460. <dt>&lsquo;<samp class="samp">open</samp>&rsquo;</dt>
  33461. <dt>&lsquo;<samp class="samp">close</samp>&rsquo;</dt>
  33462. <dt>&lsquo;<samp class="samp">gradient</samp>&rsquo;</dt>
  33463. <dt>&lsquo;<samp class="samp">tophat</samp>&rsquo;</dt>
  33464. <dt>&lsquo;<samp class="samp">blackhat</samp>&rsquo;</dt>
  33465. </dl>
  33466. <p>Default is <code class="code">erode</code>.
  33467. </p>
  33468. </dd>
  33469. <dt><samp class="option">planes</samp></dt>
  33470. <dd><p>Set planes to filter, by default all planes except alpha are filtered.
  33471. </p>
  33472. </dd>
  33473. <dt><samp class="option">structure</samp></dt>
  33474. <dd><p>Set which structure video frames will be processed from second input stream,
  33475. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  33476. </p></dd>
  33477. </dl>
  33478. <p>The <code class="code">morpho</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  33479. </p>
  33480. <a name="Commands-122"></a>
  33481. <h4 class="subsection">32.168.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-122" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-122" aria-hidden="true">TOC</a></span></h4>
  33482. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  33483. </p>
  33484. <a name="mpdecimate"></a>
  33485. <h3 class="section">32.169 mpdecimate<span class="pull-right"><a class="anchor hidden-xs" href="#mpdecimate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpdecimate" aria-hidden="true">TOC</a></span></h3>
  33486. <p>Drop frames that do not differ greatly from the previous frame in
  33487. order to reduce frame rate.
  33488. </p>
  33489. <p>The main use of this filter is for very-low-bitrate encoding
  33490. (e.g. streaming over dialup modem), but it could in theory be used for
  33491. fixing movies that were inverse-telecined incorrectly.
  33492. </p>
  33493. <p>A description of the accepted options follows.
  33494. </p>
  33495. <dl class="table">
  33496. <dt><samp class="option">max</samp></dt>
  33497. <dd><p>Set the maximum number of consecutive frames which can be dropped (if
  33498. positive), or the minimum interval between dropped frames (if
  33499. negative). If the value is 0, the frame is dropped disregarding the
  33500. number of previous sequentially dropped frames.
  33501. </p>
  33502. <p>Default value is 0.
  33503. </p>
  33504. </dd>
  33505. <dt><samp class="option">keep</samp></dt>
  33506. <dd><p>Set the maximum number of consecutive similar frames to ignore before to start dropping them.
  33507. If the value is 0, the frame is dropped disregarding the
  33508. number of previous sequentially similar frames.
  33509. </p>
  33510. <p>Default value is 0.
  33511. </p>
  33512. </dd>
  33513. <dt><samp class="option">hi</samp></dt>
  33514. <dt><samp class="option">lo</samp></dt>
  33515. <dt><samp class="option">frac</samp></dt>
  33516. <dd><p>Set the dropping threshold values.
  33517. </p>
  33518. <p>Values for <samp class="option">hi</samp> and <samp class="option">lo</samp> are for 8x8 pixel blocks and
  33519. represent actual pixel value differences, so a threshold of 64
  33520. corresponds to 1 unit of difference for each pixel, or the same spread
  33521. out differently over the block.
  33522. </p>
  33523. <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
  33524. than a threshold of <samp class="option">hi</samp>, and if no more than <samp class="option">frac</samp> blocks (1
  33525. meaning the whole image) differ by more than a threshold of <samp class="option">lo</samp>.
  33526. </p>
  33527. <p>Default value for <samp class="option">hi</samp> is 64*12, default value for <samp class="option">lo</samp> is
  33528. 64*5, and default value for <samp class="option">frac</samp> is 0.33.
  33529. </p></dd>
  33530. </dl>
  33531. <a name="msad"></a>
  33532. <h3 class="section">32.170 msad<span class="pull-right"><a class="anchor hidden-xs" href="#msad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-msad" aria-hidden="true">TOC</a></span></h3>
  33533. <p>Obtain the MSAD (Mean Sum of Absolute Differences) between two input videos.
  33534. </p>
  33535. <p>This filter takes two input videos.
  33536. </p>
  33537. <p>Both input videos must have the same resolution and pixel format for
  33538. this filter to work correctly. Also it assumes that both inputs
  33539. have the same number of frames, which are compared one by one.
  33540. </p>
  33541. <p>The obtained per component, average, min and max MSAD is printed through
  33542. the logging system.
  33543. </p>
  33544. <p>The filter stores the calculated MSAD of each frame in frame metadata.
  33545. </p>
  33546. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  33547. </p>
  33548. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  33549. with the reference file <samp class="file">ref.mpg</samp>.
  33550. </p>
  33551. <div class="example">
  33552. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi msad -f null -
  33553. </pre></div>
  33554. <a name="multiply"></a>
  33555. <h3 class="section">32.171 multiply<span class="pull-right"><a class="anchor hidden-xs" href="#multiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-multiply" aria-hidden="true">TOC</a></span></h3>
  33556. <p>Multiply first video stream pixels values with second video stream pixels values.
  33557. </p>
  33558. <p>The filter accepts the following options:
  33559. </p>
  33560. <dl class="table">
  33561. <dt><samp class="option">scale</samp></dt>
  33562. <dd><p>Set the scale applied to second video stream. By default is <code class="code">1</code>.
  33563. Allowed range is from <code class="code">0</code> to <code class="code">9</code>.
  33564. </p>
  33565. </dd>
  33566. <dt><samp class="option">offset</samp></dt>
  33567. <dd><p>Set the offset applied to second video stream. By default is <code class="code">0.5</code>.
  33568. Allowed range is from <code class="code">-1</code> to <code class="code">1</code>.
  33569. </p>
  33570. </dd>
  33571. <dt><samp class="option">planes</samp></dt>
  33572. <dd><p>Specify planes from input video stream that will be processed.
  33573. By default all planes are processed.
  33574. </p></dd>
  33575. </dl>
  33576. <a name="Commands-123"></a>
  33577. <h4 class="subsection">32.171.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-123" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-123" aria-hidden="true">TOC</a></span></h4>
  33578. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  33579. </p>
  33580. <a name="negate"></a>
  33581. <h3 class="section">32.172 negate<span class="pull-right"><a class="anchor hidden-xs" href="#negate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-negate" aria-hidden="true">TOC</a></span></h3>
  33582. <p>Negate (invert) the input video.
  33583. </p>
  33584. <p>It accepts the following option:
  33585. </p>
  33586. <dl class="table">
  33587. <dt><samp class="option">components</samp></dt>
  33588. <dd><p>Set components to negate.
  33589. </p>
  33590. <p>Available values for components are:
  33591. </p><dl class="table">
  33592. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  33593. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  33594. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  33595. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  33596. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  33597. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  33598. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  33599. </dl>
  33600. </dd>
  33601. <dt><samp class="option">negate_alpha</samp></dt>
  33602. <dd><p>With value 1, it negates the alpha component, if present. Default value is 0.
  33603. </p></dd>
  33604. </dl>
  33605. <a name="Commands-124"></a>
  33606. <h4 class="subsection">32.172.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-124" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-124" aria-hidden="true">TOC</a></span></h4>
  33607. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  33608. </p>
  33609. <a class="anchor" id="nlmeans"></a><a name="nlmeans-1"></a>
  33610. <h3 class="section">32.173 nlmeans<span class="pull-right"><a class="anchor hidden-xs" href="#nlmeans-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nlmeans-1" aria-hidden="true">TOC</a></span></h3>
  33611. <p>Denoise frames using Non-Local Means algorithm.
  33612. </p>
  33613. <p>Each pixel is adjusted by looking for other pixels with similar contexts. This
  33614. context similarity is defined by comparing their surrounding patches of size
  33615. <samp class="option">p</samp>x<samp class="option">p</samp>. Patches are searched in an area of <samp class="option">r</samp>x<samp class="option">r</samp>
  33616. around the pixel.
  33617. </p>
  33618. <p>Note that the research area defines centers for patches, which means some
  33619. patches will be made of pixels outside that research area.
  33620. </p>
  33621. <p>The filter accepts the following options.
  33622. </p>
  33623. <dl class="table">
  33624. <dt><samp class="option">s</samp></dt>
  33625. <dd><p>Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0].
  33626. </p>
  33627. </dd>
  33628. <dt><samp class="option">p</samp></dt>
  33629. <dd><p>Set patch size. Default is 7. Must be odd number in range [0, 99].
  33630. </p>
  33631. </dd>
  33632. <dt><samp class="option">pc</samp></dt>
  33633. <dd><p>Same as <samp class="option">p</samp> but for chroma planes.
  33634. </p>
  33635. <p>The default value is <var class="var">0</var> and means automatic.
  33636. </p>
  33637. </dd>
  33638. <dt><samp class="option">r</samp></dt>
  33639. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  33640. </p>
  33641. </dd>
  33642. <dt><samp class="option">rc</samp></dt>
  33643. <dd><p>Same as <samp class="option">r</samp> but for chroma planes.
  33644. </p>
  33645. <p>The default value is <var class="var">0</var> and means automatic.
  33646. </p></dd>
  33647. </dl>
  33648. <a name="nnedi"></a>
  33649. <h3 class="section">32.174 nnedi<span class="pull-right"><a class="anchor hidden-xs" href="#nnedi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nnedi" aria-hidden="true">TOC</a></span></h3>
  33650. <p>Deinterlace video using neural network edge directed interpolation.
  33651. </p>
  33652. <p>This filter accepts the following options:
  33653. </p>
  33654. <dl class="table">
  33655. <dt><samp class="option">weights</samp></dt>
  33656. <dd><p>Mandatory option, without binary file filter can not work.
  33657. Currently file can be found here:
  33658. https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin
  33659. </p>
  33660. </dd>
  33661. <dt><samp class="option">deint</samp></dt>
  33662. <dd><p>Set which frames to deinterlace, by default it is <code class="code">all</code>.
  33663. Can be <code class="code">all</code> or <code class="code">interlaced</code>.
  33664. </p>
  33665. </dd>
  33666. <dt><samp class="option">field</samp></dt>
  33667. <dd><p>Set mode of operation.
  33668. </p>
  33669. <p>Can be one of the following:
  33670. </p>
  33671. <dl class="table">
  33672. <dt>&lsquo;<samp class="samp">af</samp>&rsquo;</dt>
  33673. <dd><p>Use frame flags, both fields.
  33674. </p></dd>
  33675. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  33676. <dd><p>Use frame flags, single field.
  33677. </p></dd>
  33678. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  33679. <dd><p>Use top field only.
  33680. </p></dd>
  33681. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  33682. <dd><p>Use bottom field only.
  33683. </p></dd>
  33684. <dt>&lsquo;<samp class="samp">tf</samp>&rsquo;</dt>
  33685. <dd><p>Use both fields, top first.
  33686. </p></dd>
  33687. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  33688. <dd><p>Use both fields, bottom first.
  33689. </p></dd>
  33690. </dl>
  33691. </dd>
  33692. <dt><samp class="option">planes</samp></dt>
  33693. <dd><p>Set which planes to process, by default filter process all frames.
  33694. </p>
  33695. </dd>
  33696. <dt><samp class="option">nsize</samp></dt>
  33697. <dd><p>Set size of local neighborhood around each pixel, used by the predictor neural
  33698. network.
  33699. </p>
  33700. <p>Can be one of the following:
  33701. </p>
  33702. <dl class="table">
  33703. <dt>&lsquo;<samp class="samp">s8x6</samp>&rsquo;</dt>
  33704. <dt>&lsquo;<samp class="samp">s16x6</samp>&rsquo;</dt>
  33705. <dt>&lsquo;<samp class="samp">s32x6</samp>&rsquo;</dt>
  33706. <dt>&lsquo;<samp class="samp">s48x6</samp>&rsquo;</dt>
  33707. <dt>&lsquo;<samp class="samp">s8x4</samp>&rsquo;</dt>
  33708. <dt>&lsquo;<samp class="samp">s16x4</samp>&rsquo;</dt>
  33709. <dt>&lsquo;<samp class="samp">s32x4</samp>&rsquo;</dt>
  33710. </dl>
  33711. </dd>
  33712. <dt><samp class="option">nns</samp></dt>
  33713. <dd><p>Set the number of neurons in predictor neural network.
  33714. Can be one of the following:
  33715. </p>
  33716. <dl class="table">
  33717. <dt>&lsquo;<samp class="samp">n16</samp>&rsquo;</dt>
  33718. <dt>&lsquo;<samp class="samp">n32</samp>&rsquo;</dt>
  33719. <dt>&lsquo;<samp class="samp">n64</samp>&rsquo;</dt>
  33720. <dt>&lsquo;<samp class="samp">n128</samp>&rsquo;</dt>
  33721. <dt>&lsquo;<samp class="samp">n256</samp>&rsquo;</dt>
  33722. </dl>
  33723. </dd>
  33724. <dt><samp class="option">qual</samp></dt>
  33725. <dd><p>Controls the number of different neural network predictions that are blended
  33726. together to compute the final output value. Can be <code class="code">fast</code>, default or
  33727. <code class="code">slow</code>.
  33728. </p>
  33729. </dd>
  33730. <dt><samp class="option">etype</samp></dt>
  33731. <dd><p>Set which set of weights to use in the predictor.
  33732. Can be one of the following:
  33733. </p>
  33734. <dl class="table">
  33735. <dt>&lsquo;<samp class="samp">a, abs</samp>&rsquo;</dt>
  33736. <dd><p>weights trained to minimize absolute error
  33737. </p></dd>
  33738. <dt>&lsquo;<samp class="samp">s, mse</samp>&rsquo;</dt>
  33739. <dd><p>weights trained to minimize squared error
  33740. </p></dd>
  33741. </dl>
  33742. </dd>
  33743. <dt><samp class="option">pscrn</samp></dt>
  33744. <dd><p>Controls whether or not the prescreener neural network is used to decide
  33745. which pixels should be processed by the predictor neural network and which
  33746. can be handled by simple cubic interpolation.
  33747. The prescreener is trained to know whether cubic interpolation will be
  33748. sufficient for a pixel or whether it should be predicted by the predictor nn.
  33749. The computational complexity of the prescreener nn is much less than that of
  33750. the predictor nn. Since most pixels can be handled by cubic interpolation,
  33751. using the prescreener generally results in much faster processing.
  33752. The prescreener is pretty accurate, so the difference between using it and not
  33753. using it is almost always unnoticeable.
  33754. </p>
  33755. <p>Can be one of the following:
  33756. </p>
  33757. <dl class="table">
  33758. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  33759. <dt>&lsquo;<samp class="samp">original</samp>&rsquo;</dt>
  33760. <dt>&lsquo;<samp class="samp">new</samp>&rsquo;</dt>
  33761. <dt>&lsquo;<samp class="samp">new2</samp>&rsquo;</dt>
  33762. <dt>&lsquo;<samp class="samp">new3</samp>&rsquo;</dt>
  33763. </dl>
  33764. <p>Default is <code class="code">new</code>.
  33765. </p></dd>
  33766. </dl>
  33767. <a name="Commands-125"></a>
  33768. <h4 class="subsection">32.174.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-125" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-125" aria-hidden="true">TOC</a></span></h4>
  33769. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options, excluding <var class="var">weights</var> option.
  33770. </p>
  33771. <a name="noformat"></a>
  33772. <h3 class="section">32.175 noformat<span class="pull-right"><a class="anchor hidden-xs" href="#noformat" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noformat" aria-hidden="true">TOC</a></span></h3>
  33773. <p>Force libavfilter not to use any of the specified pixel formats for the
  33774. input to the next filter.
  33775. </p>
  33776. <p>It accepts the following parameters:
  33777. </p><dl class="table">
  33778. <dt><samp class="option">pix_fmts</samp></dt>
  33779. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  33780. pix_fmts=yuv420p|monow|rgb24&quot;.
  33781. </p>
  33782. </dd>
  33783. </dl>
  33784. <a name="Examples-116"></a>
  33785. <h4 class="subsection">32.175.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-116" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-116" aria-hidden="true">TOC</a></span></h4>
  33786. <ul class="itemize mark-bullet">
  33787. <li>Force libavfilter to use a format different from <var class="var">yuv420p</var> for the
  33788. input to the vflip filter:
  33789. <div class="example">
  33790. <pre class="example-preformatted">noformat=pix_fmts=yuv420p,vflip
  33791. </pre></div>
  33792. </li><li>Convert the input video to any of the formats not contained in the list:
  33793. <div class="example">
  33794. <pre class="example-preformatted">noformat=yuv420p|yuv444p|yuv410p
  33795. </pre></div>
  33796. </li></ul>
  33797. <a name="noise-1"></a>
  33798. <h3 class="section">32.176 noise<span class="pull-right"><a class="anchor hidden-xs" href="#noise-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noise-1" aria-hidden="true">TOC</a></span></h3>
  33799. <p>Add noise on video input frame.
  33800. </p>
  33801. <p>The filter accepts the following options:
  33802. </p>
  33803. <dl class="table">
  33804. <dt><samp class="option">all_seed</samp></dt>
  33805. <dt><samp class="option">c0_seed</samp></dt>
  33806. <dt><samp class="option">c1_seed</samp></dt>
  33807. <dt><samp class="option">c2_seed</samp></dt>
  33808. <dt><samp class="option">c3_seed</samp></dt>
  33809. <dd><p>Set noise seed for specific pixel component or all pixel components in case
  33810. of <var class="var">all_seed</var>. Default value is <code class="code">123457</code>.
  33811. </p>
  33812. </dd>
  33813. <dt><samp class="option">all_strength, alls</samp></dt>
  33814. <dt><samp class="option">c0_strength, c0s</samp></dt>
  33815. <dt><samp class="option">c1_strength, c1s</samp></dt>
  33816. <dt><samp class="option">c2_strength, c2s</samp></dt>
  33817. <dt><samp class="option">c3_strength, c3s</samp></dt>
  33818. <dd><p>Set noise strength for specific pixel component or all pixel components in case
  33819. <var class="var">all_strength</var>. Default value is <code class="code">0</code>. Allowed range is [0, 100].
  33820. </p>
  33821. </dd>
  33822. <dt><samp class="option">all_flags, allf</samp></dt>
  33823. <dt><samp class="option">c0_flags, c0f</samp></dt>
  33824. <dt><samp class="option">c1_flags, c1f</samp></dt>
  33825. <dt><samp class="option">c2_flags, c2f</samp></dt>
  33826. <dt><samp class="option">c3_flags, c3f</samp></dt>
  33827. <dd><p>Set pixel component flags or set flags for all components if <var class="var">all_flags</var>.
  33828. Available values for component flags are:
  33829. </p><dl class="table">
  33830. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  33831. <dd><p>averaged temporal noise (smoother)
  33832. </p></dd>
  33833. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  33834. <dd><p>mix random noise with a (semi)regular pattern
  33835. </p></dd>
  33836. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  33837. <dd><p>temporal noise (noise pattern changes between frames)
  33838. </p></dd>
  33839. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  33840. <dd><p>uniform noise (gaussian otherwise)
  33841. </p></dd>
  33842. </dl>
  33843. </dd>
  33844. </dl>
  33845. <a name="Examples-117"></a>
  33846. <h4 class="subsection">32.176.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-117" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-117" aria-hidden="true">TOC</a></span></h4>
  33847. <p>Add temporal and uniform noise to input video:
  33848. </p><div class="example">
  33849. <pre class="example-preformatted">noise=alls=20:allf=t+u
  33850. </pre></div>
  33851. <a name="normalize"></a>
  33852. <h3 class="section">32.177 normalize<span class="pull-right"><a class="anchor hidden-xs" href="#normalize" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-normalize" aria-hidden="true">TOC</a></span></h3>
  33853. <p>Normalize RGB video (aka histogram stretching, contrast stretching).
  33854. See: https://en.wikipedia.org/wiki/Normalization_(image_processing)
  33855. </p>
  33856. <p>For each channel of each frame, the filter computes the input range and maps
  33857. it linearly to the user-specified output range. The output range defaults
  33858. to the full dynamic range from pure black to pure white.
  33859. </p>
  33860. <p>Temporal smoothing can be used on the input range to reduce flickering (rapid
  33861. changes in brightness) caused when small dark or bright objects enter or leave
  33862. the scene. This is similar to the auto-exposure (automatic gain control) on a
  33863. video camera, and, like a video camera, it may cause a period of over- or
  33864. under-exposure of the video.
  33865. </p>
  33866. <p>The R,G,B channels can be normalized independently, which may cause some
  33867. color shifting, or linked together as a single channel, which prevents
  33868. color shifting. Linked normalization preserves hue. Independent normalization
  33869. does not, so it can be used to remove some color casts. Independent and linked
  33870. normalization can be combined in any ratio.
  33871. </p>
  33872. <p>The normalize filter accepts the following options:
  33873. </p>
  33874. <dl class="table">
  33875. <dt><samp class="option">blackpt</samp></dt>
  33876. <dt><samp class="option">whitept</samp></dt>
  33877. <dd><p>Colors which define the output range. The minimum input value is mapped to
  33878. the <var class="var">blackpt</var>. The maximum input value is mapped to the <var class="var">whitept</var>.
  33879. The defaults are black and white respectively. Specifying white for
  33880. <var class="var">blackpt</var> and black for <var class="var">whitept</var> will give color-inverted,
  33881. normalized video. Shades of grey can be used to reduce the dynamic range
  33882. (contrast). Specifying saturated colors here can create some interesting
  33883. effects.
  33884. </p>
  33885. </dd>
  33886. <dt><samp class="option">smoothing</samp></dt>
  33887. <dd><p>The number of previous frames to use for temporal smoothing. The input range
  33888. of each channel is smoothed using a rolling average over the current frame
  33889. and the <var class="var">smoothing</var> previous frames. The default is 0 (no temporal
  33890. smoothing).
  33891. </p>
  33892. </dd>
  33893. <dt><samp class="option">independence</samp></dt>
  33894. <dd><p>Controls the ratio of independent (color shifting) channel normalization to
  33895. linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully
  33896. independent. Defaults to 1.0 (fully independent).
  33897. </p>
  33898. </dd>
  33899. <dt><samp class="option">strength</samp></dt>
  33900. <dd><p>Overall strength of the filter. 1.0 is full strength. 0.0 is a rather
  33901. expensive no-op. Defaults to 1.0 (full strength).
  33902. </p>
  33903. </dd>
  33904. </dl>
  33905. <a name="Commands-126"></a>
  33906. <h4 class="subsection">32.177.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-126" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-126" aria-hidden="true">TOC</a></span></h4>
  33907. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options, excluding <var class="var">smoothing</var> option.
  33908. The command accepts the same syntax of the corresponding option.
  33909. </p>
  33910. <p>If the specified expression is not valid, it is kept at its current
  33911. value.
  33912. </p>
  33913. <a name="Examples-118"></a>
  33914. <h4 class="subsection">32.177.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-118" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-118" aria-hidden="true">TOC</a></span></h4>
  33915. <p>Stretch video contrast to use the full dynamic range, with no temporal
  33916. smoothing; may flicker depending on the source content:
  33917. </p><div class="example">
  33918. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=0
  33919. </pre></div>
  33920. <p>As above, but with 50 frames of temporal smoothing; flicker should be
  33921. reduced, depending on the source content:
  33922. </p><div class="example">
  33923. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50
  33924. </pre></div>
  33925. <p>As above, but with hue-preserving linked channel normalization:
  33926. </p><div class="example">
  33927. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50:independence=0
  33928. </pre></div>
  33929. <p>As above, but with half strength:
  33930. </p><div class="example">
  33931. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
  33932. </pre></div>
  33933. <p>Map the darkest input color to red, the brightest input color to cyan:
  33934. </p><div class="example">
  33935. <pre class="example-preformatted">normalize=blackpt=red:whitept=cyan
  33936. </pre></div>
  33937. <a name="null-1"></a>
  33938. <h3 class="section">32.178 null<span class="pull-right"><a class="anchor hidden-xs" href="#null-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-null-1" aria-hidden="true">TOC</a></span></h3>
  33939. <p>Pass the video source unchanged to the output.
  33940. </p>
  33941. <a name="ocr"></a>
  33942. <h3 class="section">32.179 ocr<span class="pull-right"><a class="anchor hidden-xs" href="#ocr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ocr" aria-hidden="true">TOC</a></span></h3>
  33943. <p>Optical Character Recognition
  33944. </p>
  33945. <p>This filter uses Tesseract for optical character recognition. To enable
  33946. compilation of this filter, you need to configure FFmpeg with
  33947. <code class="code">--enable-libtesseract</code>.
  33948. </p>
  33949. <p>It accepts the following options:
  33950. </p>
  33951. <dl class="table">
  33952. <dt><samp class="option">datapath</samp></dt>
  33953. <dd><p>Set datapath to tesseract data. Default is to use whatever was
  33954. set at installation.
  33955. </p>
  33956. </dd>
  33957. <dt><samp class="option">language</samp></dt>
  33958. <dd><p>Set language, default is &quot;eng&quot;.
  33959. </p>
  33960. </dd>
  33961. <dt><samp class="option">whitelist</samp></dt>
  33962. <dd><p>Set character whitelist.
  33963. </p>
  33964. </dd>
  33965. <dt><samp class="option">blacklist</samp></dt>
  33966. <dd><p>Set character blacklist.
  33967. </p></dd>
  33968. </dl>
  33969. <p>The filter exports recognized text as the frame metadata <code class="code">lavfi.ocr.text</code>.
  33970. The filter exports confidence of recognized words as the frame metadata <code class="code">lavfi.ocr.confidence</code>.
  33971. </p>
  33972. <a name="ocv"></a>
  33973. <h3 class="section">32.180 ocv<span class="pull-right"><a class="anchor hidden-xs" href="#ocv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ocv" aria-hidden="true">TOC</a></span></h3>
  33974. <p>Apply a video transform using libopencv.
  33975. </p>
  33976. <p>To enable this filter, install the libopencv library and headers and
  33977. configure FFmpeg with <code class="code">--enable-libopencv</code>.
  33978. </p>
  33979. <p>It accepts the following parameters:
  33980. </p>
  33981. <dl class="table">
  33982. <dt><samp class="option">filter_name</samp></dt>
  33983. <dd><p>The name of the libopencv filter to apply.
  33984. </p>
  33985. </dd>
  33986. <dt><samp class="option">filter_params</samp></dt>
  33987. <dd><p>The parameters to pass to the libopencv filter. If not specified, the default
  33988. values are assumed.
  33989. </p>
  33990. </dd>
  33991. </dl>
  33992. <p>Refer to the official libopencv documentation for more precise
  33993. information:
  33994. <a class="url" href="http://docs.opencv.org/master/modules/imgproc/doc/filtering.html">http://docs.opencv.org/master/modules/imgproc/doc/filtering.html</a>
  33995. </p>
  33996. <p>Several libopencv filters are supported; see the following subsections.
  33997. </p>
  33998. <a class="anchor" id="dilate"></a><a name="dilate-1"></a>
  33999. <h4 class="subsection">32.180.1 dilate<span class="pull-right"><a class="anchor hidden-xs" href="#dilate-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilate-1" aria-hidden="true">TOC</a></span></h4>
  34000. <p>Dilate an image by using a specific structuring element.
  34001. It corresponds to the libopencv function <code class="code">cvDilate</code>.
  34002. </p>
  34003. <p>It accepts the parameters: <var class="var">struct_el</var>|<var class="var">nb_iterations</var>.
  34004. </p>
  34005. <p><var class="var">struct_el</var> represents a structuring element, and has the syntax:
  34006. <var class="var">cols</var>x<var class="var">rows</var>+<var class="var">anchor_x</var>x<var class="var">anchor_y</var>/<var class="var">shape</var>
  34007. </p>
  34008. <p><var class="var">cols</var> and <var class="var">rows</var> represent the number of columns and rows of
  34009. the structuring element, <var class="var">anchor_x</var> and <var class="var">anchor_y</var> the anchor
  34010. point, and <var class="var">shape</var> the shape for the structuring element. <var class="var">shape</var>
  34011. must be &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, or &quot;custom&quot;.
  34012. </p>
  34013. <p>If the value for <var class="var">shape</var> is &quot;custom&quot;, it must be followed by a
  34014. string of the form &quot;=<var class="var">filename</var>&quot;. The file with name
  34015. <var class="var">filename</var> is assumed to represent a binary image, with each
  34016. printable character corresponding to a bright pixel. When a custom
  34017. <var class="var">shape</var> is used, <var class="var">cols</var> and <var class="var">rows</var> are ignored, the number
  34018. or columns and rows of the read file are assumed instead.
  34019. </p>
  34020. <p>The default value for <var class="var">struct_el</var> is &quot;3x3+0x0/rect&quot;.
  34021. </p>
  34022. <p><var class="var">nb_iterations</var> specifies the number of times the transform is
  34023. applied to the image, and defaults to 1.
  34024. </p>
  34025. <p>Some examples:
  34026. </p><div class="example">
  34027. <pre class="example-preformatted"># Use the default values
  34028. ocv=dilate
  34029. # Dilate using a structuring element with a 5x5 cross, iterating two times
  34030. ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
  34031. # Read the shape from the file diamond.shape, iterating two times.
  34032. # The file diamond.shape may contain a pattern of characters like this
  34033. # *
  34034. # ***
  34035. # *****
  34036. # ***
  34037. # *
  34038. # The specified columns and rows are ignored
  34039. # but the anchor point coordinates are not
  34040. ocv=dilate:0x0+2x2/custom=diamond.shape|2
  34041. </pre></div>
  34042. <a name="erode"></a>
  34043. <h4 class="subsection">32.180.2 erode<span class="pull-right"><a class="anchor hidden-xs" href="#erode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erode" aria-hidden="true">TOC</a></span></h4>
  34044. <p>Erode an image by using a specific structuring element.
  34045. It corresponds to the libopencv function <code class="code">cvErode</code>.
  34046. </p>
  34047. <p>It accepts the parameters: <var class="var">struct_el</var>:<var class="var">nb_iterations</var>,
  34048. with the same syntax and semantics as the <a class="ref" href="#dilate">dilate</a> filter.
  34049. </p>
  34050. <a name="smooth"></a>
  34051. <h4 class="subsection">32.180.3 smooth<span class="pull-right"><a class="anchor hidden-xs" href="#smooth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smooth" aria-hidden="true">TOC</a></span></h4>
  34052. <p>Smooth the input video.
  34053. </p>
  34054. <p>The filter takes the following parameters:
  34055. <var class="var">type</var>|<var class="var">param1</var>|<var class="var">param2</var>|<var class="var">param3</var>|<var class="var">param4</var>.
  34056. </p>
  34057. <p><var class="var">type</var> is the type of smooth filter to apply, and must be one of
  34058. the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
  34059. or &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
  34060. </p>
  34061. <p>The meaning of <var class="var">param1</var>, <var class="var">param2</var>, <var class="var">param3</var>, and <var class="var">param4</var>
  34062. depends on the smooth type. <var class="var">param1</var> and
  34063. <var class="var">param2</var> accept integer positive values or 0. <var class="var">param3</var> and
  34064. <var class="var">param4</var> accept floating point values.
  34065. </p>
  34066. <p>The default value for <var class="var">param1</var> is 3. The default value for the
  34067. other parameters is 0.
  34068. </p>
  34069. <p>These parameters correspond to the parameters assigned to the
  34070. libopencv function <code class="code">cvSmooth</code>.
  34071. </p>
  34072. <a name="oscilloscope"></a>
  34073. <h3 class="section">32.181 oscilloscope<span class="pull-right"><a class="anchor hidden-xs" href="#oscilloscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oscilloscope" aria-hidden="true">TOC</a></span></h3>
  34074. <p>2D Video Oscilloscope.
  34075. </p>
  34076. <p>Useful to measure spatial impulse, step responses, chroma delays, etc.
  34077. </p>
  34078. <p>It accepts the following parameters:
  34079. </p>
  34080. <dl class="table">
  34081. <dt><samp class="option">x</samp></dt>
  34082. <dd><p>Set scope center x position.
  34083. </p>
  34084. </dd>
  34085. <dt><samp class="option">y</samp></dt>
  34086. <dd><p>Set scope center y position.
  34087. </p>
  34088. </dd>
  34089. <dt><samp class="option">s</samp></dt>
  34090. <dd><p>Set scope size, relative to frame diagonal.
  34091. </p>
  34092. </dd>
  34093. <dt><samp class="option">t</samp></dt>
  34094. <dd><p>Set scope tilt/rotation.
  34095. </p>
  34096. </dd>
  34097. <dt><samp class="option">o</samp></dt>
  34098. <dd><p>Set trace opacity.
  34099. </p>
  34100. </dd>
  34101. <dt><samp class="option">tx</samp></dt>
  34102. <dd><p>Set trace center x position.
  34103. </p>
  34104. </dd>
  34105. <dt><samp class="option">ty</samp></dt>
  34106. <dd><p>Set trace center y position.
  34107. </p>
  34108. </dd>
  34109. <dt><samp class="option">tw</samp></dt>
  34110. <dd><p>Set trace width, relative to width of frame.
  34111. </p>
  34112. </dd>
  34113. <dt><samp class="option">th</samp></dt>
  34114. <dd><p>Set trace height, relative to height of frame.
  34115. </p>
  34116. </dd>
  34117. <dt><samp class="option">c</samp></dt>
  34118. <dd><p>Set which components to trace. By default it traces first three components.
  34119. </p>
  34120. </dd>
  34121. <dt><samp class="option">g</samp></dt>
  34122. <dd><p>Draw trace grid. By default is enabled.
  34123. </p>
  34124. </dd>
  34125. <dt><samp class="option">st</samp></dt>
  34126. <dd><p>Draw some statistics. By default is enabled.
  34127. </p>
  34128. </dd>
  34129. <dt><samp class="option">sc</samp></dt>
  34130. <dd><p>Draw scope. By default is enabled.
  34131. </p></dd>
  34132. </dl>
  34133. <a name="Commands-127"></a>
  34134. <h4 class="subsection">32.181.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-127" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-127" aria-hidden="true">TOC</a></span></h4>
  34135. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  34136. The command accepts the same syntax of the corresponding option.
  34137. </p>
  34138. <p>If the specified expression is not valid, it is kept at its current
  34139. value.
  34140. </p>
  34141. <a name="Examples-119"></a>
  34142. <h4 class="subsection">32.181.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-119" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-119" aria-hidden="true">TOC</a></span></h4>
  34143. <ul class="itemize mark-bullet">
  34144. <li>Inspect full first row of video frame.
  34145. <div class="example">
  34146. <pre class="example-preformatted">oscilloscope=x=0.5:y=0:s=1
  34147. </pre></div>
  34148. </li><li>Inspect full last row of video frame.
  34149. <div class="example">
  34150. <pre class="example-preformatted">oscilloscope=x=0.5:y=1:s=1
  34151. </pre></div>
  34152. </li><li>Inspect full 5th line of video frame of height 1080.
  34153. <div class="example">
  34154. <pre class="example-preformatted">oscilloscope=x=0.5:y=5/1080:s=1
  34155. </pre></div>
  34156. </li><li>Inspect full last column of video frame.
  34157. <div class="example">
  34158. <pre class="example-preformatted">oscilloscope=x=1:y=0.5:s=1:t=1
  34159. </pre></div>
  34160. </li></ul>
  34161. <a class="anchor" id="overlay"></a><a name="overlay-1"></a>
  34162. <h3 class="section">32.182 overlay<span class="pull-right"><a class="anchor hidden-xs" href="#overlay-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay-1" aria-hidden="true">TOC</a></span></h3>
  34163. <p>Overlay one video on top of another.
  34164. </p>
  34165. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  34166. video on which the second input is overlaid.
  34167. </p>
  34168. <p>It accepts the following parameters:
  34169. </p>
  34170. <p>A description of the accepted options follows.
  34171. </p>
  34172. <dl class="table">
  34173. <dt><samp class="option">x</samp></dt>
  34174. <dt><samp class="option">y</samp></dt>
  34175. <dd><p>Set the expression for the x and y coordinates of the overlaid video
  34176. on the main video. Default value is &quot;0&quot; for both expressions. In case
  34177. the expression is invalid, it is set to a huge value (meaning that the
  34178. overlay will not be displayed within the output visible area).
  34179. </p>
  34180. </dd>
  34181. <dt><samp class="option">eof_action</samp></dt>
  34182. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  34183. </p>
  34184. </dd>
  34185. <dt><samp class="option">eval</samp></dt>
  34186. <dd><p>Set when the expressions for <samp class="option">x</samp>, and <samp class="option">y</samp> are evaluated.
  34187. </p>
  34188. <p>It accepts the following values:
  34189. </p><dl class="table">
  34190. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  34191. <dd><p>only evaluate expressions once during the filter initialization or
  34192. when a command is processed
  34193. </p>
  34194. </dd>
  34195. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  34196. <dd><p>evaluate expressions for each incoming frame
  34197. </p></dd>
  34198. </dl>
  34199. <p>Default value is &lsquo;<samp class="samp">frame</samp>&rsquo;.
  34200. </p>
  34201. </dd>
  34202. <dt><samp class="option">shortest</samp></dt>
  34203. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  34204. </p>
  34205. </dd>
  34206. <dt><samp class="option">format</samp></dt>
  34207. <dd><p>Set the format for the output video.
  34208. </p>
  34209. <p>It accepts the following values:
  34210. </p><dl class="table">
  34211. <dt>&lsquo;<samp class="samp">yuv420</samp>&rsquo;</dt>
  34212. <dd><p>force YUV 4:2:0 8-bit planar output
  34213. </p>
  34214. </dd>
  34215. <dt>&lsquo;<samp class="samp">yuv420p10</samp>&rsquo;</dt>
  34216. <dd><p>force YUV 4:2:0 10-bit planar output
  34217. </p>
  34218. </dd>
  34219. <dt>&lsquo;<samp class="samp">yuv422</samp>&rsquo;</dt>
  34220. <dd><p>force YUV 4:2:2 8-bit planar output
  34221. </p>
  34222. </dd>
  34223. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  34224. <dd><p>force YUV 4:2:2 10-bit planar output
  34225. </p>
  34226. </dd>
  34227. <dt>&lsquo;<samp class="samp">yuv444</samp>&rsquo;</dt>
  34228. <dd><p>force YUV 4:4:4 8-bit planar output
  34229. </p>
  34230. </dd>
  34231. <dt>&lsquo;<samp class="samp">yuv444p10</samp>&rsquo;</dt>
  34232. <dd><p>force YUV 4:4:4 10-bit planar output
  34233. </p>
  34234. </dd>
  34235. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  34236. <dd><p>force RGB 8-bit packed output
  34237. </p>
  34238. </dd>
  34239. <dt>&lsquo;<samp class="samp">gbrp</samp>&rsquo;</dt>
  34240. <dd><p>force RGB 8-bit planar output
  34241. </p>
  34242. </dd>
  34243. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  34244. <dd><p>automatically pick format
  34245. </p></dd>
  34246. </dl>
  34247. <p>Default value is &lsquo;<samp class="samp">yuv420</samp>&rsquo;.
  34248. </p>
  34249. </dd>
  34250. <dt><samp class="option">repeatlast</samp></dt>
  34251. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  34252. </p>
  34253. </dd>
  34254. <dt><samp class="option">alpha</samp></dt>
  34255. <dd><p>Set format of alpha of the overlaid video, it can be <var class="var">straight</var> or
  34256. <var class="var">premultiplied</var>, or <var class="var">auto</var> to choose the alpha mode automatically.
  34257. Default is <var class="var">auto</var>.
  34258. </p></dd>
  34259. </dl>
  34260. <p>The <samp class="option">x</samp>, and <samp class="option">y</samp> expressions can contain the following
  34261. parameters.
  34262. </p>
  34263. <dl class="table">
  34264. <dt><samp class="option">main_w, W</samp></dt>
  34265. <dt><samp class="option">main_h, H</samp></dt>
  34266. <dd><p>The main input width and height.
  34267. </p>
  34268. </dd>
  34269. <dt><samp class="option">overlay_w, w</samp></dt>
  34270. <dt><samp class="option">overlay_h, h</samp></dt>
  34271. <dd><p>The overlay input width and height.
  34272. </p>
  34273. </dd>
  34274. <dt><samp class="option">x</samp></dt>
  34275. <dt><samp class="option">y</samp></dt>
  34276. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  34277. each new frame.
  34278. </p>
  34279. </dd>
  34280. <dt><samp class="option">hsub</samp></dt>
  34281. <dt><samp class="option">vsub</samp></dt>
  34282. <dd><p>horizontal and vertical chroma subsample values of the output
  34283. format. For example for the pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and
  34284. <var class="var">vsub</var> is 1.
  34285. </p>
  34286. </dd>
  34287. <dt><samp class="option">n</samp></dt>
  34288. <dd><p>the number of input frame, starting from 0
  34289. </p>
  34290. </dd>
  34291. <dt><samp class="option">pos</samp></dt>
  34292. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  34293. do not use
  34294. </p>
  34295. </dd>
  34296. <dt><samp class="option">t</samp></dt>
  34297. <dd><p>The timestamp, expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  34298. </p>
  34299. </dd>
  34300. </dl>
  34301. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  34302. </p>
  34303. <p>Note that the <var class="var">n</var>, <var class="var">t</var> variables are available only
  34304. when evaluation is done <em class="emph">per frame</em>, and will evaluate to NAN
  34305. when <samp class="option">eval</samp> is set to &lsquo;<samp class="samp">init</samp>&rsquo;.
  34306. </p>
  34307. <p>Be aware that frames are taken from each input video in timestamp
  34308. order, hence, if their initial timestamps differ, it is a good idea
  34309. to pass the two inputs through a <var class="var">setpts=PTS-STARTPTS</var> filter to
  34310. have them begin in the same zero timestamp, as the example for
  34311. the <var class="var">movie</var> filter does.
  34312. </p>
  34313. <p>You can chain together more overlays but you should test the
  34314. efficiency of such approach.
  34315. </p>
  34316. <a name="Commands-128"></a>
  34317. <h4 class="subsection">32.182.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-128" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-128" aria-hidden="true">TOC</a></span></h4>
  34318. <p>This filter supports the following commands:
  34319. </p><dl class="table">
  34320. <dt><samp class="option">x</samp></dt>
  34321. <dt><samp class="option">y</samp></dt>
  34322. <dd><p>Modify the x and y of the overlay input.
  34323. The command accepts the same syntax of the corresponding option.
  34324. </p>
  34325. <p>If the specified expression is not valid, it is kept at its current
  34326. value.
  34327. </p></dd>
  34328. </dl>
  34329. <a name="Examples-120"></a>
  34330. <h4 class="subsection">32.182.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-120" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-120" aria-hidden="true">TOC</a></span></h4>
  34331. <ul class="itemize mark-bullet">
  34332. <li>Draw the overlay at 10 pixels from the bottom right corner of the main
  34333. video:
  34334. <div class="example">
  34335. <pre class="example-preformatted">overlay=main_w-overlay_w-10:main_h-overlay_h-10
  34336. </pre></div>
  34337. <p>Using named options the example above becomes:
  34338. </p><div class="example">
  34339. <pre class="example-preformatted">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
  34340. </pre></div>
  34341. </li><li>Insert a transparent PNG logo in the bottom left corner of the input,
  34342. using the <code class="command">ffmpeg</code> tool with the <code class="code">-filter_complex</code> option:
  34343. <div class="example">
  34344. <pre class="example-preformatted">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
  34345. </pre></div>
  34346. </li><li>Insert 2 different transparent PNG logos (second logo on bottom
  34347. right corner) using the <code class="command">ffmpeg</code> tool:
  34348. <div class="example">
  34349. <pre class="example-preformatted">ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output
  34350. </pre></div>
  34351. </li><li>Add a transparent color layer on top of the main video; <code class="code">WxH</code>
  34352. must specify the size of the main input to the overlay filter:
  34353. <div class="example">
  34354. <pre class="example-preformatted">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
  34355. </pre></div>
  34356. </li><li>Play an original video and a filtered version (here with the deshake
  34357. filter) side by side using the <code class="command">ffplay</code> tool:
  34358. <div class="example">
  34359. <pre class="example-preformatted">ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
  34360. </pre></div>
  34361. <p>The above command is the same as:
  34362. </p><div class="example">
  34363. <pre class="example-preformatted">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
  34364. </pre></div>
  34365. </li><li>Make a sliding overlay appearing from the left to the right top part of the
  34366. screen starting since time 2:
  34367. <div class="example">
  34368. <pre class="example-preformatted">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
  34369. </pre></div>
  34370. </li><li>Compose output by putting two input videos side to side:
  34371. <div class="example">
  34372. <pre class="example-preformatted">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
  34373. nullsrc=size=200x100 [background];
  34374. [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
  34375. [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
  34376. [background][left] overlay=shortest=1 [background+left];
  34377. [background+left][right] overlay=shortest=1:x=100 [left+right]
  34378. &quot;
  34379. </pre></div>
  34380. </li><li>Mask 10-20 seconds of a video by applying the delogo filter to a section
  34381. <div class="example">
  34382. <pre class="example-preformatted">ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
  34383. -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]'
  34384. masked.avi
  34385. </pre></div>
  34386. </li><li>Chain several overlays in cascade:
  34387. <div class="example">
  34388. <pre class="example-preformatted">nullsrc=s=200x200 [bg];
  34389. testsrc=s=100x100, split=4 [in0][in1][in2][in3];
  34390. [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
  34391. [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
  34392. [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
  34393. [in3] null, [mid2] overlay=100:100 [out0]
  34394. </pre></div>
  34395. </li></ul>
  34396. <a name="owdenoise"></a>
  34397. <h3 class="section">32.183 owdenoise<span class="pull-right"><a class="anchor hidden-xs" href="#owdenoise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-owdenoise" aria-hidden="true">TOC</a></span></h3>
  34398. <p>Apply Overcomplete Wavelet denoiser.
  34399. </p>
  34400. <p>The filter accepts the following options:
  34401. </p>
  34402. <dl class="table">
  34403. <dt><samp class="option">depth</samp></dt>
  34404. <dd><p>Set depth.
  34405. </p>
  34406. <p>Larger depth values will denoise lower frequency components more, but
  34407. slow down filtering.
  34408. </p>
  34409. <p>Must be an int in the range 8-16, default is <code class="code">8</code>.
  34410. </p>
  34411. </dd>
  34412. <dt><samp class="option">luma_strength, ls</samp></dt>
  34413. <dd><p>Set luma strength.
  34414. </p>
  34415. <p>Must be a double value in the range 0-1000, default is <code class="code">1.0</code>.
  34416. </p>
  34417. </dd>
  34418. <dt><samp class="option">chroma_strength, cs</samp></dt>
  34419. <dd><p>Set chroma strength.
  34420. </p>
  34421. <p>Must be a double value in the range 0-1000, default is <code class="code">1.0</code>.
  34422. </p></dd>
  34423. </dl>
  34424. <a class="anchor" id="pad"></a><a name="pad-1"></a>
  34425. <h3 class="section">32.184 pad<span class="pull-right"><a class="anchor hidden-xs" href="#pad-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad-1" aria-hidden="true">TOC</a></span></h3>
  34426. <p>Add paddings to the input image, and place the original input at the
  34427. provided <var class="var">x</var>, <var class="var">y</var> coordinates.
  34428. </p>
  34429. <p>It accepts the following parameters:
  34430. </p>
  34431. <dl class="table">
  34432. <dt><samp class="option">width, w</samp></dt>
  34433. <dt><samp class="option">height, h</samp></dt>
  34434. <dd><p>Specify an expression for the size of the output image with the
  34435. paddings added. If the value for <var class="var">width</var> or <var class="var">height</var> is 0, the
  34436. corresponding input size is used for the output.
  34437. </p>
  34438. <p>The <var class="var">width</var> expression can reference the value set by the
  34439. <var class="var">height</var> expression, and vice versa.
  34440. </p>
  34441. <p>The default value of <var class="var">width</var> and <var class="var">height</var> is 0.
  34442. </p>
  34443. </dd>
  34444. <dt><samp class="option">x</samp></dt>
  34445. <dt><samp class="option">y</samp></dt>
  34446. <dd><p>Specify the offsets to place the input image at within the padded area,
  34447. with respect to the top/left border of the output image.
  34448. </p>
  34449. <p>The <var class="var">x</var> expression can reference the value set by the <var class="var">y</var>
  34450. expression, and vice versa.
  34451. </p>
  34452. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is 0.
  34453. </p>
  34454. <p>If <var class="var">x</var> or <var class="var">y</var> evaluate to a negative number, they&rsquo;ll be changed
  34455. so the input image is centered on the padded area.
  34456. </p>
  34457. </dd>
  34458. <dt><samp class="option">color</samp></dt>
  34459. <dd><p>Specify the color of the padded area. For the syntax of this option,
  34460. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  34461. manual</a>.
  34462. </p>
  34463. <p>The default value of <var class="var">color</var> is &quot;black&quot;.
  34464. </p>
  34465. </dd>
  34466. <dt><samp class="option">eval</samp></dt>
  34467. <dd><p>Specify when to evaluate <var class="var">width</var>, <var class="var">height</var>, <var class="var">x</var> and <var class="var">y</var> expression.
  34468. </p>
  34469. <p>It accepts the following values:
  34470. </p>
  34471. <dl class="table">
  34472. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  34473. <dd><p>Only evaluate expressions once during the filter initialization or when
  34474. a command is processed.
  34475. </p>
  34476. </dd>
  34477. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  34478. <dd><p>Evaluate expressions for each incoming frame.
  34479. </p>
  34480. </dd>
  34481. </dl>
  34482. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  34483. </p>
  34484. </dd>
  34485. <dt><samp class="option">aspect</samp></dt>
  34486. <dd><p>Pad to aspect instead to a resolution.
  34487. </p>
  34488. </dd>
  34489. </dl>
  34490. <p>The value for the <var class="var">width</var>, <var class="var">height</var>, <var class="var">x</var>, and <var class="var">y</var>
  34491. options are expressions containing the following constants:
  34492. </p>
  34493. <dl class="table">
  34494. <dt><samp class="option">in_w</samp></dt>
  34495. <dt><samp class="option">in_h</samp></dt>
  34496. <dd><p>The input video width and height.
  34497. </p>
  34498. </dd>
  34499. <dt><samp class="option">iw</samp></dt>
  34500. <dt><samp class="option">ih</samp></dt>
  34501. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  34502. </p>
  34503. </dd>
  34504. <dt><samp class="option">out_w</samp></dt>
  34505. <dt><samp class="option">out_h</samp></dt>
  34506. <dd><p>The output width and height (the size of the padded area), as
  34507. specified by the <var class="var">width</var> and <var class="var">height</var> expressions.
  34508. </p>
  34509. </dd>
  34510. <dt><samp class="option">ow</samp></dt>
  34511. <dt><samp class="option">oh</samp></dt>
  34512. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  34513. </p>
  34514. </dd>
  34515. <dt><samp class="option">x</samp></dt>
  34516. <dt><samp class="option">y</samp></dt>
  34517. <dd><p>The x and y offsets as specified by the <var class="var">x</var> and <var class="var">y</var>
  34518. expressions, or NAN if not yet specified.
  34519. </p>
  34520. </dd>
  34521. <dt><samp class="option">a</samp></dt>
  34522. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  34523. </p>
  34524. </dd>
  34525. <dt><samp class="option">sar</samp></dt>
  34526. <dd><p>input sample aspect ratio
  34527. </p>
  34528. </dd>
  34529. <dt><samp class="option">dar</samp></dt>
  34530. <dd><p>input display aspect ratio, it is the same as (<var class="var">iw</var> / <var class="var">ih</var>) * <var class="var">sar</var>
  34531. </p>
  34532. </dd>
  34533. <dt><samp class="option">hsub</samp></dt>
  34534. <dt><samp class="option">vsub</samp></dt>
  34535. <dd><p>The horizontal and vertical chroma subsample values. For example for the
  34536. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  34537. </p></dd>
  34538. </dl>
  34539. <a name="Examples-121"></a>
  34540. <h4 class="subsection">32.184.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-121" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-121" aria-hidden="true">TOC</a></span></h4>
  34541. <ul class="itemize mark-bullet">
  34542. <li>Add paddings with the color &quot;violet&quot; to the input video. The output video
  34543. size is 640x480, and the top-left corner of the input video is placed at
  34544. column 0, row 40
  34545. <div class="example">
  34546. <pre class="example-preformatted">pad=640:480:0:40:violet
  34547. </pre></div>
  34548. <p>The example above is equivalent to the following command:
  34549. </p><div class="example">
  34550. <pre class="example-preformatted">pad=width=640:height=480:x=0:y=40:color=violet
  34551. </pre></div>
  34552. </li><li>Pad the input to get an output with dimensions increased by 3/2,
  34553. and put the input video at the center of the padded area:
  34554. <div class="example">
  34555. <pre class="example-preformatted">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
  34556. </pre></div>
  34557. </li><li>Pad the input to get a squared output with size equal to the maximum
  34558. value between the input width and height, and put the input video at
  34559. the center of the padded area:
  34560. <div class="example">
  34561. <pre class="example-preformatted">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
  34562. </pre></div>
  34563. </li><li>Pad the input to get a final w/h ratio of 16:9:
  34564. <div class="example">
  34565. <pre class="example-preformatted">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
  34566. </pre></div>
  34567. </li><li>In case of anamorphic video, in order to set the output display aspect
  34568. correctly, it is necessary to use <var class="var">sar</var> in the expression,
  34569. according to the relation:
  34570. <div class="example">
  34571. <pre class="example-preformatted">(ih * X / ih) * sar = output_dar
  34572. X = output_dar / sar
  34573. </pre></div>
  34574. <p>Thus the previous example needs to be modified to:
  34575. </p><div class="example">
  34576. <pre class="example-preformatted">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
  34577. </pre></div>
  34578. </li><li>Double the output size and put the input video in the bottom-right
  34579. corner of the output padded area:
  34580. <div class="example">
  34581. <pre class="example-preformatted">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
  34582. </pre></div>
  34583. </li></ul>
  34584. <a class="anchor" id="palettegen"></a><a name="palettegen-1"></a>
  34585. <h3 class="section">32.185 palettegen<span class="pull-right"><a class="anchor hidden-xs" href="#palettegen-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-palettegen-1" aria-hidden="true">TOC</a></span></h3>
  34586. <p>Generate one palette for a whole video stream.
  34587. </p>
  34588. <p>It accepts the following options:
  34589. </p>
  34590. <dl class="table">
  34591. <dt><samp class="option">max_colors</samp></dt>
  34592. <dd><p>Set the maximum number of colors to quantize in the palette.
  34593. Note: the palette will still contain 256 colors; the unused palette entries
  34594. will be black.
  34595. </p>
  34596. </dd>
  34597. <dt><samp class="option">reserve_transparent</samp></dt>
  34598. <dd><p>Create a palette of 255 colors maximum and reserve the last one for
  34599. transparency. Reserving the transparency color is useful for GIF optimization.
  34600. If not set, the maximum of colors in the palette will be 256. You probably want
  34601. to disable this option for a standalone image.
  34602. Set by default.
  34603. </p>
  34604. </dd>
  34605. <dt><samp class="option">transparency_color</samp></dt>
  34606. <dd><p>Set the color that will be used as background for transparency.
  34607. </p>
  34608. </dd>
  34609. <dt><samp class="option">stats_mode</samp></dt>
  34610. <dd><p>Set statistics mode.
  34611. </p>
  34612. <p>It accepts the following values:
  34613. </p><dl class="table">
  34614. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  34615. <dd><p>Compute full frame histograms.
  34616. </p></dd>
  34617. <dt>&lsquo;<samp class="samp">diff</samp>&rsquo;</dt>
  34618. <dd><p>Compute histograms only for the part that differs from previous frame. This
  34619. might be relevant to give more importance to the moving part of your input if
  34620. the background is static.
  34621. </p></dd>
  34622. <dt>&lsquo;<samp class="samp">single</samp>&rsquo;</dt>
  34623. <dd><p>Compute new histogram for each frame.
  34624. </p></dd>
  34625. </dl>
  34626. <p>Default value is <var class="var">full</var>.
  34627. </p></dd>
  34628. </dl>
  34629. <p>The filter also exports the frame metadata <code class="code">lavfi.color_quant_ratio</code>
  34630. (<code class="code">nb_color_in / nb_color_out</code>) which you can use to evaluate the degree of
  34631. color quantization of the palette. This information is also visible at
  34632. <var class="var">info</var> logging level.
  34633. </p>
  34634. <a name="Examples-122"></a>
  34635. <h4 class="subsection">32.185.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-122" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-122" aria-hidden="true">TOC</a></span></h4>
  34636. <ul class="itemize mark-bullet">
  34637. <li>Generate a representative palette of a given video using <code class="command">ffmpeg</code>:
  34638. <div class="example">
  34639. <pre class="example-preformatted">ffmpeg -i input.mkv -vf palettegen palette.png
  34640. </pre></div>
  34641. </li></ul>
  34642. <a name="paletteuse"></a>
  34643. <h3 class="section">32.186 paletteuse<span class="pull-right"><a class="anchor hidden-xs" href="#paletteuse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-paletteuse" aria-hidden="true">TOC</a></span></h3>
  34644. <p>Use a palette to downsample an input video stream.
  34645. </p>
  34646. <p>The filter takes two inputs: one video stream and a palette. The palette must
  34647. be a 256 pixels image.
  34648. </p>
  34649. <p>It accepts the following options:
  34650. </p>
  34651. <dl class="table">
  34652. <dt><samp class="option">dither</samp></dt>
  34653. <dd><p>Select dithering mode. Available algorithms are:
  34654. </p><dl class="table">
  34655. <dt>&lsquo;<samp class="samp">bayer</samp>&rsquo;</dt>
  34656. <dd><p>Ordered 8x8 bayer dithering (deterministic)
  34657. </p></dd>
  34658. <dt>&lsquo;<samp class="samp">heckbert</samp>&rsquo;</dt>
  34659. <dd><p>Dithering as defined by Paul Heckbert in 1982 (simple error diffusion).
  34660. Note: this dithering is sometimes considered &quot;wrong&quot; and is included as a
  34661. reference.
  34662. </p></dd>
  34663. <dt>&lsquo;<samp class="samp">floyd_steinberg</samp>&rsquo;</dt>
  34664. <dd><p>Floyd and Steingberg dithering (error diffusion)
  34665. </p></dd>
  34666. <dt>&lsquo;<samp class="samp">sierra2</samp>&rsquo;</dt>
  34667. <dd><p>Frankie Sierra dithering v2 (error diffusion)
  34668. </p></dd>
  34669. <dt>&lsquo;<samp class="samp">sierra2_4a</samp>&rsquo;</dt>
  34670. <dd><p>Frankie Sierra dithering v2 &quot;Lite&quot; (error diffusion)
  34671. </p></dd>
  34672. <dt>&lsquo;<samp class="samp">sierra3</samp>&rsquo;</dt>
  34673. <dd><p>Frankie Sierra dithering v3 (error diffusion)
  34674. </p></dd>
  34675. <dt>&lsquo;<samp class="samp">burkes</samp>&rsquo;</dt>
  34676. <dd><p>Burkes dithering (error diffusion)
  34677. </p></dd>
  34678. <dt>&lsquo;<samp class="samp">atkinson</samp>&rsquo;</dt>
  34679. <dd><p>Atkinson dithering by Bill Atkinson at Apple Computer (error diffusion)
  34680. </p></dd>
  34681. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  34682. <dd><p>Disable dithering.
  34683. </p></dd>
  34684. </dl>
  34685. <p>Default is <var class="var">sierra2_4a</var>.
  34686. </p>
  34687. </dd>
  34688. <dt><samp class="option">bayer_scale</samp></dt>
  34689. <dd><p>When <var class="var">bayer</var> dithering is selected, this option defines the scale of the
  34690. pattern (how much the crosshatch pattern is visible). A low value means more
  34691. visible pattern for less banding, and higher value means less visible pattern
  34692. at the cost of more banding.
  34693. </p>
  34694. <p>The option must be an integer value in the range [0,5]. Default is <var class="var">2</var>.
  34695. </p>
  34696. </dd>
  34697. <dt><samp class="option">diff_mode</samp></dt>
  34698. <dd><p>If set, define the zone to process
  34699. </p>
  34700. <dl class="table">
  34701. <dt>&lsquo;<samp class="samp">rectangle</samp>&rsquo;</dt>
  34702. <dd><p>Only the changing rectangle will be reprocessed. This is similar to GIF
  34703. cropping/offsetting compression mechanism. This option can be useful for speed
  34704. if only a part of the image is changing, and has use cases such as limiting the
  34705. scope of the error diffusal <samp class="option">dither</samp> to the rectangle that bounds the
  34706. moving scene (it leads to more deterministic output if the scene doesn&rsquo;t change
  34707. much, and as a result less moving noise and better GIF compression).
  34708. </p></dd>
  34709. </dl>
  34710. <p>Default is <var class="var">none</var>.
  34711. </p>
  34712. </dd>
  34713. <dt><samp class="option">new</samp></dt>
  34714. <dd><p>Take new palette for each output frame.
  34715. </p>
  34716. </dd>
  34717. <dt><samp class="option">alpha_threshold</samp></dt>
  34718. <dd><p>Sets the alpha threshold for transparency. Alpha values above this threshold
  34719. will be treated as completely opaque, and values below this threshold will be
  34720. treated as completely transparent.
  34721. </p>
  34722. <p>The option must be an integer value in the range [0,255]. Default is <var class="var">128</var>.
  34723. </p></dd>
  34724. </dl>
  34725. <a name="Examples-123"></a>
  34726. <h4 class="subsection">32.186.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-123" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-123" aria-hidden="true">TOC</a></span></h4>
  34727. <ul class="itemize mark-bullet">
  34728. <li>Use a palette (generated for example with <a class="ref" href="#palettegen">palettegen</a>) to encode a GIF
  34729. using <code class="command">ffmpeg</code>:
  34730. <div class="example">
  34731. <pre class="example-preformatted">ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
  34732. </pre></div>
  34733. </li></ul>
  34734. <a name="perspective"></a>
  34735. <h3 class="section">32.187 perspective<span class="pull-right"><a class="anchor hidden-xs" href="#perspective" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-perspective" aria-hidden="true">TOC</a></span></h3>
  34736. <p>Correct perspective of video not recorded perpendicular to the screen.
  34737. </p>
  34738. <p>A description of the accepted parameters follows.
  34739. </p>
  34740. <dl class="table">
  34741. <dt><samp class="option">x0</samp></dt>
  34742. <dt><samp class="option">y0</samp></dt>
  34743. <dt><samp class="option">x1</samp></dt>
  34744. <dt><samp class="option">y1</samp></dt>
  34745. <dt><samp class="option">x2</samp></dt>
  34746. <dt><samp class="option">y2</samp></dt>
  34747. <dt><samp class="option">x3</samp></dt>
  34748. <dt><samp class="option">y3</samp></dt>
  34749. <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
  34750. Default values are <code class="code">0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
  34751. If the <code class="code">sense</code> option is set to <code class="code">source</code>, then the specified points will be sent
  34752. to the corners of the destination. If the <code class="code">sense</code> option is set to <code class="code">destination</code>,
  34753. then the corners of the source will be sent to the specified coordinates.
  34754. </p>
  34755. <p>The expressions can use the following variables:
  34756. </p>
  34757. <dl class="table">
  34758. <dt><samp class="option">W</samp></dt>
  34759. <dt><samp class="option">H</samp></dt>
  34760. <dd><p>the width and height of video frame.
  34761. </p></dd>
  34762. <dt><samp class="option">in</samp></dt>
  34763. <dd><p>Input frame count.
  34764. </p></dd>
  34765. <dt><samp class="option">on</samp></dt>
  34766. <dd><p>Output frame count.
  34767. </p></dd>
  34768. </dl>
  34769. </dd>
  34770. <dt><samp class="option">interpolation</samp></dt>
  34771. <dd><p>Set interpolation for perspective correction.
  34772. </p>
  34773. <p>It accepts the following values:
  34774. </p><dl class="table">
  34775. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  34776. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  34777. </dl>
  34778. <p>Default value is &lsquo;<samp class="samp">linear</samp>&rsquo;.
  34779. </p>
  34780. </dd>
  34781. <dt><samp class="option">sense</samp></dt>
  34782. <dd><p>Set interpretation of coordinate options.
  34783. </p>
  34784. <p>It accepts the following values:
  34785. </p><dl class="table">
  34786. <dt>&lsquo;<samp class="samp">0, source</samp>&rsquo;</dt>
  34787. <dd>
  34788. <p>Send point in the source specified by the given coordinates to
  34789. the corners of the destination.
  34790. </p>
  34791. </dd>
  34792. <dt>&lsquo;<samp class="samp">1, destination</samp>&rsquo;</dt>
  34793. <dd>
  34794. <p>Send the corners of the source to the point in the destination specified
  34795. by the given coordinates.
  34796. </p>
  34797. <p>Default value is &lsquo;<samp class="samp">source</samp>&rsquo;.
  34798. </p></dd>
  34799. </dl>
  34800. </dd>
  34801. <dt><samp class="option">eval</samp></dt>
  34802. <dd><p>Set when the expressions for coordinates <samp class="option">x0,y0,...x3,y3</samp> are evaluated.
  34803. </p>
  34804. <p>It accepts the following values:
  34805. </p><dl class="table">
  34806. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  34807. <dd><p>only evaluate expressions once during the filter initialization or
  34808. when a command is processed
  34809. </p>
  34810. </dd>
  34811. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  34812. <dd><p>evaluate expressions for each incoming frame
  34813. </p></dd>
  34814. </dl>
  34815. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  34816. </p></dd>
  34817. </dl>
  34818. <a name="phase"></a>
  34819. <h3 class="section">32.188 phase<span class="pull-right"><a class="anchor hidden-xs" href="#phase" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-phase" aria-hidden="true">TOC</a></span></h3>
  34820. <p>Delay interlaced video by one field time so that the field order changes.
  34821. </p>
  34822. <p>The intended use is to fix PAL movies that have been captured with the
  34823. opposite field order to the film-to-video transfer.
  34824. </p>
  34825. <p>A description of the accepted parameters follows.
  34826. </p>
  34827. <dl class="table">
  34828. <dt><samp class="option">mode</samp></dt>
  34829. <dd><p>Set phase mode.
  34830. </p>
  34831. <p>It accepts the following values:
  34832. </p><dl class="table">
  34833. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  34834. <dd><p>Capture field order top-first, transfer bottom-first.
  34835. Filter will delay the bottom field.
  34836. </p>
  34837. </dd>
  34838. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  34839. <dd><p>Capture field order bottom-first, transfer top-first.
  34840. Filter will delay the top field.
  34841. </p>
  34842. </dd>
  34843. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  34844. <dd><p>Capture and transfer with the same field order. This mode only exists
  34845. for the documentation of the other options to refer to, but if you
  34846. actually select it, the filter will faithfully do nothing.
  34847. </p>
  34848. </dd>
  34849. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  34850. <dd><p>Capture field order determined automatically by field flags, transfer
  34851. opposite.
  34852. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo; and &lsquo;<samp class="samp">b</samp>&rsquo; modes on a frame by frame
  34853. basis using field flags. If no field information is available,
  34854. then this works just like &lsquo;<samp class="samp">u</samp>&rsquo;.
  34855. </p>
  34856. </dd>
  34857. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  34858. <dd><p>Capture unknown or varying, transfer opposite.
  34859. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo; and &lsquo;<samp class="samp">b</samp>&rsquo; on a frame by frame basis by
  34860. analyzing the images and selecting the alternative that produces best
  34861. match between the fields.
  34862. </p>
  34863. </dd>
  34864. <dt>&lsquo;<samp class="samp">T</samp>&rsquo;</dt>
  34865. <dd><p>Capture top-first, transfer unknown or varying.
  34866. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using image analysis.
  34867. </p>
  34868. </dd>
  34869. <dt>&lsquo;<samp class="samp">B</samp>&rsquo;</dt>
  34870. <dd><p>Capture bottom-first, transfer unknown or varying.
  34871. Filter selects among &lsquo;<samp class="samp">b</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using image analysis.
  34872. </p>
  34873. </dd>
  34874. <dt>&lsquo;<samp class="samp">A</samp>&rsquo;</dt>
  34875. <dd><p>Capture determined by field flags, transfer unknown or varying.
  34876. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo;, &lsquo;<samp class="samp">b</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using field flags and
  34877. image analysis. If no field information is available, then this works just
  34878. like &lsquo;<samp class="samp">U</samp>&rsquo;. This is the default mode.
  34879. </p>
  34880. </dd>
  34881. <dt>&lsquo;<samp class="samp">U</samp>&rsquo;</dt>
  34882. <dd><p>Both capture and transfer unknown or varying.
  34883. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo;, &lsquo;<samp class="samp">b</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using image analysis only.
  34884. </p></dd>
  34885. </dl>
  34886. </dd>
  34887. </dl>
  34888. <a name="Commands-129"></a>
  34889. <h4 class="subsection">32.188.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-129" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-129" aria-hidden="true">TOC</a></span></h4>
  34890. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34891. </p>
  34892. <a name="photosensitivity"></a>
  34893. <h3 class="section">32.189 photosensitivity<span class="pull-right"><a class="anchor hidden-xs" href="#photosensitivity" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-photosensitivity" aria-hidden="true">TOC</a></span></h3>
  34894. <p>Reduce various flashes in video, so to help users with epilepsy.
  34895. </p>
  34896. <p>It accepts the following options:
  34897. </p><dl class="table">
  34898. <dt><samp class="option">frames, f</samp></dt>
  34899. <dd><p>Set how many frames to use when filtering. Default is 30.
  34900. </p>
  34901. </dd>
  34902. <dt><samp class="option">threshold, t</samp></dt>
  34903. <dd><p>Set detection threshold factor. Default is 1.
  34904. Lower is stricter.
  34905. </p>
  34906. </dd>
  34907. <dt><samp class="option">skip</samp></dt>
  34908. <dd><p>Set how many pixels to skip when sampling frames. Default is 1.
  34909. Allowed range is from 1 to 1024.
  34910. </p>
  34911. </dd>
  34912. <dt><samp class="option">bypass</samp></dt>
  34913. <dd><p>Leave frames unchanged. Default is disabled.
  34914. </p></dd>
  34915. </dl>
  34916. <a name="pixdesctest"></a>
  34917. <h3 class="section">32.190 pixdesctest<span class="pull-right"><a class="anchor hidden-xs" href="#pixdesctest" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pixdesctest" aria-hidden="true">TOC</a></span></h3>
  34918. <p>Pixel format descriptor test filter, mainly useful for internal
  34919. testing. The output video should be equal to the input video.
  34920. </p>
  34921. <p>For example:
  34922. </p><div class="example">
  34923. <pre class="example-preformatted">format=monow, pixdesctest
  34924. </pre></div>
  34925. <p>can be used to test the monowhite pixel format descriptor definition.
  34926. </p>
  34927. <a name="pixelize"></a>
  34928. <h3 class="section">32.191 pixelize<span class="pull-right"><a class="anchor hidden-xs" href="#pixelize" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pixelize" aria-hidden="true">TOC</a></span></h3>
  34929. <p>Apply pixelization to video stream.
  34930. </p>
  34931. <p>The filter accepts the following options:
  34932. </p><dl class="table">
  34933. <dt><samp class="option">width, w</samp></dt>
  34934. <dt><samp class="option">height, h</samp></dt>
  34935. <dd><p>Set block dimensions that will be used for pixelization.
  34936. Default value is <code class="code">16</code>.
  34937. </p>
  34938. </dd>
  34939. <dt><samp class="option">mode, m</samp></dt>
  34940. <dd><p>Set the mode of pixelization used.
  34941. </p>
  34942. <p>Possible values are:
  34943. </p><dl class="table">
  34944. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  34945. <dt>&lsquo;<samp class="samp">min</samp>&rsquo;</dt>
  34946. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  34947. </dl>
  34948. <p>Default value is <code class="code">avg</code>.
  34949. </p>
  34950. </dd>
  34951. <dt><samp class="option">planes, p</samp></dt>
  34952. <dd><p>Set what planes to filter. Default is to filter all planes.
  34953. </p></dd>
  34954. </dl>
  34955. <a name="Commands-130"></a>
  34956. <h4 class="subsection">32.191.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-130" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-130" aria-hidden="true">TOC</a></span></h4>
  34957. <p>This filter supports all options as <a class="ref" href="#commands">commands</a>.
  34958. </p>
  34959. <a name="pixscope"></a>
  34960. <h3 class="section">32.192 pixscope<span class="pull-right"><a class="anchor hidden-xs" href="#pixscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pixscope" aria-hidden="true">TOC</a></span></h3>
  34961. <p>Display sample values of color channels. Mainly useful for checking color
  34962. and levels. Minimum supported resolution is 640x480.
  34963. </p>
  34964. <p>The filters accept the following options:
  34965. </p>
  34966. <dl class="table">
  34967. <dt><samp class="option">x</samp></dt>
  34968. <dd><p>Set scope X position, relative offset on X axis.
  34969. </p>
  34970. </dd>
  34971. <dt><samp class="option">y</samp></dt>
  34972. <dd><p>Set scope Y position, relative offset on Y axis.
  34973. </p>
  34974. </dd>
  34975. <dt><samp class="option">w</samp></dt>
  34976. <dd><p>Set scope width.
  34977. </p>
  34978. </dd>
  34979. <dt><samp class="option">h</samp></dt>
  34980. <dd><p>Set scope height.
  34981. </p>
  34982. </dd>
  34983. <dt><samp class="option">o</samp></dt>
  34984. <dd><p>Set window opacity. This window also holds statistics about pixel area.
  34985. </p>
  34986. </dd>
  34987. <dt><samp class="option">wx</samp></dt>
  34988. <dd><p>Set window X position, relative offset on X axis.
  34989. </p>
  34990. </dd>
  34991. <dt><samp class="option">wy</samp></dt>
  34992. <dd><p>Set window Y position, relative offset on Y axis.
  34993. </p></dd>
  34994. </dl>
  34995. <a name="Commands-131"></a>
  34996. <h4 class="subsection">32.192.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-131" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-131" aria-hidden="true">TOC</a></span></h4>
  34997. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  34998. </p>
  34999. <a name="pp7"></a>
  35000. <h3 class="section">32.193 pp7<span class="pull-right"><a class="anchor hidden-xs" href="#pp7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pp7" aria-hidden="true">TOC</a></span></h3>
  35001. <p>Apply Postprocessing filter 7. It is variant of the <a class="ref" href="#spp">spp</a> filter,
  35002. similar to spp = 6 with 7 point DCT, where only the center sample is
  35003. used after IDCT.
  35004. </p>
  35005. <p>The filter accepts the following options:
  35006. </p>
  35007. <dl class="table">
  35008. <dt><samp class="option">qp</samp></dt>
  35009. <dd><p>Force a constant quantization parameter. It accepts an integer in range
  35010. 0 to 63. If not set, the filter will use the QP from the video stream
  35011. (if available).
  35012. </p>
  35013. </dd>
  35014. <dt><samp class="option">mode</samp></dt>
  35015. <dd><p>Set thresholding mode. Available modes are:
  35016. </p>
  35017. <dl class="table">
  35018. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  35019. <dd><p>Set hard thresholding.
  35020. </p></dd>
  35021. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  35022. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  35023. </p></dd>
  35024. <dt>&lsquo;<samp class="samp">medium</samp>&rsquo;</dt>
  35025. <dd><p>Set medium thresholding (good results, default).
  35026. </p></dd>
  35027. </dl>
  35028. </dd>
  35029. </dl>
  35030. <a name="premultiply"></a>
  35031. <h3 class="section">32.194 premultiply<span class="pull-right"><a class="anchor hidden-xs" href="#premultiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-premultiply" aria-hidden="true">TOC</a></span></h3>
  35032. <p>Apply alpha premultiply effect to input video stream using first plane
  35033. of second stream as alpha.
  35034. </p>
  35035. <p>Both streams must have same dimensions and same pixel format.
  35036. </p>
  35037. <p>The filter accepts the following option:
  35038. </p>
  35039. <dl class="table">
  35040. <dt><samp class="option">planes</samp></dt>
  35041. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  35042. By default value 0xf, all planes will be processed.
  35043. </p>
  35044. </dd>
  35045. <dt><samp class="option">inplace</samp></dt>
  35046. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  35047. </p></dd>
  35048. </dl>
  35049. <a name="premultiply_005fdynamic"></a>
  35050. <h3 class="section">32.195 premultiply_dynamic<span class="pull-right"><a class="anchor hidden-xs" href="#premultiply_005fdynamic" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-premultiply_005fdynamic" aria-hidden="true">TOC</a></span></h3>
  35051. <p>Dynamically premultiply or unpremultiply the input video stream as needed,
  35052. to match the requirements of the downstream filter graph. This is roughly
  35053. equivalent to either <code class="code">premultiply:inplace=yes</code> or
  35054. <code class="code">unpremultiply:inplace=yes</code>, or otherwise a noop.
  35055. </p>
  35056. <p>The filter accepts the following option:
  35057. </p>
  35058. <dl class="table">
  35059. <dt><samp class="option">planes</samp></dt>
  35060. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  35061. By default value 0xf, all planes will be processed.
  35062. </p></dd>
  35063. </dl>
  35064. <a name="prewitt"></a>
  35065. <h3 class="section">32.196 prewitt<span class="pull-right"><a class="anchor hidden-xs" href="#prewitt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prewitt" aria-hidden="true">TOC</a></span></h3>
  35066. <p>Apply prewitt operator to input video stream.
  35067. </p>
  35068. <p>The filter accepts the following option:
  35069. </p>
  35070. <dl class="table">
  35071. <dt><samp class="option">planes</samp></dt>
  35072. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  35073. By default value 0xf, all planes will be processed.
  35074. </p>
  35075. </dd>
  35076. <dt><samp class="option">scale</samp></dt>
  35077. <dd><p>Set value which will be multiplied with filtered result.
  35078. </p>
  35079. </dd>
  35080. <dt><samp class="option">delta</samp></dt>
  35081. <dd><p>Set value which will be added to filtered result.
  35082. </p></dd>
  35083. </dl>
  35084. <a name="Commands-132"></a>
  35085. <h4 class="subsection">32.196.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-132" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-132" aria-hidden="true">TOC</a></span></h4>
  35086. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  35087. </p>
  35088. <a name="pseudocolor"></a>
  35089. <h3 class="section">32.197 pseudocolor<span class="pull-right"><a class="anchor hidden-xs" href="#pseudocolor" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pseudocolor" aria-hidden="true">TOC</a></span></h3>
  35090. <p>Alter frame colors in video with pseudocolors.
  35091. </p>
  35092. <p>This filter accepts the following options:
  35093. </p>
  35094. <dl class="table">
  35095. <dt><samp class="option">c0</samp></dt>
  35096. <dd><p>set pixel first component expression
  35097. </p>
  35098. </dd>
  35099. <dt><samp class="option">c1</samp></dt>
  35100. <dd><p>set pixel second component expression
  35101. </p>
  35102. </dd>
  35103. <dt><samp class="option">c2</samp></dt>
  35104. <dd><p>set pixel third component expression
  35105. </p>
  35106. </dd>
  35107. <dt><samp class="option">c3</samp></dt>
  35108. <dd><p>set pixel fourth component expression, corresponds to the alpha component
  35109. </p>
  35110. </dd>
  35111. <dt><samp class="option">index, i</samp></dt>
  35112. <dd><p>set component to use as base for altering colors
  35113. </p>
  35114. </dd>
  35115. <dt><samp class="option">preset, p</samp></dt>
  35116. <dd><p>Pick one of built-in LUTs. By default is set to none.
  35117. </p>
  35118. <p>Available LUTs:
  35119. </p><dl class="table">
  35120. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  35121. <dt>&lsquo;<samp class="samp">inferno</samp>&rsquo;</dt>
  35122. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  35123. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  35124. <dt>&lsquo;<samp class="samp">turbo</samp>&rsquo;</dt>
  35125. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  35126. <dt>&lsquo;<samp class="samp">range1</samp>&rsquo;</dt>
  35127. <dt>&lsquo;<samp class="samp">range2</samp>&rsquo;</dt>
  35128. <dt>&lsquo;<samp class="samp">shadows</samp>&rsquo;</dt>
  35129. <dt>&lsquo;<samp class="samp">highlights</samp>&rsquo;</dt>
  35130. <dt>&lsquo;<samp class="samp">solar</samp>&rsquo;</dt>
  35131. <dt>&lsquo;<samp class="samp">nominal</samp>&rsquo;</dt>
  35132. <dt>&lsquo;<samp class="samp">preferred</samp>&rsquo;</dt>
  35133. <dt>&lsquo;<samp class="samp">total</samp>&rsquo;</dt>
  35134. <dt>&lsquo;<samp class="samp">spectral</samp>&rsquo;</dt>
  35135. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  35136. <dt>&lsquo;<samp class="samp">heat</samp>&rsquo;</dt>
  35137. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  35138. <dt>&lsquo;<samp class="samp">blues</samp>&rsquo;</dt>
  35139. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  35140. <dt>&lsquo;<samp class="samp">helix</samp>&rsquo;</dt>
  35141. </dl>
  35142. </dd>
  35143. <dt><samp class="option">opacity</samp></dt>
  35144. <dd><p>Set opacity of output colors. Allowed range is from 0 to 1.
  35145. Default value is set to 1.
  35146. </p></dd>
  35147. </dl>
  35148. <p>Each of the expression options specifies the expression to use for computing
  35149. the lookup table for the corresponding pixel component values.
  35150. </p>
  35151. <p>The expressions can contain the following constants and functions:
  35152. </p>
  35153. <dl class="table">
  35154. <dt><samp class="option">w</samp></dt>
  35155. <dt><samp class="option">h</samp></dt>
  35156. <dd><p>The input width and height.
  35157. </p>
  35158. </dd>
  35159. <dt><samp class="option">val</samp></dt>
  35160. <dd><p>The input value for the pixel component.
  35161. </p>
  35162. </dd>
  35163. <dt><samp class="option">ymin, umin, vmin, amin</samp></dt>
  35164. <dd><p>The minimum allowed component value.
  35165. </p>
  35166. </dd>
  35167. <dt><samp class="option">ymax, umax, vmax, amax</samp></dt>
  35168. <dd><p>The maximum allowed component value.
  35169. </p></dd>
  35170. </dl>
  35171. <p>All expressions default to &quot;val&quot;.
  35172. </p>
  35173. <a name="Commands-133"></a>
  35174. <h4 class="subsection">32.197.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-133" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-133" aria-hidden="true">TOC</a></span></h4>
  35175. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  35176. </p>
  35177. <a name="Examples-124"></a>
  35178. <h4 class="subsection">32.197.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-124" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-124" aria-hidden="true">TOC</a></span></h4>
  35179. <ul class="itemize mark-bullet">
  35180. <li>Change too high luma values to gradient:
  35181. <div class="example">
  35182. <pre class="example-preformatted">pseudocolor=&quot;'if(between(val,ymax,amax),lerp(ymin,ymax,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(umax,umin,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(vmin,vmax,(val-ymax)/(amax-ymax)),-1):-1'&quot;
  35183. </pre></div>
  35184. </li></ul>
  35185. <a class="anchor" id="psnr"></a><a name="psnr-1"></a>
  35186. <h3 class="section">32.198 psnr<span class="pull-right"><a class="anchor hidden-xs" href="#psnr-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-psnr-1" aria-hidden="true">TOC</a></span></h3>
  35187. <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
  35188. Ratio) between two input videos.
  35189. </p>
  35190. <p>This filter takes in input two input videos, the first input is
  35191. considered the &quot;main&quot; source and is passed unchanged to the
  35192. output. The second input is used as a &quot;reference&quot; video for computing
  35193. the PSNR.
  35194. </p>
  35195. <p>Both video inputs must have the same resolution and pixel format for
  35196. this filter to work correctly. Also it assumes that both inputs
  35197. have the same number of frames, which are compared one by one.
  35198. </p>
  35199. <p>The obtained average PSNR is printed through the logging system.
  35200. </p>
  35201. <p>The filter stores the accumulated MSE (mean squared error) of each
  35202. frame, and at the end of the processing it is averaged across all frames
  35203. equally, and the following formula is applied to obtain the PSNR:
  35204. </p>
  35205. <div class="example">
  35206. <pre class="example-preformatted">PSNR = 10*log10(MAX^2/MSE)
  35207. </pre></div>
  35208. <p>Where MAX is the average of the maximum values of each component of the
  35209. image.
  35210. </p>
  35211. <p>The description of the accepted parameters follows.
  35212. </p>
  35213. <dl class="table">
  35214. <dt><samp class="option">stats_file, f</samp></dt>
  35215. <dd><p>If specified the filter will use the named file to save the PSNR of
  35216. each individual frame. When filename equals &quot;-&quot; the data is sent to
  35217. standard output.
  35218. </p>
  35219. </dd>
  35220. <dt><samp class="option">stats_version</samp></dt>
  35221. <dd><p>Specifies which version of the stats file format to use. Details of
  35222. each format are written below.
  35223. Default value is 1.
  35224. </p>
  35225. </dd>
  35226. <dt><samp class="option">output_max</samp></dt>
  35227. <dd><p>Determines whether the max value is output to the stats log.
  35228. Default value is 0.
  35229. Requires stats_version &gt;= 2. If this is set and stats_version &lt; 2,
  35230. the filter will return an error.
  35231. </p></dd>
  35232. </dl>
  35233. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  35234. </p>
  35235. <p>The file printed if <var class="var">stats_file</var> is selected, contains a sequence of
  35236. key/value pairs of the form <var class="var">key</var>:<var class="var">value</var> for each compared
  35237. couple of frames.
  35238. </p>
  35239. <p>If a <var class="var">stats_version</var> greater than 1 is specified, a header line precedes
  35240. the list of per-frame-pair stats, with key value pairs following the frame
  35241. format with the following parameters:
  35242. </p>
  35243. <dl class="table">
  35244. <dt><samp class="option">psnr_log_version</samp></dt>
  35245. <dd><p>The version of the log file format. Will match <var class="var">stats_version</var>.
  35246. </p>
  35247. </dd>
  35248. <dt><samp class="option">fields</samp></dt>
  35249. <dd><p>A comma separated list of the per-frame-pair parameters included in
  35250. the log.
  35251. </p></dd>
  35252. </dl>
  35253. <p>A description of each shown per-frame-pair parameter follows:
  35254. </p>
  35255. <dl class="table">
  35256. <dt><samp class="option">n</samp></dt>
  35257. <dd><p>sequential number of the input frame, starting from 1
  35258. </p>
  35259. </dd>
  35260. <dt><samp class="option">mse_avg</samp></dt>
  35261. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  35262. frames, averaged over all the image components.
  35263. </p>
  35264. </dd>
  35265. <dt><samp class="option">mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a</samp></dt>
  35266. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  35267. frames for the component specified by the suffix.
  35268. </p>
  35269. </dd>
  35270. <dt><samp class="option">psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp></dt>
  35271. <dd><p>Peak Signal to Noise ratio of the compared frames for the component
  35272. specified by the suffix.
  35273. </p>
  35274. </dd>
  35275. <dt><samp class="option">max_avg, max_y, max_u, max_v</samp></dt>
  35276. <dd><p>Maximum allowed value for each channel, and average over all
  35277. channels.
  35278. </p></dd>
  35279. </dl>
  35280. <a name="Examples-125"></a>
  35281. <h4 class="subsection">32.198.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-125" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-125" aria-hidden="true">TOC</a></span></h4>
  35282. <ul class="itemize mark-bullet">
  35283. <li>For example:
  35284. <div class="example">
  35285. <pre class="example-preformatted">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  35286. [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
  35287. </pre></div>
  35288. <p>On this example the input file being processed is compared with the
  35289. reference file <samp class="file">ref_movie.mpg</samp>. The PSNR of each individual frame
  35290. is stored in <samp class="file">stats.log</samp>.
  35291. </p>
  35292. </li><li>Another example with different containers:
  35293. <div class="example">
  35294. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mkv -lavfi &quot;[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]psnr&quot; -f null -
  35295. </pre></div>
  35296. </li></ul>
  35297. <a class="anchor" id="pullup"></a><a name="pullup-1"></a>
  35298. <h3 class="section">32.199 pullup<span class="pull-right"><a class="anchor hidden-xs" href="#pullup-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pullup-1" aria-hidden="true">TOC</a></span></h3>
  35299. <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
  35300. hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
  35301. content.
  35302. </p>
  35303. <p>The pullup filter is designed to take advantage of future context in making
  35304. its decisions. This filter is stateless in the sense that it does not lock
  35305. onto a pattern to follow, but it instead looks forward to the following
  35306. fields in order to identify matches and rebuild progressive frames.
  35307. </p>
  35308. <p>To produce content with an even framerate, insert the fps filter after
  35309. pullup, use <code class="code">fps=24000/1001</code> if the input frame rate is 29.97fps,
  35310. <code class="code">fps=24</code> for 30fps and the (rare) telecined 25fps input.
  35311. </p>
  35312. <p>The filter accepts the following options:
  35313. </p>
  35314. <dl class="table">
  35315. <dt><samp class="option">jl</samp></dt>
  35316. <dt><samp class="option">jr</samp></dt>
  35317. <dt><samp class="option">jt</samp></dt>
  35318. <dt><samp class="option">jb</samp></dt>
  35319. <dd><p>These options set the amount of &quot;junk&quot; to ignore at the left, right, top, and
  35320. bottom of the image, respectively. Left and right are in units of 8 pixels,
  35321. while top and bottom are in units of 2 lines.
  35322. The default is 8 pixels on each side.
  35323. </p>
  35324. </dd>
  35325. <dt><samp class="option">sb</samp></dt>
  35326. <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
  35327. filter generating an occasional mismatched frame, but it may also cause an
  35328. excessive number of frames to be dropped during high motion sequences.
  35329. Conversely, setting it to -1 will make filter match fields more easily.
  35330. This may help processing of video where there is slight blurring between
  35331. the fields, but may also cause there to be interlaced frames in the output.
  35332. Default value is <code class="code">0</code>.
  35333. </p>
  35334. </dd>
  35335. <dt><samp class="option">mp</samp></dt>
  35336. <dd><p>Set the metric plane to use. It accepts the following values:
  35337. </p><dl class="table">
  35338. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  35339. <dd><p>Use luma plane.
  35340. </p>
  35341. </dd>
  35342. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  35343. <dd><p>Use chroma blue plane.
  35344. </p>
  35345. </dd>
  35346. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  35347. <dd><p>Use chroma red plane.
  35348. </p></dd>
  35349. </dl>
  35350. <p>This option may be set to use chroma plane instead of the default luma plane
  35351. for doing filter&rsquo;s computations. This may improve accuracy on very clean
  35352. source material, but more likely will decrease accuracy, especially if there
  35353. is chroma noise (rainbow effect) or any grayscale video.
  35354. The main purpose of setting <samp class="option">mp</samp> to a chroma plane is to reduce CPU
  35355. load and make pullup usable in realtime on slow machines.
  35356. </p></dd>
  35357. </dl>
  35358. <p>For best results (without duplicated frames in the output file) it is
  35359. necessary to change the output frame rate. For example, to inverse
  35360. telecine NTSC input:
  35361. </p><div class="example">
  35362. <pre class="example-preformatted">ffmpeg -i input -vf pullup -r 24000/1001 ...
  35363. </pre></div>
  35364. <a name="qp"></a>
  35365. <h3 class="section">32.200 qp<span class="pull-right"><a class="anchor hidden-xs" href="#qp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qp" aria-hidden="true">TOC</a></span></h3>
  35366. <p>Change video quantization parameters (QP).
  35367. </p>
  35368. <p>The filter accepts the following option:
  35369. </p>
  35370. <dl class="table">
  35371. <dt><samp class="option">qp</samp></dt>
  35372. <dd><p>Set expression for quantization parameter.
  35373. </p></dd>
  35374. </dl>
  35375. <p>The expression is evaluated through the eval API and can contain, among others,
  35376. the following constants:
  35377. </p>
  35378. <dl class="table">
  35379. <dt><var class="var">known</var></dt>
  35380. <dd><p>1 if index is not 129, 0 otherwise.
  35381. </p>
  35382. </dd>
  35383. <dt><var class="var">qp</var></dt>
  35384. <dd><p>Sequential index starting from -129 to 128.
  35385. </p></dd>
  35386. </dl>
  35387. <a name="Examples-126"></a>
  35388. <h4 class="subsection">32.200.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-126" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-126" aria-hidden="true">TOC</a></span></h4>
  35389. <ul class="itemize mark-bullet">
  35390. <li>Some equation like:
  35391. <div class="example">
  35392. <pre class="example-preformatted">qp=2+2*sin(PI*qp)
  35393. </pre></div>
  35394. </li></ul>
  35395. <a name="qrencode"></a>
  35396. <h3 class="section">32.201 qrencode<span class="pull-right"><a class="anchor hidden-xs" href="#qrencode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qrencode" aria-hidden="true">TOC</a></span></h3>
  35397. <p>Generate a QR code using the libqrencode library (see
  35398. <a class="url" href="https://fukuchi.org/works/qrencode/">https://fukuchi.org/works/qrencode/</a>), and overlay it on top of the current
  35399. frame.
  35400. </p>
  35401. <p>To enable the compilation of this filter, you need to configure FFmpeg with
  35402. <code class="code">--enable-libqrencode</code>.
  35403. </p>
  35404. <p>The QR code is generated from the provided text or text pattern. The
  35405. corresponding QR code is scaled and overlaid into the video output according to
  35406. the specified options.
  35407. </p>
  35408. <p>In case no text is specified, no QR code is overlaied.
  35409. </p>
  35410. <p>This filter accepts the following options:
  35411. </p>
  35412. <dl class="table">
  35413. <dt><samp class="option">qrcode_width, q</samp></dt>
  35414. <dt><samp class="option">padded_qrcode_width, Q</samp></dt>
  35415. <dd><p>Specify an expression for the width of the rendered QR code, with and without
  35416. padding. The <var class="var">qrcode_width</var> expression can reference the value set by the
  35417. <var class="var">padded_qrcode_width</var> expression, and vice versa.
  35418. By default <var class="var">padded_qrcode_width</var> is set to <var class="var">qrcode_width</var>, meaning that
  35419. there is no padding.
  35420. </p>
  35421. <p>These expressions are evaluated for each new frame.
  35422. </p>
  35423. <p>See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  35424. </p>
  35425. </dd>
  35426. <dt><samp class="option">x</samp></dt>
  35427. <dt><samp class="option">y</samp></dt>
  35428. <dd><p>Specify an expression for positioning the padded QR code top-left corner. The
  35429. <var class="var">x</var> expression can reference the value set by the <var class="var">y</var> expression, and
  35430. vice.
  35431. </p>
  35432. <p>By default <var class="var">x</var> and <var class="var">y</var> are set set to <var class="var">0</var>, meaning that the QR code
  35433. is placed in the top left corner of the input.
  35434. </p>
  35435. <p>These expressions are evaluated for each new frame.
  35436. </p>
  35437. <p>See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  35438. </p>
  35439. </dd>
  35440. <dt><samp class="option">case_sensitive, cs</samp></dt>
  35441. <dd><p>Instruct libqrencode to use case sensitive encoding. This is enabled by
  35442. default. This can be disabled to reduce the QR encoding size.
  35443. </p>
  35444. </dd>
  35445. <dt><samp class="option">level, l</samp></dt>
  35446. <dd><p>Specify the QR encoding error correction level. With an higher correction level,
  35447. the encoding size will increase but the code will be more robust to corruption.
  35448. Lower level is <var class="var">L</var>.
  35449. </p>
  35450. <p>It accepts the following values:
  35451. </p><dl class="table">
  35452. <dt>&lsquo;<samp class="samp">L</samp>&rsquo;</dt>
  35453. <dt>&lsquo;<samp class="samp">M</samp>&rsquo;</dt>
  35454. <dt>&lsquo;<samp class="samp">Q</samp>&rsquo;</dt>
  35455. <dt>&lsquo;<samp class="samp">H</samp>&rsquo;</dt>
  35456. </dl>
  35457. </dd>
  35458. <dt><samp class="option">expansion</samp></dt>
  35459. <dd><p>Select how the input text is expanded. Can be either <code class="code">none</code>, or
  35460. <code class="code">normal</code> (default). See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode Text expansion</a>
  35461. section below for details.
  35462. </p>
  35463. </dd>
  35464. <dt><samp class="option">text</samp></dt>
  35465. <dt><samp class="option">textfile</samp></dt>
  35466. <dd><p>Define the text to be rendered. In case neither is specified, no QR is encoded
  35467. (just an empty colored frame).
  35468. </p>
  35469. <p>In case expansion is enabled, the text is treated as a text template, using the
  35470. qrencode expansion mechanism. See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode
  35471. Text expansion</a> section below for details.
  35472. </p>
  35473. </dd>
  35474. <dt><samp class="option">background_color, bc</samp></dt>
  35475. <dt><samp class="option">foreground_color, fc</samp></dt>
  35476. <dd><p>Set the QR code and background color. The default value of
  35477. <var class="var">foreground_color</var> is &quot;black&quot;, the default value of <var class="var">background_color</var>
  35478. is &quot;white&quot;.
  35479. </p>
  35480. <p>For the syntax of the color options, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot;
  35481. section in the ffmpeg-utils manual</a>.
  35482. </p></dd>
  35483. </dl>
  35484. <a class="anchor" id="qrencode_005fexpressions"></a><a name="qrencode-Expressions"></a>
  35485. <h4 class="subsection">32.201.1 qrencode Expressions<span class="pull-right"><a class="anchor hidden-xs" href="#qrencode-Expressions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qrencode-Expressions" aria-hidden="true">TOC</a></span></h4>
  35486. <p>The expressions set by the options contain the following constants and functions.
  35487. </p>
  35488. <dl class="table">
  35489. <dt><samp class="option">dar</samp></dt>
  35490. <dd><p>input display aspect ratio, it is the same as (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>
  35491. </p>
  35492. </dd>
  35493. <dt><samp class="option">duration</samp></dt>
  35494. <dd><p>the current frame&rsquo;s duration, in seconds
  35495. </p>
  35496. </dd>
  35497. <dt><samp class="option">hsub</samp></dt>
  35498. <dt><samp class="option">vsub</samp></dt>
  35499. <dd><p>horizontal and vertical chroma subsample values. For example for the
  35500. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  35501. </p>
  35502. </dd>
  35503. <dt><samp class="option">main_h, H</samp></dt>
  35504. <dd><p>the input height
  35505. </p>
  35506. </dd>
  35507. <dt><samp class="option">main_w, W</samp></dt>
  35508. <dd><p>the input width
  35509. </p>
  35510. </dd>
  35511. <dt><samp class="option">n</samp></dt>
  35512. <dd><p>the number of input frame, starting from 0
  35513. </p>
  35514. </dd>
  35515. <dt><samp class="option">pict_type</samp></dt>
  35516. <dd><p>a number representing the picture type
  35517. </p>
  35518. </dd>
  35519. <dt><samp class="option">qr_w, w</samp></dt>
  35520. <dd><p>the width of the encoded QR code
  35521. </p>
  35522. </dd>
  35523. <dt><samp class="option">rendered_qr_w, q</samp></dt>
  35524. <dt><samp class="option">rendered_padded_qr_w, Q</samp></dt>
  35525. <dd><p>the width of the rendered QR code, without and without padding.
  35526. </p>
  35527. <p>These parameters allow the <var class="var">q</var> and <var class="var">Q</var> expressions to refer to each
  35528. other, so you can for example specify <code class="code">q=3/4*Q</code>.
  35529. </p>
  35530. </dd>
  35531. <dt><samp class="option">rand(min, max)</samp></dt>
  35532. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  35533. </p>
  35534. </dd>
  35535. <dt><samp class="option">sar</samp></dt>
  35536. <dd><p>the input sample aspect ratio
  35537. </p>
  35538. </dd>
  35539. <dt><samp class="option">t</samp></dt>
  35540. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  35541. </p>
  35542. </dd>
  35543. <dt><samp class="option">x</samp></dt>
  35544. <dt><samp class="option">y</samp></dt>
  35545. <dd><p>the x and y offset coordinates where the text is drawn.
  35546. </p>
  35547. <p>These parameters allow the <var class="var">x</var> and <var class="var">y</var> expressions to refer to each
  35548. other, so you can for example specify <code class="code">y=x/dar</code>.
  35549. </p></dd>
  35550. </dl>
  35551. <a class="anchor" id="qrencode_005ftext_005fexpansion"></a><a name="qrencode-Text-expansion"></a>
  35552. <h4 class="subsection">32.201.2 qrencode Text expansion<span class="pull-right"><a class="anchor hidden-xs" href="#qrencode-Text-expansion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qrencode-Text-expansion" aria-hidden="true">TOC</a></span></h4>
  35553. <p>If <samp class="option">expansion</samp> is set to <code class="code">none</code>, the text is printed verbatim.
  35554. </p>
  35555. <p>If <samp class="option">expansion</samp> is set to <code class="code">normal</code> (which is the default),
  35556. the following expansion mechanism is used.
  35557. </p>
  35558. <p>The backslash character &lsquo;<samp class="samp">\</samp>&rsquo;, followed by any character, always expands to
  35559. the second character.
  35560. </p>
  35561. <p>Sequences of the form <code class="code">%{...}</code> are expanded. The text between the
  35562. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  35563. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  35564. they should be escaped.
  35565. </p>
  35566. <p>Note that they probably must also be escaped as the value for the <samp class="option">text</samp>
  35567. option in the filter argument string and as the filter argument in the
  35568. filtergraph description, and possibly also for the shell, that makes up to four
  35569. levels of escaping; using a text file with the <samp class="option">textfile</samp> option avoids
  35570. these problems.
  35571. </p>
  35572. <p>The following functions are available:
  35573. </p>
  35574. <dl class="table">
  35575. <dt><code class="command">n, frame_num</code></dt>
  35576. <dd><p>return the frame number
  35577. </p>
  35578. </dd>
  35579. <dt><code class="command">pts</code></dt>
  35580. <dd><p>Return the presentation timestamp of the current frame.
  35581. </p>
  35582. <p>It can take up to two arguments.
  35583. </p>
  35584. <p>The first argument is the format of the timestamp; it defaults to <code class="code">flt</code> for
  35585. seconds as a decimal number with microsecond accuracy; <code class="code">hms</code> stands for a
  35586. formatted <var class="var">[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  35587. <code class="code">gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  35588. <code class="code">localtime</code> stands for the timestamp of the frame formatted as local time
  35589. zone time. If the format is set to <code class="code">hms24hh</code>, the time is formatted in 24h
  35590. format (00-23).
  35591. </p>
  35592. <p>The second argument is an offset added to the timestamp.
  35593. </p>
  35594. <p>If the format is set to <code class="code">localtime</code> or <code class="code">gmtime</code>, a third argument may
  35595. be supplied: a <code class="code">strftime</code> C function format string. By default,
  35596. <var class="var">YYYY-MM-DD HH:MM:SS</var> format will be used.
  35597. </p>
  35598. </dd>
  35599. <dt><code class="command">expr, e</code></dt>
  35600. <dd><p>Evaluate the expression&rsquo;s value and output as a double.
  35601. </p>
  35602. <p>It must take one argument specifying the expression to be evaluated, accepting
  35603. the constants and functions defined in <a class="ref" href="#qrencode_005fexpressions">qrencode_expressions</a>.
  35604. </p>
  35605. </dd>
  35606. <dt><code class="command">expr_formatted, ef</code></dt>
  35607. <dd><p>Evaluate the expression&rsquo;s value and output as a formatted string.
  35608. </p>
  35609. <p>The first argument is the expression to be evaluated, just as for the <var class="var">expr</var> function.
  35610. The second argument specifies the output format. Allowed values are &lsquo;<samp class="samp">x</samp>&rsquo;,
  35611. &lsquo;<samp class="samp">X</samp>&rsquo;, &lsquo;<samp class="samp">d</samp>&rsquo; and &lsquo;<samp class="samp">u</samp>&rsquo;. They are treated exactly as in the
  35612. <code class="code">printf</code> function.
  35613. The third parameter is optional and sets the number of positions taken by the output.
  35614. It can be used to add padding with zeros from the left.
  35615. </p>
  35616. </dd>
  35617. <dt><code class="command">gmtime</code></dt>
  35618. <dd><p>The time at which the filter is running, expressed in UTC.
  35619. It can accept an argument: a <code class="code">strftime</code> C function format string.
  35620. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  35621. which prints fractions of the second with optionally specified number of digits.
  35622. </p>
  35623. </dd>
  35624. <dt><code class="command">localtime</code></dt>
  35625. <dd><p>The time at which the filter is running, expressed in the local time zone.
  35626. It can accept an argument: a <code class="code">strftime</code> C function format string.
  35627. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  35628. which prints fractions of the second with optionally specified number of digits.
  35629. </p>
  35630. </dd>
  35631. <dt><code class="command">metadata</code></dt>
  35632. <dd><p>Frame metadata. Takes one or two arguments.
  35633. </p>
  35634. <p>The first argument is mandatory and specifies the metadata key.
  35635. </p>
  35636. <p>The second argument is optional and specifies a default value, used when the
  35637. metadata key is not found or empty.
  35638. </p>
  35639. <p>Available metadata can be identified by inspecting entries starting with TAG
  35640. included within each frame section printed by running <code class="code">ffprobe
  35641. -show_frames</code>.
  35642. </p>
  35643. <p>String metadata generated in filters leading to the qrencode filter are also
  35644. available.
  35645. </p>
  35646. </dd>
  35647. <dt><code class="command">rand(min, max)</code></dt>
  35648. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  35649. </p></dd>
  35650. </dl>
  35651. <a name="Examples-127"></a>
  35652. <h4 class="subsection">32.201.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-127" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-127" aria-hidden="true">TOC</a></span></h4>
  35653. <ul class="itemize mark-bullet">
  35654. <li>Generate a QR code encoding the specified text with the default size, overalaid
  35655. in the top left corner of the input video, with the default size:
  35656. <div class="example">
  35657. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org
  35658. </pre></div>
  35659. </li><li>Same as below, but select blue on pink colors:
  35660. <div class="example">
  35661. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:bc=pink@0.5:fc=blue
  35662. </pre></div>
  35663. </li><li>Place the QR code in the bottom right corner of the input video:
  35664. <div class="example">
  35665. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:x=W-Q:y=H-Q
  35666. </pre></div>
  35667. </li><li>Generate a QR code with width of 200 pixels and padding, making the padded width
  35668. 4/3 of the QR code width:
  35669. <div class="example">
  35670. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:q=200:Q=4/3*q
  35671. </pre></div>
  35672. </li><li>Generate a QR code with padded width of 200 pixels and padding, making the QR
  35673. code width 3/4 of the padded width:
  35674. <div class="example">
  35675. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:Q=200:q=3/4*Q
  35676. </pre></div>
  35677. </li><li>Make the QR code a fraction of the input video width:
  35678. <div class="example">
  35679. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:q=W/5
  35680. </pre></div>
  35681. </li><li>Generate a QR code encoding the frame number:
  35682. <div class="example">
  35683. <pre class="example-preformatted">qrencode=text=%{n}
  35684. </pre></div>
  35685. </li><li>Generate a QR code encoding the GMT timestamp:
  35686. <div class="example">
  35687. <pre class="example-preformatted">qrencode=text=%{gmtime}
  35688. </pre></div>
  35689. </li><li>Generate a QR code encoding the timestamp expressed as a float:
  35690. <div class="example">
  35691. <pre class="example-preformatted">qrencode=text=%{pts}
  35692. </pre></div>
  35693. </li></ul>
  35694. <a name="quirc"></a>
  35695. <h3 class="section">32.202 quirc<span class="pull-right"><a class="anchor hidden-xs" href="#quirc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-quirc" aria-hidden="true">TOC</a></span></h3>
  35696. <p>Identify and decode a QR code using the libquirc library (see
  35697. <a class="url" href="https://github.com/dlbeer/quirc/">https://github.com/dlbeer/quirc/</a>), and print the identified QR codes
  35698. positions and payload as metadata.
  35699. </p>
  35700. <p>To enable the compilation of this filter, you need to configure FFmpeg with
  35701. <code class="code">--enable-libquirc</code>.
  35702. </p>
  35703. <p>For each found QR code in the input video, some metadata entries are added with
  35704. the prefix <var class="var">lavfi.quirc.N</var>, where <var class="var">N</var> is the index, starting from 0,
  35705. associated to the QR code.
  35706. </p>
  35707. <p>A description of each metadata value follows:
  35708. </p>
  35709. <dl class="table">
  35710. <dt><samp class="option">lavfi.quirc.count</samp></dt>
  35711. <dd><p>the number of found QR codes, it is not set in case none was found
  35712. </p>
  35713. </dd>
  35714. <dt><samp class="option">lavfi.quirc.N.corner.M.x</samp></dt>
  35715. <dt><samp class="option">lavfi.quirc.N.coreer.M.y</samp></dt>
  35716. <dd><p>the x/y positions of the four corners of the square containing the QR code,
  35717. where <var class="var">M</var> is the index of the corner starting from 0
  35718. </p>
  35719. </dd>
  35720. <dt><samp class="option">lavfi.quirc.N.payload</samp></dt>
  35721. <dd><p>the payload of the QR code
  35722. </p></dd>
  35723. </dl>
  35724. <a name="random"></a>
  35725. <h3 class="section">32.203 random<span class="pull-right"><a class="anchor hidden-xs" href="#random" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-random" aria-hidden="true">TOC</a></span></h3>
  35726. <p>Flush video frames from internal cache of frames into a random order.
  35727. No frame is discarded.
  35728. Inspired by <a class="ref" href="#frei0r">frei0r</a> nervous filter.
  35729. </p>
  35730. <dl class="table">
  35731. <dt><samp class="option">frames</samp></dt>
  35732. <dd><p>Set size in number of frames of internal cache, in range from <code class="code">2</code> to
  35733. <code class="code">512</code>. Default is <code class="code">30</code>.
  35734. </p>
  35735. </dd>
  35736. <dt><samp class="option">seed</samp></dt>
  35737. <dd><p>Set seed for random number generator, must be an integer included between
  35738. <code class="code">0</code> and <code class="code">UINT32_MAX</code>. If not specified, or if explicitly set to
  35739. less than <code class="code">0</code>, the filter will try to use a good random seed on a
  35740. best effort basis.
  35741. </p></dd>
  35742. </dl>
  35743. <a name="readeia608"></a>
  35744. <h3 class="section">32.204 readeia608<span class="pull-right"><a class="anchor hidden-xs" href="#readeia608" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-readeia608" aria-hidden="true">TOC</a></span></h3>
  35745. <p>Read closed captioning (EIA-608) information from the top lines of a video frame.
  35746. </p>
  35747. <p>This filter adds frame metadata for <code class="code">lavfi.readeia608.X.cc</code> and
  35748. <code class="code">lavfi.readeia608.X.line</code>, where <code class="code">X</code> is the number of the identified line
  35749. with EIA-608 data (starting from 0). A description of each metadata value follows:
  35750. </p>
  35751. <dl class="table">
  35752. <dt><samp class="option">lavfi.readeia608.X.cc</samp></dt>
  35753. <dd><p>The two bytes stored as EIA-608 data (printed in hexadecimal).
  35754. </p>
  35755. </dd>
  35756. <dt><samp class="option">lavfi.readeia608.X.line</samp></dt>
  35757. <dd><p>The number of the line on which the EIA-608 data was identified and read.
  35758. </p></dd>
  35759. </dl>
  35760. <p>This filter accepts the following options:
  35761. </p>
  35762. <dl class="table">
  35763. <dt><samp class="option">scan_min</samp></dt>
  35764. <dd><p>Set the line to start scanning for EIA-608 data. Default is <code class="code">0</code>.
  35765. </p>
  35766. </dd>
  35767. <dt><samp class="option">scan_max</samp></dt>
  35768. <dd><p>Set the line to end scanning for EIA-608 data. Default is <code class="code">29</code>.
  35769. </p>
  35770. </dd>
  35771. <dt><samp class="option">spw</samp></dt>
  35772. <dd><p>Set the ratio of width reserved for sync code detection.
  35773. Default is <code class="code">0.27</code>. Allowed range is <code class="code">[0.1 - 0.7]</code>.
  35774. </p>
  35775. </dd>
  35776. <dt><samp class="option">chp</samp></dt>
  35777. <dd><p>Enable checking the parity bit. In the event of a parity error, the filter will output
  35778. <code class="code">0x00</code> for that character. Default is false.
  35779. </p>
  35780. </dd>
  35781. <dt><samp class="option">lp</samp></dt>
  35782. <dd><p>Lowpass lines prior to further processing. Default is enabled.
  35783. </p></dd>
  35784. </dl>
  35785. <a name="Commands-134"></a>
  35786. <h4 class="subsection">32.204.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-134" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-134" aria-hidden="true">TOC</a></span></h4>
  35787. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  35788. </p>
  35789. <a name="Examples-128"></a>
  35790. <h4 class="subsection">32.204.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-128" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-128" aria-hidden="true">TOC</a></span></h4>
  35791. <ul class="itemize mark-bullet">
  35792. <li>Output a csv with presentation time and the first two lines of identified EIA-608 captioning data.
  35793. <div class="example">
  35794. <pre class="example-preformatted">ffprobe -f lavfi -i movie=captioned_video.mov,readeia608 -show_entries frame=pts_time:frame_tags=lavfi.readeia608.0.cc,lavfi.readeia608.1.cc -of csv
  35795. </pre></div>
  35796. </li></ul>
  35797. <a name="readvitc"></a>
  35798. <h3 class="section">32.205 readvitc<span class="pull-right"><a class="anchor hidden-xs" href="#readvitc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-readvitc" aria-hidden="true">TOC</a></span></h3>
  35799. <p>Read vertical interval timecode (VITC) information from the top lines of a
  35800. video frame.
  35801. </p>
  35802. <p>The filter adds frame metadata key <code class="code">lavfi.readvitc.tc_str</code> with the
  35803. timecode value, if a valid timecode has been detected. Further metadata key
  35804. <code class="code">lavfi.readvitc.found</code> is set to 0/1 depending on whether
  35805. timecode data has been found or not.
  35806. </p>
  35807. <p>This filter accepts the following options:
  35808. </p>
  35809. <dl class="table">
  35810. <dt><samp class="option">scan_max</samp></dt>
  35811. <dd><p>Set the maximum number of lines to scan for VITC data. If the value is set to
  35812. <code class="code">-1</code> the full video frame is scanned. Default is <code class="code">45</code>.
  35813. </p>
  35814. </dd>
  35815. <dt><samp class="option">thr_b</samp></dt>
  35816. <dd><p>Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0],
  35817. default value is <code class="code">0.2</code>. The value must be equal or less than <code class="code">thr_w</code>.
  35818. </p>
  35819. </dd>
  35820. <dt><samp class="option">thr_w</samp></dt>
  35821. <dd><p>Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0],
  35822. default value is <code class="code">0.6</code>. The value must be equal or greater than <code class="code">thr_b</code>.
  35823. </p></dd>
  35824. </dl>
  35825. <a name="Examples-129"></a>
  35826. <h4 class="subsection">32.205.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-129" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-129" aria-hidden="true">TOC</a></span></h4>
  35827. <ul class="itemize mark-bullet">
  35828. <li>Detect and draw VITC data onto the video frame; if no valid VITC is detected,
  35829. draw <code class="code">--:--:--:--</code> as a placeholder:
  35830. <div class="example">
  35831. <pre class="example-preformatted">ffmpeg -i input.avi -filter:v 'readvitc,drawtext=fontfile=FreeMono.ttf:text=%{metadata\\:lavfi.readvitc.tc_str\\:--\\\\\\:--\\\\\\:--\\\\\\:--}:x=(w-tw)/2:y=400-ascent'
  35832. </pre></div>
  35833. </li></ul>
  35834. <a name="remap"></a>
  35835. <h3 class="section">32.206 remap<span class="pull-right"><a class="anchor hidden-xs" href="#remap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-remap" aria-hidden="true">TOC</a></span></h3>
  35836. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  35837. </p>
  35838. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  35839. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  35840. value for pixel will be used for destination pixel.
  35841. </p>
  35842. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  35843. will have Xmap/Ymap video stream dimensions.
  35844. Xmap and Ymap input video streams are 16bit depth, single channel.
  35845. </p>
  35846. <dl class="table">
  35847. <dt><samp class="option">format</samp></dt>
  35848. <dd><p>Specify pixel format of output from this filter. Can be <code class="code">color</code> or <code class="code">gray</code>.
  35849. Default is <code class="code">color</code>.
  35850. </p>
  35851. </dd>
  35852. <dt><samp class="option">fill</samp></dt>
  35853. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  35854. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  35855. manual</a>. Default color is <code class="code">black</code>.
  35856. </p></dd>
  35857. </dl>
  35858. <a name="removegrain"></a>
  35859. <h3 class="section">32.207 removegrain<span class="pull-right"><a class="anchor hidden-xs" href="#removegrain" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-removegrain" aria-hidden="true">TOC</a></span></h3>
  35860. <p>The removegrain filter is a spatial denoiser for progressive video.
  35861. </p>
  35862. <dl class="table">
  35863. <dt><samp class="option">m0</samp></dt>
  35864. <dd><p>Set mode for the first plane.
  35865. </p>
  35866. </dd>
  35867. <dt><samp class="option">m1</samp></dt>
  35868. <dd><p>Set mode for the second plane.
  35869. </p>
  35870. </dd>
  35871. <dt><samp class="option">m2</samp></dt>
  35872. <dd><p>Set mode for the third plane.
  35873. </p>
  35874. </dd>
  35875. <dt><samp class="option">m3</samp></dt>
  35876. <dd><p>Set mode for the fourth plane.
  35877. </p></dd>
  35878. </dl>
  35879. <p>Range of mode is from 0 to 24. Description of each mode follows:
  35880. </p>
  35881. <dl class="table">
  35882. <dt><var class="var">0</var></dt>
  35883. <dd><p>Leave input plane unchanged. Default.
  35884. </p>
  35885. </dd>
  35886. <dt><var class="var">1</var></dt>
  35887. <dd><p>Clips the pixel with the minimum and maximum of the 8 neighbour pixels.
  35888. </p>
  35889. </dd>
  35890. <dt><var class="var">2</var></dt>
  35891. <dd><p>Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.
  35892. </p>
  35893. </dd>
  35894. <dt><var class="var">3</var></dt>
  35895. <dd><p>Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.
  35896. </p>
  35897. </dd>
  35898. <dt><var class="var">4</var></dt>
  35899. <dd><p>Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels.
  35900. This is equivalent to a median filter.
  35901. </p>
  35902. </dd>
  35903. <dt><var class="var">5</var></dt>
  35904. <dd><p>Line-sensitive clipping giving the minimal change.
  35905. </p>
  35906. </dd>
  35907. <dt><var class="var">6</var></dt>
  35908. <dd><p>Line-sensitive clipping, intermediate.
  35909. </p>
  35910. </dd>
  35911. <dt><var class="var">7</var></dt>
  35912. <dd><p>Line-sensitive clipping, intermediate.
  35913. </p>
  35914. </dd>
  35915. <dt><var class="var">8</var></dt>
  35916. <dd><p>Line-sensitive clipping, intermediate.
  35917. </p>
  35918. </dd>
  35919. <dt><var class="var">9</var></dt>
  35920. <dd><p>Line-sensitive clipping on a line where the neighbours pixels are the closest.
  35921. </p>
  35922. </dd>
  35923. <dt><var class="var">10</var></dt>
  35924. <dd><p>Replaces the target pixel with the closest neighbour.
  35925. </p>
  35926. </dd>
  35927. <dt><var class="var">11</var></dt>
  35928. <dd><p>[1 2 1] horizontal and vertical kernel blur.
  35929. </p>
  35930. </dd>
  35931. <dt><var class="var">12</var></dt>
  35932. <dd><p>Same as mode 11.
  35933. </p>
  35934. </dd>
  35935. <dt><var class="var">13</var></dt>
  35936. <dd><p>Bob mode, interpolates top field from the line where the neighbours
  35937. pixels are the closest.
  35938. </p>
  35939. </dd>
  35940. <dt><var class="var">14</var></dt>
  35941. <dd><p>Bob mode, interpolates bottom field from the line where the neighbours
  35942. pixels are the closest.
  35943. </p>
  35944. </dd>
  35945. <dt><var class="var">15</var></dt>
  35946. <dd><p>Bob mode, interpolates top field. Same as 13 but with a more complicated
  35947. interpolation formula.
  35948. </p>
  35949. </dd>
  35950. <dt><var class="var">16</var></dt>
  35951. <dd><p>Bob mode, interpolates bottom field. Same as 14 but with a more complicated
  35952. interpolation formula.
  35953. </p>
  35954. </dd>
  35955. <dt><var class="var">17</var></dt>
  35956. <dd><p>Clips the pixel with the minimum and maximum of respectively the maximum and
  35957. minimum of each pair of opposite neighbour pixels.
  35958. </p>
  35959. </dd>
  35960. <dt><var class="var">18</var></dt>
  35961. <dd><p>Line-sensitive clipping using opposite neighbours whose greatest distance from
  35962. the current pixel is minimal.
  35963. </p>
  35964. </dd>
  35965. <dt><var class="var">19</var></dt>
  35966. <dd><p>Replaces the pixel with the average of its 8 neighbours.
  35967. </p>
  35968. </dd>
  35969. <dt><var class="var">20</var></dt>
  35970. <dd><p>Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
  35971. </p>
  35972. </dd>
  35973. <dt><var class="var">21</var></dt>
  35974. <dd><p>Clips pixels using the averages of opposite neighbour.
  35975. </p>
  35976. </dd>
  35977. <dt><var class="var">22</var></dt>
  35978. <dd><p>Same as mode 21 but simpler and faster.
  35979. </p>
  35980. </dd>
  35981. <dt><var class="var">23</var></dt>
  35982. <dd><p>Small edge and halo removal, but reputed useless.
  35983. </p>
  35984. </dd>
  35985. <dt><var class="var">24</var></dt>
  35986. <dd><p>Similar as 23.
  35987. </p></dd>
  35988. </dl>
  35989. <a name="removelogo"></a>
  35990. <h3 class="section">32.208 removelogo<span class="pull-right"><a class="anchor hidden-xs" href="#removelogo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-removelogo" aria-hidden="true">TOC</a></span></h3>
  35991. <p>Suppress a TV station logo, using an image file to determine which
  35992. pixels comprise the logo. It works by filling in the pixels that
  35993. comprise the logo with neighboring pixels.
  35994. </p>
  35995. <p>The filter accepts the following options:
  35996. </p>
  35997. <dl class="table">
  35998. <dt><samp class="option">filename, f</samp></dt>
  35999. <dd><p>Set the filter bitmap file, which can be any image format supported by
  36000. libavformat. The width and height of the image file must match those of the
  36001. video stream being processed.
  36002. </p></dd>
  36003. </dl>
  36004. <p>Pixels in the provided bitmap image with a value of zero are not
  36005. considered part of the logo, non-zero pixels are considered part of
  36006. the logo. If you use white (255) for the logo and black (0) for the
  36007. rest, you will be safe. For making the filter bitmap, it is
  36008. recommended to take a screen capture of a black frame with the logo
  36009. visible, and then using a threshold filter followed by the erode
  36010. filter once or twice.
  36011. </p>
  36012. <p>If needed, little splotches can be fixed manually. Remember that if
  36013. logo pixels are not covered, the filter quality will be much
  36014. reduced. Marking too many pixels as part of the logo does not hurt as
  36015. much, but it will increase the amount of blurring needed to cover over
  36016. the image and will destroy more information than necessary, and extra
  36017. pixels will slow things down on a large logo.
  36018. </p>
  36019. <a name="repeatfields"></a>
  36020. <h3 class="section">32.209 repeatfields<span class="pull-right"><a class="anchor hidden-xs" href="#repeatfields" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-repeatfields" aria-hidden="true">TOC</a></span></h3>
  36021. <p>This filter uses the repeat_field flag from the Video ES headers and hard repeats
  36022. fields based on its value.
  36023. </p>
  36024. <a name="reverse"></a>
  36025. <h3 class="section">32.210 reverse<span class="pull-right"><a class="anchor hidden-xs" href="#reverse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-reverse" aria-hidden="true">TOC</a></span></h3>
  36026. <p>Reverse a video clip.
  36027. </p>
  36028. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  36029. is suggested.
  36030. </p>
  36031. <a name="Examples-130"></a>
  36032. <h4 class="subsection">32.210.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-130" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-130" aria-hidden="true">TOC</a></span></h4>
  36033. <ul class="itemize mark-bullet">
  36034. <li>Take the first 5 seconds of a clip, and reverse it.
  36035. <div class="example">
  36036. <pre class="example-preformatted">trim=end=5,reverse
  36037. </pre></div>
  36038. </li></ul>
  36039. <a name="rgbashift"></a>
  36040. <h3 class="section">32.211 rgbashift<span class="pull-right"><a class="anchor hidden-xs" href="#rgbashift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rgbashift" aria-hidden="true">TOC</a></span></h3>
  36041. <p>Shift R/G/B/A pixels horizontally and/or vertically.
  36042. </p>
  36043. <p>The filter accepts the following options:
  36044. </p><dl class="table">
  36045. <dt><samp class="option">rh</samp></dt>
  36046. <dd><p>Set amount to shift red horizontally.
  36047. </p></dd>
  36048. <dt><samp class="option">rv</samp></dt>
  36049. <dd><p>Set amount to shift red vertically.
  36050. </p></dd>
  36051. <dt><samp class="option">gh</samp></dt>
  36052. <dd><p>Set amount to shift green horizontally.
  36053. </p></dd>
  36054. <dt><samp class="option">gv</samp></dt>
  36055. <dd><p>Set amount to shift green vertically.
  36056. </p></dd>
  36057. <dt><samp class="option">bh</samp></dt>
  36058. <dd><p>Set amount to shift blue horizontally.
  36059. </p></dd>
  36060. <dt><samp class="option">bv</samp></dt>
  36061. <dd><p>Set amount to shift blue vertically.
  36062. </p></dd>
  36063. <dt><samp class="option">ah</samp></dt>
  36064. <dd><p>Set amount to shift alpha horizontally.
  36065. </p></dd>
  36066. <dt><samp class="option">av</samp></dt>
  36067. <dd><p>Set amount to shift alpha vertically.
  36068. </p></dd>
  36069. <dt><samp class="option">edge</samp></dt>
  36070. <dd><p>Set edge mode, can be <var class="var">smear</var>, default, or <var class="var">warp</var>.
  36071. </p></dd>
  36072. </dl>
  36073. <a name="Commands-135"></a>
  36074. <h4 class="subsection">32.211.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-135" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-135" aria-hidden="true">TOC</a></span></h4>
  36075. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  36076. </p>
  36077. <a name="roberts"></a>
  36078. <h3 class="section">32.212 roberts<span class="pull-right"><a class="anchor hidden-xs" href="#roberts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-roberts" aria-hidden="true">TOC</a></span></h3>
  36079. <p>Apply roberts cross operator to input video stream.
  36080. </p>
  36081. <p>The filter accepts the following option:
  36082. </p>
  36083. <dl class="table">
  36084. <dt><samp class="option">planes</samp></dt>
  36085. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  36086. By default value 0xf, all planes will be processed.
  36087. </p>
  36088. </dd>
  36089. <dt><samp class="option">scale</samp></dt>
  36090. <dd><p>Set value which will be multiplied with filtered result.
  36091. </p>
  36092. </dd>
  36093. <dt><samp class="option">delta</samp></dt>
  36094. <dd><p>Set value which will be added to filtered result.
  36095. </p></dd>
  36096. </dl>
  36097. <a name="Commands-136"></a>
  36098. <h4 class="subsection">32.212.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-136" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-136" aria-hidden="true">TOC</a></span></h4>
  36099. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  36100. </p>
  36101. <a name="rotate"></a>
  36102. <h3 class="section">32.213 rotate<span class="pull-right"><a class="anchor hidden-xs" href="#rotate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rotate" aria-hidden="true">TOC</a></span></h3>
  36103. <p>Rotate video by an arbitrary angle expressed in radians.
  36104. </p>
  36105. <p>The filter accepts the following options:
  36106. </p>
  36107. <p>A description of the optional parameters follows.
  36108. </p><dl class="table">
  36109. <dt><samp class="option">angle, a</samp></dt>
  36110. <dd><p>Set an expression for the angle by which to rotate the input video
  36111. clockwise, expressed as a number of radians. A negative value will
  36112. result in a counter-clockwise rotation. By default it is set to &quot;0&quot;.
  36113. </p>
  36114. <p>This expression is evaluated for each frame.
  36115. </p>
  36116. </dd>
  36117. <dt><samp class="option">out_w, ow</samp></dt>
  36118. <dd><p>Set the output width expression, default value is &quot;iw&quot;.
  36119. This expression is evaluated just once during configuration.
  36120. </p>
  36121. </dd>
  36122. <dt><samp class="option">out_h, oh</samp></dt>
  36123. <dd><p>Set the output height expression, default value is &quot;ih&quot;.
  36124. This expression is evaluated just once during configuration.
  36125. </p>
  36126. </dd>
  36127. <dt><samp class="option">bilinear</samp></dt>
  36128. <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
  36129. it. Default value is 1.
  36130. </p>
  36131. </dd>
  36132. <dt><samp class="option">fillcolor, c</samp></dt>
  36133. <dd><p>Set the color used to fill the output area not covered by the rotated
  36134. image. For the general syntax of this option, check the
  36135. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  36136. If the special value &quot;none&quot; is selected then no
  36137. background is printed (useful for example if the background is never shown).
  36138. </p>
  36139. <p>Default value is &quot;black&quot;.
  36140. </p></dd>
  36141. </dl>
  36142. <p>The expressions for the angle and the output size can contain the
  36143. following constants and functions:
  36144. </p>
  36145. <dl class="table">
  36146. <dt><samp class="option">n</samp></dt>
  36147. <dd><p>sequential number of the input frame, starting from 0. It is always NAN
  36148. before the first frame is filtered.
  36149. </p>
  36150. </dd>
  36151. <dt><samp class="option">t</samp></dt>
  36152. <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
  36153. configured. It is always NAN before the first frame is filtered.
  36154. </p>
  36155. </dd>
  36156. <dt><samp class="option">hsub</samp></dt>
  36157. <dt><samp class="option">vsub</samp></dt>
  36158. <dd><p>horizontal and vertical chroma subsample values. For example for the
  36159. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  36160. </p>
  36161. </dd>
  36162. <dt><samp class="option">in_w, iw</samp></dt>
  36163. <dt><samp class="option">in_h, ih</samp></dt>
  36164. <dd><p>the input video width and height
  36165. </p>
  36166. </dd>
  36167. <dt><samp class="option">out_w, ow</samp></dt>
  36168. <dt><samp class="option">out_h, oh</samp></dt>
  36169. <dd><p>the output width and height, that is the size of the padded area as
  36170. specified by the <var class="var">width</var> and <var class="var">height</var> expressions
  36171. </p>
  36172. </dd>
  36173. <dt><samp class="option">rotw(a)</samp></dt>
  36174. <dt><samp class="option">roth(a)</samp></dt>
  36175. <dd><p>the minimal width/height required for completely containing the input
  36176. video rotated by <var class="var">a</var> radians.
  36177. </p>
  36178. <p>These are only available when computing the <samp class="option">out_w</samp> and
  36179. <samp class="option">out_h</samp> expressions.
  36180. </p></dd>
  36181. </dl>
  36182. <a name="Examples-131"></a>
  36183. <h4 class="subsection">32.213.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-131" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-131" aria-hidden="true">TOC</a></span></h4>
  36184. <ul class="itemize mark-bullet">
  36185. <li>Rotate the input by PI/6 radians clockwise:
  36186. <div class="example">
  36187. <pre class="example-preformatted">rotate=PI/6
  36188. </pre></div>
  36189. </li><li>Rotate the input by PI/6 radians counter-clockwise:
  36190. <div class="example">
  36191. <pre class="example-preformatted">rotate=-PI/6
  36192. </pre></div>
  36193. </li><li>Rotate the input by 45 degrees clockwise:
  36194. <div class="example">
  36195. <pre class="example-preformatted">rotate=45*PI/180
  36196. </pre></div>
  36197. </li><li>Apply a constant rotation with period T, starting from an angle of PI/3:
  36198. <div class="example">
  36199. <pre class="example-preformatted">rotate=PI/3+2*PI*t/T
  36200. </pre></div>
  36201. </li><li>Make the input video rotation oscillating with a period of T
  36202. seconds and an amplitude of A radians:
  36203. <div class="example">
  36204. <pre class="example-preformatted">rotate=A*sin(2*PI/T*t)
  36205. </pre></div>
  36206. </li><li>Rotate the video, output size is chosen so that the whole rotating
  36207. input video is always completely contained in the output:
  36208. <div class="example">
  36209. <pre class="example-preformatted">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
  36210. </pre></div>
  36211. </li><li>Rotate the video, reduce the output size so that no background is ever
  36212. shown:
  36213. <div class="example">
  36214. <pre class="example-preformatted">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
  36215. </pre></div>
  36216. </li></ul>
  36217. <a name="Commands-137"></a>
  36218. <h4 class="subsection">32.213.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-137" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-137" aria-hidden="true">TOC</a></span></h4>
  36219. <p>The filter supports the following commands:
  36220. </p>
  36221. <dl class="table">
  36222. <dt><samp class="option">a, angle</samp></dt>
  36223. <dd><p>Set the angle expression.
  36224. The command accepts the same syntax of the corresponding option.
  36225. </p>
  36226. <p>If the specified expression is not valid, it is kept at its current
  36227. value.
  36228. </p></dd>
  36229. </dl>
  36230. <a name="sab"></a>
  36231. <h3 class="section">32.214 sab<span class="pull-right"><a class="anchor hidden-xs" href="#sab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sab" aria-hidden="true">TOC</a></span></h3>
  36232. <p>Apply Shape Adaptive Blur.
  36233. </p>
  36234. <p>The filter accepts the following options:
  36235. </p>
  36236. <dl class="table">
  36237. <dt><samp class="option">luma_radius, lr</samp></dt>
  36238. <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
  36239. value is 1.0. A greater value will result in a more blurred image, and
  36240. in slower processing.
  36241. </p>
  36242. </dd>
  36243. <dt><samp class="option">luma_pre_filter_radius, lpfr</samp></dt>
  36244. <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
  36245. value is 1.0.
  36246. </p>
  36247. </dd>
  36248. <dt><samp class="option">luma_strength, ls</samp></dt>
  36249. <dd><p>Set luma maximum difference between pixels to still be considered, must
  36250. be a value in the 0.1-100.0 range, default value is 1.0.
  36251. </p>
  36252. </dd>
  36253. <dt><samp class="option">chroma_radius, cr</samp></dt>
  36254. <dd><p>Set chroma blur filter strength, must be a value in range -0.9-4.0. A
  36255. greater value will result in a more blurred image, and in slower
  36256. processing.
  36257. </p>
  36258. </dd>
  36259. <dt><samp class="option">chroma_pre_filter_radius, cpfr</samp></dt>
  36260. <dd><p>Set chroma pre-filter radius, must be a value in the -0.9-2.0 range.
  36261. </p>
  36262. </dd>
  36263. <dt><samp class="option">chroma_strength, cs</samp></dt>
  36264. <dd><p>Set chroma maximum difference between pixels to still be considered,
  36265. must be a value in the -0.9-100.0 range.
  36266. </p></dd>
  36267. </dl>
  36268. <p>Each chroma option value, if not explicitly specified, is set to the
  36269. corresponding luma option value.
  36270. </p>
  36271. <a class="anchor" id="scale"></a><a name="scale-1"></a>
  36272. <h3 class="section">32.215 scale<span class="pull-right"><a class="anchor hidden-xs" href="#scale-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale-1" aria-hidden="true">TOC</a></span></h3>
  36273. <p>Scale (resize) the input video, using the libswscale library.
  36274. </p>
  36275. <p>The scale filter forces the output display aspect ratio to be the same
  36276. of the input, by changing the output sample aspect ratio.
  36277. </p>
  36278. <p>If the input image format is different from the format requested by
  36279. the next filter, the scale filter will convert the input to the
  36280. requested format.
  36281. </p>
  36282. <a name="Options-39"></a>
  36283. <h4 class="subsection">32.215.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-39" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-39" aria-hidden="true">TOC</a></span></h4>
  36284. <p>The filter accepts the following options, any of the options supported
  36285. by the libswscale scaler, as well as any of the <a class="ref" href="#framesync">framesync</a> options.
  36286. </p>
  36287. <p>See <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#scaler_005foptions">the ffmpeg-scaler manual</a> for
  36288. the complete list of scaler options.
  36289. </p>
  36290. <dl class="table">
  36291. <dt><samp class="option">width, w</samp></dt>
  36292. <dt><samp class="option">height, h</samp></dt>
  36293. <dd><p>Set the output video dimension expression. Default value is the input
  36294. dimension.
  36295. </p>
  36296. <p>If the <var class="var">width</var> or <var class="var">w</var> value is 0, the input width is used for
  36297. the output. If the <var class="var">height</var> or <var class="var">h</var> value is 0, the input height
  36298. is used for the output.
  36299. </p>
  36300. <p>If one and only one of the values is -n with n &gt;= 1, the scale filter
  36301. will use a value that maintains the aspect ratio of the input image,
  36302. calculated from the other specified dimension. After that it will,
  36303. however, make sure that the calculated dimension is divisible by n and
  36304. adjust the value if necessary.
  36305. </p>
  36306. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  36307. both values being set to 0 as previously detailed.
  36308. </p>
  36309. <p>See below for the list of accepted constants for use in the dimension
  36310. expression.
  36311. </p>
  36312. </dd>
  36313. <dt><samp class="option">eval</samp></dt>
  36314. <dd><p>Specify when to evaluate <var class="var">width</var> and <var class="var">height</var> expression. It accepts the following values:
  36315. </p>
  36316. <dl class="table">
  36317. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  36318. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  36319. </p>
  36320. </dd>
  36321. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  36322. <dd><p>Evaluate expressions for each incoming frame.
  36323. </p>
  36324. </dd>
  36325. </dl>
  36326. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  36327. </p>
  36328. </dd>
  36329. <dt><samp class="option">interl</samp></dt>
  36330. <dd><p>Set the interlacing mode. It accepts the following values:
  36331. </p>
  36332. <dl class="table">
  36333. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  36334. <dd><p>Force interlaced aware scaling.
  36335. </p>
  36336. </dd>
  36337. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  36338. <dd><p>Do not apply interlaced scaling.
  36339. </p>
  36340. </dd>
  36341. <dt>&lsquo;<samp class="samp">-1</samp>&rsquo;</dt>
  36342. <dd><p>Select interlaced aware scaling depending on whether the source frames
  36343. are flagged as interlaced or not.
  36344. </p></dd>
  36345. </dl>
  36346. <p>Default value is &lsquo;<samp class="samp">0</samp>&rsquo;.
  36347. </p>
  36348. </dd>
  36349. <dt><samp class="option">flags</samp></dt>
  36350. <dd><p>Set libswscale scaling flags. See
  36351. <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#sws_005fflags">the ffmpeg-scaler manual</a> for the
  36352. complete list of values. If not explicitly specified the filter applies
  36353. the default flags.
  36354. </p>
  36355. </dd>
  36356. <dt><samp class="option">param0, param1</samp></dt>
  36357. <dd><p>Set libswscale input parameters for scaling algorithms that need them. See
  36358. <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#sws_005fparams">the ffmpeg-scaler manual</a> for the
  36359. complete documentation. If not explicitly specified the filter applies
  36360. empty parameters.
  36361. </p>
  36362. </dd>
  36363. <dt><samp class="option">intent</samp></dt>
  36364. <dd><p>Set the ICC rendering intent to use when transforming between different color
  36365. spaces. It accepts the following values:
  36366. </p>
  36367. <dl class="table">
  36368. <dt>&lsquo;<samp class="samp">perceptual</samp>&rsquo;</dt>
  36369. <dd><p>Use a perceptually guided tone and gamut mapping curve. The exact details of
  36370. the mapping used may change at any time and should not be relied on as stable.
  36371. This intent is recommended for final viewing of image/video content in typical
  36372. viewing settings.
  36373. </p>
  36374. </dd>
  36375. <dt>&lsquo;<samp class="samp">relative_colorimetric</samp>&rsquo;</dt>
  36376. <dd><p>Statically clip out-of-gamut colors using a colorimetric clipping curve which
  36377. attempts to find the colorimetrically least dissimilar in-gamut color. This
  36378. intent performs white point adaptation and black point adaptation. This is
  36379. the default. This intent is recommended wherever faithful color reproduction
  36380. is of the utmost importance, even at the cost of clipping.
  36381. </p>
  36382. </dd>
  36383. <dt>&lsquo;<samp class="samp">absolute_colorimetric</samp>&rsquo;</dt>
  36384. <dd><p>Hard clip out-of-gamut colors with no attempt at white or black point
  36385. reproduction. This intent will reproduce in-gamut colors 1:1 on the output
  36386. display as they would appear on the reference display, assuming the output
  36387. display is appropriately calibrated.
  36388. </p>
  36389. </dd>
  36390. <dt>&lsquo;<samp class="samp">saturation</samp>&rsquo;</dt>
  36391. <dd><p>Performs saturation mapping - that is, stretches the input color volume
  36392. directly onto the output color volume, in non-linear fashion that preserves the
  36393. original signal appearance as much as possible. This intent is recommended for
  36394. signal content evaluation, as it will not lead to any clipping. It is roughly
  36395. analogous to not performing any color mapping, although it still takes into
  36396. account the mastering display primaries and any differences in encoding TRC.
  36397. </p></dd>
  36398. </dl>
  36399. </dd>
  36400. <dt><samp class="option">size, s</samp></dt>
  36401. <dd><p>Set the video size. For the syntax of this option, check the
  36402. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  36403. </p>
  36404. </dd>
  36405. <dt><samp class="option">in_color_matrix</samp></dt>
  36406. <dt><samp class="option">out_color_matrix</samp></dt>
  36407. <dd><p>Set in/output YCbCr color space type.
  36408. </p>
  36409. <p>This allows the autodetected value to be overridden as well as allows forcing
  36410. a specific value used for the output and encoder.
  36411. </p>
  36412. <p>If not specified, the color space type depends on the pixel format.
  36413. </p>
  36414. <p>Possible values:
  36415. </p>
  36416. <dl class="table">
  36417. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  36418. <dd><p>Choose automatically.
  36419. </p>
  36420. </dd>
  36421. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  36422. <dd><p>Format conforming to International Telecommunication Union (ITU)
  36423. Recommendation BT.709.
  36424. </p>
  36425. </dd>
  36426. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  36427. <dd><p>Set color space conforming to the United States Federal Communications
  36428. Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
  36429. </p>
  36430. </dd>
  36431. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  36432. <dt>&lsquo;<samp class="samp">bt470</samp>&rsquo;</dt>
  36433. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  36434. <dd><p>Set color space conforming to:
  36435. </p>
  36436. <ul class="itemize mark-bullet">
  36437. <li>ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
  36438. </li><li>ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
  36439. </li><li>Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
  36440. </li></ul>
  36441. </dd>
  36442. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  36443. <dd><p>Set color space conforming to SMPTE ST 240:1999.
  36444. </p>
  36445. </dd>
  36446. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  36447. <dd><p>Set color space conforming to ITU-R BT.2020 non-constant luminance system.
  36448. </p></dd>
  36449. </dl>
  36450. </dd>
  36451. <dt><samp class="option">in_range</samp></dt>
  36452. <dt><samp class="option">out_range</samp></dt>
  36453. <dd><p>Set in/output YCbCr sample range.
  36454. </p>
  36455. <p>This allows the autodetected value to be overridden as well as allows forcing
  36456. a specific value used for the output and encoder. If not specified, the
  36457. range depends on the pixel format. Possible values:
  36458. </p>
  36459. <dl class="table">
  36460. <dt>&lsquo;<samp class="samp">auto/unknown</samp>&rsquo;</dt>
  36461. <dd><p>Choose automatically.
  36462. </p>
  36463. </dd>
  36464. <dt>&lsquo;<samp class="samp">jpeg/full/pc</samp>&rsquo;</dt>
  36465. <dd><p>Set full range (0-255 in case of 8-bit luma).
  36466. </p>
  36467. </dd>
  36468. <dt>&lsquo;<samp class="samp">mpeg/limited/tv</samp>&rsquo;</dt>
  36469. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  36470. </p></dd>
  36471. </dl>
  36472. </dd>
  36473. <dt><samp class="option">in_chroma_loc</samp></dt>
  36474. <dt><samp class="option">out_chroma_loc</samp></dt>
  36475. <dd><p>Set in/output chroma sample location. If not specified, center-sited chroma
  36476. is used by default. Possible values:
  36477. </p>
  36478. <dl class="table">
  36479. <dt>&lsquo;<samp class="samp">auto, unknown</samp>&rsquo;</dt>
  36480. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  36481. <dt>&lsquo;<samp class="samp">center</samp>&rsquo;</dt>
  36482. <dt>&lsquo;<samp class="samp">topleft</samp>&rsquo;</dt>
  36483. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  36484. <dt>&lsquo;<samp class="samp">bottomleft</samp>&rsquo;</dt>
  36485. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  36486. </dl>
  36487. </dd>
  36488. <dt><samp class="option">in_primaries</samp></dt>
  36489. <dt><samp class="option">out_primaries</samp></dt>
  36490. <dd><p>Set in/output RGB primaries.
  36491. </p>
  36492. <p>This allows the autodetected value to be overridden as well as allows forcing
  36493. a specific value used for the output and encoder. Possible values:
  36494. </p>
  36495. <dl class="table">
  36496. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  36497. <dd><p>Choose automatically. This is the default.
  36498. </p>
  36499. </dd>
  36500. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  36501. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  36502. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  36503. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  36504. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  36505. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  36506. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  36507. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  36508. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  36509. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  36510. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  36511. <dt>&lsquo;<samp class="samp">ebu3213</samp>&rsquo;</dt>
  36512. </dl>
  36513. </dd>
  36514. <dt><samp class="option">in_transfer</samp></dt>
  36515. <dt><samp class="option">out_transfer</samp></dt>
  36516. <dd><p>Set in/output transfer response curve (TRC).
  36517. </p>
  36518. <p>This allows the autodetected value to be overridden as well as allows forcing
  36519. a specific value used for the output and encoder. Possible values:
  36520. </p>
  36521. <dl class="table">
  36522. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  36523. <dd><p>Choose automatically. This is the default.
  36524. </p>
  36525. </dd>
  36526. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  36527. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  36528. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  36529. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  36530. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  36531. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  36532. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  36533. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  36534. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  36535. <dt>&lsquo;<samp class="samp">srgb</samp>&rsquo;</dt>
  36536. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  36537. <dt>&lsquo;<samp class="samp">xvycc</samp>&rsquo;</dt>
  36538. <dt>&lsquo;<samp class="samp">bt1361e</samp>&rsquo;</dt>
  36539. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  36540. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  36541. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  36542. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  36543. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  36544. </dl>
  36545. </dd>
  36546. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  36547. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  36548. keep the original aspect ratio. Possible values:
  36549. </p>
  36550. <dl class="table">
  36551. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  36552. <dd><p>Scale the video as specified and disable this feature.
  36553. </p>
  36554. </dd>
  36555. <dt>&lsquo;<samp class="samp">decrease</samp>&rsquo;</dt>
  36556. <dd><p>The output video dimensions will automatically be decreased if needed.
  36557. </p>
  36558. </dd>
  36559. <dt>&lsquo;<samp class="samp">increase</samp>&rsquo;</dt>
  36560. <dd><p>The output video dimensions will automatically be increased if needed.
  36561. </p>
  36562. </dd>
  36563. </dl>
  36564. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  36565. maximum allowed resolution, you can use this to limit the output video to
  36566. that, while retaining the aspect ratio. For example, device A allows
  36567. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  36568. decrease) and specifying 1280x720 to the command line makes the output
  36569. 1280x533.
  36570. </p>
  36571. <p>Please note that this is a different thing than specifying -1 for <samp class="option">w</samp>
  36572. or <samp class="option">h</samp>, you still need to specify the output resolution for this option
  36573. to work.
  36574. </p>
  36575. </dd>
  36576. <dt><samp class="option">force_divisible_by</samp></dt>
  36577. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  36578. given integer when used together with <samp class="option">force_original_aspect_ratio</samp>. This
  36579. works similar to using <code class="code">-n</code> in the <samp class="option">w</samp> and <samp class="option">h</samp> options.
  36580. </p>
  36581. <p>This option respects the value set for <samp class="option">force_original_aspect_ratio</samp>,
  36582. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  36583. may be slightly modified.
  36584. </p>
  36585. <p>This option can be handy if you need to have a video fit within or exceed
  36586. a defined resolution using <samp class="option">force_original_aspect_ratio</samp> but also have
  36587. encoder restrictions on width or height divisibility.
  36588. </p>
  36589. </dd>
  36590. <dt><samp class="option">reset_sar</samp></dt>
  36591. <dd><p>Enabling this option leads to the output SAR being reset to 1.
  36592. Additionally, if the user requests proportional scaling either
  36593. through the width or height expressions, e.g. <code class="code">w=-4:h=360</code> or <code class="code">w=iw/2:h=-1</code>
  36594. or by enabling <code class="code">force_original_aspect_ratio</code>, then the input DAR is taken into
  36595. account and the output is scaled to produce square pixels.
  36596. Default is false.
  36597. </p>
  36598. </dd>
  36599. </dl>
  36600. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  36601. containing the following constants:
  36602. </p>
  36603. <dl class="table">
  36604. <dt><var class="var">in_w</var></dt>
  36605. <dt><var class="var">in_h</var></dt>
  36606. <dd><p>The input width and height
  36607. </p>
  36608. </dd>
  36609. <dt><var class="var">iw</var></dt>
  36610. <dt><var class="var">ih</var></dt>
  36611. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  36612. </p>
  36613. </dd>
  36614. <dt><var class="var">out_w</var></dt>
  36615. <dt><var class="var">out_h</var></dt>
  36616. <dd><p>The output (scaled) width and height
  36617. </p>
  36618. </dd>
  36619. <dt><var class="var">ow</var></dt>
  36620. <dt><var class="var">oh</var></dt>
  36621. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  36622. </p>
  36623. </dd>
  36624. <dt><var class="var">a</var></dt>
  36625. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  36626. </p>
  36627. </dd>
  36628. <dt><var class="var">sar</var></dt>
  36629. <dd><p>input sample aspect ratio
  36630. </p>
  36631. </dd>
  36632. <dt><var class="var">dar</var></dt>
  36633. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  36634. </p>
  36635. </dd>
  36636. <dt><var class="var">hsub</var></dt>
  36637. <dt><var class="var">vsub</var></dt>
  36638. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  36639. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  36640. </p>
  36641. </dd>
  36642. <dt><var class="var">ohsub</var></dt>
  36643. <dt><var class="var">ovsub</var></dt>
  36644. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  36645. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  36646. </p>
  36647. </dd>
  36648. <dt><var class="var">n</var></dt>
  36649. <dd><p>The (sequential) number of the input frame, starting from 0.
  36650. Only available with <code class="code">eval=frame</code>.
  36651. </p>
  36652. </dd>
  36653. <dt><var class="var">t</var></dt>
  36654. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  36655. seconds. Only available with <code class="code">eval=frame</code>.
  36656. </p>
  36657. </dd>
  36658. <dt><var class="var">pos</var></dt>
  36659. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  36660. this information is unavailable and/or meaningless (for example in case of synthetic video).
  36661. Only available with <code class="code">eval=frame</code>.
  36662. Deprecated, do not use.
  36663. </p>
  36664. </dd>
  36665. <dt><var class="var">ref_w, rw</var></dt>
  36666. <dt><var class="var">ref_h, rh</var></dt>
  36667. <dt><var class="var">ref_a</var></dt>
  36668. <dt><var class="var">ref_dar, rdar</var></dt>
  36669. <dt><var class="var">ref_n</var></dt>
  36670. <dt><var class="var">ref_t</var></dt>
  36671. <dt><var class="var">ref_pos</var></dt>
  36672. <dd><p>Eqvuialent to the above, but for a second reference input. If any of these
  36673. variables are present, this filter accepts two inputs.
  36674. </p></dd>
  36675. </dl>
  36676. <a name="Examples-132"></a>
  36677. <h4 class="subsection">32.215.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-132" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-132" aria-hidden="true">TOC</a></span></h4>
  36678. <ul class="itemize mark-bullet">
  36679. <li>Scale the input video to a size of 200x100
  36680. <div class="example">
  36681. <pre class="example-preformatted">scale=w=200:h=100
  36682. </pre></div>
  36683. <p>This is equivalent to:
  36684. </p><div class="example">
  36685. <pre class="example-preformatted">scale=200:100
  36686. </pre></div>
  36687. <p>or:
  36688. </p><div class="example">
  36689. <pre class="example-preformatted">scale=200x100
  36690. </pre></div>
  36691. </li><li>Specify a size abbreviation for the output size:
  36692. <div class="example">
  36693. <pre class="example-preformatted">scale=qcif
  36694. </pre></div>
  36695. <p>which can also be written as:
  36696. </p><div class="example">
  36697. <pre class="example-preformatted">scale=size=qcif
  36698. </pre></div>
  36699. </li><li>Scale the input to 2x:
  36700. <div class="example">
  36701. <pre class="example-preformatted">scale=w=2*iw:h=2*ih
  36702. </pre></div>
  36703. </li><li>The above is the same as:
  36704. <div class="example">
  36705. <pre class="example-preformatted">scale=2*in_w:2*in_h
  36706. </pre></div>
  36707. </li><li>Scale the input to 2x with forced interlaced scaling:
  36708. <div class="example">
  36709. <pre class="example-preformatted">scale=2*iw:2*ih:interl=1
  36710. </pre></div>
  36711. </li><li>Scale the input to half size:
  36712. <div class="example">
  36713. <pre class="example-preformatted">scale=w=iw/2:h=ih/2
  36714. </pre></div>
  36715. </li><li>Increase the width, and set the height to the same size:
  36716. <div class="example">
  36717. <pre class="example-preformatted">scale=3/2*iw:ow
  36718. </pre></div>
  36719. </li><li>Seek Greek harmony:
  36720. <div class="example">
  36721. <pre class="example-preformatted">scale=iw:1/PHI*iw
  36722. scale=ih*PHI:ih
  36723. </pre></div>
  36724. </li><li>Increase the height, and set the width to 3/2 of the height:
  36725. <div class="example">
  36726. <pre class="example-preformatted">scale=w=3/2*oh:h=3/5*ih
  36727. </pre></div>
  36728. </li><li>Increase the size, making the size a multiple of the chroma
  36729. subsample values:
  36730. <div class="example">
  36731. <pre class="example-preformatted">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
  36732. </pre></div>
  36733. </li><li>Increase the width to a maximum of 500 pixels,
  36734. keeping the same aspect ratio as the input:
  36735. <div class="example">
  36736. <pre class="example-preformatted">scale=w='min(500\, iw*3/2):h=-1'
  36737. </pre></div>
  36738. </li><li>Make pixels square by combining scale and setsar:
  36739. <div class="example">
  36740. <pre class="example-preformatted">scale='trunc(ih*dar):ih',setsar=1/1
  36741. </pre></div>
  36742. </li><li>Make pixels square using reset_sar,
  36743. making sure the resulting resolution is even (required by some codecs):
  36744. <div class="example">
  36745. <pre class="example-preformatted">scale='-2:ih-mod(ih,2):reset_sar=1'
  36746. </pre></div>
  36747. </li><li>Scale to target exactly, however reset SAR to 1:
  36748. <div class="example">
  36749. <pre class="example-preformatted">scale='400:300:reset_sar=1'
  36750. </pre></div>
  36751. </li><li>Scale to even dimensions that fit within 400x300, preserving input SAR:
  36752. <div class="example">
  36753. <pre class="example-preformatted">scale='400:300:force_original_aspect_ratio=decrease:force_divisible_by=2'
  36754. </pre></div>
  36755. </li><li>Scale to produce square pixels with even dimensions that fit within 400x300:
  36756. <div class="example">
  36757. <pre class="example-preformatted">scale='400:300:force_original_aspect_ratio=decrease:force_divisible_by=2:reset_sar=1'
  36758. </pre></div>
  36759. </li><li>Scale a subtitle stream (sub) to match the main video (main) in size before
  36760. overlaying. (&quot;scale2ref&quot;)
  36761. <div class="example">
  36762. <pre class="example-preformatted">'[main]split[a][b]; [ref][a]scale=rw:rh[c]; [b][c]overlay'
  36763. </pre></div>
  36764. </li><li>Scale a logo to 1/10th the height of a video, while preserving its display
  36765. aspect ratio.
  36766. <div class="example">
  36767. <pre class="example-preformatted">[logo-in][video-in]scale=w=oh*dar:h=rh/10[logo-out]
  36768. </pre></div>
  36769. </li></ul>
  36770. <a name="Commands-138"></a>
  36771. <h4 class="subsection">32.215.3 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-138" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-138" aria-hidden="true">TOC</a></span></h4>
  36772. <p>This filter supports the following commands:
  36773. </p><dl class="table">
  36774. <dt><samp class="option">width, w</samp></dt>
  36775. <dt><samp class="option">height, h</samp></dt>
  36776. <dd><p>Set the output video dimension expression.
  36777. The command accepts the same syntax of the corresponding option.
  36778. </p>
  36779. <p>If the specified expression is not valid, it is kept at its current
  36780. value.
  36781. </p></dd>
  36782. </dl>
  36783. <a name="scharr"></a>
  36784. <h3 class="section">32.216 scharr<span class="pull-right"><a class="anchor hidden-xs" href="#scharr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scharr" aria-hidden="true">TOC</a></span></h3>
  36785. <p>Apply scharr operator to input video stream.
  36786. </p>
  36787. <p>The filter accepts the following option:
  36788. </p>
  36789. <dl class="table">
  36790. <dt><samp class="option">planes</samp></dt>
  36791. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  36792. By default value 0xf, all planes will be processed.
  36793. </p>
  36794. </dd>
  36795. <dt><samp class="option">scale</samp></dt>
  36796. <dd><p>Set value which will be multiplied with filtered result.
  36797. </p>
  36798. </dd>
  36799. <dt><samp class="option">delta</samp></dt>
  36800. <dd><p>Set value which will be added to filtered result.
  36801. </p></dd>
  36802. </dl>
  36803. <a name="Commands-139"></a>
  36804. <h4 class="subsection">32.216.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-139" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-139" aria-hidden="true">TOC</a></span></h4>
  36805. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  36806. </p>
  36807. <a name="scroll"></a>
  36808. <h3 class="section">32.217 scroll<span class="pull-right"><a class="anchor hidden-xs" href="#scroll" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scroll" aria-hidden="true">TOC</a></span></h3>
  36809. <p>Scroll input video horizontally and/or vertically by constant speed.
  36810. </p>
  36811. <p>The filter accepts the following options:
  36812. </p><dl class="table">
  36813. <dt><samp class="option">horizontal, h</samp></dt>
  36814. <dd><p>Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1.
  36815. Negative values changes scrolling direction.
  36816. </p>
  36817. </dd>
  36818. <dt><samp class="option">vertical, v</samp></dt>
  36819. <dd><p>Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1.
  36820. Negative values changes scrolling direction.
  36821. </p>
  36822. </dd>
  36823. <dt><samp class="option">hpos</samp></dt>
  36824. <dd><p>Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1.
  36825. </p>
  36826. </dd>
  36827. <dt><samp class="option">vpos</samp></dt>
  36828. <dd><p>Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1.
  36829. </p></dd>
  36830. </dl>
  36831. <a name="Commands-140"></a>
  36832. <h4 class="subsection">32.217.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-140" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-140" aria-hidden="true">TOC</a></span></h4>
  36833. <p>This filter supports the following <a class="ref" href="#commands">commands</a>:
  36834. </p><dl class="table">
  36835. <dt><samp class="option">horizontal, h</samp></dt>
  36836. <dd><p>Set the horizontal scrolling speed.
  36837. </p></dd>
  36838. <dt><samp class="option">vertical, v</samp></dt>
  36839. <dd><p>Set the vertical scrolling speed.
  36840. </p></dd>
  36841. </dl>
  36842. <a class="anchor" id="scdet"></a><a name="scdet-1"></a>
  36843. <h3 class="section">32.218 scdet<span class="pull-right"><a class="anchor hidden-xs" href="#scdet-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scdet-1" aria-hidden="true">TOC</a></span></h3>
  36844. <p>Detect video scene change.
  36845. </p>
  36846. <p>This filter sets frame metadata with mafd between frame, the scene score, and
  36847. forward the frame to the next filter, so they can use these metadata to detect
  36848. scene change or others.
  36849. </p>
  36850. <p>In addition, this filter logs a message and sets frame metadata when it detects
  36851. a scene change by <samp class="option">threshold</samp>.
  36852. </p>
  36853. <p><code class="code">lavfi.scd.mafd</code> metadata keys are set with mafd for every frame.
  36854. </p>
  36855. <p><code class="code">lavfi.scd.score</code> metadata keys are set with scene change score for every frame
  36856. to detect scene change.
  36857. </p>
  36858. <p><code class="code">lavfi.scd.time</code> metadata keys are set with current filtered frame time which
  36859. detect scene change with <samp class="option">threshold</samp>.
  36860. </p>
  36861. <p>The filter accepts the following options:
  36862. </p>
  36863. <dl class="table">
  36864. <dt><samp class="option">threshold, t</samp></dt>
  36865. <dd><p>Set the scene change detection threshold as a percentage of maximum change. Good
  36866. values are in the <code class="code">[8.0, 14.0]</code> range. The range for <samp class="option">threshold</samp> is
  36867. <code class="code">[0., 100.]</code>.
  36868. </p>
  36869. <p>Default value is <code class="code">10.</code>.
  36870. </p>
  36871. </dd>
  36872. <dt><samp class="option">sc_pass, s</samp></dt>
  36873. <dd><p>Set the flag to pass scene change frames to the next filter. Default value is <code class="code">0</code>
  36874. You can enable it if you want to get snapshot of scene change frames only.
  36875. </p></dd>
  36876. </dl>
  36877. <a class="anchor" id="selectivecolor"></a><a name="selectivecolor-1"></a>
  36878. <h3 class="section">32.219 selectivecolor<span class="pull-right"><a class="anchor hidden-xs" href="#selectivecolor-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-selectivecolor-1" aria-hidden="true">TOC</a></span></h3>
  36879. <p>Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such
  36880. as &quot;reds&quot;, &quot;yellows&quot;, &quot;greens&quot;, &quot;cyans&quot;, ...). The adjustment range is defined
  36881. by the &quot;purity&quot; of the color (that is, how saturated it already is).
  36882. </p>
  36883. <p>This filter is similar to the Adobe Photoshop Selective Color tool.
  36884. </p>
  36885. <p>The filter accepts the following options:
  36886. </p>
  36887. <dl class="table">
  36888. <dt><samp class="option">correction_method</samp></dt>
  36889. <dd><p>Select color correction method.
  36890. </p>
  36891. <p>Available values are:
  36892. </p><dl class="table">
  36893. <dt>&lsquo;<samp class="samp">absolute</samp>&rsquo;</dt>
  36894. <dd><p>Specified adjustments are applied &quot;as-is&quot; (added/subtracted to original pixel
  36895. component value).
  36896. </p></dd>
  36897. <dt>&lsquo;<samp class="samp">relative</samp>&rsquo;</dt>
  36898. <dd><p>Specified adjustments are relative to the original component value.
  36899. </p></dd>
  36900. </dl>
  36901. <p>Default is <code class="code">absolute</code>.
  36902. </p></dd>
  36903. <dt><samp class="option">reds</samp></dt>
  36904. <dd><p>Adjustments for red pixels (pixels where the red component is the maximum)
  36905. </p></dd>
  36906. <dt><samp class="option">yellows</samp></dt>
  36907. <dd><p>Adjustments for yellow pixels (pixels where the blue component is the minimum)
  36908. </p></dd>
  36909. <dt><samp class="option">greens</samp></dt>
  36910. <dd><p>Adjustments for green pixels (pixels where the green component is the maximum)
  36911. </p></dd>
  36912. <dt><samp class="option">cyans</samp></dt>
  36913. <dd><p>Adjustments for cyan pixels (pixels where the red component is the minimum)
  36914. </p></dd>
  36915. <dt><samp class="option">blues</samp></dt>
  36916. <dd><p>Adjustments for blue pixels (pixels where the blue component is the maximum)
  36917. </p></dd>
  36918. <dt><samp class="option">magentas</samp></dt>
  36919. <dd><p>Adjustments for magenta pixels (pixels where the green component is the minimum)
  36920. </p></dd>
  36921. <dt><samp class="option">whites</samp></dt>
  36922. <dd><p>Adjustments for white pixels (pixels where all components are greater than 128)
  36923. </p></dd>
  36924. <dt><samp class="option">neutrals</samp></dt>
  36925. <dd><p>Adjustments for all pixels except pure black and pure white
  36926. </p></dd>
  36927. <dt><samp class="option">blacks</samp></dt>
  36928. <dd><p>Adjustments for black pixels (pixels where all components are lesser than 128)
  36929. </p></dd>
  36930. <dt><samp class="option">psfile</samp></dt>
  36931. <dd><p>Specify a Photoshop selective color file (<code class="code">.asv</code>) to import the settings from.
  36932. </p></dd>
  36933. </dl>
  36934. <p>All the adjustment settings (<samp class="option">reds</samp>, <samp class="option">yellows</samp>, ...) accept up to
  36935. 4 space separated floating point adjustment values in the [-1,1] range,
  36936. respectively to adjust the amount of cyan, magenta, yellow and black for the
  36937. pixels of its range.
  36938. </p>
  36939. <a name="Examples-133"></a>
  36940. <h4 class="subsection">32.219.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-133" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-133" aria-hidden="true">TOC</a></span></h4>
  36941. <ul class="itemize mark-bullet">
  36942. <li>Increase cyan by 50% and reduce yellow by 33% in every green areas, and
  36943. increase magenta by 27% in blue areas:
  36944. <div class="example">
  36945. <pre class="example-preformatted">selectivecolor=greens=.5 0 -.33 0:blues=0 .27
  36946. </pre></div>
  36947. </li><li>Use a Photoshop selective color preset:
  36948. <div class="example">
  36949. <pre class="example-preformatted">selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
  36950. </pre></div>
  36951. </li></ul>
  36952. <a class="anchor" id="separatefields"></a><a name="separatefields-1"></a>
  36953. <h3 class="section">32.220 separatefields<span class="pull-right"><a class="anchor hidden-xs" href="#separatefields-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-separatefields-1" aria-hidden="true">TOC</a></span></h3>
  36954. <p>The <code class="code">separatefields</code> takes a frame-based video input and splits
  36955. each frame into its components fields, producing a new half height clip
  36956. with twice the frame rate and twice the frame count.
  36957. </p>
  36958. <p>This filter use field-dominance information in frame to decide which
  36959. of each pair of fields to place first in the output.
  36960. If it gets it wrong use <a class="ref" href="#setfield">setfield</a> filter before <code class="code">separatefields</code> filter.
  36961. </p>
  36962. <a name="setdar_002c-setsar"></a>
  36963. <h3 class="section">32.221 setdar, setsar<span class="pull-right"><a class="anchor hidden-xs" href="#setdar_002c-setsar" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setdar_002c-setsar" aria-hidden="true">TOC</a></span></h3>
  36964. <p>The <code class="code">setdar</code> filter sets the Display Aspect Ratio for the filter
  36965. output video.
  36966. </p>
  36967. <p>This is done by changing the specified Sample (aka Pixel) Aspect
  36968. Ratio, according to the following equation:
  36969. </p><div class="example">
  36970. <pre class="example-preformatted"><var class="var">DAR</var> = <var class="var">HORIZONTAL_RESOLUTION</var> / <var class="var">VERTICAL_RESOLUTION</var> * <var class="var">SAR</var>
  36971. </pre></div>
  36972. <p>Keep in mind that the <code class="code">setdar</code> filter does not modify the pixel
  36973. dimensions of the video frame. Also, the display aspect ratio set by
  36974. this filter may be changed by later filters in the filterchain,
  36975. e.g. in case of scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is
  36976. applied.
  36977. </p>
  36978. <p>The <code class="code">setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
  36979. the filter output video.
  36980. </p>
  36981. <p>Note that as a consequence of the application of this filter, the
  36982. output display aspect ratio will change according to the equation
  36983. above.
  36984. </p>
  36985. <p>Keep in mind that the sample aspect ratio set by the <code class="code">setsar</code>
  36986. filter may be changed by later filters in the filterchain, e.g. if
  36987. another &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
  36988. </p>
  36989. <p>It accepts the following parameters:
  36990. </p>
  36991. <dl class="table">
  36992. <dt><samp class="option">r, ratio, dar (<code class="code">setdar</code> only), sar (<code class="code">setsar</code> only)</samp></dt>
  36993. <dd><p>Set the aspect ratio used by the filter.
  36994. </p>
  36995. <p>The parameter can be a floating point number string, or an expression. If the
  36996. parameter is not specified, the value &quot;0&quot; is assumed, meaning that the same
  36997. input value is used.
  36998. </p>
  36999. </dd>
  37000. <dt><samp class="option">max</samp></dt>
  37001. <dd><p>Set the maximum integer value to use for expressing numerator and
  37002. denominator when reducing the expressed aspect ratio to a rational.
  37003. Default value is <code class="code">100</code>.
  37004. </p>
  37005. </dd>
  37006. </dl>
  37007. <p>The parameter <var class="var">sar</var> is an expression containing the following constants:
  37008. </p>
  37009. <dl class="table">
  37010. <dt><samp class="option">w, h</samp></dt>
  37011. <dd><p>The input width and height.
  37012. </p>
  37013. </dd>
  37014. <dt><samp class="option">a</samp></dt>
  37015. <dd><p>Same as <var class="var">w</var> / <var class="var">h</var>.
  37016. </p>
  37017. </dd>
  37018. <dt><samp class="option">sar</samp></dt>
  37019. <dd><p>The input sample aspect ratio.
  37020. </p>
  37021. </dd>
  37022. <dt><samp class="option">dar</samp></dt>
  37023. <dd><p>The input display aspect ratio. It is the same as
  37024. (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>.
  37025. </p>
  37026. </dd>
  37027. <dt><samp class="option">hsub, vsub</samp></dt>
  37028. <dd><p>Horizontal and vertical chroma subsample values. For example, for the
  37029. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  37030. </p></dd>
  37031. </dl>
  37032. <a name="Examples-134"></a>
  37033. <h4 class="subsection">32.221.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-134" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-134" aria-hidden="true">TOC</a></span></h4>
  37034. <ul class="itemize mark-bullet">
  37035. <li>To change the display aspect ratio to 16:9, specify one of the following:
  37036. <div class="example">
  37037. <pre class="example-preformatted">setdar=dar=1.77777
  37038. setdar=dar=16/9
  37039. </pre></div>
  37040. </li><li>To change the sample aspect ratio to 10:11, specify:
  37041. <div class="example">
  37042. <pre class="example-preformatted">setsar=sar=10/11
  37043. </pre></div>
  37044. </li><li>To set a display aspect ratio of 16:9, and specify a maximum integer value of
  37045. 1000 in the aspect ratio reduction, use the command:
  37046. <div class="example">
  37047. <pre class="example-preformatted">setdar=ratio=16/9:max=1000
  37048. </pre></div>
  37049. </li></ul>
  37050. <a class="anchor" id="setfield"></a><a name="setfield-1"></a>
  37051. <h3 class="section">32.222 setfield<span class="pull-right"><a class="anchor hidden-xs" href="#setfield-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setfield-1" aria-hidden="true">TOC</a></span></h3>
  37052. <p>Force field for the output video frame.
  37053. </p>
  37054. <p>The <code class="code">setfield</code> filter marks the interlace type field for the
  37055. output frames. It does not change the input frame, but only sets the
  37056. corresponding property, which affects how the frame is treated by
  37057. following filters (e.g. <code class="code">fieldorder</code> or <code class="code">yadif</code>).
  37058. </p>
  37059. <p>The filter accepts the following options:
  37060. </p>
  37061. <dl class="table">
  37062. <dt><samp class="option">mode</samp></dt>
  37063. <dd><p>Available values are:
  37064. </p>
  37065. <dl class="table">
  37066. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  37067. <dd><p>Keep the same field property.
  37068. </p>
  37069. </dd>
  37070. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  37071. <dd><p>Mark the frame as bottom-field-first.
  37072. </p>
  37073. </dd>
  37074. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  37075. <dd><p>Mark the frame as top-field-first.
  37076. </p>
  37077. </dd>
  37078. <dt>&lsquo;<samp class="samp">prog</samp>&rsquo;</dt>
  37079. <dd><p>Mark the frame as progressive.
  37080. </p></dd>
  37081. </dl>
  37082. </dd>
  37083. </dl>
  37084. <a class="anchor" id="setparams"></a><a name="setparams-1"></a>
  37085. <h3 class="section">32.223 setparams<span class="pull-right"><a class="anchor hidden-xs" href="#setparams-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setparams-1" aria-hidden="true">TOC</a></span></h3>
  37086. <p>Force frame parameter for the output video frame.
  37087. </p>
  37088. <p>The <code class="code">setparams</code> filter marks interlace and color range for the
  37089. output frames. It does not change the input frame, but only sets the
  37090. corresponding property, which affects how the frame is treated by
  37091. filters/encoders.
  37092. </p>
  37093. <dl class="table">
  37094. <dt><samp class="option">field_mode</samp></dt>
  37095. <dd><p>Available values are:
  37096. </p>
  37097. <dl class="table">
  37098. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  37099. <dd><p>Keep the same field property (default).
  37100. </p>
  37101. </dd>
  37102. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  37103. <dd><p>Mark the frame as bottom-field-first.
  37104. </p>
  37105. </dd>
  37106. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  37107. <dd><p>Mark the frame as top-field-first.
  37108. </p>
  37109. </dd>
  37110. <dt>&lsquo;<samp class="samp">prog</samp>&rsquo;</dt>
  37111. <dd><p>Mark the frame as progressive.
  37112. </p></dd>
  37113. </dl>
  37114. </dd>
  37115. <dt><samp class="option">range</samp></dt>
  37116. <dd><p>Available values are:
  37117. </p>
  37118. <dl class="table">
  37119. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  37120. <dd><p>Keep the same color range property (default).
  37121. </p>
  37122. </dd>
  37123. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  37124. <dd><p>Mark the frame as unspecified color range.
  37125. </p>
  37126. </dd>
  37127. <dt>&lsquo;<samp class="samp">limited, tv, mpeg</samp>&rsquo;</dt>
  37128. <dd><p>Mark the frame as limited range.
  37129. </p>
  37130. </dd>
  37131. <dt>&lsquo;<samp class="samp">full, pc, jpeg</samp>&rsquo;</dt>
  37132. <dd><p>Mark the frame as full range.
  37133. </p></dd>
  37134. </dl>
  37135. </dd>
  37136. <dt><samp class="option">color_primaries</samp></dt>
  37137. <dd><p>Set the color primaries.
  37138. Available values are:
  37139. </p>
  37140. <dl class="table">
  37141. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  37142. <dd><p>Keep the same color primaries property (default).
  37143. </p>
  37144. </dd>
  37145. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  37146. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  37147. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  37148. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  37149. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  37150. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  37151. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  37152. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  37153. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  37154. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  37155. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  37156. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  37157. </dl>
  37158. </dd>
  37159. <dt><samp class="option">color_trc</samp></dt>
  37160. <dd><p>Set the color transfer.
  37161. Available values are:
  37162. </p>
  37163. <dl class="table">
  37164. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  37165. <dd><p>Keep the same color trc property (default).
  37166. </p>
  37167. </dd>
  37168. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  37169. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  37170. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  37171. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  37172. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  37173. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  37174. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  37175. <dt>&lsquo;<samp class="samp">log100</samp>&rsquo;</dt>
  37176. <dt>&lsquo;<samp class="samp">log316</samp>&rsquo;</dt>
  37177. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  37178. <dt>&lsquo;<samp class="samp">bt1361e</samp>&rsquo;</dt>
  37179. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  37180. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  37181. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  37182. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  37183. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  37184. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  37185. </dl>
  37186. </dd>
  37187. <dt><samp class="option">colorspace</samp></dt>
  37188. <dd><p>Set the colorspace.
  37189. Available values are:
  37190. </p>
  37191. <dl class="table">
  37192. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  37193. <dd><p>Keep the same colorspace property (default).
  37194. </p>
  37195. </dd>
  37196. <dt>&lsquo;<samp class="samp">gbr</samp>&rsquo;</dt>
  37197. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  37198. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  37199. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  37200. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  37201. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  37202. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  37203. <dt>&lsquo;<samp class="samp">ycgco</samp>&rsquo;</dt>
  37204. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  37205. <dt>&lsquo;<samp class="samp">bt2020c</samp>&rsquo;</dt>
  37206. <dt>&lsquo;<samp class="samp">smpte2085</samp>&rsquo;</dt>
  37207. <dt>&lsquo;<samp class="samp">chroma-derived-nc</samp>&rsquo;</dt>
  37208. <dt>&lsquo;<samp class="samp">chroma-derived-c</samp>&rsquo;</dt>
  37209. <dt>&lsquo;<samp class="samp">ictcp</samp>&rsquo;</dt>
  37210. </dl>
  37211. </dd>
  37212. <dt><samp class="option">chroma_location</samp></dt>
  37213. <dd><p>Set the chroma sample location.
  37214. Available values are:
  37215. </p>
  37216. <dl class="table">
  37217. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  37218. <dd><p>Keep the same chroma location (default).
  37219. </p>
  37220. </dd>
  37221. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  37222. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  37223. <dt>&lsquo;<samp class="samp">center</samp>&rsquo;</dt>
  37224. <dt>&lsquo;<samp class="samp">topleft</samp>&rsquo;</dt>
  37225. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  37226. <dt>&lsquo;<samp class="samp">bottomleft</samp>&rsquo;</dt>
  37227. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  37228. </dl>
  37229. </dd>
  37230. <dt><samp class="option">alpha_mode</samp></dt>
  37231. <dd><p>Set the alpha moda.
  37232. Available values are:
  37233. </p>
  37234. <dl class="table">
  37235. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  37236. <dd><p>Keep the same alpha mode (default).
  37237. </p>
  37238. </dd>
  37239. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  37240. <dt>&lsquo;<samp class="samp">premultiplied</samp>&rsquo;</dt>
  37241. <dt>&lsquo;<samp class="samp">straight</samp>&rsquo;</dt>
  37242. </dl>
  37243. </dd>
  37244. </dl>
  37245. <a name="shear"></a>
  37246. <h3 class="section">32.224 shear<span class="pull-right"><a class="anchor hidden-xs" href="#shear" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shear" aria-hidden="true">TOC</a></span></h3>
  37247. <p>Apply shear transform to input video.
  37248. </p>
  37249. <p>This filter supports the following options:
  37250. </p>
  37251. <dl class="table">
  37252. <dt><samp class="option">shx</samp></dt>
  37253. <dd><p>Shear factor in X-direction. Default value is 0.
  37254. Allowed range is from -2 to 2.
  37255. </p>
  37256. </dd>
  37257. <dt><samp class="option">shy</samp></dt>
  37258. <dd><p>Shear factor in Y-direction. Default value is 0.
  37259. Allowed range is from -2 to 2.
  37260. </p>
  37261. </dd>
  37262. <dt><samp class="option">fillcolor, c</samp></dt>
  37263. <dd><p>Set the color used to fill the output area not covered by the transformed
  37264. video. For the general syntax of this option, check the
  37265. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  37266. If the special value &quot;none&quot; is selected then no
  37267. background is printed (useful for example if the background is never shown).
  37268. </p>
  37269. <p>Default value is &quot;black&quot;.
  37270. </p>
  37271. </dd>
  37272. <dt><samp class="option">interp</samp></dt>
  37273. <dd><p>Set interpolation type. Can be <code class="code">bilinear</code> or <code class="code">nearest</code>. Default is <code class="code">bilinear</code>.
  37274. </p></dd>
  37275. </dl>
  37276. <a name="Commands-141"></a>
  37277. <h4 class="subsection">32.224.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-141" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-141" aria-hidden="true">TOC</a></span></h4>
  37278. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37279. </p>
  37280. <a name="showinfo-1"></a>
  37281. <h3 class="section">32.225 showinfo<span class="pull-right"><a class="anchor hidden-xs" href="#showinfo-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showinfo-1" aria-hidden="true">TOC</a></span></h3>
  37282. <p>Show a line containing various information for each input video frame.
  37283. The input video is not modified.
  37284. </p>
  37285. <p>This filter supports the following options:
  37286. </p>
  37287. <dl class="table">
  37288. <dt><samp class="option">checksum</samp></dt>
  37289. <dd><p>Calculate checksums of each plane. By default enabled.
  37290. </p>
  37291. </dd>
  37292. <dt><samp class="option">udu_sei_as_ascii</samp></dt>
  37293. <dd><p>Try to print user data unregistered SEI as ascii character when possible,
  37294. in hex format otherwise.
  37295. </p></dd>
  37296. </dl>
  37297. <p>The shown line contains a sequence of key/value pairs of the form
  37298. <var class="var">key</var>:<var class="var">value</var>.
  37299. </p>
  37300. <p>The following values are shown in the output:
  37301. </p>
  37302. <dl class="table">
  37303. <dt><samp class="option">n</samp></dt>
  37304. <dd><p>The (sequential) number of the input frame, starting from 0.
  37305. </p>
  37306. </dd>
  37307. <dt><samp class="option">pts</samp></dt>
  37308. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  37309. time base units. The time base unit depends on the filter input pad.
  37310. </p>
  37311. </dd>
  37312. <dt><samp class="option">pts_time</samp></dt>
  37313. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  37314. seconds.
  37315. </p>
  37316. </dd>
  37317. <dt><samp class="option">fmt</samp></dt>
  37318. <dd><p>The pixel format name.
  37319. </p>
  37320. </dd>
  37321. <dt><samp class="option">sar</samp></dt>
  37322. <dd><p>The sample aspect ratio of the input frame, expressed in the form
  37323. <var class="var">num</var>/<var class="var">den</var>.
  37324. </p>
  37325. </dd>
  37326. <dt><samp class="option">s</samp></dt>
  37327. <dd><p>The size of the input frame. For the syntax of this option, check the
  37328. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  37329. </p>
  37330. </dd>
  37331. <dt><samp class="option">i</samp></dt>
  37332. <dd><p>The type of interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
  37333. for bottom field first).
  37334. </p>
  37335. </dd>
  37336. <dt><samp class="option">iskey</samp></dt>
  37337. <dd><p>This is 1 if the frame is a key frame, 0 otherwise.
  37338. </p>
  37339. </dd>
  37340. <dt><samp class="option">type</samp></dt>
  37341. <dd><p>The picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
  37342. P-frame, &quot;B&quot; for a B-frame, or &quot;?&quot; for an unknown type).
  37343. Also refer to the documentation of the <code class="code">AVPictureType</code> enum and of
  37344. the <code class="code">av_get_picture_type_char</code> function defined in
  37345. <samp class="file">libavutil/avutil.h</samp>.
  37346. </p>
  37347. </dd>
  37348. <dt><samp class="option">checksum</samp></dt>
  37349. <dd><p>The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame.
  37350. </p>
  37351. </dd>
  37352. <dt><samp class="option">plane_checksum</samp></dt>
  37353. <dd><p>The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
  37354. expressed in the form &quot;[<var class="var">c0</var> <var class="var">c1</var> <var class="var">c2</var> <var class="var">c3</var>]&quot;.
  37355. </p>
  37356. </dd>
  37357. <dt><samp class="option">mean</samp></dt>
  37358. <dd><p>The mean value of pixels in each plane of the input frame, expressed in the form
  37359. &quot;[<var class="var">mean0</var> <var class="var">mean1</var> <var class="var">mean2</var> <var class="var">mean3</var>]&quot;.
  37360. </p>
  37361. </dd>
  37362. <dt><samp class="option">stdev</samp></dt>
  37363. <dd><p>The standard deviation of pixel values in each plane of the input frame, expressed
  37364. in the form &quot;[<var class="var">stdev0</var> <var class="var">stdev1</var> <var class="var">stdev2</var> <var class="var">stdev3</var>]&quot;.
  37365. </p>
  37366. </dd>
  37367. </dl>
  37368. <a name="showpalette"></a>
  37369. <h3 class="section">32.226 showpalette<span class="pull-right"><a class="anchor hidden-xs" href="#showpalette" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showpalette" aria-hidden="true">TOC</a></span></h3>
  37370. <p>Displays the 256 colors palette of each frame. This filter is only relevant for
  37371. <var class="var">pal8</var> pixel format frames.
  37372. </p>
  37373. <p>It accepts the following option:
  37374. </p>
  37375. <dl class="table">
  37376. <dt><samp class="option">s</samp></dt>
  37377. <dd><p>Set the size of the box used to represent one palette color entry. Default is
  37378. <code class="code">30</code> (for a <code class="code">30x30</code> pixel box).
  37379. </p></dd>
  37380. </dl>
  37381. <a name="shuffleframes"></a>
  37382. <h3 class="section">32.227 shuffleframes<span class="pull-right"><a class="anchor hidden-xs" href="#shuffleframes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shuffleframes" aria-hidden="true">TOC</a></span></h3>
  37383. <p>Reorder and/or duplicate and/or drop video frames.
  37384. </p>
  37385. <p>It accepts the following parameters:
  37386. </p>
  37387. <dl class="table">
  37388. <dt><samp class="option">mapping</samp></dt>
  37389. <dd><p>Set the destination indexes of input frames.
  37390. This is space or &rsquo;|&rsquo; separated list of indexes that maps input frames to output
  37391. frames. Number of indexes also sets maximal value that each index may have.
  37392. &rsquo;-1&rsquo; index have special meaning and that is to drop frame.
  37393. </p></dd>
  37394. </dl>
  37395. <p>The first frame has the index 0. The default is to keep the input unchanged.
  37396. </p>
  37397. <a name="Examples-135"></a>
  37398. <h4 class="subsection">32.227.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-135" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-135" aria-hidden="true">TOC</a></span></h4>
  37399. <ul class="itemize mark-bullet">
  37400. <li>Swap second and third frame of every three frames of the input:
  37401. <div class="example">
  37402. <pre class="example-preformatted">ffmpeg -i INPUT -vf &quot;shuffleframes=0 2 1&quot; OUTPUT
  37403. </pre></div>
  37404. </li><li>Swap 10th and 1st frame of every ten frames of the input:
  37405. <div class="example">
  37406. <pre class="example-preformatted">ffmpeg -i INPUT -vf &quot;shuffleframes=9 1 2 3 4 5 6 7 8 0&quot; OUTPUT
  37407. </pre></div>
  37408. </li></ul>
  37409. <a name="shufflepixels"></a>
  37410. <h3 class="section">32.228 shufflepixels<span class="pull-right"><a class="anchor hidden-xs" href="#shufflepixels" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shufflepixels" aria-hidden="true">TOC</a></span></h3>
  37411. <p>Reorder pixels in video frames.
  37412. </p>
  37413. <p>This filter accepts the following options:
  37414. </p>
  37415. <dl class="table">
  37416. <dt><samp class="option">direction, d</samp></dt>
  37417. <dd><p>Set shuffle direction. Can be forward or inverse direction.
  37418. Default direction is forward.
  37419. </p>
  37420. </dd>
  37421. <dt><samp class="option">mode, m</samp></dt>
  37422. <dd><p>Set shuffle mode. Can be horizontal, vertical or block mode.
  37423. </p>
  37424. </dd>
  37425. <dt><samp class="option">width, w</samp></dt>
  37426. <dt><samp class="option">height, h</samp></dt>
  37427. <dd><p>Set shuffle block_size. In case of horizontal shuffle mode only width
  37428. part of size is used, and in case of vertical shuffle mode only height
  37429. part of size is used.
  37430. </p>
  37431. </dd>
  37432. <dt><samp class="option">seed, s</samp></dt>
  37433. <dd><p>Set random seed used with shuffling pixels. Mainly useful to set to be able
  37434. to reverse filtering process to get original input.
  37435. For example, to reverse forward shuffle you need to use same parameters
  37436. and exact same seed and to set direction to inverse.
  37437. </p></dd>
  37438. </dl>
  37439. <a name="shuffleplanes"></a>
  37440. <h3 class="section">32.229 shuffleplanes<span class="pull-right"><a class="anchor hidden-xs" href="#shuffleplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shuffleplanes" aria-hidden="true">TOC</a></span></h3>
  37441. <p>Reorder and/or duplicate video planes.
  37442. </p>
  37443. <p>It accepts the following parameters:
  37444. </p>
  37445. <dl class="table">
  37446. <dt><samp class="option">map0</samp></dt>
  37447. <dd><p>The index of the input plane to be used as the first output plane.
  37448. </p>
  37449. </dd>
  37450. <dt><samp class="option">map1</samp></dt>
  37451. <dd><p>The index of the input plane to be used as the second output plane.
  37452. </p>
  37453. </dd>
  37454. <dt><samp class="option">map2</samp></dt>
  37455. <dd><p>The index of the input plane to be used as the third output plane.
  37456. </p>
  37457. </dd>
  37458. <dt><samp class="option">map3</samp></dt>
  37459. <dd><p>The index of the input plane to be used as the fourth output plane.
  37460. </p>
  37461. </dd>
  37462. </dl>
  37463. <p>The first plane has the index 0. The default is to keep the input unchanged.
  37464. </p>
  37465. <a name="Examples-136"></a>
  37466. <h4 class="subsection">32.229.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-136" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-136" aria-hidden="true">TOC</a></span></h4>
  37467. <ul class="itemize mark-bullet">
  37468. <li>Swap the second and third planes of the input:
  37469. <div class="example">
  37470. <pre class="example-preformatted">ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
  37471. </pre></div>
  37472. </li></ul>
  37473. <a class="anchor" id="signalstats"></a><a name="signalstats-1"></a>
  37474. <h3 class="section">32.230 signalstats<span class="pull-right"><a class="anchor hidden-xs" href="#signalstats-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-signalstats-1" aria-hidden="true">TOC</a></span></h3>
  37475. <p>Evaluate various visual metrics that assist in determining issues associated
  37476. with the digitization of analog video media.
  37477. </p>
  37478. <p>By default the filter will log these metadata values:
  37479. </p>
  37480. <dl class="table">
  37481. <dt><samp class="option">YMIN</samp></dt>
  37482. <dd><p>Display the minimal Y value contained within the input frame. Expressed in
  37483. range of [0-255].
  37484. </p>
  37485. </dd>
  37486. <dt><samp class="option">YLOW</samp></dt>
  37487. <dd><p>Display the Y value at the 10% percentile within the input frame. Expressed in
  37488. range of [0-255].
  37489. </p>
  37490. </dd>
  37491. <dt><samp class="option">YAVG</samp></dt>
  37492. <dd><p>Display the average Y value within the input frame. Expressed in range of
  37493. [0-255].
  37494. </p>
  37495. </dd>
  37496. <dt><samp class="option">YHIGH</samp></dt>
  37497. <dd><p>Display the Y value at the 90% percentile within the input frame. Expressed in
  37498. range of [0-255].
  37499. </p>
  37500. </dd>
  37501. <dt><samp class="option">YMAX</samp></dt>
  37502. <dd><p>Display the maximum Y value contained within the input frame. Expressed in
  37503. range of [0-255].
  37504. </p>
  37505. </dd>
  37506. <dt><samp class="option">UMIN</samp></dt>
  37507. <dd><p>Display the minimal U value contained within the input frame. Expressed in
  37508. range of [0-255].
  37509. </p>
  37510. </dd>
  37511. <dt><samp class="option">ULOW</samp></dt>
  37512. <dd><p>Display the U value at the 10% percentile within the input frame. Expressed in
  37513. range of [0-255].
  37514. </p>
  37515. </dd>
  37516. <dt><samp class="option">UAVG</samp></dt>
  37517. <dd><p>Display the average U value within the input frame. Expressed in range of
  37518. [0-255].
  37519. </p>
  37520. </dd>
  37521. <dt><samp class="option">UHIGH</samp></dt>
  37522. <dd><p>Display the U value at the 90% percentile within the input frame. Expressed in
  37523. range of [0-255].
  37524. </p>
  37525. </dd>
  37526. <dt><samp class="option">UMAX</samp></dt>
  37527. <dd><p>Display the maximum U value contained within the input frame. Expressed in
  37528. range of [0-255].
  37529. </p>
  37530. </dd>
  37531. <dt><samp class="option">VMIN</samp></dt>
  37532. <dd><p>Display the minimal V value contained within the input frame. Expressed in
  37533. range of [0-255].
  37534. </p>
  37535. </dd>
  37536. <dt><samp class="option">VLOW</samp></dt>
  37537. <dd><p>Display the V value at the 10% percentile within the input frame. Expressed in
  37538. range of [0-255].
  37539. </p>
  37540. </dd>
  37541. <dt><samp class="option">VAVG</samp></dt>
  37542. <dd><p>Display the average V value within the input frame. Expressed in range of
  37543. [0-255].
  37544. </p>
  37545. </dd>
  37546. <dt><samp class="option">VHIGH</samp></dt>
  37547. <dd><p>Display the V value at the 90% percentile within the input frame. Expressed in
  37548. range of [0-255].
  37549. </p>
  37550. </dd>
  37551. <dt><samp class="option">VMAX</samp></dt>
  37552. <dd><p>Display the maximum V value contained within the input frame. Expressed in
  37553. range of [0-255].
  37554. </p>
  37555. </dd>
  37556. <dt><samp class="option">SATMIN</samp></dt>
  37557. <dd><p>Display the minimal saturation value contained within the input frame.
  37558. Expressed in range of [0-~181.02].
  37559. </p>
  37560. </dd>
  37561. <dt><samp class="option">SATLOW</samp></dt>
  37562. <dd><p>Display the saturation value at the 10% percentile within the input frame.
  37563. Expressed in range of [0-~181.02].
  37564. </p>
  37565. </dd>
  37566. <dt><samp class="option">SATAVG</samp></dt>
  37567. <dd><p>Display the average saturation value within the input frame. Expressed in range
  37568. of [0-~181.02].
  37569. </p>
  37570. </dd>
  37571. <dt><samp class="option">SATHIGH</samp></dt>
  37572. <dd><p>Display the saturation value at the 90% percentile within the input frame.
  37573. Expressed in range of [0-~181.02].
  37574. </p>
  37575. </dd>
  37576. <dt><samp class="option">SATMAX</samp></dt>
  37577. <dd><p>Display the maximum saturation value contained within the input frame.
  37578. Expressed in range of [0-~181.02].
  37579. </p>
  37580. </dd>
  37581. <dt><samp class="option">HUEMED</samp></dt>
  37582. <dd><p>Display the median value for hue within the input frame. Expressed in range of
  37583. [0-360].
  37584. </p>
  37585. </dd>
  37586. <dt><samp class="option">HUEAVG</samp></dt>
  37587. <dd><p>Display the average value for hue within the input frame. Expressed in range of
  37588. [0-360].
  37589. </p>
  37590. </dd>
  37591. <dt><samp class="option">YDIF</samp></dt>
  37592. <dd><p>Display the average of sample value difference between all values of the Y
  37593. plane in the current frame and corresponding values of the previous input frame.
  37594. Expressed in range of [0-255].
  37595. </p>
  37596. </dd>
  37597. <dt><samp class="option">UDIF</samp></dt>
  37598. <dd><p>Display the average of sample value difference between all values of the U
  37599. plane in the current frame and corresponding values of the previous input frame.
  37600. Expressed in range of [0-255].
  37601. </p>
  37602. </dd>
  37603. <dt><samp class="option">VDIF</samp></dt>
  37604. <dd><p>Display the average of sample value difference between all values of the V
  37605. plane in the current frame and corresponding values of the previous input frame.
  37606. Expressed in range of [0-255].
  37607. </p>
  37608. </dd>
  37609. <dt><samp class="option">YBITDEPTH</samp></dt>
  37610. <dd><p>Display bit depth of Y plane in current frame.
  37611. Expressed in range of [0-16].
  37612. </p>
  37613. </dd>
  37614. <dt><samp class="option">UBITDEPTH</samp></dt>
  37615. <dd><p>Display bit depth of U plane in current frame.
  37616. Expressed in range of [0-16].
  37617. </p>
  37618. </dd>
  37619. <dt><samp class="option">VBITDEPTH</samp></dt>
  37620. <dd><p>Display bit depth of V plane in current frame.
  37621. Expressed in range of [0-16].
  37622. </p></dd>
  37623. </dl>
  37624. <p>The filter accepts the following options:
  37625. </p>
  37626. <dl class="table">
  37627. <dt><samp class="option">stat</samp></dt>
  37628. <dt><samp class="option">out</samp></dt>
  37629. <dd>
  37630. <p><samp class="option">stat</samp> specify an additional form of image analysis.
  37631. <samp class="option">out</samp> output video with the specified type of pixel highlighted.
  37632. </p>
  37633. <p>Both options accept the following values:
  37634. </p>
  37635. <dl class="table">
  37636. <dt>&lsquo;<samp class="samp">tout</samp>&rsquo;</dt>
  37637. <dd><p>Identify <var class="var">temporal outliers</var> pixels. A <var class="var">temporal outlier</var> is a pixel
  37638. unlike the neighboring pixels of the same field. Examples of temporal outliers
  37639. include the results of video dropouts, head clogs, or tape tracking issues.
  37640. </p>
  37641. </dd>
  37642. <dt>&lsquo;<samp class="samp">vrep</samp>&rsquo;</dt>
  37643. <dd><p>Identify <var class="var">vertical line repetition</var>. Vertical line repetition includes
  37644. similar rows of pixels within a frame. In born-digital video vertical line
  37645. repetition is common, but this pattern is uncommon in video digitized from an
  37646. analog source. When it occurs in video that results from the digitization of an
  37647. analog source it can indicate concealment from a dropout compensator.
  37648. </p>
  37649. </dd>
  37650. <dt>&lsquo;<samp class="samp">brng</samp>&rsquo;</dt>
  37651. <dd><p>Identify pixels that fall outside of legal broadcast range.
  37652. </p></dd>
  37653. </dl>
  37654. </dd>
  37655. <dt><samp class="option">color, c</samp></dt>
  37656. <dd><p>Set the highlight color for the <samp class="option">out</samp> option. The default color is
  37657. yellow.
  37658. </p></dd>
  37659. </dl>
  37660. <a name="Examples-137"></a>
  37661. <h4 class="subsection">32.230.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-137" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-137" aria-hidden="true">TOC</a></span></h4>
  37662. <ul class="itemize mark-bullet">
  37663. <li>Output data of various video metrics:
  37664. <div class="example">
  37665. <pre class="example-preformatted">ffprobe -f lavfi movie=example.mov,signalstats=&quot;stat=tout+vrep+brng&quot; -show_frames
  37666. </pre></div>
  37667. </li><li>Output specific data about the minimum and maximum values of the Y plane per frame:
  37668. <div class="example">
  37669. <pre class="example-preformatted">ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
  37670. </pre></div>
  37671. </li><li>Playback video while highlighting pixels that are outside of broadcast range in red.
  37672. <div class="example">
  37673. <pre class="example-preformatted">ffplay example.mov -vf signalstats=&quot;out=brng:color=red&quot;
  37674. </pre></div>
  37675. </li><li>Playback video with signalstats metadata drawn over the frame.
  37676. <div class="example">
  37677. <pre class="example-preformatted">ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
  37678. </pre></div>
  37679. <p>The contents of signalstat_drawtext.txt used in the command are:
  37680. </p><div class="example">
  37681. <pre class="example-preformatted">time %{pts:hms}
  37682. Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
  37683. U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
  37684. V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
  37685. saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
  37686. </pre></div>
  37687. </li></ul>
  37688. <a class="anchor" id="signature"></a><a name="signature-1"></a>
  37689. <h3 class="section">32.231 signature<span class="pull-right"><a class="anchor hidden-xs" href="#signature-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-signature-1" aria-hidden="true">TOC</a></span></h3>
  37690. <p>Calculates the MPEG-7 Video Signature. The filter can handle more than one
  37691. input. In this case the matching between the inputs can be calculated additionally.
  37692. The filter always passes through the first input. The signature of each stream can
  37693. be written into a file.
  37694. </p>
  37695. <p>It accepts the following options:
  37696. </p>
  37697. <dl class="table">
  37698. <dt><samp class="option">detectmode</samp></dt>
  37699. <dd><p>Enable or disable the matching process.
  37700. </p>
  37701. <p>Available values are:
  37702. </p>
  37703. <dl class="table">
  37704. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  37705. <dd><p>Disable the calculation of a matching (default).
  37706. </p></dd>
  37707. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  37708. <dd><p>Calculate the matching for the whole video and output whether the whole video
  37709. matches or only parts.
  37710. </p></dd>
  37711. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  37712. <dd><p>Calculate only until a matching is found or the video ends. Should be faster in
  37713. some cases.
  37714. </p></dd>
  37715. </dl>
  37716. </dd>
  37717. <dt><samp class="option">nb_inputs</samp></dt>
  37718. <dd><p>Set the number of inputs. The option value must be a non negative integer.
  37719. Default value is 1.
  37720. </p>
  37721. </dd>
  37722. <dt><samp class="option">filename</samp></dt>
  37723. <dd><p>Set the path to which the output is written. If there is more than one input,
  37724. the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive
  37725. integer), that will be replaced with the input number. If no filename is
  37726. specified, no output will be written. This is the default.
  37727. </p>
  37728. </dd>
  37729. <dt><samp class="option">format</samp></dt>
  37730. <dd><p>Choose the output format.
  37731. </p>
  37732. <p>Available values are:
  37733. </p>
  37734. <dl class="table">
  37735. <dt>&lsquo;<samp class="samp">binary</samp>&rsquo;</dt>
  37736. <dd><p>Use the specified binary representation (default).
  37737. </p></dd>
  37738. <dt>&lsquo;<samp class="samp">xml</samp>&rsquo;</dt>
  37739. <dd><p>Use the specified xml representation.
  37740. </p></dd>
  37741. </dl>
  37742. </dd>
  37743. <dt><samp class="option">th_d</samp></dt>
  37744. <dd><p>Set threshold to detect one word as similar. The option value must be an integer
  37745. greater than zero. The default value is 9000.
  37746. </p>
  37747. </dd>
  37748. <dt><samp class="option">th_dc</samp></dt>
  37749. <dd><p>Set threshold to detect all words as similar. The option value must be an integer
  37750. greater than zero. The default value is 60000.
  37751. </p>
  37752. </dd>
  37753. <dt><samp class="option">th_xh</samp></dt>
  37754. <dd><p>Set threshold to detect frames as similar. The option value must be an integer
  37755. greater than zero. The default value is 116.
  37756. </p>
  37757. </dd>
  37758. <dt><samp class="option">th_di</samp></dt>
  37759. <dd><p>Set the minimum length of a sequence in frames to recognize it as matching
  37760. sequence. The option value must be a non negative integer value.
  37761. The default value is 0.
  37762. </p>
  37763. </dd>
  37764. <dt><samp class="option">th_it</samp></dt>
  37765. <dd><p>Set the minimum relation, that matching frames to all frames must have.
  37766. The option value must be a double value between 0 and 1. The default value is 0.5.
  37767. </p></dd>
  37768. </dl>
  37769. <a name="Examples-138"></a>
  37770. <h4 class="subsection">32.231.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-138" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-138" aria-hidden="true">TOC</a></span></h4>
  37771. <ul class="itemize mark-bullet">
  37772. <li>To calculate the signature of an input video and store it in signature.bin:
  37773. <div class="example">
  37774. <pre class="example-preformatted">ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
  37775. </pre></div>
  37776. </li><li>To detect whether two videos match and store the signatures in XML format in
  37777. signature0.xml and signature1.xml:
  37778. <div class="example">
  37779. <pre class="example-preformatted">ffmpeg -i input1.mkv -i input2.mkv -filter_complex &quot;[0:v][1:v] signature=nb_inputs=2:detectmode=full:format=xml:filename=signature%d.xml&quot; -map :v -f null -
  37780. </pre></div>
  37781. </li></ul>
  37782. <a class="anchor" id="siti"></a><a name="siti-1"></a>
  37783. <h3 class="section">32.232 siti<span class="pull-right"><a class="anchor hidden-xs" href="#siti-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-siti-1" aria-hidden="true">TOC</a></span></h3>
  37784. <p>Calculate Spatial Information (SI) and Temporal Information (TI) scores for a video,
  37785. as defined in ITU-T Rec. P.910 (11/21): Subjective video quality assessment methods
  37786. for multimedia applications. Available PDF at <a class="url" href="https://www.itu.int/rec/T-REC-P.910-202111-S/en">https://www.itu.int/rec/T-REC-P.910-202111-S/en</a>.
  37787. Note that this is a legacy implementation that corresponds to a superseded recommendation.
  37788. Refer to ITU-T Rec. P.910 (07/22) for the latest version: <a class="url" href="https://www.itu.int/rec/T-REC-P.910-202207-I/en">https://www.itu.int/rec/T-REC-P.910-202207-I/en</a>
  37789. </p>
  37790. <p>It accepts the following option:
  37791. </p>
  37792. <dl class="table">
  37793. <dt><samp class="option">print_summary</samp></dt>
  37794. <dd><p>If set to 1, Summary statistics will be printed to the console. Default 0.
  37795. </p></dd>
  37796. </dl>
  37797. <a name="Examples-139"></a>
  37798. <h4 class="subsection">32.232.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-139" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-139" aria-hidden="true">TOC</a></span></h4>
  37799. <ul class="itemize mark-bullet">
  37800. <li>To calculate SI/TI metrics and print summary:
  37801. <div class="example">
  37802. <pre class="example-preformatted">ffmpeg -i input.mp4 -vf siti=print_summary=1 -f null -
  37803. </pre></div>
  37804. </li></ul>
  37805. <a class="anchor" id="smartblur"></a><a name="smartblur-1"></a>
  37806. <h3 class="section">32.233 smartblur<span class="pull-right"><a class="anchor hidden-xs" href="#smartblur-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smartblur-1" aria-hidden="true">TOC</a></span></h3>
  37807. <p>Blur the input video without impacting the outlines.
  37808. </p>
  37809. <p>It accepts the following options:
  37810. </p>
  37811. <dl class="table">
  37812. <dt><samp class="option">luma_radius, lr</samp></dt>
  37813. <dd><p>Set the luma radius. The option value must be a float number in
  37814. the range [0.1,5.0] that specifies the variance of the gaussian filter
  37815. used to blur the image (slower if larger). Default value is 1.0.
  37816. </p>
  37817. </dd>
  37818. <dt><samp class="option">luma_strength, ls</samp></dt>
  37819. <dd><p>Set the luma strength. The option value must be a float number
  37820. in the range [-1.0,1.0] that configures the blurring. A value included
  37821. in [0.0,1.0] will blur the image whereas a value included in
  37822. [-1.0,0.0] will sharpen the image. Default value is 1.0.
  37823. </p>
  37824. </dd>
  37825. <dt><samp class="option">luma_threshold, lt</samp></dt>
  37826. <dd><p>Set the luma threshold used as a coefficient to determine
  37827. whether a pixel should be blurred or not. The option value must be an
  37828. integer in the range [-30,30]. A value of 0 will filter all the image,
  37829. a value included in [0,30] will filter flat areas and a value included
  37830. in [-30,0] will filter edges. Default value is 0.
  37831. </p>
  37832. </dd>
  37833. <dt><samp class="option">chroma_radius, cr</samp></dt>
  37834. <dd><p>Set the chroma radius. The option value must be a float number in
  37835. the range [0.1,5.0] that specifies the variance of the gaussian filter
  37836. used to blur the image (slower if larger). Default value is <samp class="option">luma_radius</samp>.
  37837. </p>
  37838. </dd>
  37839. <dt><samp class="option">chroma_strength, cs</samp></dt>
  37840. <dd><p>Set the chroma strength. The option value must be a float number
  37841. in the range [-1.0,1.0] that configures the blurring. A value included
  37842. in [0.0,1.0] will blur the image whereas a value included in
  37843. [-1.0,0.0] will sharpen the image. Default value is <samp class="option">luma_strength</samp>.
  37844. </p>
  37845. </dd>
  37846. <dt><samp class="option">chroma_threshold, ct</samp></dt>
  37847. <dd><p>Set the chroma threshold used as a coefficient to determine
  37848. whether a pixel should be blurred or not. The option value must be an
  37849. integer in the range [-30,30]. A value of 0 will filter all the image,
  37850. a value included in [0,30] will filter flat areas and a value included
  37851. in [-30,0] will filter edges. Default value is <samp class="option">luma_threshold</samp>.
  37852. </p>
  37853. </dd>
  37854. <dt><samp class="option">alpha_radius, ar</samp></dt>
  37855. <dd><p>Set the alpha radius. The option value must be a float number in
  37856. the range [0.1,5.0] that specifies the variance of the gaussian filter
  37857. used to blur the image (slower if larger). Default value is <samp class="option">luma_radius</samp>.
  37858. </p>
  37859. </dd>
  37860. <dt><samp class="option">alpha_strength, as</samp></dt>
  37861. <dd><p>Set the alpha strength. The option value must be a float number
  37862. in the range [-1.0,1.0] that configures the blurring. A value included
  37863. in [0.0,1.0] will blur the image whereas a value included in
  37864. [-1.0,0.0] will sharpen the image. Default value is <samp class="option">luma_strength</samp>.
  37865. </p>
  37866. </dd>
  37867. <dt><samp class="option">alpha_threshold, at</samp></dt>
  37868. <dd><p>Set the alpha threshold used as a coefficient to determine
  37869. whether a pixel should be blurred or not. The option value must be an
  37870. integer in the range [-30,30]. A value of 0 will filter all the image,
  37871. a value included in [0,30] will filter flat areas and a value included
  37872. in [-30,0] will filter edges. Default value is <samp class="option">luma_threshold</samp>.
  37873. </p></dd>
  37874. </dl>
  37875. <p>If a chroma or alpha option is not explicitly set, the corresponding luma value
  37876. is set.
  37877. </p>
  37878. <a name="sobel"></a>
  37879. <h3 class="section">32.234 sobel<span class="pull-right"><a class="anchor hidden-xs" href="#sobel" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sobel" aria-hidden="true">TOC</a></span></h3>
  37880. <p>Apply sobel operator to input video stream.
  37881. </p>
  37882. <p>The filter accepts the following option:
  37883. </p>
  37884. <dl class="table">
  37885. <dt><samp class="option">planes</samp></dt>
  37886. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  37887. By default value 0xf, all planes will be processed.
  37888. </p>
  37889. </dd>
  37890. <dt><samp class="option">scale</samp></dt>
  37891. <dd><p>Set value which will be multiplied with filtered result.
  37892. </p>
  37893. </dd>
  37894. <dt><samp class="option">delta</samp></dt>
  37895. <dd><p>Set value which will be added to filtered result.
  37896. </p></dd>
  37897. </dl>
  37898. <a name="Commands-142"></a>
  37899. <h4 class="subsection">32.234.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-142" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-142" aria-hidden="true">TOC</a></span></h4>
  37900. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37901. </p>
  37902. <a class="anchor" id="spp"></a><a name="spp-1"></a>
  37903. <h3 class="section">32.235 spp<span class="pull-right"><a class="anchor hidden-xs" href="#spp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-spp-1" aria-hidden="true">TOC</a></span></h3>
  37904. <p>Apply a simple postprocessing filter that compresses and decompresses the image
  37905. at several (or - in the case of <samp class="option">quality</samp> level <code class="code">6</code> - all) shifts
  37906. and average the results.
  37907. </p>
  37908. <p>The filter accepts the following options:
  37909. </p>
  37910. <dl class="table">
  37911. <dt><samp class="option">quality</samp></dt>
  37912. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  37913. an integer in the range 0-6. If set to <code class="code">0</code>, the filter will have no
  37914. effect. A value of <code class="code">6</code> means the higher quality. For each increment of
  37915. that value the speed drops by a factor of approximately 2. Default value is
  37916. <code class="code">3</code>.
  37917. </p>
  37918. </dd>
  37919. <dt><samp class="option">qp</samp></dt>
  37920. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  37921. from the video stream (if available).
  37922. </p>
  37923. </dd>
  37924. <dt><samp class="option">mode</samp></dt>
  37925. <dd><p>Set thresholding mode. Available modes are:
  37926. </p>
  37927. <dl class="table">
  37928. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  37929. <dd><p>Set hard thresholding (default).
  37930. </p></dd>
  37931. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  37932. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  37933. </p></dd>
  37934. </dl>
  37935. </dd>
  37936. <dt><samp class="option">use_bframe_qp</samp></dt>
  37937. <dd><p>Enable the use of the QP from the B-Frames if set to <code class="code">1</code>. Using this
  37938. option may cause flicker since the B-Frames have often larger QP. Default is
  37939. <code class="code">0</code> (not enabled).
  37940. </p></dd>
  37941. </dl>
  37942. <a name="Commands-143"></a>
  37943. <h4 class="subsection">32.235.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-143" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-143" aria-hidden="true">TOC</a></span></h4>
  37944. <p>This filter supports the following commands:
  37945. </p><dl class="table">
  37946. <dt><samp class="option">quality, level</samp></dt>
  37947. <dd><p>Set quality level. The value <code class="code">max</code> can be used to set the maximum level,
  37948. currently <code class="code">6</code>.
  37949. </p></dd>
  37950. </dl>
  37951. <a class="anchor" id="sr"></a><a name="sr-1"></a>
  37952. <h3 class="section">32.236 sr<span class="pull-right"><a class="anchor hidden-xs" href="#sr-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sr-1" aria-hidden="true">TOC</a></span></h3>
  37953. <p>Scale the input by applying one of the super-resolution methods based on
  37954. convolutional neural networks. Supported models:
  37955. </p>
  37956. <ul class="itemize mark-bullet">
  37957. <li>Super-Resolution Convolutional Neural Network model (SRCNN).
  37958. See <a class="url" href="https://arxiv.org/abs/1501.00092">https://arxiv.org/abs/1501.00092</a>.
  37959. </li><li>Efficient Sub-Pixel Convolutional Neural Network model (ESPCN).
  37960. See <a class="url" href="https://arxiv.org/abs/1609.05158">https://arxiv.org/abs/1609.05158</a>.
  37961. </li></ul>
  37962. <p>Training scripts as well as scripts for model file (.pb) saving can be found at
  37963. <a class="url" href="https://github.com/XueweiMeng/sr/tree/sr_dnn_native">https://github.com/XueweiMeng/sr/tree/sr_dnn_native</a>. Original repository
  37964. is at <a class="url" href="https://github.com/HighVoltageRocknRoll/sr.git">https://github.com/HighVoltageRocknRoll/sr.git</a>.
  37965. </p>
  37966. <p>The filter accepts the following options:
  37967. </p>
  37968. <dl class="table">
  37969. <dt><samp class="option">dnn_backend</samp></dt>
  37970. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  37971. the following values:
  37972. </p>
  37973. <dl class="table">
  37974. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  37975. <dd><p>TensorFlow backend. To enable this backend you
  37976. need to install the TensorFlow for C library (see
  37977. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  37978. <code class="code">--enable-libtensorflow</code>
  37979. </p></dd>
  37980. </dl>
  37981. </dd>
  37982. <dt><samp class="option">model</samp></dt>
  37983. <dd><p>Set path to model file specifying network architecture and its parameters.
  37984. Note that different backends use different file formats. TensorFlow, OpenVINO backend
  37985. can load files for only its format.
  37986. </p>
  37987. </dd>
  37988. <dt><samp class="option">scale_factor</samp></dt>
  37989. <dd><p>Set scale factor for SRCNN model. Allowed values are <code class="code">2</code>, <code class="code">3</code> and <code class="code">4</code>.
  37990. Default value is <code class="code">2</code>. Scale factor is necessary for SRCNN model, because it accepts
  37991. input upscaled using bicubic upscaling with proper scale factor.
  37992. </p></dd>
  37993. </dl>
  37994. <p>To get full functionality (such as async execution), please use the <a class="ref" href="#dnn_005fprocessing">dnn_processing</a> filter.
  37995. </p>
  37996. <a class="anchor" id="sr_005famf"></a><a name="sr_005famf-1"></a>
  37997. <h3 class="section">32.237 sr_amf<span class="pull-right"><a class="anchor hidden-xs" href="#sr_005famf-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sr_005famf-1" aria-hidden="true">TOC</a></span></h3>
  37998. <p>Upscale (size increasing) for the input video using AMD Advanced Media Framework library for hardware acceleration.
  37999. Use advanced algorithms for upscaling with higher output quality.
  38000. Setting the output width and height works in the same way as for the <a class="ref" href="#scale">scale</a> filter.
  38001. </p>
  38002. <p>The filter accepts the following options:
  38003. </p><dl class="table">
  38004. <dt><samp class="option">w</samp></dt>
  38005. <dt><samp class="option">h</samp></dt>
  38006. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  38007. </p>
  38008. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  38009. </p>
  38010. </dd>
  38011. <dt><samp class="option">algorithm</samp></dt>
  38012. <dd><p>Sets the algorithm used for scaling:
  38013. </p>
  38014. <dl class="table">
  38015. <dt><var class="var">bilinear</var></dt>
  38016. <dd><p>Bilinear
  38017. </p>
  38018. </dd>
  38019. <dt><var class="var">bicubic</var></dt>
  38020. <dd><p>Bicubic
  38021. </p>
  38022. </dd>
  38023. <dt><var class="var">sr1-0</var></dt>
  38024. <dd><p>Video SR1.0
  38025. This is a default value
  38026. </p>
  38027. </dd>
  38028. <dt><var class="var">point</var></dt>
  38029. <dd><p>Point
  38030. </p>
  38031. </dd>
  38032. <dt><var class="var">sr1-1</var></dt>
  38033. <dd><p>Video SR1.1
  38034. </p>
  38035. </dd>
  38036. </dl>
  38037. </dd>
  38038. <dt><samp class="option">sharpness</samp></dt>
  38039. <dd><p>Control hq scaler sharpening. The value is a float in the range of [0.0, 2.0]
  38040. </p>
  38041. </dd>
  38042. <dt><samp class="option">format</samp></dt>
  38043. <dd><p>Controls the output pixel format. By default, or if none is specified, the input
  38044. pixel format is used.
  38045. </p>
  38046. </dd>
  38047. <dt><samp class="option">keep-ratio</samp></dt>
  38048. <dd><p>Force the scaler to keep the aspect ratio of the input image when the output size has a different aspect ratio.
  38049. Default value is false.
  38050. </p>
  38051. </dd>
  38052. <dt><samp class="option">fill</samp></dt>
  38053. <dd><p>Specifies whether the output image outside the region of interest,
  38054. which does not fill the entire output surface should be filled with a solid color.
  38055. </p>
  38056. </dd>
  38057. </dl>
  38058. <a name="Examples-140"></a>
  38059. <h4 class="subsection">32.237.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-140" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-140" aria-hidden="true">TOC</a></span></h4>
  38060. <ul class="itemize mark-bullet">
  38061. <li>Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p.
  38062. <div class="example">
  38063. <pre class="example-preformatted">sr_amf=-2:720:format=yuv420p
  38064. </pre></div>
  38065. </li><li>Upscale to 4K with algorithm video SR1.1.
  38066. <div class="example">
  38067. <pre class="example-preformatted">sr_amf=4096:2160:algorithm=sr1-1
  38068. </pre></div>
  38069. </li></ul>
  38070. <a name="ssim"></a>
  38071. <h3 class="section">32.238 ssim<span class="pull-right"><a class="anchor hidden-xs" href="#ssim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ssim" aria-hidden="true">TOC</a></span></h3>
  38072. <p>Obtain the SSIM (Structural SImilarity Metric) between two input videos.
  38073. </p>
  38074. <p>This filter takes in input two input videos, the first input is
  38075. considered the &quot;main&quot; source and is passed unchanged to the
  38076. output. The second input is used as a &quot;reference&quot; video for computing
  38077. the SSIM.
  38078. </p>
  38079. <p>Both video inputs must have the same resolution and pixel format for
  38080. this filter to work correctly. Also it assumes that both inputs
  38081. have the same number of frames, which are compared one by one.
  38082. </p>
  38083. <p>The filter stores the calculated SSIM of each frame.
  38084. </p>
  38085. <p>The description of the accepted parameters follows.
  38086. </p>
  38087. <dl class="table">
  38088. <dt><samp class="option">stats_file, f</samp></dt>
  38089. <dd><p>If specified the filter will use the named file to save the SSIM of
  38090. each individual frame. When filename equals &quot;-&quot; the data is sent to
  38091. standard output.
  38092. </p></dd>
  38093. </dl>
  38094. <p>The file printed if <var class="var">stats_file</var> is selected, contains a sequence of
  38095. key/value pairs of the form <var class="var">key</var>:<var class="var">value</var> for each compared
  38096. couple of frames.
  38097. </p>
  38098. <p>A description of each shown parameter follows:
  38099. </p>
  38100. <dl class="table">
  38101. <dt><samp class="option">n</samp></dt>
  38102. <dd><p>sequential number of the input frame, starting from 1
  38103. </p>
  38104. </dd>
  38105. <dt><samp class="option">Y, U, V, R, G, B</samp></dt>
  38106. <dd><p>SSIM of the compared frames for the component specified by the suffix.
  38107. </p>
  38108. </dd>
  38109. <dt><samp class="option">All</samp></dt>
  38110. <dd><p>SSIM of the compared frames for the whole frame.
  38111. </p>
  38112. </dd>
  38113. <dt><samp class="option">dB</samp></dt>
  38114. <dd><p>Same as above but in dB representation.
  38115. </p></dd>
  38116. </dl>
  38117. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  38118. </p>
  38119. <a name="Examples-141"></a>
  38120. <h4 class="subsection">32.238.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-141" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-141" aria-hidden="true">TOC</a></span></h4>
  38121. <ul class="itemize mark-bullet">
  38122. <li>For example:
  38123. <div class="example">
  38124. <pre class="example-preformatted">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  38125. [main][ref] ssim=&quot;stats_file=stats.log&quot; [out]
  38126. </pre></div>
  38127. <p>On this example the input file being processed is compared with the
  38128. reference file <samp class="file">ref_movie.mpg</samp>. The SSIM of each individual frame
  38129. is stored in <samp class="file">stats.log</samp>.
  38130. </p>
  38131. </li><li>Another example with both psnr and ssim at same time:
  38132. <div class="example">
  38133. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi &quot;ssim;[0:v][1:v]psnr&quot; -f null -
  38134. </pre></div>
  38135. </li><li>Another example with different containers:
  38136. <div class="example">
  38137. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mkv -lavfi &quot;[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]ssim&quot; -f null -
  38138. </pre></div>
  38139. </li></ul>
  38140. <a name="stereo3d"></a>
  38141. <h3 class="section">32.239 stereo3d<span class="pull-right"><a class="anchor hidden-xs" href="#stereo3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-stereo3d" aria-hidden="true">TOC</a></span></h3>
  38142. <p>Convert between different stereoscopic image formats.
  38143. </p>
  38144. <p>The filters accept the following options:
  38145. </p>
  38146. <dl class="table">
  38147. <dt><samp class="option">in</samp></dt>
  38148. <dd><p>Set stereoscopic image format of input.
  38149. </p>
  38150. <p>Available values for input image formats are:
  38151. </p><dl class="table">
  38152. <dt>&lsquo;<samp class="samp">sbsl</samp>&rsquo;</dt>
  38153. <dd><p>side by side parallel (left eye left, right eye right)
  38154. </p>
  38155. </dd>
  38156. <dt>&lsquo;<samp class="samp">sbsr</samp>&rsquo;</dt>
  38157. <dd><p>side by side crosseye (right eye left, left eye right)
  38158. </p>
  38159. </dd>
  38160. <dt>&lsquo;<samp class="samp">sbs2l</samp>&rsquo;</dt>
  38161. <dd><p>side by side parallel with half width resolution
  38162. (left eye left, right eye right)
  38163. </p>
  38164. </dd>
  38165. <dt>&lsquo;<samp class="samp">sbs2r</samp>&rsquo;</dt>
  38166. <dd><p>side by side crosseye with half width resolution
  38167. (right eye left, left eye right)
  38168. </p>
  38169. </dd>
  38170. <dt>&lsquo;<samp class="samp">abl</samp>&rsquo;</dt>
  38171. <dt>&lsquo;<samp class="samp">tbl</samp>&rsquo;</dt>
  38172. <dd><p>above-below (left eye above, right eye below)
  38173. </p>
  38174. </dd>
  38175. <dt>&lsquo;<samp class="samp">abr</samp>&rsquo;</dt>
  38176. <dt>&lsquo;<samp class="samp">tbr</samp>&rsquo;</dt>
  38177. <dd><p>above-below (right eye above, left eye below)
  38178. </p>
  38179. </dd>
  38180. <dt>&lsquo;<samp class="samp">ab2l</samp>&rsquo;</dt>
  38181. <dt>&lsquo;<samp class="samp">tb2l</samp>&rsquo;</dt>
  38182. <dd><p>above-below with half height resolution
  38183. (left eye above, right eye below)
  38184. </p>
  38185. </dd>
  38186. <dt>&lsquo;<samp class="samp">ab2r</samp>&rsquo;</dt>
  38187. <dt>&lsquo;<samp class="samp">tb2r</samp>&rsquo;</dt>
  38188. <dd><p>above-below with half height resolution
  38189. (right eye above, left eye below)
  38190. </p>
  38191. </dd>
  38192. <dt>&lsquo;<samp class="samp">al</samp>&rsquo;</dt>
  38193. <dd><p>alternating frames (left eye first, right eye second)
  38194. </p>
  38195. </dd>
  38196. <dt>&lsquo;<samp class="samp">ar</samp>&rsquo;</dt>
  38197. <dd><p>alternating frames (right eye first, left eye second)
  38198. </p>
  38199. </dd>
  38200. <dt>&lsquo;<samp class="samp">irl</samp>&rsquo;</dt>
  38201. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  38202. </p>
  38203. </dd>
  38204. <dt>&lsquo;<samp class="samp">irr</samp>&rsquo;</dt>
  38205. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  38206. </p>
  38207. </dd>
  38208. <dt>&lsquo;<samp class="samp">icl</samp>&rsquo;</dt>
  38209. <dd><p>interleaved columns, left eye first
  38210. </p>
  38211. </dd>
  38212. <dt>&lsquo;<samp class="samp">icr</samp>&rsquo;</dt>
  38213. <dd><p>interleaved columns, right eye first
  38214. </p>
  38215. <p>Default value is &lsquo;<samp class="samp">sbsl</samp>&rsquo;.
  38216. </p></dd>
  38217. </dl>
  38218. </dd>
  38219. <dt><samp class="option">out</samp></dt>
  38220. <dd><p>Set stereoscopic image format of output.
  38221. </p>
  38222. <dl class="table">
  38223. <dt>&lsquo;<samp class="samp">sbsl</samp>&rsquo;</dt>
  38224. <dd><p>side by side parallel (left eye left, right eye right)
  38225. </p>
  38226. </dd>
  38227. <dt>&lsquo;<samp class="samp">sbsr</samp>&rsquo;</dt>
  38228. <dd><p>side by side crosseye (right eye left, left eye right)
  38229. </p>
  38230. </dd>
  38231. <dt>&lsquo;<samp class="samp">sbs2l</samp>&rsquo;</dt>
  38232. <dd><p>side by side parallel with half width resolution
  38233. (left eye left, right eye right)
  38234. </p>
  38235. </dd>
  38236. <dt>&lsquo;<samp class="samp">sbs2r</samp>&rsquo;</dt>
  38237. <dd><p>side by side crosseye with half width resolution
  38238. (right eye left, left eye right)
  38239. </p>
  38240. </dd>
  38241. <dt>&lsquo;<samp class="samp">abl</samp>&rsquo;</dt>
  38242. <dt>&lsquo;<samp class="samp">tbl</samp>&rsquo;</dt>
  38243. <dd><p>above-below (left eye above, right eye below)
  38244. </p>
  38245. </dd>
  38246. <dt>&lsquo;<samp class="samp">abr</samp>&rsquo;</dt>
  38247. <dt>&lsquo;<samp class="samp">tbr</samp>&rsquo;</dt>
  38248. <dd><p>above-below (right eye above, left eye below)
  38249. </p>
  38250. </dd>
  38251. <dt>&lsquo;<samp class="samp">ab2l</samp>&rsquo;</dt>
  38252. <dt>&lsquo;<samp class="samp">tb2l</samp>&rsquo;</dt>
  38253. <dd><p>above-below with half height resolution
  38254. (left eye above, right eye below)
  38255. </p>
  38256. </dd>
  38257. <dt>&lsquo;<samp class="samp">ab2r</samp>&rsquo;</dt>
  38258. <dt>&lsquo;<samp class="samp">tb2r</samp>&rsquo;</dt>
  38259. <dd><p>above-below with half height resolution
  38260. (right eye above, left eye below)
  38261. </p>
  38262. </dd>
  38263. <dt>&lsquo;<samp class="samp">al</samp>&rsquo;</dt>
  38264. <dd><p>alternating frames (left eye first, right eye second)
  38265. </p>
  38266. </dd>
  38267. <dt>&lsquo;<samp class="samp">ar</samp>&rsquo;</dt>
  38268. <dd><p>alternating frames (right eye first, left eye second)
  38269. </p>
  38270. </dd>
  38271. <dt>&lsquo;<samp class="samp">irl</samp>&rsquo;</dt>
  38272. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  38273. </p>
  38274. </dd>
  38275. <dt>&lsquo;<samp class="samp">irr</samp>&rsquo;</dt>
  38276. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  38277. </p>
  38278. </dd>
  38279. <dt>&lsquo;<samp class="samp">arbg</samp>&rsquo;</dt>
  38280. <dd><p>anaglyph red/blue gray
  38281. (red filter on left eye, blue filter on right eye)
  38282. </p>
  38283. </dd>
  38284. <dt>&lsquo;<samp class="samp">argg</samp>&rsquo;</dt>
  38285. <dd><p>anaglyph red/green gray
  38286. (red filter on left eye, green filter on right eye)
  38287. </p>
  38288. </dd>
  38289. <dt>&lsquo;<samp class="samp">arcg</samp>&rsquo;</dt>
  38290. <dd><p>anaglyph red/cyan gray
  38291. (red filter on left eye, cyan filter on right eye)
  38292. </p>
  38293. </dd>
  38294. <dt>&lsquo;<samp class="samp">arch</samp>&rsquo;</dt>
  38295. <dd><p>anaglyph red/cyan half colored
  38296. (red filter on left eye, cyan filter on right eye)
  38297. </p>
  38298. </dd>
  38299. <dt>&lsquo;<samp class="samp">arcc</samp>&rsquo;</dt>
  38300. <dd><p>anaglyph red/cyan color
  38301. (red filter on left eye, cyan filter on right eye)
  38302. </p>
  38303. </dd>
  38304. <dt>&lsquo;<samp class="samp">arcd</samp>&rsquo;</dt>
  38305. <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
  38306. (red filter on left eye, cyan filter on right eye)
  38307. </p>
  38308. </dd>
  38309. <dt>&lsquo;<samp class="samp">agmg</samp>&rsquo;</dt>
  38310. <dd><p>anaglyph green/magenta gray
  38311. (green filter on left eye, magenta filter on right eye)
  38312. </p>
  38313. </dd>
  38314. <dt>&lsquo;<samp class="samp">agmh</samp>&rsquo;</dt>
  38315. <dd><p>anaglyph green/magenta half colored
  38316. (green filter on left eye, magenta filter on right eye)
  38317. </p>
  38318. </dd>
  38319. <dt>&lsquo;<samp class="samp">agmc</samp>&rsquo;</dt>
  38320. <dd><p>anaglyph green/magenta colored
  38321. (green filter on left eye, magenta filter on right eye)
  38322. </p>
  38323. </dd>
  38324. <dt>&lsquo;<samp class="samp">agmd</samp>&rsquo;</dt>
  38325. <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
  38326. (green filter on left eye, magenta filter on right eye)
  38327. </p>
  38328. </dd>
  38329. <dt>&lsquo;<samp class="samp">aybg</samp>&rsquo;</dt>
  38330. <dd><p>anaglyph yellow/blue gray
  38331. (yellow filter on left eye, blue filter on right eye)
  38332. </p>
  38333. </dd>
  38334. <dt>&lsquo;<samp class="samp">aybh</samp>&rsquo;</dt>
  38335. <dd><p>anaglyph yellow/blue half colored
  38336. (yellow filter on left eye, blue filter on right eye)
  38337. </p>
  38338. </dd>
  38339. <dt>&lsquo;<samp class="samp">aybc</samp>&rsquo;</dt>
  38340. <dd><p>anaglyph yellow/blue colored
  38341. (yellow filter on left eye, blue filter on right eye)
  38342. </p>
  38343. </dd>
  38344. <dt>&lsquo;<samp class="samp">aybd</samp>&rsquo;</dt>
  38345. <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
  38346. (yellow filter on left eye, blue filter on right eye)
  38347. </p>
  38348. </dd>
  38349. <dt>&lsquo;<samp class="samp">ml</samp>&rsquo;</dt>
  38350. <dd><p>mono output (left eye only)
  38351. </p>
  38352. </dd>
  38353. <dt>&lsquo;<samp class="samp">mr</samp>&rsquo;</dt>
  38354. <dd><p>mono output (right eye only)
  38355. </p>
  38356. </dd>
  38357. <dt>&lsquo;<samp class="samp">chl</samp>&rsquo;</dt>
  38358. <dd><p>checkerboard, left eye first
  38359. </p>
  38360. </dd>
  38361. <dt>&lsquo;<samp class="samp">chr</samp>&rsquo;</dt>
  38362. <dd><p>checkerboard, right eye first
  38363. </p>
  38364. </dd>
  38365. <dt>&lsquo;<samp class="samp">icl</samp>&rsquo;</dt>
  38366. <dd><p>interleaved columns, left eye first
  38367. </p>
  38368. </dd>
  38369. <dt>&lsquo;<samp class="samp">icr</samp>&rsquo;</dt>
  38370. <dd><p>interleaved columns, right eye first
  38371. </p>
  38372. </dd>
  38373. <dt>&lsquo;<samp class="samp">hdmi</samp>&rsquo;</dt>
  38374. <dd><p>HDMI frame pack
  38375. </p></dd>
  38376. </dl>
  38377. <p>Default value is &lsquo;<samp class="samp">arcd</samp>&rsquo;.
  38378. </p></dd>
  38379. </dl>
  38380. <a name="Examples-142"></a>
  38381. <h4 class="subsection">32.239.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-142" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-142" aria-hidden="true">TOC</a></span></h4>
  38382. <ul class="itemize mark-bullet">
  38383. <li>Convert input video from side by side parallel to anaglyph yellow/blue dubois:
  38384. <div class="example">
  38385. <pre class="example-preformatted">stereo3d=sbsl:aybd
  38386. </pre></div>
  38387. </li><li>Convert input video from above below (left eye above, right eye below) to side by side crosseye.
  38388. <div class="example">
  38389. <pre class="example-preformatted">stereo3d=abl:sbsr
  38390. </pre></div>
  38391. </li></ul>
  38392. <a name="streamselect_002c-astreamselect"></a>
  38393. <h3 class="section">32.240 streamselect, astreamselect<span class="pull-right"><a class="anchor hidden-xs" href="#streamselect_002c-astreamselect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-streamselect_002c-astreamselect" aria-hidden="true">TOC</a></span></h3>
  38394. <p>Select video or audio streams.
  38395. </p>
  38396. <p>The filter accepts the following options:
  38397. </p>
  38398. <dl class="table">
  38399. <dt><samp class="option">inputs</samp></dt>
  38400. <dd><p>Set number of inputs. Default is 2.
  38401. </p>
  38402. </dd>
  38403. <dt><samp class="option">map</samp></dt>
  38404. <dd><p>Set input indexes to remap to outputs.
  38405. </p></dd>
  38406. </dl>
  38407. <a name="Commands-144"></a>
  38408. <h4 class="subsection">32.240.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-144" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-144" aria-hidden="true">TOC</a></span></h4>
  38409. <p>The <code class="code">streamselect</code> and <code class="code">astreamselect</code> filter supports the following
  38410. commands:
  38411. </p>
  38412. <dl class="table">
  38413. <dt><samp class="option">map</samp></dt>
  38414. <dd><p>Set input indexes to remap to outputs.
  38415. </p></dd>
  38416. </dl>
  38417. <a name="Examples-143"></a>
  38418. <h4 class="subsection">32.240.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-143" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-143" aria-hidden="true">TOC</a></span></h4>
  38419. <ul class="itemize mark-bullet">
  38420. <li>Select first 5 seconds 1st stream and rest of time 2nd stream:
  38421. <div class="example">
  38422. <pre class="example-preformatted">sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
  38423. </pre></div>
  38424. </li><li>Same as above, but for audio:
  38425. <div class="example">
  38426. <pre class="example-preformatted">asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
  38427. </pre></div>
  38428. </li></ul>
  38429. <a class="anchor" id="subtitles"></a><a name="subtitles-1"></a>
  38430. <h3 class="section">32.241 subtitles<span class="pull-right"><a class="anchor hidden-xs" href="#subtitles-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-subtitles-1" aria-hidden="true">TOC</a></span></h3>
  38431. <p>Draw subtitles on top of input video using the libass library.
  38432. </p>
  38433. <p>To enable compilation of this filter you need to configure FFmpeg with
  38434. <code class="code">--enable-libass</code>. This filter also requires a build with libavcodec and
  38435. libavformat to convert the passed subtitles file to ASS (Advanced Substation
  38436. Alpha) subtitles format.
  38437. </p>
  38438. <p>The filter accepts the following options:
  38439. </p>
  38440. <dl class="table">
  38441. <dt><samp class="option">filename, f</samp></dt>
  38442. <dd><p>Set the filename of the subtitle file to read. It must be specified.
  38443. </p>
  38444. </dd>
  38445. <dt><samp class="option">original_size</samp></dt>
  38446. <dd><p>Specify the size of the original video, the video for which the ASS file
  38447. was composed. For the syntax of this option, check the
  38448. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  38449. Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to
  38450. correctly scale the fonts if the aspect ratio has been changed.
  38451. </p>
  38452. </dd>
  38453. <dt><samp class="option">fontsdir</samp></dt>
  38454. <dd><p>Set a directory path containing fonts that can be used by the filter.
  38455. These fonts will be used in addition to whatever the font provider uses.
  38456. </p>
  38457. </dd>
  38458. <dt><samp class="option">alpha</samp></dt>
  38459. <dd><p>Process alpha channel, by default alpha channel is untouched.
  38460. </p>
  38461. </dd>
  38462. <dt><samp class="option">charenc</samp></dt>
  38463. <dd><p>Set subtitles input character encoding. <code class="code">subtitles</code> filter only. Only
  38464. useful if not UTF-8.
  38465. </p>
  38466. </dd>
  38467. <dt><samp class="option">stream_index, si</samp></dt>
  38468. <dd><p>Set subtitles stream index. <code class="code">subtitles</code> filter only.
  38469. </p>
  38470. </dd>
  38471. <dt><samp class="option">force_style</samp></dt>
  38472. <dd><p>Override default style or script info parameters of the subtitles. It accepts a
  38473. string containing ASS style format <code class="code">KEY=VALUE</code> couples separated by &quot;,&quot;.
  38474. </p>
  38475. </dd>
  38476. <dt><samp class="option">wrap_unicode</samp></dt>
  38477. <dd><p>Break lines according to the Unicode Line Breaking Algorithm. Availability requires
  38478. at least libass release 0.17.0 (or LIBASS_VERSION 0x01600010), <em class="emph">and</em> libass must
  38479. have been built with libunibreak.
  38480. </p>
  38481. <p>The option is enabled by default except for native ASS.
  38482. </p></dd>
  38483. </dl>
  38484. <p>If the first key is not specified, it is assumed that the first value
  38485. specifies the <samp class="option">filename</samp>.
  38486. </p>
  38487. <p>For example, to render the file <samp class="file">sub.srt</samp> on top of the input
  38488. video, use the command:
  38489. </p><div class="example">
  38490. <pre class="example-preformatted">subtitles=sub.srt
  38491. </pre></div>
  38492. <p>which is equivalent to:
  38493. </p><div class="example">
  38494. <pre class="example-preformatted">subtitles=filename=sub.srt
  38495. </pre></div>
  38496. <p>To render the default subtitles stream from file <samp class="file">video.mkv</samp>, use:
  38497. </p><div class="example">
  38498. <pre class="example-preformatted">subtitles=video.mkv
  38499. </pre></div>
  38500. <p>To render the second subtitles stream from that file, use:
  38501. </p><div class="example">
  38502. <pre class="example-preformatted">subtitles=video.mkv:si=1
  38503. </pre></div>
  38504. <p>To make the subtitles stream from <samp class="file">sub.srt</samp> appear in 80% transparent blue
  38505. <code class="code">DejaVu Serif</code>, use:
  38506. </p><div class="example">
  38507. <pre class="example-preformatted">subtitles=sub.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&amp;HCCFF0000'
  38508. </pre></div>
  38509. <a name="super2xsai"></a>
  38510. <h3 class="section">32.242 super2xsai<span class="pull-right"><a class="anchor hidden-xs" href="#super2xsai" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-super2xsai" aria-hidden="true">TOC</a></span></h3>
  38511. <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
  38512. Interpolate) pixel art scaling algorithm.
  38513. </p>
  38514. <p>Useful for enlarging pixel art images without reducing sharpness.
  38515. </p>
  38516. <a name="swaprect"></a>
  38517. <h3 class="section">32.243 swaprect<span class="pull-right"><a class="anchor hidden-xs" href="#swaprect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-swaprect" aria-hidden="true">TOC</a></span></h3>
  38518. <p>Swap two rectangular objects in video.
  38519. </p>
  38520. <p>This filter accepts the following options:
  38521. </p>
  38522. <dl class="table">
  38523. <dt><samp class="option">w</samp></dt>
  38524. <dd><p>Set object width.
  38525. </p>
  38526. </dd>
  38527. <dt><samp class="option">h</samp></dt>
  38528. <dd><p>Set object height.
  38529. </p>
  38530. </dd>
  38531. <dt><samp class="option">x1</samp></dt>
  38532. <dd><p>Set 1st rect x coordinate.
  38533. </p>
  38534. </dd>
  38535. <dt><samp class="option">y1</samp></dt>
  38536. <dd><p>Set 1st rect y coordinate.
  38537. </p>
  38538. </dd>
  38539. <dt><samp class="option">x2</samp></dt>
  38540. <dd><p>Set 2nd rect x coordinate.
  38541. </p>
  38542. </dd>
  38543. <dt><samp class="option">y2</samp></dt>
  38544. <dd><p>Set 2nd rect y coordinate.
  38545. </p>
  38546. <p>All expressions are evaluated once for each frame.
  38547. </p></dd>
  38548. </dl>
  38549. <p>The all options are expressions containing the following constants:
  38550. </p>
  38551. <dl class="table">
  38552. <dt><samp class="option">w</samp></dt>
  38553. <dt><samp class="option">h</samp></dt>
  38554. <dd><p>The input width and height.
  38555. </p>
  38556. </dd>
  38557. <dt><samp class="option">a</samp></dt>
  38558. <dd><p>same as <var class="var">w</var> / <var class="var">h</var>
  38559. </p>
  38560. </dd>
  38561. <dt><samp class="option">sar</samp></dt>
  38562. <dd><p>input sample aspect ratio
  38563. </p>
  38564. </dd>
  38565. <dt><samp class="option">dar</samp></dt>
  38566. <dd><p>input display aspect ratio, it is the same as (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>
  38567. </p>
  38568. </dd>
  38569. <dt><samp class="option">n</samp></dt>
  38570. <dd><p>The number of the input frame, starting from 0.
  38571. </p>
  38572. </dd>
  38573. <dt><samp class="option">t</samp></dt>
  38574. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  38575. </p>
  38576. </dd>
  38577. <dt><samp class="option">pos</samp></dt>
  38578. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  38579. do not use
  38580. </p></dd>
  38581. </dl>
  38582. <a name="Commands-145"></a>
  38583. <h4 class="subsection">32.243.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-145" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-145" aria-hidden="true">TOC</a></span></h4>
  38584. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  38585. </p>
  38586. <a name="swapuv"></a>
  38587. <h3 class="section">32.244 swapuv<span class="pull-right"><a class="anchor hidden-xs" href="#swapuv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-swapuv" aria-hidden="true">TOC</a></span></h3>
  38588. <p>Swap U &amp; V plane.
  38589. </p>
  38590. <a name="tblend"></a>
  38591. <h3 class="section">32.245 tblend<span class="pull-right"><a class="anchor hidden-xs" href="#tblend" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tblend" aria-hidden="true">TOC</a></span></h3>
  38592. <p>Blend successive video frames.
  38593. </p>
  38594. <p>See <a class="ref" href="#blend">blend</a>
  38595. </p>
  38596. <a name="telecine"></a>
  38597. <h3 class="section">32.246 telecine<span class="pull-right"><a class="anchor hidden-xs" href="#telecine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-telecine" aria-hidden="true">TOC</a></span></h3>
  38598. <p>Apply telecine process to the video.
  38599. </p>
  38600. <p>This filter accepts the following options:
  38601. </p>
  38602. <dl class="table">
  38603. <dt><samp class="option">first_field</samp></dt>
  38604. <dd><dl class="table">
  38605. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  38606. <dd><p>top field first
  38607. </p></dd>
  38608. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  38609. <dd><p>bottom field first
  38610. The default value is <code class="code">top</code>.
  38611. </p></dd>
  38612. </dl>
  38613. </dd>
  38614. <dt><samp class="option">pattern</samp></dt>
  38615. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  38616. The default value is <code class="code">23</code>.
  38617. </p></dd>
  38618. </dl>
  38619. <div class="example">
  38620. <pre class="example-preformatted">Some typical patterns:
  38621. NTSC output (30i):
  38622. 27.5p: 32222
  38623. 24p: 23 (classic)
  38624. 24p: 2332 (preferred)
  38625. 20p: 33
  38626. 18p: 334
  38627. 16p: 3444
  38628. PAL output (25i):
  38629. 27.5p: 12222
  38630. 24p: 222222222223 (&quot;Euro pulldown&quot;)
  38631. 16.67p: 33
  38632. 16p: 33333334
  38633. </pre></div>
  38634. <a name="thistogram"></a>
  38635. <h3 class="section">32.247 thistogram<span class="pull-right"><a class="anchor hidden-xs" href="#thistogram" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-thistogram" aria-hidden="true">TOC</a></span></h3>
  38636. <p>Compute and draw a color distribution histogram for the input video across time.
  38637. </p>
  38638. <p>Unlike <a class="ref" href="#histogram">histogram</a> video filter which only shows histogram of single input frame
  38639. at certain time, this filter shows also past histograms of number of frames defined
  38640. by <code class="code">width</code> option.
  38641. </p>
  38642. <p>The computed histogram is a representation of the color component
  38643. distribution in an image.
  38644. </p>
  38645. <p>The filter accepts the following options:
  38646. </p>
  38647. <dl class="table">
  38648. <dt><samp class="option">width, w</samp></dt>
  38649. <dd><p>Set width of single color component output. Default value is <code class="code">0</code>.
  38650. Value of <code class="code">0</code> means width will be picked from input video.
  38651. This also set number of passed histograms to keep.
  38652. Allowed range is [0, 8192].
  38653. </p>
  38654. </dd>
  38655. <dt><samp class="option">display_mode, d</samp></dt>
  38656. <dd><p>Set display mode.
  38657. It accepts the following values:
  38658. </p><dl class="table">
  38659. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  38660. <dd><p>Per color component graphs are placed below each other.
  38661. </p>
  38662. </dd>
  38663. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  38664. <dd><p>Per color component graphs are placed side by side.
  38665. </p>
  38666. </dd>
  38667. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  38668. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  38669. that the graphs representing color components are superimposed directly
  38670. over one another.
  38671. </p></dd>
  38672. </dl>
  38673. <p>Default is <code class="code">stack</code>.
  38674. </p>
  38675. </dd>
  38676. <dt><samp class="option">levels_mode, m</samp></dt>
  38677. <dd><p>Set mode. Can be either <code class="code">linear</code>, or <code class="code">logarithmic</code>.
  38678. Default is <code class="code">linear</code>.
  38679. </p>
  38680. </dd>
  38681. <dt><samp class="option">components, c</samp></dt>
  38682. <dd><p>Set what color components to display.
  38683. Default is <code class="code">7</code>.
  38684. </p>
  38685. </dd>
  38686. <dt><samp class="option">bgopacity, b</samp></dt>
  38687. <dd><p>Set background opacity. Default is <code class="code">0.9</code>.
  38688. </p>
  38689. </dd>
  38690. <dt><samp class="option">envelope, e</samp></dt>
  38691. <dd><p>Show envelope. Default is disabled.
  38692. </p>
  38693. </dd>
  38694. <dt><samp class="option">ecolor, ec</samp></dt>
  38695. <dd><p>Set envelope color. Default is <code class="code">gold</code>.
  38696. </p>
  38697. </dd>
  38698. <dt><samp class="option">slide</samp></dt>
  38699. <dd><p>Set slide mode.
  38700. </p>
  38701. <p>Available values for slide is:
  38702. </p><dl class="table">
  38703. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  38704. <dd><p>Draw new frame when right border is reached.
  38705. </p>
  38706. </dd>
  38707. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  38708. <dd><p>Replace old columns with new ones.
  38709. </p>
  38710. </dd>
  38711. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  38712. <dd><p>Scroll from right to left.
  38713. </p>
  38714. </dd>
  38715. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  38716. <dd><p>Scroll from left to right.
  38717. </p>
  38718. </dd>
  38719. <dt>&lsquo;<samp class="samp">picture</samp>&rsquo;</dt>
  38720. <dd><p>Draw single picture.
  38721. </p></dd>
  38722. </dl>
  38723. <p>Default is <code class="code">replace</code>.
  38724. </p></dd>
  38725. </dl>
  38726. <a name="threshold"></a>
  38727. <h3 class="section">32.248 threshold<span class="pull-right"><a class="anchor hidden-xs" href="#threshold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-threshold" aria-hidden="true">TOC</a></span></h3>
  38728. <p>Apply threshold effect to video stream.
  38729. </p>
  38730. <p>This filter needs four video streams to perform thresholding.
  38731. First stream is stream we are filtering.
  38732. Second stream is holding threshold values, third stream is holding min values,
  38733. and last, fourth stream is holding max values.
  38734. </p>
  38735. <p>The filter accepts the following option:
  38736. </p>
  38737. <dl class="table">
  38738. <dt><samp class="option">planes</samp></dt>
  38739. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  38740. By default value 0xf, all planes will be processed.
  38741. </p></dd>
  38742. </dl>
  38743. <p>For example if first stream pixel&rsquo;s component value is less then threshold value
  38744. of pixel component from 2nd threshold stream, third stream value will picked,
  38745. otherwise fourth stream pixel component value will be picked.
  38746. </p>
  38747. <p>Using color source filter one can perform various types of thresholding:
  38748. </p>
  38749. <a name="Commands-146"></a>
  38750. <h4 class="subsection">32.248.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-146" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-146" aria-hidden="true">TOC</a></span></h4>
  38751. <p>This filter supports the all options as <a class="ref" href="#commands">commands</a>.
  38752. </p>
  38753. <a name="Examples-144"></a>
  38754. <h4 class="subsection">32.248.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-144" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-144" aria-hidden="true">TOC</a></span></h4>
  38755. <ul class="itemize mark-bullet">
  38756. <li>Binary threshold, using gray color as threshold:
  38757. <div class="example">
  38758. <pre class="example-preformatted">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=black -f lavfi -i color=white -lavfi threshold output.avi
  38759. </pre></div>
  38760. </li><li>Inverted binary threshold, using gray color as threshold:
  38761. <div class="example">
  38762. <pre class="example-preformatted">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -f lavfi -i color=black -lavfi threshold output.avi
  38763. </pre></div>
  38764. </li><li>Truncate binary threshold, using gray color as threshold:
  38765. <div class="example">
  38766. <pre class="example-preformatted">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=gray -lavfi threshold output.avi
  38767. </pre></div>
  38768. </li><li>Threshold to zero, using gray color as threshold:
  38769. <div class="example">
  38770. <pre class="example-preformatted">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -i 320x240.avi -lavfi threshold output.avi
  38771. </pre></div>
  38772. </li><li>Inverted threshold to zero, using gray color as threshold:
  38773. <div class="example">
  38774. <pre class="example-preformatted">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=white -lavfi threshold output.avi
  38775. </pre></div>
  38776. </li></ul>
  38777. <a name="thumbnail"></a>
  38778. <h3 class="section">32.249 thumbnail<span class="pull-right"><a class="anchor hidden-xs" href="#thumbnail" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-thumbnail" aria-hidden="true">TOC</a></span></h3>
  38779. <p>Select the most representative frame in a given sequence of consecutive frames.
  38780. </p>
  38781. <p>The filter accepts the following options:
  38782. </p>
  38783. <dl class="table">
  38784. <dt><samp class="option">n</samp></dt>
  38785. <dd><p>Set the frames batch size to analyze; in a set of <var class="var">n</var> frames, the filter
  38786. will pick one of them, and then handle the next batch of <var class="var">n</var> frames until
  38787. the end. Default is <code class="code">100</code>.
  38788. </p>
  38789. </dd>
  38790. <dt><samp class="option">log</samp></dt>
  38791. <dd><p>Set the log level to display picked frame stats.
  38792. Default is <code class="code">info</code>.
  38793. </p></dd>
  38794. </dl>
  38795. <p>Since the filter keeps track of the whole frames sequence, a bigger <var class="var">n</var>
  38796. value will result in a higher memory usage, so a high value is not recommended.
  38797. </p>
  38798. <a name="Examples-145"></a>
  38799. <h4 class="subsection">32.249.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-145" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-145" aria-hidden="true">TOC</a></span></h4>
  38800. <ul class="itemize mark-bullet">
  38801. <li>Extract one picture each 50 frames:
  38802. <div class="example">
  38803. <pre class="example-preformatted">thumbnail=50
  38804. </pre></div>
  38805. </li><li>Complete example of a thumbnail creation with <code class="command">ffmpeg</code>:
  38806. <div class="example">
  38807. <pre class="example-preformatted">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
  38808. </pre></div>
  38809. </li></ul>
  38810. <a class="anchor" id="tile"></a><a name="tile-1"></a>
  38811. <h3 class="section">32.250 tile<span class="pull-right"><a class="anchor hidden-xs" href="#tile-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tile-1" aria-hidden="true">TOC</a></span></h3>
  38812. <p>Tile several successive frames together.
  38813. </p>
  38814. <p>The <a class="ref" href="#untile">untile</a> filter can do the reverse.
  38815. </p>
  38816. <p>The filter accepts the following options:
  38817. </p>
  38818. <dl class="table">
  38819. <dt><samp class="option">layout</samp></dt>
  38820. <dd><p>Set the grid size in the form <code class="code">COLUMNSxROWS</code>. Range is up to UINT_MAX cells.
  38821. Default is <code class="code">6x5</code>.
  38822. </p>
  38823. </dd>
  38824. <dt><samp class="option">nb_frames</samp></dt>
  38825. <dd><p>Set the maximum number of frames to render in the given area. It must be less
  38826. than or equal to <var class="var">w</var>x<var class="var">h</var>. The default value is <code class="code">0</code>, meaning all
  38827. the area will be used.
  38828. </p>
  38829. </dd>
  38830. <dt><samp class="option">margin</samp></dt>
  38831. <dd><p>Set the outer border margin in pixels. Range is 0 to 1024. Default is <code class="code">0</code>.
  38832. </p>
  38833. </dd>
  38834. <dt><samp class="option">padding</samp></dt>
  38835. <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
  38836. more advanced padding options (such as having different values for the edges),
  38837. refer to the pad video filter. Range is 0 to 1024. Default is <code class="code">0</code>.
  38838. </p>
  38839. </dd>
  38840. <dt><samp class="option">color</samp></dt>
  38841. <dd><p>Specify the color of the unused area. For the syntax of this option, check the
  38842. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  38843. The default value of <var class="var">color</var> is &quot;black&quot;.
  38844. </p>
  38845. </dd>
  38846. <dt><samp class="option">overlap</samp></dt>
  38847. <dd><p>Set the number of frames to overlap when tiling several successive frames together.
  38848. The value must be between <code class="code">0</code> and <var class="var">nb_frames - 1</var>. Default is <code class="code">0</code>.
  38849. </p>
  38850. </dd>
  38851. <dt><samp class="option">init_padding</samp></dt>
  38852. <dd><p>Set the number of frames to initially be empty before displaying first output frame.
  38853. This controls how soon will one get first output frame.
  38854. The value must be between <code class="code">0</code> and <var class="var">nb_frames - 1</var>. Default is <code class="code">0</code>.
  38855. </p></dd>
  38856. </dl>
  38857. <a name="Examples-146"></a>
  38858. <h4 class="subsection">32.250.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-146" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-146" aria-hidden="true">TOC</a></span></h4>
  38859. <ul class="itemize mark-bullet">
  38860. <li>Produce 8x8 PNG tiles of all keyframes (<samp class="option">-skip_frame nokey</samp>) in a movie:
  38861. <div class="example">
  38862. <pre class="example-preformatted">ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
  38863. </pre></div>
  38864. <p>The <samp class="option">-vsync 0</samp> is necessary to prevent <code class="command">ffmpeg</code> from
  38865. duplicating each output frame to accommodate the originally detected frame
  38866. rate.
  38867. </p>
  38868. </li><li>Display <code class="code">5</code> pictures in an area of <code class="code">3x2</code> frames,
  38869. with <code class="code">7</code> pixels between them, and <code class="code">2</code> pixels of initial margin, using
  38870. mixed flat and named options:
  38871. <div class="example">
  38872. <pre class="example-preformatted">tile=3x2:nb_frames=5:padding=7:margin=2
  38873. </pre></div>
  38874. </li></ul>
  38875. <a name="tiltandshift"></a>
  38876. <h3 class="section">32.251 tiltandshift<span class="pull-right"><a class="anchor hidden-xs" href="#tiltandshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tiltandshift" aria-hidden="true">TOC</a></span></h3>
  38877. <p>Apply tilt-and-shift effect.
  38878. </p>
  38879. <p>What happens when you invert time and space?
  38880. </p>
  38881. <p>Normally a video is composed of several frames that represent a different
  38882. instant of time and shows a scene that evolves in the space captured by the
  38883. frame. This filter is the antipode of that concept, taking inspiration from
  38884. tilt and shift photography.
  38885. </p>
  38886. <p>A filtered frame contains the whole timeline of events composing the sequence,
  38887. and this is obtained by placing a slice of pixels from each frame into a single
  38888. one. However, since there are no infinite-width frames, this is done up the
  38889. width of the input frame, and a video is recomposed by shifting away one
  38890. column for each subsequent frame. In order to map space to time, the filter
  38891. tilts each input frame as well, so that motion is preserved. This is accomplished
  38892. by progressively selecting a different column from each input frame.
  38893. </p>
  38894. <p>The end result is a sort of inverted parallax, so that far away objects move
  38895. much faster that the ones in the front. The ideal conditions for this video
  38896. effect are when there is either very little motion and the background is static,
  38897. or when there is a lot of motion and a very wide depth of field (e.g. wide
  38898. panorama, while moving on a train).
  38899. </p>
  38900. <p>The filter accepts the following parameters:
  38901. </p>
  38902. <dl class="table">
  38903. <dt><samp class="option">tilt</samp></dt>
  38904. <dd><p>Tilt video while shifting (default). When unset, video will be sliding a
  38905. static image, composed of the first column of each frame.
  38906. </p>
  38907. </dd>
  38908. <dt><samp class="option">start</samp></dt>
  38909. <dd><p>What to do at the start of filtering (see below).
  38910. </p>
  38911. </dd>
  38912. <dt><samp class="option">end</samp></dt>
  38913. <dd><p>What to do at the end of filtering (see below).
  38914. </p>
  38915. </dd>
  38916. <dt><samp class="option">hold</samp></dt>
  38917. <dd><p>How many columns should pass through before start of filtering.
  38918. </p>
  38919. </dd>
  38920. <dt><samp class="option">pad</samp></dt>
  38921. <dd><p>How many columns should be inserted before end of filtering.
  38922. </p>
  38923. </dd>
  38924. </dl>
  38925. <p>Normally the filter shifts and tilts from the very first frame, and stops when
  38926. the last one is received. However, before filtering starts, normal video may
  38927. be preserved, so that the effect is slowly shifted in its place. Similarly,
  38928. the last video frame may be reconstructed at the end. Alternatively it is
  38929. possible to just start and end with black.
  38930. </p>
  38931. <dl class="table">
  38932. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  38933. <dd><p>Filtering starts immediately and ends when the last frame is received.
  38934. </p>
  38935. </dd>
  38936. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  38937. <dd><p>The first frames or the very last frame are kept intact during processing.
  38938. </p>
  38939. </dd>
  38940. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  38941. <dd><p>Black is padded at the beginning or at the end of filtering.
  38942. </p>
  38943. </dd>
  38944. </dl>
  38945. <a name="tinterlace"></a>
  38946. <h3 class="section">32.252 tinterlace<span class="pull-right"><a class="anchor hidden-xs" href="#tinterlace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tinterlace" aria-hidden="true">TOC</a></span></h3>
  38947. <p>Perform various types of temporal field interlacing.
  38948. </p>
  38949. <p>Frames are counted starting from 1, so the first input frame is
  38950. considered odd.
  38951. </p>
  38952. <p>The filter accepts the following options:
  38953. </p>
  38954. <dl class="table">
  38955. <dt><samp class="option">mode</samp></dt>
  38956. <dd><p>Specify the mode of the interlacing. This option can also be specified
  38957. as a value alone. See below for a list of values for this option.
  38958. </p>
  38959. <p>Available values are:
  38960. </p>
  38961. <dl class="table">
  38962. <dt>&lsquo;<samp class="samp">merge, 0</samp>&rsquo;</dt>
  38963. <dd><p>Move odd frames into the upper field, even into the lower field,
  38964. generating a double height frame at half frame rate.
  38965. </p><div class="example">
  38966. <pre class="example-preformatted"> ------&gt; time
  38967. Input:
  38968. Frame 1 Frame 2 Frame 3 Frame 4
  38969. 11111 22222 33333 44444
  38970. 11111 22222 33333 44444
  38971. 11111 22222 33333 44444
  38972. 11111 22222 33333 44444
  38973. Output:
  38974. 11111 33333
  38975. 22222 44444
  38976. 11111 33333
  38977. 22222 44444
  38978. 11111 33333
  38979. 22222 44444
  38980. 11111 33333
  38981. 22222 44444
  38982. </pre></div>
  38983. </dd>
  38984. <dt>&lsquo;<samp class="samp">drop_even, 1</samp>&rsquo;</dt>
  38985. <dd><p>Only output odd frames, even frames are dropped, generating a frame with
  38986. unchanged height at half frame rate.
  38987. </p>
  38988. <div class="example">
  38989. <pre class="example-preformatted"> ------&gt; time
  38990. Input:
  38991. Frame 1 Frame 2 Frame 3 Frame 4
  38992. 11111 22222 33333 44444
  38993. 11111 22222 33333 44444
  38994. 11111 22222 33333 44444
  38995. 11111 22222 33333 44444
  38996. Output:
  38997. 11111 33333
  38998. 11111 33333
  38999. 11111 33333
  39000. 11111 33333
  39001. </pre></div>
  39002. </dd>
  39003. <dt>&lsquo;<samp class="samp">drop_odd, 2</samp>&rsquo;</dt>
  39004. <dd><p>Only output even frames, odd frames are dropped, generating a frame with
  39005. unchanged height at half frame rate.
  39006. </p>
  39007. <div class="example">
  39008. <pre class="example-preformatted"> ------&gt; time
  39009. Input:
  39010. Frame 1 Frame 2 Frame 3 Frame 4
  39011. 11111 22222 33333 44444
  39012. 11111 22222 33333 44444
  39013. 11111 22222 33333 44444
  39014. 11111 22222 33333 44444
  39015. Output:
  39016. 22222 44444
  39017. 22222 44444
  39018. 22222 44444
  39019. 22222 44444
  39020. </pre></div>
  39021. </dd>
  39022. <dt>&lsquo;<samp class="samp">pad, 3</samp>&rsquo;</dt>
  39023. <dd><p>Expand each frame to full height, but pad alternate lines with black,
  39024. generating a frame with double height at the same input frame rate.
  39025. </p>
  39026. <div class="example">
  39027. <pre class="example-preformatted"> ------&gt; time
  39028. Input:
  39029. Frame 1 Frame 2 Frame 3 Frame 4
  39030. 11111 22222 33333 44444
  39031. 11111 22222 33333 44444
  39032. 11111 22222 33333 44444
  39033. 11111 22222 33333 44444
  39034. Output:
  39035. 11111 ..... 33333 .....
  39036. ..... 22222 ..... 44444
  39037. 11111 ..... 33333 .....
  39038. ..... 22222 ..... 44444
  39039. 11111 ..... 33333 .....
  39040. ..... 22222 ..... 44444
  39041. 11111 ..... 33333 .....
  39042. ..... 22222 ..... 44444
  39043. </pre></div>
  39044. </dd>
  39045. <dt>&lsquo;<samp class="samp">interleave_top, 4</samp>&rsquo;</dt>
  39046. <dd><p>Interleave the upper field from odd frames with the lower field from
  39047. even frames, generating a frame with unchanged height at half frame rate.
  39048. </p>
  39049. <div class="example">
  39050. <pre class="example-preformatted"> ------&gt; time
  39051. Input:
  39052. Frame 1 Frame 2 Frame 3 Frame 4
  39053. 11111&lt;- 22222 33333&lt;- 44444
  39054. 11111 22222&lt;- 33333 44444&lt;-
  39055. 11111&lt;- 22222 33333&lt;- 44444
  39056. 11111 22222&lt;- 33333 44444&lt;-
  39057. Output:
  39058. 11111 33333
  39059. 22222 44444
  39060. 11111 33333
  39061. 22222 44444
  39062. </pre></div>
  39063. </dd>
  39064. <dt>&lsquo;<samp class="samp">interleave_bottom, 5</samp>&rsquo;</dt>
  39065. <dd><p>Interleave the lower field from odd frames with the upper field from
  39066. even frames, generating a frame with unchanged height at half frame rate.
  39067. </p>
  39068. <div class="example">
  39069. <pre class="example-preformatted"> ------&gt; time
  39070. Input:
  39071. Frame 1 Frame 2 Frame 3 Frame 4
  39072. 11111 22222&lt;- 33333 44444&lt;-
  39073. 11111&lt;- 22222 33333&lt;- 44444
  39074. 11111 22222&lt;- 33333 44444&lt;-
  39075. 11111&lt;- 22222 33333&lt;- 44444
  39076. Output:
  39077. 22222 44444
  39078. 11111 33333
  39079. 22222 44444
  39080. 11111 33333
  39081. </pre></div>
  39082. </dd>
  39083. <dt>&lsquo;<samp class="samp">interlacex2, 6</samp>&rsquo;</dt>
  39084. <dd><p>Double frame rate with unchanged height. Frames are inserted each
  39085. containing the second temporal field from the previous input frame and
  39086. the first temporal field from the next input frame. This mode relies on
  39087. the top_field_first flag. Useful for interlaced video displays with no
  39088. field synchronisation.
  39089. </p>
  39090. <div class="example">
  39091. <pre class="example-preformatted"> ------&gt; time
  39092. Input:
  39093. Frame 1 Frame 2 Frame 3 Frame 4
  39094. 11111 22222 33333 44444
  39095. 11111 22222 33333 44444
  39096. 11111 22222 33333 44444
  39097. 11111 22222 33333 44444
  39098. Output:
  39099. 11111 22222 22222 33333 33333 44444 44444
  39100. 11111 11111 22222 22222 33333 33333 44444
  39101. 11111 22222 22222 33333 33333 44444 44444
  39102. 11111 11111 22222 22222 33333 33333 44444
  39103. </pre></div>
  39104. </dd>
  39105. <dt>&lsquo;<samp class="samp">mergex2, 7</samp>&rsquo;</dt>
  39106. <dd><p>Move odd frames into the upper field, even into the lower field,
  39107. generating a double height frame at same frame rate.
  39108. </p>
  39109. <div class="example">
  39110. <pre class="example-preformatted"> ------&gt; time
  39111. Input:
  39112. Frame 1 Frame 2 Frame 3 Frame 4
  39113. 11111 22222 33333 44444
  39114. 11111 22222 33333 44444
  39115. 11111 22222 33333 44444
  39116. 11111 22222 33333 44444
  39117. Output:
  39118. 11111 33333 33333 55555
  39119. 22222 22222 44444 44444
  39120. 11111 33333 33333 55555
  39121. 22222 22222 44444 44444
  39122. 11111 33333 33333 55555
  39123. 22222 22222 44444 44444
  39124. 11111 33333 33333 55555
  39125. 22222 22222 44444 44444
  39126. </pre></div>
  39127. </dd>
  39128. </dl>
  39129. <p>Numeric values are deprecated but are accepted for backward
  39130. compatibility reasons.
  39131. </p>
  39132. <p>Default mode is <code class="code">merge</code>.
  39133. </p>
  39134. </dd>
  39135. <dt><samp class="option">flags</samp></dt>
  39136. <dd><p>Specify flags influencing the filter process.
  39137. </p>
  39138. <p>Available value for <var class="var">flags</var> is:
  39139. </p>
  39140. <dl class="table">
  39141. <dt><samp class="option">low_pass_filter, vlpf</samp></dt>
  39142. <dd><p>Enable linear vertical low-pass filtering in the filter.
  39143. Vertical low-pass filtering is required when creating an interlaced
  39144. destination from a progressive source which contains high-frequency
  39145. vertical detail. Filtering will reduce interlace &rsquo;twitter&rsquo; and Moire
  39146. patterning.
  39147. </p>
  39148. </dd>
  39149. <dt><samp class="option">complex_filter, cvlpf</samp></dt>
  39150. <dd><p>Enable complex vertical low-pass filtering.
  39151. This will slightly less reduce interlace &rsquo;twitter&rsquo; and Moire
  39152. patterning but better retain detail and subjective sharpness impression.
  39153. </p>
  39154. </dd>
  39155. <dt><samp class="option">bypass_il</samp></dt>
  39156. <dd><p>Bypass already interlaced frames, only adjust the frame rate.
  39157. </p></dd>
  39158. </dl>
  39159. <p>Vertical low-pass filtering and bypassing already interlaced frames can only be
  39160. enabled for <samp class="option">mode</samp> <var class="var">interleave_top</var> and <var class="var">interleave_bottom</var>.
  39161. </p>
  39162. </dd>
  39163. </dl>
  39164. <a name="tmedian"></a>
  39165. <h3 class="section">32.253 tmedian<span class="pull-right"><a class="anchor hidden-xs" href="#tmedian" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tmedian" aria-hidden="true">TOC</a></span></h3>
  39166. <p>Pick median pixels from several successive input video frames.
  39167. </p>
  39168. <p>The filter accepts the following options:
  39169. </p>
  39170. <dl class="table">
  39171. <dt><samp class="option">radius</samp></dt>
  39172. <dd><p>Set radius of median filter.
  39173. Default is 1. Allowed range is from 1 to 127.
  39174. </p>
  39175. </dd>
  39176. <dt><samp class="option">planes</samp></dt>
  39177. <dd><p>Set which planes to filter. Default value is <code class="code">15</code>, by which all planes are processed.
  39178. </p>
  39179. </dd>
  39180. <dt><samp class="option">percentile</samp></dt>
  39181. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  39182. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  39183. minimum values, and <code class="code">1</code> maximum values.
  39184. </p></dd>
  39185. </dl>
  39186. <a name="Commands-147"></a>
  39187. <h4 class="subsection">32.253.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-147" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-147" aria-hidden="true">TOC</a></span></h4>
  39188. <p>This filter supports all above options as <a class="ref" href="#commands">commands</a>, excluding option <code class="code">radius</code>.
  39189. </p>
  39190. <a name="tmidequalizer"></a>
  39191. <h3 class="section">32.254 tmidequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#tmidequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tmidequalizer" aria-hidden="true">TOC</a></span></h3>
  39192. <p>Apply Temporal Midway Video Equalization effect.
  39193. </p>
  39194. <p>Midway Video Equalization adjusts a sequence of video frames to have the same
  39195. histograms, while maintaining their dynamics as much as possible. It&rsquo;s
  39196. useful for e.g. matching exposures from a video frames sequence.
  39197. </p>
  39198. <p>This filter accepts the following option:
  39199. </p>
  39200. <dl class="table">
  39201. <dt><samp class="option">radius</samp></dt>
  39202. <dd><p>Set filtering radius. Default is <code class="code">5</code>. Allowed range is from 1 to 127.
  39203. </p>
  39204. </dd>
  39205. <dt><samp class="option">sigma</samp></dt>
  39206. <dd><p>Set filtering sigma. Default is <code class="code">0.5</code>. This controls strength of filtering.
  39207. Setting this option to 0 effectively does nothing.
  39208. </p>
  39209. </dd>
  39210. <dt><samp class="option">planes</samp></dt>
  39211. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  39212. </p></dd>
  39213. </dl>
  39214. <a name="tmix"></a>
  39215. <h3 class="section">32.255 tmix<span class="pull-right"><a class="anchor hidden-xs" href="#tmix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tmix" aria-hidden="true">TOC</a></span></h3>
  39216. <p>Mix successive video frames.
  39217. </p>
  39218. <p>A description of the accepted options follows.
  39219. </p>
  39220. <dl class="table">
  39221. <dt><samp class="option">frames</samp></dt>
  39222. <dd><p>The number of successive frames to mix. If unspecified, it defaults to 3.
  39223. </p>
  39224. </dd>
  39225. <dt><samp class="option">weights</samp></dt>
  39226. <dd><p>Specify weight of each input video frame.
  39227. Each weight is separated by space. If number of weights is smaller than
  39228. number of <var class="var">frames</var> last specified weight will be used for all remaining
  39229. unset weights.
  39230. </p>
  39231. </dd>
  39232. <dt><samp class="option">scale</samp></dt>
  39233. <dd><p>Specify scale, if it is set it will be multiplied with sum
  39234. of each weight multiplied with pixel values to give final destination
  39235. pixel value. By default <var class="var">scale</var> is auto scaled to sum of weights.
  39236. </p>
  39237. </dd>
  39238. <dt><samp class="option">planes</samp></dt>
  39239. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  39240. </p></dd>
  39241. </dl>
  39242. <a name="Examples-147"></a>
  39243. <h4 class="subsection">32.255.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-147" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-147" aria-hidden="true">TOC</a></span></h4>
  39244. <ul class="itemize mark-bullet">
  39245. <li>Average 7 successive frames:
  39246. <div class="example">
  39247. <pre class="example-preformatted">tmix=frames=7:weights=&quot;1 1 1 1 1 1 1&quot;
  39248. </pre></div>
  39249. </li><li>Apply simple temporal convolution:
  39250. <div class="example">
  39251. <pre class="example-preformatted">tmix=frames=3:weights=&quot;-1 3 -1&quot;
  39252. </pre></div>
  39253. </li><li>Similar as above but only showing temporal differences:
  39254. <div class="example">
  39255. <pre class="example-preformatted">tmix=frames=3:weights=&quot;-1 2 -1&quot;:scale=1
  39256. </pre></div>
  39257. </li></ul>
  39258. <a name="Commands-148"></a>
  39259. <h4 class="subsection">32.255.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-148" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-148" aria-hidden="true">TOC</a></span></h4>
  39260. <p>This filter supports the following commands:
  39261. </p><dl class="table">
  39262. <dt><samp class="option">weights</samp></dt>
  39263. <dt><samp class="option">scale</samp></dt>
  39264. <dt><samp class="option">planes</samp></dt>
  39265. <dd><p>Syntax is same as option with same name.
  39266. </p></dd>
  39267. </dl>
  39268. <a class="anchor" id="tonemap"></a><a name="tonemap-1"></a>
  39269. <h3 class="section">32.256 tonemap<span class="pull-right"><a class="anchor hidden-xs" href="#tonemap-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tonemap-1" aria-hidden="true">TOC</a></span></h3>
  39270. <p>Tone map colors from different dynamic ranges.
  39271. </p>
  39272. <p>This filter expects data in single precision floating point, as it needs to
  39273. operate on (and can output) out-of-range values. Another filter, such as
  39274. <a class="ref" href="#zscale">zscale</a>, is needed to convert the resulting frame to a usable format.
  39275. </p>
  39276. <p>The tonemapping algorithms implemented only work on linear light, so input
  39277. data should be linearized beforehand (and possibly correctly tagged).
  39278. </p>
  39279. <div class="example">
  39280. <pre class="example-preformatted">ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
  39281. </pre></div>
  39282. <a name="Options-40"></a>
  39283. <h4 class="subsection">32.256.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-40" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-40" aria-hidden="true">TOC</a></span></h4>
  39284. <p>The filter accepts the following options.
  39285. </p>
  39286. <dl class="table">
  39287. <dt><samp class="option">tonemap</samp></dt>
  39288. <dd><p>Set the tone map algorithm to use.
  39289. </p>
  39290. <p>Possible values are:
  39291. </p><dl class="table">
  39292. <dt><var class="var">none</var></dt>
  39293. <dd><p>Do not apply any tone map, only desaturate overbright pixels.
  39294. </p>
  39295. </dd>
  39296. <dt><var class="var">clip</var></dt>
  39297. <dd><p>Hard-clip any out-of-range values. Use it for perfect color accuracy for
  39298. in-range values, while distorting out-of-range values.
  39299. </p>
  39300. </dd>
  39301. <dt><var class="var">linear</var></dt>
  39302. <dd><p>Stretch the entire reference gamut to a linear multiple of the display.
  39303. </p>
  39304. </dd>
  39305. <dt><var class="var">gamma</var></dt>
  39306. <dd><p>Fit a logarithmic transfer between the tone curves.
  39307. </p>
  39308. </dd>
  39309. <dt><var class="var">reinhard</var></dt>
  39310. <dd><p>Preserve overall image brightness with a simple curve, using nonlinear
  39311. contrast, which results in flattening details and degrading color accuracy.
  39312. </p>
  39313. </dd>
  39314. <dt><var class="var">hable</var></dt>
  39315. <dd><p>Preserve both dark and bright details better than <var class="var">reinhard</var>, at the cost
  39316. of slightly darkening everything. Use it when detail preservation is more
  39317. important than color and brightness accuracy.
  39318. </p>
  39319. </dd>
  39320. <dt><var class="var">mobius</var></dt>
  39321. <dd><p>Smoothly map out-of-range values, while retaining contrast and colors for
  39322. in-range material as much as possible. Use it when color accuracy is more
  39323. important than detail preservation.
  39324. </p></dd>
  39325. </dl>
  39326. <p>Default is none.
  39327. </p>
  39328. </dd>
  39329. <dt><samp class="option">param</samp></dt>
  39330. <dd><p>Tune the tone mapping algorithm.
  39331. </p>
  39332. <p>This affects the following algorithms:
  39333. </p><dl class="table">
  39334. <dt><var class="var">none</var></dt>
  39335. <dd><p>Ignored.
  39336. </p>
  39337. </dd>
  39338. <dt><var class="var">linear</var></dt>
  39339. <dd><p>Specifies the scale factor to use while stretching.
  39340. Default to 1.0.
  39341. </p>
  39342. </dd>
  39343. <dt><var class="var">gamma</var></dt>
  39344. <dd><p>Specifies the exponent of the function.
  39345. Default to 1.8.
  39346. </p>
  39347. </dd>
  39348. <dt><var class="var">clip</var></dt>
  39349. <dd><p>Specify an extra linear coefficient to multiply into the signal before clipping.
  39350. Default to 1.0.
  39351. </p>
  39352. </dd>
  39353. <dt><var class="var">reinhard</var></dt>
  39354. <dd><p>Specify the local contrast coefficient at the display peak.
  39355. Default to 0.5, which means that in-gamut values will be about half as bright
  39356. as when clipping.
  39357. </p>
  39358. </dd>
  39359. <dt><var class="var">hable</var></dt>
  39360. <dd><p>Ignored.
  39361. </p>
  39362. </dd>
  39363. <dt><var class="var">mobius</var></dt>
  39364. <dd><p>Specify the transition point from linear to mobius transform. Every value
  39365. below this point is guaranteed to be mapped 1:1. The higher the value, the
  39366. more accurate the result will be, at the cost of losing bright details.
  39367. Default to 0.3, which due to the steep initial slope still preserves in-range
  39368. colors fairly accurately.
  39369. </p></dd>
  39370. </dl>
  39371. </dd>
  39372. <dt><samp class="option">desat</samp></dt>
  39373. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  39374. higher the parameter, the more color information will be preserved. This
  39375. setting helps prevent unnaturally blown-out colors for super-highlights, by
  39376. (smoothly) turning into white instead. This makes images feel more natural,
  39377. at the cost of reducing information about out-of-range colors.
  39378. </p>
  39379. <p>The default of 2.0 is somewhat conservative and will mostly just apply to
  39380. skies or directly sunlit surfaces. A setting of 0.0 disables this option.
  39381. </p>
  39382. <p>This option works only if the input frame has a supported color tag.
  39383. </p>
  39384. </dd>
  39385. <dt><samp class="option">peak</samp></dt>
  39386. <dd><p>Override signal/nominal/reference peak with this value. Useful when the
  39387. embedded peak information in display metadata is not reliable or when tone
  39388. mapping from a lower range to a higher range.
  39389. </p></dd>
  39390. </dl>
  39391. <a name="tpad"></a>
  39392. <h3 class="section">32.257 tpad<span class="pull-right"><a class="anchor hidden-xs" href="#tpad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tpad" aria-hidden="true">TOC</a></span></h3>
  39393. <p>Temporarily pad video frames.
  39394. </p>
  39395. <p>The filter accepts the following options:
  39396. </p>
  39397. <dl class="table">
  39398. <dt><samp class="option">start</samp></dt>
  39399. <dd><p>Specify number of delay frames before input video stream. Default is 0.
  39400. </p>
  39401. </dd>
  39402. <dt><samp class="option">stop</samp></dt>
  39403. <dd><p>Specify number of padding frames after input video stream.
  39404. Set to -1 to pad indefinitely. Default is 0.
  39405. </p>
  39406. </dd>
  39407. <dt><samp class="option">start_mode</samp></dt>
  39408. <dd><p>Set kind of frames added to beginning of stream.
  39409. Can be either <var class="var">add</var> or <var class="var">clone</var>.
  39410. With <var class="var">add</var> frames of solid-color are added.
  39411. With <var class="var">clone</var> frames are clones of first frame.
  39412. Default is <var class="var">add</var>.
  39413. </p>
  39414. </dd>
  39415. <dt><samp class="option">stop_mode</samp></dt>
  39416. <dd><p>Set kind of frames added to end of stream.
  39417. Can be either <var class="var">add</var> or <var class="var">clone</var>.
  39418. With <var class="var">add</var> frames of solid-color are added.
  39419. With <var class="var">clone</var> frames are clones of last frame.
  39420. Default is <var class="var">add</var>.
  39421. </p>
  39422. </dd>
  39423. <dt><samp class="option">start_duration, stop_duration</samp></dt>
  39424. <dd><p>Specify the duration of the start/stop delay. See
  39425. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  39426. for the accepted syntax.
  39427. These options override <var class="var">start</var> and <var class="var">stop</var>. Default is 0.
  39428. </p>
  39429. </dd>
  39430. <dt><samp class="option">color</samp></dt>
  39431. <dd><p>Specify the color of the padded area. For the syntax of this option,
  39432. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  39433. manual</a>.
  39434. </p>
  39435. <p>The default value of <var class="var">color</var> is &quot;black&quot;.
  39436. </p></dd>
  39437. </dl>
  39438. <a class="anchor" id="transpose"></a><a name="transpose-1"></a>
  39439. <h3 class="section">32.258 transpose<span class="pull-right"><a class="anchor hidden-xs" href="#transpose-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose-1" aria-hidden="true">TOC</a></span></h3>
  39440. <p>Transpose rows with columns in the input video and optionally flip it.
  39441. </p>
  39442. <p>It accepts the following parameters:
  39443. </p>
  39444. <dl class="table">
  39445. <dt><samp class="option">dir</samp></dt>
  39446. <dd><p>Specify the transposition direction.
  39447. </p>
  39448. <p>Can assume the following values:
  39449. </p><dl class="table">
  39450. <dt>&lsquo;<samp class="samp">0, 4, cclock_flip</samp>&rsquo;</dt>
  39451. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
  39452. </p><div class="example">
  39453. <pre class="example-preformatted">L.R L.l
  39454. . . -&gt; . .
  39455. l.r R.r
  39456. </pre></div>
  39457. </dd>
  39458. <dt>&lsquo;<samp class="samp">1, 5, clock</samp>&rsquo;</dt>
  39459. <dd><p>Rotate by 90 degrees clockwise, that is:
  39460. </p><div class="example">
  39461. <pre class="example-preformatted">L.R l.L
  39462. . . -&gt; . .
  39463. l.r r.R
  39464. </pre></div>
  39465. </dd>
  39466. <dt>&lsquo;<samp class="samp">2, 6, cclock</samp>&rsquo;</dt>
  39467. <dd><p>Rotate by 90 degrees counterclockwise, that is:
  39468. </p><div class="example">
  39469. <pre class="example-preformatted">L.R R.r
  39470. . . -&gt; . .
  39471. l.r L.l
  39472. </pre></div>
  39473. </dd>
  39474. <dt>&lsquo;<samp class="samp">3, 7, clock_flip</samp>&rsquo;</dt>
  39475. <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
  39476. </p><div class="example">
  39477. <pre class="example-preformatted">L.R r.R
  39478. . . -&gt; . .
  39479. l.r l.L
  39480. </pre></div>
  39481. </dd>
  39482. </dl>
  39483. <p>For values between 4-7, the transposition is only done if the input
  39484. video geometry is portrait and not landscape. These values are
  39485. deprecated, the <code class="code">passthrough</code> option should be used instead.
  39486. </p>
  39487. <p>Numerical values are deprecated, and should be dropped in favor of
  39488. symbolic constants.
  39489. </p>
  39490. </dd>
  39491. <dt><samp class="option">passthrough</samp></dt>
  39492. <dd><p>Do not apply the transposition if the input geometry matches the one
  39493. specified by the specified value. It accepts the following values:
  39494. </p><dl class="table">
  39495. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  39496. <dd><p>Always apply transposition.
  39497. </p></dd>
  39498. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  39499. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  39500. </p></dd>
  39501. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  39502. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  39503. </p></dd>
  39504. </dl>
  39505. <p>Default value is <code class="code">none</code>.
  39506. </p></dd>
  39507. </dl>
  39508. <p>For example to rotate by 90 degrees clockwise and preserve portrait
  39509. layout:
  39510. </p><div class="example">
  39511. <pre class="example-preformatted">transpose=dir=1:passthrough=portrait
  39512. </pre></div>
  39513. <p>The command above can also be specified as:
  39514. </p><div class="example">
  39515. <pre class="example-preformatted">transpose=1:portrait
  39516. </pre></div>
  39517. <a name="trim"></a>
  39518. <h3 class="section">32.259 trim<span class="pull-right"><a class="anchor hidden-xs" href="#trim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-trim" aria-hidden="true">TOC</a></span></h3>
  39519. <p>Trim the input so that the output contains one continuous subpart of the input.
  39520. </p>
  39521. <p>It accepts the following parameters:
  39522. </p><dl class="table">
  39523. <dt><samp class="option">start</samp></dt>
  39524. <dd><p>Specify the time of the start of the kept section, i.e. the frame with the
  39525. timestamp <var class="var">start</var> will be the first frame in the output.
  39526. </p>
  39527. </dd>
  39528. <dt><samp class="option">end</samp></dt>
  39529. <dd><p>Specify the time of the first frame that will be dropped, i.e. the frame
  39530. immediately preceding the one with the timestamp <var class="var">end</var> will be the last
  39531. frame in the output.
  39532. </p>
  39533. </dd>
  39534. <dt><samp class="option">start_pts</samp></dt>
  39535. <dd><p>This is the same as <var class="var">start</var>, except this option sets the start timestamp
  39536. in timebase units instead of seconds.
  39537. </p>
  39538. </dd>
  39539. <dt><samp class="option">end_pts</samp></dt>
  39540. <dd><p>This is the same as <var class="var">end</var>, except this option sets the end timestamp
  39541. in timebase units instead of seconds.
  39542. </p>
  39543. </dd>
  39544. <dt><samp class="option">duration</samp></dt>
  39545. <dd><p>The maximum duration of the output in seconds.
  39546. </p>
  39547. </dd>
  39548. <dt><samp class="option">start_frame</samp></dt>
  39549. <dd><p>The number of the first frame that should be passed to the output.
  39550. </p>
  39551. </dd>
  39552. <dt><samp class="option">end_frame</samp></dt>
  39553. <dd><p>The number of the first frame that should be dropped.
  39554. </p></dd>
  39555. </dl>
  39556. <p><samp class="option">start</samp>, <samp class="option">end</samp>, and <samp class="option">duration</samp> are expressed as time
  39557. duration specifications; see
  39558. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  39559. for the accepted syntax.
  39560. </p>
  39561. <p>Note that the first two sets of the start/end options and the <samp class="option">duration</samp>
  39562. option look at the frame timestamp, while the _frame variants simply count the
  39563. frames that pass through the filter. Also note that this filter does not modify
  39564. the timestamps. If you wish for the output timestamps to start at zero, insert a
  39565. setpts filter after the trim filter.
  39566. </p>
  39567. <p>If multiple start or end options are set, this filter tries to be greedy and
  39568. keep all the frames that match at least one of the specified constraints. To keep
  39569. only the part that matches all the constraints at once, chain multiple trim
  39570. filters.
  39571. </p>
  39572. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  39573. just the end values to keep everything before the specified time.
  39574. </p>
  39575. <p>Examples:
  39576. </p><ul class="itemize mark-bullet">
  39577. <li>Drop everything except the second minute of input:
  39578. <div class="example">
  39579. <pre class="example-preformatted">ffmpeg -i INPUT -vf trim=60:120
  39580. </pre></div>
  39581. </li><li>Keep only the first second:
  39582. <div class="example">
  39583. <pre class="example-preformatted">ffmpeg -i INPUT -vf trim=duration=1
  39584. </pre></div>
  39585. </li></ul>
  39586. <a name="unpremultiply"></a>
  39587. <h3 class="section">32.260 unpremultiply<span class="pull-right"><a class="anchor hidden-xs" href="#unpremultiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unpremultiply" aria-hidden="true">TOC</a></span></h3>
  39588. <p>Apply alpha unpremultiply effect to input video stream using first plane
  39589. of second stream as alpha.
  39590. </p>
  39591. <p>Both streams must have same dimensions and same pixel format.
  39592. </p>
  39593. <p>The filter accepts the following option:
  39594. </p>
  39595. <dl class="table">
  39596. <dt><samp class="option">planes</samp></dt>
  39597. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  39598. By default value 0xf, all planes will be processed.
  39599. </p>
  39600. <p>If the format has 1 or 2 components, then luma is bit 0.
  39601. If the format has 3 or 4 components:
  39602. for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red;
  39603. for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V.
  39604. If present, the alpha channel is always the last bit.
  39605. </p>
  39606. </dd>
  39607. <dt><samp class="option">inplace</samp></dt>
  39608. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  39609. </p></dd>
  39610. </dl>
  39611. <a class="anchor" id="unsharp"></a><a name="unsharp-1"></a>
  39612. <h3 class="section">32.261 unsharp<span class="pull-right"><a class="anchor hidden-xs" href="#unsharp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unsharp-1" aria-hidden="true">TOC</a></span></h3>
  39613. <p>Sharpen or blur the input video.
  39614. </p>
  39615. <p>It accepts the following parameters:
  39616. </p>
  39617. <dl class="table">
  39618. <dt><samp class="option">luma_msize_x, lx</samp></dt>
  39619. <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
  39620. 3 and 23. The default value is 5.
  39621. </p>
  39622. </dd>
  39623. <dt><samp class="option">luma_msize_y, ly</samp></dt>
  39624. <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
  39625. and 23. The default value is 5.
  39626. </p>
  39627. </dd>
  39628. <dt><samp class="option">luma_amount, la</samp></dt>
  39629. <dd><p>Set the luma effect strength. It must be a floating point number, reasonable
  39630. values lay between -1.5 and 1.5.
  39631. </p>
  39632. <p>Negative values will blur the input video, while positive values will
  39633. sharpen it, a value of zero will disable the effect.
  39634. </p>
  39635. <p>Default value is 1.0.
  39636. </p>
  39637. </dd>
  39638. <dt><samp class="option">chroma_msize_x, cx</samp></dt>
  39639. <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
  39640. between 3 and 23. The default value is 5.
  39641. </p>
  39642. </dd>
  39643. <dt><samp class="option">chroma_msize_y, cy</samp></dt>
  39644. <dd><p>Set the chroma matrix vertical size. It must be an odd integer
  39645. between 3 and 23. The default value is 5.
  39646. </p>
  39647. </dd>
  39648. <dt><samp class="option">chroma_amount, ca</samp></dt>
  39649. <dd><p>Set the chroma effect strength. It must be a floating point number, reasonable
  39650. values lay between -1.5 and 1.5.
  39651. </p>
  39652. <p>Negative values will blur the input video, while positive values will
  39653. sharpen it, a value of zero will disable the effect.
  39654. </p>
  39655. <p>Default value is 0.0.
  39656. </p>
  39657. </dd>
  39658. <dt><samp class="option">alpha_msize_x, ax</samp></dt>
  39659. <dd><p>Set the alpha matrix horizontal size. It must be an odd integer
  39660. between 3 and 23. The default value is 5.
  39661. </p>
  39662. </dd>
  39663. <dt><samp class="option">alpha_msize_y, ay</samp></dt>
  39664. <dd><p>Set the alpha matrix vertical size. It must be an odd integer
  39665. between 3 and 23. The default value is 5.
  39666. </p>
  39667. </dd>
  39668. <dt><samp class="option">alpha_amount, aa</samp></dt>
  39669. <dd><p>Set the alpha effect strength. It must be a floating point number, reasonable
  39670. values lay between -1.5 and 1.5.
  39671. </p>
  39672. <p>Negative values will blur the input video, while positive values will
  39673. sharpen it, a value of zero will disable the effect.
  39674. </p>
  39675. <p>Default value is 0.0.
  39676. </p>
  39677. </dd>
  39678. </dl>
  39679. <p>All parameters are optional and default to the equivalent of the
  39680. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  39681. </p>
  39682. <a name="Examples-148"></a>
  39683. <h4 class="subsection">32.261.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-148" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-148" aria-hidden="true">TOC</a></span></h4>
  39684. <ul class="itemize mark-bullet">
  39685. <li>Apply strong luma sharpen effect:
  39686. <div class="example">
  39687. <pre class="example-preformatted">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
  39688. </pre></div>
  39689. </li><li>Apply a strong blur of both luma and chroma parameters:
  39690. <div class="example">
  39691. <pre class="example-preformatted">unsharp=7:7:-2:7:7:-2
  39692. </pre></div>
  39693. </li></ul>
  39694. <a class="anchor" id="untile"></a><a name="untile-1"></a>
  39695. <h3 class="section">32.262 untile<span class="pull-right"><a class="anchor hidden-xs" href="#untile-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-untile-1" aria-hidden="true">TOC</a></span></h3>
  39696. <p>Decompose a video made of tiled images into the individual images.
  39697. </p>
  39698. <p>The frame rate of the output video is the frame rate of the input video
  39699. multiplied by the number of tiles.
  39700. </p>
  39701. <p>This filter does the reverse of <a class="ref" href="#tile">tile</a>.
  39702. </p>
  39703. <p>The filter accepts the following options:
  39704. </p>
  39705. <dl class="table">
  39706. <dt><samp class="option">layout</samp></dt>
  39707. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  39708. this option, check the
  39709. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  39710. </p></dd>
  39711. </dl>
  39712. <a name="Examples-149"></a>
  39713. <h4 class="subsection">32.262.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-149" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-149" aria-hidden="true">TOC</a></span></h4>
  39714. <ul class="itemize mark-bullet">
  39715. <li>Produce a 1-second video from a still image file made of 25 frames stacked
  39716. vertically, like an analogic film reel:
  39717. <div class="example">
  39718. <pre class="example-preformatted">ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
  39719. </pre></div>
  39720. </li></ul>
  39721. <a name="uspp"></a>
  39722. <h3 class="section">32.263 uspp<span class="pull-right"><a class="anchor hidden-xs" href="#uspp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-uspp" aria-hidden="true">TOC</a></span></h3>
  39723. <p>Apply ultra slow/simple postprocessing filter that compresses and decompresses
  39724. the image at several (or - in the case of <samp class="option">quality</samp> level <code class="code">8</code> - all)
  39725. shifts and average the results.
  39726. </p>
  39727. <p>The way this differs from the behavior of spp is that uspp actually encodes &amp;
  39728. decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8
  39729. DCT similar to MJPEG.
  39730. </p>
  39731. <p>This filter is not available in ffmpeg versions between 5.0 and 6.0.
  39732. </p>
  39733. <p>The filter accepts the following options:
  39734. </p>
  39735. <dl class="table">
  39736. <dt><samp class="option">quality</samp></dt>
  39737. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  39738. an integer in the range 0-8. If set to <code class="code">0</code>, the filter will have no
  39739. effect. A value of <code class="code">8</code> means the higher quality. For each increment of
  39740. that value the speed drops by a factor of approximately 2. Default value is
  39741. <code class="code">3</code>.
  39742. </p>
  39743. </dd>
  39744. <dt><samp class="option">qp</samp></dt>
  39745. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  39746. from the video stream (if available).
  39747. </p>
  39748. </dd>
  39749. <dt><samp class="option">codec</samp></dt>
  39750. <dd><p>Use specified codec instead of snow.
  39751. </p></dd>
  39752. </dl>
  39753. <a name="v360"></a>
  39754. <h3 class="section">32.264 v360<span class="pull-right"><a class="anchor hidden-xs" href="#v360" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-v360" aria-hidden="true">TOC</a></span></h3>
  39755. <p>Convert 360 videos between various formats.
  39756. </p>
  39757. <p>The filter accepts the following options:
  39758. </p>
  39759. <dl class="table">
  39760. <dt><samp class="option">input</samp></dt>
  39761. <dt><samp class="option">output</samp></dt>
  39762. <dd><p>Set format of the input/output video.
  39763. </p>
  39764. <p>Available formats:
  39765. </p>
  39766. <dl class="table">
  39767. <dt>&lsquo;<samp class="samp">e</samp>&rsquo;</dt>
  39768. <dt>&lsquo;<samp class="samp">equirect</samp>&rsquo;</dt>
  39769. <dd><p>Equirectangular projection.
  39770. </p>
  39771. </dd>
  39772. <dt>&lsquo;<samp class="samp">c3x2</samp>&rsquo;</dt>
  39773. <dt>&lsquo;<samp class="samp">c6x1</samp>&rsquo;</dt>
  39774. <dt>&lsquo;<samp class="samp">c1x6</samp>&rsquo;</dt>
  39775. <dd><p>Cubemap with 3x2/6x1/1x6 layout.
  39776. </p>
  39777. <p>Format specific options:
  39778. </p>
  39779. <dl class="table">
  39780. <dt><samp class="option">in_pad</samp></dt>
  39781. <dt><samp class="option">out_pad</samp></dt>
  39782. <dd><p>Set padding proportion for the input/output cubemap. Values in decimals.
  39783. </p>
  39784. <p>Example values:
  39785. </p><dl class="table">
  39786. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  39787. <dd><p>No padding.
  39788. </p></dd>
  39789. <dt>&lsquo;<samp class="samp">0.01</samp>&rsquo;</dt>
  39790. <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)
  39791. </p></dd>
  39792. </dl>
  39793. <p>Default value is <b class="b">&lsquo;<samp class="samp">0</samp>&rsquo;</b>.
  39794. Maximum value is <b class="b">&lsquo;<samp class="samp">0.1</samp>&rsquo;</b>.
  39795. </p>
  39796. </dd>
  39797. <dt><samp class="option">fin_pad</samp></dt>
  39798. <dt><samp class="option">fout_pad</samp></dt>
  39799. <dd><p>Set fixed padding for the input/output cubemap. Values in pixels.
  39800. </p>
  39801. <p>Default value is <b class="b">&lsquo;<samp class="samp">0</samp>&rsquo;</b>. If greater than zero it overrides other padding options.
  39802. </p>
  39803. </dd>
  39804. <dt><samp class="option">in_forder</samp></dt>
  39805. <dt><samp class="option">out_forder</samp></dt>
  39806. <dd><p>Set order of faces for the input/output cubemap. Choose one direction for each position.
  39807. </p>
  39808. <p>Designation of directions:
  39809. </p><dl class="table">
  39810. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  39811. <dd><p>right
  39812. </p></dd>
  39813. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  39814. <dd><p>left
  39815. </p></dd>
  39816. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  39817. <dd><p>up
  39818. </p></dd>
  39819. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  39820. <dd><p>down
  39821. </p></dd>
  39822. <dt>&lsquo;<samp class="samp">f</samp>&rsquo;</dt>
  39823. <dd><p>forward
  39824. </p></dd>
  39825. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  39826. <dd><p>back
  39827. </p></dd>
  39828. </dl>
  39829. <p>Default value is <b class="b">&lsquo;<samp class="samp">rludfb</samp>&rsquo;</b>.
  39830. </p>
  39831. </dd>
  39832. <dt><samp class="option">in_frot</samp></dt>
  39833. <dt><samp class="option">out_frot</samp></dt>
  39834. <dd><p>Set rotation of faces for the input/output cubemap. Choose one angle for each position.
  39835. </p>
  39836. <p>Designation of angles:
  39837. </p><dl class="table">
  39838. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  39839. <dd><p>0 degrees clockwise
  39840. </p></dd>
  39841. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  39842. <dd><p>90 degrees clockwise
  39843. </p></dd>
  39844. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  39845. <dd><p>180 degrees clockwise
  39846. </p></dd>
  39847. <dt>&lsquo;<samp class="samp">3</samp>&rsquo;</dt>
  39848. <dd><p>270 degrees clockwise
  39849. </p></dd>
  39850. </dl>
  39851. <p>Default value is <b class="b">&lsquo;<samp class="samp">000000</samp>&rsquo;</b>.
  39852. </p></dd>
  39853. </dl>
  39854. </dd>
  39855. <dt>&lsquo;<samp class="samp">eac</samp>&rsquo;</dt>
  39856. <dd><p>Equi-Angular Cubemap.
  39857. </p>
  39858. </dd>
  39859. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  39860. <dt>&lsquo;<samp class="samp">gnomonic</samp>&rsquo;</dt>
  39861. <dt>&lsquo;<samp class="samp">rectilinear</samp>&rsquo;</dt>
  39862. <dd><p>Regular video.
  39863. </p>
  39864. <p>Format specific options:
  39865. </p><dl class="table">
  39866. <dt><samp class="option">h_fov</samp></dt>
  39867. <dt><samp class="option">v_fov</samp></dt>
  39868. <dt><samp class="option">d_fov</samp></dt>
  39869. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  39870. </p>
  39871. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  39872. </p>
  39873. </dd>
  39874. <dt><samp class="option">ih_fov</samp></dt>
  39875. <dt><samp class="option">iv_fov</samp></dt>
  39876. <dt><samp class="option">id_fov</samp></dt>
  39877. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  39878. </p>
  39879. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  39880. </p></dd>
  39881. </dl>
  39882. </dd>
  39883. <dt>&lsquo;<samp class="samp">dfisheye</samp>&rsquo;</dt>
  39884. <dd><p>Dual fisheye.
  39885. </p>
  39886. <p>Format specific options:
  39887. </p><dl class="table">
  39888. <dt><samp class="option">h_fov</samp></dt>
  39889. <dt><samp class="option">v_fov</samp></dt>
  39890. <dt><samp class="option">d_fov</samp></dt>
  39891. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  39892. </p>
  39893. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  39894. </p>
  39895. </dd>
  39896. <dt><samp class="option">ih_fov</samp></dt>
  39897. <dt><samp class="option">iv_fov</samp></dt>
  39898. <dt><samp class="option">id_fov</samp></dt>
  39899. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  39900. </p>
  39901. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  39902. </p></dd>
  39903. </dl>
  39904. </dd>
  39905. <dt>&lsquo;<samp class="samp">barrel</samp>&rsquo;</dt>
  39906. <dt>&lsquo;<samp class="samp">fb</samp>&rsquo;</dt>
  39907. <dt>&lsquo;<samp class="samp">barrelsplit</samp>&rsquo;</dt>
  39908. <dd><p>Facebook&rsquo;s 360 formats.
  39909. </p>
  39910. </dd>
  39911. <dt>&lsquo;<samp class="samp">sg</samp>&rsquo;</dt>
  39912. <dd><p>Stereographic format.
  39913. </p>
  39914. <p>Format specific options:
  39915. </p><dl class="table">
  39916. <dt><samp class="option">h_fov</samp></dt>
  39917. <dt><samp class="option">v_fov</samp></dt>
  39918. <dt><samp class="option">d_fov</samp></dt>
  39919. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  39920. </p>
  39921. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  39922. </p>
  39923. </dd>
  39924. <dt><samp class="option">ih_fov</samp></dt>
  39925. <dt><samp class="option">iv_fov</samp></dt>
  39926. <dt><samp class="option">id_fov</samp></dt>
  39927. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  39928. </p>
  39929. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  39930. </p></dd>
  39931. </dl>
  39932. </dd>
  39933. <dt>&lsquo;<samp class="samp">mercator</samp>&rsquo;</dt>
  39934. <dd><p>Mercator format.
  39935. </p>
  39936. </dd>
  39937. <dt>&lsquo;<samp class="samp">ball</samp>&rsquo;</dt>
  39938. <dd><p>Ball format, gives significant distortion toward the back.
  39939. </p>
  39940. </dd>
  39941. <dt>&lsquo;<samp class="samp">hammer</samp>&rsquo;</dt>
  39942. <dd><p>Hammer-Aitoff map projection format.
  39943. </p>
  39944. </dd>
  39945. <dt>&lsquo;<samp class="samp">sinusoidal</samp>&rsquo;</dt>
  39946. <dd><p>Sinusoidal map projection format.
  39947. </p>
  39948. </dd>
  39949. <dt>&lsquo;<samp class="samp">fisheye</samp>&rsquo;</dt>
  39950. <dd><p>Fisheye projection.
  39951. </p>
  39952. <p>Format specific options:
  39953. </p><dl class="table">
  39954. <dt><samp class="option">h_fov</samp></dt>
  39955. <dt><samp class="option">v_fov</samp></dt>
  39956. <dt><samp class="option">d_fov</samp></dt>
  39957. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  39958. </p>
  39959. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  39960. </p>
  39961. </dd>
  39962. <dt><samp class="option">ih_fov</samp></dt>
  39963. <dt><samp class="option">iv_fov</samp></dt>
  39964. <dt><samp class="option">id_fov</samp></dt>
  39965. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  39966. </p>
  39967. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  39968. </p></dd>
  39969. </dl>
  39970. </dd>
  39971. <dt>&lsquo;<samp class="samp">pannini</samp>&rsquo;</dt>
  39972. <dd><p>Pannini projection.
  39973. </p>
  39974. <p>Format specific options:
  39975. </p><dl class="table">
  39976. <dt><samp class="option">h_fov</samp></dt>
  39977. <dd><p>Set output pannini parameter.
  39978. </p>
  39979. </dd>
  39980. <dt><samp class="option">ih_fov</samp></dt>
  39981. <dd><p>Set input pannini parameter.
  39982. </p></dd>
  39983. </dl>
  39984. </dd>
  39985. <dt>&lsquo;<samp class="samp">cylindrical</samp>&rsquo;</dt>
  39986. <dd><p>Cylindrical projection.
  39987. </p>
  39988. <p>Format specific options:
  39989. </p><dl class="table">
  39990. <dt><samp class="option">h_fov</samp></dt>
  39991. <dt><samp class="option">v_fov</samp></dt>
  39992. <dt><samp class="option">d_fov</samp></dt>
  39993. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  39994. </p>
  39995. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  39996. </p>
  39997. </dd>
  39998. <dt><samp class="option">ih_fov</samp></dt>
  39999. <dt><samp class="option">iv_fov</samp></dt>
  40000. <dt><samp class="option">id_fov</samp></dt>
  40001. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  40002. </p>
  40003. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  40004. </p></dd>
  40005. </dl>
  40006. </dd>
  40007. <dt>&lsquo;<samp class="samp">perspective</samp>&rsquo;</dt>
  40008. <dd><p>Perspective projection. <i class="i">(output only)</i>
  40009. </p>
  40010. <p>Format specific options:
  40011. </p><dl class="table">
  40012. <dt><samp class="option">v_fov</samp></dt>
  40013. <dd><p>Set perspective parameter.
  40014. </p></dd>
  40015. </dl>
  40016. </dd>
  40017. <dt>&lsquo;<samp class="samp">tetrahedron</samp>&rsquo;</dt>
  40018. <dd><p>Tetrahedron projection.
  40019. </p>
  40020. </dd>
  40021. <dt>&lsquo;<samp class="samp">tsp</samp>&rsquo;</dt>
  40022. <dd><p>Truncated square pyramid projection.
  40023. </p>
  40024. </dd>
  40025. <dt>&lsquo;<samp class="samp">he</samp>&rsquo;</dt>
  40026. <dt>&lsquo;<samp class="samp">hequirect</samp>&rsquo;</dt>
  40027. <dd><p>Half equirectangular projection.
  40028. </p>
  40029. </dd>
  40030. <dt>&lsquo;<samp class="samp">equisolid</samp>&rsquo;</dt>
  40031. <dd><p>Equisolid format.
  40032. </p>
  40033. <p>Format specific options:
  40034. </p><dl class="table">
  40035. <dt><samp class="option">h_fov</samp></dt>
  40036. <dt><samp class="option">v_fov</samp></dt>
  40037. <dt><samp class="option">d_fov</samp></dt>
  40038. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  40039. </p>
  40040. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  40041. </p>
  40042. </dd>
  40043. <dt><samp class="option">ih_fov</samp></dt>
  40044. <dt><samp class="option">iv_fov</samp></dt>
  40045. <dt><samp class="option">id_fov</samp></dt>
  40046. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  40047. </p>
  40048. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  40049. </p></dd>
  40050. </dl>
  40051. </dd>
  40052. <dt>&lsquo;<samp class="samp">og</samp>&rsquo;</dt>
  40053. <dd><p>Orthographic format.
  40054. </p>
  40055. <p>Format specific options:
  40056. </p><dl class="table">
  40057. <dt><samp class="option">h_fov</samp></dt>
  40058. <dt><samp class="option">v_fov</samp></dt>
  40059. <dt><samp class="option">d_fov</samp></dt>
  40060. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  40061. </p>
  40062. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  40063. </p>
  40064. </dd>
  40065. <dt><samp class="option">ih_fov</samp></dt>
  40066. <dt><samp class="option">iv_fov</samp></dt>
  40067. <dt><samp class="option">id_fov</samp></dt>
  40068. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  40069. </p>
  40070. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  40071. </p></dd>
  40072. </dl>
  40073. </dd>
  40074. <dt>&lsquo;<samp class="samp">octahedron</samp>&rsquo;</dt>
  40075. <dd><p>Octahedron projection.
  40076. </p>
  40077. </dd>
  40078. <dt>&lsquo;<samp class="samp">cylindricalea</samp>&rsquo;</dt>
  40079. <dd><p>Cylindrical Equal Area projection.
  40080. </p></dd>
  40081. </dl>
  40082. </dd>
  40083. <dt><samp class="option">interp</samp></dt>
  40084. <dd><p>Set interpolation method.<br>
  40085. <i class="i">Note: more complex interpolation methods require much more memory to run.</i>
  40086. </p>
  40087. <p>Available methods:
  40088. </p>
  40089. <dl class="table">
  40090. <dt>&lsquo;<samp class="samp">near</samp>&rsquo;</dt>
  40091. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  40092. <dd><p>Nearest neighbour.
  40093. </p></dd>
  40094. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  40095. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  40096. <dd><p>Bilinear interpolation.
  40097. </p></dd>
  40098. <dt>&lsquo;<samp class="samp">lagrange9</samp>&rsquo;</dt>
  40099. <dd><p>Lagrange9 interpolation.
  40100. </p></dd>
  40101. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  40102. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  40103. <dd><p>Bicubic interpolation.
  40104. </p></dd>
  40105. <dt>&lsquo;<samp class="samp">lanc</samp>&rsquo;</dt>
  40106. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  40107. <dd><p>Lanczos interpolation.
  40108. </p></dd>
  40109. <dt>&lsquo;<samp class="samp">sp16</samp>&rsquo;</dt>
  40110. <dt>&lsquo;<samp class="samp">spline16</samp>&rsquo;</dt>
  40111. <dd><p>Spline16 interpolation.
  40112. </p></dd>
  40113. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  40114. <dt>&lsquo;<samp class="samp">gaussian</samp>&rsquo;</dt>
  40115. <dd><p>Gaussian interpolation.
  40116. </p></dd>
  40117. <dt>&lsquo;<samp class="samp">mitchell</samp>&rsquo;</dt>
  40118. <dd><p>Mitchell interpolation.
  40119. </p></dd>
  40120. </dl>
  40121. <p>Default value is <b class="b">&lsquo;<samp class="samp">line</samp>&rsquo;</b>.
  40122. </p>
  40123. </dd>
  40124. <dt><samp class="option">w</samp></dt>
  40125. <dt><samp class="option">h</samp></dt>
  40126. <dd><p>Set the output video resolution.
  40127. </p>
  40128. <p>Default resolution depends on formats.
  40129. </p>
  40130. </dd>
  40131. <dt><samp class="option">in_stereo</samp></dt>
  40132. <dt><samp class="option">out_stereo</samp></dt>
  40133. <dd><p>Set the input/output stereo format.
  40134. </p>
  40135. <dl class="table">
  40136. <dt>&lsquo;<samp class="samp">2d</samp>&rsquo;</dt>
  40137. <dd><p>2D mono
  40138. </p></dd>
  40139. <dt>&lsquo;<samp class="samp">sbs</samp>&rsquo;</dt>
  40140. <dd><p>Side by side
  40141. </p></dd>
  40142. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  40143. <dd><p>Top bottom
  40144. </p></dd>
  40145. </dl>
  40146. <p>Default value is <b class="b">&lsquo;<samp class="samp">2d</samp>&rsquo;</b> for input and output format.
  40147. </p>
  40148. </dd>
  40149. <dt><samp class="option">yaw</samp></dt>
  40150. <dt><samp class="option">pitch</samp></dt>
  40151. <dt><samp class="option">roll</samp></dt>
  40152. <dd><p>Set rotation for the output video. Values in degrees.
  40153. </p>
  40154. </dd>
  40155. <dt><samp class="option">rorder</samp></dt>
  40156. <dd><p>Set rotation order for the output video. Choose one item for each position.
  40157. </p>
  40158. <dl class="table">
  40159. <dt>&lsquo;<samp class="samp">y, Y</samp>&rsquo;</dt>
  40160. <dd><p>yaw
  40161. </p></dd>
  40162. <dt>&lsquo;<samp class="samp">p, P</samp>&rsquo;</dt>
  40163. <dd><p>pitch
  40164. </p></dd>
  40165. <dt>&lsquo;<samp class="samp">r, R</samp>&rsquo;</dt>
  40166. <dd><p>roll
  40167. </p></dd>
  40168. </dl>
  40169. <p>Default value is <b class="b">&lsquo;<samp class="samp">ypr</samp>&rsquo;</b>.
  40170. </p>
  40171. </dd>
  40172. <dt><samp class="option">h_flip</samp></dt>
  40173. <dt><samp class="option">v_flip</samp></dt>
  40174. <dt><samp class="option">d_flip</samp></dt>
  40175. <dd><p>Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values.
  40176. </p>
  40177. </dd>
  40178. <dt><samp class="option">ih_flip</samp></dt>
  40179. <dt><samp class="option">iv_flip</samp></dt>
  40180. <dd><p>Set if input video is flipped horizontally/vertically. Boolean values.
  40181. </p>
  40182. </dd>
  40183. <dt><samp class="option">in_trans</samp></dt>
  40184. <dd><p>Set if input video is transposed. Boolean value, by default disabled.
  40185. </p>
  40186. </dd>
  40187. <dt><samp class="option">out_trans</samp></dt>
  40188. <dd><p>Set if output video needs to be transposed. Boolean value, by default disabled.
  40189. </p>
  40190. </dd>
  40191. <dt><samp class="option">h_offset</samp></dt>
  40192. <dt><samp class="option">v_offset</samp></dt>
  40193. <dd><p>Set output horizontal/vertical off-axis offset. Default is set to 0.
  40194. Allowed range is from -1 to 1.
  40195. </p>
  40196. </dd>
  40197. <dt><samp class="option">alpha_mask</samp></dt>
  40198. <dd><p>Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled.
  40199. </p>
  40200. </dd>
  40201. <dt><samp class="option">reset_rot</samp></dt>
  40202. <dd><p>Reset rotation of output video. Boolean value, by default disabled.
  40203. </p></dd>
  40204. </dl>
  40205. <a name="Examples-150"></a>
  40206. <h4 class="subsection">32.264.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-150" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-150" aria-hidden="true">TOC</a></span></h4>
  40207. <ul class="itemize mark-bullet">
  40208. <li>Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation:
  40209. <div class="example">
  40210. <pre class="example-preformatted">ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
  40211. </pre></div>
  40212. </li><li>Extract back view of Equi-Angular Cubemap:
  40213. <div class="example">
  40214. <pre class="example-preformatted">ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
  40215. </pre></div>
  40216. </li><li>Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format:
  40217. <div class="example">
  40218. <pre class="example-preformatted">v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
  40219. </pre></div>
  40220. </li></ul>
  40221. <a name="Commands-149"></a>
  40222. <h4 class="subsection">32.264.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-149" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-149" aria-hidden="true">TOC</a></span></h4>
  40223. <p>This filter supports subset of above options as <a class="ref" href="#commands">commands</a>.
  40224. </p>
  40225. <a name="vaguedenoiser"></a>
  40226. <h3 class="section">32.265 vaguedenoiser<span class="pull-right"><a class="anchor hidden-xs" href="#vaguedenoiser" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vaguedenoiser" aria-hidden="true">TOC</a></span></h3>
  40227. <p>Apply a wavelet based denoiser.
  40228. </p>
  40229. <p>It transforms each frame from the video input into the wavelet domain,
  40230. using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to
  40231. the obtained coefficients. It does an inverse wavelet transform after.
  40232. Due to wavelet properties, it should give a nice smoothed result, and
  40233. reduced noise, without blurring picture features.
  40234. </p>
  40235. <p>This filter accepts the following options:
  40236. </p>
  40237. <dl class="table">
  40238. <dt><samp class="option">threshold</samp></dt>
  40239. <dd><p>The filtering strength. The higher, the more filtered the video will be.
  40240. Hard thresholding can use a higher threshold than soft thresholding
  40241. before the video looks overfiltered. Default value is 2.
  40242. </p>
  40243. </dd>
  40244. <dt><samp class="option">method</samp></dt>
  40245. <dd><p>The filtering method the filter will use.
  40246. </p>
  40247. <p>It accepts the following values:
  40248. </p><dl class="table">
  40249. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  40250. <dd><p>All values under the threshold will be zeroed.
  40251. </p>
  40252. </dd>
  40253. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  40254. <dd><p>All values under the threshold will be zeroed. All values above will be
  40255. reduced by the threshold.
  40256. </p>
  40257. </dd>
  40258. <dt>&lsquo;<samp class="samp">garrote</samp>&rsquo;</dt>
  40259. <dd><p>Scales or nullifies coefficients - intermediary between (more) soft and
  40260. (less) hard thresholding.
  40261. </p></dd>
  40262. </dl>
  40263. <p>Default is garrote.
  40264. </p>
  40265. </dd>
  40266. <dt><samp class="option">nsteps</samp></dt>
  40267. <dd><p>Number of times, the wavelet will decompose the picture. Picture can&rsquo;t
  40268. be decomposed beyond a particular point (typically, 8 for a 640x480
  40269. frame - as 2^9 = 512 &gt; 480). Valid values are integers between 1 and 32. Default value is 6.
  40270. </p>
  40271. </dd>
  40272. <dt><samp class="option">percent</samp></dt>
  40273. <dd><p>Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85.
  40274. </p>
  40275. </dd>
  40276. <dt><samp class="option">planes</samp></dt>
  40277. <dd><p>A list of the planes to process. By default all planes are processed.
  40278. </p>
  40279. </dd>
  40280. <dt><samp class="option">type</samp></dt>
  40281. <dd><p>The threshold type the filter will use.
  40282. </p>
  40283. <p>It accepts the following values:
  40284. </p><dl class="table">
  40285. <dt>&lsquo;<samp class="samp">universal</samp>&rsquo;</dt>
  40286. <dd><p>Threshold used is same for all decompositions.
  40287. </p>
  40288. </dd>
  40289. <dt>&lsquo;<samp class="samp">bayes</samp>&rsquo;</dt>
  40290. <dd><p>Threshold used depends also on each decomposition coefficients.
  40291. </p></dd>
  40292. </dl>
  40293. <p>Default is universal.
  40294. </p></dd>
  40295. </dl>
  40296. <a name="varblur"></a>
  40297. <h3 class="section">32.266 varblur<span class="pull-right"><a class="anchor hidden-xs" href="#varblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-varblur" aria-hidden="true">TOC</a></span></h3>
  40298. <p>Apply variable blur filter by using 2nd video stream to set blur radius.
  40299. The 2nd stream must have the same dimensions.
  40300. </p>
  40301. <p>This filter accepts the following options:
  40302. </p>
  40303. <dl class="table">
  40304. <dt><samp class="option">min_r</samp></dt>
  40305. <dd><p>Set min allowed radius. Allowed range is from 0 to 254. Default is 0.
  40306. </p></dd>
  40307. <dt><samp class="option">max_r</samp></dt>
  40308. <dd><p>Set max allowed radius. Allowed range is from 1 to 255. Default is 8.
  40309. </p></dd>
  40310. <dt><samp class="option">planes</samp></dt>
  40311. <dd><p>Set which planes to process. By default, all are used.
  40312. </p></dd>
  40313. </dl>
  40314. <p>The <code class="code">varblur</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  40315. </p>
  40316. <a name="Commands-150"></a>
  40317. <h4 class="subsection">32.266.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-150" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-150" aria-hidden="true">TOC</a></span></h4>
  40318. <p>This filter supports all the above options as <a class="ref" href="#commands">commands</a>.
  40319. </p>
  40320. <a name="vectorscope"></a>
  40321. <h3 class="section">32.267 vectorscope<span class="pull-right"><a class="anchor hidden-xs" href="#vectorscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vectorscope" aria-hidden="true">TOC</a></span></h3>
  40322. <p>Display 2 color component values in the two dimensional graph (which is called
  40323. a vectorscope).
  40324. </p>
  40325. <p>This filter accepts the following options:
  40326. </p>
  40327. <dl class="table">
  40328. <dt><samp class="option">mode, m</samp></dt>
  40329. <dd><p>Set vectorscope mode.
  40330. </p>
  40331. <p>It accepts the following values:
  40332. </p><dl class="table">
  40333. <dt>&lsquo;<samp class="samp">gray</samp>&rsquo;</dt>
  40334. <dt>&lsquo;<samp class="samp">tint</samp>&rsquo;</dt>
  40335. <dd><p>Gray values are displayed on graph, higher brightness means more pixels have
  40336. same component color value on location in graph. This is the default mode.
  40337. </p>
  40338. </dd>
  40339. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  40340. <dd><p>Gray values are displayed on graph. Surrounding pixels values which are not
  40341. present in video frame are drawn in gradient of 2 color components which are
  40342. set by option <code class="code">x</code> and <code class="code">y</code>. The 3rd color component is static.
  40343. </p>
  40344. </dd>
  40345. <dt>&lsquo;<samp class="samp">color2</samp>&rsquo;</dt>
  40346. <dd><p>Actual color components values present in video frame are displayed on graph.
  40347. </p>
  40348. </dd>
  40349. <dt>&lsquo;<samp class="samp">color3</samp>&rsquo;</dt>
  40350. <dd><p>Similar as color2 but higher frequency of same values <code class="code">x</code> and <code class="code">y</code>
  40351. on graph increases value of another color component, which is luminance by
  40352. default values of <code class="code">x</code> and <code class="code">y</code>.
  40353. </p>
  40354. </dd>
  40355. <dt>&lsquo;<samp class="samp">color4</samp>&rsquo;</dt>
  40356. <dd><p>Actual colors present in video frame are displayed on graph. If two different
  40357. colors map to same position on graph then color with higher value of component
  40358. not present in graph is picked.
  40359. </p>
  40360. </dd>
  40361. <dt>&lsquo;<samp class="samp">color5</samp>&rsquo;</dt>
  40362. <dd><p>Gray values are displayed on graph. Similar to <code class="code">color</code> but with 3rd color
  40363. component picked from radial gradient.
  40364. </p></dd>
  40365. </dl>
  40366. </dd>
  40367. <dt><samp class="option">x</samp></dt>
  40368. <dd><p>Set which color component will be represented on X-axis. Default is <code class="code">1</code>.
  40369. </p>
  40370. </dd>
  40371. <dt><samp class="option">y</samp></dt>
  40372. <dd><p>Set which color component will be represented on Y-axis. Default is <code class="code">2</code>.
  40373. </p>
  40374. </dd>
  40375. <dt><samp class="option">intensity, i</samp></dt>
  40376. <dd><p>Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness
  40377. of color component which represents frequency of (X, Y) location in graph.
  40378. </p>
  40379. </dd>
  40380. <dt><samp class="option">envelope, e</samp></dt>
  40381. <dd><dl class="table">
  40382. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  40383. <dd><p>No envelope, this is default.
  40384. </p>
  40385. </dd>
  40386. <dt>&lsquo;<samp class="samp">instant</samp>&rsquo;</dt>
  40387. <dd><p>Instant envelope, even darkest single pixel will be clearly highlighted.
  40388. </p>
  40389. </dd>
  40390. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  40391. <dd><p>Hold maximum and minimum values presented in graph over time. This way you
  40392. can still spot out of range values without constantly looking at vectorscope.
  40393. </p>
  40394. </dd>
  40395. <dt>&lsquo;<samp class="samp">peak+instant</samp>&rsquo;</dt>
  40396. <dd><p>Peak and instant envelope combined together.
  40397. </p></dd>
  40398. </dl>
  40399. </dd>
  40400. <dt><samp class="option">graticule, g</samp></dt>
  40401. <dd><p>Set what kind of graticule to draw.
  40402. </p><dl class="table">
  40403. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  40404. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  40405. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  40406. <dt>&lsquo;<samp class="samp">invert</samp>&rsquo;</dt>
  40407. </dl>
  40408. </dd>
  40409. <dt><samp class="option">opacity, o</samp></dt>
  40410. <dd><p>Set graticule opacity.
  40411. </p>
  40412. </dd>
  40413. <dt><samp class="option">flags, f</samp></dt>
  40414. <dd><p>Set graticule flags.
  40415. </p>
  40416. <dl class="table">
  40417. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  40418. <dd><p>Draw graticule for white point.
  40419. </p>
  40420. </dd>
  40421. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  40422. <dd><p>Draw graticule for black point.
  40423. </p>
  40424. </dd>
  40425. <dt>&lsquo;<samp class="samp">name</samp>&rsquo;</dt>
  40426. <dd><p>Draw color points short names.
  40427. </p></dd>
  40428. </dl>
  40429. </dd>
  40430. <dt><samp class="option">bgopacity, b</samp></dt>
  40431. <dd><p>Set background opacity.
  40432. </p>
  40433. </dd>
  40434. <dt><samp class="option">lthreshold, l</samp></dt>
  40435. <dd><p>Set low threshold for color component not represented on X or Y axis.
  40436. Values lower than this value will be ignored. Default is 0.
  40437. Note this value is multiplied with actual max possible value one pixel component
  40438. can have. So for 8-bit input and low threshold value of 0.1 actual threshold
  40439. is 0.1 * 255 = 25.
  40440. </p>
  40441. </dd>
  40442. <dt><samp class="option">hthreshold, h</samp></dt>
  40443. <dd><p>Set high threshold for color component not represented on X or Y axis.
  40444. Values higher than this value will be ignored. Default is 1.
  40445. Note this value is multiplied with actual max possible value one pixel component
  40446. can have. So for 8-bit input and high threshold value of 0.9 actual threshold
  40447. is 0.9 * 255 = 230.
  40448. </p>
  40449. </dd>
  40450. <dt><samp class="option">colorspace, c</samp></dt>
  40451. <dd><p>Set what kind of colorspace to use when drawing graticule.
  40452. </p><dl class="table">
  40453. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  40454. <dt>&lsquo;<samp class="samp">601</samp>&rsquo;</dt>
  40455. <dt>&lsquo;<samp class="samp">709</samp>&rsquo;</dt>
  40456. </dl>
  40457. <p>Default is auto.
  40458. </p>
  40459. </dd>
  40460. <dt><samp class="option">tint0, t0</samp></dt>
  40461. <dt><samp class="option">tint1, t1</samp></dt>
  40462. <dd><p>Set color tint for gray/tint vectorscope mode. By default both options are zero.
  40463. This means no tint, and output will remain gray.
  40464. </p></dd>
  40465. </dl>
  40466. <a class="anchor" id="vidstabdetect"></a><a name="vidstabdetect-1"></a>
  40467. <h3 class="section">32.268 vidstabdetect<span class="pull-right"><a class="anchor hidden-xs" href="#vidstabdetect-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vidstabdetect-1" aria-hidden="true">TOC</a></span></h3>
  40468. <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
  40469. <a class="ref" href="#vidstabtransform">vidstabtransform</a> for pass 2.
  40470. </p>
  40471. <p>This filter generates a file with relative translation and rotation
  40472. transform information about subsequent frames, which is then used by
  40473. the <a class="ref" href="#vidstabtransform">vidstabtransform</a> filter.
  40474. </p>
  40475. <p>To enable compilation of this filter you need to configure FFmpeg with
  40476. <code class="code">--enable-libvidstab</code>.
  40477. </p>
  40478. <p>This filter accepts the following options:
  40479. </p>
  40480. <dl class="table">
  40481. <dt><samp class="option">result</samp></dt>
  40482. <dd><p>Set the path to the file used to write the transforms information.
  40483. Default value is <samp class="file">transforms.trf</samp>.
  40484. </p>
  40485. </dd>
  40486. <dt><samp class="option">shakiness</samp></dt>
  40487. <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
  40488. integer in the range 1-10, a value of 1 means little shakiness, a
  40489. value of 10 means strong shakiness. Default value is 5.
  40490. </p>
  40491. </dd>
  40492. <dt><samp class="option">accuracy</samp></dt>
  40493. <dd><p>Set the accuracy of the detection process. It must be a value in the
  40494. range 1-15. A value of 1 means low accuracy, a value of 15 means high
  40495. accuracy. Default value is 15.
  40496. </p>
  40497. </dd>
  40498. <dt><samp class="option">stepsize</samp></dt>
  40499. <dd><p>Set stepsize of the search process. The region around minimum is
  40500. scanned with 1 pixel resolution. Default value is 6.
  40501. </p>
  40502. </dd>
  40503. <dt><samp class="option">mincontrast</samp></dt>
  40504. <dd><p>Set minimum contrast. Below this value a local measurement field is
  40505. discarded. Must be a floating point value in the range 0-1. Default
  40506. value is 0.3.
  40507. </p>
  40508. </dd>
  40509. <dt><samp class="option">tripod</samp></dt>
  40510. <dd><p>Set reference frame number for tripod mode.
  40511. </p>
  40512. <p>If enabled, the motion of the frames is compared to a reference frame
  40513. in the filtered stream, identified by the specified number. The idea
  40514. is to compensate all movements in a more-or-less static scene and keep
  40515. the camera view absolutely still.
  40516. </p>
  40517. <p>If set to 0, it is disabled. The frames are counted starting from 1.
  40518. </p>
  40519. </dd>
  40520. <dt><samp class="option">show</samp></dt>
  40521. <dd><p>Show fields and transforms in the resulting frames. It accepts an
  40522. integer in the range 0-2. Default value is 0, which disables any
  40523. visualization.
  40524. </p>
  40525. </dd>
  40526. <dt><samp class="option">fileformat</samp></dt>
  40527. <dd><p>Format for the transforms data file to be written.
  40528. Acceptable values are
  40529. </p>
  40530. <dl class="table">
  40531. <dt>&lsquo;<samp class="samp">ascii</samp>&rsquo;</dt>
  40532. <dd><p>Human-readable plain text
  40533. </p>
  40534. </dd>
  40535. <dt>&lsquo;<samp class="samp">binary</samp>&rsquo;</dt>
  40536. <dd><p>Binary format, roughly 40% smaller than <code class="code">ascii</code>. (<em class="emph">default</em>)
  40537. </p></dd>
  40538. </dl>
  40539. </dd>
  40540. </dl>
  40541. <a name="Examples-151"></a>
  40542. <h4 class="subsection">32.268.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-151" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-151" aria-hidden="true">TOC</a></span></h4>
  40543. <ul class="itemize mark-bullet">
  40544. <li>Use default values:
  40545. <div class="example">
  40546. <pre class="example-preformatted">vidstabdetect
  40547. </pre></div>
  40548. </li><li>Analyze strongly shaky movie and put the results in file
  40549. <samp class="file">mytransforms.trf</samp>:
  40550. <div class="example">
  40551. <pre class="example-preformatted">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
  40552. </pre></div>
  40553. </li><li>Visualize the result of internal transformations in the resulting
  40554. video:
  40555. <div class="example">
  40556. <pre class="example-preformatted">vidstabdetect=show=1
  40557. </pre></div>
  40558. </li><li>Analyze a video with medium shakiness using <code class="command">ffmpeg</code>:
  40559. <div class="example">
  40560. <pre class="example-preformatted">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
  40561. </pre></div>
  40562. </li></ul>
  40563. <a class="anchor" id="vidstabtransform"></a><a name="vidstabtransform-1"></a>
  40564. <h3 class="section">32.269 vidstabtransform<span class="pull-right"><a class="anchor hidden-xs" href="#vidstabtransform-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vidstabtransform-1" aria-hidden="true">TOC</a></span></h3>
  40565. <p>Video stabilization/deshaking: pass 2 of 2,
  40566. see <a class="ref" href="#vidstabdetect">vidstabdetect</a> for pass 1.
  40567. </p>
  40568. <p>Read a file with transform information for each frame and
  40569. apply/compensate them. Together with the <a class="ref" href="#vidstabdetect">vidstabdetect</a>
  40570. filter this can be used to deshake videos. See also
  40571. <a class="url" href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
  40572. the <a class="ref" href="#unsharp">unsharp</a> filter, see below.
  40573. </p>
  40574. <p>To enable compilation of this filter you need to configure FFmpeg with
  40575. <code class="code">--enable-libvidstab</code>.
  40576. </p>
  40577. <a name="Options-41"></a>
  40578. <h4 class="subsection">32.269.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-41" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-41" aria-hidden="true">TOC</a></span></h4>
  40579. <dl class="table">
  40580. <dt><samp class="option">input</samp></dt>
  40581. <dd><p>Set path to the file used to read the transforms. Default value is
  40582. <samp class="file">transforms.trf</samp>.
  40583. </p>
  40584. </dd>
  40585. <dt><samp class="option">smoothing</samp></dt>
  40586. <dd><p>Set the number of frames (value*2 + 1) used for lowpass filtering the
  40587. camera movements. Default value is 10.
  40588. </p>
  40589. <p>For example a number of 10 means that 21 frames are used (10 in the
  40590. past and 10 in the future) to smoothen the motion in the video. A
  40591. larger value leads to a smoother video, but limits the acceleration of
  40592. the camera (pan/tilt movements). 0 is a special case where a static
  40593. camera is simulated.
  40594. </p>
  40595. </dd>
  40596. <dt><samp class="option">optalgo</samp></dt>
  40597. <dd><p>Set the camera path optimization algorithm.
  40598. </p>
  40599. <p>Accepted values are:
  40600. </p><dl class="table">
  40601. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  40602. <dd><p>gaussian kernel low-pass filter on camera motion (default)
  40603. </p></dd>
  40604. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  40605. <dd><p>averaging on transformations
  40606. </p></dd>
  40607. </dl>
  40608. </dd>
  40609. <dt><samp class="option">maxshift</samp></dt>
  40610. <dd><p>Set maximal number of pixels to translate frames. Default value is -1,
  40611. meaning no limit.
  40612. </p>
  40613. </dd>
  40614. <dt><samp class="option">maxangle</samp></dt>
  40615. <dd><p>Set maximal angle in radians (degree*PI/180) to rotate frames. Default
  40616. value is -1, meaning no limit.
  40617. </p>
  40618. </dd>
  40619. <dt><samp class="option">crop</samp></dt>
  40620. <dd><p>Specify how to deal with borders that may be visible due to movement
  40621. compensation.
  40622. </p>
  40623. <p>Available values are:
  40624. </p><dl class="table">
  40625. <dt>&lsquo;<samp class="samp">keep</samp>&rsquo;</dt>
  40626. <dd><p>keep image information from previous frame (default)
  40627. </p></dd>
  40628. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  40629. <dd><p>fill the border black
  40630. </p></dd>
  40631. </dl>
  40632. </dd>
  40633. <dt><samp class="option">invert</samp></dt>
  40634. <dd><p>Invert transforms if set to 1. Default value is 0.
  40635. </p>
  40636. </dd>
  40637. <dt><samp class="option">relative</samp></dt>
  40638. <dd><p>Consider transforms as relative to previous frame if set to 1,
  40639. absolute if set to 0. Default value is 0.
  40640. </p>
  40641. </dd>
  40642. <dt><samp class="option">zoom</samp></dt>
  40643. <dd><p>Set percentage to zoom. A positive value will result in a zoom-in
  40644. effect, a negative value in a zoom-out effect. Default value is 0 (no
  40645. zoom).
  40646. </p>
  40647. </dd>
  40648. <dt><samp class="option">optzoom</samp></dt>
  40649. <dd><p>Set optimal zooming to avoid borders.
  40650. </p>
  40651. <p>Accepted values are:
  40652. </p><dl class="table">
  40653. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  40654. <dd><p>disabled
  40655. </p></dd>
  40656. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  40657. <dd><p>optimal static zoom value is determined (only very strong movements
  40658. will lead to visible borders) (default)
  40659. </p></dd>
  40660. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  40661. <dd><p>optimal adaptive zoom value is determined (no borders will be
  40662. visible), see <samp class="option">zoomspeed</samp>
  40663. </p></dd>
  40664. </dl>
  40665. <p>Note that the value given at zoom is added to the one calculated here.
  40666. </p>
  40667. </dd>
  40668. <dt><samp class="option">zoomspeed</samp></dt>
  40669. <dd><p>Set percent to zoom maximally each frame (enabled when
  40670. <samp class="option">optzoom</samp> is set to 2). Range is from 0 to 5, default value is
  40671. 0.25.
  40672. </p>
  40673. </dd>
  40674. <dt><samp class="option">interpol</samp></dt>
  40675. <dd><p>Specify type of interpolation.
  40676. </p>
  40677. <p>Available values are:
  40678. </p><dl class="table">
  40679. <dt>&lsquo;<samp class="samp">no</samp>&rsquo;</dt>
  40680. <dd><p>no interpolation
  40681. </p></dd>
  40682. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  40683. <dd><p>linear only horizontal
  40684. </p></dd>
  40685. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  40686. <dd><p>linear in both directions (default)
  40687. </p></dd>
  40688. <dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
  40689. <dd><p>cubic in both directions (slow)
  40690. </p></dd>
  40691. </dl>
  40692. </dd>
  40693. <dt><samp class="option">tripod</samp></dt>
  40694. <dd><p>Enable virtual tripod mode if set to 1, which is equivalent to
  40695. <code class="code">relative=0:smoothing=0</code>. Default value is 0.
  40696. </p>
  40697. <p>Use also <code class="code">tripod</code> option of <a class="ref" href="#vidstabdetect">vidstabdetect</a>.
  40698. </p>
  40699. </dd>
  40700. <dt><samp class="option">debug</samp></dt>
  40701. <dd><p>Increase log verbosity if set to 1. Also the detected global motions
  40702. are written to the temporary file <samp class="file">global_motions.trf</samp>. Default
  40703. value is 0.
  40704. </p></dd>
  40705. </dl>
  40706. <a name="Examples-152"></a>
  40707. <h4 class="subsection">32.269.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-152" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-152" aria-hidden="true">TOC</a></span></h4>
  40708. <ul class="itemize mark-bullet">
  40709. <li>Use <code class="command">ffmpeg</code> for a typical stabilization with default values:
  40710. <div class="example">
  40711. <pre class="example-preformatted">ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
  40712. </pre></div>
  40713. <p>Note the use of the <a class="ref" href="#unsharp">unsharp</a> filter which is always recommended.
  40714. </p>
  40715. </li><li>Zoom in a bit more and load transform data from a given file:
  40716. <div class="example">
  40717. <pre class="example-preformatted">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
  40718. </pre></div>
  40719. </li><li>Smoothen the video even more:
  40720. <div class="example">
  40721. <pre class="example-preformatted">vidstabtransform=smoothing=30
  40722. </pre></div>
  40723. </li></ul>
  40724. <a name="vflip"></a>
  40725. <h3 class="section">32.270 vflip<span class="pull-right"><a class="anchor hidden-xs" href="#vflip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vflip" aria-hidden="true">TOC</a></span></h3>
  40726. <p>Flip the input video vertically.
  40727. </p>
  40728. <p>For example, to vertically flip a video with <code class="command">ffmpeg</code>:
  40729. </p><div class="example">
  40730. <pre class="example-preformatted">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
  40731. </pre></div>
  40732. <a name="vfrdet"></a>
  40733. <h3 class="section">32.271 vfrdet<span class="pull-right"><a class="anchor hidden-xs" href="#vfrdet" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vfrdet" aria-hidden="true">TOC</a></span></h3>
  40734. <p>Detect variable frame rate video.
  40735. </p>
  40736. <p>This filter tries to detect if the input is variable or constant frame rate.
  40737. </p>
  40738. <p>At end it will output number of frames detected as having variable delta pts,
  40739. and ones with constant delta pts.
  40740. If there was frames with variable delta, than it will also show min, max and
  40741. average delta encountered.
  40742. </p>
  40743. <a name="vibrance"></a>
  40744. <h3 class="section">32.272 vibrance<span class="pull-right"><a class="anchor hidden-xs" href="#vibrance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vibrance" aria-hidden="true">TOC</a></span></h3>
  40745. <p>Boost or alter saturation.
  40746. </p>
  40747. <p>The filter accepts the following options:
  40748. </p><dl class="table">
  40749. <dt><samp class="option">intensity</samp></dt>
  40750. <dd><p>Set strength of boost if positive value or strength of alter if negative value.
  40751. Default is 0. Allowed range is from -2 to 2.
  40752. </p>
  40753. </dd>
  40754. <dt><samp class="option">rbal</samp></dt>
  40755. <dd><p>Set the red balance. Default is 1. Allowed range is from -10 to 10.
  40756. </p>
  40757. </dd>
  40758. <dt><samp class="option">gbal</samp></dt>
  40759. <dd><p>Set the green balance. Default is 1. Allowed range is from -10 to 10.
  40760. </p>
  40761. </dd>
  40762. <dt><samp class="option">bbal</samp></dt>
  40763. <dd><p>Set the blue balance. Default is 1. Allowed range is from -10 to 10.
  40764. </p>
  40765. </dd>
  40766. <dt><samp class="option">rlum</samp></dt>
  40767. <dd><p>Set the red luma coefficient.
  40768. </p>
  40769. </dd>
  40770. <dt><samp class="option">glum</samp></dt>
  40771. <dd><p>Set the green luma coefficient.
  40772. </p>
  40773. </dd>
  40774. <dt><samp class="option">blum</samp></dt>
  40775. <dd><p>Set the blue luma coefficient.
  40776. </p>
  40777. </dd>
  40778. <dt><samp class="option">alternate</samp></dt>
  40779. <dd><p>If <code class="code">intensity</code> is negative and this is set to 1, colors will change,
  40780. otherwise colors will be less saturated, more towards gray.
  40781. </p></dd>
  40782. </dl>
  40783. <a name="Commands-151"></a>
  40784. <h4 class="subsection">32.272.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-151" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-151" aria-hidden="true">TOC</a></span></h4>
  40785. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  40786. </p>
  40787. <a name="vif"></a>
  40788. <h3 class="section">32.273 vif<span class="pull-right"><a class="anchor hidden-xs" href="#vif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vif" aria-hidden="true">TOC</a></span></h3>
  40789. <p>Obtain the average VIF (Visual Information Fidelity) between two input videos.
  40790. </p>
  40791. <p>This filter takes two input videos.
  40792. </p>
  40793. <p>Both input videos must have the same resolution and pixel format for
  40794. this filter to work correctly. Also it assumes that both inputs
  40795. have the same number of frames, which are compared one by one.
  40796. </p>
  40797. <p>The obtained average VIF score is printed through the logging system.
  40798. </p>
  40799. <p>The filter stores the calculated VIF score of each frame.
  40800. </p>
  40801. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  40802. </p>
  40803. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  40804. with the reference file <samp class="file">ref.mpg</samp>.
  40805. </p>
  40806. <div class="example">
  40807. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi vif -f null -
  40808. </pre></div>
  40809. <a class="anchor" id="vignette"></a><a name="vignette-1"></a>
  40810. <h3 class="section">32.274 vignette<span class="pull-right"><a class="anchor hidden-xs" href="#vignette-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vignette-1" aria-hidden="true">TOC</a></span></h3>
  40811. <p>Make or reverse a natural vignetting effect.
  40812. </p>
  40813. <p>The filter accepts the following options:
  40814. </p>
  40815. <dl class="table">
  40816. <dt><samp class="option">angle, a</samp></dt>
  40817. <dd><p>Set lens angle expression as a number of radians.
  40818. </p>
  40819. <p>The value is clipped in the <code class="code">[0,PI/2]</code> range.
  40820. </p>
  40821. <p>Default value: <code class="code">&quot;PI/5&quot;</code>
  40822. </p>
  40823. </dd>
  40824. <dt><samp class="option">x0</samp></dt>
  40825. <dt><samp class="option">y0</samp></dt>
  40826. <dd><p>Set center coordinates expressions. Respectively <code class="code">&quot;w/2&quot;</code> and <code class="code">&quot;h/2&quot;</code>
  40827. by default.
  40828. </p>
  40829. </dd>
  40830. <dt><samp class="option">mode</samp></dt>
  40831. <dd><p>Set forward/backward mode.
  40832. </p>
  40833. <p>Available modes are:
  40834. </p><dl class="table">
  40835. <dt>&lsquo;<samp class="samp">forward</samp>&rsquo;</dt>
  40836. <dd><p>The larger the distance from the central point, the darker the image becomes.
  40837. </p>
  40838. </dd>
  40839. <dt>&lsquo;<samp class="samp">backward</samp>&rsquo;</dt>
  40840. <dd><p>The larger the distance from the central point, the brighter the image becomes.
  40841. This can be used to reverse a vignette effect, though there is no automatic
  40842. detection to extract the lens <samp class="option">angle</samp> and other settings (yet). It can
  40843. also be used to create a burning effect.
  40844. </p></dd>
  40845. </dl>
  40846. <p>Default value is &lsquo;<samp class="samp">forward</samp>&rsquo;.
  40847. </p>
  40848. </dd>
  40849. <dt><samp class="option">eval</samp></dt>
  40850. <dd><p>Set evaluation mode for the expressions (<samp class="option">angle</samp>, <samp class="option">x0</samp>, <samp class="option">y0</samp>).
  40851. </p>
  40852. <p>It accepts the following values:
  40853. </p><dl class="table">
  40854. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  40855. <dd><p>Evaluate expressions only once during the filter initialization.
  40856. </p>
  40857. </dd>
  40858. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  40859. <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
  40860. &lsquo;<samp class="samp">init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
  40861. allows advanced dynamic expressions.
  40862. </p></dd>
  40863. </dl>
  40864. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  40865. </p>
  40866. </dd>
  40867. <dt><samp class="option">dither</samp></dt>
  40868. <dd><p>Set dithering to reduce the circular banding effects. Default is <code class="code">1</code>
  40869. (enabled).
  40870. </p>
  40871. </dd>
  40872. <dt><samp class="option">aspect</samp></dt>
  40873. <dd><p>Set vignette aspect. This setting allows one to adjust the shape of the vignette.
  40874. Setting this value to the SAR of the input will make a rectangular vignetting
  40875. following the dimensions of the video.
  40876. </p>
  40877. <p>Default is <code class="code">1/1</code>.
  40878. </p></dd>
  40879. </dl>
  40880. <a name="Expressions"></a>
  40881. <h4 class="subsection">32.274.1 Expressions<span class="pull-right"><a class="anchor hidden-xs" href="#Expressions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Expressions" aria-hidden="true">TOC</a></span></h4>
  40882. <p>The <samp class="option">alpha</samp>, <samp class="option">x0</samp> and <samp class="option">y0</samp> expressions can contain the
  40883. following parameters.
  40884. </p>
  40885. <dl class="table">
  40886. <dt><samp class="option">w</samp></dt>
  40887. <dt><samp class="option">h</samp></dt>
  40888. <dd><p>input width and height
  40889. </p>
  40890. </dd>
  40891. <dt><samp class="option">n</samp></dt>
  40892. <dd><p>the number of input frame, starting from 0
  40893. </p>
  40894. </dd>
  40895. <dt><samp class="option">pts</samp></dt>
  40896. <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
  40897. <var class="var">TB</var> units, NAN if undefined
  40898. </p>
  40899. </dd>
  40900. <dt><samp class="option">r</samp></dt>
  40901. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  40902. </p>
  40903. </dd>
  40904. <dt><samp class="option">t</samp></dt>
  40905. <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
  40906. expressed in seconds, NAN if undefined
  40907. </p>
  40908. </dd>
  40909. <dt><samp class="option">tb</samp></dt>
  40910. <dd><p>time base of the input video
  40911. </p></dd>
  40912. </dl>
  40913. <a name="Examples-153"></a>
  40914. <h4 class="subsection">32.274.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-153" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-153" aria-hidden="true">TOC</a></span></h4>
  40915. <ul class="itemize mark-bullet">
  40916. <li>Apply simple strong vignetting effect:
  40917. <div class="example">
  40918. <pre class="example-preformatted">vignette=PI/4
  40919. </pre></div>
  40920. </li><li>Make a flickering vignetting:
  40921. <div class="example">
  40922. <pre class="example-preformatted">vignette='PI/4+random(1)*PI/50':eval=frame
  40923. </pre></div>
  40924. </li></ul>
  40925. <a name="vmafmotion"></a>
  40926. <h3 class="section">32.275 vmafmotion<span class="pull-right"><a class="anchor hidden-xs" href="#vmafmotion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vmafmotion" aria-hidden="true">TOC</a></span></h3>
  40927. <p>Obtain the average VMAF motion score of a video.
  40928. It is one of the component metrics of VMAF.
  40929. </p>
  40930. <p>The obtained average motion score is printed through the logging system.
  40931. </p>
  40932. <p>The filter accepts the following options:
  40933. </p>
  40934. <dl class="table">
  40935. <dt><samp class="option">stats_file</samp></dt>
  40936. <dd><p>If specified, the filter will use the named file to save the motion score of
  40937. each frame with respect to the previous frame.
  40938. When filename equals &quot;-&quot; the data is sent to standard output.
  40939. </p></dd>
  40940. </dl>
  40941. <p>Example:
  40942. </p><div class="example">
  40943. <pre class="example-preformatted">ffmpeg -i ref.mpg -vf vmafmotion -f null -
  40944. </pre></div>
  40945. <a class="anchor" id="vpp_005famf"></a><a name="vpp_005famf-1"></a>
  40946. <h3 class="section">32.276 vpp_amf<span class="pull-right"><a class="anchor hidden-xs" href="#vpp_005famf-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vpp_005famf-1" aria-hidden="true">TOC</a></span></h3>
  40947. <p>Scale (resize) and convert colorspace, transfer characteristics or color primaries for the input video, using AMD Advanced Media Framework library for hardware acceleration.
  40948. Setting the output width and height works in the same way as for the <a class="ref" href="#scale">scale</a> filter.
  40949. </p>
  40950. <p>The filter accepts the following options:
  40951. </p><dl class="table">
  40952. <dt><samp class="option">w</samp></dt>
  40953. <dt><samp class="option">h</samp></dt>
  40954. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  40955. </p>
  40956. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  40957. </p>
  40958. </dd>
  40959. <dt><samp class="option">scale_type</samp></dt>
  40960. <dd><p>Sets the algorithm used for scaling:
  40961. </p>
  40962. <dl class="table">
  40963. <dt><var class="var">bilinear</var></dt>
  40964. <dd><p>Bilinear
  40965. </p>
  40966. <p>This is the default.
  40967. </p>
  40968. </dd>
  40969. <dt><var class="var">bicubic</var></dt>
  40970. <dd><p>Bicubic
  40971. </p>
  40972. </dd>
  40973. </dl>
  40974. </dd>
  40975. <dt><samp class="option">format</samp></dt>
  40976. <dd><p>Controls the output pixel format. By default, or if none is specified, the input
  40977. pixel format is used.
  40978. </p>
  40979. </dd>
  40980. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  40981. <dt><samp class="option">force_divisible_by</samp></dt>
  40982. <dd><p>Work the same as the identical <a class="ref" href="#scale">scale</a> filter options.
  40983. </p>
  40984. </dd>
  40985. <dt><samp class="option">reset_sar</samp></dt>
  40986. <dd><p>Works the same as the identical <a class="ref" href="#scale">scale</a> filter option.
  40987. </p>
  40988. <a class="anchor" id="color_005fprofile"></a></dd>
  40989. <dt><samp class="option">color_profile</samp></dt>
  40990. <dd><p>Specify all color properties at once.
  40991. </p>
  40992. <p>The accepted values are:
  40993. </p><dl class="table">
  40994. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  40995. <dd><p>BT.601
  40996. </p>
  40997. </dd>
  40998. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  40999. <dd><p>BT.709
  41000. </p>
  41001. </dd>
  41002. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  41003. <dd><p>BT.2020
  41004. </p>
  41005. </dd>
  41006. </dl>
  41007. </dd>
  41008. <dt><samp class="option">trc</samp></dt>
  41009. <dd><p>Specify output transfer characteristics.
  41010. </p>
  41011. <p>The accepted values are:
  41012. </p><dl class="table">
  41013. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  41014. <dd><p>BT.709
  41015. </p>
  41016. </dd>
  41017. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  41018. <dd><p>Constant gamma of 2.2
  41019. </p>
  41020. </dd>
  41021. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  41022. <dd><p>Constant gamma of 2.8
  41023. </p>
  41024. </dd>
  41025. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  41026. <dd><p>SMPTE-170M
  41027. </p>
  41028. </dd>
  41029. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  41030. <dd><p>SMPTE-240M
  41031. </p>
  41032. </dd>
  41033. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  41034. <dd><p>Linear
  41035. </p>
  41036. </dd>
  41037. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  41038. <dd><p>LOG
  41039. </p>
  41040. </dd>
  41041. <dt>&lsquo;<samp class="samp">log-sqrt</samp>&rsquo;</dt>
  41042. <dd><p>LOG_SQRT
  41043. </p>
  41044. </dd>
  41045. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  41046. <dd><p>iec61966-2-4
  41047. </p>
  41048. </dd>
  41049. <dt>&lsquo;<samp class="samp">bt1361-ecg</samp>&rsquo;</dt>
  41050. <dd><p>BT1361_ECG
  41051. </p>
  41052. </dd>
  41053. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  41054. <dd><p>iec61966-2-1
  41055. </p>
  41056. </dd>
  41057. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  41058. <dd><p>BT.2020 for 10-bits content
  41059. </p>
  41060. </dd>
  41061. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  41062. <dd><p>BT.2020 for 12-bits content
  41063. </p>
  41064. </dd>
  41065. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  41066. <dd><p>SMPTE2084
  41067. </p>
  41068. </dd>
  41069. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  41070. <dd><p>SMPTE428
  41071. </p>
  41072. </dd>
  41073. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  41074. <dd><p>ARIB_STD_B67
  41075. </p>
  41076. </dd>
  41077. </dl>
  41078. </dd>
  41079. <dt><samp class="option">primaries</samp></dt>
  41080. <dd><p>Specify output color primaries.
  41081. </p>
  41082. <p>The accepted values are:
  41083. </p><dl class="table">
  41084. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  41085. <dd><p>BT.709
  41086. </p>
  41087. </dd>
  41088. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  41089. <dd><p>BT.470M
  41090. </p>
  41091. </dd>
  41092. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  41093. <dd><p>BT.470BG or BT.601-6 625
  41094. </p>
  41095. </dd>
  41096. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  41097. <dd><p>SMPTE-170M or BT.601-6 525
  41098. </p>
  41099. </dd>
  41100. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  41101. <dd><p>SMPTE-240M
  41102. </p>
  41103. </dd>
  41104. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  41105. <dd><p>film
  41106. </p>
  41107. </dd>
  41108. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  41109. <dd><p>BT.2020
  41110. </p>
  41111. </dd>
  41112. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  41113. <dd><p>SMPTE-428
  41114. </p>
  41115. </dd>
  41116. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  41117. <dd><p>SMPTE-431
  41118. </p>
  41119. </dd>
  41120. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  41121. <dd><p>SMPTE-432
  41122. </p>
  41123. </dd>
  41124. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  41125. <dd><p>JEDEC P22 phosphors
  41126. </p>
  41127. </dd>
  41128. </dl>
  41129. </dd>
  41130. </dl>
  41131. <a name="Examples-154"></a>
  41132. <h4 class="subsection">32.276.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-154" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-154" aria-hidden="true">TOC</a></span></h4>
  41133. <ul class="itemize mark-bullet">
  41134. <li>Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p.
  41135. <div class="example">
  41136. <pre class="example-preformatted">vpp_amf=-2:720:format=yuv420p
  41137. </pre></div>
  41138. </li><li>Upscale to 4K and change color profile to bt2020.
  41139. <div class="example">
  41140. <pre class="example-preformatted">vpp_amf=4096:2160:color_profile=bt2020
  41141. </pre></div>
  41142. </li></ul>
  41143. <a class="anchor" id="vstack"></a><a name="vstack-1"></a>
  41144. <h3 class="section">32.277 vstack<span class="pull-right"><a class="anchor hidden-xs" href="#vstack-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vstack-1" aria-hidden="true">TOC</a></span></h3>
  41145. <p>Stack input videos vertically.
  41146. </p>
  41147. <p>All streams must be of same pixel format and of same width.
  41148. </p>
  41149. <p>Note that this filter is faster than using <a class="ref" href="#overlay">overlay</a> and <a class="ref" href="#pad">pad</a> filter
  41150. to create same output.
  41151. </p>
  41152. <p>The filter accepts the following options:
  41153. </p>
  41154. <dl class="table">
  41155. <dt><samp class="option">inputs</samp></dt>
  41156. <dd><p>Set number of input streams. Default is 2.
  41157. </p>
  41158. </dd>
  41159. <dt><samp class="option">shortest</samp></dt>
  41160. <dd><p>If set to 1, force the output to terminate when the shortest input
  41161. terminates. Default value is 0.
  41162. </p></dd>
  41163. </dl>
  41164. <a name="w3fdif"></a>
  41165. <h3 class="section">32.278 w3fdif<span class="pull-right"><a class="anchor hidden-xs" href="#w3fdif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-w3fdif" aria-hidden="true">TOC</a></span></h3>
  41166. <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
  41167. Deinterlacing Filter&quot;).
  41168. </p>
  41169. <p>Based on the process described by Martin Weston for BBC R&amp;D, and
  41170. implemented based on the de-interlace algorithm written by Jim
  41171. Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
  41172. uses filter coefficients calculated by BBC R&amp;D.
  41173. </p>
  41174. <p>This filter uses field-dominance information in frame to decide which
  41175. of each pair of fields to place first in the output.
  41176. If it gets it wrong use <a class="ref" href="#setfield">setfield</a> filter before <code class="code">w3fdif</code> filter.
  41177. </p>
  41178. <p>There are two sets of filter coefficients, so called &quot;simple&quot;
  41179. and &quot;complex&quot;. Which set of filter coefficients is used can
  41180. be set by passing an optional parameter:
  41181. </p>
  41182. <dl class="table">
  41183. <dt><samp class="option">filter</samp></dt>
  41184. <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
  41185. </p>
  41186. <dl class="table">
  41187. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  41188. <dd><p>Simple filter coefficient set.
  41189. </p></dd>
  41190. <dt>&lsquo;<samp class="samp">complex</samp>&rsquo;</dt>
  41191. <dd><p>More-complex filter coefficient set.
  41192. </p></dd>
  41193. </dl>
  41194. <p>Default value is &lsquo;<samp class="samp">complex</samp>&rsquo;.
  41195. </p>
  41196. </dd>
  41197. <dt><samp class="option">mode</samp></dt>
  41198. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  41199. </p>
  41200. <dl class="table">
  41201. <dt><samp class="option">frame</samp></dt>
  41202. <dd><p>Output one frame for each frame.
  41203. </p></dd>
  41204. <dt><samp class="option">field</samp></dt>
  41205. <dd><p>Output one frame for each field.
  41206. </p></dd>
  41207. </dl>
  41208. <p>The default value is <code class="code">field</code>.
  41209. </p>
  41210. </dd>
  41211. <dt><samp class="option">parity</samp></dt>
  41212. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  41213. of the following values:
  41214. </p>
  41215. <dl class="table">
  41216. <dt><samp class="option">tff</samp></dt>
  41217. <dd><p>Assume the top field is first.
  41218. </p></dd>
  41219. <dt><samp class="option">bff</samp></dt>
  41220. <dd><p>Assume the bottom field is first.
  41221. </p></dd>
  41222. <dt><samp class="option">auto</samp></dt>
  41223. <dd><p>Enable automatic detection of field parity.
  41224. </p></dd>
  41225. </dl>
  41226. <p>The default value is <code class="code">auto</code>.
  41227. If the interlacing is unknown or the decoder does not export this information,
  41228. top field first will be assumed.
  41229. </p>
  41230. </dd>
  41231. <dt><samp class="option">deint</samp></dt>
  41232. <dd><p>Specify which frames to deinterlace. Accepts one of the following values:
  41233. </p>
  41234. <dl class="table">
  41235. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  41236. <dd><p>Deinterlace all frames,
  41237. </p></dd>
  41238. <dt>&lsquo;<samp class="samp">interlaced</samp>&rsquo;</dt>
  41239. <dd><p>Only deinterlace frames marked as interlaced.
  41240. </p></dd>
  41241. </dl>
  41242. <p>Default value is &lsquo;<samp class="samp">all</samp>&rsquo;.
  41243. </p></dd>
  41244. </dl>
  41245. <a name="Commands-152"></a>
  41246. <h4 class="subsection">32.278.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-152" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-152" aria-hidden="true">TOC</a></span></h4>
  41247. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  41248. </p>
  41249. <a name="waveform"></a>
  41250. <h3 class="section">32.279 waveform<span class="pull-right"><a class="anchor hidden-xs" href="#waveform" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-waveform" aria-hidden="true">TOC</a></span></h3>
  41251. <p>Video waveform monitor.
  41252. </p>
  41253. <p>The waveform monitor plots color component intensity. By default luma
  41254. only. Each column of the waveform corresponds to a column of pixels in the
  41255. source video.
  41256. </p>
  41257. <p>It accepts the following options:
  41258. </p>
  41259. <dl class="table">
  41260. <dt><samp class="option">mode, m</samp></dt>
  41261. <dd><p>Can be either <code class="code">row</code>, or <code class="code">column</code>. Default is <code class="code">column</code>.
  41262. In row mode, the graph on the left side represents color component value 0 and
  41263. the right side represents value = 255. In column mode, the top side represents
  41264. color component value = 0 and bottom side represents value = 255.
  41265. </p>
  41266. </dd>
  41267. <dt><samp class="option">intensity, i</samp></dt>
  41268. <dd><p>Set intensity. Smaller values are useful to find out how many values of the same
  41269. luminance are distributed across input rows/columns.
  41270. Default value is <code class="code">0.04</code>. Allowed range is [0, 1].
  41271. </p>
  41272. </dd>
  41273. <dt><samp class="option">mirror, r</samp></dt>
  41274. <dd><p>Set mirroring mode. <code class="code">0</code> means unmirrored, <code class="code">1</code> means mirrored.
  41275. In mirrored mode, higher values will be represented on the left
  41276. side for <code class="code">row</code> mode and at the top for <code class="code">column</code> mode. Default is
  41277. <code class="code">1</code> (mirrored).
  41278. </p>
  41279. </dd>
  41280. <dt><samp class="option">display, d</samp></dt>
  41281. <dd><p>Set display mode.
  41282. It accepts the following values:
  41283. </p><dl class="table">
  41284. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  41285. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  41286. that the graphs representing color components are superimposed directly
  41287. over one another.
  41288. </p>
  41289. <p>This display mode makes it easier to spot relative differences or similarities
  41290. in overlapping areas of the color components that are supposed to be identical,
  41291. such as neutral whites, grays, or blacks.
  41292. </p>
  41293. </dd>
  41294. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  41295. <dd><p>Display separate graph for the color components side by side in
  41296. <code class="code">row</code> mode or one below the other in <code class="code">column</code> mode.
  41297. </p>
  41298. </dd>
  41299. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  41300. <dd><p>Display separate graph for the color components side by side in
  41301. <code class="code">column</code> mode or one below the other in <code class="code">row</code> mode.
  41302. </p>
  41303. <p>Using this display mode makes it easy to spot color casts in the highlights
  41304. and shadows of an image, by comparing the contours of the top and the bottom
  41305. graphs of each waveform. Since whites, grays, and blacks are characterized
  41306. by exactly equal amounts of red, green, and blue, neutral areas of the picture
  41307. should display three waveforms of roughly equal width/height. If not, the
  41308. correction is easy to perform by making level adjustments the three waveforms.
  41309. </p></dd>
  41310. </dl>
  41311. <p>Default is <code class="code">stack</code>.
  41312. </p>
  41313. </dd>
  41314. <dt><samp class="option">components, c</samp></dt>
  41315. <dd><p>Set which color components to display. Default is 1, which means only luma
  41316. or red color component if input is in RGB colorspace. If is set for example to
  41317. 7 it will display all 3 (if) available color components.
  41318. </p>
  41319. </dd>
  41320. <dt><samp class="option">envelope, e</samp></dt>
  41321. <dd><dl class="table">
  41322. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  41323. <dd><p>No envelope, this is default.
  41324. </p>
  41325. </dd>
  41326. <dt>&lsquo;<samp class="samp">instant</samp>&rsquo;</dt>
  41327. <dd><p>Instant envelope, minimum and maximum values presented in graph will be easily
  41328. visible even with small <code class="code">step</code> value.
  41329. </p>
  41330. </dd>
  41331. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  41332. <dd><p>Hold minimum and maximum values presented in graph across time. This way you
  41333. can still spot out of range values without constantly looking at waveforms.
  41334. </p>
  41335. </dd>
  41336. <dt>&lsquo;<samp class="samp">peak+instant</samp>&rsquo;</dt>
  41337. <dd><p>Peak and instant envelope combined together.
  41338. </p></dd>
  41339. </dl>
  41340. </dd>
  41341. <dt><samp class="option">filter, f</samp></dt>
  41342. <dd><dl class="table">
  41343. <dt>&lsquo;<samp class="samp">lowpass</samp>&rsquo;</dt>
  41344. <dd><p>No filtering, this is default.
  41345. </p>
  41346. </dd>
  41347. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  41348. <dd><p>Luma and chroma combined together.
  41349. </p>
  41350. </dd>
  41351. <dt>&lsquo;<samp class="samp">aflat</samp>&rsquo;</dt>
  41352. <dd><p>Similar as above, but shows difference between blue and red chroma.
  41353. </p>
  41354. </dd>
  41355. <dt>&lsquo;<samp class="samp">xflat</samp>&rsquo;</dt>
  41356. <dd><p>Similar as above, but use different colors.
  41357. </p>
  41358. </dd>
  41359. <dt>&lsquo;<samp class="samp">yflat</samp>&rsquo;</dt>
  41360. <dd><p>Similar as above, but again with different colors.
  41361. </p>
  41362. </dd>
  41363. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  41364. <dd><p>Displays only chroma.
  41365. </p>
  41366. </dd>
  41367. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  41368. <dd><p>Displays actual color value on waveform.
  41369. </p>
  41370. </dd>
  41371. <dt>&lsquo;<samp class="samp">acolor</samp>&rsquo;</dt>
  41372. <dd><p>Similar as above, but with luma showing frequency of chroma values.
  41373. </p></dd>
  41374. </dl>
  41375. </dd>
  41376. <dt><samp class="option">graticule, g</samp></dt>
  41377. <dd><p>Set which graticule to display.
  41378. </p>
  41379. <dl class="table">
  41380. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  41381. <dd><p>Do not display graticule.
  41382. </p>
  41383. </dd>
  41384. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  41385. <dd><p>Display green graticule showing legal broadcast ranges.
  41386. </p>
  41387. </dd>
  41388. <dt>&lsquo;<samp class="samp">orange</samp>&rsquo;</dt>
  41389. <dd><p>Display orange graticule showing legal broadcast ranges.
  41390. </p>
  41391. </dd>
  41392. <dt>&lsquo;<samp class="samp">invert</samp>&rsquo;</dt>
  41393. <dd><p>Display invert graticule showing legal broadcast ranges.
  41394. </p></dd>
  41395. </dl>
  41396. </dd>
  41397. <dt><samp class="option">opacity, o</samp></dt>
  41398. <dd><p>Set graticule opacity.
  41399. </p>
  41400. </dd>
  41401. <dt><samp class="option">flags, fl</samp></dt>
  41402. <dd><p>Set graticule flags.
  41403. </p>
  41404. <dl class="table">
  41405. <dt>&lsquo;<samp class="samp">numbers</samp>&rsquo;</dt>
  41406. <dd><p>Draw numbers above lines. By default enabled.
  41407. </p>
  41408. </dd>
  41409. <dt>&lsquo;<samp class="samp">dots</samp>&rsquo;</dt>
  41410. <dd><p>Draw dots instead of lines.
  41411. </p></dd>
  41412. </dl>
  41413. </dd>
  41414. <dt><samp class="option">scale, s</samp></dt>
  41415. <dd><p>Set scale used for displaying graticule.
  41416. </p>
  41417. <dl class="table">
  41418. <dt>&lsquo;<samp class="samp">digital</samp>&rsquo;</dt>
  41419. <dt>&lsquo;<samp class="samp">millivolts</samp>&rsquo;</dt>
  41420. <dt>&lsquo;<samp class="samp">ire</samp>&rsquo;</dt>
  41421. </dl>
  41422. <p>Default is digital.
  41423. </p>
  41424. </dd>
  41425. <dt><samp class="option">bgopacity, b</samp></dt>
  41426. <dd><p>Set background opacity.
  41427. </p>
  41428. </dd>
  41429. <dt><samp class="option">tint0, t0</samp></dt>
  41430. <dt><samp class="option">tint1, t1</samp></dt>
  41431. <dd><p>Set tint for output.
  41432. Only used with lowpass filter and when display is not overlay and input
  41433. pixel formats are not RGB.
  41434. </p>
  41435. </dd>
  41436. <dt><samp class="option">fitmode, fm</samp></dt>
  41437. <dd><p>Set sample aspect ratio of video output frames.
  41438. Can be used to configure waveform so it is not
  41439. stretched too much in one of directions.
  41440. </p>
  41441. <dl class="table">
  41442. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  41443. <dd><p>Set sample aspect ration to 1/1.
  41444. </p></dd>
  41445. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  41446. <dd><p>Set sample aspect ratio to match input size of video
  41447. </p></dd>
  41448. </dl>
  41449. <p>Default is &lsquo;<samp class="samp">none</samp>&rsquo;.
  41450. </p>
  41451. </dd>
  41452. <dt><samp class="option">input</samp></dt>
  41453. <dd><p>Set input formats for filter to pick from.
  41454. Can be &lsquo;<samp class="samp">all</samp>&rsquo;, for selecting from all available formats,
  41455. or &lsquo;<samp class="samp">first</samp>&rsquo;, for selecting first available format.
  41456. Default is &lsquo;<samp class="samp">first</samp>&rsquo;.
  41457. </p></dd>
  41458. </dl>
  41459. <a name="weave_002c-doubleweave"></a>
  41460. <h3 class="section">32.280 weave, doubleweave<span class="pull-right"><a class="anchor hidden-xs" href="#weave_002c-doubleweave" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-weave_002c-doubleweave" aria-hidden="true">TOC</a></span></h3>
  41461. <p>The <code class="code">weave</code> takes a field-based video input and join
  41462. each two sequential fields into single frame, producing a new double
  41463. height clip with half the frame rate and half the frame count.
  41464. </p>
  41465. <p>The <code class="code">doubleweave</code> works same as <code class="code">weave</code> but without
  41466. halving frame rate and frame count.
  41467. </p>
  41468. <p>It accepts the following option:
  41469. </p>
  41470. <dl class="table">
  41471. <dt><samp class="option">first_field</samp></dt>
  41472. <dd><p>Set first field. Available values are:
  41473. </p>
  41474. <dl class="table">
  41475. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  41476. <dd><p>Set the frame as top-field-first.
  41477. </p>
  41478. </dd>
  41479. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  41480. <dd><p>Set the frame as bottom-field-first.
  41481. </p></dd>
  41482. </dl>
  41483. </dd>
  41484. </dl>
  41485. <a name="Examples-155"></a>
  41486. <h4 class="subsection">32.280.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-155" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-155" aria-hidden="true">TOC</a></span></h4>
  41487. <ul class="itemize mark-bullet">
  41488. <li>Interlace video using <a class="ref" href="#select">select</a> and <a class="ref" href="#separatefields">separatefields</a> filter:
  41489. <div class="example">
  41490. <pre class="example-preformatted">separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
  41491. </pre></div>
  41492. </li></ul>
  41493. <a name="xbr"></a>
  41494. <h3 class="section">32.281 xbr<span class="pull-right"><a class="anchor hidden-xs" href="#xbr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xbr" aria-hidden="true">TOC</a></span></h3>
  41495. <p>Apply the xBR high-quality magnification filter which is designed for pixel
  41496. art. It follows a set of edge-detection rules, see
  41497. <a class="url" href="https://forums.libretro.com/t/xbr-algorithm-tutorial/123">https://forums.libretro.com/t/xbr-algorithm-tutorial/123</a>.
  41498. </p>
  41499. <p>It accepts the following option:
  41500. </p>
  41501. <dl class="table">
  41502. <dt><samp class="option">n</samp></dt>
  41503. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">2xBR</code>, <code class="code">3</code> for
  41504. <code class="code">3xBR</code> and <code class="code">4</code> for <code class="code">4xBR</code>.
  41505. Default is <code class="code">3</code>.
  41506. </p></dd>
  41507. </dl>
  41508. <a name="xcorrelate"></a>
  41509. <h3 class="section">32.282 xcorrelate<span class="pull-right"><a class="anchor hidden-xs" href="#xcorrelate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xcorrelate" aria-hidden="true">TOC</a></span></h3>
  41510. <p>Apply normalized cross-correlation between first and second input video stream.
  41511. </p>
  41512. <p>Second input video stream dimensions must be lower than first input video stream.
  41513. </p>
  41514. <p>The filter accepts the following options:
  41515. </p>
  41516. <dl class="table">
  41517. <dt><samp class="option">planes</samp></dt>
  41518. <dd><p>Set which planes to process.
  41519. </p>
  41520. </dd>
  41521. <dt><samp class="option">secondary</samp></dt>
  41522. <dd><p>Set which secondary video frames will be processed from second input video stream,
  41523. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  41524. </p></dd>
  41525. </dl>
  41526. <p>The <code class="code">xcorrelate</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  41527. </p>
  41528. <a name="xfade"></a>
  41529. <h3 class="section">32.283 xfade<span class="pull-right"><a class="anchor hidden-xs" href="#xfade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xfade" aria-hidden="true">TOC</a></span></h3>
  41530. <p>Apply cross fade from one input video stream to another input video stream.
  41531. The cross fade is applied for specified duration.
  41532. </p>
  41533. <p>Both inputs must be constant frame-rate and have the same resolution, pixel format,
  41534. frame rate and timebase.
  41535. </p>
  41536. <p>The filter accepts the following options:
  41537. </p>
  41538. <dl class="table">
  41539. <dt><samp class="option">transition</samp></dt>
  41540. <dd><p>Set one of available transition effects:
  41541. </p>
  41542. <dl class="table">
  41543. <dt>&lsquo;<samp class="samp">custom</samp>&rsquo;</dt>
  41544. <dt>&lsquo;<samp class="samp">fade</samp>&rsquo;</dt>
  41545. <dt>&lsquo;<samp class="samp">wipeleft</samp>&rsquo;</dt>
  41546. <dt>&lsquo;<samp class="samp">wiperight</samp>&rsquo;</dt>
  41547. <dt>&lsquo;<samp class="samp">wipeup</samp>&rsquo;</dt>
  41548. <dt>&lsquo;<samp class="samp">wipedown</samp>&rsquo;</dt>
  41549. <dt>&lsquo;<samp class="samp">slideleft</samp>&rsquo;</dt>
  41550. <dt>&lsquo;<samp class="samp">slideright</samp>&rsquo;</dt>
  41551. <dt>&lsquo;<samp class="samp">slideup</samp>&rsquo;</dt>
  41552. <dt>&lsquo;<samp class="samp">slidedown</samp>&rsquo;</dt>
  41553. <dt>&lsquo;<samp class="samp">circlecrop</samp>&rsquo;</dt>
  41554. <dt>&lsquo;<samp class="samp">rectcrop</samp>&rsquo;</dt>
  41555. <dt>&lsquo;<samp class="samp">distance</samp>&rsquo;</dt>
  41556. <dt>&lsquo;<samp class="samp">fadeblack</samp>&rsquo;</dt>
  41557. <dt>&lsquo;<samp class="samp">fadewhite</samp>&rsquo;</dt>
  41558. <dt>&lsquo;<samp class="samp">radial</samp>&rsquo;</dt>
  41559. <dt>&lsquo;<samp class="samp">smoothleft</samp>&rsquo;</dt>
  41560. <dt>&lsquo;<samp class="samp">smoothright</samp>&rsquo;</dt>
  41561. <dt>&lsquo;<samp class="samp">smoothup</samp>&rsquo;</dt>
  41562. <dt>&lsquo;<samp class="samp">smoothdown</samp>&rsquo;</dt>
  41563. <dt>&lsquo;<samp class="samp">circleopen</samp>&rsquo;</dt>
  41564. <dt>&lsquo;<samp class="samp">circleclose</samp>&rsquo;</dt>
  41565. <dt>&lsquo;<samp class="samp">vertopen</samp>&rsquo;</dt>
  41566. <dt>&lsquo;<samp class="samp">vertclose</samp>&rsquo;</dt>
  41567. <dt>&lsquo;<samp class="samp">horzopen</samp>&rsquo;</dt>
  41568. <dt>&lsquo;<samp class="samp">horzclose</samp>&rsquo;</dt>
  41569. <dt>&lsquo;<samp class="samp">dissolve</samp>&rsquo;</dt>
  41570. <dt>&lsquo;<samp class="samp">pixelize</samp>&rsquo;</dt>
  41571. <dt>&lsquo;<samp class="samp">diagtl</samp>&rsquo;</dt>
  41572. <dt>&lsquo;<samp class="samp">diagtr</samp>&rsquo;</dt>
  41573. <dt>&lsquo;<samp class="samp">diagbl</samp>&rsquo;</dt>
  41574. <dt>&lsquo;<samp class="samp">diagbr</samp>&rsquo;</dt>
  41575. <dt>&lsquo;<samp class="samp">hlslice</samp>&rsquo;</dt>
  41576. <dt>&lsquo;<samp class="samp">hrslice</samp>&rsquo;</dt>
  41577. <dt>&lsquo;<samp class="samp">vuslice</samp>&rsquo;</dt>
  41578. <dt>&lsquo;<samp class="samp">vdslice</samp>&rsquo;</dt>
  41579. <dt>&lsquo;<samp class="samp">hblur</samp>&rsquo;</dt>
  41580. <dt>&lsquo;<samp class="samp">fadegrays</samp>&rsquo;</dt>
  41581. <dt>&lsquo;<samp class="samp">wipetl</samp>&rsquo;</dt>
  41582. <dt>&lsquo;<samp class="samp">wipetr</samp>&rsquo;</dt>
  41583. <dt>&lsquo;<samp class="samp">wipebl</samp>&rsquo;</dt>
  41584. <dt>&lsquo;<samp class="samp">wipebr</samp>&rsquo;</dt>
  41585. <dt>&lsquo;<samp class="samp">squeezeh</samp>&rsquo;</dt>
  41586. <dt>&lsquo;<samp class="samp">squeezev</samp>&rsquo;</dt>
  41587. <dt>&lsquo;<samp class="samp">zoomin</samp>&rsquo;</dt>
  41588. <dt>&lsquo;<samp class="samp">fadefast</samp>&rsquo;</dt>
  41589. <dt>&lsquo;<samp class="samp">fadeslow</samp>&rsquo;</dt>
  41590. <dt>&lsquo;<samp class="samp">hlwind</samp>&rsquo;</dt>
  41591. <dt>&lsquo;<samp class="samp">hrwind</samp>&rsquo;</dt>
  41592. <dt>&lsquo;<samp class="samp">vuwind</samp>&rsquo;</dt>
  41593. <dt>&lsquo;<samp class="samp">vdwind</samp>&rsquo;</dt>
  41594. <dt>&lsquo;<samp class="samp">coverleft</samp>&rsquo;</dt>
  41595. <dt>&lsquo;<samp class="samp">coverright</samp>&rsquo;</dt>
  41596. <dt>&lsquo;<samp class="samp">coverup</samp>&rsquo;</dt>
  41597. <dt>&lsquo;<samp class="samp">coverdown</samp>&rsquo;</dt>
  41598. <dt>&lsquo;<samp class="samp">revealleft</samp>&rsquo;</dt>
  41599. <dt>&lsquo;<samp class="samp">revealright</samp>&rsquo;</dt>
  41600. <dt>&lsquo;<samp class="samp">revealup</samp>&rsquo;</dt>
  41601. <dt>&lsquo;<samp class="samp">revealdown</samp>&rsquo;</dt>
  41602. </dl>
  41603. <p>Default transition effect is fade.
  41604. </p>
  41605. </dd>
  41606. <dt><samp class="option">duration</samp></dt>
  41607. <dd><p>Set cross fade duration in seconds.
  41608. Range is 0 to 60 seconds.
  41609. Default duration is 1 second.
  41610. </p>
  41611. </dd>
  41612. <dt><samp class="option">offset</samp></dt>
  41613. <dd><p>Set cross fade start relative to first input stream in seconds.
  41614. Default offset is 0.
  41615. </p>
  41616. </dd>
  41617. <dt><samp class="option">expr</samp></dt>
  41618. <dd><p>Set expression for custom transition effect.
  41619. </p>
  41620. <p>The expressions can use the following variables and functions:
  41621. </p>
  41622. <dl class="table">
  41623. <dt><samp class="option">X</samp></dt>
  41624. <dt><samp class="option">Y</samp></dt>
  41625. <dd><p>The coordinates of the current sample.
  41626. </p>
  41627. </dd>
  41628. <dt><samp class="option">W</samp></dt>
  41629. <dt><samp class="option">H</samp></dt>
  41630. <dd><p>The width and height of the image.
  41631. </p>
  41632. </dd>
  41633. <dt><samp class="option">P</samp></dt>
  41634. <dd><p>Progress of transition effect.
  41635. </p>
  41636. </dd>
  41637. <dt><samp class="option">PLANE</samp></dt>
  41638. <dd><p>Currently processed plane.
  41639. </p>
  41640. </dd>
  41641. <dt><samp class="option">A</samp></dt>
  41642. <dd><p>Return value of first input at current location and plane.
  41643. </p>
  41644. </dd>
  41645. <dt><samp class="option">B</samp></dt>
  41646. <dd><p>Return value of second input at current location and plane.
  41647. </p>
  41648. </dd>
  41649. <dt><samp class="option">a0(x, y)</samp></dt>
  41650. <dt><samp class="option">a1(x, y)</samp></dt>
  41651. <dt><samp class="option">a2(x, y)</samp></dt>
  41652. <dt><samp class="option">a3(x, y)</samp></dt>
  41653. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  41654. first/second/third/fourth component of first input.
  41655. </p>
  41656. </dd>
  41657. <dt><samp class="option">b0(x, y)</samp></dt>
  41658. <dt><samp class="option">b1(x, y)</samp></dt>
  41659. <dt><samp class="option">b2(x, y)</samp></dt>
  41660. <dt><samp class="option">b3(x, y)</samp></dt>
  41661. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  41662. first/second/third/fourth component of second input.
  41663. </p></dd>
  41664. </dl>
  41665. </dd>
  41666. </dl>
  41667. <a name="Examples-156"></a>
  41668. <h4 class="subsection">32.283.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-156" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-156" aria-hidden="true">TOC</a></span></h4>
  41669. <ul class="itemize mark-bullet">
  41670. <li>Cross fade from one input video to another input video, with fade transition and duration of transition
  41671. of 2 seconds starting at offset of 5 seconds:
  41672. <div class="example">
  41673. <pre class="example-preformatted">ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
  41674. </pre></div>
  41675. </li></ul>
  41676. <a name="xmedian"></a>
  41677. <h3 class="section">32.284 xmedian<span class="pull-right"><a class="anchor hidden-xs" href="#xmedian" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xmedian" aria-hidden="true">TOC</a></span></h3>
  41678. <p>Pick median pixels from several input videos.
  41679. </p>
  41680. <p>The filter accepts the following options:
  41681. </p>
  41682. <dl class="table">
  41683. <dt><samp class="option">inputs</samp></dt>
  41684. <dd><p>Set number of inputs.
  41685. Default is 3. Allowed range is from 3 to 255.
  41686. If number of inputs is even number, than result will be mean value between two median values.
  41687. </p>
  41688. </dd>
  41689. <dt><samp class="option">planes</samp></dt>
  41690. <dd><p>Set which planes to filter. Default value is <code class="code">15</code>, by which all planes are processed.
  41691. </p>
  41692. </dd>
  41693. <dt><samp class="option">percentile</samp></dt>
  41694. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  41695. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  41696. minimum values, and <code class="code">1</code> maximum values.
  41697. </p></dd>
  41698. </dl>
  41699. <a name="Commands-153"></a>
  41700. <h4 class="subsection">32.284.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-153" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-153" aria-hidden="true">TOC</a></span></h4>
  41701. <p>This filter supports all above options as <a class="ref" href="#commands">commands</a>, excluding option <code class="code">inputs</code>.
  41702. </p>
  41703. <a class="anchor" id="xpsnr"></a><a name="xpsnr-1"></a>
  41704. <h3 class="section">32.285 xpsnr<span class="pull-right"><a class="anchor hidden-xs" href="#xpsnr-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xpsnr-1" aria-hidden="true">TOC</a></span></h3>
  41705. <p>Obtain the average (across all input frames) and minimum (across all color plane averages)
  41706. eXtended Perceptually weighted peak Signal-to-Noise Ratio (XPSNR) between two input videos.
  41707. </p>
  41708. <p>The XPSNR is a low-complexity psychovisually motivated distortion measurement algorithm for
  41709. assessing the difference between two video streams or images. This is especially useful for
  41710. objectively quantifying the distortions caused by video and image codecs, as an alternative
  41711. to a formal subjective test. The logarithmic XPSNR output values are in a similar range as
  41712. those of traditional <a class="ref" href="#psnr">psnr</a> assessments but better reflect human impressions of visual
  41713. coding quality. More details on the XPSNR measure, which essentially represents a blockwise
  41714. weighted variant of the PSNR measure, can be found in the following freely available papers:
  41715. </p>
  41716. <ul class="itemize mark-bullet">
  41717. <li>C. R. Helmrich, M. Siekmann, S. Becker, S. Bosse, D. Marpe, and T. Wiegand, &quot;XPSNR: A
  41718. Low-Complexity Extension of the Perceptually Weighted Peak Signal-to-Noise Ratio for
  41719. High-Resolution Video Quality Assessment,&quot; in Proc. IEEE Int. Conf. Acoustics, Speech,
  41720. Sig. Process. (ICASSP), virt./online, May 2020. <a class="url" href="www.ecodis.de/xpsnr.htm">www.ecodis.de/xpsnr.htm</a>
  41721. </li><li>C. R. Helmrich, S. Bosse, H. Schwarz, D. Marpe, and T. Wiegand, &quot;A Study of the
  41722. Extended Perceptually Weighted Peak Signal-to-Noise Ratio (XPSNR) for Video Compression
  41723. with Different Resolutions and Bit Depths,&quot; ITU Journal: ICT Discoveries, vol. 3, no.
  41724. 1, pp. 65 - 72, May 2020. <a class="url" href="http://handle.itu.int/11.1002/pub/8153d78b-en">http://handle.itu.int/11.1002/pub/8153d78b-en</a>
  41725. </li></ul>
  41726. <p>When publishing the results of XPSNR assessments obtained using, e.g., this FFmpeg filter, a
  41727. reference to the above papers as a means of documentation is strongly encouraged. The filter
  41728. requires two input videos. The first input is considered a (usually not distorted) reference
  41729. source and is passed unchanged to the output, whereas the second input is a (distorted) test
  41730. signal. Except for the bit depth, these two video inputs must have the same pixel format. In
  41731. addition, for best performance, both compared input videos should be in YCbCr color format.
  41732. </p>
  41733. <p>The obtained overall XPSNR values mentioned above are printed through the logging system. In
  41734. case of input with multiple color planes, we suggest reporting of the minimum XPSNR average.
  41735. </p>
  41736. <p>The following parameter, which behaves like the one for the <a class="ref" href="#psnr">psnr</a> filter, is accepted:
  41737. </p>
  41738. <dl class="table">
  41739. <dt><samp class="option">stats_file, f</samp></dt>
  41740. <dd><p>If specified, the filter will use the named file to save the XPSNR value of each individual
  41741. frame and color plane. When the file name equals &quot;-&quot;, that data is sent to standard output.
  41742. </p></dd>
  41743. </dl>
  41744. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  41745. </p>
  41746. <a name="Examples-157"></a>
  41747. <h4 class="subsection">32.285.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-157" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-157" aria-hidden="true">TOC</a></span></h4>
  41748. <ul class="itemize mark-bullet">
  41749. <li>XPSNR analysis of two 1080p HD videos, ref_source.yuv and test_video.yuv, both at 24 frames
  41750. per second, with color format 4:2:0, bit depth 8, and output of a logfile named &quot;xpsnr.log&quot;:
  41751. <div class="example">
  41752. <pre class="example-preformatted">ffmpeg -s 1920x1080 -framerate 24 -pix_fmt yuv420p -i ref_source.yuv -s 1920x1080 -framerate
  41753. 24 -pix_fmt yuv420p -i test_video.yuv -lavfi xpsnr=&quot;stats_file=xpsnr.log&quot; -f null -
  41754. </pre></div>
  41755. </li><li>XPSNR analysis of two 2160p UHD videos, ref_source.yuv with bit depth 8 and test_video.yuv
  41756. with bit depth 10, both at 60 frames per second with color format 4:2:0, no logfile output:
  41757. <div class="example">
  41758. <pre class="example-preformatted">ffmpeg -s 3840x2160 -framerate 60 -pix_fmt yuv420p -i ref_source.yuv -s 3840x2160 -framerate
  41759. 60 -pix_fmt yuv420p10le -i test_video.yuv -lavfi xpsnr=&quot;stats_file=-&quot; -f null -
  41760. </pre></div>
  41761. </li></ul>
  41762. <a class="anchor" id="xstack"></a><a name="xstack-1"></a>
  41763. <h3 class="section">32.286 xstack<span class="pull-right"><a class="anchor hidden-xs" href="#xstack-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xstack-1" aria-hidden="true">TOC</a></span></h3>
  41764. <p>Stack video inputs into custom layout.
  41765. </p>
  41766. <p>All streams must be of same pixel format.
  41767. </p>
  41768. <p>The filter accepts the following options:
  41769. </p>
  41770. <dl class="table">
  41771. <dt><samp class="option">inputs</samp></dt>
  41772. <dd><p>Set number of input streams. Default is 2.
  41773. </p>
  41774. </dd>
  41775. <dt><samp class="option">layout</samp></dt>
  41776. <dd><p>Specify layout of inputs.
  41777. This option requires the desired layout configuration to be explicitly set by the user.
  41778. This sets position of each video input in output. Each input
  41779. is separated by &rsquo;|&rsquo;.
  41780. The first number represents the column, and the second number represents the row.
  41781. Numbers start at 0 and are separated by &rsquo;_&rsquo;. Optionally one can use wX and hX,
  41782. where X is video input from which to take width or height.
  41783. Multiple values can be used when separated by &rsquo;+&rsquo;. In such
  41784. case values are summed together.
  41785. </p>
  41786. <p>Note that if inputs are of different sizes gaps may appear, as not all of
  41787. the output video frame will be filled. Similarly, videos can overlap each
  41788. other if their position doesn&rsquo;t leave enough space for the full frame of
  41789. adjoining videos.
  41790. </p>
  41791. <p>For 2 inputs, a default layout of <code class="code">0_0|w0_0</code> (equivalent to
  41792. <code class="code">grid=2x1</code>) is set. In all other cases, a layout or a grid must be set by
  41793. the user. Either <code class="code">grid</code> or <code class="code">layout</code> can be specified at a time.
  41794. Specifying both will result in an error.
  41795. </p>
  41796. </dd>
  41797. <dt><samp class="option">grid</samp></dt>
  41798. <dd><p>Specify a fixed size grid of inputs.
  41799. This option is used to create a fixed size grid of the input streams. Set the
  41800. grid size in the form <code class="code">COLUMNSxROWS</code>. There must be <code class="code">ROWS * COLUMNS</code>
  41801. input streams and they will be arranged as a grid with <code class="code">ROWS</code> rows and
  41802. <code class="code">COLUMNS</code> columns. When using this option, each input stream within a row
  41803. must have the same height and all the rows must have the same width.
  41804. </p>
  41805. <p>If <code class="code">grid</code> is set, then <code class="code">inputs</code> option is ignored and is implicitly
  41806. set to <code class="code">ROWS * COLUMNS</code>.
  41807. </p>
  41808. <p>For 2 inputs, a default grid of <code class="code">2x1</code> (equivalent to
  41809. <code class="code">layout=0_0|w0_0</code>) is set. In all other cases, a layout or a grid must be
  41810. set by the user. Either <code class="code">grid</code> or <code class="code">layout</code> can be specified at a time.
  41811. Specifying both will result in an error.
  41812. </p>
  41813. </dd>
  41814. <dt><samp class="option">shortest</samp></dt>
  41815. <dd><p>If set to 1, force the output to terminate when the shortest input
  41816. terminates. Default value is 0.
  41817. </p>
  41818. </dd>
  41819. <dt><samp class="option">fill</samp></dt>
  41820. <dd><p>If set to valid color, all unused pixels will be filled with that color.
  41821. By default fill is set to none, so it is disabled.
  41822. </p></dd>
  41823. </dl>
  41824. <a name="Examples-158"></a>
  41825. <h4 class="subsection">32.286.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-158" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-158" aria-hidden="true">TOC</a></span></h4>
  41826. <ul class="itemize mark-bullet">
  41827. <li>Display 4 inputs into 2x2 grid.
  41828. <p>Layout:
  41829. </p><div class="example">
  41830. <pre class="example-preformatted">input1(0, 0) | input3(w0, 0)
  41831. input2(0, h0) | input4(w0, h0)
  41832. </pre></div>
  41833. <div class="example">
  41834. <pre class="example-preformatted">xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
  41835. </pre></div>
  41836. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  41837. </p>
  41838. </li><li>Display 4 inputs into 1x4 grid.
  41839. <p>Layout:
  41840. </p><div class="example">
  41841. <pre class="example-preformatted">input1(0, 0)
  41842. input2(0, h0)
  41843. input3(0, h0+h1)
  41844. input4(0, h0+h1+h2)
  41845. </pre></div>
  41846. <div class="example">
  41847. <pre class="example-preformatted">xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
  41848. </pre></div>
  41849. <p>Note that if inputs are of different widths, unused space will appear.
  41850. </p>
  41851. </li><li>Display 9 inputs into 3x3 grid.
  41852. <p>Layout:
  41853. </p><div class="example">
  41854. <pre class="example-preformatted">input1(0, 0) | input4(w0, 0) | input7(w0+w3, 0)
  41855. input2(0, h0) | input5(w0, h0) | input8(w0+w3, h0)
  41856. input3(0, h0+h1) | input6(w0, h0+h1) | input9(w0+w3, h0+h1)
  41857. </pre></div>
  41858. <div class="example">
  41859. <pre class="example-preformatted">xstack=inputs=9:layout=0_0|0_h0|0_h0+h1|w0_0|w0_h0|w0_h0+h1|w0+w3_0|w0+w3_h0|w0+w3_h0+h1
  41860. </pre></div>
  41861. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  41862. </p>
  41863. </li><li>Display 16 inputs into 4x4 grid.
  41864. <p>Layout:
  41865. </p><div class="example">
  41866. <pre class="example-preformatted">input1(0, 0) | input5(w0, 0) | input9 (w0+w4, 0) | input13(w0+w4+w8, 0)
  41867. input2(0, h0) | input6(w0, h0) | input10(w0+w4, h0) | input14(w0+w4+w8, h0)
  41868. input3(0, h0+h1) | input7(w0, h0+h1) | input11(w0+w4, h0+h1) | input15(w0+w4+w8, h0+h1)
  41869. input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
  41870. </pre></div>
  41871. <div class="example">
  41872. <pre class="example-preformatted">xstack=inputs=16:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0+w4_0|
  41873. 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
  41874. </pre></div>
  41875. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  41876. </p>
  41877. </li></ul>
  41878. <a class="anchor" id="yadif"></a><a name="yadif-1"></a>
  41879. <h3 class="section">32.287 yadif<span class="pull-right"><a class="anchor hidden-xs" href="#yadif-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-yadif-1" aria-hidden="true">TOC</a></span></h3>
  41880. <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
  41881. filter&quot;).
  41882. </p>
  41883. <p>It accepts the following parameters:
  41884. </p>
  41885. <dl class="table">
  41886. <dt><samp class="option">mode</samp></dt>
  41887. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  41888. </p>
  41889. <dl class="table">
  41890. <dt><samp class="option">0, send_frame</samp></dt>
  41891. <dd><p>Output one frame for each frame.
  41892. </p></dd>
  41893. <dt><samp class="option">1, send_field</samp></dt>
  41894. <dd><p>Output one frame for each field.
  41895. </p></dd>
  41896. <dt><samp class="option">2, send_frame_nospatial</samp></dt>
  41897. <dd><p>Like <code class="code">send_frame</code>, but it skips the spatial interlacing check.
  41898. </p></dd>
  41899. <dt><samp class="option">3, send_field_nospatial</samp></dt>
  41900. <dd><p>Like <code class="code">send_field</code>, but it skips the spatial interlacing check.
  41901. </p></dd>
  41902. </dl>
  41903. <p>The default value is <code class="code">send_frame</code>.
  41904. </p>
  41905. </dd>
  41906. <dt><samp class="option">parity</samp></dt>
  41907. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  41908. of the following values:
  41909. </p>
  41910. <dl class="table">
  41911. <dt><samp class="option">0, tff</samp></dt>
  41912. <dd><p>Assume the top field is first.
  41913. </p></dd>
  41914. <dt><samp class="option">1, bff</samp></dt>
  41915. <dd><p>Assume the bottom field is first.
  41916. </p></dd>
  41917. <dt><samp class="option">-1, auto</samp></dt>
  41918. <dd><p>Enable automatic detection of field parity.
  41919. </p></dd>
  41920. </dl>
  41921. <p>The default value is <code class="code">auto</code>.
  41922. If the interlacing is unknown or the decoder does not export this information,
  41923. top field first will be assumed.
  41924. </p>
  41925. </dd>
  41926. <dt><samp class="option">deint</samp></dt>
  41927. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  41928. values:
  41929. </p>
  41930. <dl class="table">
  41931. <dt><samp class="option">0, all</samp></dt>
  41932. <dd><p>Deinterlace all frames.
  41933. </p></dd>
  41934. <dt><samp class="option">1, interlaced</samp></dt>
  41935. <dd><p>Only deinterlace frames marked as interlaced.
  41936. </p></dd>
  41937. </dl>
  41938. <p>The default value is <code class="code">all</code>.
  41939. </p></dd>
  41940. </dl>
  41941. <a name="yaepblur"></a>
  41942. <h3 class="section">32.288 yaepblur<span class="pull-right"><a class="anchor hidden-xs" href="#yaepblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-yaepblur" aria-hidden="true">TOC</a></span></h3>
  41943. <p>Apply blur filter while preserving edges (&quot;yaepblur&quot; means &quot;yet another edge preserving blur filter&quot;).
  41944. The algorithm is described in
  41945. &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;
  41946. </p>
  41947. <p>It accepts the following parameters:
  41948. </p>
  41949. <dl class="table">
  41950. <dt><samp class="option">radius, r</samp></dt>
  41951. <dd><p>Set the window radius. Default value is 3.
  41952. </p>
  41953. </dd>
  41954. <dt><samp class="option">planes, p</samp></dt>
  41955. <dd><p>Set which planes to filter. Default is only the first plane.
  41956. </p>
  41957. </dd>
  41958. <dt><samp class="option">sigma, s</samp></dt>
  41959. <dd><p>Set blur strength. Default value is 128.
  41960. </p></dd>
  41961. </dl>
  41962. <a name="Commands-154"></a>
  41963. <h4 class="subsection">32.288.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-154" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-154" aria-hidden="true">TOC</a></span></h4>
  41964. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  41965. </p>
  41966. <a name="zoompan"></a>
  41967. <h3 class="section">32.289 zoompan<span class="pull-right"><a class="anchor hidden-xs" href="#zoompan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zoompan" aria-hidden="true">TOC</a></span></h3>
  41968. <p>Apply Zoom &amp; Pan effect.
  41969. </p>
  41970. <p>This filter accepts the following options:
  41971. </p>
  41972. <dl class="table">
  41973. <dt><samp class="option">zoom, z</samp></dt>
  41974. <dd><p>Set the zoom expression. Range is 1-10. Default is 1.
  41975. </p>
  41976. </dd>
  41977. <dt><samp class="option">x</samp></dt>
  41978. <dt><samp class="option">y</samp></dt>
  41979. <dd><p>Set the x and y expression. Default is 0.
  41980. </p>
  41981. </dd>
  41982. <dt><samp class="option">d</samp></dt>
  41983. <dd><p>Set the duration expression in number of frames.
  41984. This sets for how many number of frames effect will last for
  41985. single input image. Default is 90.
  41986. </p>
  41987. </dd>
  41988. <dt><samp class="option">s</samp></dt>
  41989. <dd><p>Set the output image size, default is &rsquo;hd720&rsquo;.
  41990. </p>
  41991. </dd>
  41992. <dt><samp class="option">fps</samp></dt>
  41993. <dd><p>Set the output frame rate, default is &rsquo;25&rsquo;.
  41994. </p></dd>
  41995. </dl>
  41996. <p>Each expression can contain the following constants:
  41997. </p>
  41998. <dl class="table">
  41999. <dt><samp class="option">in_w, iw</samp></dt>
  42000. <dd><p>Input width.
  42001. </p>
  42002. </dd>
  42003. <dt><samp class="option">in_h, ih</samp></dt>
  42004. <dd><p>Input height.
  42005. </p>
  42006. </dd>
  42007. <dt><samp class="option">out_w, ow</samp></dt>
  42008. <dd><p>Output width.
  42009. </p>
  42010. </dd>
  42011. <dt><samp class="option">out_h, oh</samp></dt>
  42012. <dd><p>Output height.
  42013. </p>
  42014. </dd>
  42015. <dt><samp class="option">in</samp></dt>
  42016. <dd><p>Input frame count.
  42017. </p>
  42018. </dd>
  42019. <dt><samp class="option">on</samp></dt>
  42020. <dd><p>Output frame count.
  42021. </p>
  42022. </dd>
  42023. <dt><samp class="option">in_time, it</samp></dt>
  42024. <dd><p>The input timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  42025. </p>
  42026. </dd>
  42027. <dt><samp class="option">out_time, time, ot</samp></dt>
  42028. <dd><p>The output timestamp expressed in seconds.
  42029. </p>
  42030. </dd>
  42031. <dt><samp class="option">x</samp></dt>
  42032. <dt><samp class="option">y</samp></dt>
  42033. <dd><p>Last calculated &rsquo;x&rsquo; and &rsquo;y&rsquo; position from &rsquo;x&rsquo; and &rsquo;y&rsquo; expression
  42034. for current input frame.
  42035. </p>
  42036. </dd>
  42037. <dt><samp class="option">px</samp></dt>
  42038. <dt><samp class="option">py</samp></dt>
  42039. <dd><p>&rsquo;x&rsquo; and &rsquo;y&rsquo; of last output frame of previous input frame or 0 when there was
  42040. not yet such frame (first input frame).
  42041. </p>
  42042. </dd>
  42043. <dt><samp class="option">zoom</samp></dt>
  42044. <dd><p>Last calculated zoom from &rsquo;z&rsquo; expression for current input frame.
  42045. </p>
  42046. </dd>
  42047. <dt><samp class="option">pzoom</samp></dt>
  42048. <dd><p>Last calculated zoom of last output frame of previous input frame.
  42049. </p>
  42050. </dd>
  42051. <dt><samp class="option">duration</samp></dt>
  42052. <dd><p>Number of output frames for current input frame. Calculated from &rsquo;d&rsquo; expression
  42053. for each input frame.
  42054. </p>
  42055. </dd>
  42056. <dt><samp class="option">pduration</samp></dt>
  42057. <dd><p>number of output frames created for previous input frame
  42058. </p>
  42059. </dd>
  42060. <dt><samp class="option">a</samp></dt>
  42061. <dd><p>Rational number: input width / input height
  42062. </p>
  42063. </dd>
  42064. <dt><samp class="option">sar</samp></dt>
  42065. <dd><p>sample aspect ratio
  42066. </p>
  42067. </dd>
  42068. <dt><samp class="option">dar</samp></dt>
  42069. <dd><p>display aspect ratio
  42070. </p>
  42071. </dd>
  42072. </dl>
  42073. <a name="Examples-159"></a>
  42074. <h4 class="subsection">32.289.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-159" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-159" aria-hidden="true">TOC</a></span></h4>
  42075. <ul class="itemize mark-bullet">
  42076. <li>Zoom in up to 1.5x and pan at same time to some spot near center of picture:
  42077. <div class="example">
  42078. <pre class="example-preformatted">zoompan=z='min(zoom+0.0015,1.5)':d=700:x='if(gte(zoom,1.5),x,x+1/a)':y='if(gte(zoom,1.5),y,y+1)':s=640x360
  42079. </pre></div>
  42080. </li><li>Zoom in up to 1.5x and pan always at center of picture:
  42081. <div class="example">
  42082. <pre class="example-preformatted">zoompan=z='min(zoom+0.0015,1.5)':d=700:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  42083. </pre></div>
  42084. </li><li>Same as above but without pausing:
  42085. <div class="example">
  42086. <pre class="example-preformatted">zoompan=z='min(max(zoom,pzoom)+0.0015,1.5)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  42087. </pre></div>
  42088. </li><li>Zoom in 2x into center of picture only for the first second of the input video:
  42089. <div class="example">
  42090. <pre class="example-preformatted">zoompan=z='if(between(in_time,0,1),2,1)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  42091. </pre></div>
  42092. </li></ul>
  42093. <a class="anchor" id="zscale"></a><a name="zscale-1"></a>
  42094. <h3 class="section">32.290 zscale<span class="pull-right"><a class="anchor hidden-xs" href="#zscale-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zscale-1" aria-hidden="true">TOC</a></span></h3>
  42095. <p>Scale (resize) the input video, using the z.lib library:
  42096. <a class="url" href="https://github.com/sekrit-twc/zimg">https://github.com/sekrit-twc/zimg</a>. To enable compilation of this
  42097. filter, you need to configure FFmpeg with <code class="code">--enable-libzimg</code>.
  42098. </p>
  42099. <p>The zscale filter forces the output display aspect ratio to be the same
  42100. as the input, by changing the output sample aspect ratio.
  42101. </p>
  42102. <p>If the input image format is different from the format requested by
  42103. the next filter, the zscale filter will convert the input to the
  42104. requested format.
  42105. </p>
  42106. <a name="Options-42"></a>
  42107. <h4 class="subsection">32.290.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-42" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-42" aria-hidden="true">TOC</a></span></h4>
  42108. <p>The filter accepts the following options.
  42109. </p>
  42110. <dl class="table">
  42111. <dt><samp class="option">width, w</samp></dt>
  42112. <dt><samp class="option">height, h</samp></dt>
  42113. <dd><p>Set the output video dimension expression. Default value is the input
  42114. dimension.
  42115. </p>
  42116. <p>If the <var class="var">width</var> or <var class="var">w</var> value is 0, the input width is used for
  42117. the output. If the <var class="var">height</var> or <var class="var">h</var> value is 0, the input height
  42118. is used for the output.
  42119. </p>
  42120. <p>If one and only one of the values is -n with n &gt;= 1, the zscale filter
  42121. will use a value that maintains the aspect ratio of the input image,
  42122. calculated from the other specified dimension. After that it will,
  42123. however, make sure that the calculated dimension is divisible by n and
  42124. adjust the value if necessary.
  42125. </p>
  42126. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  42127. both values being set to 0 as previously detailed.
  42128. </p>
  42129. <p>See below for the list of accepted constants for use in the dimension
  42130. expression.
  42131. </p>
  42132. </dd>
  42133. <dt><samp class="option">size, s</samp></dt>
  42134. <dd><p>Set the video size. For the syntax of this option, check the
  42135. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  42136. </p>
  42137. </dd>
  42138. <dt><samp class="option">dither, d</samp></dt>
  42139. <dd><p>Set the dither type.
  42140. </p>
  42141. <p>Possible values are:
  42142. </p><dl class="table">
  42143. <dt><var class="var">none</var></dt>
  42144. <dt><var class="var">ordered</var></dt>
  42145. <dt><var class="var">random</var></dt>
  42146. <dt><var class="var">error_diffusion</var></dt>
  42147. </dl>
  42148. <p>Default is none.
  42149. </p>
  42150. </dd>
  42151. <dt><samp class="option">filter, f</samp></dt>
  42152. <dd><p>Set the resize filter type.
  42153. </p>
  42154. <p>Possible values are:
  42155. </p><dl class="table">
  42156. <dt><var class="var">point</var></dt>
  42157. <dt><var class="var">bilinear</var></dt>
  42158. <dt><var class="var">bicubic</var></dt>
  42159. <dt><var class="var">spline16</var></dt>
  42160. <dt><var class="var">spline36</var></dt>
  42161. <dt><var class="var">spline64</var></dt>
  42162. <dt><var class="var">lanczos</var></dt>
  42163. </dl>
  42164. <p>Default is bilinear.
  42165. </p>
  42166. </dd>
  42167. <dt><samp class="option">range, r</samp></dt>
  42168. <dd><p>Set the color range.
  42169. </p>
  42170. <p>Possible values are:
  42171. </p><dl class="table">
  42172. <dt><var class="var">input</var></dt>
  42173. <dt><var class="var">limited</var></dt>
  42174. <dt><var class="var">full</var></dt>
  42175. </dl>
  42176. <p>Default is same as input.
  42177. </p>
  42178. </dd>
  42179. <dt><samp class="option">primaries, p</samp></dt>
  42180. <dd><p>Set the color primaries.
  42181. </p>
  42182. <p>Possible values are:
  42183. </p><dl class="table">
  42184. <dt><var class="var">input</var></dt>
  42185. <dt><var class="var">709</var></dt>
  42186. <dt><var class="var">unspecified</var></dt>
  42187. <dt><var class="var">170m</var></dt>
  42188. <dt><var class="var">240m</var></dt>
  42189. <dt><var class="var">2020</var></dt>
  42190. </dl>
  42191. <p>Default is same as input.
  42192. </p>
  42193. </dd>
  42194. <dt><samp class="option">transfer, t</samp></dt>
  42195. <dd><p>Set the transfer characteristics.
  42196. </p>
  42197. <p>Possible values are:
  42198. </p><dl class="table">
  42199. <dt><var class="var">input</var></dt>
  42200. <dt><var class="var">709</var></dt>
  42201. <dt><var class="var">unspecified</var></dt>
  42202. <dt><var class="var">601</var></dt>
  42203. <dt><var class="var">linear</var></dt>
  42204. <dt><var class="var">2020_10</var></dt>
  42205. <dt><var class="var">2020_12</var></dt>
  42206. <dt><var class="var">smpte2084</var></dt>
  42207. <dt><var class="var">iec61966-2-1</var></dt>
  42208. <dt><var class="var">arib-std-b67</var></dt>
  42209. </dl>
  42210. <p>Default is same as input.
  42211. </p>
  42212. </dd>
  42213. <dt><samp class="option">matrix, m</samp></dt>
  42214. <dd><p>Set the colorspace matrix.
  42215. </p>
  42216. <p>Possible value are:
  42217. </p><dl class="table">
  42218. <dt><var class="var">input</var></dt>
  42219. <dt><var class="var">709</var></dt>
  42220. <dt><var class="var">unspecified</var></dt>
  42221. <dt><var class="var">470bg</var></dt>
  42222. <dt><var class="var">170m</var></dt>
  42223. <dt><var class="var">2020_ncl</var></dt>
  42224. <dt><var class="var">2020_cl</var></dt>
  42225. </dl>
  42226. <p>Default is same as input.
  42227. </p>
  42228. </dd>
  42229. <dt><samp class="option">rangein, rin</samp></dt>
  42230. <dd><p>Set the input color range.
  42231. </p>
  42232. <p>Possible values are:
  42233. </p><dl class="table">
  42234. <dt><var class="var">input</var></dt>
  42235. <dt><var class="var">limited</var></dt>
  42236. <dt><var class="var">full</var></dt>
  42237. </dl>
  42238. <p>Default is same as input.
  42239. </p>
  42240. </dd>
  42241. <dt><samp class="option">primariesin, pin</samp></dt>
  42242. <dd><p>Set the input color primaries.
  42243. </p>
  42244. <p>Possible values are:
  42245. </p><dl class="table">
  42246. <dt><var class="var">input</var></dt>
  42247. <dt><var class="var">709</var></dt>
  42248. <dt><var class="var">unspecified</var></dt>
  42249. <dt><var class="var">170m</var></dt>
  42250. <dt><var class="var">240m</var></dt>
  42251. <dt><var class="var">2020</var></dt>
  42252. </dl>
  42253. <p>Default is same as input.
  42254. </p>
  42255. </dd>
  42256. <dt><samp class="option">transferin, tin</samp></dt>
  42257. <dd><p>Set the input transfer characteristics.
  42258. </p>
  42259. <p>Possible values are:
  42260. </p><dl class="table">
  42261. <dt><var class="var">input</var></dt>
  42262. <dt><var class="var">709</var></dt>
  42263. <dt><var class="var">unspecified</var></dt>
  42264. <dt><var class="var">601</var></dt>
  42265. <dt><var class="var">linear</var></dt>
  42266. <dt><var class="var">2020_10</var></dt>
  42267. <dt><var class="var">2020_12</var></dt>
  42268. </dl>
  42269. <p>Default is same as input.
  42270. </p>
  42271. </dd>
  42272. <dt><samp class="option">matrixin, min</samp></dt>
  42273. <dd><p>Set the input colorspace matrix.
  42274. </p>
  42275. <p>Possible value are:
  42276. </p><dl class="table">
  42277. <dt><var class="var">input</var></dt>
  42278. <dt><var class="var">709</var></dt>
  42279. <dt><var class="var">unspecified</var></dt>
  42280. <dt><var class="var">470bg</var></dt>
  42281. <dt><var class="var">170m</var></dt>
  42282. <dt><var class="var">2020_ncl</var></dt>
  42283. <dt><var class="var">2020_cl</var></dt>
  42284. </dl>
  42285. </dd>
  42286. <dt><samp class="option">chromal, c</samp></dt>
  42287. <dd><p>Set the output chroma location.
  42288. </p>
  42289. <p>Possible values are:
  42290. </p><dl class="table">
  42291. <dt><var class="var">input</var></dt>
  42292. <dt><var class="var">left</var></dt>
  42293. <dt><var class="var">center</var></dt>
  42294. <dt><var class="var">topleft</var></dt>
  42295. <dt><var class="var">top</var></dt>
  42296. <dt><var class="var">bottomleft</var></dt>
  42297. <dt><var class="var">bottom</var></dt>
  42298. </dl>
  42299. </dd>
  42300. <dt><samp class="option">chromalin, cin</samp></dt>
  42301. <dd><p>Set the input chroma location.
  42302. </p>
  42303. <p>Possible values are:
  42304. </p><dl class="table">
  42305. <dt><var class="var">input</var></dt>
  42306. <dt><var class="var">left</var></dt>
  42307. <dt><var class="var">center</var></dt>
  42308. <dt><var class="var">topleft</var></dt>
  42309. <dt><var class="var">top</var></dt>
  42310. <dt><var class="var">bottomleft</var></dt>
  42311. <dt><var class="var">bottom</var></dt>
  42312. </dl>
  42313. </dd>
  42314. <dt><samp class="option">npl</samp></dt>
  42315. <dd><p>Set the nominal peak luminance.
  42316. </p>
  42317. </dd>
  42318. <dt><samp class="option">param_a</samp></dt>
  42319. <dd><p>Parameter A for scaling filters. Parameter &quot;b&quot; for bicubic, and the number of
  42320. filter taps for lanczos.
  42321. </p>
  42322. </dd>
  42323. <dt><samp class="option">param_b</samp></dt>
  42324. <dd><p>Parameter B for scaling filters. Parameter &quot;c&quot; for bicubic.
  42325. </p></dd>
  42326. </dl>
  42327. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  42328. containing the following constants:
  42329. </p>
  42330. <dl class="table">
  42331. <dt><var class="var">in_w</var></dt>
  42332. <dt><var class="var">in_h</var></dt>
  42333. <dd><p>The input width and height
  42334. </p>
  42335. </dd>
  42336. <dt><var class="var">iw</var></dt>
  42337. <dt><var class="var">ih</var></dt>
  42338. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  42339. </p>
  42340. </dd>
  42341. <dt><var class="var">out_w</var></dt>
  42342. <dt><var class="var">out_h</var></dt>
  42343. <dd><p>The output (scaled) width and height
  42344. </p>
  42345. </dd>
  42346. <dt><var class="var">ow</var></dt>
  42347. <dt><var class="var">oh</var></dt>
  42348. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  42349. </p>
  42350. </dd>
  42351. <dt><var class="var">a</var></dt>
  42352. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  42353. </p>
  42354. </dd>
  42355. <dt><var class="var">sar</var></dt>
  42356. <dd><p>input sample aspect ratio
  42357. </p>
  42358. </dd>
  42359. <dt><var class="var">dar</var></dt>
  42360. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  42361. </p>
  42362. </dd>
  42363. <dt><var class="var">hsub</var></dt>
  42364. <dt><var class="var">vsub</var></dt>
  42365. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  42366. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  42367. </p>
  42368. </dd>
  42369. <dt><var class="var">ohsub</var></dt>
  42370. <dt><var class="var">ovsub</var></dt>
  42371. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  42372. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  42373. </p></dd>
  42374. </dl>
  42375. <a name="Commands-155"></a>
  42376. <h4 class="subsection">32.290.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-155" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-155" aria-hidden="true">TOC</a></span></h4>
  42377. <p>This filter supports the following commands:
  42378. </p><dl class="table">
  42379. <dt><samp class="option">width, w</samp></dt>
  42380. <dt><samp class="option">height, h</samp></dt>
  42381. <dd><p>Set the output video dimension expression.
  42382. The command accepts the same syntax of the corresponding option.
  42383. </p>
  42384. <p>If the specified expression is not valid, it is kept at its current
  42385. value.
  42386. </p></dd>
  42387. </dl>
  42388. <a name="CUDA-Video-Filters"></a>
  42389. <h2 class="chapter">33 CUDA Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#CUDA-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-CUDA-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  42390. <p>To enable CUDA and/or NPP filters please refer to configuration guidelines for <a class="ref" href="#CUDA">CUDA</a> and for <a class="ref" href="#CUDA-NPP">CUDA NPP</a> filters.
  42391. </p>
  42392. <p>Running CUDA filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  42393. </p><dl class="table">
  42394. <dt><samp class="option">-init_hw_device cuda[=<var class="var">name</var>][:<var class="var">device</var>[,<var class="var">key=value</var>...]]</samp></dt>
  42395. <dd><p>Initialise a new hardware device of type <var class="var">cuda</var> called <var class="var">name</var>, using the
  42396. given device parameters.
  42397. </p>
  42398. </dd>
  42399. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  42400. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  42401. </p>
  42402. </dd>
  42403. </dl>
  42404. <p>For more detailed information see <a class="url" href="https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options">https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options</a>
  42405. </p>
  42406. <ul class="itemize mark-bullet">
  42407. <li>Example of initializing second CUDA device on the system and running scale_cuda and bilateral_cuda filters.
  42408. <div class="example">
  42409. <pre class="example-preformatted">./ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -init_hw_device cuda:1 -filter_complex \
  42410. &quot;[0:v]scale_cuda=format=yuv444p[scaled_video];[scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0&quot; \
  42411. -an -sn -c:v h264_nvenc -cq 20 out.mp4
  42412. </pre></div>
  42413. </li></ul>
  42414. <p>Since CUDA filters operate exclusively on GPU memory, frame data must sometimes be uploaded (<a class="ref" href="#hwupload">hwupload</a>) to hardware surfaces associated with the appropriate CUDA device before processing, and downloaded (<a class="ref" href="#hwdownload">hwdownload</a>) back to normal memory afterward, if required. Whether <a class="ref" href="#hwupload">hwupload</a> or <a class="ref" href="#hwdownload">hwdownload</a> is necessary depends on the specific workflow:
  42415. </p>
  42416. <ul class="itemize mark-bullet">
  42417. <li>If the input frames are already in GPU memory (e.g., when using <code class="code">-hwaccel cuda</code> or <code class="code">-hwaccel_output_format cuda</code>), explicit use of <a class="ref" href="#hwupload">hwupload</a> is not needed, as the data is already in the appropriate memory space.
  42418. </li><li>If the input frames are in CPU memory (e.g., software-decoded frames or frames processed by CPU-based filters), it is necessary to use <a class="ref" href="#hwupload">hwupload</a> to transfer the data to GPU memory for CUDA processing.
  42419. </li><li>If the output of the CUDA filters needs to be further processed by software-based filters or saved in a format not supported by GPU-based encoders, <a class="ref" href="#hwdownload">hwdownload</a> is required to transfer the data back to CPU memory.
  42420. </li></ul>
  42421. <p>Note that <a class="ref" href="#hwupload">hwupload</a> uploads data to a surface with the same layout as the software frame, so it may be necessary to add a <a class="ref" href="#format">format</a> filter immediately before <a class="ref" href="#hwupload">hwupload</a> to ensure the input is in the correct format. Similarly, <a class="ref" href="#hwdownload">hwdownload</a> may not support all output formats, so an additional <a class="ref" href="#format">format</a> filter may need to be inserted immediately after <a class="ref" href="#hwdownload">hwdownload</a> in the filter graph to ensure compatibility.
  42422. </p>
  42423. <a class="anchor" id="CUDA"></a><a name="CUDA-1"></a>
  42424. <h3 class="section">33.1 CUDA<span class="pull-right"><a class="anchor hidden-xs" href="#CUDA-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-CUDA-1" aria-hidden="true">TOC</a></span></h3>
  42425. <p>Below is a description of the currently available Nvidia CUDA video filters.
  42426. </p>
  42427. <p>Prerequisites:
  42428. </p><ul class="itemize mark-bullet">
  42429. <li>Install Nvidia CUDA Toolkit
  42430. </li></ul>
  42431. <p>Note: If FFmpeg detects the Nvidia CUDA Toolkit during configuration, it will enable CUDA filters automatically without requiring any additional flags. If you want to explicitly enable them, use the following options:
  42432. </p>
  42433. <ul class="itemize mark-bullet">
  42434. <li>Configure FFmpeg with <code class="code">--enable-cuda-nvcc --enable-nonfree</code>.
  42435. </li><li>Configure FFmpeg with <code class="code">--enable-cuda-llvm</code>. Additional requirement: <code class="code">llvm</code> lib must be installed.
  42436. </li></ul>
  42437. <a name="bilateral_005fcuda"></a>
  42438. <h4 class="subsection">33.1.1 bilateral_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#bilateral_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bilateral_005fcuda" aria-hidden="true">TOC</a></span></h4>
  42439. <p>CUDA accelerated bilateral filter, an edge preserving filter.
  42440. This filter is mathematically accurate thanks to the use of GPU acceleration.
  42441. For best output quality, use one to one chroma subsampling, i.e. yuv444p format.
  42442. </p>
  42443. <p>The filter accepts the following options:
  42444. </p><dl class="table">
  42445. <dt><samp class="option">sigmaS</samp></dt>
  42446. <dd><p>Set sigma of gaussian function to calculate spatial weight, also called sigma space.
  42447. Allowed range is 0.1 to 512. Default is 0.1.
  42448. </p>
  42449. </dd>
  42450. <dt><samp class="option">sigmaR</samp></dt>
  42451. <dd><p>Set sigma of gaussian function to calculate color range weight, also called sigma color.
  42452. Allowed range is 0.1 to 512. Default is 0.1.
  42453. </p>
  42454. </dd>
  42455. <dt><samp class="option">window_size</samp></dt>
  42456. <dd><p>Set window size of the bilateral function to determine the number of neighbours to loop on.
  42457. If the number entered is even, one will be added automatically.
  42458. Allowed range is 1 to 255. Default is 1.
  42459. </p></dd>
  42460. </dl>
  42461. <a name="Examples-160"></a>
  42462. <h4 class="subsubsection">33.1.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-160" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-160" aria-hidden="true">TOC</a></span></h4>
  42463. <ul class="itemize mark-bullet">
  42464. <li>Apply the bilateral filter on a video.
  42465. <div class="example">
  42466. <pre class="example-preformatted">./ffmpeg -v verbose \
  42467. -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 \
  42468. -init_hw_device cuda \
  42469. -filter_complex \
  42470. &quot; \
  42471. [0:v]scale_cuda=format=yuv444p[scaled_video];
  42472. [scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0&quot; \
  42473. -an -sn -c:v h264_nvenc -cq 20 out.mp4
  42474. </pre></div>
  42475. </li></ul>
  42476. <a name="bwdif_005fcuda"></a>
  42477. <h4 class="subsection">33.1.2 bwdif_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#bwdif_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bwdif_005fcuda" aria-hidden="true">TOC</a></span></h4>
  42478. <p>Deinterlace the input video using the <a class="ref" href="#bwdif">bwdif</a> algorithm, but implemented
  42479. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  42480. and/or nvenc.
  42481. </p>
  42482. <p>It accepts the following parameters:
  42483. </p>
  42484. <dl class="table">
  42485. <dt><samp class="option">mode</samp></dt>
  42486. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  42487. </p>
  42488. <dl class="table">
  42489. <dt><samp class="option">0, send_frame</samp></dt>
  42490. <dd><p>Output one frame for each frame.
  42491. </p></dd>
  42492. <dt><samp class="option">1, send_field</samp></dt>
  42493. <dd><p>Output one frame for each field.
  42494. </p></dd>
  42495. </dl>
  42496. <p>The default value is <code class="code">send_field</code>.
  42497. </p>
  42498. </dd>
  42499. <dt><samp class="option">parity</samp></dt>
  42500. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  42501. of the following values:
  42502. </p>
  42503. <dl class="table">
  42504. <dt><samp class="option">0, tff</samp></dt>
  42505. <dd><p>Assume the top field is first.
  42506. </p></dd>
  42507. <dt><samp class="option">1, bff</samp></dt>
  42508. <dd><p>Assume the bottom field is first.
  42509. </p></dd>
  42510. <dt><samp class="option">-1, auto</samp></dt>
  42511. <dd><p>Enable automatic detection of field parity.
  42512. </p></dd>
  42513. </dl>
  42514. <p>The default value is <code class="code">auto</code>.
  42515. If the interlacing is unknown or the decoder does not export this information,
  42516. top field first will be assumed.
  42517. </p>
  42518. </dd>
  42519. <dt><samp class="option">deint</samp></dt>
  42520. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  42521. values:
  42522. </p>
  42523. <dl class="table">
  42524. <dt><samp class="option">0, all</samp></dt>
  42525. <dd><p>Deinterlace all frames.
  42526. </p></dd>
  42527. <dt><samp class="option">1, interlaced</samp></dt>
  42528. <dd><p>Only deinterlace frames marked as interlaced.
  42529. </p></dd>
  42530. </dl>
  42531. <p>The default value is <code class="code">all</code>.
  42532. </p></dd>
  42533. </dl>
  42534. <a name="chromakey_005fcuda"></a>
  42535. <h4 class="subsection">33.1.3 chromakey_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#chromakey_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromakey_005fcuda" aria-hidden="true">TOC</a></span></h4>
  42536. <p>CUDA accelerated YUV colorspace color/chroma keying.
  42537. </p>
  42538. <p>This filter works like normal chromakey filter but operates on CUDA frames.
  42539. for more details and parameters see <a class="ref" href="#chromakey">chromakey</a>.
  42540. </p>
  42541. <a name="Examples-161"></a>
  42542. <h4 class="subsubsection">33.1.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-161" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-161" aria-hidden="true">TOC</a></span></h4>
  42543. <ul class="itemize mark-bullet">
  42544. <li>Make all the green pixels in the input video transparent and use it as an overlay for another video:
  42545. <div class="example">
  42546. <pre class="example-preformatted">./ffmpeg \
  42547. -hwaccel cuda -hwaccel_output_format cuda -i input_green.mp4 \
  42548. -hwaccel cuda -hwaccel_output_format cuda -i base_video.mp4 \
  42549. -init_hw_device cuda \
  42550. -filter_complex \
  42551. &quot; \
  42552. [0:v]chromakey_cuda=0x25302D:0.1:0.12:1[overlay_video]; \
  42553. [1:v]scale_cuda=format=yuv420p[base]; \
  42554. [base][overlay_video]overlay_cuda&quot; \
  42555. -an -sn -c:v h264_nvenc -cq 20 output.mp4
  42556. </pre></div>
  42557. </li><li>Process two software sources, explicitly uploading the frames:
  42558. <div class="example">
  42559. <pre class="example-preformatted">./ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda \
  42560. -f lavfi -i color=size=800x600:color=white,format=yuv420p \
  42561. -f lavfi -i yuvtestsrc=size=200x200,format=yuv420p \
  42562. -filter_complex \
  42563. &quot; \
  42564. [0]hwupload[under]; \
  42565. [1]hwupload,chromakey_cuda=green:0.1:0.12[over]; \
  42566. [under][over]overlay_cuda&quot; \
  42567. -c:v hevc_nvenc -cq 18 -preset slow output.mp4
  42568. </pre></div>
  42569. </li></ul>
  42570. <a name="colorspace_005fcuda"></a>
  42571. <h4 class="subsection">33.1.4 colorspace_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#colorspace_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorspace_005fcuda" aria-hidden="true">TOC</a></span></h4>
  42572. <p>CUDA accelerated implementation of the colorspace filter.
  42573. </p>
  42574. <p>It is by no means feature complete compared to the software colorspace filter,
  42575. and at the current time only supports color range conversion between jpeg/full
  42576. and mpeg/limited range.
  42577. </p>
  42578. <p>The filter accepts the following options:
  42579. </p>
  42580. <dl class="table">
  42581. <dt><samp class="option">range</samp></dt>
  42582. <dd><p>Specify output color range.
  42583. </p>
  42584. <p>The accepted values are:
  42585. </p><dl class="table">
  42586. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  42587. <dd><p>TV (restricted) range
  42588. </p>
  42589. </dd>
  42590. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  42591. <dd><p>MPEG (restricted) range
  42592. </p>
  42593. </dd>
  42594. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  42595. <dd><p>PC (full) range
  42596. </p>
  42597. </dd>
  42598. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  42599. <dd><p>JPEG (full) range
  42600. </p>
  42601. </dd>
  42602. </dl>
  42603. </dd>
  42604. </dl>
  42605. <a class="anchor" id="overlay_005fcuda"></a><a name="overlay_005fcuda-1"></a>
  42606. <h4 class="subsection">33.1.5 overlay_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fcuda-1" aria-hidden="true">TOC</a></span></h4>
  42607. <p>Overlay one video on top of another.
  42608. </p>
  42609. <p>This is the CUDA variant of the <a class="ref" href="#overlay">overlay</a> filter.
  42610. It only accepts CUDA frames. The underlying input pixel formats have to match.
  42611. </p>
  42612. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  42613. video on which the second input is overlaid.
  42614. </p>
  42615. <p>It accepts the following parameters:
  42616. </p>
  42617. <dl class="table">
  42618. <dt><samp class="option">x</samp></dt>
  42619. <dt><samp class="option">y</samp></dt>
  42620. <dd><p>Set expressions for the x and y coordinates of the overlaid video
  42621. on the main video.
  42622. </p>
  42623. <p>They can contain the following parameters:
  42624. </p>
  42625. <dl class="table">
  42626. <dt><samp class="option">main_w, W</samp></dt>
  42627. <dt><samp class="option">main_h, H</samp></dt>
  42628. <dd><p>The main input width and height.
  42629. </p>
  42630. </dd>
  42631. <dt><samp class="option">overlay_w, w</samp></dt>
  42632. <dt><samp class="option">overlay_h, h</samp></dt>
  42633. <dd><p>The overlay input width and height.
  42634. </p>
  42635. </dd>
  42636. <dt><samp class="option">x</samp></dt>
  42637. <dt><samp class="option">y</samp></dt>
  42638. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  42639. each new frame.
  42640. </p>
  42641. </dd>
  42642. <dt><samp class="option">n</samp></dt>
  42643. <dd><p>The ordinal index of the main input frame, starting from 0.
  42644. </p>
  42645. </dd>
  42646. <dt><samp class="option">pos</samp></dt>
  42647. <dd><p>The byte offset position in the file of the main input frame, NAN if unknown.
  42648. Deprecated, do not use.
  42649. </p>
  42650. </dd>
  42651. <dt><samp class="option">t</samp></dt>
  42652. <dd><p>The timestamp of the main input frame, expressed in seconds, NAN if unknown.
  42653. </p>
  42654. </dd>
  42655. </dl>
  42656. <p>Default value is &quot;0&quot; for both expressions.
  42657. </p>
  42658. </dd>
  42659. <dt><samp class="option">eval</samp></dt>
  42660. <dd><p>Set when the expressions for <samp class="option">x</samp> and <samp class="option">y</samp> are evaluated.
  42661. </p>
  42662. <p>It accepts the following values:
  42663. </p><dl class="table">
  42664. <dt><samp class="option">init</samp></dt>
  42665. <dd><p>Evaluate expressions once during filter initialization or
  42666. when a command is processed.
  42667. </p>
  42668. </dd>
  42669. <dt><samp class="option">frame</samp></dt>
  42670. <dd><p>Evaluate expressions for each incoming frame
  42671. </p></dd>
  42672. </dl>
  42673. <p>Default value is <samp class="option">frame</samp>.
  42674. </p>
  42675. </dd>
  42676. <dt><samp class="option">eof_action</samp></dt>
  42677. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  42678. </p>
  42679. </dd>
  42680. <dt><samp class="option">shortest</samp></dt>
  42681. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  42682. </p>
  42683. </dd>
  42684. <dt><samp class="option">repeatlast</samp></dt>
  42685. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  42686. </p>
  42687. </dd>
  42688. </dl>
  42689. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  42690. </p>
  42691. <a class="anchor" id="pad_005fcuda"></a><a name="pad_005fcuda-1"></a>
  42692. <h4 class="subsection">33.1.6 pad_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#pad_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad_005fcuda-1" aria-hidden="true">TOC</a></span></h4>
  42693. <p>Add paddings to an input video stream using CUDA.
  42694. </p>
  42695. <p>This filter is the CUDA-accelerated version of the <a class="ref" href="#pad">pad</a> filter. It accepts the same options and expressions and provides the same core functionality.
  42696. For a detailed description of available options, please see the documentation for the <a class="ref" href="#pad">pad</a> filter.
  42697. </p>
  42698. <a name="Examples-162"></a>
  42699. <h4 class="subsubsection">33.1.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-162" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-162" aria-hidden="true">TOC</a></span></h4>
  42700. <ul class="itemize mark-bullet">
  42701. <li>Add a 200-pixel black border to all sides of a video frame:
  42702. <div class="example">
  42703. <pre class="example-preformatted">ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf &quot;pad_cuda=w=iw+400:h=ih+400:x=200:y=200&quot; -c:v h264_nvenc out.mp4
  42704. </pre></div>
  42705. </li><li>Pad the input video to a 16:9 aspect ratio, filling with the color &quot;blue&quot;:
  42706. <div class="example">
  42707. <pre class="example-preformatted">ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf &quot;pad_cuda=w=ih*16/9/sar:h=ih:x=(ow-iw)/2:y=(oh-ih)/2:color=blue&quot; -c:v h264_nvenc out.mp4
  42708. </pre></div>
  42709. </li></ul>
  42710. <a class="anchor" id="scale_005fcuda"></a><a name="scale_005fcuda-1"></a>
  42711. <h4 class="subsection">33.1.7 scale_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#scale_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale_005fcuda-1" aria-hidden="true">TOC</a></span></h4>
  42712. <p>Scale (resize) and convert (pixel format) the input video, using accelerated CUDA kernels.
  42713. Setting the output width and height works in the same way as for the <a class="ref" href="#scale">scale</a> filter.
  42714. </p>
  42715. <p>The filter accepts the following options:
  42716. </p><dl class="table">
  42717. <dt><samp class="option">w</samp></dt>
  42718. <dt><samp class="option">h</samp></dt>
  42719. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  42720. </p>
  42721. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  42722. </p>
  42723. </dd>
  42724. <dt><samp class="option">interp_algo</samp></dt>
  42725. <dd><p>Sets the algorithm used for scaling:
  42726. </p>
  42727. <dl class="table">
  42728. <dt><var class="var">nearest</var></dt>
  42729. <dd><p>Nearest neighbour
  42730. </p>
  42731. <p>Used by default if input parameters match the desired output.
  42732. </p>
  42733. </dd>
  42734. <dt><var class="var">bilinear</var></dt>
  42735. <dd><p>Bilinear
  42736. </p>
  42737. </dd>
  42738. <dt><var class="var">bicubic</var></dt>
  42739. <dd><p>Bicubic
  42740. </p>
  42741. <p>This is the default.
  42742. </p>
  42743. </dd>
  42744. <dt><var class="var">lanczos</var></dt>
  42745. <dd><p>Lanczos
  42746. </p>
  42747. </dd>
  42748. </dl>
  42749. </dd>
  42750. <dt><samp class="option">format</samp></dt>
  42751. <dd><p>Controls the output pixel format. By default, or if none is specified, the input
  42752. pixel format is used.
  42753. </p>
  42754. <p>The filter does not support converting between YUV and RGB pixel formats.
  42755. </p>
  42756. </dd>
  42757. <dt><samp class="option">passthrough</samp></dt>
  42758. <dd><p>If set to 0, every frame is processed, even if no conversion is necessary.
  42759. This mode can be useful to use the filter as a buffer for a downstream
  42760. frame-consumer that exhausts the limited decoder frame pool.
  42761. </p>
  42762. <p>If set to 1, frames are passed through as-is if they match the desired output
  42763. parameters. This is the default behaviour.
  42764. </p>
  42765. </dd>
  42766. <dt><samp class="option">param</samp></dt>
  42767. <dd><p>Algorithm-Specific parameter.
  42768. </p>
  42769. <p>Affects the curves of the bicubic algorithm.
  42770. </p>
  42771. </dd>
  42772. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  42773. <dt><samp class="option">force_divisible_by</samp></dt>
  42774. <dd><p>Work the same as the identical <a class="ref" href="#scale">scale</a> filter options.
  42775. </p>
  42776. </dd>
  42777. <dt><samp class="option">reset_sar</samp></dt>
  42778. <dd><p>Works the same as the identical <a class="ref" href="#scale">scale</a> filter option.
  42779. </p>
  42780. </dd>
  42781. </dl>
  42782. <a name="Examples-163"></a>
  42783. <h4 class="subsubsection">33.1.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-163" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-163" aria-hidden="true">TOC</a></span></h4>
  42784. <ul class="itemize mark-bullet">
  42785. <li>Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p.
  42786. <div class="example">
  42787. <pre class="example-preformatted">scale_cuda=-2:720:format=yuv420p
  42788. </pre></div>
  42789. </li><li>Upscale to 4K using nearest neighbour algorithm.
  42790. <div class="example">
  42791. <pre class="example-preformatted">scale_cuda=4096:2160:interp_algo=nearest
  42792. </pre></div>
  42793. </li><li>Don&rsquo;t do any conversion or scaling, but copy all input frames into newly allocated ones.
  42794. This can be useful to deal with a filter and encode chain that otherwise exhausts the
  42795. decoders frame pool.
  42796. <div class="example">
  42797. <pre class="example-preformatted">scale_cuda=passthrough=0
  42798. </pre></div>
  42799. </li></ul>
  42800. <a name="thumbnail_005fcuda"></a>
  42801. <h4 class="subsection">33.1.8 thumbnail_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#thumbnail_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-thumbnail_005fcuda" aria-hidden="true">TOC</a></span></h4>
  42802. <p>Select the most representative frame in a given sequence of consecutive frames using CUDA.
  42803. </p>
  42804. <p>The filter accepts the following options:
  42805. </p>
  42806. <dl class="table">
  42807. <dt><samp class="option">n</samp></dt>
  42808. <dd><p>Set the frames batch size to analyze; in a set of <var class="var">n</var> frames, the filter
  42809. will pick one of them, and then handle the next batch of <var class="var">n</var> frames until
  42810. the end. Default is <code class="code">100</code>.
  42811. </p></dd>
  42812. </dl>
  42813. <p>Since the filter keeps track of the whole frames sequence, a bigger <var class="var">n</var>
  42814. value will result in a higher memory usage, so a high value is not recommended.
  42815. </p>
  42816. <a name="Example"></a>
  42817. <h4 class="subsubsection">33.1.8.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example" aria-hidden="true">TOC</a></span></h4>
  42818. <ul class="itemize mark-bullet">
  42819. <li>Thumbnails are extracted from every <var class="var">n</var>=150-frame batch, selecting one per batch. Chosen frames are then scaled with <a class="ref" href="#scale_005fcuda">scale_cuda</a>.
  42820. <div class="example">
  42821. <pre class="example-preformatted">./ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i ./input.mp4 -vf &quot;thumbnail_cuda=150,scale_cuda=1920:1080,hwdownload,format=nv12&quot; ./output/out%03d.png
  42822. </pre></div>
  42823. </li></ul>
  42824. <a name="yadif_005fcuda"></a>
  42825. <h4 class="subsection">33.1.9 yadif_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#yadif_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-yadif_005fcuda" aria-hidden="true">TOC</a></span></h4>
  42826. <p>Deinterlace the input video using the <a class="ref" href="#yadif">yadif</a> algorithm, but implemented
  42827. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  42828. and/or nvenc.
  42829. </p>
  42830. <p>It accepts the following parameters:
  42831. </p>
  42832. <dl class="table">
  42833. <dt><samp class="option">mode</samp></dt>
  42834. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  42835. </p>
  42836. <dl class="table">
  42837. <dt><samp class="option">0, send_frame</samp></dt>
  42838. <dd><p>Output one frame for each frame.
  42839. </p></dd>
  42840. <dt><samp class="option">1, send_field</samp></dt>
  42841. <dd><p>Output one frame for each field.
  42842. </p></dd>
  42843. <dt><samp class="option">2, send_frame_nospatial</samp></dt>
  42844. <dd><p>Like <code class="code">send_frame</code>, but it skips the spatial interlacing check.
  42845. </p></dd>
  42846. <dt><samp class="option">3, send_field_nospatial</samp></dt>
  42847. <dd><p>Like <code class="code">send_field</code>, but it skips the spatial interlacing check.
  42848. </p></dd>
  42849. </dl>
  42850. <p>The default value is <code class="code">send_frame</code>.
  42851. </p>
  42852. </dd>
  42853. <dt><samp class="option">parity</samp></dt>
  42854. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  42855. of the following values:
  42856. </p>
  42857. <dl class="table">
  42858. <dt><samp class="option">0, tff</samp></dt>
  42859. <dd><p>Assume the top field is first.
  42860. </p></dd>
  42861. <dt><samp class="option">1, bff</samp></dt>
  42862. <dd><p>Assume the bottom field is first.
  42863. </p></dd>
  42864. <dt><samp class="option">-1, auto</samp></dt>
  42865. <dd><p>Enable automatic detection of field parity.
  42866. </p></dd>
  42867. </dl>
  42868. <p>The default value is <code class="code">auto</code>.
  42869. If the interlacing is unknown or the decoder does not export this information,
  42870. top field first will be assumed.
  42871. </p>
  42872. </dd>
  42873. <dt><samp class="option">deint</samp></dt>
  42874. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  42875. values:
  42876. </p>
  42877. <dl class="table">
  42878. <dt><samp class="option">0, all</samp></dt>
  42879. <dd><p>Deinterlace all frames.
  42880. </p></dd>
  42881. <dt><samp class="option">1, interlaced</samp></dt>
  42882. <dd><p>Only deinterlace frames marked as interlaced.
  42883. </p></dd>
  42884. </dl>
  42885. <p>The default value is <code class="code">all</code>.
  42886. </p></dd>
  42887. </dl>
  42888. <a class="anchor" id="CUDA-NPP"></a><a name="CUDA-NPP-1"></a>
  42889. <h3 class="section">33.2 CUDA NPP<span class="pull-right"><a class="anchor hidden-xs" href="#CUDA-NPP-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-CUDA-NPP-1" aria-hidden="true">TOC</a></span></h3>
  42890. <p>Below is a description of the currently available NVIDIA Performance Primitives (libnpp) video filters.
  42891. </p>
  42892. <p>Prerequisites:
  42893. </p><ul class="itemize mark-bullet">
  42894. <li>Install Nvidia CUDA Toolkit
  42895. </li><li>Install libnpp
  42896. </li></ul>
  42897. <p>To enable CUDA NPP filters:
  42898. </p>
  42899. <ul class="itemize mark-bullet">
  42900. <li>Configure FFmpeg with <code class="code">--enable-nonfree --enable-libnpp</code>.
  42901. </li></ul>
  42902. <a class="anchor" id="scale_005fnpp"></a><a name="scale_005fnpp-1"></a>
  42903. <h4 class="subsection">33.2.1 scale_npp<span class="pull-right"><a class="anchor hidden-xs" href="#scale_005fnpp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale_005fnpp-1" aria-hidden="true">TOC</a></span></h4>
  42904. <p>Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel
  42905. format conversion on CUDA video frames. Setting the output width and height
  42906. works in the same way as for the <var class="var">scale</var> filter.
  42907. </p>
  42908. <p>The following additional options are accepted:
  42909. </p><dl class="table">
  42910. <dt><samp class="option">format</samp></dt>
  42911. <dd><p>The pixel format of the output CUDA frames. If set to the string &quot;same&quot; (the
  42912. default), the input format will be kept. Note that automatic format negotiation
  42913. and conversion is not yet supported for hardware frames
  42914. </p>
  42915. </dd>
  42916. <dt><samp class="option">interp_algo</samp></dt>
  42917. <dd><p>The interpolation algorithm used for resizing. One of the following:
  42918. </p><dl class="table">
  42919. <dt><samp class="option">nn</samp></dt>
  42920. <dd><p>Nearest neighbour.
  42921. </p>
  42922. </dd>
  42923. <dt><samp class="option">linear</samp></dt>
  42924. <dt><samp class="option">cubic</samp></dt>
  42925. <dt><samp class="option">cubic2p_bspline</samp></dt>
  42926. <dd><p>2-parameter cubic (B=1, C=0)
  42927. </p>
  42928. </dd>
  42929. <dt><samp class="option">cubic2p_catmullrom</samp></dt>
  42930. <dd><p>2-parameter cubic (B=0, C=1/2)
  42931. </p>
  42932. </dd>
  42933. <dt><samp class="option">cubic2p_b05c03</samp></dt>
  42934. <dd><p>2-parameter cubic (B=1/2, C=3/10)
  42935. </p>
  42936. </dd>
  42937. <dt><samp class="option">super</samp></dt>
  42938. <dd><p>Supersampling
  42939. </p>
  42940. </dd>
  42941. <dt><samp class="option">lanczos</samp></dt>
  42942. </dl>
  42943. </dd>
  42944. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  42945. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  42946. keep the original aspect ratio. Possible values:
  42947. </p>
  42948. <dl class="table">
  42949. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  42950. <dd><p>Scale the video as specified and disable this feature.
  42951. </p>
  42952. </dd>
  42953. <dt>&lsquo;<samp class="samp">decrease</samp>&rsquo;</dt>
  42954. <dd><p>The output video dimensions will automatically be decreased if needed.
  42955. </p>
  42956. </dd>
  42957. <dt>&lsquo;<samp class="samp">increase</samp>&rsquo;</dt>
  42958. <dd><p>The output video dimensions will automatically be increased if needed.
  42959. </p>
  42960. </dd>
  42961. </dl>
  42962. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  42963. maximum allowed resolution, you can use this to limit the output video to
  42964. that, while retaining the aspect ratio. For example, device A allows
  42965. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  42966. decrease) and specifying 1280x720 to the command line makes the output
  42967. 1280x533.
  42968. </p>
  42969. <p>Please note that this is a different thing than specifying -1 for <samp class="option">w</samp>
  42970. or <samp class="option">h</samp>, you still need to specify the output resolution for this option
  42971. to work.
  42972. </p>
  42973. </dd>
  42974. <dt><samp class="option">force_divisible_by</samp></dt>
  42975. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  42976. given integer when used together with <samp class="option">force_original_aspect_ratio</samp>. This
  42977. works similar to using <code class="code">-n</code> in the <samp class="option">w</samp> and <samp class="option">h</samp> options.
  42978. </p>
  42979. <p>This option respects the value set for <samp class="option">force_original_aspect_ratio</samp>,
  42980. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  42981. may be slightly modified.
  42982. </p>
  42983. <p>This option can be handy if you need to have a video fit within or exceed
  42984. a defined resolution using <samp class="option">force_original_aspect_ratio</samp> but also have
  42985. encoder restrictions on width or height divisibility.
  42986. </p>
  42987. </dd>
  42988. <dt><samp class="option">reset_sar</samp></dt>
  42989. <dd><p>Works the same as the identical <a class="ref" href="#scale">scale</a> filter option.
  42990. </p>
  42991. </dd>
  42992. <dt><samp class="option">eval</samp></dt>
  42993. <dd><p>Specify when to evaluate <var class="var">width</var> and <var class="var">height</var> expression. It accepts the following values:
  42994. </p>
  42995. <dl class="table">
  42996. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  42997. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  42998. </p>
  42999. </dd>
  43000. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  43001. <dd><p>Evaluate expressions for each incoming frame.
  43002. </p>
  43003. </dd>
  43004. </dl>
  43005. </dd>
  43006. </dl>
  43007. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  43008. containing the following constants:
  43009. </p>
  43010. <dl class="table">
  43011. <dt><var class="var">in_w</var></dt>
  43012. <dt><var class="var">in_h</var></dt>
  43013. <dd><p>The input width and height
  43014. </p>
  43015. </dd>
  43016. <dt><var class="var">iw</var></dt>
  43017. <dt><var class="var">ih</var></dt>
  43018. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  43019. </p>
  43020. </dd>
  43021. <dt><var class="var">out_w</var></dt>
  43022. <dt><var class="var">out_h</var></dt>
  43023. <dd><p>The output (scaled) width and height
  43024. </p>
  43025. </dd>
  43026. <dt><var class="var">ow</var></dt>
  43027. <dt><var class="var">oh</var></dt>
  43028. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  43029. </p>
  43030. </dd>
  43031. <dt><var class="var">a</var></dt>
  43032. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  43033. </p>
  43034. </dd>
  43035. <dt><var class="var">sar</var></dt>
  43036. <dd><p>input sample aspect ratio
  43037. </p>
  43038. </dd>
  43039. <dt><var class="var">dar</var></dt>
  43040. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  43041. </p>
  43042. </dd>
  43043. <dt><var class="var">n</var></dt>
  43044. <dd><p>The (sequential) number of the input frame, starting from 0.
  43045. Only available with <code class="code">eval=frame</code>.
  43046. </p>
  43047. </dd>
  43048. <dt><var class="var">t</var></dt>
  43049. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  43050. seconds. Only available with <code class="code">eval=frame</code>.
  43051. </p>
  43052. </dd>
  43053. <dt><var class="var">pos</var></dt>
  43054. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  43055. this information is unavailable and/or meaningless (for example in case of synthetic video).
  43056. Only available with <code class="code">eval=frame</code>.
  43057. Deprecated, do not use.
  43058. </p></dd>
  43059. </dl>
  43060. <a name="scale2ref_005fnpp"></a>
  43061. <h4 class="subsection">33.2.2 scale2ref_npp<span class="pull-right"><a class="anchor hidden-xs" href="#scale2ref_005fnpp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale2ref_005fnpp" aria-hidden="true">TOC</a></span></h4>
  43062. <p>Use the NVIDIA Performance Primitives (libnpp) to scale (resize) the input
  43063. video, based on a reference video.
  43064. </p>
  43065. <p>See the <a class="ref" href="#scale_005fnpp">scale_npp</a> filter for available options, scale2ref_npp supports the same
  43066. but uses the reference video instead of the main input as basis. scale2ref_npp
  43067. also supports the following additional constants for the <samp class="option">w</samp> and
  43068. <samp class="option">h</samp> options:
  43069. </p>
  43070. <dl class="table">
  43071. <dt><var class="var">main_w</var></dt>
  43072. <dt><var class="var">main_h</var></dt>
  43073. <dd><p>The main input video&rsquo;s width and height
  43074. </p>
  43075. </dd>
  43076. <dt><var class="var">main_a</var></dt>
  43077. <dd><p>The same as <var class="var">main_w</var> / <var class="var">main_h</var>
  43078. </p>
  43079. </dd>
  43080. <dt><var class="var">main_sar</var></dt>
  43081. <dd><p>The main input video&rsquo;s sample aspect ratio
  43082. </p>
  43083. </dd>
  43084. <dt><var class="var">main_dar, mdar</var></dt>
  43085. <dd><p>The main input video&rsquo;s display aspect ratio. Calculated from
  43086. <code class="code">(main_w / main_h) * main_sar</code>.
  43087. </p>
  43088. </dd>
  43089. <dt><var class="var">main_n</var></dt>
  43090. <dd><p>The (sequential) number of the main input frame, starting from 0.
  43091. Only available with <code class="code">eval=frame</code>.
  43092. </p>
  43093. </dd>
  43094. <dt><var class="var">main_t</var></dt>
  43095. <dd><p>The presentation timestamp of the main input frame, expressed as a number of
  43096. seconds. Only available with <code class="code">eval=frame</code>.
  43097. </p>
  43098. </dd>
  43099. <dt><var class="var">main_pos</var></dt>
  43100. <dd><p>The position (byte offset) of the frame in the main input stream, or NaN if
  43101. this information is unavailable and/or meaningless (for example in case of synthetic video).
  43102. Only available with <code class="code">eval=frame</code>.
  43103. </p></dd>
  43104. </dl>
  43105. <a name="Examples-164"></a>
  43106. <h4 class="subsubsection">33.2.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-164" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-164" aria-hidden="true">TOC</a></span></h4>
  43107. <ul class="itemize mark-bullet">
  43108. <li>Scale a subtitle stream (b) to match the main video (a) in size before overlaying
  43109. <div class="example">
  43110. <pre class="example-preformatted">'scale2ref_npp[b][a];[a][b]overlay_cuda'
  43111. </pre></div>
  43112. </li><li>Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
  43113. <div class="example">
  43114. <pre class="example-preformatted">[logo-in][video-in]scale2ref_npp=w=oh*mdar:h=ih/10[logo-out][video-out]
  43115. </pre></div>
  43116. </li></ul>
  43117. <a name="sharpen_005fnpp"></a>
  43118. <h4 class="subsection">33.2.3 sharpen_npp<span class="pull-right"><a class="anchor hidden-xs" href="#sharpen_005fnpp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sharpen_005fnpp" aria-hidden="true">TOC</a></span></h4>
  43119. <p>Use the NVIDIA Performance Primitives (libnpp) to perform image sharpening with
  43120. border control.
  43121. </p>
  43122. <p>The following additional options are accepted:
  43123. </p><dl class="table">
  43124. <dt><samp class="option">border_type</samp></dt>
  43125. <dd><p>Type of sampling to be used ad frame borders. One of the following:
  43126. </p><dl class="table">
  43127. <dt><samp class="option">replicate</samp></dt>
  43128. <dd><p>Replicate pixel values.
  43129. </p>
  43130. </dd>
  43131. </dl>
  43132. </dd>
  43133. </dl>
  43134. <a name="transpose_005fnpp"></a>
  43135. <h4 class="subsection">33.2.4 transpose_npp<span class="pull-right"><a class="anchor hidden-xs" href="#transpose_005fnpp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose_005fnpp" aria-hidden="true">TOC</a></span></h4>
  43136. <p>Transpose rows with columns in the input video and optionally flip it.
  43137. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  43138. </p>
  43139. <p>It accepts the following parameters:
  43140. </p>
  43141. <dl class="table">
  43142. <dt><samp class="option">dir</samp></dt>
  43143. <dd><p>Specify the transposition direction.
  43144. </p>
  43145. <p>Can assume the following values:
  43146. </p><dl class="table">
  43147. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  43148. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  43149. </p>
  43150. </dd>
  43151. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  43152. <dd><p>Rotate by 90 degrees clockwise.
  43153. </p>
  43154. </dd>
  43155. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  43156. <dd><p>Rotate by 90 degrees counterclockwise.
  43157. </p>
  43158. </dd>
  43159. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  43160. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  43161. </p></dd>
  43162. </dl>
  43163. </dd>
  43164. <dt><samp class="option">passthrough</samp></dt>
  43165. <dd><p>Do not apply the transposition if the input geometry matches the one
  43166. specified by the specified value. It accepts the following values:
  43167. </p><dl class="table">
  43168. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  43169. <dd><p>Always apply transposition. (default)
  43170. </p></dd>
  43171. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  43172. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  43173. </p></dd>
  43174. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  43175. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  43176. </p></dd>
  43177. </dl>
  43178. </dd>
  43179. </dl>
  43180. <a name="OpenCL-Video-Filters"></a>
  43181. <h2 class="chapter">34 OpenCL Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#OpenCL-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenCL-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  43182. <p>Below is a description of the currently available OpenCL video filters.
  43183. </p>
  43184. <p>To enable compilation of these filters you need to configure FFmpeg with
  43185. <code class="code">--enable-opencl</code>.
  43186. </p>
  43187. <p>Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  43188. </p><dl class="table">
  43189. <dt><samp class="option">-init_hw_device opencl[=<var class="var">name</var>][:<var class="var">device</var>[,<var class="var">key=value</var>...]]</samp></dt>
  43190. <dd><p>Initialise a new hardware device of type <var class="var">opencl</var> called <var class="var">name</var>, using the
  43191. given device parameters.
  43192. </p>
  43193. </dd>
  43194. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  43195. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  43196. </p>
  43197. </dd>
  43198. </dl>
  43199. <p>For more detailed information see <a class="url" href="https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options">https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options</a>
  43200. </p>
  43201. <ul class="itemize mark-bullet">
  43202. <li>Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it.
  43203. <div class="example">
  43204. <pre class="example-preformatted">-init_hw_device opencl=gpu:1.0 -filter_hw_device gpu -i INPUT -vf &quot;hwupload, avgblur_opencl, hwdownload&quot; OUTPUT
  43205. </pre></div>
  43206. </li></ul>
  43207. <p>Since OpenCL filters are not able to access frame data in normal memory, all frame data needs to be uploaded(<a class="ref" href="#hwupload">hwupload</a>) to hardware surfaces connected to the appropriate device before being used and then downloaded(<a class="ref" href="#hwdownload">hwdownload</a>) back to normal memory. Note that <a class="ref" href="#hwupload">hwupload</a> will upload to a surface with the same layout as the software frame, so it may be necessary to add a <a class="ref" href="#format">format</a> filter immediately before to get the input into the right format and <a class="ref" href="#hwdownload">hwdownload</a> does not support all formats on the output - it may be necessary to insert an additional <a class="ref" href="#format">format</a> filter immediately following in the graph to get the output in a supported format.
  43208. </p>
  43209. <a name="avgblur_005fopencl"></a>
  43210. <h3 class="section">34.1 avgblur_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#avgblur_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avgblur_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43211. <p>Apply average blur filter.
  43212. </p>
  43213. <p>The filter accepts the following options:
  43214. </p>
  43215. <dl class="table">
  43216. <dt><samp class="option">sizeX</samp></dt>
  43217. <dd><p>Set horizontal radius size.
  43218. Range is <code class="code">[1, 1024]</code> and default value is <code class="code">1</code>.
  43219. </p>
  43220. </dd>
  43221. <dt><samp class="option">planes</samp></dt>
  43222. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  43223. </p>
  43224. </dd>
  43225. <dt><samp class="option">sizeY</samp></dt>
  43226. <dd><p>Set vertical radius size. Range is <code class="code">[1, 1024]</code> and default value is <code class="code">0</code>. If zero, <code class="code">sizeX</code> value will be used.
  43227. </p></dd>
  43228. </dl>
  43229. <a name="Example-1"></a>
  43230. <h4 class="subsection">34.1.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-1" aria-hidden="true">TOC</a></span></h4>
  43231. <ul class="itemize mark-bullet">
  43232. <li>Apply average blur filter with horizontal and vertical size of 3, setting each pixel of the output to the average value of the 7x7 region centered on it in the input. For pixels on the edges of the image, the region does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations.
  43233. <div class="example">
  43234. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, avgblur_opencl=3, hwdownload&quot; OUTPUT
  43235. </pre></div>
  43236. </li></ul>
  43237. <a name="boxblur_005fopencl"></a>
  43238. <h3 class="section">34.2 boxblur_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#boxblur_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-boxblur_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43239. <p>Apply a boxblur algorithm to the input video.
  43240. </p>
  43241. <p>It accepts the following parameters:
  43242. </p>
  43243. <dl class="table">
  43244. <dt><samp class="option">luma_radius, lr</samp></dt>
  43245. <dt><samp class="option">luma_power, lp</samp></dt>
  43246. <dt><samp class="option">chroma_radius, cr</samp></dt>
  43247. <dt><samp class="option">chroma_power, cp</samp></dt>
  43248. <dt><samp class="option">alpha_radius, ar</samp></dt>
  43249. <dt><samp class="option">alpha_power, ap</samp></dt>
  43250. </dl>
  43251. <p>A description of the accepted options follows.
  43252. </p>
  43253. <dl class="table">
  43254. <dt><samp class="option">luma_radius, lr</samp></dt>
  43255. <dt><samp class="option">chroma_radius, cr</samp></dt>
  43256. <dt><samp class="option">alpha_radius, ar</samp></dt>
  43257. <dd><p>Set an expression for the box radius in pixels used for blurring the
  43258. corresponding input plane.
  43259. </p>
  43260. <p>The radius value must be a non-negative number, and must not be
  43261. greater than the value of the expression <code class="code">min(w,h)/2</code> for the
  43262. luma and alpha planes, and of <code class="code">min(cw,ch)/2</code> for the chroma
  43263. planes.
  43264. </p>
  43265. <p>Default value for <samp class="option">luma_radius</samp> is &quot;2&quot;. If not specified,
  43266. <samp class="option">chroma_radius</samp> and <samp class="option">alpha_radius</samp> default to the
  43267. corresponding value set for <samp class="option">luma_radius</samp>.
  43268. </p>
  43269. <p>The expressions can contain the following constants:
  43270. </p><dl class="table">
  43271. <dt><samp class="option">w</samp></dt>
  43272. <dt><samp class="option">h</samp></dt>
  43273. <dd><p>The input width and height in pixels.
  43274. </p>
  43275. </dd>
  43276. <dt><samp class="option">cw</samp></dt>
  43277. <dt><samp class="option">ch</samp></dt>
  43278. <dd><p>The input chroma image width and height in pixels.
  43279. </p>
  43280. </dd>
  43281. <dt><samp class="option">hsub</samp></dt>
  43282. <dt><samp class="option">vsub</samp></dt>
  43283. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  43284. pixel format &quot;yuv422p&quot;, <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  43285. </p></dd>
  43286. </dl>
  43287. </dd>
  43288. <dt><samp class="option">luma_power, lp</samp></dt>
  43289. <dt><samp class="option">chroma_power, cp</samp></dt>
  43290. <dt><samp class="option">alpha_power, ap</samp></dt>
  43291. <dd><p>Specify how many times the boxblur filter is applied to the
  43292. corresponding plane.
  43293. </p>
  43294. <p>Default value for <samp class="option">luma_power</samp> is 2. If not specified,
  43295. <samp class="option">chroma_power</samp> and <samp class="option">alpha_power</samp> default to the
  43296. corresponding value set for <samp class="option">luma_power</samp>.
  43297. </p>
  43298. <p>A value of 0 will disable the effect.
  43299. </p></dd>
  43300. </dl>
  43301. <a name="Examples-165"></a>
  43302. <h4 class="subsection">34.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-165" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-165" aria-hidden="true">TOC</a></span></h4>
  43303. <p>Apply boxblur filter, setting each pixel of the output to the average value of box-radiuses <var class="var">luma_radius</var>, <var class="var">chroma_radius</var>, <var class="var">alpha_radius</var> for each plane respectively. The filter will apply <var class="var">luma_power</var>, <var class="var">chroma_power</var>, <var class="var">alpha_power</var> times onto the corresponding plane. For pixels on the edges of the image, the radius does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations.
  43304. </p>
  43305. <ul class="itemize mark-bullet">
  43306. <li>Apply a boxblur filter with the luma, chroma, and alpha radius
  43307. 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.
  43308. <div class="example">
  43309. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload&quot; OUTPUT
  43310. -i INPUT -vf &quot;hwupload, boxblur_opencl=2:3, hwdownload&quot; OUTPUT
  43311. </pre></div>
  43312. </li><li>Apply a boxblur filter with luma radius set to 2, luma_power to 1, chroma_radius to 4, chroma_power to 5, alpha_radius to 3 and alpha_power to 7.
  43313. <p>For the luma plane, a 2x2 box radius will be run once.
  43314. </p>
  43315. <p>For the chroma plane, a 4x4 box radius will be run 5 times.
  43316. </p>
  43317. <p>For the alpha plane, a 3x3 box radius will be run 7 times.
  43318. </p><div class="example">
  43319. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload&quot; OUTPUT
  43320. </pre></div>
  43321. </li></ul>
  43322. <a name="colorkey_005fopencl"></a>
  43323. <h3 class="section">34.3 colorkey_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#colorkey_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorkey_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43324. <p>RGB colorspace color keying.
  43325. </p>
  43326. <p>The filter accepts the following options:
  43327. </p>
  43328. <dl class="table">
  43329. <dt><samp class="option">color</samp></dt>
  43330. <dd><p>The color which will be replaced with transparency.
  43331. </p>
  43332. </dd>
  43333. <dt><samp class="option">similarity</samp></dt>
  43334. <dd><p>Similarity percentage with the key color.
  43335. </p>
  43336. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  43337. </p>
  43338. </dd>
  43339. <dt><samp class="option">blend</samp></dt>
  43340. <dd><p>Blend percentage.
  43341. </p>
  43342. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  43343. </p>
  43344. <p>Higher values result in semi-transparent pixels, with a higher transparency
  43345. the more similar the pixels color is to the key color.
  43346. </p></dd>
  43347. </dl>
  43348. <a name="Examples-166"></a>
  43349. <h4 class="subsection">34.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-166" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-166" aria-hidden="true">TOC</a></span></h4>
  43350. <ul class="itemize mark-bullet">
  43351. <li>Make every semi-green pixel in the input transparent with some slight blending:
  43352. <div class="example">
  43353. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, colorkey_opencl=green:0.3:0.1, hwdownload&quot; OUTPUT
  43354. </pre></div>
  43355. </li></ul>
  43356. <a name="convolution_005fopencl"></a>
  43357. <h3 class="section">34.4 convolution_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#convolution_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-convolution_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43358. <p>Apply convolution of 3x3, 5x5, 7x7 matrix.
  43359. </p>
  43360. <p>The filter accepts the following options:
  43361. </p>
  43362. <dl class="table">
  43363. <dt><samp class="option">0m</samp></dt>
  43364. <dt><samp class="option">1m</samp></dt>
  43365. <dt><samp class="option">2m</samp></dt>
  43366. <dt><samp class="option">3m</samp></dt>
  43367. <dd><p>Set matrix for each plane.
  43368. Matrix is sequence of 9, 25 or 49 signed numbers.
  43369. Default value for each plane is <code class="code">0 0 0 0 1 0 0 0 0</code>.
  43370. </p>
  43371. </dd>
  43372. <dt><samp class="option">0rdiv</samp></dt>
  43373. <dt><samp class="option">1rdiv</samp></dt>
  43374. <dt><samp class="option">2rdiv</samp></dt>
  43375. <dt><samp class="option">3rdiv</samp></dt>
  43376. <dd><p>Set multiplier for calculated value for each plane.
  43377. If unset or 0, it will be sum of all matrix elements.
  43378. The option value must be a float number greater or equal to <code class="code">0.0</code>. Default value is <code class="code">1.0</code>.
  43379. </p>
  43380. </dd>
  43381. <dt><samp class="option">0bias</samp></dt>
  43382. <dt><samp class="option">1bias</samp></dt>
  43383. <dt><samp class="option">2bias</samp></dt>
  43384. <dt><samp class="option">3bias</samp></dt>
  43385. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  43386. Useful for making the overall image brighter or darker.
  43387. The option value must be a float number greater or equal to <code class="code">0.0</code>. Default value is <code class="code">0.0</code>.
  43388. </p>
  43389. </dd>
  43390. </dl>
  43391. <a name="Examples-167"></a>
  43392. <h4 class="subsection">34.4.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-167" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-167" aria-hidden="true">TOC</a></span></h4>
  43393. <ul class="itemize mark-bullet">
  43394. <li>Apply sharpen:
  43395. <div class="example">
  43396. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, convolution_opencl=0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0, hwdownload&quot; OUTPUT
  43397. </pre></div>
  43398. </li><li>Apply blur:
  43399. <div class="example">
  43400. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, convolution_opencl=1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9, hwdownload&quot; OUTPUT
  43401. </pre></div>
  43402. </li><li>Apply edge enhance:
  43403. <div class="example">
  43404. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, convolution_opencl=0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128, hwdownload&quot; OUTPUT
  43405. </pre></div>
  43406. </li><li>Apply edge detect:
  43407. <div class="example">
  43408. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, convolution_opencl=0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128, hwdownload&quot; OUTPUT
  43409. </pre></div>
  43410. </li><li>Apply laplacian edge detector which includes diagonals:
  43411. <div class="example">
  43412. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, convolution_opencl=1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0, hwdownload&quot; OUTPUT
  43413. </pre></div>
  43414. </li><li>Apply emboss:
  43415. <div class="example">
  43416. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, convolution_opencl=-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2, hwdownload&quot; OUTPUT
  43417. </pre></div>
  43418. </li></ul>
  43419. <a name="erosion_005fopencl"></a>
  43420. <h3 class="section">34.5 erosion_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#erosion_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erosion_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43421. <p>Apply erosion effect to the video.
  43422. </p>
  43423. <p>This filter replaces the pixel by the local(3x3) minimum.
  43424. </p>
  43425. <p>It accepts the following options:
  43426. </p>
  43427. <dl class="table">
  43428. <dt><samp class="option">threshold0</samp></dt>
  43429. <dt><samp class="option">threshold1</samp></dt>
  43430. <dt><samp class="option">threshold2</samp></dt>
  43431. <dt><samp class="option">threshold3</samp></dt>
  43432. <dd><p>Limit the maximum change for each plane. Range is <code class="code">[0, 65535]</code> and default value is <code class="code">65535</code>.
  43433. If <code class="code">0</code>, plane will remain unchanged.
  43434. </p>
  43435. </dd>
  43436. <dt><samp class="option">coordinates</samp></dt>
  43437. <dd><p>Flag which specifies the pixel to refer to.
  43438. Range is <code class="code">[0, 255]</code> and default value is <code class="code">255</code>, i.e. all eight pixels are used.
  43439. </p>
  43440. <p>Flags to local 3x3 coordinates region centered on <code class="code">x</code>:
  43441. </p>
  43442. <p>1 2 3
  43443. </p>
  43444. <p>4 x 5
  43445. </p>
  43446. <p>6 7 8
  43447. </p></dd>
  43448. </dl>
  43449. <a name="Example-2"></a>
  43450. <h4 class="subsection">34.5.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-2" aria-hidden="true">TOC</a></span></h4>
  43451. <ul class="itemize mark-bullet">
  43452. <li>Apply erosion filter with threshold0 set to 30, threshold1 set 40, threshold2 set to 50 and coordinates set to 231, setting each pixel of the output to the local minimum between pixels: 1, 2, 3, 6, 7, 8 of the 3x3 region centered on it in the input. If the difference between input pixel and local minimum is more then threshold of the corresponding plane, output pixel will be set to input pixel - threshold of corresponding plane.
  43453. <div class="example">
  43454. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  43455. </pre></div>
  43456. </li></ul>
  43457. <a name="deshake_005fopencl"></a>
  43458. <h3 class="section">34.6 deshake_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#deshake_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deshake_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43459. <p>Feature-point based video stabilization filter.
  43460. </p>
  43461. <p>The filter accepts the following options:
  43462. </p>
  43463. <dl class="table">
  43464. <dt><samp class="option">tripod</samp></dt>
  43465. <dd><p>Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to <code class="code">0</code>.
  43466. </p>
  43467. </dd>
  43468. <dt><samp class="option">debug</samp></dt>
  43469. <dd><p>Whether or not additional debug info should be displayed, both in the processed output and in the console.
  43470. </p>
  43471. <p>Note that in order to see console debug output you will also need to pass <code class="code">-v verbose</code> to ffmpeg.
  43472. </p>
  43473. <p>Viewing point matches in the output video is only supported for RGB input.
  43474. </p>
  43475. <p>Defaults to <code class="code">0</code>.
  43476. </p>
  43477. </dd>
  43478. <dt><samp class="option">adaptive_crop</samp></dt>
  43479. <dd><p>Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels.
  43480. </p>
  43481. <p>Defaults to <code class="code">1</code>.
  43482. </p>
  43483. </dd>
  43484. <dt><samp class="option">refine_features</samp></dt>
  43485. <dd><p>Whether or not feature points should be refined at a sub-pixel level.
  43486. </p>
  43487. <p>This can be turned off for a slight performance gain at the cost of precision.
  43488. </p>
  43489. <p>Defaults to <code class="code">1</code>.
  43490. </p>
  43491. </dd>
  43492. <dt><samp class="option">smooth_strength</samp></dt>
  43493. <dd><p>The strength of the smoothing applied to the camera path from <code class="code">0.0</code> to <code class="code">1.0</code>.
  43494. </p>
  43495. <p><code class="code">1.0</code> is the maximum smoothing strength while values less than that result in less smoothing.
  43496. </p>
  43497. <p><code class="code">0.0</code> causes the filter to adaptively choose a smoothing strength on a per-frame basis.
  43498. </p>
  43499. <p>Defaults to <code class="code">0.0</code>.
  43500. </p>
  43501. </dd>
  43502. <dt><samp class="option">smooth_window_multiplier</samp></dt>
  43503. <dd><p>Controls the size of the smoothing window (the number of frames buffered to determine motion information from).
  43504. </p>
  43505. <p>The size of the smoothing window is determined by multiplying the framerate of the video by this number.
  43506. </p>
  43507. <p>Acceptable values range from <code class="code">0.1</code> to <code class="code">10.0</code>.
  43508. </p>
  43509. <p>Larger values increase the amount of motion data available for determining how to smooth the camera path,
  43510. potentially improving smoothness, but also increase latency and memory usage.
  43511. </p>
  43512. <p>Defaults to <code class="code">2.0</code>.
  43513. </p>
  43514. </dd>
  43515. </dl>
  43516. <a name="Examples-168"></a>
  43517. <h4 class="subsection">34.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-168" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-168" aria-hidden="true">TOC</a></span></h4>
  43518. <ul class="itemize mark-bullet">
  43519. <li>Stabilize a video with a fixed, medium smoothing strength:
  43520. <div class="example">
  43521. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, deshake_opencl=smooth_strength=0.5, hwdownload&quot; OUTPUT
  43522. </pre></div>
  43523. </li><li>Stabilize a video with debugging (both in console and in rendered video):
  43524. <div class="example">
  43525. <pre class="example-preformatted">-i INPUT -filter_complex &quot;[0:v]format=rgba, hwupload, deshake_opencl=debug=1, hwdownload, format=rgba, format=yuv420p&quot; -v verbose OUTPUT
  43526. </pre></div>
  43527. </li></ul>
  43528. <a name="dilation_005fopencl"></a>
  43529. <h3 class="section">34.7 dilation_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#dilation_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilation_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43530. <p>Apply dilation effect to the video.
  43531. </p>
  43532. <p>This filter replaces the pixel by the local(3x3) maximum.
  43533. </p>
  43534. <p>It accepts the following options:
  43535. </p>
  43536. <dl class="table">
  43537. <dt><samp class="option">threshold0</samp></dt>
  43538. <dt><samp class="option">threshold1</samp></dt>
  43539. <dt><samp class="option">threshold2</samp></dt>
  43540. <dt><samp class="option">threshold3</samp></dt>
  43541. <dd><p>Limit the maximum change for each plane. Range is <code class="code">[0, 65535]</code> and default value is <code class="code">65535</code>.
  43542. If <code class="code">0</code>, plane will remain unchanged.
  43543. </p>
  43544. </dd>
  43545. <dt><samp class="option">coordinates</samp></dt>
  43546. <dd><p>Flag which specifies the pixel to refer to.
  43547. Range is <code class="code">[0, 255]</code> and default value is <code class="code">255</code>, i.e. all eight pixels are used.
  43548. </p>
  43549. <p>Flags to local 3x3 coordinates region centered on <code class="code">x</code>:
  43550. </p>
  43551. <p>1 2 3
  43552. </p>
  43553. <p>4 x 5
  43554. </p>
  43555. <p>6 7 8
  43556. </p></dd>
  43557. </dl>
  43558. <a name="Example-3"></a>
  43559. <h4 class="subsection">34.7.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-3" aria-hidden="true">TOC</a></span></h4>
  43560. <ul class="itemize mark-bullet">
  43561. <li>Apply dilation filter with threshold0 set to 30, threshold1 set 40, threshold2 set to 50 and coordinates set to 231, setting each pixel of the output to the local maximum between pixels: 1, 2, 3, 6, 7, 8 of the 3x3 region centered on it in the input. If the difference between input pixel and local maximum is more then threshold of the corresponding plane, output pixel will be set to input pixel + threshold of corresponding plane.
  43562. <div class="example">
  43563. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  43564. </pre></div>
  43565. </li></ul>
  43566. <a class="anchor" id="nlmeans_005fopencl"></a><a name="nlmeans_005fopencl-1"></a>
  43567. <h3 class="section">34.8 nlmeans_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#nlmeans_005fopencl-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nlmeans_005fopencl-1" aria-hidden="true">TOC</a></span></h3>
  43568. <p>Non-local Means denoise filter through OpenCL, this filter accepts same options as <a class="ref" href="#nlmeans">nlmeans</a>.
  43569. </p>
  43570. <a name="overlay_005fopencl"></a>
  43571. <h3 class="section">34.9 overlay_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43572. <p>Overlay one video on top of another.
  43573. </p>
  43574. <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.
  43575. This filter requires same memory layout for all the inputs. So, format conversion may be needed.
  43576. </p>
  43577. <p>The filter accepts the following options:
  43578. </p>
  43579. <dl class="table">
  43580. <dt><samp class="option">x</samp></dt>
  43581. <dd><p>Set the x coordinate of the overlaid video on the main video.
  43582. Default value is <code class="code">0</code>.
  43583. </p>
  43584. </dd>
  43585. <dt><samp class="option">y</samp></dt>
  43586. <dd><p>Set the y coordinate of the overlaid video on the main video.
  43587. Default value is <code class="code">0</code>.
  43588. </p>
  43589. </dd>
  43590. </dl>
  43591. <a name="Examples-169"></a>
  43592. <h4 class="subsection">34.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-169" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-169" aria-hidden="true">TOC</a></span></h4>
  43593. <ul class="itemize mark-bullet">
  43594. <li>Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format.
  43595. <div class="example">
  43596. <pre class="example-preformatted">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_opencl, hwdownload&quot; OUTPUT
  43597. </pre></div>
  43598. </li><li>The inputs have same memory layout for color channels , the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p.
  43599. <div class="example">
  43600. <pre class="example-preformatted">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_opencl, hwdownload&quot; OUTPUT
  43601. </pre></div>
  43602. </li></ul>
  43603. <a name="pad_005fopencl"></a>
  43604. <h3 class="section">34.10 pad_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#pad_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43605. <p>Add paddings to the input image, and place the original input at the
  43606. provided <var class="var">x</var>, <var class="var">y</var> coordinates.
  43607. </p>
  43608. <p>It accepts the following options:
  43609. </p>
  43610. <dl class="table">
  43611. <dt><samp class="option">width, w</samp></dt>
  43612. <dt><samp class="option">height, h</samp></dt>
  43613. <dd><p>Specify an expression for the size of the output image with the
  43614. paddings added. If the value for <var class="var">width</var> or <var class="var">height</var> is 0, the
  43615. corresponding input size is used for the output.
  43616. </p>
  43617. <p>The <var class="var">width</var> expression can reference the value set by the
  43618. <var class="var">height</var> expression, and vice versa.
  43619. </p>
  43620. <p>The default value of <var class="var">width</var> and <var class="var">height</var> is 0.
  43621. </p>
  43622. </dd>
  43623. <dt><samp class="option">x</samp></dt>
  43624. <dt><samp class="option">y</samp></dt>
  43625. <dd><p>Specify the offsets to place the input image at within the padded area,
  43626. with respect to the top/left border of the output image.
  43627. </p>
  43628. <p>The <var class="var">x</var> expression can reference the value set by the <var class="var">y</var>
  43629. expression, and vice versa.
  43630. </p>
  43631. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is 0.
  43632. </p>
  43633. <p>If <var class="var">x</var> or <var class="var">y</var> evaluate to a negative number, they&rsquo;ll be changed
  43634. so the input image is centered on the padded area.
  43635. </p>
  43636. </dd>
  43637. <dt><samp class="option">color</samp></dt>
  43638. <dd><p>Specify the color of the padded area. For the syntax of this option,
  43639. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  43640. manual</a>.
  43641. </p>
  43642. </dd>
  43643. <dt><samp class="option">aspect</samp></dt>
  43644. <dd><p>Pad to an aspect instead to a resolution.
  43645. </p></dd>
  43646. </dl>
  43647. <p>The value for the <var class="var">width</var>, <var class="var">height</var>, <var class="var">x</var>, and <var class="var">y</var>
  43648. options are expressions containing the following constants:
  43649. </p>
  43650. <dl class="table">
  43651. <dt><samp class="option">in_w</samp></dt>
  43652. <dt><samp class="option">in_h</samp></dt>
  43653. <dd><p>The input video width and height.
  43654. </p>
  43655. </dd>
  43656. <dt><samp class="option">iw</samp></dt>
  43657. <dt><samp class="option">ih</samp></dt>
  43658. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  43659. </p>
  43660. </dd>
  43661. <dt><samp class="option">out_w</samp></dt>
  43662. <dt><samp class="option">out_h</samp></dt>
  43663. <dd><p>The output width and height (the size of the padded area), as
  43664. specified by the <var class="var">width</var> and <var class="var">height</var> expressions.
  43665. </p>
  43666. </dd>
  43667. <dt><samp class="option">ow</samp></dt>
  43668. <dt><samp class="option">oh</samp></dt>
  43669. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  43670. </p>
  43671. </dd>
  43672. <dt><samp class="option">x</samp></dt>
  43673. <dt><samp class="option">y</samp></dt>
  43674. <dd><p>The x and y offsets as specified by the <var class="var">x</var> and <var class="var">y</var>
  43675. expressions, or NAN if not yet specified.
  43676. </p>
  43677. </dd>
  43678. <dt><samp class="option">a</samp></dt>
  43679. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  43680. </p>
  43681. </dd>
  43682. <dt><samp class="option">sar</samp></dt>
  43683. <dd><p>input sample aspect ratio
  43684. </p>
  43685. </dd>
  43686. <dt><samp class="option">dar</samp></dt>
  43687. <dd><p>input display aspect ratio, it is the same as (<var class="var">iw</var> / <var class="var">ih</var>) * <var class="var">sar</var>
  43688. </p></dd>
  43689. </dl>
  43690. <a name="prewitt_005fopencl"></a>
  43691. <h3 class="section">34.11 prewitt_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#prewitt_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prewitt_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43692. <p>Apply the Prewitt operator (<a class="url" href="https://en.wikipedia.org/wiki/Prewitt_operator">https://en.wikipedia.org/wiki/Prewitt_operator</a>) to input video stream.
  43693. </p>
  43694. <p>The filter accepts the following option:
  43695. </p>
  43696. <dl class="table">
  43697. <dt><samp class="option">planes</samp></dt>
  43698. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  43699. </p>
  43700. </dd>
  43701. <dt><samp class="option">scale</samp></dt>
  43702. <dd><p>Set value which will be multiplied with filtered result.
  43703. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  43704. </p>
  43705. </dd>
  43706. <dt><samp class="option">delta</samp></dt>
  43707. <dd><p>Set value which will be added to filtered result.
  43708. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  43709. </p></dd>
  43710. </dl>
  43711. <a name="Example-4"></a>
  43712. <h4 class="subsection">34.11.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-4" aria-hidden="true">TOC</a></span></h4>
  43713. <ul class="itemize mark-bullet">
  43714. <li>Apply the Prewitt operator with scale set to 2 and delta set to 10.
  43715. <div class="example">
  43716. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, prewitt_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  43717. </pre></div>
  43718. </li></ul>
  43719. <a class="anchor" id="program_005fopencl"></a><a name="program_005fopencl-1"></a>
  43720. <h3 class="section">34.12 program_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#program_005fopencl-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-program_005fopencl-1" aria-hidden="true">TOC</a></span></h3>
  43721. <p>Filter video using an OpenCL program.
  43722. </p>
  43723. <dl class="table">
  43724. <dt><samp class="option">source</samp></dt>
  43725. <dd><p>OpenCL program source file.
  43726. </p>
  43727. </dd>
  43728. <dt><samp class="option">kernel</samp></dt>
  43729. <dd><p>Kernel name in program.
  43730. </p>
  43731. </dd>
  43732. <dt><samp class="option">inputs</samp></dt>
  43733. <dd><p>Number of inputs to the filter. Defaults to 1.
  43734. </p>
  43735. </dd>
  43736. <dt><samp class="option">size, s</samp></dt>
  43737. <dd><p>Size of output frames. Defaults to the same as the first input.
  43738. </p>
  43739. </dd>
  43740. </dl>
  43741. <p>The <code class="code">program_opencl</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  43742. </p>
  43743. <p>The program source file must contain a kernel function with the given name,
  43744. which will be run once for each plane of the output. Each run on a plane
  43745. gets enqueued as a separate 2D global NDRange with one work-item for each
  43746. pixel to be generated. The global ID offset for each work-item is therefore
  43747. the coordinates of a pixel in the destination image.
  43748. </p>
  43749. <p>The kernel function needs to take the following arguments:
  43750. </p><ul class="itemize mark-bullet">
  43751. <li>Destination image, <var class="var">__write_only image2d_t</var>.
  43752. <p>This image will become the output; the kernel should write all of it.
  43753. </p></li><li>Frame index, <var class="var">unsigned int</var>.
  43754. <p>This is a counter starting from zero and increasing by one for each frame.
  43755. </p></li><li>Source images, <var class="var">__read_only image2d_t</var>.
  43756. <p>These are the most recent images on each input. The kernel may read from
  43757. them to generate the output, but they can&rsquo;t be written to.
  43758. </p></li></ul>
  43759. <p>Example programs:
  43760. </p>
  43761. <ul class="itemize mark-bullet">
  43762. <li>Copy the input to the output (output must be the same size as the input).
  43763. <pre class="verbatim">__kernel void copy(__write_only image2d_t destination,
  43764. unsigned int index,
  43765. __read_only image2d_t source)
  43766. {
  43767. const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
  43768. int2 location = (int2)(get_global_id(0), get_global_id(1));
  43769. float4 value = read_imagef(source, sampler, location);
  43770. write_imagef(destination, location, value);
  43771. }
  43772. </pre>
  43773. </li><li>Apply a simple transformation, rotating the input by an amount increasing
  43774. with the index counter. Pixel values are linearly interpolated by the
  43775. sampler, and the output need not have the same dimensions as the input.
  43776. <pre class="verbatim">__kernel void rotate_image(__write_only image2d_t dst,
  43777. unsigned int index,
  43778. __read_only image2d_t src)
  43779. {
  43780. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  43781. CLK_FILTER_LINEAR);
  43782. float angle = (float)index / 100.0f;
  43783. float2 dst_dim = convert_float2(get_image_dim(dst));
  43784. float2 src_dim = convert_float2(get_image_dim(src));
  43785. float2 dst_cen = dst_dim / 2.0f;
  43786. float2 src_cen = src_dim / 2.0f;
  43787. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  43788. float2 dst_pos = convert_float2(dst_loc) - dst_cen;
  43789. float2 src_pos = {
  43790. cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
  43791. sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
  43792. };
  43793. src_pos = src_pos * src_dim / dst_dim;
  43794. float2 src_loc = src_pos + src_cen;
  43795. if (src_loc.x &lt; 0.0f || src_loc.y &lt; 0.0f ||
  43796. src_loc.x &gt; src_dim.x || src_loc.y &gt; src_dim.y)
  43797. write_imagef(dst, dst_loc, 0.5f);
  43798. else
  43799. write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
  43800. }
  43801. </pre>
  43802. </li><li>Blend two inputs together, with the amount of each input used varying
  43803. with the index counter.
  43804. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  43805. unsigned int index,
  43806. __read_only image2d_t src1,
  43807. __read_only image2d_t src2)
  43808. {
  43809. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  43810. CLK_FILTER_LINEAR);
  43811. float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
  43812. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  43813. int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
  43814. int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
  43815. float4 val1 = read_imagef(src1, sampler, src1_loc);
  43816. float4 val2 = read_imagef(src2, sampler, src2_loc);
  43817. write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
  43818. }
  43819. </pre>
  43820. </li></ul>
  43821. <a name="remap_005fopencl"></a>
  43822. <h3 class="section">34.13 remap_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#remap_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-remap_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43823. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  43824. </p>
  43825. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  43826. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  43827. value for pixel will be used for destination pixel.
  43828. </p>
  43829. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  43830. will have Xmap/Ymap video stream dimensions.
  43831. Xmap and Ymap input video streams are 32bit float pixel format, single channel.
  43832. </p>
  43833. <dl class="table">
  43834. <dt><samp class="option">interp</samp></dt>
  43835. <dd><p>Specify interpolation used for remapping of pixels.
  43836. Allowed values are <code class="code">near</code> and <code class="code">linear</code>.
  43837. Default value is <code class="code">linear</code>.
  43838. </p>
  43839. </dd>
  43840. <dt><samp class="option">fill</samp></dt>
  43841. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  43842. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  43843. manual</a>. Default color is <code class="code">black</code>.
  43844. </p></dd>
  43845. </dl>
  43846. <a name="roberts_005fopencl"></a>
  43847. <h3 class="section">34.14 roberts_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#roberts_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-roberts_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43848. <p>Apply the Roberts cross operator (<a class="url" href="https://en.wikipedia.org/wiki/Roberts_cross">https://en.wikipedia.org/wiki/Roberts_cross</a>) to input video stream.
  43849. </p>
  43850. <p>The filter accepts the following option:
  43851. </p>
  43852. <dl class="table">
  43853. <dt><samp class="option">planes</samp></dt>
  43854. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  43855. </p>
  43856. </dd>
  43857. <dt><samp class="option">scale</samp></dt>
  43858. <dd><p>Set value which will be multiplied with filtered result.
  43859. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  43860. </p>
  43861. </dd>
  43862. <dt><samp class="option">delta</samp></dt>
  43863. <dd><p>Set value which will be added to filtered result.
  43864. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  43865. </p></dd>
  43866. </dl>
  43867. <a name="Example-5"></a>
  43868. <h4 class="subsection">34.14.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-5" aria-hidden="true">TOC</a></span></h4>
  43869. <ul class="itemize mark-bullet">
  43870. <li>Apply the Roberts cross operator with scale set to 2 and delta set to 10
  43871. <div class="example">
  43872. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, roberts_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  43873. </pre></div>
  43874. </li></ul>
  43875. <a name="sobel_005fopencl"></a>
  43876. <h3 class="section">34.15 sobel_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#sobel_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sobel_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43877. <p>Apply the Sobel operator (<a class="url" href="https://en.wikipedia.org/wiki/Sobel_operator">https://en.wikipedia.org/wiki/Sobel_operator</a>) to input video stream.
  43878. </p>
  43879. <p>The filter accepts the following option:
  43880. </p>
  43881. <dl class="table">
  43882. <dt><samp class="option">planes</samp></dt>
  43883. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  43884. </p>
  43885. </dd>
  43886. <dt><samp class="option">scale</samp></dt>
  43887. <dd><p>Set value which will be multiplied with filtered result.
  43888. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  43889. </p>
  43890. </dd>
  43891. <dt><samp class="option">delta</samp></dt>
  43892. <dd><p>Set value which will be added to filtered result.
  43893. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  43894. </p></dd>
  43895. </dl>
  43896. <a name="Example-6"></a>
  43897. <h4 class="subsection">34.15.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-6" aria-hidden="true">TOC</a></span></h4>
  43898. <ul class="itemize mark-bullet">
  43899. <li>Apply sobel operator with scale set to 2 and delta set to 10
  43900. <div class="example">
  43901. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, sobel_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  43902. </pre></div>
  43903. </li></ul>
  43904. <a name="tonemap_005fopencl"></a>
  43905. <h3 class="section">34.16 tonemap_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#tonemap_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tonemap_005fopencl" aria-hidden="true">TOC</a></span></h3>
  43906. <p>Perform HDR(PQ/HLG) to SDR conversion with tone-mapping.
  43907. </p>
  43908. <p>It accepts the following parameters:
  43909. </p>
  43910. <dl class="table">
  43911. <dt><samp class="option">tonemap</samp></dt>
  43912. <dd><p>Specify the tone-mapping operator to be used. Same as tonemap option in <a class="ref" href="#tonemap">tonemap</a>.
  43913. </p>
  43914. </dd>
  43915. <dt><samp class="option">param</samp></dt>
  43916. <dd><p>Tune the tone mapping algorithm. same as param option in <a class="ref" href="#tonemap">tonemap</a>.
  43917. </p>
  43918. </dd>
  43919. <dt><samp class="option">desat</samp></dt>
  43920. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  43921. higher the parameter, the more color information will be preserved. This
  43922. setting helps prevent unnaturally blown-out colors for super-highlights, by
  43923. (smoothly) turning into white instead. This makes images feel more natural,
  43924. at the cost of reducing information about out-of-range colors.
  43925. </p>
  43926. <p>The default value is 0.5, and the algorithm here is a little different from
  43927. the cpu version tonemap currently. A setting of 0.0 disables this option.
  43928. </p>
  43929. </dd>
  43930. <dt><samp class="option">threshold</samp></dt>
  43931. <dd><p>The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold
  43932. is used to detect whether the scene has changed or not. If the distance between
  43933. the current frame average brightness and the current running average exceeds
  43934. a threshold value, we would re-calculate scene average and peak brightness.
  43935. The default value is 0.2.
  43936. </p>
  43937. </dd>
  43938. <dt><samp class="option">format</samp></dt>
  43939. <dd><p>Specify the output pixel format.
  43940. </p>
  43941. <p>Currently supported formats are:
  43942. </p><dl class="table">
  43943. <dt><var class="var">p010</var></dt>
  43944. <dt><var class="var">nv12</var></dt>
  43945. </dl>
  43946. </dd>
  43947. <dt><samp class="option">range, r</samp></dt>
  43948. <dd><p>Set the output color range.
  43949. </p>
  43950. <p>Possible values are:
  43951. </p><dl class="table">
  43952. <dt><var class="var">tv/mpeg</var></dt>
  43953. <dt><var class="var">pc/jpeg</var></dt>
  43954. </dl>
  43955. <p>Default is same as input.
  43956. </p>
  43957. </dd>
  43958. <dt><samp class="option">primaries, p</samp></dt>
  43959. <dd><p>Set the output color primaries.
  43960. </p>
  43961. <p>Possible values are:
  43962. </p><dl class="table">
  43963. <dt><var class="var">bt709</var></dt>
  43964. <dt><var class="var">bt2020</var></dt>
  43965. </dl>
  43966. <p>Default is same as input.
  43967. </p>
  43968. </dd>
  43969. <dt><samp class="option">transfer, t</samp></dt>
  43970. <dd><p>Set the output transfer characteristics.
  43971. </p>
  43972. <p>Possible values are:
  43973. </p><dl class="table">
  43974. <dt><var class="var">bt709</var></dt>
  43975. <dt><var class="var">bt2020</var></dt>
  43976. </dl>
  43977. <p>Default is bt709.
  43978. </p>
  43979. </dd>
  43980. <dt><samp class="option">matrix, m</samp></dt>
  43981. <dd><p>Set the output colorspace matrix.
  43982. </p>
  43983. <p>Possible value are:
  43984. </p><dl class="table">
  43985. <dt><var class="var">bt709</var></dt>
  43986. <dt><var class="var">bt2020</var></dt>
  43987. </dl>
  43988. <p>Default is same as input.
  43989. </p>
  43990. </dd>
  43991. </dl>
  43992. <a name="Example-7"></a>
  43993. <h4 class="subsection">34.16.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-7" aria-hidden="true">TOC</a></span></h4>
  43994. <ul class="itemize mark-bullet">
  43995. <li>Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator.
  43996. <div class="example">
  43997. <pre class="example-preformatted">-i INPUT -vf &quot;format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010&quot; OUTPUT
  43998. </pre></div>
  43999. </li></ul>
  44000. <a name="unsharp_005fopencl"></a>
  44001. <h3 class="section">34.17 unsharp_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#unsharp_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unsharp_005fopencl" aria-hidden="true">TOC</a></span></h3>
  44002. <p>Sharpen or blur the input video.
  44003. </p>
  44004. <p>It accepts the following parameters:
  44005. </p>
  44006. <dl class="table">
  44007. <dt><samp class="option">luma_msize_x, lx</samp></dt>
  44008. <dd><p>Set the luma matrix horizontal size.
  44009. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  44010. </p>
  44011. </dd>
  44012. <dt><samp class="option">luma_msize_y, ly</samp></dt>
  44013. <dd><p>Set the luma matrix vertical size.
  44014. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  44015. </p>
  44016. </dd>
  44017. <dt><samp class="option">luma_amount, la</samp></dt>
  44018. <dd><p>Set the luma effect strength.
  44019. Range is <code class="code">[-10, 10]</code> and default value is <code class="code">1.0</code>.
  44020. </p>
  44021. <p>Negative values will blur the input video, while positive values will
  44022. sharpen it, a value of zero will disable the effect.
  44023. </p>
  44024. </dd>
  44025. <dt><samp class="option">chroma_msize_x, cx</samp></dt>
  44026. <dd><p>Set the chroma matrix horizontal size.
  44027. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  44028. </p>
  44029. </dd>
  44030. <dt><samp class="option">chroma_msize_y, cy</samp></dt>
  44031. <dd><p>Set the chroma matrix vertical size.
  44032. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  44033. </p>
  44034. </dd>
  44035. <dt><samp class="option">chroma_amount, ca</samp></dt>
  44036. <dd><p>Set the chroma effect strength.
  44037. Range is <code class="code">[-10, 10]</code> and default value is <code class="code">0.0</code>.
  44038. </p>
  44039. <p>Negative values will blur the input video, while positive values will
  44040. sharpen it, a value of zero will disable the effect.
  44041. </p>
  44042. </dd>
  44043. </dl>
  44044. <p>All parameters are optional and default to the equivalent of the
  44045. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  44046. </p>
  44047. <a name="Examples-170"></a>
  44048. <h4 class="subsection">34.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-170" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-170" aria-hidden="true">TOC</a></span></h4>
  44049. <ul class="itemize mark-bullet">
  44050. <li>Apply strong luma sharpen effect:
  44051. <div class="example">
  44052. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, unsharp_opencl=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5, hwdownload&quot; OUTPUT
  44053. </pre></div>
  44054. </li><li>Apply a strong blur of both luma and chroma parameters:
  44055. <div class="example">
  44056. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload&quot; OUTPUT
  44057. </pre></div>
  44058. </li></ul>
  44059. <a name="xfade_005fopencl"></a>
  44060. <h3 class="section">34.18 xfade_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#xfade_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xfade_005fopencl" aria-hidden="true">TOC</a></span></h3>
  44061. <p>Cross fade two videos with custom transition effect by using OpenCL.
  44062. </p>
  44063. <p>It accepts the following options:
  44064. </p>
  44065. <dl class="table">
  44066. <dt><samp class="option">transition</samp></dt>
  44067. <dd><p>Set one of possible transition effects.
  44068. </p>
  44069. <dl class="table">
  44070. <dt><samp class="option">custom</samp></dt>
  44071. <dd><p>Select custom transition effect, the actual transition description
  44072. will be picked from source and kernel options.
  44073. </p>
  44074. </dd>
  44075. <dt><samp class="option">fade</samp></dt>
  44076. <dt><samp class="option">wipeleft</samp></dt>
  44077. <dt><samp class="option">wiperight</samp></dt>
  44078. <dt><samp class="option">wipeup</samp></dt>
  44079. <dt><samp class="option">wipedown</samp></dt>
  44080. <dt><samp class="option">slideleft</samp></dt>
  44081. <dt><samp class="option">slideright</samp></dt>
  44082. <dt><samp class="option">slideup</samp></dt>
  44083. <dt><samp class="option">slidedown</samp></dt>
  44084. <dd>
  44085. <p>Default transition is fade.
  44086. </p></dd>
  44087. </dl>
  44088. </dd>
  44089. <dt><samp class="option">source</samp></dt>
  44090. <dd><p>OpenCL program source file for custom transition.
  44091. </p>
  44092. </dd>
  44093. <dt><samp class="option">kernel</samp></dt>
  44094. <dd><p>Set name of kernel to use for custom transition from program source file.
  44095. </p>
  44096. </dd>
  44097. <dt><samp class="option">duration</samp></dt>
  44098. <dd><p>Set duration of video transition.
  44099. </p>
  44100. </dd>
  44101. <dt><samp class="option">offset</samp></dt>
  44102. <dd><p>Set time of start of transition relative to first video.
  44103. </p></dd>
  44104. </dl>
  44105. <p>The program source file must contain a kernel function with the given name,
  44106. which will be run once for each plane of the output. Each run on a plane
  44107. gets enqueued as a separate 2D global NDRange with one work-item for each
  44108. pixel to be generated. The global ID offset for each work-item is therefore
  44109. the coordinates of a pixel in the destination image.
  44110. </p>
  44111. <p>The kernel function needs to take the following arguments:
  44112. </p><ul class="itemize mark-bullet">
  44113. <li>Destination image, <var class="var">__write_only image2d_t</var>.
  44114. <p>This image will become the output; the kernel should write all of it.
  44115. </p>
  44116. </li><li>First Source image, <var class="var">__read_only image2d_t</var>.
  44117. Second Source image, <var class="var">__read_only image2d_t</var>.
  44118. <p>These are the most recent images on each input. The kernel may read from
  44119. them to generate the output, but they can&rsquo;t be written to.
  44120. </p>
  44121. </li><li>Transition progress, <var class="var">float</var>. This value is always between 0 and 1 inclusive.
  44122. </li></ul>
  44123. <p>Example programs:
  44124. </p>
  44125. <ul class="itemize mark-bullet">
  44126. <li>Apply dots curtain transition effect:
  44127. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  44128. __read_only image2d_t src1,
  44129. __read_only image2d_t src2,
  44130. float progress)
  44131. {
  44132. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  44133. CLK_FILTER_LINEAR);
  44134. int2 p = (int2)(get_global_id(0), get_global_id(1));
  44135. float2 rp = (float2)(get_global_id(0), get_global_id(1));
  44136. float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
  44137. rp = rp / dim;
  44138. float2 dots = (float2)(20.0, 20.0);
  44139. float2 center = (float2)(0,0);
  44140. float2 unused;
  44141. float4 val1 = read_imagef(src1, sampler, p);
  44142. float4 val2 = read_imagef(src2, sampler, p);
  44143. bool next = distance(fract(rp * dots, &amp;unused), (float2)(0.5, 0.5)) &lt; (progress / distance(rp, center));
  44144. write_imagef(dst, p, next ? val1 : val2);
  44145. }
  44146. </pre>
  44147. </li></ul>
  44148. <a name="VAAPI-Video-Filters"></a>
  44149. <h2 class="chapter">35 VAAPI Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#VAAPI-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VAAPI-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  44150. <p>VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters.
  44151. </p>
  44152. <p>To enable compilation of these filters you need to configure FFmpeg with
  44153. <code class="code">--enable-vaapi</code>.
  44154. </p>
  44155. <p>To use vaapi filters, you need to setup the vaapi device correctly. For more information, please read <a class="url" href="https://trac.ffmpeg.org/wiki/Hardware/VAAPI">https://trac.ffmpeg.org/wiki/Hardware/VAAPI</a>
  44156. </p>
  44157. <a name="overlay_005fvaapi"></a>
  44158. <h3 class="section">35.1 overlay_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  44159. <p>Overlay one video on the top of another.
  44160. </p>
  44161. <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.
  44162. </p>
  44163. <p>The filter accepts the following options:
  44164. </p>
  44165. <dl class="table">
  44166. <dt><samp class="option">x</samp></dt>
  44167. <dt><samp class="option">y</samp></dt>
  44168. <dd><p>Set expressions for the x and y coordinates of the overlaid video
  44169. on the main video.
  44170. </p>
  44171. <p>Default value is &quot;0&quot; for both expressions.
  44172. </p>
  44173. </dd>
  44174. <dt><samp class="option">w</samp></dt>
  44175. <dt><samp class="option">h</samp></dt>
  44176. <dd><p>Set expressions for the width and height the overlaid video
  44177. on the main video.
  44178. </p>
  44179. <p>Default values are &rsquo;overlay_iw&rsquo; for &rsquo;w&rsquo; and &rsquo;overlay_ih*w/overlay_iw&rsquo; for &rsquo;h&rsquo;.
  44180. </p>
  44181. <p>The expressions can contain the following parameters:
  44182. </p>
  44183. <dl class="table">
  44184. <dt><samp class="option">main_w, W</samp></dt>
  44185. <dt><samp class="option">main_h, H</samp></dt>
  44186. <dd><p>The main input width and height.
  44187. </p>
  44188. </dd>
  44189. <dt><samp class="option">overlay_iw</samp></dt>
  44190. <dt><samp class="option">overlay_ih</samp></dt>
  44191. <dd><p>The overlay input width and height.
  44192. </p>
  44193. </dd>
  44194. <dt><samp class="option">overlay_w, w</samp></dt>
  44195. <dt><samp class="option">overlay_h, h</samp></dt>
  44196. <dd><p>The overlay output width and height.
  44197. </p>
  44198. </dd>
  44199. <dt><samp class="option">overlay_x, x</samp></dt>
  44200. <dt><samp class="option">overlay_y, y</samp></dt>
  44201. <dd><p>Position of the overlay layer inside of main
  44202. </p>
  44203. </dd>
  44204. </dl>
  44205. </dd>
  44206. <dt><samp class="option">alpha</samp></dt>
  44207. <dd><p>Set transparency of overlaid video. Allowed range is 0.0 to 1.0.
  44208. Higher value means lower transparency.
  44209. Default value is <code class="code">1.0</code>.
  44210. </p>
  44211. </dd>
  44212. <dt><samp class="option">eof_action</samp></dt>
  44213. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  44214. </p>
  44215. </dd>
  44216. <dt><samp class="option">shortest</samp></dt>
  44217. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  44218. </p>
  44219. </dd>
  44220. <dt><samp class="option">repeatlast</samp></dt>
  44221. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  44222. </p>
  44223. </dd>
  44224. </dl>
  44225. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  44226. </p><a name="Examples-171"></a>
  44227. <h4 class="subsection">35.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-171" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-171" aria-hidden="true">TOC</a></span></h4>
  44228. <ul class="itemize mark-bullet">
  44229. <li>Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs for this filter are yuv420p format.
  44230. <div class="example">
  44231. <pre class="example-preformatted">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_vaapi&quot; OUTPUT
  44232. </pre></div>
  44233. </li><li>Overlay an image LOGO at the offset (200, 100) from the top-left corner of the INPUT video.
  44234. The inputs have same memory layout for color channels, the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p.
  44235. <div class="example">
  44236. <pre class="example-preformatted">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_vaapi=x=200:y=100:w=400:h=300:alpha=1.0, hwdownload, format=nv12&quot; OUTPUT
  44237. </pre></div>
  44238. </li></ul>
  44239. <a name="tonemap_005fvaapi"></a>
  44240. <h3 class="section">35.2 tonemap_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#tonemap_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tonemap_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  44241. <p>Perform HDR-to-SDR or HDR-to-HDR tone-mapping.
  44242. It currently only accepts HDR10 as input.
  44243. </p>
  44244. <p>It accepts the following parameters:
  44245. </p>
  44246. <dl class="table">
  44247. <dt><samp class="option">format</samp></dt>
  44248. <dd><p>Specify the output pixel format.
  44249. </p>
  44250. <p>Default is nv12 for HDR-to-SDR tone-mapping and p010 for HDR-to-HDR
  44251. tone-mapping.
  44252. </p>
  44253. </dd>
  44254. <dt><samp class="option">primaries, p</samp></dt>
  44255. <dd><p>Set the output color primaries.
  44256. </p>
  44257. <p>Default is bt709 for HDR-to-SDR tone-mapping and same as input for HDR-to-HDR
  44258. tone-mapping.
  44259. </p>
  44260. </dd>
  44261. <dt><samp class="option">transfer, t</samp></dt>
  44262. <dd><p>Set the output transfer characteristics.
  44263. </p>
  44264. <p>Default is bt709 for HDR-to-SDR tone-mapping and same as input for HDR-to-HDR
  44265. tone-mapping.
  44266. </p>
  44267. </dd>
  44268. <dt><samp class="option">matrix, m</samp></dt>
  44269. <dd><p>Set the output colorspace matrix.
  44270. </p>
  44271. <p>Default is bt709 for HDR-to-SDR tone-mapping and same as input for HDR-to-HDR
  44272. tone-mapping.
  44273. </p>
  44274. </dd>
  44275. <dt><samp class="option">display</samp></dt>
  44276. <dd><p>Set the output mastering display colour volume. It is given by a &rsquo;|&rsquo;-separated
  44277. list of two values, two values are space separated. It set display primaries
  44278. x &amp; y in G, B, R order, then white point x &amp; y, the nominal minimum &amp; maximum
  44279. display luminances.
  44280. </p>
  44281. <p>HDR-to-HDR tone-mapping will be performed when this option is set.
  44282. </p>
  44283. </dd>
  44284. <dt><samp class="option">light</samp></dt>
  44285. <dd><p>Set the output content light level information. It accepts 2 space-separated
  44286. values, the first input is the maximum light level and the second input is
  44287. the maximum average light level.
  44288. </p>
  44289. <p>It is ignored for HDR-to-SDR tone-mapping, and optional for HDR-to-HDR
  44290. tone-mapping.
  44291. </p>
  44292. </dd>
  44293. </dl>
  44294. <a name="Example-8"></a>
  44295. <h4 class="subsection">35.2.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-8" aria-hidden="true">TOC</a></span></h4>
  44296. <ul class="itemize mark-bullet">
  44297. <li>Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format
  44298. <div class="example">
  44299. <pre class="example-preformatted">tonemap_vaapi=format=p010:t=bt2020-10
  44300. </pre></div>
  44301. </li><li>Convert HDR video to HDR video
  44302. <div class="example">
  44303. <pre class="example-preformatted">tonemap_vaapi=display=7500\ 3000|34000\ 16000|13250\ 34500|15635\ 16450|500\ 10000000
  44304. </pre></div>
  44305. </li></ul>
  44306. <a name="hstack_005fvaapi"></a>
  44307. <h3 class="section">35.3 hstack_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#hstack_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hstack_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  44308. <p>Stack input videos horizontally.
  44309. </p>
  44310. <p>This is the VA-API variant of the <a class="ref" href="#hstack">hstack</a> filter, each input stream may
  44311. have different height, this filter will scale down/up each input stream while
  44312. keeping the original aspect.
  44313. </p>
  44314. <p>It accepts the following options:
  44315. </p>
  44316. <dl class="table">
  44317. <dt><samp class="option">inputs</samp></dt>
  44318. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  44319. </p>
  44320. </dd>
  44321. <dt><samp class="option">shortest</samp></dt>
  44322. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  44323. </p>
  44324. </dd>
  44325. <dt><samp class="option">height</samp></dt>
  44326. <dd><p>Set height of output. If set to 0, this filter will set height of output to
  44327. height of the first input stream. Default value is 0.
  44328. </p></dd>
  44329. </dl>
  44330. <a name="vstack_005fvaapi"></a>
  44331. <h3 class="section">35.4 vstack_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#vstack_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vstack_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  44332. <p>Stack input videos vertically.
  44333. </p>
  44334. <p>This is the VA-API variant of the <a class="ref" href="#vstack">vstack</a> filter, each input stream may
  44335. have different width, this filter will scale down/up each input stream while
  44336. keeping the original aspect.
  44337. </p>
  44338. <p>It accepts the following options:
  44339. </p>
  44340. <dl class="table">
  44341. <dt><samp class="option">inputs</samp></dt>
  44342. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  44343. </p>
  44344. </dd>
  44345. <dt><samp class="option">shortest</samp></dt>
  44346. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  44347. </p>
  44348. </dd>
  44349. <dt><samp class="option">width</samp></dt>
  44350. <dd><p>Set width of output. If set to 0, this filter will set width of output to
  44351. width of the first input stream. Default value is 0.
  44352. </p></dd>
  44353. </dl>
  44354. <a name="xstack_005fvaapi"></a>
  44355. <h3 class="section">35.5 xstack_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#xstack_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xstack_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  44356. <p>Stack video inputs into custom layout.
  44357. </p>
  44358. <p>This is the VA-API variant of the <a class="ref" href="#xstack">xstack</a> filter, each input stream may
  44359. have different size, this filter will scale down/up each input stream to the
  44360. given output size, or the size of the first input stream.
  44361. </p>
  44362. <p>It accepts the following options:
  44363. </p>
  44364. <dl class="table">
  44365. <dt><samp class="option">inputs</samp></dt>
  44366. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  44367. </p>
  44368. </dd>
  44369. <dt><samp class="option">shortest</samp></dt>
  44370. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  44371. </p>
  44372. </dd>
  44373. <dt><samp class="option">layout</samp></dt>
  44374. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  44375. Moreover, this permits the user to supply output size for each input stream.
  44376. </p><div class="example">
  44377. <pre class="example-preformatted">xstack_vaapi=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
  44378. </pre></div>
  44379. </dd>
  44380. <dt><samp class="option">grid</samp></dt>
  44381. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  44382. </p>
  44383. </dd>
  44384. <dt><samp class="option">grid_tile_size</samp></dt>
  44385. <dd><p>Set output size for each input stream when <samp class="option">grid</samp> is set. If this option
  44386. is not set, this filter will set output size by default to the size of the
  44387. first input stream. For the syntax of this option, check the
  44388. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44389. </p>
  44390. </dd>
  44391. <dt><samp class="option">fill</samp></dt>
  44392. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  44393. </p></dd>
  44394. </dl>
  44395. <a name="pad_005fvaapi"></a>
  44396. <h3 class="section">35.6 pad_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#pad_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  44397. <p>Add paddings to the input image, and place the original input at the
  44398. provided <var class="var">x</var>, <var class="var">y</var> coordinates.
  44399. </p>
  44400. <p>It accepts the following options:
  44401. </p>
  44402. <dl class="table">
  44403. <dt><samp class="option">width, w</samp></dt>
  44404. <dt><samp class="option">height, h</samp></dt>
  44405. <dd><p>Specify an expression for the size of the output image with the
  44406. paddings added. If the value for <var class="var">width</var> or <var class="var">height</var> is 0, the
  44407. corresponding input size is used for the output.
  44408. </p>
  44409. <p>The <var class="var">width</var> expression can reference the value set by the
  44410. <var class="var">height</var> expression, and vice versa.
  44411. </p>
  44412. <p>The default value of <var class="var">width</var> and <var class="var">height</var> is 0.
  44413. </p>
  44414. </dd>
  44415. <dt><samp class="option">x</samp></dt>
  44416. <dt><samp class="option">y</samp></dt>
  44417. <dd><p>Specify the offsets to place the input image at within the padded area,
  44418. with respect to the top/left border of the output image.
  44419. </p>
  44420. <p>The <var class="var">x</var> expression can reference the value set by the <var class="var">y</var>
  44421. expression, and vice versa.
  44422. </p>
  44423. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is 0.
  44424. </p>
  44425. <p>If <var class="var">x</var> or <var class="var">y</var> evaluate to a negative number, they&rsquo;ll be changed
  44426. so the input image is centered on the padded area.
  44427. </p>
  44428. </dd>
  44429. <dt><samp class="option">color</samp></dt>
  44430. <dd><p>Specify the color of the padded area. For the syntax of this option,
  44431. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  44432. manual</a>.
  44433. </p>
  44434. </dd>
  44435. <dt><samp class="option">aspect</samp></dt>
  44436. <dd><p>Pad to an aspect instead to a resolution.
  44437. </p></dd>
  44438. </dl>
  44439. <p>The value for the <var class="var">width</var>, <var class="var">height</var>, <var class="var">x</var>, and <var class="var">y</var>
  44440. options are expressions containing the following constants:
  44441. </p>
  44442. <dl class="table">
  44443. <dt><samp class="option">in_w</samp></dt>
  44444. <dt><samp class="option">in_h</samp></dt>
  44445. <dd><p>The input video width and height.
  44446. </p>
  44447. </dd>
  44448. <dt><samp class="option">iw</samp></dt>
  44449. <dt><samp class="option">ih</samp></dt>
  44450. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  44451. </p>
  44452. </dd>
  44453. <dt><samp class="option">out_w</samp></dt>
  44454. <dt><samp class="option">out_h</samp></dt>
  44455. <dd><p>The output width and height (the size of the padded area), as
  44456. specified by the <var class="var">width</var> and <var class="var">height</var> expressions.
  44457. </p>
  44458. </dd>
  44459. <dt><samp class="option">ow</samp></dt>
  44460. <dt><samp class="option">oh</samp></dt>
  44461. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  44462. </p>
  44463. </dd>
  44464. <dt><samp class="option">x</samp></dt>
  44465. <dt><samp class="option">y</samp></dt>
  44466. <dd><p>The x and y offsets as specified by the <var class="var">x</var> and <var class="var">y</var>
  44467. expressions, or NAN if not yet specified.
  44468. </p>
  44469. </dd>
  44470. <dt><samp class="option">a</samp></dt>
  44471. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  44472. </p>
  44473. </dd>
  44474. <dt><samp class="option">sar</samp></dt>
  44475. <dd><p>input sample aspect ratio
  44476. </p>
  44477. </dd>
  44478. <dt><samp class="option">dar</samp></dt>
  44479. <dd><p>input display aspect ratio, it is the same as (<var class="var">iw</var> / <var class="var">ih</var>) * <var class="var">sar</var>
  44480. </p></dd>
  44481. </dl>
  44482. <a name="drawbox_005fvaapi"></a>
  44483. <h3 class="section">35.7 drawbox_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#drawbox_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawbox_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  44484. <p>Draw a colored box on the input image.
  44485. </p>
  44486. <p>It accepts the following parameters:
  44487. </p>
  44488. <dl class="table">
  44489. <dt><samp class="option">x</samp></dt>
  44490. <dt><samp class="option">y</samp></dt>
  44491. <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
  44492. </p>
  44493. </dd>
  44494. <dt><samp class="option">width, w</samp></dt>
  44495. <dt><samp class="option">height, h</samp></dt>
  44496. <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
  44497. the input width and height. It defaults to 0.
  44498. </p>
  44499. </dd>
  44500. <dt><samp class="option">color, c</samp></dt>
  44501. <dd><p>Specify the color of the box to write. For the general syntax of this option,
  44502. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  44503. </p>
  44504. </dd>
  44505. <dt><samp class="option">thickness, t</samp></dt>
  44506. <dd><p>The expression which sets the thickness of the box edge.
  44507. A value of <code class="code">fill</code> will create a filled box. Default value is <code class="code">3</code>.
  44508. </p>
  44509. <p>See below for the list of accepted constants.
  44510. </p>
  44511. </dd>
  44512. <dt><samp class="option">replace</samp></dt>
  44513. <dd><p>With value <code class="code">1</code>, the pixels of the painted box will overwrite the video&rsquo;s color and alpha pixels.
  44514. Default is <code class="code">0</code>, which composites the box onto the input video.
  44515. </p></dd>
  44516. </dl>
  44517. <p>The parameters for <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var> and <var class="var">h</var> and <var class="var">t</var> are expressions containing the
  44518. following constants:
  44519. </p>
  44520. <dl class="table">
  44521. <dt><samp class="option">in_h, ih</samp></dt>
  44522. <dt><samp class="option">in_w, iw</samp></dt>
  44523. <dd><p>The input width and height.
  44524. </p>
  44525. </dd>
  44526. <dt><samp class="option">x</samp></dt>
  44527. <dt><samp class="option">y</samp></dt>
  44528. <dd><p>The x and y offset coordinates where the box is drawn.
  44529. </p>
  44530. </dd>
  44531. <dt><samp class="option">w</samp></dt>
  44532. <dt><samp class="option">h</samp></dt>
  44533. <dd><p>The width and height of the drawn box.
  44534. </p>
  44535. </dd>
  44536. <dt><samp class="option">t</samp></dt>
  44537. <dd><p>The thickness of the drawn box.
  44538. </p>
  44539. </dd>
  44540. </dl>
  44541. <a name="Examples-172"></a>
  44542. <h4 class="subsection">35.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-172" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-172" aria-hidden="true">TOC</a></span></h4>
  44543. <ul class="itemize mark-bullet">
  44544. <li>Draw a black box around the edge of the input image:
  44545. <div class="example">
  44546. <pre class="example-preformatted">drawbox
  44547. </pre></div>
  44548. </li><li>Draw a box with color red and an opacity of 50%:
  44549. <div class="example">
  44550. <pre class="example-preformatted">drawbox=10:20:200:60:red@0.5
  44551. </pre></div>
  44552. <p>The previous example can be specified as:
  44553. </p><div class="example">
  44554. <pre class="example-preformatted">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
  44555. </pre></div>
  44556. </li><li>Fill the box with pink color:
  44557. <div class="example">
  44558. <pre class="example-preformatted">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
  44559. </pre></div>
  44560. </li><li>Draw a 2-pixel red 2.40:1 mask:
  44561. <div class="example">
  44562. <pre class="example-preformatted">drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
  44563. </pre></div>
  44564. </li></ul>
  44565. <a name="VideoToolbox-Video-Filters"></a>
  44566. <h2 class="chapter">36 VideoToolbox Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#VideoToolbox-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VideoToolbox-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  44567. <p>Below is a description of the currently available VideoToolbox video filters.
  44568. </p>
  44569. <p>VideoToolbox filter depends on VideoToolbox framework, and is auto detected
  44570. when building ffmpeg for an Apple platform such as macOS. Add
  44571. <code class="code">--enable-videotoolbox</code> to configure if autodetect is disabled.
  44572. </p>
  44573. <a name="scale_005fvt"></a>
  44574. <h3 class="section">36.1 scale_vt<span class="pull-right"><a class="anchor hidden-xs" href="#scale_005fvt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale_005fvt" aria-hidden="true">TOC</a></span></h3>
  44575. <p>Scale and convert the color parameters using VTPixelTransferSession.
  44576. </p>
  44577. <p>The filter accepts the following options:
  44578. </p><dl class="table">
  44579. <dt><samp class="option">w</samp></dt>
  44580. <dt><samp class="option">h</samp></dt>
  44581. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  44582. </p>
  44583. </dd>
  44584. <dt><samp class="option">color_matrix</samp></dt>
  44585. <dd><p>Set the output colorspace matrix.
  44586. </p>
  44587. </dd>
  44588. <dt><samp class="option">color_primaries</samp></dt>
  44589. <dd><p>Set the output color primaries.
  44590. </p>
  44591. </dd>
  44592. <dt><samp class="option">color_transfer</samp></dt>
  44593. <dd><p>Set the output transfer characteristics.
  44594. </p>
  44595. </dd>
  44596. </dl>
  44597. <a name="Examples-173"></a>
  44598. <h4 class="subsection">36.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-173" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-173" aria-hidden="true">TOC</a></span></h4>
  44599. <ul class="itemize mark-bullet">
  44600. <li>Perform HDR to SDR conversion, and scale to half size of input
  44601. <div class="example">
  44602. <pre class="example-preformatted">ffmpeg -hwaccel videotoolbox \
  44603. -hwaccel_output_format videotoolbox_vld \
  44604. -i hdr.mov \
  44605. -c:v hevc_videotoolbox \
  44606. -profile:v main \
  44607. -b:v 3M \
  44608. -vf scale_vt=w=iw/2:h=ih/2:color_matrix=bt709:color_primaries=bt709:color_transfer=bt709 \
  44609. -c:a copy \
  44610. -tag:v hvc1 \
  44611. sdr.mp4
  44612. </pre></div>
  44613. </li></ul>
  44614. <a name="transpose_005fvt"></a>
  44615. <h3 class="section">36.2 transpose_vt<span class="pull-right"><a class="anchor hidden-xs" href="#transpose_005fvt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose_005fvt" aria-hidden="true">TOC</a></span></h3>
  44616. <p>Transpose rows with columns in the input video and optionally flip it.
  44617. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  44618. </p>
  44619. <p>It accepts the following parameters:
  44620. </p>
  44621. <dl class="table">
  44622. <dt><samp class="option">dir</samp></dt>
  44623. <dd><p>Specify the transposition direction.
  44624. </p>
  44625. <p>Can assume the following values:
  44626. </p><dl class="table">
  44627. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  44628. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  44629. </p>
  44630. </dd>
  44631. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  44632. <dd><p>Rotate by 90 degrees clockwise.
  44633. </p>
  44634. </dd>
  44635. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  44636. <dd><p>Rotate by 90 degrees counterclockwise.
  44637. </p>
  44638. </dd>
  44639. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  44640. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  44641. </p>
  44642. </dd>
  44643. <dt>&lsquo;<samp class="samp">hflip</samp>&rsquo;</dt>
  44644. <dd><p>Flip the input video horizontally.
  44645. </p>
  44646. </dd>
  44647. <dt>&lsquo;<samp class="samp">vflip</samp>&rsquo;</dt>
  44648. <dd><p>Flip the input video vertically.
  44649. </p>
  44650. </dd>
  44651. </dl>
  44652. </dd>
  44653. <dt><samp class="option">passthrough</samp></dt>
  44654. <dd><p>Do not apply the transposition if the input geometry matches the one
  44655. specified by the specified value. It accepts the following values:
  44656. </p><dl class="table">
  44657. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  44658. <dd><p>Always apply transposition. (default)
  44659. </p></dd>
  44660. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  44661. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  44662. </p></dd>
  44663. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  44664. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  44665. </p></dd>
  44666. </dl>
  44667. </dd>
  44668. </dl>
  44669. <a name="Vulkan-Video-Filters"></a>
  44670. <h2 class="chapter">37 Vulkan Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Vulkan-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Vulkan-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  44671. <p>Below is a description of the currently available Vulkan video filters.
  44672. </p>
  44673. <p>To enable compilation of these filters you need to configure FFmpeg with
  44674. <code class="code">--enable-vulkan</code> and either <code class="code">--enable-libglslang</code> or <code class="code">--enable-libshaderc</code>.
  44675. </p>
  44676. <p>Running Vulkan filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  44677. </p><dl class="table">
  44678. <dt><samp class="option">-init_hw_device vulkan[=<var class="var">name</var>][:<var class="var">device</var>[,<var class="var">key=value</var>...]]</samp></dt>
  44679. <dd><p>Initialise a new hardware device of type <var class="var">vulkan</var> called <var class="var">name</var>, using the
  44680. given device parameters and options in <var class="var">key=value</var>. The following options
  44681. are supported:
  44682. </p>
  44683. <dl class="table">
  44684. <dt><samp class="option">debug</samp></dt>
  44685. <dd><p>Switches validation layers on if set to 1.
  44686. </p>
  44687. </dd>
  44688. <dt><samp class="option">linear_images</samp></dt>
  44689. <dd><p>Allocates linear images. Does not apply to decoding.
  44690. </p>
  44691. </dd>
  44692. <dt><samp class="option">disable_multiplane</samp></dt>
  44693. <dd><p>Disables multiplane images. Does not apply to decoding.
  44694. </p>
  44695. </dd>
  44696. <dt><samp class="option">avoid_host_import</samp></dt>
  44697. <dd><p>Avoids the use of dynamic host memory imports, in favor of a regular memcpy()
  44698. into a previously mapped buffer.
  44699. </p></dd>
  44700. </dl>
  44701. </dd>
  44702. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  44703. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  44704. </p>
  44705. </dd>
  44706. </dl>
  44707. <p>For more detailed information see <a class="url" href="https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options">https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options</a>
  44708. </p>
  44709. <ul class="itemize mark-bullet">
  44710. <li>Example of choosing the first device and running nlmeans_vulkan filter with default parameters on it.
  44711. <div class="example">
  44712. <pre class="example-preformatted">-init_hw_device vulkan=vk:0 -filter_hw_device vk -i INPUT -vf &quot;hwupload,nlmeans_vulkan,hwdownload&quot; OUTPUT
  44713. </pre></div>
  44714. </li></ul>
  44715. <p>As Vulkan filters are not able to access frame data in normal memory, all frame data needs to be uploaded (<a class="ref" href="#hwupload">hwupload</a>) to hardware surfaces connected to the appropriate device before being used and then downloaded (<a class="ref" href="#hwdownload">hwdownload</a>) back to normal memory. Note that <a class="ref" href="#hwupload">hwupload</a> will upload to a frame with the same layout as the software frame, so it may be necessary to add a <a class="ref" href="#format">format</a> filter immediately before to get the input into the right format and <a class="ref" href="#hwdownload">hwdownload</a> does not support all formats on the output - it is usually necessary to insert an additional <a class="ref" href="#format">format</a> filter immediately following in the graph to get the output in a supported format.
  44716. </p>
  44717. <a name="avgblur_005fvulkan"></a>
  44718. <h3 class="section">37.1 avgblur_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#avgblur_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avgblur_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  44719. <p>Apply an average blur filter, implemented on the GPU using Vulkan.
  44720. </p>
  44721. <p>The filter accepts the following options:
  44722. </p>
  44723. <dl class="table">
  44724. <dt><samp class="option">sizeX</samp></dt>
  44725. <dd><p>Set horizontal radius size.
  44726. Range is <code class="code">[1, 32]</code> and default value is <code class="code">3</code>.
  44727. </p>
  44728. </dd>
  44729. <dt><samp class="option">sizeY</samp></dt>
  44730. <dd><p>Set vertical radius size. Range is <code class="code">[1, 32]</code> and default value is <code class="code">3</code>.
  44731. </p>
  44732. </dd>
  44733. <dt><samp class="option">planes</samp></dt>
  44734. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  44735. </p></dd>
  44736. </dl>
  44737. <a name="blend_005fvulkan"></a>
  44738. <h3 class="section">37.2 blend_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#blend_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blend_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  44739. <p>Blend two Vulkan frames into each other.
  44740. </p>
  44741. <p>The <code class="code">blend</code> filter takes two input streams and outputs one
  44742. stream, the first input is the &quot;top&quot; layer and second input is
  44743. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  44744. </p>
  44745. <p>A description of the accepted options follows.
  44746. </p>
  44747. <dl class="table">
  44748. <dt><samp class="option">c0_mode</samp></dt>
  44749. <dt><samp class="option">c1_mode</samp></dt>
  44750. <dt><samp class="option">c2_mode</samp></dt>
  44751. <dt><samp class="option">c3_mode</samp></dt>
  44752. <dt><samp class="option">all_mode</samp></dt>
  44753. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  44754. of <var class="var">all_mode</var>. Default value is <code class="code">normal</code>.
  44755. </p>
  44756. <p>Available values for component modes are:
  44757. </p><dl class="table">
  44758. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  44759. <dt>&lsquo;<samp class="samp">multiply</samp>&rsquo;</dt>
  44760. </dl>
  44761. </dd>
  44762. </dl>
  44763. <a name="bwdif_005fvulkan"></a>
  44764. <h3 class="section">37.3 bwdif_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#bwdif_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bwdif_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  44765. <p>Deinterlacer using <a class="ref" href="#bwdif">bwdif</a>, the &quot;Bob Weaver Deinterlacing Filter&quot; algorithm, implemented
  44766. on the GPU using Vulkan.
  44767. </p>
  44768. <p>It accepts the following parameters:
  44769. </p>
  44770. <dl class="table">
  44771. <dt><samp class="option">mode</samp></dt>
  44772. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  44773. </p>
  44774. <dl class="table">
  44775. <dt><samp class="option">0, send_frame</samp></dt>
  44776. <dd><p>Output one frame for each frame.
  44777. </p></dd>
  44778. <dt><samp class="option">1, send_field</samp></dt>
  44779. <dd><p>Output one frame for each field.
  44780. </p></dd>
  44781. </dl>
  44782. <p>The default value is <code class="code">send_field</code>.
  44783. </p>
  44784. </dd>
  44785. <dt><samp class="option">parity</samp></dt>
  44786. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  44787. of the following values:
  44788. </p>
  44789. <dl class="table">
  44790. <dt><samp class="option">0, tff</samp></dt>
  44791. <dd><p>Assume the top field is first.
  44792. </p></dd>
  44793. <dt><samp class="option">1, bff</samp></dt>
  44794. <dd><p>Assume the bottom field is first.
  44795. </p></dd>
  44796. <dt><samp class="option">-1, auto</samp></dt>
  44797. <dd><p>Enable automatic detection of field parity.
  44798. </p></dd>
  44799. </dl>
  44800. <p>The default value is <code class="code">auto</code>.
  44801. If the interlacing is unknown or the decoder does not export this information,
  44802. top field first will be assumed.
  44803. </p>
  44804. </dd>
  44805. <dt><samp class="option">deint</samp></dt>
  44806. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  44807. values:
  44808. </p>
  44809. <dl class="table">
  44810. <dt><samp class="option">0, all</samp></dt>
  44811. <dd><p>Deinterlace all frames.
  44812. </p></dd>
  44813. <dt><samp class="option">1, interlaced</samp></dt>
  44814. <dd><p>Only deinterlace frames marked as interlaced.
  44815. </p></dd>
  44816. </dl>
  44817. <p>The default value is <code class="code">all</code>.
  44818. </p></dd>
  44819. </dl>
  44820. <a name="chromaber_005fvulkan"></a>
  44821. <h3 class="section">37.4 chromaber_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#chromaber_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromaber_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  44822. <p>Apply an effect that emulates chromatic aberration. Works best with RGB inputs,
  44823. but provides a similar effect with YCbCr inputs too.
  44824. </p>
  44825. <dl class="table">
  44826. <dt><samp class="option">dist_x</samp></dt>
  44827. <dd><p>Horizontal displacement multiplier. Each chroma pixel&rsquo;s position will be multiplied
  44828. by this amount, starting from the center of the image. Default is <code class="code">0</code>.
  44829. </p>
  44830. </dd>
  44831. <dt><samp class="option">dist_y</samp></dt>
  44832. <dd><p>Similarly, this sets the vertical displacement multiplier. Default is <code class="code">0</code>.
  44833. </p>
  44834. </dd>
  44835. </dl>
  44836. <a name="color_005fvulkan"></a>
  44837. <h3 class="section">37.5 color_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#color_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-color_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  44838. <p>Video source that creates a Vulkan frame of a solid color.
  44839. Useful for benchmarking, or overlaying.
  44840. </p>
  44841. <p>It accepts the following parameters:
  44842. </p>
  44843. <dl class="table">
  44844. <dt><samp class="option">color</samp></dt>
  44845. <dd><p>The color to use. Either a name, or a hexadecimal value.
  44846. The default value is <code class="code">black</code>.
  44847. </p>
  44848. </dd>
  44849. <dt><samp class="option">size</samp></dt>
  44850. <dd><p>The size of the output frame. Default value is <code class="code">1920x1080</code>.
  44851. </p>
  44852. </dd>
  44853. <dt><samp class="option">rate</samp></dt>
  44854. <dd><p>The framerate to output at. Default value is <code class="code">60</code> frames per second.
  44855. </p>
  44856. </dd>
  44857. <dt><samp class="option">duration</samp></dt>
  44858. <dd><p>The video duration. Default value is <code class="code">-0.000001</code>.
  44859. </p>
  44860. </dd>
  44861. <dt><samp class="option">sar</samp></dt>
  44862. <dd><p>The video signal aspect ratio. Default value is <code class="code">1/1</code>.
  44863. </p>
  44864. </dd>
  44865. <dt><samp class="option">format</samp></dt>
  44866. <dd><p>The pixel format of the output Vulkan frames. Default value is <code class="code">yuv444p</code>.
  44867. </p>
  44868. </dd>
  44869. <dt><samp class="option">out_range</samp></dt>
  44870. <dd><p>Set the output YCbCr sample range.
  44871. </p>
  44872. <p>This allows the autodetected value to be overridden as well as allows forcing
  44873. a specific value used for the output and encoder. If not specified, the
  44874. range depends on the pixel format. Possible values:
  44875. </p>
  44876. <dl class="table">
  44877. <dt>&lsquo;<samp class="samp">auto/unknown</samp>&rsquo;</dt>
  44878. <dd><p>Choose automatically.
  44879. </p>
  44880. </dd>
  44881. <dt>&lsquo;<samp class="samp">jpeg/full/pc</samp>&rsquo;</dt>
  44882. <dd><p>Set full range (0-255 in case of 8-bit luma).
  44883. </p>
  44884. </dd>
  44885. <dt>&lsquo;<samp class="samp">mpeg/limited/tv</samp>&rsquo;</dt>
  44886. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  44887. </p></dd>
  44888. </dl>
  44889. </dd>
  44890. </dl>
  44891. <a name="vflip_005fvulkan"></a>
  44892. <h3 class="section">37.6 vflip_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#vflip_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vflip_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  44893. <p>Flips an image vertically.
  44894. </p>
  44895. <a name="hflip_005fvulkan"></a>
  44896. <h3 class="section">37.7 hflip_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#hflip_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hflip_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  44897. <p>Flips an image horizontally.
  44898. </p>
  44899. <a name="flip_005fvulkan"></a>
  44900. <h3 class="section">37.8 flip_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#flip_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flip_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  44901. <p>Flips an image along both the vertical and horizontal axis.
  44902. </p>
  44903. <a name="gblur_005fvulkan"></a>
  44904. <h3 class="section">37.9 gblur_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#gblur_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gblur_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  44905. <p>Apply Gaussian blur filter on Vulkan frames.
  44906. </p>
  44907. <p>The filter accepts the following options:
  44908. </p>
  44909. <dl class="table">
  44910. <dt><samp class="option">sigma</samp></dt>
  44911. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code class="code">0.5</code>.
  44912. </p>
  44913. </dd>
  44914. <dt><samp class="option">sigmaV</samp></dt>
  44915. <dd><p>Set vertical sigma, if negative it will be same as <code class="code">sigma</code>.
  44916. Default is <code class="code">-1</code>.
  44917. </p>
  44918. </dd>
  44919. <dt><samp class="option">planes</samp></dt>
  44920. <dd><p>Set which planes to filter. By default all planes are filtered.
  44921. </p>
  44922. </dd>
  44923. <dt><samp class="option">size</samp></dt>
  44924. <dd><p>Set the kernel size along the horizontal axis. Default is <code class="code">19</code>.
  44925. </p>
  44926. </dd>
  44927. <dt><samp class="option">sizeV</samp></dt>
  44928. <dd><p>Set the kernel size along the vertical axis. Default is <code class="code">0</code>,
  44929. which sets to use the same value as <var class="var">size</var>.
  44930. </p>
  44931. </dd>
  44932. </dl>
  44933. <a name="nlmeans_005fvulkan"></a>
  44934. <h3 class="section">37.10 nlmeans_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#nlmeans_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nlmeans_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  44935. <p>Denoise frames using Non-Local Means algorithm, implemented on the GPU using
  44936. Vulkan.
  44937. Supports more pixel formats than <a class="ref" href="#nlmeans">nlmeans</a> or <a class="ref" href="#nlmeans_005fopencl">nlmeans_opencl</a>, including
  44938. alpha channel support.
  44939. </p>
  44940. <p>The filter accepts the following options.
  44941. </p>
  44942. <dl class="table">
  44943. <dt><samp class="option">s</samp></dt>
  44944. <dd><p>Set denoising strength for all components. Default is 1.0. Must be in range [0.0, 100.0].
  44945. </p>
  44946. </dd>
  44947. <dt><samp class="option">p</samp></dt>
  44948. <dd><p>Set patch size for all planes. Default is 7. Must be odd number in range [0, 99].
  44949. </p>
  44950. </dd>
  44951. <dt><samp class="option">r</samp></dt>
  44952. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  44953. </p>
  44954. </dd>
  44955. <dt><samp class="option">t</samp></dt>
  44956. <dd><p>Set parallelism. Default is 8. Must be a number in the range [1, 64].
  44957. Larger values will use more VRAM but may not result in greater speed.
  44958. The optimal value is hardware and input dependent.
  44959. </p>
  44960. </dd>
  44961. <dt><samp class="option">s0</samp></dt>
  44962. <dt><samp class="option">s1</samp></dt>
  44963. <dt><samp class="option">s2</samp></dt>
  44964. <dt><samp class="option">s3</samp></dt>
  44965. <dd><p>Set denoising strength for a specific component. Default is <var class="var">1.0</var>, equal to <samp class="option">s</samp>.
  44966. Must be in range [0.0, 100.0]. 0.0 disables denoising in that component.
  44967. </p>
  44968. </dd>
  44969. <dt><samp class="option">p0</samp></dt>
  44970. <dt><samp class="option">p1</samp></dt>
  44971. <dt><samp class="option">p2</samp></dt>
  44972. <dt><samp class="option">p3</samp></dt>
  44973. <dd><p>Set patch size for a specific component. Default is <var class="var">7</var>, equal to <samp class="option">p</samp>.
  44974. Must be odd number in range [0, 99].
  44975. </p>
  44976. </dd>
  44977. </dl>
  44978. <a name="overlay_005fvulkan"></a>
  44979. <h3 class="section">37.11 overlay_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  44980. <p>Overlay one video on top of another.
  44981. </p>
  44982. <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.
  44983. This filter requires all inputs to use the same pixel format. So, format conversion may be needed.
  44984. </p>
  44985. <p>The filter accepts the following options:
  44986. </p>
  44987. <dl class="table">
  44988. <dt><samp class="option">x</samp></dt>
  44989. <dd><p>Set the x coordinate of the overlaid video on the main video.
  44990. Default value is <code class="code">0</code>.
  44991. </p>
  44992. </dd>
  44993. <dt><samp class="option">y</samp></dt>
  44994. <dd><p>Set the y coordinate of the overlaid video on the main video.
  44995. Default value is <code class="code">0</code>.
  44996. </p>
  44997. </dd>
  44998. </dl>
  44999. <a name="transpose_005fvulkan"></a>
  45000. <h3 class="section">37.12 transpose_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#transpose_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  45001. <p>Transpose rows with columns in the input video and optionally flip it.
  45002. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  45003. </p>
  45004. <p>It accepts the following parameters:
  45005. </p>
  45006. <dl class="table">
  45007. <dt><samp class="option">dir</samp></dt>
  45008. <dd><p>Specify the transposition direction.
  45009. </p>
  45010. <p>Can assume the following values:
  45011. </p><dl class="table">
  45012. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  45013. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  45014. </p>
  45015. </dd>
  45016. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  45017. <dd><p>Rotate by 90 degrees clockwise.
  45018. </p>
  45019. </dd>
  45020. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  45021. <dd><p>Rotate by 90 degrees counterclockwise.
  45022. </p>
  45023. </dd>
  45024. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  45025. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  45026. </p></dd>
  45027. </dl>
  45028. </dd>
  45029. <dt><samp class="option">passthrough</samp></dt>
  45030. <dd><p>Do not apply the transposition if the input geometry matches the one
  45031. specified by the specified value. It accepts the following values:
  45032. </p><dl class="table">
  45033. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  45034. <dd><p>Always apply transposition. (default)
  45035. </p></dd>
  45036. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  45037. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  45038. </p></dd>
  45039. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  45040. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  45041. </p></dd>
  45042. </dl>
  45043. </dd>
  45044. </dl>
  45045. <a name="QSV-Video-Filters"></a>
  45046. <h2 class="chapter">38 QSV Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#QSV-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-QSV-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  45047. <p>Below is a description of the currently available QSV video filters.
  45048. </p>
  45049. <p>To enable compilation of these filters you need to configure FFmpeg with
  45050. <code class="code">--enable-libmfx</code> or <code class="code">--enable-libvpl</code>.
  45051. </p>
  45052. <p>To use QSV filters, you need to setup the QSV device correctly. For more information, please read <a class="url" href="https://trac.ffmpeg.org/wiki/Hardware/QuickSync">https://trac.ffmpeg.org/wiki/Hardware/QuickSync</a>
  45053. </p>
  45054. <a name="hstack_005fqsv"></a>
  45055. <h3 class="section">38.1 hstack_qsv<span class="pull-right"><a class="anchor hidden-xs" href="#hstack_005fqsv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hstack_005fqsv" aria-hidden="true">TOC</a></span></h3>
  45056. <p>Stack input videos horizontally.
  45057. </p>
  45058. <p>This is the QSV variant of the <a class="ref" href="#hstack">hstack</a> filter, each input stream may
  45059. have different height, this filter will scale down/up each input stream while
  45060. keeping the original aspect.
  45061. </p>
  45062. <p>It accepts the following options:
  45063. </p>
  45064. <dl class="table">
  45065. <dt><samp class="option">inputs</samp></dt>
  45066. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  45067. </p>
  45068. </dd>
  45069. <dt><samp class="option">shortest</samp></dt>
  45070. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  45071. </p>
  45072. </dd>
  45073. <dt><samp class="option">height</samp></dt>
  45074. <dd><p>Set height of output. If set to 0, this filter will set height of output to
  45075. height of the first input stream. Default value is 0.
  45076. </p></dd>
  45077. </dl>
  45078. <a name="vstack_005fqsv"></a>
  45079. <h3 class="section">38.2 vstack_qsv<span class="pull-right"><a class="anchor hidden-xs" href="#vstack_005fqsv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vstack_005fqsv" aria-hidden="true">TOC</a></span></h3>
  45080. <p>Stack input videos vertically.
  45081. </p>
  45082. <p>This is the QSV variant of the <a class="ref" href="#vstack">vstack</a> filter, each input stream may
  45083. have different width, this filter will scale down/up each input stream while
  45084. keeping the original aspect.
  45085. </p>
  45086. <p>It accepts the following options:
  45087. </p>
  45088. <dl class="table">
  45089. <dt><samp class="option">inputs</samp></dt>
  45090. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  45091. </p>
  45092. </dd>
  45093. <dt><samp class="option">shortest</samp></dt>
  45094. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  45095. </p>
  45096. </dd>
  45097. <dt><samp class="option">width</samp></dt>
  45098. <dd><p>Set width of output. If set to 0, this filter will set width of output to
  45099. width of the first input stream. Default value is 0.
  45100. </p></dd>
  45101. </dl>
  45102. <a name="xstack_005fqsv"></a>
  45103. <h3 class="section">38.3 xstack_qsv<span class="pull-right"><a class="anchor hidden-xs" href="#xstack_005fqsv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xstack_005fqsv" aria-hidden="true">TOC</a></span></h3>
  45104. <p>Stack video inputs into custom layout.
  45105. </p>
  45106. <p>This is the QSV variant of the <a class="ref" href="#xstack">xstack</a> filter.
  45107. </p>
  45108. <p>It accepts the following options:
  45109. </p>
  45110. <dl class="table">
  45111. <dt><samp class="option">inputs</samp></dt>
  45112. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  45113. </p>
  45114. </dd>
  45115. <dt><samp class="option">shortest</samp></dt>
  45116. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  45117. </p>
  45118. </dd>
  45119. <dt><samp class="option">layout</samp></dt>
  45120. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  45121. Moreover, this permits the user to supply output size for each input stream.
  45122. </p><div class="example">
  45123. <pre class="example-preformatted">xstack_qsv=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
  45124. </pre></div>
  45125. </dd>
  45126. <dt><samp class="option">grid</samp></dt>
  45127. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  45128. </p>
  45129. </dd>
  45130. <dt><samp class="option">grid_tile_size</samp></dt>
  45131. <dd><p>Set output size for each input stream when <samp class="option">grid</samp> is set. If this option
  45132. is not set, this filter will set output size by default to the size of the
  45133. first input stream. For the syntax of this option, check the
  45134. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  45135. </p>
  45136. </dd>
  45137. <dt><samp class="option">fill</samp></dt>
  45138. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  45139. </p></dd>
  45140. </dl>
  45141. <a name="Video-Sources"></a>
  45142. <h2 class="chapter">39 Video Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Sources" aria-hidden="true">TOC</a></span></h2>
  45143. <p>Below is a description of the currently available video sources.
  45144. </p>
  45145. <a name="buffer"></a>
  45146. <h3 class="section">39.1 buffer<span class="pull-right"><a class="anchor hidden-xs" href="#buffer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-buffer" aria-hidden="true">TOC</a></span></h3>
  45147. <p>Buffer video frames, and make them available to the filter chain.
  45148. </p>
  45149. <p>This source is mainly intended for a programmatic use, in particular
  45150. through the interface defined in <samp class="file">libavfilter/buffersrc.h</samp>.
  45151. </p>
  45152. <p>It accepts the following parameters:
  45153. </p>
  45154. <dl class="table">
  45155. <dt><samp class="option">video_size</samp></dt>
  45156. <dd><p>Specify the size (width and height) of the buffered video frames. For the
  45157. syntax of this option, check the
  45158. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  45159. </p>
  45160. </dd>
  45161. <dt><samp class="option">width</samp></dt>
  45162. <dd><p>The input video width.
  45163. </p>
  45164. </dd>
  45165. <dt><samp class="option">height</samp></dt>
  45166. <dd><p>The input video height.
  45167. </p>
  45168. </dd>
  45169. <dt><samp class="option">pix_fmt</samp></dt>
  45170. <dd><p>A string representing the pixel format of the buffered video frames.
  45171. It may be a number corresponding to a pixel format, or a pixel format
  45172. name.
  45173. </p>
  45174. </dd>
  45175. <dt><samp class="option">time_base</samp></dt>
  45176. <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
  45177. </p>
  45178. </dd>
  45179. <dt><samp class="option">frame_rate</samp></dt>
  45180. <dd><p>Specify the frame rate expected for the video stream.
  45181. </p>
  45182. </dd>
  45183. <dt><samp class="option">colorspace</samp></dt>
  45184. <dd><p>A string representing the color space of the buffered video frames.
  45185. It may be a number corresponding to a color space, or a color space
  45186. name.
  45187. </p>
  45188. </dd>
  45189. <dt><samp class="option">range</samp></dt>
  45190. <dd><p>A string representing the color range of the buffered video frames.
  45191. It may be a number corresponding to a color range, or a color range
  45192. name.
  45193. </p>
  45194. </dd>
  45195. <dt><samp class="option">alpha_mode</samp></dt>
  45196. <dd><p>A string representing the alpha mode of the buffered video frames.
  45197. It may be a number corresponding to an alpha mode, or an alpha mode
  45198. name.
  45199. </p>
  45200. </dd>
  45201. <dt><samp class="option">pixel_aspect, sar</samp></dt>
  45202. <dd><p>The sample (pixel) aspect ratio of the input video.
  45203. </p>
  45204. </dd>
  45205. <dt><samp class="option">hw_frames_ctx</samp></dt>
  45206. <dd><p>When using a hardware pixel format, this should be a reference to an
  45207. AVHWFramesContext describing input frames.
  45208. </p></dd>
  45209. </dl>
  45210. <p>For example:
  45211. </p><div class="example">
  45212. <pre class="example-preformatted">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
  45213. </pre></div>
  45214. <p>will instruct the source to accept video frames with size 320x240 and
  45215. with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
  45216. square pixels (1:1 sample aspect ratio).
  45217. Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
  45218. (check the enum AVPixelFormat definition in <samp class="file">libavutil/pixfmt.h</samp>),
  45219. this example corresponds to:
  45220. </p><div class="example">
  45221. <pre class="example-preformatted">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
  45222. </pre></div>
  45223. <p>Alternatively, the options can be specified as a flat string, but this
  45224. syntax is deprecated:
  45225. </p>
  45226. <p><var class="var">width</var>:<var class="var">height</var>:<var class="var">pix_fmt</var>:<var class="var">time_base.num</var>:<var class="var">time_base.den</var>:<var class="var">pixel_aspect.num</var>:<var class="var">pixel_aspect.den</var>
  45227. </p>
  45228. <a name="cellauto"></a>
  45229. <h3 class="section">39.2 cellauto<span class="pull-right"><a class="anchor hidden-xs" href="#cellauto" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cellauto" aria-hidden="true">TOC</a></span></h3>
  45230. <p>Create a pattern generated by an elementary cellular automaton.
  45231. </p>
  45232. <p>The initial state of the cellular automaton can be defined through the
  45233. <samp class="option">filename</samp> and <samp class="option">pattern</samp> options. If such options are
  45234. not specified an initial state is created randomly.
  45235. </p>
  45236. <p>At each new frame a new row in the video is filled with the result of
  45237. the cellular automaton next generation. The behavior when the whole
  45238. frame is filled is defined by the <samp class="option">scroll</samp> option.
  45239. </p>
  45240. <p>This source accepts the following options:
  45241. </p>
  45242. <dl class="table">
  45243. <dt><samp class="option">filename, f</samp></dt>
  45244. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  45245. the specified file.
  45246. In the file, each non-whitespace character is considered an alive
  45247. cell, a newline will terminate the row, and further characters in the
  45248. file will be ignored.
  45249. </p>
  45250. </dd>
  45251. <dt><samp class="option">pattern, p</samp></dt>
  45252. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  45253. the specified string.
  45254. </p>
  45255. <p>Each non-whitespace character in the string is considered an alive
  45256. cell, a newline will terminate the row, and further characters in the
  45257. string will be ignored.
  45258. </p>
  45259. </dd>
  45260. <dt><samp class="option">rate, r</samp></dt>
  45261. <dd><p>Set the video rate, that is the number of frames generated per second.
  45262. Default is 25.
  45263. </p>
  45264. </dd>
  45265. <dt><samp class="option">random_fill_ratio, ratio</samp></dt>
  45266. <dd><p>Set the random fill ratio for the initial cellular automaton row. It
  45267. is a floating point number value ranging from 0 to 1, defaults to
  45268. 1/PHI.
  45269. </p>
  45270. <p>This option is ignored when a file or a pattern is specified.
  45271. </p>
  45272. </dd>
  45273. <dt><samp class="option">random_seed, seed</samp></dt>
  45274. <dd><p>Set the seed for filling randomly the initial row, must be an integer
  45275. included between 0 and UINT32_MAX. If not specified, or if explicitly
  45276. set to -1, the filter will try to use a good random seed on a best
  45277. effort basis.
  45278. </p>
  45279. </dd>
  45280. <dt><samp class="option">rule</samp></dt>
  45281. <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
  45282. Default value is 110.
  45283. </p>
  45284. </dd>
  45285. <dt><samp class="option">size, s</samp></dt>
  45286. <dd><p>Set the size of the output video. For the syntax of this option, check the
  45287. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  45288. </p>
  45289. <p>If <samp class="option">filename</samp> or <samp class="option">pattern</samp> is specified, the size is set
  45290. by default to the width of the specified initial state row, and the
  45291. height is set to <var class="var">width</var> * PHI.
  45292. </p>
  45293. <p>If <samp class="option">size</samp> is set, it must contain the width of the specified
  45294. pattern string, and the specified pattern will be centered in the
  45295. larger row.
  45296. </p>
  45297. <p>If a filename or a pattern string is not specified, the size value
  45298. defaults to &quot;320x518&quot; (used for a randomly generated initial state).
  45299. </p>
  45300. </dd>
  45301. <dt><samp class="option">scroll</samp></dt>
  45302. <dd><p>If set to 1, scroll the output upward when all the rows in the output
  45303. have been already filled. If set to 0, the new generated row will be
  45304. written over the top row just after the bottom row is filled.
  45305. Defaults to 1.
  45306. </p>
  45307. </dd>
  45308. <dt><samp class="option">start_full, full</samp></dt>
  45309. <dd><p>If set to 1, completely fill the output with generated rows before
  45310. outputting the first frame.
  45311. This is the default behavior, for disabling set the value to 0.
  45312. </p>
  45313. </dd>
  45314. <dt><samp class="option">stitch</samp></dt>
  45315. <dd><p>If set to 1, stitch the left and right row edges together.
  45316. This is the default behavior, for disabling set the value to 0.
  45317. </p></dd>
  45318. </dl>
  45319. <a name="Examples-174"></a>
  45320. <h4 class="subsection">39.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-174" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-174" aria-hidden="true">TOC</a></span></h4>
  45321. <ul class="itemize mark-bullet">
  45322. <li>Read the initial state from <samp class="file">pattern</samp>, and specify an output of
  45323. size 200x400.
  45324. <div class="example">
  45325. <pre class="example-preformatted">cellauto=f=pattern:s=200x400
  45326. </pre></div>
  45327. </li><li>Generate a random initial row with a width of 200 cells, with a fill
  45328. ratio of 2/3:
  45329. <div class="example">
  45330. <pre class="example-preformatted">cellauto=ratio=2/3:s=200x200
  45331. </pre></div>
  45332. </li><li>Create a pattern generated by rule 18 starting by a single alive cell
  45333. centered on an initial row with width 100:
  45334. <div class="example">
  45335. <pre class="example-preformatted">cellauto=p=@:s=100x400:full=0:rule=18
  45336. </pre></div>
  45337. </li><li>Specify a more elaborated initial pattern:
  45338. <div class="example">
  45339. <pre class="example-preformatted">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
  45340. </pre></div>
  45341. </li></ul>
  45342. <a class="anchor" id="coreimagesrc"></a><a name="coreimagesrc-1"></a>
  45343. <h3 class="section">39.3 coreimagesrc<span class="pull-right"><a class="anchor hidden-xs" href="#coreimagesrc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-coreimagesrc-1" aria-hidden="true">TOC</a></span></h3>
  45344. <p>Video source generated on GPU using Apple&rsquo;s CoreImage API on OSX.
  45345. </p>
  45346. <p>This video source is a specialized version of the <a class="ref" href="#coreimage">coreimage</a> video filter.
  45347. Use a core image generator at the beginning of the applied filterchain to
  45348. generate the content.
  45349. </p>
  45350. <p>The coreimagesrc video source accepts the following options:
  45351. </p><dl class="table">
  45352. <dt><samp class="option">list_generators</samp></dt>
  45353. <dd><p>List all available generators along with all their respective options as well as
  45354. possible minimum and maximum values along with the default values.
  45355. </p><div class="example">
  45356. <pre class="example-preformatted">list_generators=true
  45357. </pre></div>
  45358. </dd>
  45359. <dt><samp class="option">size, s</samp></dt>
  45360. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  45361. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  45362. The default value is <code class="code">320x240</code>.
  45363. </p>
  45364. </dd>
  45365. <dt><samp class="option">rate, r</samp></dt>
  45366. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  45367. generated per second. It has to be a string in the format
  45368. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  45369. number or a valid video frame rate abbreviation. The default value is
  45370. &quot;25&quot;.
  45371. </p>
  45372. </dd>
  45373. <dt><samp class="option">sar</samp></dt>
  45374. <dd><p>Set the sample aspect ratio of the sourced video.
  45375. </p>
  45376. </dd>
  45377. <dt><samp class="option">duration, d</samp></dt>
  45378. <dd><p>Set the duration of the sourced video. See
  45379. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  45380. for the accepted syntax.
  45381. </p>
  45382. <p>If not specified, or the expressed duration is negative, the video is
  45383. supposed to be generated forever.
  45384. </p></dd>
  45385. </dl>
  45386. <p>Additionally, all options of the <a class="ref" href="#coreimage">coreimage</a> video filter are accepted.
  45387. A complete filterchain can be used for further processing of the
  45388. generated input without CPU-HOST transfer. See <a class="ref" href="#coreimage">coreimage</a> documentation
  45389. and examples for details.
  45390. </p>
  45391. <a name="Examples-175"></a>
  45392. <h4 class="subsection">39.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-175" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-175" aria-hidden="true">TOC</a></span></h4>
  45393. <ul class="itemize mark-bullet">
  45394. <li>Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  45395. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  45396. <div class="example">
  45397. <pre class="example-preformatted">ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  45398. </pre></div>
  45399. <p>This example is equivalent to the QRCode example of <a class="ref" href="#coreimage">coreimage</a> without the
  45400. need for a nullsrc video source.
  45401. </p></li></ul>
  45402. <a name="ddagrab"></a>
  45403. <h3 class="section">39.4 ddagrab<span class="pull-right"><a class="anchor hidden-xs" href="#ddagrab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ddagrab" aria-hidden="true">TOC</a></span></h3>
  45404. <p>Captures the Windows Desktop via Desktop Duplication API.
  45405. </p>
  45406. <p>The filter exclusively returns D3D11 Hardware Frames, for on-gpu encoding
  45407. or processing. So an explicit <a class="ref" href="#hwdownload">hwdownload</a> is needed for any kind of
  45408. software processing.
  45409. </p>
  45410. <p>It accepts the following options:
  45411. </p>
  45412. <dl class="table">
  45413. <dt><samp class="option">output_idx</samp></dt>
  45414. <dd><p>DXGI Output Index to capture.
  45415. </p>
  45416. <p>Usually corresponds to the index Windows has given the screen minus one,
  45417. so it&rsquo;s starting at 0.
  45418. </p>
  45419. <p>Defaults to output 0.
  45420. </p>
  45421. </dd>
  45422. <dt><samp class="option">draw_mouse</samp></dt>
  45423. <dd><p>Whether to draw the mouse cursor.
  45424. </p>
  45425. <p>Defaults to true.
  45426. </p>
  45427. <p>Only affects hardware cursors. If a game or application renders its own cursor,
  45428. it&rsquo;ll always be captured.
  45429. </p>
  45430. </dd>
  45431. <dt><samp class="option">framerate</samp></dt>
  45432. <dd><p>Maximum framerate at which the desktop will be captured - the interval between
  45433. successive frames will not be smaller than the inverse of the framerate. When
  45434. <var class="var">dup_frames</var> is true (the default) and the desktop is not being updated
  45435. often enough, the filter will duplicate a previous frame. Note that there is no
  45436. background buffering going on, so when the filter is not polled often enough
  45437. then the actual inter-frame interval may be significantly larger.
  45438. </p>
  45439. <p>Defaults to 30 FPS.
  45440. </p>
  45441. </dd>
  45442. <dt><samp class="option">video_size</samp></dt>
  45443. <dd><p>Specify the size of the captured video.
  45444. </p>
  45445. <p>Defaults to the full size of the screen.
  45446. </p>
  45447. <p>Cropped from the bottom/right if smaller than screen size.
  45448. </p>
  45449. </dd>
  45450. <dt><samp class="option">offset_x</samp></dt>
  45451. <dd><p>Horizontal offset of the captured video.
  45452. </p>
  45453. </dd>
  45454. <dt><samp class="option">offset_y</samp></dt>
  45455. <dd><p>Vertical offset of the captured video.
  45456. </p>
  45457. </dd>
  45458. <dt><samp class="option">output_fmt</samp></dt>
  45459. <dd><p>Desired filter output format.
  45460. Defaults to 8 Bit BGRA.
  45461. </p>
  45462. <p>It accepts the following values:
  45463. </p><dl class="table">
  45464. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  45465. <dd><p>Passes all supported output formats to DDA and returns what DDA decides to use.
  45466. </p></dd>
  45467. <dt>&lsquo;<samp class="samp">8bit</samp>&rsquo;</dt>
  45468. <dt>&lsquo;<samp class="samp">bgra</samp>&rsquo;</dt>
  45469. <dd><p>8 Bit formats always work, and DDA will convert to them if necessary.
  45470. </p></dd>
  45471. <dt>&lsquo;<samp class="samp">10bit</samp>&rsquo;</dt>
  45472. <dt>&lsquo;<samp class="samp">x2bgr10</samp>&rsquo;</dt>
  45473. <dd><p>Filter initialization will fail if 10 bit format is requested but unavailable.
  45474. </p></dd>
  45475. </dl>
  45476. </dd>
  45477. <dt><samp class="option">dup_frames</samp></dt>
  45478. <dd><p>When this option is set to true (the default), the filter will duplicate frames
  45479. when the desktop has not been updated in order to maintain approximately
  45480. constant target framerate. When this option is set to false, the filter will
  45481. wait for the desktop to be updated (inter-frame intervals may vary significantly
  45482. in this case).
  45483. </p>
  45484. </dd>
  45485. </dl>
  45486. <a name="Examples-176"></a>
  45487. <h4 class="subsection">39.4.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-176" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-176" aria-hidden="true">TOC</a></span></h4>
  45488. <p>Capture primary screen and encode using nvenc:
  45489. </p><div class="example">
  45490. <pre class="example-preformatted">ffmpeg -f lavfi -i ddagrab -c:v h264_nvenc -cq 18 output.mp4
  45491. </pre></div>
  45492. <p>You can also skip the lavfi device and directly use the filter.
  45493. Also demonstrates downloading the frame and encoding with libx264.
  45494. Explicit output format specification is required in this case:
  45495. </p><div class="example">
  45496. <pre class="example-preformatted">ffmpeg -filter_complex ddagrab=output_idx=1:framerate=60,hwdownload,format=bgra -c:v libx264 -crf 18 output.mp4
  45497. </pre></div>
  45498. <p>If you want to capture only a subsection of the desktop, this can be achieved
  45499. by specifying a smaller size and its offsets into the screen:
  45500. </p><div class="example">
  45501. <pre class="example-preformatted">ddagrab=video_size=800x600:offset_x=100:offset_y=100
  45502. </pre></div>
  45503. <a name="gfxcapture"></a>
  45504. <h3 class="section">39.5 gfxcapture<span class="pull-right"><a class="anchor hidden-xs" href="#gfxcapture" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gfxcapture" aria-hidden="true">TOC</a></span></h3>
  45505. <p>Capture windows or monitors using Windows.Graphics.Capture API.
  45506. </p>
  45507. <p>This source provides low overhead capture of application windows or entire monitors.
  45508. The filter outputs hardware frames in <code class="code">d3d11</code> format; use <code class="code">hwdownload,format=</code>
  45509. if system memory frames are required.
  45510. </p>
  45511. <p>The window to be captured can be selected via regular expressions on its title,
  45512. class name or backing executable name, by explicit native handles, or by monitor
  45513. index or explicit native handle. A window must match all provided expressions to be
  45514. selected. The first matching window will be picked, in whatever order Windows
  45515. returns them.
  45516. </p>
  45517. <p>Explicit handles (<samp class="option">hwnd</samp>, <samp class="option">hmonitor</samp>) override pattern or index
  45518. based selection. If neither handles nor a monitor index are given, the first
  45519. window matching the provided regular expressions is captured.
  45520. </p>
  45521. <p>This source does NOT hold a stable FPS. It returns frames at whatever rate the compositor
  45522. provides them, only capped by the <samp class="option">max_framerate</samp>.
  45523. If you need a stable rate, you need to add an fps filter to drop/duplicate frames as needed.
  45524. </p>
  45525. <p>If the capture source disappears mid-capture (window closed, monitor disconnected), the filter will return EOF.
  45526. </p>
  45527. <p>This source accepts the following options:
  45528. </p><dl class="table">
  45529. <dt><samp class="option">window_title</samp></dt>
  45530. <dd><p>ECMAScript regular expression matched against the window title. Supports a
  45531. PCRE style <code class="code">(?i)</code> prefix for case-insensitive matching.
  45532. </p>
  45533. </dd>
  45534. <dt><samp class="option">window_class</samp></dt>
  45535. <dd><p>As <samp class="option">window_title</samp>, but matched against the window class name.
  45536. </p>
  45537. </dd>
  45538. <dt><samp class="option">window_exe</samp></dt>
  45539. <dd><p>As <samp class="option">window_title</samp>, but matched against the executable file name of the
  45540. window&rsquo;s process.
  45541. </p>
  45542. </dd>
  45543. <dt><samp class="option">monitor_idx</samp></dt>
  45544. <dd><p>Zero-based index of the monitor to capture.
  45545. </p>
  45546. <p>Can also be set to <code class="code">window</code> to capture the monitor the selected window
  45547. is displayed on at filter initialization time.
  45548. </p>
  45549. </dd>
  45550. <dt><samp class="option">hwnd</samp></dt>
  45551. <dd><p>Explicit native window handle (HWND).
  45552. </p>
  45553. </dd>
  45554. <dt><samp class="option">hmonitor</samp></dt>
  45555. <dd><p>Explicit native monitor handle (HMONITOR).
  45556. </p>
  45557. </dd>
  45558. <dt><samp class="option">capture_cursor</samp></dt>
  45559. <dd><p>Capture the mouse cursor. Enabled by default.
  45560. </p>
  45561. </dd>
  45562. <dt><samp class="option">capture_border</samp></dt>
  45563. <dd><p>Capture the full area of the window, including its window decorarions/border.
  45564. Disabled by default.
  45565. </p>
  45566. </dd>
  45567. <dt><samp class="option">display_border</samp></dt>
  45568. <dd><p>Draw a yellow highlight border around the captured window. Disabled by default.
  45569. </p>
  45570. </dd>
  45571. <dt><samp class="option">max_framerate</samp></dt>
  45572. <dd><p>Maximum capture frame rate. Accepts a video rate (e.g. <code class="code">30</code>, <code class="code">60/1</code>,
  45573. <code class="code">24000/1001</code>). The default is <code class="code">60</code> FPS.
  45574. The actual rate is the rate at which the compositor renders the window/monitor,
  45575. capped by this option.
  45576. </p>
  45577. </dd>
  45578. <dt><samp class="option">width</samp></dt>
  45579. <dd><p>Force the output canvas width. If zero (default) the initial captured source
  45580. width is used. If a negative number is provided, the width will be rounded
  45581. down to the next multiple of that number.
  45582. </p>
  45583. <p>See <samp class="option">resize_mode</samp>.
  45584. </p>
  45585. </dd>
  45586. <dt><samp class="option">height</samp></dt>
  45587. <dd><p>Force the output canvas height. If zero (default) the initial captured source
  45588. height is used. If a negative number is provided, the height will be rounded
  45589. down to the next multiple of that number.
  45590. </p>
  45591. <p>See <samp class="option">resize_mode</samp>.
  45592. </p>
  45593. </dd>
  45594. <dt><samp class="option">crop_left</samp></dt>
  45595. <dd><p>Crop this many pixels from the left side of the captured frames.
  45596. </p>
  45597. </dd>
  45598. <dt><samp class="option">crop_top</samp></dt>
  45599. <dd><p>Crop this many pixels from the left side of the captured frames.
  45600. </p>
  45601. </dd>
  45602. <dt><samp class="option">crop_right</samp></dt>
  45603. <dd><p>Crop this many pixels from the left side of the captured frames.
  45604. </p>
  45605. </dd>
  45606. <dt><samp class="option">crop_bottom</samp></dt>
  45607. <dd><p>Crop this many pixels from the left side of the captured frames.
  45608. </p>
  45609. </dd>
  45610. <dt><samp class="option">premultiplied</samp></dt>
  45611. <dd><p>If set to 1, return frames with premultiplied alpha. Default is 0 (straight
  45612. alpha).
  45613. </p>
  45614. </dd>
  45615. <dt><samp class="option">resize_mode</samp></dt>
  45616. <dd><p>Defines how the captured content is fitted into the output canvas size.
  45617. Possible values:
  45618. </p><dl class="table">
  45619. <dt>&lsquo;<samp class="samp">crop</samp>&rsquo;</dt>
  45620. <dd><p>Crop (or pad with black) to the canvas size. (default)
  45621. </p></dd>
  45622. <dt>&lsquo;<samp class="samp">scale</samp>&rsquo;</dt>
  45623. <dd><p>Scale the source to fill the canvas, potentially altering aspect ratio.
  45624. </p></dd>
  45625. <dt>&lsquo;<samp class="samp">scale_aspect</samp>&rsquo;</dt>
  45626. <dd><p>Scale the source to fit inside the canvas while preserving aspect ratio.
  45627. Remaining area is filled with black.
  45628. </p></dd>
  45629. </dl>
  45630. </dd>
  45631. <dt><samp class="option">scale_mode</samp></dt>
  45632. <dd><p>Scaling algorithm used when resizing is required.
  45633. </p>
  45634. <p>Possible values:
  45635. </p><dl class="table">
  45636. <dt>&lsquo;<samp class="samp">point</samp>&rsquo;</dt>
  45637. <dd><p>Nearest neighbour (pixelated) scaling.
  45638. </p></dd>
  45639. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  45640. <dd><p>Bilinear filtering. (default)
  45641. </p></dd>
  45642. <dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
  45643. <dd><p>Bicubic filtering. Potentially more blurry, but fewer scaling artifacts depending on contents.
  45644. </p></dd>
  45645. </dl>
  45646. </dd>
  45647. <dt><samp class="option">output_fmt</samp></dt>
  45648. <dd><p>Desired output pixel format inside the D3D11 hardware frames.
  45649. </p>
  45650. <p>Possible values:
  45651. </p><dl class="table">
  45652. <dt>&lsquo;<samp class="samp">bgra</samp>&rsquo;</dt>
  45653. <dt>&lsquo;<samp class="samp">8bit</samp>&rsquo;</dt>
  45654. <dd><p>8 bit BGRA output (default)
  45655. </p></dd>
  45656. <dt>&lsquo;<samp class="samp">x2bgr10</samp>&rsquo;</dt>
  45657. <dt>&lsquo;<samp class="samp">10bit</samp>&rsquo;</dt>
  45658. <dd><p>10 bit BGR output
  45659. </p></dd>
  45660. <dt>&lsquo;<samp class="samp">rgbaf16</samp>&rsquo;</dt>
  45661. <dt>&lsquo;<samp class="samp">16bit</samp>&rsquo;</dt>
  45662. <dd><p>16bit float RGBA output
  45663. </p></dd>
  45664. </dl>
  45665. </dd>
  45666. </dl>
  45667. <a name="Examples-177"></a>
  45668. <h4 class="subsection">39.5.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-177" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-177" aria-hidden="true">TOC</a></span></h4>
  45669. <ul class="itemize mark-bullet">
  45670. <li>Capture a window by title (case-insensitive) at a maximum of 60 fps:
  45671. <div class="example">
  45672. <pre class="example-preformatted">ffmpeg -filter_complex gfxcapture=window_title='(?i)My Application':max_framerate=60,hwdownload,format=bgra,format=yuv420p -c:v libx264 -crf 15 capture.mp4
  45673. </pre></div>
  45674. </li><li>Capture monitor 1 at native refresh, 10bit color depth, scale to 1920x1080 preserving aspect:
  45675. <div class="example">
  45676. <pre class="example-preformatted">ffmpeg -filter_complex gfxcapture=monitor_idx=1:width=1920:height=1080:resize_mode=scale_aspect:output_fmt=10bit -c:v hevc_nvenc -cq 15 capture.mp4
  45677. </pre></div>
  45678. </li><li>Capture a window by executable name, draw border, force point scaling, fixed 60 fps:
  45679. <div class="example">
  45680. <pre class="example-preformatted">ffmpeg -filter_complex gfxcapture=window_exe='^firefox.exe$':display_border=1:scale_mode=point,fps=60 -rc qvbr -qvbr_quality_level 15 -c:v h264_amf capture.mp4
  45681. </pre></div>
  45682. </li></ul>
  45683. <a name="gradients"></a>
  45684. <h3 class="section">39.6 gradients<span class="pull-right"><a class="anchor hidden-xs" href="#gradients" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gradients" aria-hidden="true">TOC</a></span></h3>
  45685. <p>Generate several gradients.
  45686. </p>
  45687. <dl class="table">
  45688. <dt><samp class="option">size, s</samp></dt>
  45689. <dd><p>Set frame size. For the syntax of this option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video
  45690. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  45691. </p>
  45692. </dd>
  45693. <dt><samp class="option">rate, r</samp></dt>
  45694. <dd><p>Set frame rate, expressed as number of frames per second. Default
  45695. value is &quot;25&quot;.
  45696. </p>
  45697. </dd>
  45698. <dt><samp class="option">c0, c1, c2, c3, c4, c5, c6, c7</samp></dt>
  45699. <dd><p>Set 8 colors. Default values for colors is to pick random one.
  45700. </p>
  45701. </dd>
  45702. <dt><samp class="option">x0, y0, y0, y1</samp></dt>
  45703. <dd><p>Set gradient line source and destination points. If negative or out of range, random ones
  45704. are picked.
  45705. </p>
  45706. </dd>
  45707. <dt><samp class="option">nb_colors, n</samp></dt>
  45708. <dd><p>Set number of colors to use at once. Allowed range is from 2 to 8. Default value is 2.
  45709. </p>
  45710. </dd>
  45711. <dt><samp class="option">seed</samp></dt>
  45712. <dd><p>Set seed for picking gradient line points.
  45713. </p>
  45714. </dd>
  45715. <dt><samp class="option">duration, d</samp></dt>
  45716. <dd><p>Set the duration of the sourced video. See
  45717. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  45718. for the accepted syntax.
  45719. </p>
  45720. <p>If not specified, or the expressed duration is negative, the video is
  45721. supposed to be generated forever.
  45722. </p>
  45723. </dd>
  45724. <dt><samp class="option">speed</samp></dt>
  45725. <dd><p>Set speed of gradients rotation.
  45726. </p>
  45727. </dd>
  45728. <dt><samp class="option">type, t</samp></dt>
  45729. <dd><p>Set type of gradients.
  45730. Available values are:
  45731. </p><dl class="table">
  45732. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  45733. <dt>&lsquo;<samp class="samp">radial</samp>&rsquo;</dt>
  45734. <dt>&lsquo;<samp class="samp">circular</samp>&rsquo;</dt>
  45735. <dt>&lsquo;<samp class="samp">spiral</samp>&rsquo;</dt>
  45736. <dt>&lsquo;<samp class="samp">square</samp>&rsquo;</dt>
  45737. </dl>
  45738. <p>Default type is <var class="var">linear</var>.
  45739. </p></dd>
  45740. </dl>
  45741. <a name="Commands-156"></a>
  45742. <h4 class="subsection">39.6.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-156" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-156" aria-hidden="true">TOC</a></span></h4>
  45743. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  45744. </p>
  45745. <a name="mandelbrot"></a>
  45746. <h3 class="section">39.7 mandelbrot<span class="pull-right"><a class="anchor hidden-xs" href="#mandelbrot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mandelbrot" aria-hidden="true">TOC</a></span></h3>
  45747. <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
  45748. point specified with <var class="var">start_x</var> and <var class="var">start_y</var>.
  45749. </p>
  45750. <p>This source accepts the following options:
  45751. </p>
  45752. <dl class="table">
  45753. <dt><samp class="option">end_pts</samp></dt>
  45754. <dd><p>Set the terminal pts value. Default value is 400.
  45755. </p>
  45756. </dd>
  45757. <dt><samp class="option">end_scale</samp></dt>
  45758. <dd><p>Set the terminal scale value.
  45759. Must be a floating point value. Default value is 0.3.
  45760. </p>
  45761. </dd>
  45762. <dt><samp class="option">inner</samp></dt>
  45763. <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
  45764. Mandelbrot fractal internal region.
  45765. </p>
  45766. <p>It shall assume one of the following values:
  45767. </p><dl class="table">
  45768. <dt><samp class="option">black</samp></dt>
  45769. <dd><p>Set black mode.
  45770. </p></dd>
  45771. <dt><samp class="option">convergence</samp></dt>
  45772. <dd><p>Show time until convergence.
  45773. </p></dd>
  45774. <dt><samp class="option">mincol</samp></dt>
  45775. <dd><p>Set color based on point closest to the origin of the iterations.
  45776. </p></dd>
  45777. <dt><samp class="option">period</samp></dt>
  45778. <dd><p>Set period mode.
  45779. </p></dd>
  45780. </dl>
  45781. <p>Default value is <var class="var">mincol</var>.
  45782. </p>
  45783. </dd>
  45784. <dt><samp class="option">bailout</samp></dt>
  45785. <dd><p>Set the bailout value. Default value is 10.0.
  45786. </p>
  45787. </dd>
  45788. <dt><samp class="option">maxiter</samp></dt>
  45789. <dd><p>Set the maximum of iterations performed by the rendering
  45790. algorithm. Default value is 7189.
  45791. </p>
  45792. </dd>
  45793. <dt><samp class="option">outer</samp></dt>
  45794. <dd><p>Set outer coloring mode.
  45795. It shall assume one of following values:
  45796. </p><dl class="table">
  45797. <dt><samp class="option">iteration_count</samp></dt>
  45798. <dd><p>Set iteration count mode.
  45799. </p></dd>
  45800. <dt><samp class="option">normalized_iteration_count</samp></dt>
  45801. <dd><p>set normalized iteration count mode.
  45802. </p></dd>
  45803. </dl>
  45804. <p>Default value is <var class="var">normalized_iteration_count</var>.
  45805. </p>
  45806. </dd>
  45807. <dt><samp class="option">rate, r</samp></dt>
  45808. <dd><p>Set frame rate, expressed as number of frames per second. Default
  45809. value is &quot;25&quot;.
  45810. </p>
  45811. </dd>
  45812. <dt><samp class="option">size, s</samp></dt>
  45813. <dd><p>Set frame size. For the syntax of this option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video
  45814. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  45815. </p>
  45816. </dd>
  45817. <dt><samp class="option">start_scale</samp></dt>
  45818. <dd><p>Set the initial scale value. Default value is 3.0.
  45819. </p>
  45820. </dd>
  45821. <dt><samp class="option">start_x</samp></dt>
  45822. <dd><p>Set the initial x position. Must be a floating point value between
  45823. -100 and 100. Default value is -0.743643887037158704752191506114774.
  45824. </p>
  45825. </dd>
  45826. <dt><samp class="option">start_y</samp></dt>
  45827. <dd><p>Set the initial y position. Must be a floating point value between
  45828. -100 and 100. Default value is -0.131825904205311970493132056385139.
  45829. </p></dd>
  45830. </dl>
  45831. <a name="mptestsrc"></a>
  45832. <h3 class="section">39.8 mptestsrc<span class="pull-right"><a class="anchor hidden-xs" href="#mptestsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mptestsrc" aria-hidden="true">TOC</a></span></h3>
  45833. <p>Generate various test patterns, as generated by the MPlayer test filter.
  45834. </p>
  45835. <p>The size of the generated video is fixed, and is 512x512.
  45836. This source is useful in particular for testing encoding features.
  45837. </p>
  45838. <p>This source accepts the following options:
  45839. </p>
  45840. <dl class="table">
  45841. <dt><samp class="option">rate, r</samp></dt>
  45842. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  45843. generated per second. It has to be a string in the format
  45844. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  45845. number or a valid video frame rate abbreviation. The default value is
  45846. &quot;25&quot;.
  45847. </p>
  45848. </dd>
  45849. <dt><samp class="option">duration, d</samp></dt>
  45850. <dd><p>Set the duration of the sourced video. See
  45851. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  45852. for the accepted syntax.
  45853. </p>
  45854. <p>If not specified, or the expressed duration is negative, the video is
  45855. supposed to be generated forever.
  45856. </p>
  45857. </dd>
  45858. <dt><samp class="option">test, t</samp></dt>
  45859. <dd>
  45860. <p>Set the number or the name of the test to perform. Supported tests are:
  45861. </p><dl class="table">
  45862. <dt><samp class="option">dc_luma</samp></dt>
  45863. <dt><samp class="option">dc_chroma</samp></dt>
  45864. <dt><samp class="option">freq_luma</samp></dt>
  45865. <dt><samp class="option">freq_chroma</samp></dt>
  45866. <dt><samp class="option">amp_luma</samp></dt>
  45867. <dt><samp class="option">amp_chroma</samp></dt>
  45868. <dt><samp class="option">cbp</samp></dt>
  45869. <dt><samp class="option">mv</samp></dt>
  45870. <dt><samp class="option">ring1</samp></dt>
  45871. <dt><samp class="option">ring2</samp></dt>
  45872. <dt><samp class="option">all</samp></dt>
  45873. <dt><samp class="option">max_frames, m</samp></dt>
  45874. <dd><p>Set the maximum number of frames generated for each test, default value is 30.
  45875. </p>
  45876. </dd>
  45877. </dl>
  45878. <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
  45879. </p></dd>
  45880. </dl>
  45881. <p>Some examples:
  45882. </p><div class="example">
  45883. <pre class="example-preformatted">mptestsrc=t=dc_luma
  45884. </pre></div>
  45885. <p>will generate a &quot;dc_luma&quot; test pattern.
  45886. </p>
  45887. <a name="frei0r_005fsrc"></a>
  45888. <h3 class="section">39.9 frei0r_src<span class="pull-right"><a class="anchor hidden-xs" href="#frei0r_005fsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-frei0r_005fsrc" aria-hidden="true">TOC</a></span></h3>
  45889. <p>Provide a frei0r source.
  45890. </p>
  45891. <p>To enable compilation of this filter you need to install the frei0r
  45892. header and configure FFmpeg with <code class="code">--enable-frei0r</code>.
  45893. </p>
  45894. <p>This source accepts the following parameters:
  45895. </p>
  45896. <dl class="table">
  45897. <dt><samp class="option">size</samp></dt>
  45898. <dd><p>The size of the video to generate. For the syntax of this option, check the
  45899. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  45900. </p>
  45901. </dd>
  45902. <dt><samp class="option">framerate</samp></dt>
  45903. <dd><p>The framerate of the generated video. It may be a string of the form
  45904. <var class="var">num</var>/<var class="var">den</var> or a frame rate abbreviation.
  45905. </p>
  45906. </dd>
  45907. <dt><samp class="option">filter_name</samp></dt>
  45908. <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
  45909. how to set the parameters, read the <a class="ref" href="#frei0r">frei0r</a> section in the video filters
  45910. documentation.
  45911. </p>
  45912. </dd>
  45913. <dt><samp class="option">filter_params</samp></dt>
  45914. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
  45915. </p>
  45916. </dd>
  45917. </dl>
  45918. <p>For example, to generate a frei0r partik0l source with size 200x200
  45919. and frame rate 10 which is overlaid on the overlay filter main input:
  45920. </p><div class="example">
  45921. <pre class="example-preformatted">frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
  45922. </pre></div>
  45923. <a name="life"></a>
  45924. <h3 class="section">39.10 life<span class="pull-right"><a class="anchor hidden-xs" href="#life" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-life" aria-hidden="true">TOC</a></span></h3>
  45925. <p>Generate a life pattern.
  45926. </p>
  45927. <p>This source is based on a generalization of John Conway&rsquo;s life game.
  45928. </p>
  45929. <p>The sourced input represents a life grid, each pixel represents a cell
  45930. which can be in one of two possible states, alive or dead. Every cell
  45931. interacts with its eight neighbours, which are the cells that are
  45932. horizontally, vertically, or diagonally adjacent.
  45933. </p>
  45934. <p>At each interaction the grid evolves according to the adopted rule,
  45935. which specifies the number of neighbor alive cells which will make a
  45936. cell stay alive or born. The <samp class="option">rule</samp> option allows one to specify
  45937. the rule to adopt.
  45938. </p>
  45939. <p>This source accepts the following options:
  45940. </p>
  45941. <dl class="table">
  45942. <dt><samp class="option">filename, f</samp></dt>
  45943. <dd><p>Set the file from which to read the initial grid state. In the file,
  45944. each non-whitespace character is considered an alive cell, and newline
  45945. is used to delimit the end of each row.
  45946. </p>
  45947. <p>If this option is not specified, the initial grid is generated
  45948. randomly.
  45949. </p>
  45950. </dd>
  45951. <dt><samp class="option">rate, r</samp></dt>
  45952. <dd><p>Set the video rate, that is the number of frames generated per second.
  45953. Default is 25.
  45954. </p>
  45955. </dd>
  45956. <dt><samp class="option">random_fill_ratio, ratio</samp></dt>
  45957. <dd><p>Set the random fill ratio for the initial random grid. It is a
  45958. floating point number value ranging from 0 to 1, defaults to 1/PHI.
  45959. It is ignored when a file is specified.
  45960. </p>
  45961. </dd>
  45962. <dt><samp class="option">random_seed, seed</samp></dt>
  45963. <dd><p>Set the seed for filling the initial random grid, must be an integer
  45964. included between 0 and UINT32_MAX. If not specified, or if explicitly
  45965. set to -1, the filter will try to use a good random seed on a best
  45966. effort basis.
  45967. </p>
  45968. </dd>
  45969. <dt><samp class="option">rule</samp></dt>
  45970. <dd><p>Set the life rule.
  45971. </p>
  45972. <p>A rule can be specified with a code of the kind &quot;S<var class="var">NS</var>/B<var class="var">NB</var>&quot;,
  45973. where <var class="var">NS</var> and <var class="var">NB</var> are sequences of numbers in the range 0-8,
  45974. <var class="var">NS</var> specifies the number of alive neighbor cells which make a
  45975. live cell stay alive, and <var class="var">NB</var> the number of alive neighbor cells
  45976. which make a dead cell to become alive (i.e. to &quot;born&quot;).
  45977. &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
  45978. </p>
  45979. <p>Alternatively a rule can be specified by an 18-bits integer. The 9
  45980. high order bits are used to encode the next cell state if it is alive
  45981. for each number of neighbor alive cells, the low order bits specify
  45982. the rule for &quot;borning&quot; new cells. Higher order bits encode for an
  45983. higher number of neighbor cells.
  45984. For example the number 6153 = <code class="code">(12&lt;&lt;9)+9</code> specifies a stay alive
  45985. rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
  45986. </p>
  45987. <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;s game of life
  45988. rule, and will keep a cell alive if it has 2 or 3 neighbor alive
  45989. cells, and will born a new cell if there are three alive cells around
  45990. a dead cell.
  45991. </p>
  45992. </dd>
  45993. <dt><samp class="option">size, s</samp></dt>
  45994. <dd><p>Set the size of the output video. For the syntax of this option, check the
  45995. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  45996. </p>
  45997. <p>If <samp class="option">filename</samp> is specified, the size is set by default to the
  45998. same size of the input file. If <samp class="option">size</samp> is set, it must contain
  45999. the size specified in the input file, and the initial grid defined in
  46000. that file is centered in the larger resulting area.
  46001. </p>
  46002. <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
  46003. (used for a randomly generated initial grid).
  46004. </p>
  46005. </dd>
  46006. <dt><samp class="option">stitch</samp></dt>
  46007. <dd><p>If set to 1, stitch the left and right grid edges together, and the
  46008. top and bottom edges also. Defaults to 1.
  46009. </p>
  46010. </dd>
  46011. <dt><samp class="option">mold</samp></dt>
  46012. <dd><p>Set cell mold speed. If set, a dead cell will go from <samp class="option">death_color</samp> to
  46013. <samp class="option">mold_color</samp> with a step of <samp class="option">mold</samp>. <samp class="option">mold</samp> can have a
  46014. value from 0 to 255.
  46015. </p>
  46016. </dd>
  46017. <dt><samp class="option">life_color</samp></dt>
  46018. <dd><p>Set the color of living (or new born) cells.
  46019. </p>
  46020. </dd>
  46021. <dt><samp class="option">death_color</samp></dt>
  46022. <dd><p>Set the color of dead cells. If <samp class="option">mold</samp> is set, this is the first color
  46023. used to represent a dead cell.
  46024. </p>
  46025. </dd>
  46026. <dt><samp class="option">mold_color</samp></dt>
  46027. <dd><p>Set mold color, for definitely dead and moldy cells.
  46028. </p>
  46029. <p>For the syntax of these 3 color options, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the
  46030. ffmpeg-utils manual</a>.
  46031. </p></dd>
  46032. </dl>
  46033. <a name="Examples-178"></a>
  46034. <h4 class="subsection">39.10.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-178" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-178" aria-hidden="true">TOC</a></span></h4>
  46035. <ul class="itemize mark-bullet">
  46036. <li>Read a grid from <samp class="file">pattern</samp>, and center it on a grid of size
  46037. 300x300 pixels:
  46038. <div class="example">
  46039. <pre class="example-preformatted">life=f=pattern:s=300x300
  46040. </pre></div>
  46041. </li><li>Generate a random grid of size 200x200, with a fill ratio of 2/3:
  46042. <div class="example">
  46043. <pre class="example-preformatted">life=ratio=2/3:s=200x200
  46044. </pre></div>
  46045. </li><li>Specify a custom rule for evolving a randomly generated grid:
  46046. <div class="example">
  46047. <pre class="example-preformatted">life=rule=S14/B34
  46048. </pre></div>
  46049. </li><li>Full example with slow death effect (mold) using <code class="command">ffplay</code>:
  46050. <div class="example">
  46051. <pre class="example-preformatted">ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
  46052. </pre></div>
  46053. </li></ul>
  46054. <a name="perlin"></a>
  46055. <h3 class="section">39.11 perlin<span class="pull-right"><a class="anchor hidden-xs" href="#perlin" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-perlin" aria-hidden="true">TOC</a></span></h3>
  46056. <p>Generate Perlin noise.
  46057. </p>
  46058. <p>Perlin noise is a kind of noise with local continuity in space. This
  46059. can be used to generate patterns with continuity in space and time,
  46060. e.g. to simulate smoke, fluids, or terrain.
  46061. </p>
  46062. <p>In case more than one octave is specified through the <samp class="option">octaves</samp>
  46063. option, Perlin noise is generated as a sum of components, each one
  46064. with doubled frequency. In this case the <samp class="option">persistence</samp> option
  46065. specify the ratio of the amplitude with respect to the previous
  46066. component. More octave components enable to specify more high
  46067. frequency details in the generated noise (e.g. small size variations
  46068. due to boulders in a generated terrain).
  46069. </p>
  46070. <a name="Options-43"></a>
  46071. <h4 class="subsection">39.11.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-43" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-43" aria-hidden="true">TOC</a></span></h4>
  46072. <dl class="table">
  46073. <dt><samp class="option">size, s</samp></dt>
  46074. <dd><p>Specify the size (width and height) of the buffered video frames. For the
  46075. syntax of this option, check the
  46076. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46077. Default value is <code class="code">320x240</code>.
  46078. </p>
  46079. </dd>
  46080. <dt><samp class="option">rate, r</samp></dt>
  46081. <dd><p>Specify the frame rate expected for the video stream, expressed as a
  46082. number of frames per second. Default value is <code class="code">25</code>.
  46083. </p>
  46084. </dd>
  46085. <dt><samp class="option">octaves</samp></dt>
  46086. <dd><p>Specify the total number of components making up the noise, each one
  46087. with doubled frequency. Default value is <code class="code">1</code>.
  46088. </p>
  46089. </dd>
  46090. <dt><samp class="option">persistence</samp></dt>
  46091. <dd><p>Set the ratio used to compute the amplitude of the next octave
  46092. component with respect to the previous component amplitude. Default
  46093. value is <code class="code">1</code>.
  46094. </p>
  46095. </dd>
  46096. <dt><samp class="option">xscale</samp></dt>
  46097. <dt><samp class="option">yscale</samp></dt>
  46098. <dd><p>Define a scale factor used to multiple the x, y coordinates. This can
  46099. be useful to define an effect with a pattern stretched along the x or
  46100. y axis. Default value is <code class="code">1</code>.
  46101. </p>
  46102. </dd>
  46103. <dt><samp class="option">tscale</samp></dt>
  46104. <dd><p>Define a scale factor used to multiple the time coordinate. This can
  46105. be useful to change the time variation speed. Default value is <code class="code">1</code>.
  46106. </p>
  46107. </dd>
  46108. <dt><samp class="option">random_mode</samp></dt>
  46109. <dd><p>Set random mode used to compute initial pattern.
  46110. </p>
  46111. <p>Supported values are:
  46112. </p><dl class="table">
  46113. <dt><samp class="option">random</samp></dt>
  46114. <dd><p>Compute and use random seed.
  46115. </p>
  46116. </dd>
  46117. <dt><samp class="option">ken</samp></dt>
  46118. <dd><p>Use the predefined initial pattern defined by Ken Perlin in the
  46119. original article, can be useful to compare the output with other
  46120. sources.
  46121. </p>
  46122. </dd>
  46123. <dt><samp class="option">seed</samp></dt>
  46124. <dd><p>Use the value specified by <samp class="option">random_seed</samp> option.
  46125. </p></dd>
  46126. </dl>
  46127. <p>Default value is <code class="code">random</code>.
  46128. </p>
  46129. </dd>
  46130. <dt><samp class="option">random_seed, seed</samp></dt>
  46131. <dd><p>When <samp class="option">random_mode</samp> is set to <var class="var">random_seed</var>, use this value
  46132. to compute the initial pattern. Default value is <code class="code">0</code>.
  46133. </p></dd>
  46134. </dl>
  46135. <a name="Examples-179"></a>
  46136. <h4 class="subsection">39.11.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-179" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-179" aria-hidden="true">TOC</a></span></h4>
  46137. <ul class="itemize mark-bullet">
  46138. <li>Generate single component:
  46139. <div class="example">
  46140. <pre class="example-preformatted">perlin
  46141. </pre></div>
  46142. </li><li>Use Perlin noise with 7 components, each one with a halved contribution
  46143. to total amplitude:
  46144. <div class="example">
  46145. <pre class="example-preformatted">perlin=octaves=7:persistence=0.5
  46146. </pre></div>
  46147. </li><li>Chain Perlin noise with the <a class="ref" href="#lutyuv">lutyuv</a> to generate a black&amp;white
  46148. effect:
  46149. <div class="example">
  46150. <pre class="example-preformatted">perlin=octaves=3:tscale=0.3,lutyuv=y='if(lt(val\,128)\,255\,0)'
  46151. </pre></div>
  46152. </li><li>Stretch noise along the y axis, and convert gray level to red-only
  46153. signal:
  46154. <div class="example">
  46155. <pre class="example-preformatted">perlin=octaves=7:tscale=0.4:yscale=0.3,lutrgb=r=val:b=0:g=0
  46156. </pre></div>
  46157. </li></ul>
  46158. <a name="qrencodesrc"></a>
  46159. <h3 class="section">39.12 qrencodesrc<span class="pull-right"><a class="anchor hidden-xs" href="#qrencodesrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qrencodesrc" aria-hidden="true">TOC</a></span></h3>
  46160. <p>Generate a QR code using the libqrencode library (see
  46161. <a class="url" href="https://fukuchi.org/works/qrencode/">https://fukuchi.org/works/qrencode/</a>).
  46162. </p>
  46163. <p>To enable the compilation of this source, you need to configure FFmpeg with
  46164. <code class="code">--enable-libqrencode</code>.
  46165. </p>
  46166. <p>The QR code is generated from the provided text or text pattern. The
  46167. corresponding QR code is scaled and put in the video output according to the
  46168. specified output size options.
  46169. </p>
  46170. <p>In case no text is specified, the QR code is not generated, but an empty colored
  46171. output is returned instead.
  46172. </p>
  46173. <p>This source accepts the following options:
  46174. </p>
  46175. <dl class="table">
  46176. <dt><samp class="option">qrcode_width, q</samp></dt>
  46177. <dt><samp class="option">padded_qrcode_width, Q</samp></dt>
  46178. <dd><p>Specify an expression for the width of the rendered QR code, with and without
  46179. padding. The <var class="var">qrcode_width</var> expression can reference the value set by the
  46180. <var class="var">padded_qrcode_width</var> expression, and vice versa.
  46181. By default <var class="var">padded_qrcode_width</var> is set to <var class="var">qrcode_width</var>, meaning that
  46182. there is no padding.
  46183. </p>
  46184. <p>These expressions are evaluated only once, when initializing the source.
  46185. See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  46186. </p>
  46187. <p>Note that some of the constants are missing for the source (for example the
  46188. <var class="var">x</var> or <var class="var">t</var> or ¸<var class="var">n</var>), since they only makes sense when evaluating the
  46189. expression for each frame rather than at initialization time.
  46190. </p>
  46191. </dd>
  46192. <dt><samp class="option">rate, r</samp></dt>
  46193. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  46194. generated per second. It has to be a string in the format
  46195. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  46196. number or a valid video frame rate abbreviation. The default value is
  46197. &quot;25&quot;.
  46198. </p>
  46199. </dd>
  46200. <dt><samp class="option">case_sensitive, cs</samp></dt>
  46201. <dd><p>Instruct libqrencode to use case sensitive encoding. This is enabled by
  46202. default. This can be disabled to reduce the QR encoding size.
  46203. </p>
  46204. </dd>
  46205. <dt><samp class="option">level, l</samp></dt>
  46206. <dd><p>Specify the QR encoding error correction level. With an higher correction level,
  46207. the encoding size will increase but the code will be more robust to corruption.
  46208. Lower level is <var class="var">L</var>.
  46209. </p>
  46210. <p>It accepts the following values:
  46211. </p><dl class="table">
  46212. <dt>&lsquo;<samp class="samp">L</samp>&rsquo;</dt>
  46213. <dt>&lsquo;<samp class="samp">M</samp>&rsquo;</dt>
  46214. <dt>&lsquo;<samp class="samp">Q</samp>&rsquo;</dt>
  46215. <dt>&lsquo;<samp class="samp">H</samp>&rsquo;</dt>
  46216. </dl>
  46217. </dd>
  46218. <dt><samp class="option">expansion</samp></dt>
  46219. <dd><p>Select how the input text is expanded. Can be either <code class="code">none</code>, or
  46220. <code class="code">normal</code> (default). See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode Text expansion</a>
  46221. section for details.
  46222. </p>
  46223. </dd>
  46224. <dt><samp class="option">text</samp></dt>
  46225. <dt><samp class="option">textfile</samp></dt>
  46226. <dd><p>Define the text to be rendered. In case neither is specified, no QR is encoded
  46227. (just an empty colored frame).
  46228. </p>
  46229. <p>In case expansion is enabled, the text is treated as a text template, using the
  46230. qrencode expansion mechanism. See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode
  46231. Text expansion</a> section for details.
  46232. </p>
  46233. </dd>
  46234. <dt><samp class="option">background_color, bc</samp></dt>
  46235. <dt><samp class="option">foreground_color, fc</samp></dt>
  46236. <dd><p>Set the QR code and background color. The default value of
  46237. <var class="var">foreground_color</var> is &quot;black&quot;, the default value of <var class="var">background_color</var>
  46238. is &quot;white&quot;.
  46239. </p>
  46240. <p>For the syntax of the color options, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot;
  46241. section in the ffmpeg-utils manual</a>.
  46242. </p></dd>
  46243. </dl>
  46244. <a name="Examples-180"></a>
  46245. <h4 class="subsection">39.12.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-180" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-180" aria-hidden="true">TOC</a></span></h4>
  46246. <ul class="itemize mark-bullet">
  46247. <li>Generate a QR code encoding the specified text with the default size:
  46248. <div class="example">
  46249. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org
  46250. </pre></div>
  46251. </li><li>Same as below, but select blue on pink colors:
  46252. <div class="example">
  46253. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:bc=pink:fc=blue
  46254. </pre></div>
  46255. </li><li>Generate a QR code with width of 200 pixels and padding, making the padded width
  46256. 4/3 of the QR code width:
  46257. <div class="example">
  46258. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:q=200:Q=4/3*q
  46259. </pre></div>
  46260. </li><li>Generate a QR code with padded width of 200 pixels and padding, making the QR
  46261. code width 3/4 of the padded width:
  46262. <div class="example">
  46263. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:Q=200:q=3/4*Q
  46264. </pre></div>
  46265. </li><li>Generate a QR code encoding the frame number:
  46266. <div class="example">
  46267. <pre class="example-preformatted">qrencodesrc=text=%{n}
  46268. </pre></div>
  46269. </li><li>Generate a QR code encoding the GMT timestamp:
  46270. <div class="example">
  46271. <pre class="example-preformatted">qrencodesrc=text=%{gmtime}
  46272. </pre></div>
  46273. </li><li>Generate a QR code encoding the timestamp expressed as a float:
  46274. <div class="example">
  46275. <pre class="example-preformatted">qrencodesrc=text=%{pts}
  46276. </pre></div>
  46277. </li></ul>
  46278. <a class="anchor" id="allrgb"></a><a class="anchor" id="allyuv"></a><a class="anchor" id="color"></a><a class="anchor" id="colorchart"></a><a class="anchor" id="colorspectrum"></a><a class="anchor" id="haldclutsrc"></a><a class="anchor" id="nullsrc"></a><a class="anchor" id="pal75bars"></a><a class="anchor" id="pal100bars"></a><a class="anchor" id="rgbtestsrc"></a><a class="anchor" id="smptebars"></a><a class="anchor" id="smptehdbars"></a><a class="anchor" id="testsrc"></a><a class="anchor" id="testsrc2"></a><a class="anchor" id="yuvtestsrc"></a><a name="allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc"></a>
  46279. <h3 class="section">39.13 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc<span class="pull-right"><a class="anchor hidden-xs" href="#allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" aria-hidden="true">TOC</a></span></h3>
  46280. <p>The <code class="code">allrgb</code> source returns frames of size 4096x4096 of all rgb colors.
  46281. </p>
  46282. <p>The <code class="code">allyuv</code> source returns frames of size 4096x4096 of all yuv colors.
  46283. </p>
  46284. <p>The <code class="code">color</code> source provides an uniformly colored input.
  46285. </p>
  46286. <p>The <code class="code">colorchart</code> source provides a colors checker chart.
  46287. </p>
  46288. <p>The <code class="code">colorspectrum</code> source provides a color spectrum input.
  46289. </p>
  46290. <p>The <code class="code">haldclutsrc</code> source provides an identity Hald CLUT. See also
  46291. <a class="ref" href="#haldclut">haldclut</a> filter.
  46292. </p>
  46293. <p>The <code class="code">nullsrc</code> source returns unprocessed video frames. It is
  46294. mainly useful to be employed in analysis / debugging tools, or as the
  46295. source for filters which ignore the input data.
  46296. </p>
  46297. <p>The <code class="code">pal75bars</code> source generates a color bars pattern, based on
  46298. EBU PAL recommendations with 75% color levels.
  46299. </p>
  46300. <p>The <code class="code">pal100bars</code> source generates a color bars pattern, based on
  46301. EBU PAL recommendations with 100% color levels.
  46302. </p>
  46303. <p>The <code class="code">rgbtestsrc</code> source generates an RGB test pattern useful for
  46304. detecting RGB vs BGR issues. You should see a red, green and blue
  46305. stripe from top to bottom.
  46306. </p>
  46307. <p>The <code class="code">smptebars</code> source generates a color bars pattern, based on
  46308. the SMPTE Engineering Guideline EG 1-1990.
  46309. </p>
  46310. <p>The <code class="code">smptehdbars</code> source generates a color bars pattern, based on
  46311. the SMPTE RP 219-2002.
  46312. </p>
  46313. <p>The <code class="code">testsrc</code> source generates a test video pattern, showing a
  46314. color pattern, a scrolling gradient and a timestamp. This is mainly
  46315. intended for testing purposes.
  46316. </p>
  46317. <p>The <code class="code">testsrc2</code> source is similar to testsrc, but supports more
  46318. pixel formats instead of just <code class="code">rgb24</code>. This allows using it as an
  46319. input for other tests without requiring a format conversion.
  46320. </p>
  46321. <p>The <code class="code">yuvtestsrc</code> source generates an YUV test pattern. You should
  46322. see a y, cb and cr stripe from top to bottom.
  46323. </p>
  46324. <p>The sources accept the following parameters:
  46325. </p>
  46326. <dl class="table">
  46327. <dt><samp class="option">level</samp></dt>
  46328. <dd><p>Specify the level of the Hald CLUT, only available in the <code class="code">haldclutsrc</code>
  46329. source. A level of <code class="code">N</code> generates a picture of <code class="code">N*N*N</code> by <code class="code">N*N*N</code>
  46330. pixels to be used as identity matrix for 3D lookup tables. Each component is
  46331. coded on a <code class="code">1/(N*N)</code> scale.
  46332. </p>
  46333. </dd>
  46334. <dt><samp class="option">color, c</samp></dt>
  46335. <dd><p>Specify the color of the source, only available in the <code class="code">color</code>
  46336. source. For the syntax of this option, check the
  46337. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  46338. </p>
  46339. </dd>
  46340. <dt><samp class="option">size, s</samp></dt>
  46341. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  46342. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46343. The default value is <code class="code">320x240</code>.
  46344. </p>
  46345. <p>This option is not available with the <code class="code">allrgb</code>, <code class="code">allyuv</code>, and
  46346. <code class="code">haldclutsrc</code> filters.
  46347. </p>
  46348. </dd>
  46349. <dt><samp class="option">rate, r</samp></dt>
  46350. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  46351. generated per second. It has to be a string in the format
  46352. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  46353. number or a valid video frame rate abbreviation. The default value is
  46354. &quot;25&quot;.
  46355. </p>
  46356. </dd>
  46357. <dt><samp class="option">duration, d</samp></dt>
  46358. <dd><p>Set the duration of the sourced video. See
  46359. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  46360. for the accepted syntax.
  46361. </p>
  46362. <p>If not specified, or the expressed duration is negative, the video is
  46363. supposed to be generated forever.
  46364. </p>
  46365. <p>Since the frame rate is used as time base, all frames including the last one
  46366. will have their full duration. If the specified duration is not a multiple
  46367. of the frame duration, it will be rounded up.
  46368. </p>
  46369. </dd>
  46370. <dt><samp class="option">sar</samp></dt>
  46371. <dd><p>Set the sample aspect ratio of the sourced video.
  46372. </p>
  46373. </dd>
  46374. <dt><samp class="option">alpha</samp></dt>
  46375. <dd><p>Specify the alpha (opacity) of the background, only available in the
  46376. <code class="code">testsrc2</code> source. The value must be between 0 (fully transparent) and
  46377. 255 (fully opaque, the default).
  46378. </p>
  46379. </dd>
  46380. <dt><samp class="option">decimals, n</samp></dt>
  46381. <dd><p>Set the number of decimals to show in the timestamp, only available in the
  46382. <code class="code">testsrc</code> source.
  46383. </p>
  46384. <p>The displayed timestamp value will correspond to the original
  46385. timestamp value multiplied by the power of 10 of the specified
  46386. value. Default value is 0.
  46387. </p>
  46388. </dd>
  46389. <dt><samp class="option">type</samp></dt>
  46390. <dd><p>Set the type of the color spectrum, only available in the
  46391. <code class="code">colorspectrum</code> source. Can be one of the following:
  46392. </p>
  46393. <dl class="table">
  46394. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  46395. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  46396. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  46397. </dl>
  46398. </dd>
  46399. <dt><samp class="option">patch_size</samp></dt>
  46400. <dd><p>Set patch size of single color patch, only available in the
  46401. <code class="code">colorchart</code> source. Default is <code class="code">64x64</code>.
  46402. </p>
  46403. </dd>
  46404. <dt><samp class="option">preset</samp></dt>
  46405. <dd><p>Set colorchecker colors preset, only available in the
  46406. <code class="code">colorchart</code> source.
  46407. </p>
  46408. <p>Available values are:
  46409. </p><dl class="table">
  46410. <dt>&lsquo;<samp class="samp">reference</samp>&rsquo;</dt>
  46411. <dt>&lsquo;<samp class="samp">skintones</samp>&rsquo;</dt>
  46412. </dl>
  46413. <p>Default value is <code class="code">reference</code>.
  46414. </p></dd>
  46415. </dl>
  46416. <a name="Examples-181"></a>
  46417. <h4 class="subsection">39.13.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-181" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-181" aria-hidden="true">TOC</a></span></h4>
  46418. <ul class="itemize mark-bullet">
  46419. <li>Generate a video with a duration of 5.3 seconds, with size
  46420. 176x144 and a frame rate of 10 frames per second:
  46421. <div class="example">
  46422. <pre class="example-preformatted">testsrc=duration=5.3:size=qcif:rate=10
  46423. </pre></div>
  46424. </li><li>The following graph description will generate a red source
  46425. with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
  46426. frames per second:
  46427. <div class="example">
  46428. <pre class="example-preformatted">color=c=red@0.2:s=qcif:r=10
  46429. </pre></div>
  46430. </li><li>If the input content is to be ignored, <code class="code">nullsrc</code> can be used. The
  46431. following command generates noise in the luma plane by employing
  46432. the <code class="code">geq</code> filter:
  46433. <div class="example">
  46434. <pre class="example-preformatted">nullsrc=s=256x256, geq=random(1)*255:128:128
  46435. </pre></div>
  46436. </li></ul>
  46437. <a name="Commands-157"></a>
  46438. <h4 class="subsection">39.13.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-157" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-157" aria-hidden="true">TOC</a></span></h4>
  46439. <p>The <code class="code">color</code> source supports the following commands:
  46440. </p>
  46441. <dl class="table">
  46442. <dt><samp class="option">c, color</samp></dt>
  46443. <dd><p>Set the color of the created image. Accepts the same syntax of the
  46444. corresponding <samp class="option">color</samp> option.
  46445. </p></dd>
  46446. </dl>
  46447. <a name="openclsrc"></a>
  46448. <h3 class="section">39.14 openclsrc<span class="pull-right"><a class="anchor hidden-xs" href="#openclsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-openclsrc" aria-hidden="true">TOC</a></span></h3>
  46449. <p>Generate video using an OpenCL program.
  46450. </p>
  46451. <dl class="table">
  46452. <dt><samp class="option">source</samp></dt>
  46453. <dd><p>OpenCL program source file.
  46454. </p>
  46455. </dd>
  46456. <dt><samp class="option">kernel</samp></dt>
  46457. <dd><p>Kernel name in program.
  46458. </p>
  46459. </dd>
  46460. <dt><samp class="option">size, s</samp></dt>
  46461. <dd><p>Size of frames to generate. This must be set.
  46462. </p>
  46463. </dd>
  46464. <dt><samp class="option">format</samp></dt>
  46465. <dd><p>Pixel format to use for the generated frames. This must be set.
  46466. </p>
  46467. </dd>
  46468. <dt><samp class="option">rate, r</samp></dt>
  46469. <dd><p>Number of frames generated every second. Default value is &rsquo;25&rsquo;.
  46470. </p>
  46471. </dd>
  46472. </dl>
  46473. <p>For details of how the program loading works, see the <a class="ref" href="#program_005fopencl">program_opencl</a>
  46474. filter.
  46475. </p>
  46476. <p>Example programs:
  46477. </p>
  46478. <ul class="itemize mark-bullet">
  46479. <li>Generate a colour ramp by setting pixel values from the position of the pixel
  46480. in the output image. (Note that this will work with all pixel formats, but
  46481. the generated output will not be the same.)
  46482. <pre class="verbatim">__kernel void ramp(__write_only image2d_t dst,
  46483. unsigned int index)
  46484. {
  46485. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  46486. float4 val;
  46487. val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
  46488. write_imagef(dst, loc, val);
  46489. }
  46490. </pre>
  46491. </li><li>Generate a Sierpinski carpet pattern, panning by a single pixel each frame.
  46492. <pre class="verbatim">__kernel void sierpinski_carpet(__write_only image2d_t dst,
  46493. unsigned int index)
  46494. {
  46495. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  46496. float4 value = 0.0f;
  46497. int x = loc.x + index;
  46498. int y = loc.y + index;
  46499. while (x &gt; 0 || y &gt; 0) {
  46500. if (x % 3 == 1 &amp;&amp; y % 3 == 1) {
  46501. value = 1.0f;
  46502. break;
  46503. }
  46504. x /= 3;
  46505. y /= 3;
  46506. }
  46507. write_imagef(dst, loc, value);
  46508. }
  46509. </pre>
  46510. </li></ul>
  46511. <a name="sierpinski"></a>
  46512. <h3 class="section">39.15 sierpinski<span class="pull-right"><a class="anchor hidden-xs" href="#sierpinski" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sierpinski" aria-hidden="true">TOC</a></span></h3>
  46513. <p>Generate a Sierpinski carpet/triangle fractal, and randomly pan around.
  46514. </p>
  46515. <p>This source accepts the following options:
  46516. </p>
  46517. <dl class="table">
  46518. <dt><samp class="option">size, s</samp></dt>
  46519. <dd><p>Set frame size. For the syntax of this option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video
  46520. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  46521. </p>
  46522. </dd>
  46523. <dt><samp class="option">rate, r</samp></dt>
  46524. <dd><p>Set frame rate, expressed as number of frames per second. Default
  46525. value is &quot;25&quot;.
  46526. </p>
  46527. </dd>
  46528. <dt><samp class="option">seed</samp></dt>
  46529. <dd><p>Set seed which is used for random panning.
  46530. </p>
  46531. </dd>
  46532. <dt><samp class="option">jump</samp></dt>
  46533. <dd><p>Set max jump for single pan destination. Allowed range is from 1 to 10000.
  46534. </p>
  46535. </dd>
  46536. <dt><samp class="option">type</samp></dt>
  46537. <dd><p>Set fractal type, can be default <code class="code">carpet</code> or <code class="code">triangle</code>.
  46538. </p></dd>
  46539. </dl>
  46540. <a name="zoneplate"></a>
  46541. <h3 class="section">39.16 zoneplate<span class="pull-right"><a class="anchor hidden-xs" href="#zoneplate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zoneplate" aria-hidden="true">TOC</a></span></h3>
  46542. <p>Generate a zoneplate test video pattern.
  46543. </p>
  46544. <p>This source accepts the following options:
  46545. </p>
  46546. <dl class="table">
  46547. <dt><samp class="option">size, s</samp></dt>
  46548. <dd><p>Set frame size. For the syntax of this option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video
  46549. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;320x240&quot;.
  46550. </p>
  46551. </dd>
  46552. <dt><samp class="option">rate, r</samp></dt>
  46553. <dd><p>Set frame rate, expressed as number of frames per second. Default
  46554. value is &quot;25&quot;.
  46555. </p>
  46556. </dd>
  46557. <dt><samp class="option">duration, d</samp></dt>
  46558. <dd><p>Set the duration of the sourced video. See
  46559. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  46560. for the accepted syntax.
  46561. </p>
  46562. <p>If not specified, or the expressed duration is negative, the video is
  46563. supposed to be generated forever.
  46564. </p>
  46565. </dd>
  46566. <dt><samp class="option">sar</samp></dt>
  46567. <dd><p>Set the sample aspect ratio of the sourced video.
  46568. </p>
  46569. </dd>
  46570. <dt><samp class="option">precision</samp></dt>
  46571. <dd><p>Set precision in bits for look-up table for sine calculations. Default value is 10.
  46572. Allowed range is from 4 to 16.
  46573. </p>
  46574. </dd>
  46575. <dt><samp class="option">xo</samp></dt>
  46576. <dd><p>Set horizontal axis offset for output signal. Default value is 0.
  46577. </p>
  46578. </dd>
  46579. <dt><samp class="option">yo</samp></dt>
  46580. <dd><p>Set vertical axis offset for output signal. Default value is 0.
  46581. </p>
  46582. </dd>
  46583. <dt><samp class="option">to</samp></dt>
  46584. <dd><p>Set time axis offset for output signal. Default value is 0.
  46585. </p>
  46586. </dd>
  46587. <dt><samp class="option">k0</samp></dt>
  46588. <dd><p>Set 0-order, constant added to signal phase. Default value is 0.
  46589. </p>
  46590. </dd>
  46591. <dt><samp class="option">kx</samp></dt>
  46592. <dd><p>Set 1-order, phase factor multiplier for horizontal axis. Default value is 0.
  46593. </p>
  46594. </dd>
  46595. <dt><samp class="option">ky</samp></dt>
  46596. <dd><p>Set 1-order, phase factor multiplier for vertical axis. Default value is 0.
  46597. </p>
  46598. </dd>
  46599. <dt><samp class="option">kt</samp></dt>
  46600. <dd><p>Set 1-order, phase factor multiplier for time axis. Default value is 0.
  46601. </p>
  46602. </dd>
  46603. <dt><samp class="option">kxt, kyt, kxy</samp></dt>
  46604. <dd><p>Set phase factor multipliers for combination of spatial and temporal axis.
  46605. Default value is 0.
  46606. </p>
  46607. </dd>
  46608. <dt><samp class="option">kx2</samp></dt>
  46609. <dd><p>Set 2-order, phase factor multiplier for horizontal axis. Default value is 0.
  46610. </p>
  46611. </dd>
  46612. <dt><samp class="option">ky2</samp></dt>
  46613. <dd><p>Set 2-order, phase factor multiplier for vertical axis. Default value is 0.
  46614. </p>
  46615. </dd>
  46616. <dt><samp class="option">kt2</samp></dt>
  46617. <dd><p>Set 2-order, phase factor multiplier for time axis. Default value is 0.
  46618. </p>
  46619. </dd>
  46620. <dt><samp class="option">ku</samp></dt>
  46621. <dd><p>Set the constant added to final phase to produce chroma-blue component of signal.
  46622. Default value is 0.
  46623. </p>
  46624. </dd>
  46625. <dt><samp class="option">kv</samp></dt>
  46626. <dd><p>Set the constant added to final phase to produce chroma-red component of signal.
  46627. Default value is 0.
  46628. </p></dd>
  46629. </dl>
  46630. <a name="Commands-158"></a>
  46631. <h4 class="subsection">39.16.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-158" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-158" aria-hidden="true">TOC</a></span></h4>
  46632. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  46633. </p>
  46634. <a name="Examples-182"></a>
  46635. <h4 class="subsection">39.16.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-182" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-182" aria-hidden="true">TOC</a></span></h4>
  46636. <ul class="itemize mark-bullet">
  46637. <li>Generate horizontal color sine sweep:
  46638. <div class="example">
  46639. <pre class="example-preformatted">zoneplate=ku=512:kv=0:kt2=0:kx2=256:s=wvga:xo=-426:kt=11
  46640. </pre></div>
  46641. </li><li>Generate vertical color sine sweep:
  46642. <div class="example">
  46643. <pre class="example-preformatted">zoneplate=ku=512:kv=0:kt2=0:ky2=156:s=wvga:yo=-240:kt=11
  46644. </pre></div>
  46645. </li><li>Generate circular zone-plate:
  46646. <div class="example">
  46647. <pre class="example-preformatted">zoneplate=ku=512:kv=100:kt2=0:ky2=256:kx2=556:s=wvga:yo=0:kt=11
  46648. </pre></div>
  46649. </li></ul>
  46650. <a name="Video-Sinks"></a>
  46651. <h2 class="chapter">40 Video Sinks<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Sinks" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Sinks" aria-hidden="true">TOC</a></span></h2>
  46652. <p>Below is a description of the currently available video sinks.
  46653. </p>
  46654. <a name="buffersink"></a>
  46655. <h3 class="section">40.1 buffersink<span class="pull-right"><a class="anchor hidden-xs" href="#buffersink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-buffersink" aria-hidden="true">TOC</a></span></h3>
  46656. <p>Buffer video frames, and make them available to the end of the filter
  46657. graph.
  46658. </p>
  46659. <p>This sink is mainly intended for programmatic use, in particular
  46660. through the interface defined in <samp class="file">libavfilter/buffersink.h</samp>
  46661. or the options system.
  46662. </p>
  46663. <p>It accepts a pointer to an AVBufferSinkContext structure, which
  46664. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  46665. parameter to <code class="code">avfilter_init_filter</code> for initialization.
  46666. </p>
  46667. <a name="nullsink"></a>
  46668. <h3 class="section">40.2 nullsink<span class="pull-right"><a class="anchor hidden-xs" href="#nullsink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nullsink" aria-hidden="true">TOC</a></span></h3>
  46669. <p>Null video sink: do absolutely nothing with the input video. It is
  46670. mainly useful as a template and for use in analysis / debugging
  46671. tools.
  46672. </p>
  46673. <a name="Multimedia-Filters"></a>
  46674. <h2 class="chapter">41 Multimedia Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Multimedia-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Multimedia-Filters" aria-hidden="true">TOC</a></span></h2>
  46675. <p>Below is a description of the currently available multimedia filters.
  46676. </p>
  46677. <a name="a3dscope"></a>
  46678. <h3 class="section">41.1 a3dscope<span class="pull-right"><a class="anchor hidden-xs" href="#a3dscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-a3dscope" aria-hidden="true">TOC</a></span></h3>
  46679. <p>Convert input audio to 3d scope video output.
  46680. </p>
  46681. <p>The filter accepts the following options:
  46682. </p>
  46683. <dl class="table">
  46684. <dt><samp class="option">rate, r</samp></dt>
  46685. <dd><p>Set frame rate, expressed as number of frames per second. Default
  46686. value is &quot;25&quot;.
  46687. </p>
  46688. </dd>
  46689. <dt><samp class="option">size, s</samp></dt>
  46690. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  46691. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46692. Default value is <code class="code">hd720</code>.
  46693. </p>
  46694. </dd>
  46695. <dt><samp class="option">fov</samp></dt>
  46696. <dd><p>Set the camera field of view. Default is 90 degrees.
  46697. Allowed range is from 40 to 150.
  46698. </p>
  46699. </dd>
  46700. <dt><samp class="option">roll</samp></dt>
  46701. <dd><p>Set the camera roll.
  46702. </p>
  46703. </dd>
  46704. <dt><samp class="option">pitch</samp></dt>
  46705. <dd><p>Set the camera pitch.
  46706. </p>
  46707. </dd>
  46708. <dt><samp class="option">yaw</samp></dt>
  46709. <dd><p>Set the camera yaw.
  46710. </p>
  46711. </dd>
  46712. <dt><samp class="option">xzoom</samp></dt>
  46713. <dd><p>Set the camera zoom on X-axis.
  46714. </p>
  46715. </dd>
  46716. <dt><samp class="option">yzoom</samp></dt>
  46717. <dd><p>Set the camera zoom on Y-axis.
  46718. </p>
  46719. </dd>
  46720. <dt><samp class="option">zzoom</samp></dt>
  46721. <dd><p>Set the camera zoom on Z-axis.
  46722. </p>
  46723. </dd>
  46724. <dt><samp class="option">xpos</samp></dt>
  46725. <dd><p>Set the camera position on X-axis.
  46726. </p>
  46727. </dd>
  46728. <dt><samp class="option">ypos</samp></dt>
  46729. <dd><p>Set the camera position on Y-axis.
  46730. </p>
  46731. </dd>
  46732. <dt><samp class="option">zpos</samp></dt>
  46733. <dd><p>Set the camera position on Z-axis.
  46734. </p>
  46735. </dd>
  46736. <dt><samp class="option">length</samp></dt>
  46737. <dd><p>Set the length of displayed audio waves in number of frames.
  46738. </p></dd>
  46739. </dl>
  46740. <a name="Commands-159"></a>
  46741. <h4 class="subsection">41.1.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-159" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-159" aria-hidden="true">TOC</a></span></h4>
  46742. <p>Filter supports the some above options as <a class="ref" href="#commands">commands</a>.
  46743. </p>
  46744. <a name="abitscope"></a>
  46745. <h3 class="section">41.2 abitscope<span class="pull-right"><a class="anchor hidden-xs" href="#abitscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abitscope" aria-hidden="true">TOC</a></span></h3>
  46746. <p>Convert input audio to a video output, displaying the audio bit scope.
  46747. </p>
  46748. <p>The filter accepts the following options:
  46749. </p>
  46750. <dl class="table">
  46751. <dt><samp class="option">rate, r</samp></dt>
  46752. <dd><p>Set frame rate, expressed as number of frames per second. Default
  46753. value is &quot;25&quot;.
  46754. </p>
  46755. </dd>
  46756. <dt><samp class="option">size, s</samp></dt>
  46757. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  46758. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46759. Default value is <code class="code">1024x256</code>.
  46760. </p>
  46761. </dd>
  46762. <dt><samp class="option">colors</samp></dt>
  46763. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  46764. draw channels. Unrecognized or missing colors will be replaced
  46765. by white color.
  46766. </p>
  46767. </dd>
  46768. <dt><samp class="option">mode, m</samp></dt>
  46769. <dd><p>Set output mode. Can be <code class="code">bars</code> or <code class="code">trace</code>. Default is <code class="code">bars</code>.
  46770. </p></dd>
  46771. </dl>
  46772. <a name="adrawgraph"></a>
  46773. <h3 class="section">41.3 adrawgraph<span class="pull-right"><a class="anchor hidden-xs" href="#adrawgraph" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adrawgraph" aria-hidden="true">TOC</a></span></h3>
  46774. <p>Draw a graph using input audio metadata.
  46775. </p>
  46776. <p>See <a class="ref" href="#drawgraph">drawgraph</a>
  46777. </p>
  46778. <a name="agraphmonitor"></a>
  46779. <h3 class="section">41.4 agraphmonitor<span class="pull-right"><a class="anchor hidden-xs" href="#agraphmonitor" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-agraphmonitor" aria-hidden="true">TOC</a></span></h3>
  46780. <p>See <a class="ref" href="#graphmonitor">graphmonitor</a>.
  46781. </p>
  46782. <a name="ahistogram"></a>
  46783. <h3 class="section">41.5 ahistogram<span class="pull-right"><a class="anchor hidden-xs" href="#ahistogram" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ahistogram" aria-hidden="true">TOC</a></span></h3>
  46784. <p>Convert input audio to a video output, displaying the volume histogram.
  46785. </p>
  46786. <p>The filter accepts the following options:
  46787. </p>
  46788. <dl class="table">
  46789. <dt><samp class="option">dmode</samp></dt>
  46790. <dd><p>Specify how histogram is calculated.
  46791. </p>
  46792. <p>It accepts the following values:
  46793. </p><dl class="table">
  46794. <dt>&lsquo;<samp class="samp">single</samp>&rsquo;</dt>
  46795. <dd><p>Use single histogram for all channels.
  46796. </p></dd>
  46797. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  46798. <dd><p>Use separate histogram for each channel.
  46799. </p></dd>
  46800. </dl>
  46801. <p>Default is <code class="code">single</code>.
  46802. </p>
  46803. </dd>
  46804. <dt><samp class="option">rate, r</samp></dt>
  46805. <dd><p>Set frame rate, expressed as number of frames per second. Default
  46806. value is &quot;25&quot;.
  46807. </p>
  46808. </dd>
  46809. <dt><samp class="option">size, s</samp></dt>
  46810. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  46811. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46812. Default value is <code class="code">hd720</code>.
  46813. </p>
  46814. </dd>
  46815. <dt><samp class="option">scale</samp></dt>
  46816. <dd><p>Set display scale.
  46817. </p>
  46818. <p>It accepts the following values:
  46819. </p><dl class="table">
  46820. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  46821. <dd><p>logarithmic
  46822. </p></dd>
  46823. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  46824. <dd><p>square root
  46825. </p></dd>
  46826. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  46827. <dd><p>cubic root
  46828. </p></dd>
  46829. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  46830. <dd><p>linear
  46831. </p></dd>
  46832. <dt>&lsquo;<samp class="samp">rlog</samp>&rsquo;</dt>
  46833. <dd><p>reverse logarithmic
  46834. </p></dd>
  46835. </dl>
  46836. <p>Default is <code class="code">log</code>.
  46837. </p>
  46838. </dd>
  46839. <dt><samp class="option">ascale</samp></dt>
  46840. <dd><p>Set amplitude scale.
  46841. </p>
  46842. <p>It accepts the following values:
  46843. </p><dl class="table">
  46844. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  46845. <dd><p>logarithmic
  46846. </p></dd>
  46847. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  46848. <dd><p>linear
  46849. </p></dd>
  46850. </dl>
  46851. <p>Default is <code class="code">log</code>.
  46852. </p>
  46853. </dd>
  46854. <dt><samp class="option">acount</samp></dt>
  46855. <dd><p>Set how much frames to accumulate in histogram.
  46856. Default is 1. Setting this to -1 accumulates all frames.
  46857. </p>
  46858. </dd>
  46859. <dt><samp class="option">rheight</samp></dt>
  46860. <dd><p>Set histogram ratio of window height.
  46861. </p>
  46862. </dd>
  46863. <dt><samp class="option">slide</samp></dt>
  46864. <dd><p>Set sonogram sliding.
  46865. </p>
  46866. <p>It accepts the following values:
  46867. </p><dl class="table">
  46868. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  46869. <dd><p>replace old rows with new ones.
  46870. </p></dd>
  46871. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  46872. <dd><p>scroll from top to bottom.
  46873. </p></dd>
  46874. </dl>
  46875. <p>Default is <code class="code">replace</code>.
  46876. </p>
  46877. </dd>
  46878. <dt><samp class="option">hmode</samp></dt>
  46879. <dd><p>Set histogram mode.
  46880. </p>
  46881. <p>It accepts the following values:
  46882. </p><dl class="table">
  46883. <dt>&lsquo;<samp class="samp">abs</samp>&rsquo;</dt>
  46884. <dd><p>Use absolute values of samples.
  46885. </p></dd>
  46886. <dt>&lsquo;<samp class="samp">sign</samp>&rsquo;</dt>
  46887. <dd><p>Use untouched values of samples.
  46888. </p></dd>
  46889. </dl>
  46890. <p>Default is <code class="code">abs</code>.
  46891. </p></dd>
  46892. </dl>
  46893. <a name="aphasemeter"></a>
  46894. <h3 class="section">41.6 aphasemeter<span class="pull-right"><a class="anchor hidden-xs" href="#aphasemeter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aphasemeter" aria-hidden="true">TOC</a></span></h3>
  46895. <p>Measures phase of input audio, which is exported as metadata <code class="code">lavfi.aphasemeter.phase</code>,
  46896. representing mean phase of current audio frame. A video output can also be produced and is
  46897. enabled by default. The audio is passed through as first output.
  46898. </p>
  46899. <p>Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in
  46900. range <code class="code">[-1, 1]</code> where <code class="code">-1</code> means left and right channels are completely out of phase
  46901. and <code class="code">1</code> means channels are in phase.
  46902. </p>
  46903. <p>The filter accepts the following options, all related to its video output:
  46904. </p>
  46905. <dl class="table">
  46906. <dt><samp class="option">rate, r</samp></dt>
  46907. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  46908. </p>
  46909. </dd>
  46910. <dt><samp class="option">size, s</samp></dt>
  46911. <dd><p>Set the video size for the output. For the syntax of this option, check the
  46912. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46913. Default value is <code class="code">800x400</code>.
  46914. </p>
  46915. </dd>
  46916. <dt><samp class="option">rc</samp></dt>
  46917. <dt><samp class="option">gc</samp></dt>
  46918. <dt><samp class="option">bc</samp></dt>
  46919. <dd><p>Specify the red, green, blue contrast. Default values are <code class="code">2</code>,
  46920. <code class="code">7</code> and <code class="code">1</code>.
  46921. Allowed range is <code class="code">[0, 255]</code>.
  46922. </p>
  46923. </dd>
  46924. <dt><samp class="option">mpc</samp></dt>
  46925. <dd><p>Set color which will be used for drawing median phase. If color is
  46926. <code class="code">none</code> which is default, no median phase value will be drawn.
  46927. </p>
  46928. </dd>
  46929. <dt><samp class="option">video</samp></dt>
  46930. <dd><p>Enable video output. Default is enabled.
  46931. </p></dd>
  46932. </dl>
  46933. <a name="phasing-detection"></a>
  46934. <h4 class="subsection">41.6.1 phasing detection<span class="pull-right"><a class="anchor hidden-xs" href="#phasing-detection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-phasing-detection" aria-hidden="true">TOC</a></span></h4>
  46935. <p>The filter also detects out of phase and mono sequences in stereo streams.
  46936. It logs the sequence start, end and duration when it lasts longer or as long as the minimum set.
  46937. </p>
  46938. <p>The filter accepts the following options for this detection:
  46939. </p>
  46940. <dl class="table">
  46941. <dt><samp class="option">phasing</samp></dt>
  46942. <dd><p>Enable mono and out of phase detection. Default is disabled.
  46943. </p>
  46944. </dd>
  46945. <dt><samp class="option">tolerance, t</samp></dt>
  46946. <dd><p>Set phase tolerance for mono detection, in amplitude ratio. Default is <code class="code">0</code>.
  46947. Allowed range is <code class="code">[0, 1]</code>.
  46948. </p>
  46949. </dd>
  46950. <dt><samp class="option">angle, a</samp></dt>
  46951. <dd><p>Set angle threshold for out of phase detection, in degree. Default is <code class="code">170</code>.
  46952. Allowed range is <code class="code">[90, 180]</code>.
  46953. </p>
  46954. </dd>
  46955. <dt><samp class="option">duration, d</samp></dt>
  46956. <dd><p>Set mono or out of phase duration until notification, expressed in seconds. Default is <code class="code">2</code>.
  46957. </p></dd>
  46958. </dl>
  46959. <a name="Examples-183"></a>
  46960. <h4 class="subsection">41.6.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-183" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-183" aria-hidden="true">TOC</a></span></h4>
  46961. <ul class="itemize mark-bullet">
  46962. <li>Complete example with <code class="command">ffmpeg</code> to detect 1 second of mono with 0.001 phase tolerance:
  46963. <div class="example">
  46964. <pre class="example-preformatted">ffmpeg -i stereo.wav -af aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
  46965. </pre></div>
  46966. </li></ul>
  46967. <a name="avectorscope"></a>
  46968. <h3 class="section">41.7 avectorscope<span class="pull-right"><a class="anchor hidden-xs" href="#avectorscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avectorscope" aria-hidden="true">TOC</a></span></h3>
  46969. <p>Convert input audio to a video output, representing the audio vector
  46970. scope.
  46971. </p>
  46972. <p>The filter is used to measure the difference between channels of stereo
  46973. audio stream. A monaural signal, consisting of identical left and right
  46974. signal, results in straight vertical line. Any stereo separation is visible
  46975. as a deviation from this line, creating a Lissajous figure.
  46976. If the straight (or deviation from it) but horizontal line appears this
  46977. indicates that the left and right channels are out of phase.
  46978. </p>
  46979. <p>The filter accepts the following options:
  46980. </p>
  46981. <dl class="table">
  46982. <dt><samp class="option">mode, m</samp></dt>
  46983. <dd><p>Set the vectorscope mode.
  46984. </p>
  46985. <p>Available values are:
  46986. </p><dl class="table">
  46987. <dt>&lsquo;<samp class="samp">lissajous</samp>&rsquo;</dt>
  46988. <dd><p>Lissajous rotated by 45 degrees.
  46989. </p>
  46990. </dd>
  46991. <dt>&lsquo;<samp class="samp">lissajous_xy</samp>&rsquo;</dt>
  46992. <dd><p>Same as above but not rotated.
  46993. </p>
  46994. </dd>
  46995. <dt>&lsquo;<samp class="samp">polar</samp>&rsquo;</dt>
  46996. <dd><p>Shape resembling half of circle.
  46997. </p></dd>
  46998. </dl>
  46999. <p>Default value is &lsquo;<samp class="samp">lissajous</samp>&rsquo;.
  47000. </p>
  47001. </dd>
  47002. <dt><samp class="option">size, s</samp></dt>
  47003. <dd><p>Set the video size for the output. For the syntax of this option, check the
  47004. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47005. Default value is <code class="code">400x400</code>.
  47006. </p>
  47007. </dd>
  47008. <dt><samp class="option">rate, r</samp></dt>
  47009. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  47010. </p>
  47011. </dd>
  47012. <dt><samp class="option">rc</samp></dt>
  47013. <dt><samp class="option">gc</samp></dt>
  47014. <dt><samp class="option">bc</samp></dt>
  47015. <dt><samp class="option">ac</samp></dt>
  47016. <dd><p>Specify the red, green, blue and alpha contrast. Default values are <code class="code">40</code>,
  47017. <code class="code">160</code>, <code class="code">80</code> and <code class="code">255</code>.
  47018. Allowed range is <code class="code">[0, 255]</code>.
  47019. </p>
  47020. </dd>
  47021. <dt><samp class="option">rf</samp></dt>
  47022. <dt><samp class="option">gf</samp></dt>
  47023. <dt><samp class="option">bf</samp></dt>
  47024. <dt><samp class="option">af</samp></dt>
  47025. <dd><p>Specify the red, green, blue and alpha fade. Default values are <code class="code">15</code>,
  47026. <code class="code">10</code>, <code class="code">5</code> and <code class="code">5</code>.
  47027. Allowed range is <code class="code">[0, 255]</code>.
  47028. </p>
  47029. </dd>
  47030. <dt><samp class="option">zoom</samp></dt>
  47031. <dd><p>Set the zoom factor. Default value is <code class="code">1</code>. Allowed range is <code class="code">[0, 10]</code>.
  47032. Values lower than <var class="var">1</var> will auto adjust zoom factor to maximal possible value.
  47033. </p>
  47034. </dd>
  47035. <dt><samp class="option">draw</samp></dt>
  47036. <dd><p>Set the vectorscope drawing mode.
  47037. </p>
  47038. <p>Available values are:
  47039. </p><dl class="table">
  47040. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  47041. <dd><p>Draw dot for each sample.
  47042. </p>
  47043. </dd>
  47044. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  47045. <dd><p>Draw line between previous and current sample.
  47046. </p>
  47047. </dd>
  47048. <dt>&lsquo;<samp class="samp">aaline</samp>&rsquo;</dt>
  47049. <dd><p>Draw anti-aliased line between previous and current sample.
  47050. </p></dd>
  47051. </dl>
  47052. <p>Default value is &lsquo;<samp class="samp">dot</samp>&rsquo;.
  47053. </p>
  47054. </dd>
  47055. <dt><samp class="option">scale</samp></dt>
  47056. <dd><p>Specify amplitude scale of audio samples.
  47057. </p>
  47058. <p>Available values are:
  47059. </p><dl class="table">
  47060. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  47061. <dd><p>Linear.
  47062. </p>
  47063. </dd>
  47064. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  47065. <dd><p>Square root.
  47066. </p>
  47067. </dd>
  47068. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  47069. <dd><p>Cubic root.
  47070. </p>
  47071. </dd>
  47072. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  47073. <dd><p>Logarithmic.
  47074. </p></dd>
  47075. </dl>
  47076. </dd>
  47077. <dt><samp class="option">swap</samp></dt>
  47078. <dd><p>Swap left channel axis with right channel axis.
  47079. </p>
  47080. </dd>
  47081. <dt><samp class="option">mirror</samp></dt>
  47082. <dd><p>Mirror axis.
  47083. </p>
  47084. <dl class="table">
  47085. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  47086. <dd><p>No mirror.
  47087. </p>
  47088. </dd>
  47089. <dt>&lsquo;<samp class="samp">x</samp>&rsquo;</dt>
  47090. <dd><p>Mirror only x axis.
  47091. </p>
  47092. </dd>
  47093. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  47094. <dd><p>Mirror only y axis.
  47095. </p>
  47096. </dd>
  47097. <dt>&lsquo;<samp class="samp">xy</samp>&rsquo;</dt>
  47098. <dd><p>Mirror both axis.
  47099. </p></dd>
  47100. </dl>
  47101. </dd>
  47102. </dl>
  47103. <a name="Examples-184"></a>
  47104. <h4 class="subsection">41.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-184" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-184" aria-hidden="true">TOC</a></span></h4>
  47105. <ul class="itemize mark-bullet">
  47106. <li>Complete example using <code class="command">ffplay</code>:
  47107. <div class="example">
  47108. <pre class="example-preformatted">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  47109. [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
  47110. </pre></div>
  47111. </li></ul>
  47112. <a name="Commands-160"></a>
  47113. <h4 class="subsection">41.7.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-160" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-160" aria-hidden="true">TOC</a></span></h4>
  47114. <p>This filter supports the all above options as commands except options <code class="code">size</code> and <code class="code">rate</code>.
  47115. </p>
  47116. <a name="bench_002c-abench"></a>
  47117. <h3 class="section">41.8 bench, abench<span class="pull-right"><a class="anchor hidden-xs" href="#bench_002c-abench" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bench_002c-abench" aria-hidden="true">TOC</a></span></h3>
  47118. <p>Benchmark part of a filtergraph.
  47119. </p>
  47120. <p>The filter accepts the following options:
  47121. </p>
  47122. <dl class="table">
  47123. <dt><samp class="option">action</samp></dt>
  47124. <dd><p>Start or stop a timer.
  47125. </p>
  47126. <p>Available values are:
  47127. </p><dl class="table">
  47128. <dt>&lsquo;<samp class="samp">start</samp>&rsquo;</dt>
  47129. <dd><p>Get the current time, set it as frame metadata (using the key
  47130. <code class="code">lavfi.bench.start_time</code>), and forward the frame to the next filter.
  47131. </p>
  47132. </dd>
  47133. <dt>&lsquo;<samp class="samp">stop</samp>&rsquo;</dt>
  47134. <dd><p>Get the current time and fetch the <code class="code">lavfi.bench.start_time</code> metadata from
  47135. the input frame metadata to get the time difference. Time difference, average,
  47136. maximum and minimum time (respectively <code class="code">t</code>, <code class="code">avg</code>, <code class="code">max</code> and
  47137. <code class="code">min</code>) are then printed. The timestamps are expressed in seconds.
  47138. </p></dd>
  47139. </dl>
  47140. </dd>
  47141. </dl>
  47142. <a name="Examples-185"></a>
  47143. <h4 class="subsection">41.8.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-185" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-185" aria-hidden="true">TOC</a></span></h4>
  47144. <ul class="itemize mark-bullet">
  47145. <li>Benchmark <a class="ref" href="#selectivecolor">selectivecolor</a> filter:
  47146. <div class="example">
  47147. <pre class="example-preformatted">bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
  47148. </pre></div>
  47149. </li></ul>
  47150. <a class="anchor" id="concat-filter"></a><a name="concat-3"></a>
  47151. <h3 class="section">41.9 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat-3" aria-hidden="true">TOC</a></span></h3>
  47152. <p>Concatenate audio and video streams, joining them together one after the
  47153. other.
  47154. </p>
  47155. <p>The filter works on segments of synchronized video and audio streams. All
  47156. segments must have the same number of streams of each type, and that will
  47157. also be the number of streams at output.
  47158. </p>
  47159. <p>The filter accepts the following options:
  47160. </p>
  47161. <dl class="table">
  47162. <dt><samp class="option">n</samp></dt>
  47163. <dd><p>Set the number of segments. Default is 2.
  47164. </p>
  47165. </dd>
  47166. <dt><samp class="option">v</samp></dt>
  47167. <dd><p>Set the number of output video streams, that is also the number of video
  47168. streams in each segment. Default is 1.
  47169. </p>
  47170. </dd>
  47171. <dt><samp class="option">a</samp></dt>
  47172. <dd><p>Set the number of output audio streams, that is also the number of audio
  47173. streams in each segment. Default is 0.
  47174. </p>
  47175. </dd>
  47176. <dt><samp class="option">unsafe</samp></dt>
  47177. <dd><p>Activate unsafe mode: do not fail if segments have a different format.
  47178. </p>
  47179. </dd>
  47180. </dl>
  47181. <p>The filter has <var class="var">v</var>+<var class="var">a</var> outputs: first <var class="var">v</var> video outputs, then
  47182. <var class="var">a</var> audio outputs.
  47183. </p>
  47184. <p>There are <var class="var">n</var>x(<var class="var">v</var>+<var class="var">a</var>) inputs: first the inputs for the first
  47185. segment, in the same order as the outputs, then the inputs for the second
  47186. segment, etc.
  47187. </p>
  47188. <p>Related streams do not always have exactly the same duration, for various
  47189. reasons including codec frame size or sloppy authoring. For that reason,
  47190. related synchronized streams (e.g. a video and its audio track) should be
  47191. concatenated at once. The concat filter will use the duration of the longest
  47192. stream in each segment (except the last one), and if necessary pad shorter
  47193. audio streams with silence.
  47194. </p>
  47195. <p>For this filter to work correctly, all segments must start at timestamp 0.
  47196. </p>
  47197. <p>All corresponding streams must have the same parameters in all segments; the
  47198. filtering system will automatically select a common pixel format for video
  47199. streams, and a common sample format, sample rate and channel layout for
  47200. audio streams, but other settings, such as resolution, must be converted
  47201. explicitly by the user.
  47202. </p>
  47203. <p>Different frame rates are acceptable but will result in variable frame rate
  47204. at output; be sure to configure the output file to handle it.
  47205. </p>
  47206. <a name="Examples-186"></a>
  47207. <h4 class="subsection">41.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-186" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-186" aria-hidden="true">TOC</a></span></h4>
  47208. <ul class="itemize mark-bullet">
  47209. <li>Concatenate an opening, an episode and an ending, all in bilingual version
  47210. (video in stream 0, audio in streams 1 and 2):
  47211. <div class="example">
  47212. <pre class="example-preformatted">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
  47213. '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
  47214. concat=n=3:v=1:a=2 [v] [a1] [a2]' \
  47215. -map '[v]' -map '[a1]' -map '[a2]' output.mkv
  47216. </pre></div>
  47217. </li><li>Concatenate two parts, handling audio and video separately, using the
  47218. (a)movie sources, and adjusting the resolution:
  47219. <div class="example">
  47220. <pre class="example-preformatted">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
  47221. movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
  47222. [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
  47223. </pre></div>
  47224. <p>Note that a desync will happen at the stitch if the audio and video streams
  47225. do not have exactly the same duration in the first file.
  47226. </p>
  47227. </li></ul>
  47228. <a name="Commands-161"></a>
  47229. <h4 class="subsection">41.9.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-161" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-161" aria-hidden="true">TOC</a></span></h4>
  47230. <p>This filter supports the following commands:
  47231. </p><dl class="table">
  47232. <dt><samp class="option">next</samp></dt>
  47233. <dd><p>Close the current segment and step to the next one
  47234. </p></dd>
  47235. </dl>
  47236. <a class="anchor" id="ebur128"></a><a name="ebur128-1"></a>
  47237. <h3 class="section">41.10 ebur128<span class="pull-right"><a class="anchor hidden-xs" href="#ebur128-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ebur128-1" aria-hidden="true">TOC</a></span></h3>
  47238. <p>EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness
  47239. level. By default, it logs a message at a frequency of 10Hz with the
  47240. Momentary loudness (identified by <code class="code">M</code>), Short-term loudness (<code class="code">S</code>),
  47241. Integrated loudness (<code class="code">I</code>) and Loudness Range (<code class="code">LRA</code>).
  47242. </p>
  47243. <p>The filter can only analyze streams which have
  47244. sample format is double-precision floating point. The input stream will be converted to
  47245. this specification, if needed. Users may need to insert aformat and/or aresample filters
  47246. after this filter to obtain the original parameters.
  47247. </p>
  47248. <p>The filter also has a video output (see the <var class="var">video</var> option) with a real
  47249. time graph to observe the loudness evolution. The graphic contains the logged
  47250. message mentioned above, so it is not printed anymore when this option is set,
  47251. unless the verbose logging is set. The main graphing area contains the
  47252. short-term loudness (3 seconds of analysis), and the gauge on the right is for
  47253. the momentary loudness (400 milliseconds), but can optionally be configured
  47254. to instead display short-term loudness (see <var class="var">gauge</var>).
  47255. </p>
  47256. <p>The green area marks a +/- 1LU target range around the target loudness
  47257. (-23LUFS by default, unless modified through <var class="var">target</var>).
  47258. </p>
  47259. <p>More information about the Loudness Recommendation EBU R128 on
  47260. <a class="url" href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
  47261. </p>
  47262. <p>The filter accepts the following options:
  47263. </p>
  47264. <dl class="table">
  47265. <dt><samp class="option">video</samp></dt>
  47266. <dd><p>Activate the video output. The audio stream is passed unchanged whether this
  47267. option is set or no. The video stream will be the first output stream if
  47268. activated. Default is <code class="code">0</code>.
  47269. </p>
  47270. </dd>
  47271. <dt><samp class="option">size</samp></dt>
  47272. <dd><p>Set the video size. This option is for video only. For the syntax of this
  47273. option, check the
  47274. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47275. Default and minimum resolution is <code class="code">640x480</code>.
  47276. </p>
  47277. </dd>
  47278. <dt><samp class="option">meter</samp></dt>
  47279. <dd><p>Set the EBU scale meter. Default is <code class="code">9</code>. Common values are <code class="code">9</code> and
  47280. <code class="code">18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
  47281. other integer value between this range is allowed.
  47282. </p>
  47283. </dd>
  47284. <dt><samp class="option">metadata</samp></dt>
  47285. <dd><p>Set metadata injection. If set to <code class="code">1</code>, the audio input will be segmented
  47286. into 100ms output frames, each of them containing various loudness information
  47287. in metadata. All the metadata keys are prefixed with <code class="code">lavfi.r128.</code>.
  47288. </p>
  47289. <p>Default is <code class="code">0</code>.
  47290. </p>
  47291. </dd>
  47292. <dt><samp class="option">framelog</samp></dt>
  47293. <dd><p>Force the frame logging level.
  47294. </p>
  47295. <p>Available values are:
  47296. </p><dl class="table">
  47297. <dt>&lsquo;<samp class="samp">quiet</samp>&rsquo;</dt>
  47298. <dd><p>logging disabled
  47299. </p></dd>
  47300. <dt>&lsquo;<samp class="samp">info</samp>&rsquo;</dt>
  47301. <dd><p>information logging level
  47302. </p></dd>
  47303. <dt>&lsquo;<samp class="samp">verbose</samp>&rsquo;</dt>
  47304. <dd><p>verbose logging level
  47305. </p></dd>
  47306. </dl>
  47307. <p>By default, the logging level is set to <var class="var">info</var>. If the <samp class="option">video</samp> or
  47308. the <samp class="option">metadata</samp> options are set, it switches to <var class="var">verbose</var>.
  47309. </p>
  47310. </dd>
  47311. <dt><samp class="option">peak</samp></dt>
  47312. <dd><p>Set peak mode(s).
  47313. </p>
  47314. <p>Available modes can be cumulated (the option is a <code class="code">flag</code> type). Possible
  47315. values are:
  47316. </p><dl class="table">
  47317. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  47318. <dd><p>Disable any peak mode (default).
  47319. </p></dd>
  47320. <dt>&lsquo;<samp class="samp">sample</samp>&rsquo;</dt>
  47321. <dd><p>Enable sample-peak mode.
  47322. </p>
  47323. <p>Simple peak mode looking for the higher sample value. It logs a message
  47324. for sample-peak (identified by <code class="code">SPK</code>).
  47325. </p></dd>
  47326. <dt>&lsquo;<samp class="samp">true</samp>&rsquo;</dt>
  47327. <dd><p>Enable true-peak mode.
  47328. </p>
  47329. <p>If enabled, the peak lookup is done on an over-sampled version of the input
  47330. stream for better peak accuracy. It logs a message for true-peak.
  47331. (identified by <code class="code">TPK</code>) and true-peak per frame (identified by <code class="code">FTPK</code>).
  47332. This mode requires a build with <code class="code">libswresample</code>.
  47333. </p></dd>
  47334. </dl>
  47335. </dd>
  47336. <dt><samp class="option">dualmono</samp></dt>
  47337. <dd><p>Treat mono input files as &quot;dual mono&quot;. If a mono file is intended for playback
  47338. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  47339. If set to <code class="code">true</code>, this option will compensate for this effect.
  47340. Multi-channel input files are not affected by this option.
  47341. </p>
  47342. </dd>
  47343. <dt><samp class="option">panlaw</samp></dt>
  47344. <dd><p>Set a specific pan law to be used for the measurement of dual mono files.
  47345. This parameter is optional, and has a default value of -3.01dB.
  47346. </p>
  47347. </dd>
  47348. <dt><samp class="option">target</samp></dt>
  47349. <dd><p>Set a specific target level (in LUFS) used as relative zero in the visualization.
  47350. This parameter is optional and has a default value of -23LUFS as specified
  47351. by EBU R128. However, material published online may prefer a level of -16LUFS
  47352. (e.g. for use with podcasts or video platforms).
  47353. </p>
  47354. </dd>
  47355. <dt><samp class="option">gauge</samp></dt>
  47356. <dd><p>Set the value displayed by the gauge. Valid values are <code class="code">momentary</code> and s
  47357. <code class="code">shortterm</code>. By default the momentary value will be used, but in certain
  47358. scenarios it may be more useful to observe the short term value instead (e.g.
  47359. live mixing).
  47360. </p>
  47361. </dd>
  47362. <dt><samp class="option">scale</samp></dt>
  47363. <dd><p>Sets the display scale for the loudness. Valid parameters are <code class="code">absolute</code>
  47364. (in LUFS) or <code class="code">relative</code> (LU) relative to the target. This only affects the
  47365. video output, not the summary or continuous log output.
  47366. </p>
  47367. </dd>
  47368. <dt><samp class="option">integrated</samp></dt>
  47369. <dd><p>Read-only exported value for measured integrated loudness, in LUFS.
  47370. </p>
  47371. </dd>
  47372. <dt><samp class="option">range</samp></dt>
  47373. <dd><p>Read-only exported value for measured loudness range, in LU.
  47374. </p>
  47375. </dd>
  47376. <dt><samp class="option">lra_low</samp></dt>
  47377. <dd><p>Read-only exported value for measured LRA low, in LUFS.
  47378. </p>
  47379. </dd>
  47380. <dt><samp class="option">lra_high</samp></dt>
  47381. <dd><p>Read-only exported value for measured LRA high, in LUFS.
  47382. </p>
  47383. </dd>
  47384. <dt><samp class="option">sample_peak</samp></dt>
  47385. <dd><p>Read-only exported value for measured sample peak, in dBFS.
  47386. </p>
  47387. </dd>
  47388. <dt><samp class="option">true_peak</samp></dt>
  47389. <dd><p>Read-only exported value for measured true peak, in dBFS.
  47390. </p></dd>
  47391. </dl>
  47392. <a name="Examples-187"></a>
  47393. <h4 class="subsection">41.10.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-187" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-187" aria-hidden="true">TOC</a></span></h4>
  47394. <ul class="itemize mark-bullet">
  47395. <li>Real-time graph using <code class="command">ffplay</code>, with a EBU scale meter +18:
  47396. <div class="example">
  47397. <pre class="example-preformatted">ffplay -f lavfi -i &quot;amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]&quot;
  47398. </pre></div>
  47399. </li><li>Run an analysis with <code class="command">ffmpeg</code>:
  47400. <div class="example">
  47401. <pre class="example-preformatted">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
  47402. </pre></div>
  47403. </li></ul>
  47404. <a name="interleave_002c-ainterleave"></a>
  47405. <h3 class="section">41.11 interleave, ainterleave<span class="pull-right"><a class="anchor hidden-xs" href="#interleave_002c-ainterleave" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-interleave_002c-ainterleave" aria-hidden="true">TOC</a></span></h3>
  47406. <p>Temporally interleave frames from several inputs.
  47407. </p>
  47408. <p><code class="code">interleave</code> works with video inputs, <code class="code">ainterleave</code> with audio.
  47409. </p>
  47410. <p>These filters read frames from several inputs and send the oldest
  47411. queued frame to the output.
  47412. </p>
  47413. <p>Input streams must have well defined, monotonically increasing frame
  47414. timestamp values.
  47415. </p>
  47416. <p>In order to submit one frame to output, these filters need to enqueue
  47417. at least one frame for each input, so they cannot work in case one
  47418. input is not yet terminated and will not receive incoming frames.
  47419. </p>
  47420. <p>For example consider the case when one input is a <code class="code">select</code> filter
  47421. which always drops input frames. The <code class="code">interleave</code> filter will keep
  47422. reading from that input, but it will never be able to send new frames
  47423. to output until the input sends an end-of-stream signal.
  47424. </p>
  47425. <p>Also, depending on inputs synchronization, the filters will drop
  47426. frames in case one input receives more frames than the other ones, and
  47427. the queue is already filled.
  47428. </p>
  47429. <p>These filters accept the following options:
  47430. </p>
  47431. <dl class="table">
  47432. <dt><samp class="option">nb_inputs, n</samp></dt>
  47433. <dd><p>Set the number of different inputs, it is 2 by default.
  47434. </p>
  47435. </dd>
  47436. <dt><samp class="option">duration</samp></dt>
  47437. <dd><p>How to determine the end-of-stream.
  47438. </p>
  47439. <dl class="table">
  47440. <dt><samp class="option">longest</samp></dt>
  47441. <dd><p>The duration of the longest input. (default)
  47442. </p>
  47443. </dd>
  47444. <dt><samp class="option">shortest</samp></dt>
  47445. <dd><p>The duration of the shortest input.
  47446. </p>
  47447. </dd>
  47448. <dt><samp class="option">first</samp></dt>
  47449. <dd><p>The duration of the first input.
  47450. </p></dd>
  47451. </dl>
  47452. </dd>
  47453. </dl>
  47454. <a name="Examples-188"></a>
  47455. <h4 class="subsection">41.11.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-188" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-188" aria-hidden="true">TOC</a></span></h4>
  47456. <ul class="itemize mark-bullet">
  47457. <li>Interleave frames belonging to different streams using <code class="command">ffmpeg</code>:
  47458. <div class="example">
  47459. <pre class="example-preformatted">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex &quot;[0:v][1:v] interleave&quot; out.avi
  47460. </pre></div>
  47461. </li><li>Add flickering blur effect:
  47462. <div class="example">
  47463. <pre class="example-preformatted">select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
  47464. </pre></div>
  47465. </li></ul>
  47466. <a name="latency_002c-alatency"></a>
  47467. <h3 class="section">41.12 latency, alatency<span class="pull-right"><a class="anchor hidden-xs" href="#latency_002c-alatency" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-latency_002c-alatency" aria-hidden="true">TOC</a></span></h3>
  47468. <p>Measure filtering latency.
  47469. </p>
  47470. <p>Report previous filter filtering latency, delay in number of audio samples for audio filters
  47471. or number of video frames for video filters.
  47472. </p>
  47473. <p>On end of input stream, filter will report min and max measured latency for previous running filter
  47474. in filtergraph.
  47475. </p>
  47476. <a name="metadata_002c-ametadata"></a>
  47477. <h3 class="section">41.13 metadata, ametadata<span class="pull-right"><a class="anchor hidden-xs" href="#metadata_002c-ametadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-metadata_002c-ametadata" aria-hidden="true">TOC</a></span></h3>
  47478. <p>Manipulate frame metadata.
  47479. </p>
  47480. <p>This filter accepts the following options:
  47481. </p>
  47482. <dl class="table">
  47483. <dt><samp class="option">mode</samp></dt>
  47484. <dd><p>Set mode of operation of the filter.
  47485. </p>
  47486. <p>Can be one of the following:
  47487. </p>
  47488. <dl class="table">
  47489. <dt>&lsquo;<samp class="samp">select</samp>&rsquo;</dt>
  47490. <dd><p>If both <code class="code">value</code> and <code class="code">key</code> is set, select frames
  47491. which have such metadata. If only <code class="code">key</code> is set, select
  47492. every frame that has such key in metadata.
  47493. </p>
  47494. </dd>
  47495. <dt>&lsquo;<samp class="samp">add</samp>&rsquo;</dt>
  47496. <dd><p>Add new metadata <code class="code">key</code> and <code class="code">value</code>. If key is already available
  47497. do nothing.
  47498. </p>
  47499. </dd>
  47500. <dt>&lsquo;<samp class="samp">modify</samp>&rsquo;</dt>
  47501. <dd><p>Modify value of already present key.
  47502. </p>
  47503. </dd>
  47504. <dt>&lsquo;<samp class="samp">delete</samp>&rsquo;</dt>
  47505. <dd><p>If <code class="code">value</code> is set, delete only keys that have such value.
  47506. Otherwise, delete key. If <code class="code">key</code> is not set, delete all metadata values in
  47507. the frame.
  47508. </p>
  47509. </dd>
  47510. <dt>&lsquo;<samp class="samp">print</samp>&rsquo;</dt>
  47511. <dd><p>Print key and its value if metadata was found. If <code class="code">key</code> is not set print all
  47512. metadata values available in frame.
  47513. </p></dd>
  47514. </dl>
  47515. </dd>
  47516. <dt><samp class="option">key</samp></dt>
  47517. <dd><p>Set key used with all modes. Must be set for all modes except <code class="code">print</code> and <code class="code">delete</code>.
  47518. </p>
  47519. </dd>
  47520. <dt><samp class="option">value</samp></dt>
  47521. <dd><p>Set metadata value which will be used. This option is mandatory for
  47522. <code class="code">modify</code> and <code class="code">add</code> mode.
  47523. </p>
  47524. </dd>
  47525. <dt><samp class="option">function</samp></dt>
  47526. <dd><p>Which function to use when comparing metadata value and <code class="code">value</code>.
  47527. </p>
  47528. <p>Can be one of following:
  47529. </p>
  47530. <dl class="table">
  47531. <dt>&lsquo;<samp class="samp">same_str</samp>&rsquo;</dt>
  47532. <dd><p>Values are interpreted as strings, returns true if metadata value is same as <code class="code">value</code>.
  47533. </p>
  47534. </dd>
  47535. <dt>&lsquo;<samp class="samp">starts_with</samp>&rsquo;</dt>
  47536. <dd><p>Values are interpreted as strings, returns true if metadata value starts with
  47537. the <code class="code">value</code> option string.
  47538. </p>
  47539. </dd>
  47540. <dt>&lsquo;<samp class="samp">less</samp>&rsquo;</dt>
  47541. <dd><p>Values are interpreted as floats, returns true if metadata value is less than <code class="code">value</code>.
  47542. </p>
  47543. </dd>
  47544. <dt>&lsquo;<samp class="samp">equal</samp>&rsquo;</dt>
  47545. <dd><p>Values are interpreted as floats, returns true if <code class="code">value</code> is equal with metadata value.
  47546. </p>
  47547. </dd>
  47548. <dt>&lsquo;<samp class="samp">greater</samp>&rsquo;</dt>
  47549. <dd><p>Values are interpreted as floats, returns true if metadata value is greater than <code class="code">value</code>.
  47550. </p>
  47551. </dd>
  47552. <dt>&lsquo;<samp class="samp">expr</samp>&rsquo;</dt>
  47553. <dd><p>Values are interpreted as floats, returns true if expression from option <code class="code">expr</code>
  47554. evaluates to true.
  47555. </p>
  47556. </dd>
  47557. <dt>&lsquo;<samp class="samp">ends_with</samp>&rsquo;</dt>
  47558. <dd><p>Values are interpreted as strings, returns true if metadata value ends with
  47559. the <code class="code">value</code> option string.
  47560. </p></dd>
  47561. </dl>
  47562. </dd>
  47563. <dt><samp class="option">expr</samp></dt>
  47564. <dd><p>Set expression which is used when <code class="code">function</code> is set to <code class="code">expr</code>.
  47565. The expression is evaluated through the eval API and can contain the following
  47566. constants:
  47567. </p>
  47568. <dl class="table">
  47569. <dt><samp class="option">VALUE1, FRAMEVAL</samp></dt>
  47570. <dd><p>Float representation of <code class="code">value</code> from metadata key.
  47571. </p>
  47572. </dd>
  47573. <dt><samp class="option">VALUE2, USERVAL</samp></dt>
  47574. <dd><p>Float representation of <code class="code">value</code> as supplied by user in <code class="code">value</code> option.
  47575. </p></dd>
  47576. </dl>
  47577. </dd>
  47578. <dt><samp class="option">file</samp></dt>
  47579. <dd><p>If specified in <code class="code">print</code> mode, output is written to the named file. Instead of
  47580. plain filename any writable url can be specified. Filename &ldquo;-&rdquo; is a shorthand
  47581. for standard output. If <code class="code">file</code> option is not set, output is written to the log
  47582. with AV_LOG_INFO loglevel.
  47583. </p>
  47584. </dd>
  47585. <dt><samp class="option">direct</samp></dt>
  47586. <dd><p>Reduces buffering in print mode when output is written to a URL set using <var class="var">file</var>.
  47587. </p>
  47588. </dd>
  47589. </dl>
  47590. <a name="Examples-189"></a>
  47591. <h4 class="subsection">41.13.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-189" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-189" aria-hidden="true">TOC</a></span></h4>
  47592. <ul class="itemize mark-bullet">
  47593. <li>Print all metadata values for frames with key <code class="code">lavfi.signalstats.YDIF</code> with values
  47594. between 0 and 1.
  47595. <div class="example">
  47596. <pre class="example-preformatted">signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
  47597. </pre></div>
  47598. </li><li>Print silencedetect output to file <samp class="file">metadata.txt</samp>.
  47599. <div class="example">
  47600. <pre class="example-preformatted">silencedetect,ametadata=mode=print:file=metadata.txt
  47601. </pre></div>
  47602. </li><li>Direct all metadata to a pipe with file descriptor 4.
  47603. <div class="example">
  47604. <pre class="example-preformatted">metadata=mode=print:file='pipe\:4'
  47605. </pre></div>
  47606. </li></ul>
  47607. <a name="perms_002c-aperms"></a>
  47608. <h3 class="section">41.14 perms, aperms<span class="pull-right"><a class="anchor hidden-xs" href="#perms_002c-aperms" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-perms_002c-aperms" aria-hidden="true">TOC</a></span></h3>
  47609. <p>Set read/write permissions for the output frames.
  47610. </p>
  47611. <p>These filters are mainly aimed at developers to test direct path in the
  47612. following filter in the filtergraph.
  47613. </p>
  47614. <p>The filters accept the following options:
  47615. </p>
  47616. <dl class="table">
  47617. <dt><samp class="option">mode</samp></dt>
  47618. <dd><p>Select the permissions mode.
  47619. </p>
  47620. <p>It accepts the following values:
  47621. </p><dl class="table">
  47622. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  47623. <dd><p>Do nothing. This is the default.
  47624. </p></dd>
  47625. <dt>&lsquo;<samp class="samp">ro</samp>&rsquo;</dt>
  47626. <dd><p>Set all the output frames read-only.
  47627. </p></dd>
  47628. <dt>&lsquo;<samp class="samp">rw</samp>&rsquo;</dt>
  47629. <dd><p>Set all the output frames directly writable.
  47630. </p></dd>
  47631. <dt>&lsquo;<samp class="samp">toggle</samp>&rsquo;</dt>
  47632. <dd><p>Make the frame read-only if writable, and writable if read-only.
  47633. </p></dd>
  47634. <dt>&lsquo;<samp class="samp">random</samp>&rsquo;</dt>
  47635. <dd><p>Set each output frame read-only or writable randomly.
  47636. </p></dd>
  47637. </dl>
  47638. </dd>
  47639. <dt><samp class="option">seed</samp></dt>
  47640. <dd><p>Set the seed for the <var class="var">random</var> mode, must be an integer included between
  47641. <code class="code">0</code> and <code class="code">UINT32_MAX</code>. If not specified, or if explicitly set to
  47642. <code class="code">-1</code>, the filter will try to use a good random seed on a best effort
  47643. basis.
  47644. </p></dd>
  47645. </dl>
  47646. <p>Note: in case of auto-inserted filter between the permission filter and the
  47647. following one, the permission might not be received as expected in that
  47648. following filter. Inserting a <a class="ref" href="#format">format</a> or <a class="ref" href="#aformat">aformat</a> filter before the
  47649. perms/aperms filter can avoid this problem.
  47650. </p>
  47651. <a name="realtime_002c-arealtime"></a>
  47652. <h3 class="section">41.15 realtime, arealtime<span class="pull-right"><a class="anchor hidden-xs" href="#realtime_002c-arealtime" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-realtime_002c-arealtime" aria-hidden="true">TOC</a></span></h3>
  47653. <p>Slow down filtering to match real time approximately.
  47654. </p>
  47655. <p>These filters will pause the filtering for a variable amount of time to
  47656. match the output rate with the input timestamps.
  47657. They are similar to the <samp class="option">re</samp> option to <code class="code">ffmpeg</code>.
  47658. </p>
  47659. <p>They accept the following options:
  47660. </p>
  47661. <dl class="table">
  47662. <dt><samp class="option">limit</samp></dt>
  47663. <dd><p>Time limit for the pauses. Any pause longer than that will be considered
  47664. a timestamp discontinuity and reset the timer. Default is 2 seconds.
  47665. </p></dd>
  47666. <dt><samp class="option">speed</samp></dt>
  47667. <dd><p>Speed factor for processing. The value must be a float larger than zero.
  47668. Values larger than 1.0 will result in faster than realtime processing,
  47669. smaller will slow processing down. The <var class="var">limit</var> is automatically adapted
  47670. accordingly. Default is 1.0.
  47671. </p>
  47672. <p>A processing speed faster than what is possible without these filters cannot
  47673. be achieved.
  47674. </p></dd>
  47675. </dl>
  47676. <a name="Commands-162"></a>
  47677. <h4 class="subsection">41.15.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-162" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-162" aria-hidden="true">TOC</a></span></h4>
  47678. <p>Both filters supports the all above options as <a class="ref" href="#commands">commands</a>.
  47679. </p>
  47680. <a name="segment_002c-asegment"></a>
  47681. <h3 class="section">41.16 segment, asegment<span class="pull-right"><a class="anchor hidden-xs" href="#segment_002c-asegment" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-segment_002c-asegment" aria-hidden="true">TOC</a></span></h3>
  47682. <p>Split single input stream into multiple streams.
  47683. </p>
  47684. <p>This filter does opposite of concat filters.
  47685. </p>
  47686. <p><code class="code">segment</code> works on video frames, <code class="code">asegment</code> on audio samples.
  47687. </p>
  47688. <p>This filter accepts the following options:
  47689. </p>
  47690. <dl class="table">
  47691. <dt><samp class="option">timestamps</samp></dt>
  47692. <dd><p>Timestamps of output segments separated by &rsquo;|&rsquo;. The first segment will run
  47693. from the beginning of the input stream. The last segment will run until
  47694. the end of the input stream
  47695. </p>
  47696. </dd>
  47697. <dt><samp class="option">frames, samples</samp></dt>
  47698. <dd><p>Exact frame/sample count to split the segments.
  47699. </p></dd>
  47700. </dl>
  47701. <p>In all cases, prefixing an each segment with &rsquo;+&rsquo; will make it relative to the
  47702. previous segment.
  47703. </p>
  47704. <a name="Examples-190"></a>
  47705. <h4 class="subsection">41.16.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-190" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-190" aria-hidden="true">TOC</a></span></h4>
  47706. <ul class="itemize mark-bullet">
  47707. <li>Split input audio stream into three output audio streams, starting at start of input audio stream
  47708. and storing that in 1st output audio stream, then following at 60th second and storing than in 2nd
  47709. output audio stream, and last after 150th second of input audio stream store in 3rd output audio stream:
  47710. <div class="example">
  47711. <pre class="example-preformatted">asegment=timestamps=&quot;60|150&quot;
  47712. </pre></div>
  47713. </li></ul>
  47714. <a class="anchor" id="select"></a><a name="select_002c-aselect"></a>
  47715. <h3 class="section">41.17 select, aselect<span class="pull-right"><a class="anchor hidden-xs" href="#select_002c-aselect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-select_002c-aselect" aria-hidden="true">TOC</a></span></h3>
  47716. <p>Select frames to pass in output.
  47717. </p>
  47718. <p>This filter accepts the following options:
  47719. </p>
  47720. <dl class="table">
  47721. <dt><samp class="option">expr, e</samp></dt>
  47722. <dd><p>Set expression, which is evaluated for each input frame.
  47723. </p>
  47724. <p>If the expression is evaluated to zero, the frame is discarded.
  47725. </p>
  47726. <p>If the evaluation result is negative or NaN, the frame is sent to the
  47727. first output; otherwise it is sent to the output with index
  47728. <code class="code">ceil(val)-1</code>, assuming that the input index starts from 0.
  47729. </p>
  47730. <p>For example a value of <code class="code">1.2</code> corresponds to the output with index
  47731. <code class="code">ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
  47732. </p>
  47733. </dd>
  47734. <dt><samp class="option">outputs, n</samp></dt>
  47735. <dd><p>Set the number of outputs. The output to which to send the selected
  47736. frame is based on the result of the evaluation. Default value is 1.
  47737. </p></dd>
  47738. </dl>
  47739. <p>The expression can contain the following constants:
  47740. </p>
  47741. <dl class="table">
  47742. <dt><samp class="option">n</samp></dt>
  47743. <dd><p>The (sequential) number of the filtered frame, starting from 0.
  47744. </p>
  47745. </dd>
  47746. <dt><samp class="option">selected_n</samp></dt>
  47747. <dd><p>The (sequential) number of the selected frame, starting from 0.
  47748. </p>
  47749. </dd>
  47750. <dt><samp class="option">prev_selected_n</samp></dt>
  47751. <dd><p>The sequential number of the last selected frame. It&rsquo;s NAN if undefined.
  47752. </p>
  47753. </dd>
  47754. <dt><samp class="option">TB</samp></dt>
  47755. <dd><p>The timebase of the input timestamps.
  47756. </p>
  47757. </dd>
  47758. <dt><samp class="option">pts</samp></dt>
  47759. <dd><p>The PTS (Presentation TimeStamp) of the filtered frame,
  47760. expressed in <var class="var">TB</var> units. It&rsquo;s NAN if undefined.
  47761. </p>
  47762. </dd>
  47763. <dt><samp class="option">t</samp></dt>
  47764. <dd><p>The PTS of the filtered frame,
  47765. expressed in seconds. It&rsquo;s NAN if undefined.
  47766. </p>
  47767. </dd>
  47768. <dt><samp class="option">prev_pts</samp></dt>
  47769. <dd><p>The PTS of the previously filtered frame. It&rsquo;s NAN if undefined.
  47770. </p>
  47771. </dd>
  47772. <dt><samp class="option">prev_selected_pts</samp></dt>
  47773. <dd><p>The PTS of the last previously filtered frame. It&rsquo;s NAN if undefined.
  47774. </p>
  47775. </dd>
  47776. <dt><samp class="option">prev_selected_t</samp></dt>
  47777. <dd><p>The PTS of the last previously selected frame, expressed in seconds. It&rsquo;s NAN if undefined.
  47778. </p>
  47779. </dd>
  47780. <dt><samp class="option">start_pts</samp></dt>
  47781. <dd><p>The first PTS in the stream which is not NAN. It remains NAN if not found.
  47782. </p>
  47783. </dd>
  47784. <dt><samp class="option">start_t</samp></dt>
  47785. <dd><p>The first PTS, in seconds, in the stream which is not NAN. It remains NAN if not found.
  47786. </p>
  47787. </dd>
  47788. <dt><samp class="option">pict_type <em class="emph">(video only)</em></samp></dt>
  47789. <dd><p>The type of the filtered frame. It can assume one of the following
  47790. values:
  47791. </p><dl class="table">
  47792. <dt><samp class="option">I</samp></dt>
  47793. <dt><samp class="option">P</samp></dt>
  47794. <dt><samp class="option">B</samp></dt>
  47795. <dt><samp class="option">S</samp></dt>
  47796. <dt><samp class="option">SI</samp></dt>
  47797. <dt><samp class="option">SP</samp></dt>
  47798. <dt><samp class="option">BI</samp></dt>
  47799. </dl>
  47800. </dd>
  47801. <dt><samp class="option">interlace_type <em class="emph">(video only)</em></samp></dt>
  47802. <dd><p>The frame interlace type. It can assume one of the following values:
  47803. </p><dl class="table">
  47804. <dt><samp class="option">PROGRESSIVE</samp></dt>
  47805. <dd><p>The frame is progressive (not interlaced).
  47806. </p></dd>
  47807. <dt><samp class="option">TOPFIRST</samp></dt>
  47808. <dd><p>The frame is top-field-first.
  47809. </p></dd>
  47810. <dt><samp class="option">BOTTOMFIRST</samp></dt>
  47811. <dd><p>The frame is bottom-field-first.
  47812. </p></dd>
  47813. </dl>
  47814. </dd>
  47815. <dt><samp class="option">consumed_sample_n <em class="emph">(audio only)</em></samp></dt>
  47816. <dd><p>the number of selected samples before the current frame
  47817. </p>
  47818. </dd>
  47819. <dt><samp class="option">samples_n <em class="emph">(audio only)</em></samp></dt>
  47820. <dd><p>the number of samples in the current frame
  47821. </p>
  47822. </dd>
  47823. <dt><samp class="option">sample_rate <em class="emph">(audio only)</em></samp></dt>
  47824. <dd><p>the input sample rate
  47825. </p>
  47826. </dd>
  47827. <dt><samp class="option">key</samp></dt>
  47828. <dd><p>This is 1 if the filtered frame is a key-frame, 0 otherwise.
  47829. </p>
  47830. </dd>
  47831. <dt><samp class="option">pos</samp></dt>
  47832. <dd><p>the position in the file of the filtered frame, -1 if the information
  47833. is not available (e.g. for synthetic video); deprecated, do not use
  47834. </p>
  47835. </dd>
  47836. <dt><samp class="option">scene <em class="emph">(video only)</em></samp></dt>
  47837. <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
  47838. probability for the current frame to introduce a new scene, while a higher
  47839. value means the current frame is more likely to be one (see the example below)
  47840. </p>
  47841. </dd>
  47842. <dt><samp class="option">concatdec_select</samp></dt>
  47843. <dd><p>The concat demuxer can select only part of a concat input file by setting an
  47844. inpoint and an outpoint, but the output packets may not be entirely contained
  47845. in the selected interval. By using this variable, it is possible to skip frames
  47846. generated by the concat demuxer which are not exactly contained in the selected
  47847. interval.
  47848. </p>
  47849. <p>This works by comparing the frame pts against the <var class="var">lavf.concat.start_time</var>
  47850. and the <var class="var">lavf.concat.duration</var> packet metadata values which are also
  47851. present in the decoded frames.
  47852. </p>
  47853. <p>The <var class="var">concatdec_select</var> variable is -1 if the frame pts is at least
  47854. start_time and either the duration metadata is missing or the frame pts is less
  47855. than start_time + duration, 0 otherwise, and NaN if the start_time metadata is
  47856. missing.
  47857. </p>
  47858. <p>That basically means that an input frame is selected if its pts is within the
  47859. interval set by the concat demuxer.
  47860. </p>
  47861. </dd>
  47862. <dt><samp class="option">iw <em class="emph">(video only)</em></samp></dt>
  47863. <dd><p>Represents the width of the input video frame.
  47864. </p>
  47865. </dd>
  47866. <dt><samp class="option">ih <em class="emph">(video only)</em></samp></dt>
  47867. <dd><p>Represents the height of the input video frame.
  47868. </p>
  47869. </dd>
  47870. <dt><samp class="option">view <em class="emph">(video only)</em></samp></dt>
  47871. <dd><p>View ID for multi-view video.
  47872. </p>
  47873. </dd>
  47874. </dl>
  47875. <p>The default value of the select expression is &quot;1&quot;.
  47876. </p>
  47877. <a name="Examples-191"></a>
  47878. <h4 class="subsection">41.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-191" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-191" aria-hidden="true">TOC</a></span></h4>
  47879. <ul class="itemize mark-bullet">
  47880. <li>Select all frames in input:
  47881. <div class="example">
  47882. <pre class="example-preformatted">select
  47883. </pre></div>
  47884. <p>The example above is the same as:
  47885. </p><div class="example">
  47886. <pre class="example-preformatted">select=1
  47887. </pre></div>
  47888. </li><li>Skip all frames:
  47889. <div class="example">
  47890. <pre class="example-preformatted">select=0
  47891. </pre></div>
  47892. </li><li>Select only I-frames:
  47893. <div class="example">
  47894. <pre class="example-preformatted">select='eq(pict_type\,I)'
  47895. </pre></div>
  47896. </li><li>Select one frame every 100:
  47897. <div class="example">
  47898. <pre class="example-preformatted">select='not(mod(n\,100))'
  47899. </pre></div>
  47900. </li><li>Select only frames contained in the 10-20 time interval:
  47901. <div class="example">
  47902. <pre class="example-preformatted">select=between(t\,10\,20)
  47903. </pre></div>
  47904. </li><li>Select only I-frames contained in the 10-20 time interval:
  47905. <div class="example">
  47906. <pre class="example-preformatted">select=between(t\,10\,20)*eq(pict_type\,I)
  47907. </pre></div>
  47908. </li><li>Select frames with a minimum distance of 10 seconds:
  47909. <div class="example">
  47910. <pre class="example-preformatted">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
  47911. </pre></div>
  47912. </li><li>Use aselect to select only audio frames with samples number &gt; 100:
  47913. <div class="example">
  47914. <pre class="example-preformatted">aselect='gt(samples_n\,100)'
  47915. </pre></div>
  47916. </li><li>Create a mosaic of the first scenes:
  47917. <div class="example">
  47918. <pre class="example-preformatted">ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
  47919. </pre></div>
  47920. <p>Comparing <var class="var">scene</var> against a value between 0.3 and 0.5 is generally a sane
  47921. choice.
  47922. </p>
  47923. </li><li>Send even and odd frames to separate outputs, and compose them:
  47924. <div class="example">
  47925. <pre class="example-preformatted">select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
  47926. </pre></div>
  47927. </li><li>Select useful frames from an ffconcat file which is using inpoints and
  47928. outpoints but where the source files are not intra frame only.
  47929. <div class="example">
  47930. <pre class="example-preformatted">ffmpeg -copyts -vsync 0 -segment_time_metadata 1 -i input.ffconcat -vf select=concatdec_select -af aselect=concatdec_select output.avi
  47931. </pre></div>
  47932. </li></ul>
  47933. <a name="sendcmd_002c-asendcmd"></a>
  47934. <h3 class="section">41.18 sendcmd, asendcmd<span class="pull-right"><a class="anchor hidden-xs" href="#sendcmd_002c-asendcmd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sendcmd_002c-asendcmd" aria-hidden="true">TOC</a></span></h3>
  47935. <p>Send commands to filters in the filtergraph.
  47936. </p>
  47937. <p>These filters read commands to be sent to other filters in the
  47938. filtergraph.
  47939. </p>
  47940. <p><code class="code">sendcmd</code> must be inserted between two video filters,
  47941. <code class="code">asendcmd</code> must be inserted between two audio filters, but apart
  47942. from that they act the same way.
  47943. </p>
  47944. <p>The specification of commands can be provided in the filter arguments
  47945. with the <var class="var">commands</var> option, or in a file specified by the
  47946. <var class="var">filename</var> option.
  47947. </p>
  47948. <p>These filters accept the following options:
  47949. </p><dl class="table">
  47950. <dt><samp class="option">commands, c</samp></dt>
  47951. <dd><p>Set the commands to be read and sent to the other filters.
  47952. </p></dd>
  47953. <dt><samp class="option">filename, f</samp></dt>
  47954. <dd><p>Set the filename of the commands to be read and sent to the other
  47955. filters.
  47956. </p></dd>
  47957. </dl>
  47958. <a name="Commands-syntax"></a>
  47959. <h4 class="subsection">41.18.1 Commands syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-syntax" aria-hidden="true">TOC</a></span></h4>
  47960. <p>A commands description consists of a sequence of interval
  47961. specifications, comprising a list of commands to be executed when a
  47962. particular event related to that interval occurs. The occurring event
  47963. is typically the current frame time entering or leaving a given time
  47964. interval.
  47965. </p>
  47966. <p>An interval is specified by the following syntax:
  47967. </p><div class="example">
  47968. <pre class="example-preformatted"><var class="var">START</var>[-<var class="var">END</var>] <var class="var">COMMANDS</var>;
  47969. </pre></div>
  47970. <p>The time interval is specified by the <var class="var">START</var> and <var class="var">END</var> times.
  47971. <var class="var">END</var> is optional and defaults to the maximum time.
  47972. </p>
  47973. <p>The current frame time is considered within the specified interval if
  47974. it is included in the interval [<var class="var">START</var>, <var class="var">END</var>), that is when
  47975. the time is greater or equal to <var class="var">START</var> and is lesser than
  47976. <var class="var">END</var>.
  47977. </p>
  47978. <p><var class="var">COMMANDS</var> consists of a sequence of one or more command
  47979. specifications, separated by &quot;,&quot;, relating to that interval. The
  47980. syntax of a command specification is given by:
  47981. </p><div class="example">
  47982. <pre class="example-preformatted">[<var class="var">FLAGS</var>] <var class="var">TARGET</var> <var class="var">COMMAND</var> <var class="var">ARG</var>
  47983. </pre></div>
  47984. <p><var class="var">FLAGS</var> is optional and specifies the type of events relating to
  47985. the time interval which enable sending the specified command, and must
  47986. be a non-null sequence of identifier flags separated by &quot;+&quot; or &quot;|&quot; and
  47987. enclosed between &quot;[&quot; and &quot;]&quot;.
  47988. </p>
  47989. <p>The following flags are recognized:
  47990. </p><dl class="table">
  47991. <dt><samp class="option">enter</samp></dt>
  47992. <dd><p>The command is sent when the current frame timestamp enters the
  47993. specified interval. In other words, the command is sent when the
  47994. previous frame timestamp was not in the given interval, and the
  47995. current is.
  47996. </p>
  47997. </dd>
  47998. <dt><samp class="option">leave</samp></dt>
  47999. <dd><p>The command is sent when the current frame timestamp leaves the
  48000. specified interval. In other words, the command is sent when the
  48001. previous frame timestamp was in the given interval, and the
  48002. current is not.
  48003. </p>
  48004. </dd>
  48005. <dt><samp class="option">expr</samp></dt>
  48006. <dd><p>The command <var class="var">ARG</var> is interpreted as expression and result of
  48007. expression is passed as <var class="var">ARG</var>.
  48008. </p>
  48009. <p>The expression is evaluated through the eval API and can contain the following
  48010. constants:
  48011. </p>
  48012. <dl class="table">
  48013. <dt><samp class="option">POS</samp></dt>
  48014. <dd><p>Original position in the file of the frame, or undefined if undefined
  48015. for the current frame. Deprecated, do not use.
  48016. </p>
  48017. </dd>
  48018. <dt><samp class="option">PTS</samp></dt>
  48019. <dd><p>The presentation timestamp in input.
  48020. </p>
  48021. </dd>
  48022. <dt><samp class="option">N</samp></dt>
  48023. <dd><p>The count of the input frame for video or audio, starting from 0.
  48024. </p>
  48025. </dd>
  48026. <dt><samp class="option">T</samp></dt>
  48027. <dd><p>The time in seconds of the current frame.
  48028. </p>
  48029. </dd>
  48030. <dt><samp class="option">TS</samp></dt>
  48031. <dd><p>The start time in seconds of the current command interval.
  48032. </p>
  48033. </dd>
  48034. <dt><samp class="option">TE</samp></dt>
  48035. <dd><p>The end time in seconds of the current command interval.
  48036. </p>
  48037. </dd>
  48038. <dt><samp class="option">TI</samp></dt>
  48039. <dd><p>The interpolated time of the current command interval, TI = (T - TS) / (TE - TS).
  48040. </p>
  48041. </dd>
  48042. <dt><samp class="option">W</samp></dt>
  48043. <dd><p>The video frame width.
  48044. </p>
  48045. </dd>
  48046. <dt><samp class="option">H</samp></dt>
  48047. <dd><p>The video frame height.
  48048. </p></dd>
  48049. </dl>
  48050. </dd>
  48051. </dl>
  48052. <p>If <var class="var">FLAGS</var> is not specified, a default value of <code class="code">[enter]</code> is
  48053. assumed.
  48054. </p>
  48055. <p><var class="var">TARGET</var> specifies the target of the command, usually the name of
  48056. the filter class or a specific filter instance name.
  48057. </p>
  48058. <p><var class="var">COMMAND</var> specifies the name of the command for the target filter.
  48059. </p>
  48060. <p><var class="var">ARG</var> is optional and specifies the optional list of argument for
  48061. the given <var class="var">COMMAND</var>.
  48062. </p>
  48063. <p>Between one interval specification and another, whitespaces, or
  48064. sequences of characters starting with <code class="code">#</code> until the end of line,
  48065. are ignored and can be used to annotate comments.
  48066. </p>
  48067. <p>A simplified BNF description of the commands specification syntax
  48068. follows:
  48069. </p><div class="example">
  48070. <pre class="example-preformatted"><var class="var">COMMAND_FLAG</var> ::= &quot;enter&quot; | &quot;leave&quot;
  48071. <var class="var">COMMAND_FLAGS</var> ::= <var class="var">COMMAND_FLAG</var> [(+|&quot;|&quot;)<var class="var">COMMAND_FLAG</var>]
  48072. <var class="var">COMMAND</var> ::= [&quot;[&quot; <var class="var">COMMAND_FLAGS</var> &quot;]&quot;] <var class="var">TARGET</var> <var class="var">COMMAND</var> [<var class="var">ARG</var>]
  48073. <var class="var">COMMANDS</var> ::= <var class="var">COMMAND</var> [,<var class="var">COMMANDS</var>]
  48074. <var class="var">INTERVAL</var> ::= <var class="var">START</var>[-<var class="var">END</var>] <var class="var">COMMANDS</var>
  48075. <var class="var">INTERVALS</var> ::= <var class="var">INTERVAL</var>[;<var class="var">INTERVALS</var>]
  48076. </pre></div>
  48077. <a name="Examples-192"></a>
  48078. <h4 class="subsection">41.18.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-192" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-192" aria-hidden="true">TOC</a></span></h4>
  48079. <ul class="itemize mark-bullet">
  48080. <li>Specify audio tempo change at second 4:
  48081. <div class="example">
  48082. <pre class="example-preformatted">asendcmd=c='4.0 atempo tempo 1.5',atempo
  48083. </pre></div>
  48084. </li><li>Target a specific filter instance:
  48085. <div class="example">
  48086. <pre class="example-preformatted">asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
  48087. </pre></div>
  48088. </li><li>Specify a list of drawtext and hue commands in a file.
  48089. <div class="example">
  48090. <pre class="example-preformatted"># show text in the interval 5-10
  48091. 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
  48092. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
  48093. # desaturate the image in the interval 15-20
  48094. 15.0-20.0 [enter] hue s 0,
  48095. [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
  48096. [leave] hue s 1,
  48097. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
  48098. # apply an exponential saturation fade-out effect, starting from time 25
  48099. 25 [enter] hue s exp(25-t)
  48100. </pre></div>
  48101. <p>A filtergraph allowing to read and process the above command list
  48102. stored in a file <samp class="file">test.cmd</samp>, can be specified with:
  48103. </p><div class="example">
  48104. <pre class="example-preformatted">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
  48105. </pre></div>
  48106. </li></ul>
  48107. <a class="anchor" id="setpts"></a><a name="setpts_002c-asetpts"></a>
  48108. <h3 class="section">41.19 setpts, asetpts<span class="pull-right"><a class="anchor hidden-xs" href="#setpts_002c-asetpts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setpts_002c-asetpts" aria-hidden="true">TOC</a></span></h3>
  48109. <p>Change the PTS (presentation timestamp) of the input frames.
  48110. </p>
  48111. <p><code class="code">setpts</code> works on video frames, <code class="code">asetpts</code> on audio frames.
  48112. </p>
  48113. <p>This filter accepts the following options:
  48114. </p>
  48115. <dl class="table">
  48116. <dt><samp class="option">expr</samp></dt>
  48117. <dd><p>The expression which is evaluated for each frame to construct its timestamp.
  48118. </p>
  48119. </dd>
  48120. <dt><samp class="option">strip_fps (<em class="emph">video only</em>)</samp></dt>
  48121. <dd><p>Boolean option which determines if the original framerate and frame duration
  48122. metadata is unset. If set to true, be advised that a sane frame rate should be
  48123. explicitly specified if output is sent to a constant frame rate muxer.
  48124. Default is <code class="code">false</code>.
  48125. </p>
  48126. </dd>
  48127. </dl>
  48128. <p>The expression is evaluated through the eval API and can contain the following
  48129. constants:
  48130. </p>
  48131. <dl class="table">
  48132. <dt><samp class="option">FRAME_RATE, FR</samp></dt>
  48133. <dd><p>frame rate, only defined for constant frame-rate video
  48134. </p>
  48135. </dd>
  48136. <dt><samp class="option">PTS</samp></dt>
  48137. <dd><p>The presentation timestamp in input
  48138. </p>
  48139. </dd>
  48140. <dt><samp class="option">N</samp></dt>
  48141. <dd><p>The count of the input frame for video or the number of consumed samples,
  48142. not including the current frame for audio, starting from 0.
  48143. </p>
  48144. </dd>
  48145. <dt><samp class="option">NB_CONSUMED_SAMPLES</samp></dt>
  48146. <dd><p>The number of consumed samples, not including the current frame (only
  48147. audio)
  48148. </p>
  48149. </dd>
  48150. <dt><samp class="option">NB_SAMPLES, S</samp></dt>
  48151. <dd><p>The number of samples in the current frame (only audio)
  48152. </p>
  48153. </dd>
  48154. <dt><samp class="option">SAMPLE_RATE, SR</samp></dt>
  48155. <dd><p>The audio sample rate.
  48156. </p>
  48157. </dd>
  48158. <dt><samp class="option">STARTPTS</samp></dt>
  48159. <dd><p>The PTS of the first frame.
  48160. </p>
  48161. </dd>
  48162. <dt><samp class="option">STARTT</samp></dt>
  48163. <dd><p>the time in seconds of the first frame
  48164. </p>
  48165. </dd>
  48166. <dt><samp class="option">INTERLACED</samp></dt>
  48167. <dd><p>State whether the current frame is interlaced.
  48168. </p>
  48169. </dd>
  48170. <dt><samp class="option">T</samp></dt>
  48171. <dd><p>the time in seconds of the current frame
  48172. </p>
  48173. </dd>
  48174. <dt><samp class="option">POS</samp></dt>
  48175. <dd><p>original position in the file of the frame, or undefined if undefined
  48176. for the current frame; deprecated, do not use
  48177. </p>
  48178. </dd>
  48179. <dt><samp class="option">PREV_INPTS</samp></dt>
  48180. <dd><p>The previous input PTS.
  48181. </p>
  48182. </dd>
  48183. <dt><samp class="option">PREV_INT</samp></dt>
  48184. <dd><p>previous input time in seconds
  48185. </p>
  48186. </dd>
  48187. <dt><samp class="option">PREV_OUTPTS</samp></dt>
  48188. <dd><p>The previous output PTS.
  48189. </p>
  48190. </dd>
  48191. <dt><samp class="option">PREV_OUTT</samp></dt>
  48192. <dd><p>previous output time in seconds
  48193. </p>
  48194. </dd>
  48195. <dt><samp class="option">RTCTIME</samp></dt>
  48196. <dd><p>The wallclock (RTC) time in microseconds. This is deprecated, use time(0)
  48197. instead.
  48198. </p>
  48199. </dd>
  48200. <dt><samp class="option">RTCSTART</samp></dt>
  48201. <dd><p>The wallclock (RTC) time at the start of the movie in microseconds.
  48202. </p>
  48203. </dd>
  48204. <dt><samp class="option">TB</samp></dt>
  48205. <dd><p>The timebase of the input timestamps.
  48206. </p>
  48207. </dd>
  48208. <dt><samp class="option">T_CHANGE</samp></dt>
  48209. <dd><p>Time of the first frame after command was applied or time of the first frame if no commands.
  48210. </p>
  48211. </dd>
  48212. </dl>
  48213. <a name="Examples-193"></a>
  48214. <h4 class="subsection">41.19.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-193" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-193" aria-hidden="true">TOC</a></span></h4>
  48215. <ul class="itemize mark-bullet">
  48216. <li>Start counting PTS from zero
  48217. <div class="example">
  48218. <pre class="example-preformatted">setpts=PTS-STARTPTS
  48219. </pre></div>
  48220. </li><li>Apply fast motion effect:
  48221. <div class="example">
  48222. <pre class="example-preformatted">setpts=0.5*PTS
  48223. </pre></div>
  48224. </li><li>Apply slow motion effect:
  48225. <div class="example">
  48226. <pre class="example-preformatted">setpts=2.0*PTS
  48227. </pre></div>
  48228. </li><li>Set fixed rate of 25 frames per second:
  48229. <div class="example">
  48230. <pre class="example-preformatted">setpts=N/(25*TB)
  48231. </pre></div>
  48232. </li><li>Apply a random jitter effect of +/-100 TB units:
  48233. <div class="example">
  48234. <pre class="example-preformatted">setpts=PTS+randomi(0, -100\,100)
  48235. </pre></div>
  48236. </li><li>Set fixed rate 25 fps with some jitter:
  48237. <div class="example">
  48238. <pre class="example-preformatted">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
  48239. </pre></div>
  48240. </li><li>Apply an offset of 10 seconds to the input PTS:
  48241. <div class="example">
  48242. <pre class="example-preformatted">setpts=PTS+10/TB
  48243. </pre></div>
  48244. </li><li>Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
  48245. <div class="example">
  48246. <pre class="example-preformatted">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
  48247. </pre></div>
  48248. </li><li>Generate timestamps by counting samples:
  48249. <div class="example">
  48250. <pre class="example-preformatted">asetpts=N/SR/TB
  48251. </pre></div>
  48252. </li></ul>
  48253. <a name="Commands-163"></a>
  48254. <h4 class="subsection">41.19.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-163" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-163" aria-hidden="true">TOC</a></span></h4>
  48255. <p>Both filters support all above options as <a class="ref" href="#commands">commands</a>.
  48256. </p>
  48257. <a name="setrange"></a>
  48258. <h3 class="section">41.20 setrange<span class="pull-right"><a class="anchor hidden-xs" href="#setrange" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setrange" aria-hidden="true">TOC</a></span></h3>
  48259. <p>Force color range for the output video frame.
  48260. </p>
  48261. <p>The <code class="code">setrange</code> filter marks the color range property for the
  48262. output frames. It does not change the input frame, but only sets the
  48263. corresponding property, which affects how the frame is treated by
  48264. following filters.
  48265. </p>
  48266. <p>The filter accepts the following options:
  48267. </p>
  48268. <dl class="table">
  48269. <dt><samp class="option">range</samp></dt>
  48270. <dd><p>Available values are:
  48271. </p>
  48272. <dl class="table">
  48273. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  48274. <dd><p>Keep the same color range property.
  48275. </p>
  48276. </dd>
  48277. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  48278. <dd><p>Set the color range as unspecified.
  48279. </p>
  48280. </dd>
  48281. <dt>&lsquo;<samp class="samp">limited, tv, mpeg</samp>&rsquo;</dt>
  48282. <dd><p>Set the color range as limited.
  48283. </p>
  48284. </dd>
  48285. <dt>&lsquo;<samp class="samp">full, pc, jpeg</samp>&rsquo;</dt>
  48286. <dd><p>Set the color range as full.
  48287. </p></dd>
  48288. </dl>
  48289. </dd>
  48290. </dl>
  48291. <a name="settb_002c-asettb"></a>
  48292. <h3 class="section">41.21 settb, asettb<span class="pull-right"><a class="anchor hidden-xs" href="#settb_002c-asettb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-settb_002c-asettb" aria-hidden="true">TOC</a></span></h3>
  48293. <p>Set the timebase to use for the output frames timestamps.
  48294. It is mainly useful for testing timebase configuration.
  48295. </p>
  48296. <p>It accepts the following parameters:
  48297. </p>
  48298. <dl class="table">
  48299. <dt><samp class="option">expr, tb</samp></dt>
  48300. <dd><p>The expression which is evaluated into the output timebase.
  48301. </p>
  48302. </dd>
  48303. </dl>
  48304. <p>The value for <samp class="option">tb</samp> is an arithmetic expression representing a
  48305. rational. The expression can contain the constants &quot;AVTB&quot; (the default
  48306. timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
  48307. audio only). Default value is &quot;intb&quot;.
  48308. </p>
  48309. <a name="Examples-194"></a>
  48310. <h4 class="subsection">41.21.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-194" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-194" aria-hidden="true">TOC</a></span></h4>
  48311. <ul class="itemize mark-bullet">
  48312. <li>Set the timebase to 1/25:
  48313. <div class="example">
  48314. <pre class="example-preformatted">settb=expr=1/25
  48315. </pre></div>
  48316. </li><li>Set the timebase to 1/10:
  48317. <div class="example">
  48318. <pre class="example-preformatted">settb=expr=0.1
  48319. </pre></div>
  48320. </li><li>Set the timebase to 1001/1000:
  48321. <div class="example">
  48322. <pre class="example-preformatted">settb=1+0.001
  48323. </pre></div>
  48324. </li><li>Set the timebase to 2*intb:
  48325. <div class="example">
  48326. <pre class="example-preformatted">settb=2*intb
  48327. </pre></div>
  48328. </li><li>Set the default timebase value:
  48329. <div class="example">
  48330. <pre class="example-preformatted">settb=AVTB
  48331. </pre></div>
  48332. </li></ul>
  48333. <a name="showcqt"></a>
  48334. <h3 class="section">41.22 showcqt<span class="pull-right"><a class="anchor hidden-xs" href="#showcqt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showcqt" aria-hidden="true">TOC</a></span></h3>
  48335. <p>Convert input audio to a video output representing frequency spectrum
  48336. logarithmically using Brown-Puckette constant Q transform algorithm with
  48337. direct frequency domain coefficient calculation (but the transform itself
  48338. is not really constant Q, instead the Q factor is actually variable/clamped),
  48339. with musical tone scale, from E0 to D#10.
  48340. </p>
  48341. <p>The filter accepts the following options:
  48342. </p>
  48343. <dl class="table">
  48344. <dt><samp class="option">size, s</samp></dt>
  48345. <dd><p>Specify the video size for the output. It must be even. For the syntax of this option,
  48346. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  48347. Default value is <code class="code">1920x1080</code>.
  48348. </p>
  48349. </dd>
  48350. <dt><samp class="option">fps, rate, r</samp></dt>
  48351. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  48352. </p>
  48353. </dd>
  48354. <dt><samp class="option">bar_h</samp></dt>
  48355. <dd><p>Set the bargraph height. It must be even. Default value is <code class="code">-1</code> which
  48356. computes the bargraph height automatically.
  48357. </p>
  48358. </dd>
  48359. <dt><samp class="option">axis_h</samp></dt>
  48360. <dd><p>Set the axis height. It must be even. Default value is <code class="code">-1</code> which computes
  48361. the axis height automatically.
  48362. </p>
  48363. </dd>
  48364. <dt><samp class="option">sono_h</samp></dt>
  48365. <dd><p>Set the sonogram height. It must be even. Default value is <code class="code">-1</code> which
  48366. computes the sonogram height automatically.
  48367. </p>
  48368. </dd>
  48369. <dt><samp class="option">fullhd</samp></dt>
  48370. <dd><p>Set the fullhd resolution. This option is deprecated, use <var class="var">size</var>, <var class="var">s</var>
  48371. instead. Default value is <code class="code">1</code>.
  48372. </p>
  48373. </dd>
  48374. <dt><samp class="option">sono_v, volume</samp></dt>
  48375. <dd><p>Specify the sonogram volume expression. It can contain variables:
  48376. </p><dl class="table">
  48377. <dt><samp class="option">bar_v</samp></dt>
  48378. <dd><p>the <var class="var">bar_v</var> evaluated expression
  48379. </p></dd>
  48380. <dt><samp class="option">frequency, freq, f</samp></dt>
  48381. <dd><p>the frequency where it is evaluated
  48382. </p></dd>
  48383. <dt><samp class="option">timeclamp, tc</samp></dt>
  48384. <dd><p>the value of <var class="var">timeclamp</var> option
  48385. </p></dd>
  48386. </dl>
  48387. <p>and functions:
  48388. </p><dl class="table">
  48389. <dt><samp class="option">a_weighting(f)</samp></dt>
  48390. <dd><p>A-weighting of equal loudness
  48391. </p></dd>
  48392. <dt><samp class="option">b_weighting(f)</samp></dt>
  48393. <dd><p>B-weighting of equal loudness
  48394. </p></dd>
  48395. <dt><samp class="option">c_weighting(f)</samp></dt>
  48396. <dd><p>C-weighting of equal loudness.
  48397. </p></dd>
  48398. </dl>
  48399. <p>Default value is <code class="code">16</code>.
  48400. </p>
  48401. </dd>
  48402. <dt><samp class="option">bar_v, volume2</samp></dt>
  48403. <dd><p>Specify the bargraph volume expression. It can contain variables:
  48404. </p><dl class="table">
  48405. <dt><samp class="option">sono_v</samp></dt>
  48406. <dd><p>the <var class="var">sono_v</var> evaluated expression
  48407. </p></dd>
  48408. <dt><samp class="option">frequency, freq, f</samp></dt>
  48409. <dd><p>the frequency where it is evaluated
  48410. </p></dd>
  48411. <dt><samp class="option">timeclamp, tc</samp></dt>
  48412. <dd><p>the value of <var class="var">timeclamp</var> option
  48413. </p></dd>
  48414. </dl>
  48415. <p>and functions:
  48416. </p><dl class="table">
  48417. <dt><samp class="option">a_weighting(f)</samp></dt>
  48418. <dd><p>A-weighting of equal loudness
  48419. </p></dd>
  48420. <dt><samp class="option">b_weighting(f)</samp></dt>
  48421. <dd><p>B-weighting of equal loudness
  48422. </p></dd>
  48423. <dt><samp class="option">c_weighting(f)</samp></dt>
  48424. <dd><p>C-weighting of equal loudness.
  48425. </p></dd>
  48426. </dl>
  48427. <p>Default value is <code class="code">sono_v</code>.
  48428. </p>
  48429. </dd>
  48430. <dt><samp class="option">sono_g, gamma</samp></dt>
  48431. <dd><p>Specify the sonogram gamma. Lower gamma makes the spectrum more contrast,
  48432. higher gamma makes the spectrum having more range. Default value is <code class="code">3</code>.
  48433. Acceptable range is <code class="code">[1, 7]</code>.
  48434. </p>
  48435. </dd>
  48436. <dt><samp class="option">bar_g, gamma2</samp></dt>
  48437. <dd><p>Specify the bargraph gamma. Default value is <code class="code">1</code>. Acceptable range is
  48438. <code class="code">[1, 7]</code>.
  48439. </p>
  48440. </dd>
  48441. <dt><samp class="option">bar_t</samp></dt>
  48442. <dd><p>Specify the bargraph transparency level. Lower value makes the bargraph sharper.
  48443. Default value is <code class="code">1</code>. Acceptable range is <code class="code">[0, 1]</code>.
  48444. </p>
  48445. </dd>
  48446. <dt><samp class="option">timeclamp, tc</samp></dt>
  48447. <dd><p>Specify the transform timeclamp. At low frequency, there is trade-off between
  48448. accuracy in time domain and frequency domain. If timeclamp is lower,
  48449. event in time domain is represented more accurately (such as fast bass drum),
  48450. otherwise event in frequency domain is represented more accurately
  48451. (such as bass guitar). Acceptable range is <code class="code">[0.002, 1]</code>. Default value is <code class="code">0.17</code>.
  48452. </p>
  48453. </dd>
  48454. <dt><samp class="option">attack</samp></dt>
  48455. <dd><p>Set attack time in seconds. The default is <code class="code">0</code> (disabled). Otherwise, it
  48456. limits future samples by applying asymmetric windowing in time domain, useful
  48457. when low latency is required. Accepted range is <code class="code">[0, 1]</code>.
  48458. </p>
  48459. </dd>
  48460. <dt><samp class="option">basefreq</samp></dt>
  48461. <dd><p>Specify the transform base frequency. Default value is <code class="code">20.01523126408007475</code>,
  48462. which is frequency 50 cents below E0. Acceptable range is <code class="code">[10, 100000]</code>.
  48463. </p>
  48464. </dd>
  48465. <dt><samp class="option">endfreq</samp></dt>
  48466. <dd><p>Specify the transform end frequency. Default value is <code class="code">20495.59681441799654</code>,
  48467. which is frequency 50 cents above D#10. Acceptable range is <code class="code">[10, 100000]</code>.
  48468. </p>
  48469. </dd>
  48470. <dt><samp class="option">coeffclamp</samp></dt>
  48471. <dd><p>This option is deprecated and ignored.
  48472. </p>
  48473. </dd>
  48474. <dt><samp class="option">tlength</samp></dt>
  48475. <dd><p>Specify the transform length in time domain. Use this option to control accuracy
  48476. trade-off between time domain and frequency domain at every frequency sample.
  48477. It can contain variables:
  48478. </p><dl class="table">
  48479. <dt><samp class="option">frequency, freq, f</samp></dt>
  48480. <dd><p>the frequency where it is evaluated
  48481. </p></dd>
  48482. <dt><samp class="option">timeclamp, tc</samp></dt>
  48483. <dd><p>the value of <var class="var">timeclamp</var> option.
  48484. </p></dd>
  48485. </dl>
  48486. <p>Default value is <code class="code">384*tc/(384+tc*f)</code>.
  48487. </p>
  48488. </dd>
  48489. <dt><samp class="option">count</samp></dt>
  48490. <dd><p>Specify the transform count for every video frame. Default value is <code class="code">6</code>.
  48491. Acceptable range is <code class="code">[1, 30]</code>.
  48492. </p>
  48493. </dd>
  48494. <dt><samp class="option">fcount</samp></dt>
  48495. <dd><p>Specify the transform count for every single pixel. Default value is <code class="code">0</code>,
  48496. which makes it computed automatically. Acceptable range is <code class="code">[0, 10]</code>.
  48497. </p>
  48498. </dd>
  48499. <dt><samp class="option">fontfile</samp></dt>
  48500. <dd><p>Specify font file for use with freetype to draw the axis. If not specified,
  48501. use embedded font. Note that drawing with font file or embedded font is not
  48502. implemented with custom <var class="var">basefreq</var> and <var class="var">endfreq</var>, use <var class="var">axisfile</var>
  48503. option instead.
  48504. </p>
  48505. </dd>
  48506. <dt><samp class="option">font</samp></dt>
  48507. <dd><p>Specify fontconfig pattern. This has lower priority than <var class="var">fontfile</var>. The
  48508. <code class="code">:</code> in the pattern may be replaced by <code class="code">|</code> to avoid unnecessary
  48509. escaping.
  48510. </p>
  48511. </dd>
  48512. <dt><samp class="option">fontcolor</samp></dt>
  48513. <dd><p>Specify font color expression. This is arithmetic expression that should return
  48514. integer value 0xRRGGBB. It can contain variables:
  48515. </p><dl class="table">
  48516. <dt><samp class="option">frequency, freq, f</samp></dt>
  48517. <dd><p>the frequency where it is evaluated
  48518. </p></dd>
  48519. <dt><samp class="option">timeclamp, tc</samp></dt>
  48520. <dd><p>the value of <var class="var">timeclamp</var> option
  48521. </p></dd>
  48522. </dl>
  48523. <p>and functions:
  48524. </p><dl class="table">
  48525. <dt><samp class="option">midi(f)</samp></dt>
  48526. <dd><p>midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
  48527. </p></dd>
  48528. <dt><samp class="option">r(x), g(x), b(x)</samp></dt>
  48529. <dd><p>red, green, and blue value of intensity x.
  48530. </p></dd>
  48531. </dl>
  48532. <p>Default value is <code class="code">st(0, (midi(f)-59.5)/12);
  48533. st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));
  48534. r(1-ld(1)) + b(ld(1))</code>.
  48535. </p>
  48536. </dd>
  48537. <dt><samp class="option">axisfile</samp></dt>
  48538. <dd><p>Specify image file to draw the axis. This option override <var class="var">fontfile</var> and
  48539. <var class="var">fontcolor</var> option.
  48540. </p>
  48541. </dd>
  48542. <dt><samp class="option">axis, text</samp></dt>
  48543. <dd><p>Enable/disable drawing text to the axis. If it is set to <code class="code">0</code>, drawing to
  48544. the axis is disabled, ignoring <var class="var">fontfile</var> and <var class="var">axisfile</var> option.
  48545. Default value is <code class="code">1</code>.
  48546. </p>
  48547. </dd>
  48548. <dt><samp class="option">csp</samp></dt>
  48549. <dd><p>Set colorspace. The accepted values are:
  48550. </p><dl class="table">
  48551. <dt>&lsquo;<samp class="samp">unspecified</samp>&rsquo;</dt>
  48552. <dd><p>Unspecified (default)
  48553. </p>
  48554. </dd>
  48555. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  48556. <dd><p>BT.709
  48557. </p>
  48558. </dd>
  48559. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  48560. <dd><p>FCC
  48561. </p>
  48562. </dd>
  48563. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  48564. <dd><p>BT.470BG or BT.601-6 625
  48565. </p>
  48566. </dd>
  48567. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  48568. <dd><p>SMPTE-170M or BT.601-6 525
  48569. </p>
  48570. </dd>
  48571. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  48572. <dd><p>SMPTE-240M
  48573. </p>
  48574. </dd>
  48575. <dt>&lsquo;<samp class="samp">bt2020ncl</samp>&rsquo;</dt>
  48576. <dd><p>BT.2020 with non-constant luminance
  48577. </p>
  48578. </dd>
  48579. </dl>
  48580. </dd>
  48581. <dt><samp class="option">cscheme</samp></dt>
  48582. <dd><p>Set spectrogram color scheme. This is list of floating point values with format
  48583. <code class="code">left_r|left_g|left_b|right_r|right_g|right_b</code>.
  48584. The default is <code class="code">1|0.5|0|0|0.5|1</code>.
  48585. </p>
  48586. </dd>
  48587. </dl>
  48588. <a name="Examples-195"></a>
  48589. <h4 class="subsection">41.22.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-195" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-195" aria-hidden="true">TOC</a></span></h4>
  48590. <ul class="itemize mark-bullet">
  48591. <li>Playing audio while showing the spectrum:
  48592. <div class="example">
  48593. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
  48594. </pre></div>
  48595. </li><li>Same as above, but with frame rate 30 fps:
  48596. <div class="example">
  48597. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
  48598. </pre></div>
  48599. </li><li>Playing at 1280x720:
  48600. <div class="example">
  48601. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
  48602. </pre></div>
  48603. </li><li>Disable sonogram display:
  48604. <div class="example">
  48605. <pre class="example-preformatted">sono_h=0
  48606. </pre></div>
  48607. </li><li>A1 and its harmonics: A1, A2, (near)E3, A3:
  48608. <div class="example">
  48609. <pre class="example-preformatted">ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
  48610. asplit[a][out1]; [a] showcqt [out0]'
  48611. </pre></div>
  48612. </li><li>Same as above, but with more accuracy in frequency domain:
  48613. <div class="example">
  48614. <pre class="example-preformatted">ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
  48615. asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
  48616. </pre></div>
  48617. </li><li>Custom volume:
  48618. <div class="example">
  48619. <pre class="example-preformatted">bar_v=10:sono_v=bar_v*a_weighting(f)
  48620. </pre></div>
  48621. </li><li>Custom gamma, now spectrum is linear to the amplitude.
  48622. <div class="example">
  48623. <pre class="example-preformatted">bar_g=2:sono_g=2
  48624. </pre></div>
  48625. </li><li>Custom tlength equation:
  48626. <div class="example">
  48627. <pre class="example-preformatted">tc=0.33:tlength='st(0,0.17); 384*tc / (384 / ld(0) + tc*f /(1-ld(0))) + 384*tc / (tc*f / ld(0) + 384 /(1-ld(0)))'
  48628. </pre></div>
  48629. </li><li>Custom fontcolor and fontfile, C-note is colored green, others are colored blue:
  48630. <div class="example">
  48631. <pre class="example-preformatted">fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
  48632. </pre></div>
  48633. </li><li>Custom font using fontconfig:
  48634. <div class="example">
  48635. <pre class="example-preformatted">font='Courier New,Monospace,mono|bold'
  48636. </pre></div>
  48637. </li><li>Custom frequency range with custom axis using image file:
  48638. <div class="example">
  48639. <pre class="example-preformatted">axisfile=myaxis.png:basefreq=40:endfreq=10000
  48640. </pre></div>
  48641. </li></ul>
  48642. <a name="showcwt"></a>
  48643. <h3 class="section">41.23 showcwt<span class="pull-right"><a class="anchor hidden-xs" href="#showcwt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showcwt" aria-hidden="true">TOC</a></span></h3>
  48644. <p>Convert input audio to video output representing frequency spectrum
  48645. using Continuous Wavelet Transform and Morlet wavelet.
  48646. </p>
  48647. <p>The filter accepts the following options:
  48648. </p>
  48649. <dl class="table">
  48650. <dt><samp class="option">size, s</samp></dt>
  48651. <dd><p>Specify the video size for the output. For the syntax of this option,
  48652. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  48653. Default value is <code class="code">640x512</code>.
  48654. </p>
  48655. </dd>
  48656. <dt><samp class="option">rate, r</samp></dt>
  48657. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  48658. </p>
  48659. </dd>
  48660. <dt><samp class="option">scale</samp></dt>
  48661. <dd><p>Set the frequency scale used. Allowed values are:
  48662. </p>
  48663. <dl class="table">
  48664. <dt><samp class="option">linear</samp></dt>
  48665. <dt><samp class="option">log</samp></dt>
  48666. <dt><samp class="option">bark</samp></dt>
  48667. <dt><samp class="option">mel</samp></dt>
  48668. <dt><samp class="option">erbs</samp></dt>
  48669. <dt><samp class="option">sqrt</samp></dt>
  48670. <dt><samp class="option">cbrt</samp></dt>
  48671. <dt><samp class="option">qdrt</samp></dt>
  48672. <dt><samp class="option">fm</samp></dt>
  48673. </dl>
  48674. <p>Default value is <code class="code">linear</code>.
  48675. </p>
  48676. </dd>
  48677. <dt><samp class="option">iscale</samp></dt>
  48678. <dd><p>Set the intensity scale used. Allowed values are:
  48679. </p>
  48680. <dl class="table">
  48681. <dt><samp class="option">linear</samp></dt>
  48682. <dt><samp class="option">log</samp></dt>
  48683. <dt><samp class="option">sqrt</samp></dt>
  48684. <dt><samp class="option">cbrt</samp></dt>
  48685. <dt><samp class="option">qdrt</samp></dt>
  48686. </dl>
  48687. <p>Default value is <code class="code">log</code>.
  48688. </p>
  48689. </dd>
  48690. <dt><samp class="option">min</samp></dt>
  48691. <dd><p>Set the minimum frequency that will be used in output.
  48692. Default is <code class="code">20</code> Hz.
  48693. </p>
  48694. </dd>
  48695. <dt><samp class="option">max</samp></dt>
  48696. <dd><p>Set the maximum frequency that will be used in output.
  48697. Default is <code class="code">20000</code> Hz. The real frequency upper limit
  48698. depends on input audio&rsquo;s sample rate and such will be enforced
  48699. on this value when it is set to value greater than Nyquist frequency.
  48700. </p>
  48701. </dd>
  48702. <dt><samp class="option">imin</samp></dt>
  48703. <dd><p>Set the minimum intensity that will be used in output.
  48704. </p>
  48705. </dd>
  48706. <dt><samp class="option">imax</samp></dt>
  48707. <dd><p>Set the maximum intensity that will be used in output.
  48708. </p>
  48709. </dd>
  48710. <dt><samp class="option">logb</samp></dt>
  48711. <dd><p>Set the logarithmic basis for brightness strength when
  48712. mapping calculated magnitude values to pixel values.
  48713. Allowed range is from <code class="code">0</code> to <code class="code">1</code>.
  48714. Default value is <code class="code">0.0001</code>.
  48715. </p>
  48716. </dd>
  48717. <dt><samp class="option">deviation</samp></dt>
  48718. <dd><p>Set the frequency deviation.
  48719. Lower values than <code class="code">1</code> are more frequency oriented,
  48720. while higher values than <code class="code">1</code> are more time oriented.
  48721. Allowed range is from <code class="code">0</code> to <code class="code">10</code>.
  48722. Default value is <code class="code">1</code>.
  48723. </p>
  48724. </dd>
  48725. <dt><samp class="option">pps</samp></dt>
  48726. <dd><p>Set the number of pixel output per each second in one row.
  48727. Allowed range is from <code class="code">1</code> to <code class="code">1024</code>.
  48728. Default value is <code class="code">64</code>.
  48729. </p>
  48730. </dd>
  48731. <dt><samp class="option">mode</samp></dt>
  48732. <dd><p>Set the output visual mode. Allowed values are:
  48733. </p>
  48734. <dl class="table">
  48735. <dt><samp class="option">magnitude</samp></dt>
  48736. <dd><p>Show magnitude.
  48737. </p></dd>
  48738. <dt><samp class="option">phase</samp></dt>
  48739. <dd><p>Show only phase.
  48740. </p></dd>
  48741. <dt><samp class="option">magphase</samp></dt>
  48742. <dd><p>Show combination of magnitude and phase.
  48743. Magnitude is mapped to brightness and phase to color.
  48744. </p></dd>
  48745. <dt><samp class="option">channel</samp></dt>
  48746. <dd><p>Show unique color per channel magnitude.
  48747. </p></dd>
  48748. <dt><samp class="option">stereo</samp></dt>
  48749. <dd><p>Show unique color per stereo difference.
  48750. </p></dd>
  48751. </dl>
  48752. <p>Default value is <code class="code">magnitude</code>.
  48753. </p>
  48754. </dd>
  48755. <dt><samp class="option">slide</samp></dt>
  48756. <dd><p>Set the output slide method. Allowed values are:
  48757. </p>
  48758. <dl class="table">
  48759. <dt><samp class="option">replace</samp></dt>
  48760. <dt><samp class="option">scroll</samp></dt>
  48761. <dt><samp class="option">frame</samp></dt>
  48762. </dl>
  48763. </dd>
  48764. <dt><samp class="option">direction</samp></dt>
  48765. <dd><p>Set the direction method for output slide method. Allowed values are:
  48766. </p>
  48767. <dl class="table">
  48768. <dt><samp class="option">lr</samp></dt>
  48769. <dd><p>Direction from left to right.
  48770. </p></dd>
  48771. <dt><samp class="option">rl</samp></dt>
  48772. <dd><p>Direction from right to left.
  48773. </p></dd>
  48774. <dt><samp class="option">ud</samp></dt>
  48775. <dd><p>Direction from up to down.
  48776. </p></dd>
  48777. <dt><samp class="option">du</samp></dt>
  48778. <dd><p>Direction from down to up.
  48779. </p></dd>
  48780. </dl>
  48781. </dd>
  48782. <dt><samp class="option">bar</samp></dt>
  48783. <dd><p>Set the ratio of bargraph display to display size. Default is 0.
  48784. </p>
  48785. </dd>
  48786. <dt><samp class="option">rotation</samp></dt>
  48787. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  48788. Default value is <code class="code">0</code>.
  48789. </p></dd>
  48790. </dl>
  48791. <a name="showfreqs"></a>
  48792. <h3 class="section">41.24 showfreqs<span class="pull-right"><a class="anchor hidden-xs" href="#showfreqs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showfreqs" aria-hidden="true">TOC</a></span></h3>
  48793. <p>Convert input audio to video output representing the audio power spectrum.
  48794. Audio amplitude is on Y-axis while frequency is on X-axis.
  48795. </p>
  48796. <p>The filter accepts the following options:
  48797. </p>
  48798. <dl class="table">
  48799. <dt><samp class="option">size, s</samp></dt>
  48800. <dd><p>Specify size of video. For the syntax of this option, check the
  48801. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  48802. Default is <code class="code">1024x512</code>.
  48803. </p>
  48804. </dd>
  48805. <dt><samp class="option">rate, r</samp></dt>
  48806. <dd><p>Set video rate. Default is <code class="code">25</code>.
  48807. </p>
  48808. </dd>
  48809. <dt><samp class="option">mode</samp></dt>
  48810. <dd><p>Set display mode.
  48811. This set how each frequency bin will be represented.
  48812. </p>
  48813. <p>It accepts the following values:
  48814. </p><dl class="table">
  48815. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  48816. <dt>&lsquo;<samp class="samp">bar</samp>&rsquo;</dt>
  48817. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  48818. </dl>
  48819. <p>Default is <code class="code">bar</code>.
  48820. </p>
  48821. </dd>
  48822. <dt><samp class="option">ascale</samp></dt>
  48823. <dd><p>Set amplitude scale.
  48824. </p>
  48825. <p>It accepts the following values:
  48826. </p><dl class="table">
  48827. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  48828. <dd><p>Linear scale.
  48829. </p>
  48830. </dd>
  48831. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  48832. <dd><p>Square root scale.
  48833. </p>
  48834. </dd>
  48835. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  48836. <dd><p>Cubic root scale.
  48837. </p>
  48838. </dd>
  48839. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  48840. <dd><p>Logarithmic scale.
  48841. </p></dd>
  48842. </dl>
  48843. <p>Default is <code class="code">log</code>.
  48844. </p>
  48845. </dd>
  48846. <dt><samp class="option">fscale</samp></dt>
  48847. <dd><p>Set frequency scale.
  48848. </p>
  48849. <p>It accepts the following values:
  48850. </p><dl class="table">
  48851. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  48852. <dd><p>Linear scale.
  48853. </p>
  48854. </dd>
  48855. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  48856. <dd><p>Logarithmic scale.
  48857. </p>
  48858. </dd>
  48859. <dt>&lsquo;<samp class="samp">rlog</samp>&rsquo;</dt>
  48860. <dd><p>Reverse logarithmic scale.
  48861. </p></dd>
  48862. </dl>
  48863. <p>Default is <code class="code">lin</code>.
  48864. </p>
  48865. </dd>
  48866. <dt><samp class="option">win_size</samp></dt>
  48867. <dd><p>Set window size. Allowed range is from 16 to 65536.
  48868. </p>
  48869. <p>Default is <code class="code">2048</code>
  48870. </p>
  48871. </dd>
  48872. <dt><samp class="option">win_func</samp></dt>
  48873. <dd><p>Set windowing function.
  48874. </p>
  48875. <p>It accepts the following values:
  48876. </p><dl class="table">
  48877. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  48878. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  48879. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  48880. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  48881. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  48882. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  48883. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  48884. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  48885. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  48886. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  48887. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  48888. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  48889. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  48890. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  48891. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  48892. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  48893. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  48894. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  48895. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  48896. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  48897. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  48898. </dl>
  48899. <p>Default is <code class="code">hanning</code>.
  48900. </p>
  48901. </dd>
  48902. <dt><samp class="option">overlap</samp></dt>
  48903. <dd><p>Set window overlap. In range <code class="code">[0, 1]</code>. Default is <code class="code">1</code>,
  48904. which means optimal overlap for selected window function will be picked.
  48905. </p>
  48906. </dd>
  48907. <dt><samp class="option">averaging</samp></dt>
  48908. <dd><p>Set time averaging. Setting this to 0 will display current maximal peaks.
  48909. Default is <code class="code">1</code>, which means time averaging is disabled.
  48910. </p>
  48911. </dd>
  48912. <dt><samp class="option">colors</samp></dt>
  48913. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  48914. draw channel frequencies. Unrecognized or missing colors will be replaced
  48915. by white color.
  48916. </p>
  48917. </dd>
  48918. <dt><samp class="option">cmode</samp></dt>
  48919. <dd><p>Set channel display mode.
  48920. </p>
  48921. <p>It accepts the following values:
  48922. </p><dl class="table">
  48923. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  48924. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  48925. </dl>
  48926. <p>Default is <code class="code">combined</code>.
  48927. </p>
  48928. </dd>
  48929. <dt><samp class="option">minamp</samp></dt>
  48930. <dd><p>Set minimum amplitude used in <code class="code">log</code> amplitude scaler.
  48931. </p>
  48932. </dd>
  48933. <dt><samp class="option">data</samp></dt>
  48934. <dd><p>Set data display mode.
  48935. </p>
  48936. <p>It accepts the following values:
  48937. </p><dl class="table">
  48938. <dt>&lsquo;<samp class="samp">magnitude</samp>&rsquo;</dt>
  48939. <dt>&lsquo;<samp class="samp">phase</samp>&rsquo;</dt>
  48940. <dt>&lsquo;<samp class="samp">delay</samp>&rsquo;</dt>
  48941. </dl>
  48942. <p>Default is <code class="code">magnitude</code>.
  48943. </p>
  48944. </dd>
  48945. <dt><samp class="option">channels</samp></dt>
  48946. <dd><p>Set channels to use when processing audio. By default all are processed.
  48947. </p></dd>
  48948. </dl>
  48949. <a name="showspatial"></a>
  48950. <h3 class="section">41.25 showspatial<span class="pull-right"><a class="anchor hidden-xs" href="#showspatial" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showspatial" aria-hidden="true">TOC</a></span></h3>
  48951. <p>Convert stereo input audio to a video output, representing the spatial relationship
  48952. between two channels.
  48953. </p>
  48954. <p>The filter accepts the following options:
  48955. </p>
  48956. <dl class="table">
  48957. <dt><samp class="option">size, s</samp></dt>
  48958. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  48959. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  48960. Default value is <code class="code">512x512</code>.
  48961. </p>
  48962. </dd>
  48963. <dt><samp class="option">win_size</samp></dt>
  48964. <dd><p>Set window size. Allowed range is from <var class="var">1024</var> to <var class="var">65536</var>. Default size is <var class="var">4096</var>.
  48965. </p>
  48966. </dd>
  48967. <dt><samp class="option">win_func</samp></dt>
  48968. <dd><p>Set window function.
  48969. </p>
  48970. <p>It accepts the following values:
  48971. </p><dl class="table">
  48972. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  48973. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  48974. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  48975. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  48976. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  48977. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  48978. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  48979. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  48980. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  48981. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  48982. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  48983. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  48984. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  48985. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  48986. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  48987. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  48988. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  48989. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  48990. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  48991. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  48992. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  48993. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  48994. </dl>
  48995. <p>Default value is <code class="code">hann</code>.
  48996. </p>
  48997. </dd>
  48998. <dt><samp class="option">rate, r</samp></dt>
  48999. <dd><p>Set output framerate.
  49000. </p></dd>
  49001. </dl>
  49002. <a class="anchor" id="showspectrum"></a><a name="showspectrum-1"></a>
  49003. <h3 class="section">41.26 showspectrum<span class="pull-right"><a class="anchor hidden-xs" href="#showspectrum-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showspectrum-1" aria-hidden="true">TOC</a></span></h3>
  49004. <p>Convert input audio to a video output, representing the audio frequency
  49005. spectrum.
  49006. </p>
  49007. <p>The filter accepts the following options:
  49008. </p>
  49009. <dl class="table">
  49010. <dt><samp class="option">size, s</samp></dt>
  49011. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  49012. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  49013. Default value is <code class="code">640x512</code>.
  49014. </p>
  49015. </dd>
  49016. <dt><samp class="option">slide</samp></dt>
  49017. <dd><p>Specify how the spectrum should slide along the window.
  49018. </p>
  49019. <p>It accepts the following values:
  49020. </p><dl class="table">
  49021. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  49022. <dd><p>the samples start again on the left when they reach the right
  49023. </p></dd>
  49024. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  49025. <dd><p>the samples scroll from right to left
  49026. </p></dd>
  49027. <dt>&lsquo;<samp class="samp">fullframe</samp>&rsquo;</dt>
  49028. <dd><p>frames are only produced when the samples reach the right
  49029. </p></dd>
  49030. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  49031. <dd><p>the samples scroll from left to right
  49032. </p></dd>
  49033. <dt>&lsquo;<samp class="samp">lreplace</samp>&rsquo;</dt>
  49034. <dd><p>the samples start again on the right when they reach the left
  49035. </p></dd>
  49036. </dl>
  49037. <p>Default value is <code class="code">replace</code>.
  49038. </p>
  49039. </dd>
  49040. <dt><samp class="option">mode</samp></dt>
  49041. <dd><p>Specify display mode.
  49042. </p>
  49043. <p>It accepts the following values:
  49044. </p><dl class="table">
  49045. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  49046. <dd><p>all channels are displayed in the same row
  49047. </p></dd>
  49048. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  49049. <dd><p>all channels are displayed in separate rows
  49050. </p></dd>
  49051. </dl>
  49052. <p>Default value is &lsquo;<samp class="samp">combined</samp>&rsquo;.
  49053. </p>
  49054. </dd>
  49055. <dt><samp class="option">color</samp></dt>
  49056. <dd><p>Specify display color mode.
  49057. </p>
  49058. <p>It accepts the following values:
  49059. </p><dl class="table">
  49060. <dt>&lsquo;<samp class="samp">channel</samp>&rsquo;</dt>
  49061. <dd><p>each channel is displayed in a separate color
  49062. </p></dd>
  49063. <dt>&lsquo;<samp class="samp">intensity</samp>&rsquo;</dt>
  49064. <dd><p>each channel is displayed using the same color scheme
  49065. </p></dd>
  49066. <dt>&lsquo;<samp class="samp">rainbow</samp>&rsquo;</dt>
  49067. <dd><p>each channel is displayed using the rainbow color scheme
  49068. </p></dd>
  49069. <dt>&lsquo;<samp class="samp">moreland</samp>&rsquo;</dt>
  49070. <dd><p>each channel is displayed using the moreland color scheme
  49071. </p></dd>
  49072. <dt>&lsquo;<samp class="samp">nebulae</samp>&rsquo;</dt>
  49073. <dd><p>each channel is displayed using the nebulae color scheme
  49074. </p></dd>
  49075. <dt>&lsquo;<samp class="samp">fire</samp>&rsquo;</dt>
  49076. <dd><p>each channel is displayed using the fire color scheme
  49077. </p></dd>
  49078. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  49079. <dd><p>each channel is displayed using the fiery color scheme
  49080. </p></dd>
  49081. <dt>&lsquo;<samp class="samp">fruit</samp>&rsquo;</dt>
  49082. <dd><p>each channel is displayed using the fruit color scheme
  49083. </p></dd>
  49084. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  49085. <dd><p>each channel is displayed using the cool color scheme
  49086. </p></dd>
  49087. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  49088. <dd><p>each channel is displayed using the magma color scheme
  49089. </p></dd>
  49090. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  49091. <dd><p>each channel is displayed using the green color scheme
  49092. </p></dd>
  49093. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  49094. <dd><p>each channel is displayed using the viridis color scheme
  49095. </p></dd>
  49096. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  49097. <dd><p>each channel is displayed using the plasma color scheme
  49098. </p></dd>
  49099. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  49100. <dd><p>each channel is displayed using the cividis color scheme
  49101. </p></dd>
  49102. <dt>&lsquo;<samp class="samp">terrain</samp>&rsquo;</dt>
  49103. <dd><p>each channel is displayed using the terrain color scheme
  49104. </p></dd>
  49105. </dl>
  49106. <p>Default value is &lsquo;<samp class="samp">channel</samp>&rsquo;.
  49107. </p>
  49108. </dd>
  49109. <dt><samp class="option">scale</samp></dt>
  49110. <dd><p>Specify scale used for calculating intensity color values.
  49111. </p>
  49112. <p>It accepts the following values:
  49113. </p><dl class="table">
  49114. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  49115. <dd><p>linear
  49116. </p></dd>
  49117. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  49118. <dd><p>square root, default
  49119. </p></dd>
  49120. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  49121. <dd><p>cubic root
  49122. </p></dd>
  49123. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  49124. <dd><p>logarithmic
  49125. </p></dd>
  49126. <dt>&lsquo;<samp class="samp">4thrt</samp>&rsquo;</dt>
  49127. <dd><p>4th root
  49128. </p></dd>
  49129. <dt>&lsquo;<samp class="samp">5thrt</samp>&rsquo;</dt>
  49130. <dd><p>5th root
  49131. </p></dd>
  49132. </dl>
  49133. <p>Default value is &lsquo;<samp class="samp">sqrt</samp>&rsquo;.
  49134. </p>
  49135. </dd>
  49136. <dt><samp class="option">fscale</samp></dt>
  49137. <dd><p>Specify frequency scale.
  49138. </p>
  49139. <p>It accepts the following values:
  49140. </p><dl class="table">
  49141. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  49142. <dd><p>linear
  49143. </p></dd>
  49144. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  49145. <dd><p>logarithmic
  49146. </p></dd>
  49147. </dl>
  49148. <p>Default value is &lsquo;<samp class="samp">lin</samp>&rsquo;.
  49149. </p>
  49150. </dd>
  49151. <dt><samp class="option">saturation</samp></dt>
  49152. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  49153. alternative color scheme. <code class="code">0</code> is no saturation at all.
  49154. Saturation must be in [-10.0, 10.0] range.
  49155. Default value is <code class="code">1</code>.
  49156. </p>
  49157. </dd>
  49158. <dt><samp class="option">win_func</samp></dt>
  49159. <dd><p>Set window function.
  49160. </p>
  49161. <p>It accepts the following values:
  49162. </p><dl class="table">
  49163. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  49164. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  49165. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  49166. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  49167. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  49168. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  49169. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  49170. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  49171. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  49172. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  49173. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  49174. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  49175. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  49176. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  49177. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  49178. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  49179. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  49180. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  49181. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  49182. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  49183. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  49184. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  49185. </dl>
  49186. <p>Default value is <code class="code">hann</code>.
  49187. </p>
  49188. </dd>
  49189. <dt><samp class="option">orientation</samp></dt>
  49190. <dd><p>Set orientation of time vs frequency axis. Can be <code class="code">vertical</code> or
  49191. <code class="code">horizontal</code>. Default is <code class="code">vertical</code>.
  49192. </p>
  49193. </dd>
  49194. <dt><samp class="option">overlap</samp></dt>
  49195. <dd><p>Set ratio of overlap window. Default value is <code class="code">0</code>.
  49196. When value is <code class="code">1</code> overlap is set to recommended size for specific
  49197. window function currently used.
  49198. </p>
  49199. </dd>
  49200. <dt><samp class="option">gain</samp></dt>
  49201. <dd><p>Set scale gain for calculating intensity color values.
  49202. Default value is <code class="code">1</code>.
  49203. </p>
  49204. </dd>
  49205. <dt><samp class="option">data</samp></dt>
  49206. <dd><p>Set which data to display. Can be <code class="code">magnitude</code>, default or <code class="code">phase</code>,
  49207. or unwrapped phase: <code class="code">uphase</code>.
  49208. </p>
  49209. </dd>
  49210. <dt><samp class="option">rotation</samp></dt>
  49211. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  49212. Default value is <code class="code">0</code>.
  49213. </p>
  49214. </dd>
  49215. <dt><samp class="option">start</samp></dt>
  49216. <dd><p>Set start frequency from which to display spectrogram. Default is <code class="code">0</code>.
  49217. </p>
  49218. </dd>
  49219. <dt><samp class="option">stop</samp></dt>
  49220. <dd><p>Set stop frequency to which to display spectrogram. Default is <code class="code">0</code>.
  49221. </p>
  49222. </dd>
  49223. <dt><samp class="option">fps</samp></dt>
  49224. <dd><p>Set upper frame rate limit. Default is <code class="code">auto</code>, unlimited.
  49225. </p>
  49226. </dd>
  49227. <dt><samp class="option">legend</samp></dt>
  49228. <dd><p>Draw time and frequency axes and legends. Default is disabled.
  49229. </p>
  49230. </dd>
  49231. <dt><samp class="option">drange</samp></dt>
  49232. <dd><p>Set dynamic range used to calculate intensity color values. Default is 120 dBFS.
  49233. Allowed range is from 10 to 200.
  49234. </p>
  49235. </dd>
  49236. <dt><samp class="option">limit</samp></dt>
  49237. <dd><p>Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS.
  49238. Allowed range is from -100 to 100.
  49239. </p>
  49240. </dd>
  49241. <dt><samp class="option">opacity</samp></dt>
  49242. <dd><p>Set opacity strength when using pixel format output with alpha component.
  49243. </p></dd>
  49244. </dl>
  49245. <p>The usage is very similar to the showwaves filter; see the examples in that
  49246. section.
  49247. </p>
  49248. <a name="Examples-196"></a>
  49249. <h4 class="subsection">41.26.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-196" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-196" aria-hidden="true">TOC</a></span></h4>
  49250. <ul class="itemize mark-bullet">
  49251. <li>Large window with logarithmic color scaling:
  49252. <div class="example">
  49253. <pre class="example-preformatted">showspectrum=s=1280x480:scale=log
  49254. </pre></div>
  49255. </li><li>Complete example for a colored and sliding spectrum per channel using <code class="command">ffplay</code>:
  49256. <div class="example">
  49257. <pre class="example-preformatted">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  49258. [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
  49259. </pre></div>
  49260. </li></ul>
  49261. <a name="showspectrumpic"></a>
  49262. <h3 class="section">41.27 showspectrumpic<span class="pull-right"><a class="anchor hidden-xs" href="#showspectrumpic" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showspectrumpic" aria-hidden="true">TOC</a></span></h3>
  49263. <p>Convert input audio to a single video frame, representing the audio frequency
  49264. spectrum.
  49265. </p>
  49266. <p>The filter accepts the following options:
  49267. </p>
  49268. <dl class="table">
  49269. <dt><samp class="option">size, s</samp></dt>
  49270. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  49271. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  49272. Default value is <code class="code">4096x2048</code>.
  49273. </p>
  49274. </dd>
  49275. <dt><samp class="option">mode</samp></dt>
  49276. <dd><p>Specify display mode.
  49277. </p>
  49278. <p>It accepts the following values:
  49279. </p><dl class="table">
  49280. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  49281. <dd><p>all channels are displayed in the same row
  49282. </p></dd>
  49283. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  49284. <dd><p>all channels are displayed in separate rows
  49285. </p></dd>
  49286. </dl>
  49287. <p>Default value is &lsquo;<samp class="samp">combined</samp>&rsquo;.
  49288. </p>
  49289. </dd>
  49290. <dt><samp class="option">color</samp></dt>
  49291. <dd><p>Specify display color mode.
  49292. </p>
  49293. <p>It accepts the following values:
  49294. </p><dl class="table">
  49295. <dt>&lsquo;<samp class="samp">channel</samp>&rsquo;</dt>
  49296. <dd><p>each channel is displayed in a separate color
  49297. </p></dd>
  49298. <dt>&lsquo;<samp class="samp">intensity</samp>&rsquo;</dt>
  49299. <dd><p>each channel is displayed using the same color scheme
  49300. </p></dd>
  49301. <dt>&lsquo;<samp class="samp">rainbow</samp>&rsquo;</dt>
  49302. <dd><p>each channel is displayed using the rainbow color scheme
  49303. </p></dd>
  49304. <dt>&lsquo;<samp class="samp">moreland</samp>&rsquo;</dt>
  49305. <dd><p>each channel is displayed using the moreland color scheme
  49306. </p></dd>
  49307. <dt>&lsquo;<samp class="samp">nebulae</samp>&rsquo;</dt>
  49308. <dd><p>each channel is displayed using the nebulae color scheme
  49309. </p></dd>
  49310. <dt>&lsquo;<samp class="samp">fire</samp>&rsquo;</dt>
  49311. <dd><p>each channel is displayed using the fire color scheme
  49312. </p></dd>
  49313. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  49314. <dd><p>each channel is displayed using the fiery color scheme
  49315. </p></dd>
  49316. <dt>&lsquo;<samp class="samp">fruit</samp>&rsquo;</dt>
  49317. <dd><p>each channel is displayed using the fruit color scheme
  49318. </p></dd>
  49319. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  49320. <dd><p>each channel is displayed using the cool color scheme
  49321. </p></dd>
  49322. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  49323. <dd><p>each channel is displayed using the magma color scheme
  49324. </p></dd>
  49325. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  49326. <dd><p>each channel is displayed using the green color scheme
  49327. </p></dd>
  49328. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  49329. <dd><p>each channel is displayed using the viridis color scheme
  49330. </p></dd>
  49331. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  49332. <dd><p>each channel is displayed using the plasma color scheme
  49333. </p></dd>
  49334. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  49335. <dd><p>each channel is displayed using the cividis color scheme
  49336. </p></dd>
  49337. <dt>&lsquo;<samp class="samp">terrain</samp>&rsquo;</dt>
  49338. <dd><p>each channel is displayed using the terrain color scheme
  49339. </p></dd>
  49340. </dl>
  49341. <p>Default value is &lsquo;<samp class="samp">intensity</samp>&rsquo;.
  49342. </p>
  49343. </dd>
  49344. <dt><samp class="option">scale</samp></dt>
  49345. <dd><p>Specify scale used for calculating intensity color values.
  49346. </p>
  49347. <p>It accepts the following values:
  49348. </p><dl class="table">
  49349. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  49350. <dd><p>linear
  49351. </p></dd>
  49352. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  49353. <dd><p>square root, default
  49354. </p></dd>
  49355. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  49356. <dd><p>cubic root
  49357. </p></dd>
  49358. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  49359. <dd><p>logarithmic
  49360. </p></dd>
  49361. <dt>&lsquo;<samp class="samp">4thrt</samp>&rsquo;</dt>
  49362. <dd><p>4th root
  49363. </p></dd>
  49364. <dt>&lsquo;<samp class="samp">5thrt</samp>&rsquo;</dt>
  49365. <dd><p>5th root
  49366. </p></dd>
  49367. </dl>
  49368. <p>Default value is &lsquo;<samp class="samp">log</samp>&rsquo;.
  49369. </p>
  49370. </dd>
  49371. <dt><samp class="option">fscale</samp></dt>
  49372. <dd><p>Specify frequency scale.
  49373. </p>
  49374. <p>It accepts the following values:
  49375. </p><dl class="table">
  49376. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  49377. <dd><p>linear
  49378. </p></dd>
  49379. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  49380. <dd><p>logarithmic
  49381. </p></dd>
  49382. </dl>
  49383. <p>Default value is &lsquo;<samp class="samp">lin</samp>&rsquo;.
  49384. </p>
  49385. </dd>
  49386. <dt><samp class="option">saturation</samp></dt>
  49387. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  49388. alternative color scheme. <code class="code">0</code> is no saturation at all.
  49389. Saturation must be in [-10.0, 10.0] range.
  49390. Default value is <code class="code">1</code>.
  49391. </p>
  49392. </dd>
  49393. <dt><samp class="option">win_func</samp></dt>
  49394. <dd><p>Set window function.
  49395. </p>
  49396. <p>It accepts the following values:
  49397. </p><dl class="table">
  49398. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  49399. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  49400. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  49401. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  49402. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  49403. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  49404. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  49405. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  49406. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  49407. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  49408. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  49409. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  49410. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  49411. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  49412. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  49413. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  49414. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  49415. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  49416. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  49417. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  49418. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  49419. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  49420. </dl>
  49421. <p>Default value is <code class="code">hann</code>.
  49422. </p>
  49423. </dd>
  49424. <dt><samp class="option">orientation</samp></dt>
  49425. <dd><p>Set orientation of time vs frequency axis. Can be <code class="code">vertical</code> or
  49426. <code class="code">horizontal</code>. Default is <code class="code">vertical</code>.
  49427. </p>
  49428. </dd>
  49429. <dt><samp class="option">gain</samp></dt>
  49430. <dd><p>Set scale gain for calculating intensity color values.
  49431. Default value is <code class="code">1</code>.
  49432. </p>
  49433. </dd>
  49434. <dt><samp class="option">legend</samp></dt>
  49435. <dd><p>Draw time and frequency axes and legends. Default is enabled.
  49436. </p>
  49437. </dd>
  49438. <dt><samp class="option">rotation</samp></dt>
  49439. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  49440. Default value is <code class="code">0</code>.
  49441. </p>
  49442. </dd>
  49443. <dt><samp class="option">start</samp></dt>
  49444. <dd><p>Set start frequency from which to display spectrogram. Default is <code class="code">0</code>.
  49445. </p>
  49446. </dd>
  49447. <dt><samp class="option">stop</samp></dt>
  49448. <dd><p>Set stop frequency to which to display spectrogram. Default is <code class="code">0</code>.
  49449. </p>
  49450. </dd>
  49451. <dt><samp class="option">drange</samp></dt>
  49452. <dd><p>Set dynamic range used to calculate intensity color values. Default is 120 dBFS.
  49453. Allowed range is from 10 to 200.
  49454. </p>
  49455. </dd>
  49456. <dt><samp class="option">limit</samp></dt>
  49457. <dd><p>Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS.
  49458. Allowed range is from -100 to 100.
  49459. </p>
  49460. </dd>
  49461. <dt><samp class="option">opacity</samp></dt>
  49462. <dd><p>Set opacity strength when using pixel format output with alpha component.
  49463. </p></dd>
  49464. </dl>
  49465. <a name="Examples-197"></a>
  49466. <h4 class="subsection">41.27.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-197" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-197" aria-hidden="true">TOC</a></span></h4>
  49467. <ul class="itemize mark-bullet">
  49468. <li>Extract an audio spectrogram of a whole audio track
  49469. in a 1024x1024 picture using <code class="command">ffmpeg</code>:
  49470. <div class="example">
  49471. <pre class="example-preformatted">ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
  49472. </pre></div>
  49473. </li></ul>
  49474. <a name="showvolume"></a>
  49475. <h3 class="section">41.28 showvolume<span class="pull-right"><a class="anchor hidden-xs" href="#showvolume" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showvolume" aria-hidden="true">TOC</a></span></h3>
  49476. <p>Convert input audio volume to a video output.
  49477. </p>
  49478. <p>The filter accepts the following options:
  49479. </p>
  49480. <dl class="table">
  49481. <dt><samp class="option">rate, r</samp></dt>
  49482. <dd><p>Set video rate.
  49483. </p>
  49484. </dd>
  49485. <dt><samp class="option">b</samp></dt>
  49486. <dd><p>Set border width, allowed range is [0, 5]. Default is 1.
  49487. </p>
  49488. </dd>
  49489. <dt><samp class="option">w</samp></dt>
  49490. <dd><p>Set channel width, allowed range is [80, 8192]. Default is 400.
  49491. </p>
  49492. </dd>
  49493. <dt><samp class="option">h</samp></dt>
  49494. <dd><p>Set channel height, allowed range is [1, 900]. Default is 20.
  49495. </p>
  49496. </dd>
  49497. <dt><samp class="option">f</samp></dt>
  49498. <dd><p>Set fade, allowed range is [0, 1]. Default is 0.95.
  49499. </p>
  49500. </dd>
  49501. <dt><samp class="option">c</samp></dt>
  49502. <dd><p>Set volume color expression.
  49503. </p>
  49504. <p>The expression can use the following variables:
  49505. </p>
  49506. <dl class="table">
  49507. <dt><samp class="option">VOLUME</samp></dt>
  49508. <dd><p>Current max volume of channel in dB.
  49509. </p>
  49510. </dd>
  49511. <dt><samp class="option">PEAK</samp></dt>
  49512. <dd><p>Current peak.
  49513. </p>
  49514. </dd>
  49515. <dt><samp class="option">CHANNEL</samp></dt>
  49516. <dd><p>Current channel number, starting from 0.
  49517. </p></dd>
  49518. </dl>
  49519. </dd>
  49520. <dt><samp class="option">t</samp></dt>
  49521. <dd><p>If set, displays channel names. Default is enabled.
  49522. </p>
  49523. </dd>
  49524. <dt><samp class="option">v</samp></dt>
  49525. <dd><p>If set, displays volume values. Default is enabled.
  49526. </p>
  49527. </dd>
  49528. <dt><samp class="option">o</samp></dt>
  49529. <dd><p>Set orientation, can be horizontal: <code class="code">h</code> or vertical: <code class="code">v</code>,
  49530. default is <code class="code">h</code>.
  49531. </p>
  49532. </dd>
  49533. <dt><samp class="option">s</samp></dt>
  49534. <dd><p>Set step size, allowed range is [0, 5]. Default is 0, which means
  49535. step is disabled.
  49536. </p>
  49537. </dd>
  49538. <dt><samp class="option">p</samp></dt>
  49539. <dd><p>Set background opacity, allowed range is [0, 1]. Default is 0.
  49540. </p>
  49541. </dd>
  49542. <dt><samp class="option">m</samp></dt>
  49543. <dd><p>Set metering mode, can be peak: <code class="code">p</code> or rms: <code class="code">r</code>,
  49544. default is <code class="code">p</code>.
  49545. </p>
  49546. </dd>
  49547. <dt><samp class="option">ds</samp></dt>
  49548. <dd><p>Set display scale, can be linear: <code class="code">lin</code> or log: <code class="code">log</code>,
  49549. default is <code class="code">lin</code>.
  49550. </p>
  49551. </dd>
  49552. <dt><samp class="option">dm</samp></dt>
  49553. <dd><p>In second.
  49554. If set to &gt; 0., display a line for the max level
  49555. in the previous seconds.
  49556. default is disabled: <code class="code">0.</code>
  49557. </p>
  49558. </dd>
  49559. <dt><samp class="option">dmc</samp></dt>
  49560. <dd><p>The color of the max line. Use when <code class="code">dm</code> option is set to &gt; 0.
  49561. default is: <code class="code">orange</code>
  49562. </p></dd>
  49563. </dl>
  49564. <a name="showwaves"></a>
  49565. <h3 class="section">41.29 showwaves<span class="pull-right"><a class="anchor hidden-xs" href="#showwaves" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showwaves" aria-hidden="true">TOC</a></span></h3>
  49566. <p>Convert input audio to a video output, representing the samples waves.
  49567. </p>
  49568. <p>The filter accepts the following options:
  49569. </p>
  49570. <dl class="table">
  49571. <dt><samp class="option">size, s</samp></dt>
  49572. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  49573. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  49574. Default value is <code class="code">600x240</code>.
  49575. </p>
  49576. </dd>
  49577. <dt><samp class="option">mode</samp></dt>
  49578. <dd><p>Set display mode.
  49579. </p>
  49580. <p>Available values are:
  49581. </p><dl class="table">
  49582. <dt>&lsquo;<samp class="samp">point</samp>&rsquo;</dt>
  49583. <dd><p>Draw a point for each sample.
  49584. </p>
  49585. </dd>
  49586. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  49587. <dd><p>Draw a vertical line for each sample.
  49588. </p>
  49589. </dd>
  49590. <dt>&lsquo;<samp class="samp">p2p</samp>&rsquo;</dt>
  49591. <dd><p>Draw a point for each sample and a line between them.
  49592. </p>
  49593. </dd>
  49594. <dt>&lsquo;<samp class="samp">cline</samp>&rsquo;</dt>
  49595. <dd><p>Draw a centered vertical line for each sample.
  49596. </p></dd>
  49597. </dl>
  49598. <p>Default value is <code class="code">point</code>.
  49599. </p>
  49600. </dd>
  49601. <dt><samp class="option">n</samp></dt>
  49602. <dd><p>Set the number of samples which are printed on the same column. A
  49603. larger value will decrease the frame rate. Must be a positive
  49604. integer. This option can be set only if the value for <var class="var">rate</var>
  49605. is not explicitly specified.
  49606. </p>
  49607. </dd>
  49608. <dt><samp class="option">rate, r</samp></dt>
  49609. <dd><p>Set the (approximate) output frame rate. This is done by setting the
  49610. option <var class="var">n</var>. Default value is &quot;25&quot;.
  49611. </p>
  49612. </dd>
  49613. <dt><samp class="option">split_channels</samp></dt>
  49614. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  49615. </p>
  49616. </dd>
  49617. <dt><samp class="option">colors</samp></dt>
  49618. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  49619. </p>
  49620. </dd>
  49621. <dt><samp class="option">scale</samp></dt>
  49622. <dd><p>Set amplitude scale.
  49623. </p>
  49624. <p>Available values are:
  49625. </p><dl class="table">
  49626. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  49627. <dd><p>Linear.
  49628. </p>
  49629. </dd>
  49630. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  49631. <dd><p>Logarithmic.
  49632. </p>
  49633. </dd>
  49634. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  49635. <dd><p>Square root.
  49636. </p>
  49637. </dd>
  49638. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  49639. <dd><p>Cubic root.
  49640. </p></dd>
  49641. </dl>
  49642. <p>Default is linear.
  49643. </p>
  49644. </dd>
  49645. <dt><samp class="option">draw</samp></dt>
  49646. <dd><p>Set the draw mode. This is mostly useful to set for high <var class="var">n</var>.
  49647. </p>
  49648. <p>Available values are:
  49649. </p><dl class="table">
  49650. <dt>&lsquo;<samp class="samp">scale</samp>&rsquo;</dt>
  49651. <dd><p>Scale pixel values for each drawn sample.
  49652. </p>
  49653. </dd>
  49654. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  49655. <dd><p>Draw every sample directly.
  49656. </p></dd>
  49657. </dl>
  49658. <p>Default value is <code class="code">scale</code>.
  49659. </p></dd>
  49660. </dl>
  49661. <a name="Examples-198"></a>
  49662. <h4 class="subsection">41.29.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-198" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-198" aria-hidden="true">TOC</a></span></h4>
  49663. <ul class="itemize mark-bullet">
  49664. <li>Output the input file audio and the corresponding video representation
  49665. at the same time:
  49666. <div class="example">
  49667. <pre class="example-preformatted">amovie=a.mp3,asplit[out0],showwaves[out1]
  49668. </pre></div>
  49669. </li><li>Create a synthetic signal and show it with showwaves, forcing a
  49670. frame rate of 30 frames per second:
  49671. <div class="example">
  49672. <pre class="example-preformatted">aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
  49673. </pre></div>
  49674. </li></ul>
  49675. <a name="showwavespic"></a>
  49676. <h3 class="section">41.30 showwavespic<span class="pull-right"><a class="anchor hidden-xs" href="#showwavespic" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showwavespic" aria-hidden="true">TOC</a></span></h3>
  49677. <p>Convert input audio to a single video frame, representing the samples waves.
  49678. </p>
  49679. <p>The filter accepts the following options:
  49680. </p>
  49681. <dl class="table">
  49682. <dt><samp class="option">size, s</samp></dt>
  49683. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  49684. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  49685. Default value is <code class="code">600x240</code>.
  49686. </p>
  49687. </dd>
  49688. <dt><samp class="option">split_channels</samp></dt>
  49689. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  49690. </p>
  49691. </dd>
  49692. <dt><samp class="option">colors</samp></dt>
  49693. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  49694. </p>
  49695. </dd>
  49696. <dt><samp class="option">scale</samp></dt>
  49697. <dd><p>Set amplitude scale.
  49698. </p>
  49699. <p>Available values are:
  49700. </p><dl class="table">
  49701. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  49702. <dd><p>Linear.
  49703. </p>
  49704. </dd>
  49705. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  49706. <dd><p>Logarithmic.
  49707. </p>
  49708. </dd>
  49709. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  49710. <dd><p>Square root.
  49711. </p>
  49712. </dd>
  49713. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  49714. <dd><p>Cubic root.
  49715. </p></dd>
  49716. </dl>
  49717. <p>Default is linear.
  49718. </p>
  49719. </dd>
  49720. <dt><samp class="option">draw</samp></dt>
  49721. <dd><p>Set the draw mode.
  49722. </p>
  49723. <p>Available values are:
  49724. </p><dl class="table">
  49725. <dt>&lsquo;<samp class="samp">scale</samp>&rsquo;</dt>
  49726. <dd><p>Scale pixel values for each drawn sample.
  49727. </p>
  49728. </dd>
  49729. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  49730. <dd><p>Draw every sample directly.
  49731. </p></dd>
  49732. </dl>
  49733. <p>Default value is <code class="code">scale</code>.
  49734. </p>
  49735. </dd>
  49736. <dt><samp class="option">filter</samp></dt>
  49737. <dd><p>Set the filter mode.
  49738. </p>
  49739. <p>Available values are:
  49740. </p><dl class="table">
  49741. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  49742. <dd><p>Use average samples values for each drawn sample.
  49743. </p>
  49744. </dd>
  49745. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  49746. <dd><p>Use peak samples values for each drawn sample.
  49747. </p></dd>
  49748. </dl>
  49749. <p>Default value is <code class="code">average</code>.
  49750. </p></dd>
  49751. </dl>
  49752. <a name="Examples-199"></a>
  49753. <h4 class="subsection">41.30.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-199" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-199" aria-hidden="true">TOC</a></span></h4>
  49754. <ul class="itemize mark-bullet">
  49755. <li>Extract a channel split representation of the wave form of a whole audio track
  49756. in a 1024x800 picture using <code class="command">ffmpeg</code>:
  49757. <div class="example">
  49758. <pre class="example-preformatted">ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
  49759. </pre></div>
  49760. </li></ul>
  49761. <a name="sidedata_002c-asidedata"></a>
  49762. <h3 class="section">41.31 sidedata, asidedata<span class="pull-right"><a class="anchor hidden-xs" href="#sidedata_002c-asidedata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sidedata_002c-asidedata" aria-hidden="true">TOC</a></span></h3>
  49763. <p>Delete frame side data, or select frames based on it.
  49764. </p>
  49765. <p>This filter accepts the following options:
  49766. </p>
  49767. <dl class="table">
  49768. <dt><samp class="option">mode</samp></dt>
  49769. <dd><p>Set mode of operation of the filter.
  49770. </p>
  49771. <p>Can be one of the following:
  49772. </p>
  49773. <dl class="table">
  49774. <dt>&lsquo;<samp class="samp">select</samp>&rsquo;</dt>
  49775. <dd><p>Select every frame with side data of <code class="code">type</code>.
  49776. </p>
  49777. </dd>
  49778. <dt>&lsquo;<samp class="samp">delete</samp>&rsquo;</dt>
  49779. <dd><p>Delete side data of <code class="code">type</code>. If <code class="code">type</code> is not set, delete all side
  49780. data in the frame.
  49781. </p>
  49782. </dd>
  49783. </dl>
  49784. </dd>
  49785. <dt><samp class="option">type</samp></dt>
  49786. <dd><p>Set side data type used with all modes. Must be set for <code class="code">select</code> mode.
  49787. </p>
  49788. <p>Possible values are:
  49789. </p>
  49790. <dl class="table">
  49791. <dt>&lsquo;<samp class="samp">PANSCAN</samp>&rsquo;</dt>
  49792. <dt>&lsquo;<samp class="samp">A53_CC</samp>&rsquo;</dt>
  49793. <dt>&lsquo;<samp class="samp">STEREO3D</samp>&rsquo;</dt>
  49794. <dt>&lsquo;<samp class="samp">MATRIXENCODING</samp>&rsquo;</dt>
  49795. <dt>&lsquo;<samp class="samp">DOWNMIX_INFO</samp>&rsquo;</dt>
  49796. <dt>&lsquo;<samp class="samp">REPLAYGAIN</samp>&rsquo;</dt>
  49797. <dt>&lsquo;<samp class="samp">DISPLAYMATRIX</samp>&rsquo;</dt>
  49798. <dt>&lsquo;<samp class="samp">AFD</samp>&rsquo;</dt>
  49799. <dt>&lsquo;<samp class="samp">MOTION_VECTORS</samp>&rsquo;</dt>
  49800. <dt>&lsquo;<samp class="samp">SKIP_SAMPLES</samp>&rsquo;</dt>
  49801. <dt>&lsquo;<samp class="samp">AUDIO_SERVICE_TYPE</samp>&rsquo;</dt>
  49802. <dt>&lsquo;<samp class="samp">MASTERING_DISPLAY_METADATA</samp>&rsquo;</dt>
  49803. <dt>&lsquo;<samp class="samp">GOP_TIMECODE</samp>&rsquo;</dt>
  49804. <dt>&lsquo;<samp class="samp">SPHERICAL</samp>&rsquo;</dt>
  49805. <dt>&lsquo;<samp class="samp">CONTENT_LIGHT_LEVEL</samp>&rsquo;</dt>
  49806. <dt>&lsquo;<samp class="samp">ICC_PROFILE</samp>&rsquo;</dt>
  49807. <dt>&lsquo;<samp class="samp">S12M_TIMECODE</samp>&rsquo;</dt>
  49808. <dt>&lsquo;<samp class="samp">DYNAMIC_HDR_PLUS</samp>&rsquo;</dt>
  49809. <dt>&lsquo;<samp class="samp">REGIONS_OF_INTEREST</samp>&rsquo;</dt>
  49810. <dt>&lsquo;<samp class="samp">VIDEO_ENC_PARAMS</samp>&rsquo;</dt>
  49811. <dt>&lsquo;<samp class="samp">SEI_UNREGISTERED</samp>&rsquo;</dt>
  49812. <dt>&lsquo;<samp class="samp">FILM_GRAIN_PARAMS</samp>&rsquo;</dt>
  49813. <dt>&lsquo;<samp class="samp">DETECTION_BOUNDING_BOXES</samp>&rsquo;</dt>
  49814. <dt>&lsquo;<samp class="samp">DETECTION_BBOXES</samp>&rsquo;</dt>
  49815. <dt>&lsquo;<samp class="samp">DOVI_RPU_BUFFER</samp>&rsquo;</dt>
  49816. <dt>&lsquo;<samp class="samp">DOVI_METADATA</samp>&rsquo;</dt>
  49817. <dt>&lsquo;<samp class="samp">DYNAMIC_HDR_VIVID</samp>&rsquo;</dt>
  49818. <dt>&lsquo;<samp class="samp">AMBIENT_VIEWING_ENVIRONMENT</samp>&rsquo;</dt>
  49819. <dt>&lsquo;<samp class="samp">VIDEO_HINT</samp>&rsquo;</dt>
  49820. </dl>
  49821. </dd>
  49822. </dl>
  49823. <a name="spectrumsynth"></a>
  49824. <h3 class="section">41.32 spectrumsynth<span class="pull-right"><a class="anchor hidden-xs" href="#spectrumsynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-spectrumsynth" aria-hidden="true">TOC</a></span></h3>
  49825. <p>Synthesize audio from 2 input video spectrums, first input stream represents
  49826. magnitude across time and second represents phase across time.
  49827. The filter will transform from frequency domain as displayed in videos back
  49828. to time domain as presented in audio output.
  49829. </p>
  49830. <p>This filter is primarily created for reversing processed <a class="ref" href="#showspectrum">showspectrum</a>
  49831. filter outputs, but can synthesize sound from other spectrograms too.
  49832. But in such case results are going to be poor if the phase data is not
  49833. available, because in such cases phase data need to be recreated, usually
  49834. it&rsquo;s just recreated from random noise.
  49835. For best results use gray only output (<code class="code">channel</code> color mode in
  49836. <a class="ref" href="#showspectrum">showspectrum</a> filter) and <code class="code">log</code> scale for magnitude video and
  49837. <code class="code">lin</code> scale for phase video. To produce phase, for 2nd video, use
  49838. <code class="code">data</code> option. Inputs videos should generally use <code class="code">fullframe</code>
  49839. slide mode as that saves resources needed for decoding video.
  49840. </p>
  49841. <p>The filter accepts the following options:
  49842. </p>
  49843. <dl class="table">
  49844. <dt><samp class="option">sample_rate</samp></dt>
  49845. <dd><p>Specify sample rate of output audio, the sample rate of audio from which
  49846. spectrum was generated may differ.
  49847. </p>
  49848. </dd>
  49849. <dt><samp class="option">channels</samp></dt>
  49850. <dd><p>Set number of channels represented in input video spectrums.
  49851. </p>
  49852. </dd>
  49853. <dt><samp class="option">scale</samp></dt>
  49854. <dd><p>Set scale which was used when generating magnitude input spectrum.
  49855. Can be <code class="code">lin</code> or <code class="code">log</code>. Default is <code class="code">log</code>.
  49856. </p>
  49857. </dd>
  49858. <dt><samp class="option">slide</samp></dt>
  49859. <dd><p>Set slide which was used when generating inputs spectrums.
  49860. Can be <code class="code">replace</code>, <code class="code">scroll</code>, <code class="code">fullframe</code> or <code class="code">rscroll</code>.
  49861. Default is <code class="code">fullframe</code>.
  49862. </p>
  49863. </dd>
  49864. <dt><samp class="option">win_func</samp></dt>
  49865. <dd><p>Set window function used for resynthesis.
  49866. </p>
  49867. </dd>
  49868. <dt><samp class="option">overlap</samp></dt>
  49869. <dd><p>Set window overlap. In range <code class="code">[0, 1]</code>. Default is <code class="code">1</code>,
  49870. which means optimal overlap for selected window function will be picked.
  49871. </p>
  49872. </dd>
  49873. <dt><samp class="option">orientation</samp></dt>
  49874. <dd><p>Set orientation of input videos. Can be <code class="code">vertical</code> or <code class="code">horizontal</code>.
  49875. Default is <code class="code">vertical</code>.
  49876. </p></dd>
  49877. </dl>
  49878. <a name="Examples-200"></a>
  49879. <h4 class="subsection">41.32.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-200" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-200" aria-hidden="true">TOC</a></span></h4>
  49880. <ul class="itemize mark-bullet">
  49881. <li>First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate,
  49882. then resynthesize videos back to audio with spectrumsynth:
  49883. <div class="example">
  49884. <pre class="example-preformatted">ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=log:overlap=0.875:color=channel:slide=fullframe:data=magnitude -an -c:v rawvideo magnitude.nut
  49885. 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
  49886. ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
  49887. </pre></div>
  49888. </li></ul>
  49889. <a name="split_002c-asplit"></a>
  49890. <h3 class="section">41.33 split, asplit<span class="pull-right"><a class="anchor hidden-xs" href="#split_002c-asplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-split_002c-asplit" aria-hidden="true">TOC</a></span></h3>
  49891. <p>Split input into several identical outputs.
  49892. </p>
  49893. <p><code class="code">asplit</code> works with audio input, <code class="code">split</code> with video.
  49894. </p>
  49895. <p>The filter accepts a single parameter which specifies the number of outputs. If
  49896. unspecified, it defaults to 2.
  49897. </p>
  49898. <a name="Examples-201"></a>
  49899. <h4 class="subsection">41.33.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-201" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-201" aria-hidden="true">TOC</a></span></h4>
  49900. <ul class="itemize mark-bullet">
  49901. <li>Create two separate outputs from the same input:
  49902. <div class="example">
  49903. <pre class="example-preformatted">[in] split [out0][out1]
  49904. </pre></div>
  49905. </li><li>To create 3 or more outputs, you need to specify the number of
  49906. outputs, like in:
  49907. <div class="example">
  49908. <pre class="example-preformatted">[in] asplit=3 [out0][out1][out2]
  49909. </pre></div>
  49910. </li><li>Create two separate outputs from the same input, one cropped and
  49911. one padded:
  49912. <div class="example">
  49913. <pre class="example-preformatted">[in] split [splitout1][splitout2];
  49914. [splitout1] crop=100:100:0:0 [cropout];
  49915. [splitout2] pad=200:200:100:100 [padout];
  49916. </pre></div>
  49917. </li><li>Create 5 copies of the input audio with <code class="command">ffmpeg</code>:
  49918. <div class="example">
  49919. <pre class="example-preformatted">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
  49920. </pre></div>
  49921. </li></ul>
  49922. <a name="zmq_002c-azmq"></a>
  49923. <h3 class="section">41.34 zmq, azmq<span class="pull-right"><a class="anchor hidden-xs" href="#zmq_002c-azmq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zmq_002c-azmq" aria-hidden="true">TOC</a></span></h3>
  49924. <p>Receive commands sent through a libzmq client, and forward them to
  49925. filters in the filtergraph.
  49926. </p>
  49927. <p><code class="code">zmq</code> and <code class="code">azmq</code> work as a pass-through filters. <code class="code">zmq</code>
  49928. must be inserted between two video filters, <code class="code">azmq</code> between two
  49929. audio filters. Both are capable to send messages to any filter type.
  49930. </p>
  49931. <p>To enable these filters you need to install the libzmq library and
  49932. headers and configure FFmpeg with <code class="code">--enable-libzmq</code>.
  49933. </p>
  49934. <p>For more information about libzmq see:
  49935. <a class="url" href="http://www.zeromq.org/">http://www.zeromq.org/</a>
  49936. </p>
  49937. <p>The <code class="code">zmq</code> and <code class="code">azmq</code> filters work as a libzmq server, which
  49938. receives messages sent through a network interface defined by the
  49939. <samp class="option">bind_address</samp> (or the abbreviation &quot;<samp class="option">b</samp>&quot;) option.
  49940. Default value of this option is <samp class="file">tcp://localhost:5555</samp>. You may
  49941. want to alter this value to your needs, but do not forget to escape any
  49942. &rsquo;:&rsquo; signs (see <a class="ref" href="#filtergraph-escaping">filtergraph escaping</a>).
  49943. </p>
  49944. <p>The received message must be in the form:
  49945. </p><div class="example">
  49946. <pre class="example-preformatted"><var class="var">TARGET</var> <var class="var">COMMAND</var> [<var class="var">ARG</var>]
  49947. </pre></div>
  49948. <p><var class="var">TARGET</var> specifies the target of the command, usually the name of
  49949. the filter class or a specific filter instance name. The default
  49950. filter instance name uses the pattern &lsquo;<samp class="samp">Parsed_&lt;filter_name&gt;_&lt;index&gt;</samp>&rsquo;,
  49951. but you can override this by using the &lsquo;<samp class="samp">filter_name@id</samp>&rsquo; syntax
  49952. (see <a class="ref" href="#Filtergraph-syntax">Filtergraph syntax</a>).
  49953. </p>
  49954. <p><var class="var">COMMAND</var> specifies the name of the command for the target filter.
  49955. </p>
  49956. <p><var class="var">ARG</var> is optional and specifies the optional argument list for the
  49957. given <var class="var">COMMAND</var>.
  49958. </p>
  49959. <p>Upon reception, the message is processed and the corresponding command
  49960. is injected into the filtergraph. Depending on the result, the filter
  49961. will send a reply to the client, adopting the format:
  49962. </p><div class="example">
  49963. <pre class="example-preformatted"><var class="var">ERROR_CODE</var> <var class="var">ERROR_REASON</var>
  49964. <var class="var">MESSAGE</var>
  49965. </pre></div>
  49966. <p><var class="var">MESSAGE</var> is optional.
  49967. </p>
  49968. <a name="Examples-202"></a>
  49969. <h4 class="subsection">41.34.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-202" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-202" aria-hidden="true">TOC</a></span></h4>
  49970. <p>Look at <samp class="file">tools/zmqsend</samp> for an example of a zmq client which can
  49971. be used to send commands processed by these filters.
  49972. </p>
  49973. <p>Consider the following filtergraph generated by <code class="command">ffplay</code>.
  49974. In this example the last overlay filter has an instance name. All other
  49975. filters will have default instance names.
  49976. </p>
  49977. <div class="example">
  49978. <pre class="example-preformatted">ffplay -dumpgraph 1 -f lavfi &quot;
  49979. color=s=100x100:c=red [l];
  49980. color=s=100x100:c=blue [r];
  49981. nullsrc=s=200x100, zmq [bg];
  49982. [bg][l] overlay [bg+l];
  49983. [bg+l][r] overlay@my=x=100 &quot;
  49984. </pre></div>
  49985. <p>To change the color of the left side of the video, the following
  49986. command can be used:
  49987. </p><div class="example">
  49988. <pre class="example-preformatted">echo Parsed_color_0 c yellow | tools/zmqsend
  49989. </pre></div>
  49990. <p>To change the right side:
  49991. </p><div class="example">
  49992. <pre class="example-preformatted">echo Parsed_color_1 c pink | tools/zmqsend
  49993. </pre></div>
  49994. <p>To change the position of the right side:
  49995. </p><div class="example">
  49996. <pre class="example-preformatted">echo overlay@my x 150 | tools/zmqsend
  49997. </pre></div>
  49998. <a name="Multimedia-Sources"></a>
  49999. <h2 class="chapter">42 Multimedia Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Multimedia-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Multimedia-Sources" aria-hidden="true">TOC</a></span></h2>
  50000. <p>Below is a description of the currently available multimedia sources.
  50001. </p>
  50002. <a name="amovie"></a>
  50003. <h3 class="section">42.1 amovie<span class="pull-right"><a class="anchor hidden-xs" href="#amovie" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amovie" aria-hidden="true">TOC</a></span></h3>
  50004. <p>This is the same as <a class="ref" href="#movie">movie</a> source, except it selects an audio
  50005. stream by default.
  50006. </p>
  50007. <a name="avsynctest"></a>
  50008. <h3 class="section">42.2 avsynctest<span class="pull-right"><a class="anchor hidden-xs" href="#avsynctest" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avsynctest" aria-hidden="true">TOC</a></span></h3>
  50009. <p>Generate an Audio/Video Sync Test.
  50010. </p>
  50011. <p>Generated stream periodically shows flash video frame and emits beep in audio.
  50012. Useful to inspect A/V sync issues.
  50013. </p>
  50014. <p>It accepts the following options:
  50015. </p>
  50016. <dl class="table">
  50017. <dt><samp class="option">size, s</samp></dt>
  50018. <dd><p>Set output video size. Default value is <code class="code">hd720</code>.
  50019. </p>
  50020. </dd>
  50021. <dt><samp class="option">framerate, fr</samp></dt>
  50022. <dd><p>Set output video frame rate. Default value is <code class="code">30</code>.
  50023. </p>
  50024. </dd>
  50025. <dt><samp class="option">samplerate, sr</samp></dt>
  50026. <dd><p>Set output audio sample rate. Default value is <code class="code">44100</code>.
  50027. </p>
  50028. </dd>
  50029. <dt><samp class="option">amplitude, a</samp></dt>
  50030. <dd><p>Set output audio beep amplitude. Default value is <code class="code">0.7</code>.
  50031. </p>
  50032. </dd>
  50033. <dt><samp class="option">period, p</samp></dt>
  50034. <dd><p>Set output audio beep period in seconds. Default value is <code class="code">3</code>.
  50035. </p>
  50036. </dd>
  50037. <dt><samp class="option">delay, dl</samp></dt>
  50038. <dd><p>Set output video flash delay in number of frames. Default value is <code class="code">0</code>.
  50039. </p>
  50040. </dd>
  50041. <dt><samp class="option">cycle, c</samp></dt>
  50042. <dd><p>Enable cycling of video delays, by default is disabled.
  50043. </p>
  50044. </dd>
  50045. <dt><samp class="option">duration, d</samp></dt>
  50046. <dd><p>Set stream output duration. By default duration is unlimited.
  50047. </p>
  50048. </dd>
  50049. <dt><samp class="option">fg, bg, ag</samp></dt>
  50050. <dd><p>Set foreground/background/additional color.
  50051. </p></dd>
  50052. </dl>
  50053. <a name="Commands-164"></a>
  50054. <h4 class="subsection">42.2.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-164" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-164" aria-hidden="true">TOC</a></span></h4>
  50055. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  50056. </p>
  50057. <a class="anchor" id="movie"></a><a name="movie-1"></a>
  50058. <h3 class="section">42.3 movie<span class="pull-right"><a class="anchor hidden-xs" href="#movie-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-movie-1" aria-hidden="true">TOC</a></span></h3>
  50059. <p>Read audio and/or video stream(s) from a movie container.
  50060. </p>
  50061. <p>It accepts the following parameters:
  50062. </p>
  50063. <dl class="table">
  50064. <dt><samp class="option">filename</samp></dt>
  50065. <dd><p>The name of the resource to read (not necessarily a file; it can also be a
  50066. device or a stream accessed through some protocol).
  50067. </p>
  50068. </dd>
  50069. <dt><samp class="option">format_name, f</samp></dt>
  50070. <dd><p>Specifies the format assumed for the movie to read, and can be either
  50071. the name of a container or an input device. If not specified, the
  50072. format is guessed from <var class="var">movie_name</var> or by probing.
  50073. </p>
  50074. </dd>
  50075. <dt><samp class="option">seek_point, sp</samp></dt>
  50076. <dd><p>Specifies the seek point in seconds. The frames will be output
  50077. starting from this seek point. The parameter is evaluated with
  50078. <code class="code">av_strtod</code>, so the numerical value may be suffixed by an IS
  50079. postfix. The default value is &quot;0&quot;.
  50080. </p>
  50081. </dd>
  50082. <dt><samp class="option">streams, s</samp></dt>
  50083. <dd><p>Specifies the streams to read. Several streams can be specified,
  50084. separated by &quot;+&quot;. The source will then have as many outputs, in the
  50085. same order. The syntax is explained in the <a data-manual="ffmpeg" href="ffmpeg.html#Stream-specifiers">&quot;Stream specifiers&quot;
  50086. section in the ffmpeg manual</a>. Two special names, &quot;dv&quot; and &quot;da&quot; specify
  50087. respectively the default (best suited) video and audio stream. Default
  50088. is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
  50089. </p>
  50090. </dd>
  50091. <dt><samp class="option">stream_index, si</samp></dt>
  50092. <dd><p>Specifies the index of the video stream to read. If the value is -1,
  50093. the most suitable video stream will be automatically selected. The default
  50094. value is &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
  50095. audio instead of video.
  50096. </p>
  50097. </dd>
  50098. <dt><samp class="option">loop</samp></dt>
  50099. <dd><p>Specifies how many times to read the stream in sequence.
  50100. If the value is 0, the stream will be looped infinitely.
  50101. Default value is &quot;1&quot;.
  50102. </p>
  50103. <p>Note that when the movie is looped the source timestamps are not
  50104. changed, so it will generate non monotonically increasing timestamps.
  50105. </p>
  50106. </dd>
  50107. <dt><samp class="option">discontinuity</samp></dt>
  50108. <dd><p>Specifies the time difference between frames above which the point is
  50109. considered a timestamp discontinuity which is removed by adjusting the later
  50110. timestamps.
  50111. </p>
  50112. </dd>
  50113. <dt><samp class="option">dec_threads</samp></dt>
  50114. <dd><p>Specifies the number of threads for decoding
  50115. </p>
  50116. </dd>
  50117. <dt><samp class="option">format_opts</samp></dt>
  50118. <dd><p>Specify format options for the opened file. Format options can be specified
  50119. as a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;. The following example
  50120. shows how to add protocol_whitelist and protocol_blacklist options:
  50121. </p><div class="example">
  50122. <pre class="example-preformatted">ffplay -f lavfi
  50123. &quot;movie=filename='1.sdp':format_opts='protocol_whitelist=file,rtp,udp\:protocol_blacklist=http'&quot;
  50124. </pre></div>
  50125. </dd>
  50126. </dl>
  50127. <p>It allows overlaying a second video on top of the main input of
  50128. a filtergraph, as shown in this graph:
  50129. </p><div class="example">
  50130. <pre class="example-preformatted">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
  50131. ^
  50132. |
  50133. movie --&gt; scale--&gt; deltapts1 -------+
  50134. </pre></div>
  50135. <a name="Examples-203"></a>
  50136. <h4 class="subsection">42.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-203" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-203" aria-hidden="true">TOC</a></span></h4>
  50137. <ul class="itemize mark-bullet">
  50138. <li>Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it
  50139. on top of the input labelled &quot;in&quot;:
  50140. <div class="example">
  50141. <pre class="example-preformatted">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
  50142. [in] setpts=PTS-STARTPTS [main];
  50143. [main][over] overlay=16:16 [out]
  50144. </pre></div>
  50145. </li><li>Read from a video4linux2 device, and overlay it on top of the input
  50146. labelled &quot;in&quot;:
  50147. <div class="example">
  50148. <pre class="example-preformatted">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
  50149. [in] setpts=PTS-STARTPTS [main];
  50150. [main][over] overlay=16:16 [out]
  50151. </pre></div>
  50152. </li><li>Read the first video stream and the audio stream with id 0x81 from
  50153. dvd.vob; the video is connected to the pad named &quot;video&quot; and the audio is
  50154. connected to the pad named &quot;audio&quot;:
  50155. <div class="example">
  50156. <pre class="example-preformatted">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
  50157. </pre></div>
  50158. </li></ul>
  50159. <a name="Commands-165"></a>
  50160. <h4 class="subsection">42.3.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-165" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-165" aria-hidden="true">TOC</a></span></h4>
  50161. <p>Both movie and amovie support the following commands:
  50162. </p><dl class="table">
  50163. <dt><samp class="option">seek</samp></dt>
  50164. <dd><p>Perform seek using &quot;av_seek_frame&quot;.
  50165. The syntax is: seek <var class="var">stream_index</var>|<var class="var">timestamp</var>|<var class="var">flags</var>
  50166. </p><ul class="itemize mark-bullet">
  50167. <li><var class="var">stream_index</var>: If stream_index is -1, a default
  50168. stream is selected, and <var class="var">timestamp</var> is automatically converted
  50169. from AV_TIME_BASE units to the stream specific time_base.
  50170. </li><li><var class="var">timestamp</var>: Timestamp in AVStream.time_base units
  50171. or, if no stream is specified, in AV_TIME_BASE units.
  50172. </li><li><var class="var">flags</var>: Flags which select direction and seeking mode.
  50173. </li></ul>
  50174. </dd>
  50175. <dt><samp class="option">get_duration</samp></dt>
  50176. <dd><p>Get movie duration in AV_TIME_BASE units.
  50177. </p>
  50178. </dd>
  50179. </dl>
  50180. <a name="External-libraries"></a>
  50181. <h2 class="chapter">43 External libraries<span class="pull-right"><a class="anchor hidden-xs" href="#External-libraries" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-External-libraries" aria-hidden="true">TOC</a></span></h2>
  50182. <p>FFmpeg can be hooked up with a number of external libraries to add support
  50183. for more formats. None of them are used by default, their use has to be
  50184. explicitly requested by passing the appropriate flags to
  50185. <code class="command">./configure</code>.
  50186. </p>
  50187. <a name="Alliance-for-Open-Media-_0028AOM_0029"></a>
  50188. <h3 class="section">43.1 Alliance for Open Media (AOM)<span class="pull-right"><a class="anchor hidden-xs" href="#Alliance-for-Open-Media-_0028AOM_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Alliance-for-Open-Media-_0028AOM_0029" aria-hidden="true">TOC</a></span></h3>
  50189. <p>FFmpeg can make use of the AOM library for AV1 decoding and encoding.
  50190. </p>
  50191. <p>Go to <a class="url" href="http://aomedia.org/">http://aomedia.org/</a> and follow the instructions for
  50192. installing the library. Then pass <code class="code">--enable-libaom</code> to configure to
  50193. enable it.
  50194. </p>
  50195. <a name="AMD-AMF_002fVCE"></a>
  50196. <h3 class="section">43.2 AMD AMF/VCE<span class="pull-right"><a class="anchor hidden-xs" href="#AMD-AMF_002fVCE" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AMD-AMF_002fVCE" aria-hidden="true">TOC</a></span></h3>
  50197. <p>FFmpeg can use the AMD Advanced Media Framework library
  50198. for accelerated H.264 and HEVC(only windows) encoding on hardware with Video Coding Engine (VCE).
  50199. </p>
  50200. <p>To enable support you must obtain the AMF framework header files(version 1.4.9+) from
  50201. <a class="url" href="https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git">https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git</a>.
  50202. </p>
  50203. <p>Create an <code class="code">AMF/</code> directory in the system include path.
  50204. Copy the contents of <code class="code">AMF/amf/public/include/</code> into that directory.
  50205. Then configure FFmpeg with <code class="code">--enable-amf</code>.
  50206. </p>
  50207. <p>Initialization of amf encoder occurs in this order:
  50208. 1) trying to initialize through dx11(only windows)
  50209. 2) trying to initialize through dx9(only windows)
  50210. 3) trying to initialize through vulkan
  50211. </p>
  50212. <p>To use h.264(AMD VCE) encoder on linux amdgru-pro version 19.20+ and amf-amdgpu-pro
  50213. package(amdgru-pro contains, but does not install automatically) are required.
  50214. </p>
  50215. <p>This driver can be installed using amdgpu-pro-install script in official amd driver archive.
  50216. </p>
  50217. <a name="AviSynth"></a>
  50218. <h3 class="section">43.3 AviSynth<span class="pull-right"><a class="anchor hidden-xs" href="#AviSynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AviSynth" aria-hidden="true">TOC</a></span></h3>
  50219. <p>FFmpeg can read AviSynth scripts as input. To enable support, pass
  50220. <code class="code">--enable-avisynth</code> to configure after installing the headers
  50221. provided by <a class="url" href="https://github.com/AviSynth/AviSynthPlus">AviSynth+</a>.
  50222. AviSynth+ can be configured to install only the headers by either
  50223. passing <code class="code">-DHEADERS_ONLY:bool=on</code> to the normal CMake-based build
  50224. system, or by using the supplied <code class="code">GNUmakefile</code>.
  50225. </p>
  50226. <p>For Windows, supported AviSynth variants are
  50227. <a class="url" href="http://avisynth.nl">AviSynth 2.6 RC1 or higher</a> for 32-bit builds and
  50228. <a class="url" href="http://avisynth.nl/index.php/AviSynth+">AviSynth+ r1718 or higher</a> for 32-bit and 64-bit builds.
  50229. </p>
  50230. <p>For Linux, macOS, and BSD, the only supported AviSynth variant is
  50231. <a class="url" href="https://github.com/AviSynth/AviSynthPlus">AviSynth+</a>, starting with version 3.5.
  50232. </p>
  50233. <div class="info">
  50234. <p>In 2016, AviSynth+ added support for building with GCC. However, due to
  50235. the eccentricities of Windows&rsquo; calling conventions, 32-bit GCC builds
  50236. of AviSynth+ are not compatible with typical 32-bit builds of FFmpeg.
  50237. </p>
  50238. <p>By default, FFmpeg assumes compatibility with 32-bit MSVC builds of
  50239. AviSynth+ since that is the most widely-used and entrenched build
  50240. configuration. Users can override this and enable support for 32-bit
  50241. GCC builds of AviSynth+ by passing <code class="code">-DAVSC_WIN32_GCC32</code> to
  50242. <code class="code">--extra-cflags</code> when configuring FFmpeg.
  50243. </p>
  50244. <p>64-bit builds of FFmpeg are not affected, and can use either MSVC or
  50245. GCC builds of AviSynth+ without any special flags.
  50246. </p></div>
  50247. <div class="info">
  50248. <p>AviSynth(+) is loaded dynamically. Distributors can build FFmpeg
  50249. with <code class="code">--enable-avisynth</code>, and the binaries will work regardless
  50250. of the end user having AviSynth installed. If/when an end user
  50251. would like to use AviSynth scripts, then they can install AviSynth(+)
  50252. and FFmpeg will be able to find and use it to open scripts.
  50253. </p></div>
  50254. <a name="Chromaprint"></a>
  50255. <h3 class="section">43.4 Chromaprint<span class="pull-right"><a class="anchor hidden-xs" href="#Chromaprint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Chromaprint" aria-hidden="true">TOC</a></span></h3>
  50256. <p>FFmpeg can make use of the Chromaprint library for generating audio fingerprints.
  50257. Pass <code class="code">--enable-chromaprint</code> to configure to
  50258. enable it. See <a class="url" href="https://acoustid.org/chromaprint">https://acoustid.org/chromaprint</a>.
  50259. </p>
  50260. <a name="codec2"></a>
  50261. <h3 class="section">43.5 codec2<span class="pull-right"><a class="anchor hidden-xs" href="#codec2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-codec2" aria-hidden="true">TOC</a></span></h3>
  50262. <p>FFmpeg can make use of the codec2 library for codec2 decoding and encoding.
  50263. There is currently no native decoder, so libcodec2 must be used for decoding.
  50264. </p>
  50265. <p>Go to <a class="url" href="http://freedv.org/">http://freedv.org/</a>, download &quot;Codec 2 source archive&quot;.
  50266. Build and install using CMake. Debian users can install the libcodec2-dev package instead.
  50267. Once libcodec2 is installed you can pass <code class="code">--enable-libcodec2</code> to configure to enable it.
  50268. </p>
  50269. <p>The easiest way to use codec2 is with .c2 files, since they contain the mode information required for decoding.
  50270. To encode such a file, use a .c2 file extension and give the libcodec2 encoder the -mode option:
  50271. <code class="code">ffmpeg -i input.wav -mode 700C output.c2</code>.
  50272. Playback is as simple as <code class="code">ffplay output.c2</code>.
  50273. For a list of supported modes, run <code class="code">ffmpeg -h encoder=libcodec2</code>.
  50274. Raw codec2 files are also supported.
  50275. To make sense of them the mode in use needs to be specified as a format option:
  50276. <code class="code">ffmpeg -f codec2raw -mode 1300 -i input.raw output.wav</code>.
  50277. </p>
  50278. <a name="dav1d"></a>
  50279. <h3 class="section">43.6 dav1d<span class="pull-right"><a class="anchor hidden-xs" href="#dav1d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dav1d" aria-hidden="true">TOC</a></span></h3>
  50280. <p>FFmpeg can make use of the dav1d library for AV1 video decoding.
  50281. </p>
  50282. <p>Go to <a class="url" href="https://code.videolan.org/videolan/dav1d">https://code.videolan.org/videolan/dav1d</a> and follow the instructions for
  50283. installing the library. Then pass <code class="code">--enable-libdav1d</code> to configure to enable it.
  50284. </p>
  50285. <a name="davs2"></a>
  50286. <h3 class="section">43.7 davs2<span class="pull-right"><a class="anchor hidden-xs" href="#davs2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-davs2" aria-hidden="true">TOC</a></span></h3>
  50287. <p>FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video decoding.
  50288. </p>
  50289. <p>Go to <a class="url" href="https://github.com/pkuvcl/davs2">https://github.com/pkuvcl/davs2</a> and follow the instructions for
  50290. installing the library. Then pass <code class="code">--enable-libdavs2</code> to configure to
  50291. enable it.
  50292. </p>
  50293. <div class="info">
  50294. <p>libdavs2 is under the GNU Public License Version 2 or later
  50295. (see <a class="url" href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">http://www.gnu.org/licenses/old-licenses/gpl-2.0.html</a> for
  50296. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  50297. </p></div>
  50298. <a name="uavs3d"></a>
  50299. <h3 class="section">43.8 uavs3d<span class="pull-right"><a class="anchor hidden-xs" href="#uavs3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-uavs3d" aria-hidden="true">TOC</a></span></h3>
  50300. <p>FFmpeg can make use of the uavs3d library for AVS3-P2/IEEE1857.10 video decoding.
  50301. </p>
  50302. <p>Go to <a class="url" href="https://github.com/uavs3/uavs3d">https://github.com/uavs3/uavs3d</a> and follow the instructions for
  50303. installing the library. Then pass <code class="code">--enable-libuavs3d</code> to configure to
  50304. enable it.
  50305. </p>
  50306. <a name="Game-Music-Emu"></a>
  50307. <h3 class="section">43.9 Game Music Emu<span class="pull-right"><a class="anchor hidden-xs" href="#Game-Music-Emu" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Game-Music-Emu" aria-hidden="true">TOC</a></span></h3>
  50308. <p>FFmpeg can make use of the Game Music Emu library to read audio from supported video game
  50309. music file formats. Pass <code class="code">--enable-libgme</code> to configure to
  50310. enable it. See <a class="url" href="https://bitbucket.org/mpyne/game-music-emu/overview">https://bitbucket.org/mpyne/game-music-emu/overview</a>.
  50311. </p>
  50312. <a name="Intel-QuickSync-Video"></a>
  50313. <h3 class="section">43.10 Intel QuickSync Video<span class="pull-right"><a class="anchor hidden-xs" href="#Intel-QuickSync-Video" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Intel-QuickSync-Video" aria-hidden="true">TOC</a></span></h3>
  50314. <p>FFmpeg can use Intel QuickSync Video (QSV) for accelerated decoding and encoding
  50315. of multiple codecs. To use QSV, FFmpeg must be linked against the <code class="code">libmfx</code>
  50316. dispatcher, which loads the actual decoding libraries.
  50317. </p>
  50318. <p>The dispatcher is open source and can be downloaded from
  50319. <a class="url" href="https://github.com/lu-zero/mfx_dispatch.git">https://github.com/lu-zero/mfx_dispatch.git</a>. FFmpeg needs to be configured
  50320. with the <code class="code">--enable-libmfx</code> option and <code class="code">pkg-config</code> needs to be able to
  50321. locate the dispatcher&rsquo;s <code class="code">.pc</code> files.
  50322. </p>
  50323. <a name="Kvazaar"></a>
  50324. <h3 class="section">43.11 Kvazaar<span class="pull-right"><a class="anchor hidden-xs" href="#Kvazaar" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Kvazaar" aria-hidden="true">TOC</a></span></h3>
  50325. <p>FFmpeg can make use of the Kvazaar library for HEVC encoding.
  50326. </p>
  50327. <p>Go to <a class="url" href="https://github.com/ultravideo/kvazaar">https://github.com/ultravideo/kvazaar</a> and follow the
  50328. instructions for installing the library. Then pass
  50329. <code class="code">--enable-libkvazaar</code> to configure to enable it.
  50330. </p>
  50331. <a name="LAME"></a>
  50332. <h3 class="section">43.12 LAME<span class="pull-right"><a class="anchor hidden-xs" href="#LAME" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-LAME" aria-hidden="true">TOC</a></span></h3>
  50333. <p>FFmpeg can make use of the LAME library for MP3 encoding.
  50334. </p>
  50335. <p>Go to <a class="url" href="http://lame.sourceforge.net/">http://lame.sourceforge.net/</a> and follow the
  50336. instructions for installing the library.
  50337. Then pass <code class="code">--enable-libmp3lame</code> to configure to enable it.
  50338. </p>
  50339. <a name="LCEVCdec"></a>
  50340. <h3 class="section">43.13 LCEVCdec<span class="pull-right"><a class="anchor hidden-xs" href="#LCEVCdec" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-LCEVCdec" aria-hidden="true">TOC</a></span></h3>
  50341. <p>FFmpeg can make use of the liblcevc_dec library for LCEVC enhancement layer
  50342. decoding on supported bitstreams.
  50343. </p>
  50344. <p>Go to <a class="url" href="https://github.com/v-novaltd/LCEVCdec">https://github.com/v-novaltd/LCEVCdec</a> and follow the instructions
  50345. for installing the library. Then pass <code class="code">--enable-liblcevc-dec</code> to configure to
  50346. enable it.
  50347. </p>
  50348. <div class="info">
  50349. <p>LCEVCdec is under the BSD-3-Clause-Clear License.
  50350. </p></div>
  50351. <a name="libilbc-1"></a>
  50352. <h3 class="section">43.14 libilbc<span class="pull-right"><a class="anchor hidden-xs" href="#libilbc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libilbc-1" aria-hidden="true">TOC</a></span></h3>
  50353. <p>iLBC is a narrowband speech codec that has been made freely available
  50354. by Google as part of the WebRTC project. libilbc is a packaging friendly
  50355. copy of the iLBC codec. FFmpeg can make use of the libilbc library for
  50356. iLBC decoding and encoding.
  50357. </p>
  50358. <p>Go to <a class="url" href="https://github.com/TimothyGu/libilbc">https://github.com/TimothyGu/libilbc</a> and follow the instructions for
  50359. installing the library. Then pass <code class="code">--enable-libilbc</code> to configure to
  50360. enable it.
  50361. </p>
  50362. <a name="libjxl"></a>
  50363. <h3 class="section">43.15 libjxl<span class="pull-right"><a class="anchor hidden-xs" href="#libjxl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libjxl" aria-hidden="true">TOC</a></span></h3>
  50364. <p>JPEG XL is an image format intended to fully replace legacy JPEG for an extended
  50365. period of life. See <a class="url" href="https://jpegxl.info/">https://jpegxl.info/</a> for more information, and see
  50366. <a class="url" href="https://github.com/libjxl/libjxl">https://github.com/libjxl/libjxl</a> for the library source. You can pass
  50367. <code class="code">--enable-libjxl</code> to configure in order enable the libjxl wrapper.
  50368. </p>
  50369. <a name="libvpx"></a>
  50370. <h3 class="section">43.16 libvpx<span class="pull-right"><a class="anchor hidden-xs" href="#libvpx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvpx" aria-hidden="true">TOC</a></span></h3>
  50371. <p>FFmpeg can make use of the libvpx library for VP8/VP9 decoding and encoding.
  50372. </p>
  50373. <p>Go to <a class="url" href="http://www.webmproject.org/">http://www.webmproject.org/</a> and follow the instructions for
  50374. installing the library. Then pass <code class="code">--enable-libvpx</code> to configure to
  50375. enable it.
  50376. </p>
  50377. <a name="ModPlug"></a>
  50378. <h3 class="section">43.17 ModPlug<span class="pull-right"><a class="anchor hidden-xs" href="#ModPlug" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ModPlug" aria-hidden="true">TOC</a></span></h3>
  50379. <p>FFmpeg can make use of this library, originating in Modplug-XMMS, to read from MOD-like music files.
  50380. See <a class="url" href="https://github.com/Konstanty/libmodplug">https://github.com/Konstanty/libmodplug</a>. Pass <code class="code">--enable-libmodplug</code> to configure to
  50381. enable it.
  50382. </p>
  50383. <a name="OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries"></a>
  50384. <h3 class="section">43.18 OpenCORE, VisualOn, and Fraunhofer libraries<span class="pull-right"><a class="anchor hidden-xs" href="#OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries" aria-hidden="true">TOC</a></span></h3>
  50385. <p>Spun off Google Android sources, OpenCore, VisualOn and Fraunhofer
  50386. libraries provide encoders for a number of audio codecs.
  50387. </p>
  50388. <div class="info">
  50389. <p>OpenCORE and VisualOn libraries are under the Apache License 2.0
  50390. (see <a class="url" href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a> for details), which is
  50391. incompatible to the LGPL version 2.1 and GPL version 2. You have to
  50392. upgrade FFmpeg&rsquo;s license to LGPL version 3 (or if you have enabled
  50393. GPL components, GPL version 3) by passing <code class="code">--enable-version3</code> to configure in
  50394. order to use it.
  50395. </p>
  50396. <p>The license of the Fraunhofer AAC library is incompatible with the GPL.
  50397. Therefore, for GPL builds, you have to pass <code class="code">--enable-nonfree</code> to
  50398. configure in order to use it. To the best of our knowledge, it is
  50399. compatible with the LGPL.
  50400. </p></div>
  50401. <a name="OpenCORE-AMR"></a>
  50402. <h4 class="subsection">43.18.1 OpenCORE AMR<span class="pull-right"><a class="anchor hidden-xs" href="#OpenCORE-AMR" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenCORE-AMR" aria-hidden="true">TOC</a></span></h4>
  50403. <p>FFmpeg can make use of the OpenCORE libraries for AMR-NB
  50404. decoding/encoding and AMR-WB decoding.
  50405. </p>
  50406. <p>Go to <a class="url" href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  50407. instructions for installing the libraries.
  50408. Then pass <code class="code">--enable-libopencore-amrnb</code> and/or
  50409. <code class="code">--enable-libopencore-amrwb</code> to configure to enable them.
  50410. </p>
  50411. <a name="VisualOn-AMR_002dWB-encoder-library"></a>
  50412. <h4 class="subsection">43.18.2 VisualOn AMR-WB encoder library<span class="pull-right"><a class="anchor hidden-xs" href="#VisualOn-AMR_002dWB-encoder-library" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VisualOn-AMR_002dWB-encoder-library" aria-hidden="true">TOC</a></span></h4>
  50413. <p>FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding.
  50414. </p>
  50415. <p>Go to <a class="url" href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  50416. instructions for installing the library.
  50417. Then pass <code class="code">--enable-libvo-amrwbenc</code> to configure to enable it.
  50418. </p>
  50419. <a name="Fraunhofer-AAC-library"></a>
  50420. <h4 class="subsection">43.18.3 Fraunhofer AAC library<span class="pull-right"><a class="anchor hidden-xs" href="#Fraunhofer-AAC-library" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Fraunhofer-AAC-library" aria-hidden="true">TOC</a></span></h4>
  50421. <p>FFmpeg can make use of the Fraunhofer AAC library for AAC decoding &amp; encoding.
  50422. </p>
  50423. <p>Go to <a class="url" href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  50424. instructions for installing the library.
  50425. Then pass <code class="code">--enable-libfdk-aac</code> to configure to enable it.
  50426. </p>
  50427. <a name="Fraunhofer-MPEG_002dH-3D-Audio-decoder-library"></a>
  50428. <h4 class="subsection">43.18.4 Fraunhofer MPEG-H 3D Audio decoder library<span class="pull-right"><a class="anchor hidden-xs" href="#Fraunhofer-MPEG_002dH-3D-Audio-decoder-library" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Fraunhofer-MPEG_002dH-3D-Audio-decoder-library" aria-hidden="true">TOC</a></span></h4>
  50429. <p>FFmpeg can make use of the Fraunhofer MPEG-H decoder library for MPEG-H 3DA decoding.
  50430. </p>
  50431. <p>Go to <a class="url" href="https://github.com/Fraunhofer-IIS/mpeghdec">https://github.com/Fraunhofer-IIS/mpeghdec</a> and follow the
  50432. instructions for installing the library.
  50433. Then pass <code class="code">--enable-libmpeghdec --enable-nonfree</code> to configure to enable it.
  50434. </p>
  50435. <a name="LC3-library"></a>
  50436. <h4 class="subsection">43.18.5 LC3 library<span class="pull-right"><a class="anchor hidden-xs" href="#LC3-library" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-LC3-library" aria-hidden="true">TOC</a></span></h4>
  50437. <p>FFmpeg can make use of the Google LC3 library for LC3 decoding &amp; encoding.
  50438. </p>
  50439. <p>Go to <a class="url" href="https://github.com/google/liblc3/">https://github.com/google/liblc3/</a> and follow the instructions for
  50440. installing the library.
  50441. Then pass <code class="code">--enable-liblc3</code> to configure to enable it.
  50442. </p>
  50443. <a name="OpenH264"></a>
  50444. <h3 class="section">43.19 OpenH264<span class="pull-right"><a class="anchor hidden-xs" href="#OpenH264" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenH264" aria-hidden="true">TOC</a></span></h3>
  50445. <p>FFmpeg can make use of the OpenH264 library for H.264 decoding and encoding.
  50446. </p>
  50447. <p>Go to <a class="url" href="http://www.openh264.org/">http://www.openh264.org/</a> and follow the instructions for
  50448. installing the library. Then pass <code class="code">--enable-libopenh264</code> to configure to
  50449. enable it.
  50450. </p>
  50451. <p>For decoding, this library is much more limited than the built-in decoder
  50452. in libavcodec; currently, this library lacks support for decoding B-frames
  50453. and some other main/high profile features. (It currently only supports
  50454. constrained baseline profile and CABAC.) Using it is mostly useful for
  50455. testing and for taking advantage of Cisco&rsquo;s patent portfolio license
  50456. (<a class="url" href="http://www.openh264.org/BINARY_LICENSE.txt">http://www.openh264.org/BINARY_LICENSE.txt</a>).
  50457. </p>
  50458. <a name="OpenJPEG"></a>
  50459. <h3 class="section">43.20 OpenJPEG<span class="pull-right"><a class="anchor hidden-xs" href="#OpenJPEG" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenJPEG" aria-hidden="true">TOC</a></span></h3>
  50460. <p>FFmpeg can use the OpenJPEG libraries for decoding/encoding J2K videos. Go to
  50461. <a class="url" href="http://www.openjpeg.org/">http://www.openjpeg.org/</a> to get the libraries and follow the installation
  50462. instructions. To enable using OpenJPEG in FFmpeg, pass <code class="code">--enable-libopenjpeg</code> to
  50463. <samp class="file">./configure</samp>.
  50464. </p>
  50465. <a name="rav1e"></a>
  50466. <h3 class="section">43.21 rav1e<span class="pull-right"><a class="anchor hidden-xs" href="#rav1e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rav1e" aria-hidden="true">TOC</a></span></h3>
  50467. <p>FFmpeg can make use of rav1e (Rust AV1 Encoder) via its C bindings to encode videos.
  50468. Go to <a class="url" href="https://github.com/xiph/rav1e/">https://github.com/xiph/rav1e/</a> and follow the instructions to build
  50469. the C library. To enable using rav1e in FFmpeg, pass <code class="code">--enable-librav1e</code>
  50470. to <samp class="file">./configure</samp>.
  50471. </p>
  50472. <a name="SVT_002dAV1"></a>
  50473. <h3 class="section">43.22 SVT-AV1<span class="pull-right"><a class="anchor hidden-xs" href="#SVT_002dAV1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-SVT_002dAV1" aria-hidden="true">TOC</a></span></h3>
  50474. <p>FFmpeg can make use of the Scalable Video Technology for AV1 library for AV1 encoding.
  50475. </p>
  50476. <p>Go to <a class="url" href="https://gitlab.com/AOMediaCodec/SVT-AV1/">https://gitlab.com/AOMediaCodec/SVT-AV1/</a> and follow the instructions
  50477. for installing the library. Then pass <code class="code">--enable-libsvtav1</code> to configure to
  50478. enable it.
  50479. </p>
  50480. <a name="SVT_002dJPEG_002dXS"></a>
  50481. <h3 class="section">43.23 SVT-JPEG-XS<span class="pull-right"><a class="anchor hidden-xs" href="#SVT_002dJPEG_002dXS" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-SVT_002dJPEG_002dXS" aria-hidden="true">TOC</a></span></h3>
  50482. <p>FFmpeg can make use of the Scalable Video Technology for JPEG-XS library for JPEG-XS
  50483. decoding and encoding.
  50484. </p>
  50485. <p>Go to <a class="url" href="https://github.com/OpenVisualCloud/SVT-JPEG-XS">https://github.com/OpenVisualCloud/SVT-JPEG-XS</a> and follow the instructions
  50486. for installing the library. Then pass <code class="code">--enable-libsvtjpegxs</code> to configure to
  50487. enable it.
  50488. </p>
  50489. <a name="TwoLAME"></a>
  50490. <h3 class="section">43.24 TwoLAME<span class="pull-right"><a class="anchor hidden-xs" href="#TwoLAME" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-TwoLAME" aria-hidden="true">TOC</a></span></h3>
  50491. <p>FFmpeg can make use of the TwoLAME library for MP2 encoding.
  50492. </p>
  50493. <p>Go to <a class="url" href="http://www.twolame.org/">http://www.twolame.org/</a> and follow the
  50494. instructions for installing the library.
  50495. Then pass <code class="code">--enable-libtwolame</code> to configure to enable it.
  50496. </p>
  50497. <a name="VapourSynth"></a>
  50498. <h3 class="section">43.25 VapourSynth<span class="pull-right"><a class="anchor hidden-xs" href="#VapourSynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VapourSynth" aria-hidden="true">TOC</a></span></h3>
  50499. <p>FFmpeg can read VapourSynth scripts as input. To enable support, pass
  50500. <code class="code">--enable-vapoursynth</code> to configure. Vapoursynth is detected via
  50501. <code class="code">pkg-config</code>. Versions 42 or greater supported.
  50502. See <a class="url" href="http://www.vapoursynth.com/">http://www.vapoursynth.com/</a>.
  50503. </p>
  50504. <p>Due to security concerns, Vapoursynth scripts will not
  50505. be autodetected so the input format has to be forced. For ff* CLI tools,
  50506. add <code class="code">-f vapoursynth</code> before the input <code class="code">-i yourscript.vpy</code>.
  50507. </p>
  50508. <a name="x264"></a>
  50509. <h3 class="section">43.26 x264<span class="pull-right"><a class="anchor hidden-xs" href="#x264" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-x264" aria-hidden="true">TOC</a></span></h3>
  50510. <p>FFmpeg can make use of the x264 library for H.264 encoding.
  50511. </p>
  50512. <p>Go to <a class="url" href="http://www.videolan.org/developers/x264.html">http://www.videolan.org/developers/x264.html</a> and follow the
  50513. instructions for installing the library. Then pass <code class="code">--enable-libx264</code> to
  50514. configure to enable it.
  50515. </p>
  50516. <div class="info">
  50517. <p>x264 is under the GNU Public License Version 2 or later
  50518. (see <a class="url" href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">http://www.gnu.org/licenses/old-licenses/gpl-2.0.html</a> for
  50519. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  50520. </p></div>
  50521. <a name="x265"></a>
  50522. <h3 class="section">43.27 x265<span class="pull-right"><a class="anchor hidden-xs" href="#x265" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-x265" aria-hidden="true">TOC</a></span></h3>
  50523. <p>FFmpeg can make use of the x265 library for HEVC encoding.
  50524. </p>
  50525. <p>Go to <a class="url" href="http://x265.org/developers.html">http://x265.org/developers.html</a> and follow the instructions
  50526. for installing the library. Then pass <code class="code">--enable-libx265</code> to configure
  50527. to enable it.
  50528. </p>
  50529. <div class="info">
  50530. <p>x265 is under the GNU Public License Version 2 or later
  50531. (see <a class="url" href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">http://www.gnu.org/licenses/old-licenses/gpl-2.0.html</a> for
  50532. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  50533. </p></div>
  50534. <a name="xavs"></a>
  50535. <h3 class="section">43.28 xavs<span class="pull-right"><a class="anchor hidden-xs" href="#xavs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xavs" aria-hidden="true">TOC</a></span></h3>
  50536. <p>FFmpeg can make use of the xavs library for AVS encoding.
  50537. </p>
  50538. <p>Go to <a class="url" href="http://xavs.sf.net/">http://xavs.sf.net/</a> and follow the instructions for
  50539. installing the library. Then pass <code class="code">--enable-libxavs</code> to configure to
  50540. enable it.
  50541. </p>
  50542. <a name="xavs2"></a>
  50543. <h3 class="section">43.29 xavs2<span class="pull-right"><a class="anchor hidden-xs" href="#xavs2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xavs2" aria-hidden="true">TOC</a></span></h3>
  50544. <p>FFmpeg can make use of the xavs2 library for AVS2-P2/IEEE1857.4 video encoding.
  50545. </p>
  50546. <p>Go to <a class="url" href="https://github.com/pkuvcl/xavs2">https://github.com/pkuvcl/xavs2</a> and follow the instructions for
  50547. installing the library. Then pass <code class="code">--enable-libxavs2</code> to configure to
  50548. enable it.
  50549. </p>
  50550. <div class="info">
  50551. <p>libxavs2 is under the GNU Public License Version 2 or later
  50552. (see <a class="url" href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">http://www.gnu.org/licenses/old-licenses/gpl-2.0.html</a> for
  50553. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  50554. </p></div>
  50555. <a name="eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029"></a>
  50556. <h3 class="section">43.30 eXtra-fast Essential Video Encoder (XEVE)<span class="pull-right"><a class="anchor hidden-xs" href="#eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029" aria-hidden="true">TOC</a></span></h3>
  50557. <p>FFmpeg can make use of the XEVE library for EVC video encoding.
  50558. </p>
  50559. <p>Go to <a class="url" href="https://github.com/mpeg5/xeve">https://github.com/mpeg5/xeve</a> and follow the instructions for
  50560. installing the XEVE library. Then pass <code class="code">--enable-libxeve</code> to configure to
  50561. enable it.
  50562. </p>
  50563. <a name="eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029"></a>
  50564. <h3 class="section">43.31 eXtra-fast Essential Video Decoder (XEVD)<span class="pull-right"><a class="anchor hidden-xs" href="#eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029" aria-hidden="true">TOC</a></span></h3>
  50565. <p>FFmpeg can make use of the XEVD library for EVC video decoding.
  50566. </p>
  50567. <p>Go to <a class="url" href="https://github.com/mpeg5/xevd">https://github.com/mpeg5/xevd</a> and follow the instructions for
  50568. installing the XEVD library. Then pass <code class="code">--enable-libxevd</code> to configure to
  50569. enable it.
  50570. </p>
  50571. <a name="ZVBI"></a>
  50572. <h3 class="section">43.32 ZVBI<span class="pull-right"><a class="anchor hidden-xs" href="#ZVBI" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ZVBI" aria-hidden="true">TOC</a></span></h3>
  50573. <p>ZVBI is a VBI decoding library which can be used by FFmpeg to decode DVB
  50574. teletext pages and DVB teletext subtitles.
  50575. </p>
  50576. <p>Go to <a class="url" href="http://sourceforge.net/projects/zapping/">http://sourceforge.net/projects/zapping/</a> and follow the instructions for
  50577. installing the library. Then pass <code class="code">--enable-libzvbi</code> to configure to
  50578. enable it.
  50579. </p>
  50580. <a name="Supported-File-Formats_002c-Codecs-or-Features"></a>
  50581. <h2 class="chapter">44 Supported File Formats, Codecs or Features<span class="pull-right"><a class="anchor hidden-xs" href="#Supported-File-Formats_002c-Codecs-or-Features" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Supported-File-Formats_002c-Codecs-or-Features" aria-hidden="true">TOC</a></span></h2>
  50582. <p>You can use the <code class="code">-formats</code> and <code class="code">-codecs</code> options to have an exhaustive list.
  50583. </p>
  50584. <a name="File-Formats"></a>
  50585. <h3 class="section">44.1 File Formats<span class="pull-right"><a class="anchor hidden-xs" href="#File-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-File-Formats" aria-hidden="true">TOC</a></span></h3>
  50586. <p>FFmpeg supports the following file formats through the <code class="code">libavformat</code>
  50587. library:
  50588. </p>
  50589. <table class="multitable">
  50590. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  50591. <tr><td width="40%">3dostr</td><td width="10%"></td><td width="10%">X</td></tr>
  50592. <tr><td width="40%">4xm</td><td width="10%"></td><td width="10%">X</td><td width="40%">4X Technologies format, used in some games.</td></tr>
  50593. <tr><td width="40%">8088flex TMV</td><td width="10%"></td><td width="10%">X</td></tr>
  50594. <tr><td width="40%">AAX</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audible Enhanced Audio format, used in audiobooks.</td></tr>
  50595. <tr><td width="40%">AA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audible Format 2, 3, and 4, used in audiobooks.</td></tr>
  50596. <tr><td width="40%">ACT Voice</td><td width="10%"></td><td width="10%">X</td><td width="40%">contains G.729 audio</td></tr>
  50597. <tr><td width="40%">Adobe Filmstrip</td><td width="10%">X</td><td width="10%">X</td></tr>
  50598. <tr><td width="40%">Audio IFF (AIFF)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50599. <tr><td width="40%">American Laser Games MM</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used in games like Mad Dog McCree.</td></tr>
  50600. <tr><td width="40%">3GPP AMR</td><td width="10%">X</td><td width="10%">X</td></tr>
  50601. <tr><td width="40%">Amazing Studio Packed Animation File</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used in game Heart Of Darkness.</td></tr>
  50602. <tr><td width="40%">Apple HTTP Live Streaming</td><td width="10%"></td><td width="10%">X</td></tr>
  50603. <tr><td width="40%">Artworx Data Format</td><td width="10%"></td><td width="10%">X</td></tr>
  50604. <tr><td width="40%">Interplay ACM</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio only format used in some Interplay games.</td></tr>
  50605. <tr><td width="40%">ADP</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used on the Nintendo Gamecube.</td></tr>
  50606. <tr><td width="40%">AFC</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used on the Nintendo Gamecube.</td></tr>
  50607. <tr><td width="40%">ADS/SS2</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used on the PS2.</td></tr>
  50608. <tr><td width="40%">APNG</td><td width="10%">X</td><td width="10%">X</td></tr>
  50609. <tr><td width="40%">ASF</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Advanced / Active Streaming Format.</td></tr>
  50610. <tr><td width="40%">AST</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Audio format used on the Nintendo Wii.</td></tr>
  50611. <tr><td width="40%">AVI</td><td width="10%">X</td><td width="10%">X</td></tr>
  50612. <tr><td width="40%">AviSynth</td><td width="10%"></td><td width="10%">X</td></tr>
  50613. <tr><td width="40%">AVR</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used on Mac.</td></tr>
  50614. <tr><td width="40%">AVS</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used by the Creature Shock game.</td></tr>
  50615. <tr><td width="40%">Beam Software SIFF</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio and video format used in some games by Beam Software.</td></tr>
  50616. <tr><td width="40%">Bethesda Softworks VID</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in some games from Bethesda Softworks.</td></tr>
  50617. <tr><td width="40%">Binary text</td><td width="10%"></td><td width="10%">X</td></tr>
  50618. <tr><td width="40%">Bink</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used by many games.</td></tr>
  50619. <tr><td width="40%">Bink Audio</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio only multimedia format used by some games.</td></tr>
  50620. <tr><td width="40%">Bitmap Brothers JV</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Z and Z95 games.</td></tr>
  50621. <tr><td width="40%">BRP</td><td width="10%"></td><td width="10%">X</td><td width="40%">Argonaut Games format.</td></tr>
  50622. <tr><td width="40%">Brute Force &amp; Ignorance</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in the game Flash Traffic: City of Angels.</td></tr>
  50623. <tr><td width="40%">BFSTM</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used on the Nintendo WiiU (based on BRSTM).</td></tr>
  50624. <tr><td width="40%">BRSTM</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used on the Nintendo Wii.</td></tr>
  50625. <tr><td width="40%">BW64</td><td width="10%"></td><td width="10%">X</td><td width="40%">Broadcast Wave 64bit.</td></tr>
  50626. <tr><td width="40%">BWF</td><td width="10%">X</td><td width="10%">X</td></tr>
  50627. <tr><td width="40%">codec2 (raw)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Must be given -mode format option to decode correctly.</td></tr>
  50628. <tr><td width="40%">codec2 (.c2 files)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Contains header with version and mode info, simplifying playback.</td></tr>
  50629. <tr><td width="40%">CRI ADX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Audio-only format used in console video games.</td></tr>
  50630. <tr><td width="40%">CRI AIX</td><td width="10%"></td><td width="10%">X</td></tr>
  50631. <tr><td width="40%">CRI HCA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio-only format used in console video games.</td></tr>
  50632. <tr><td width="40%">Discworld II BMV</td><td width="10%"></td><td width="10%">X</td></tr>
  50633. <tr><td width="40%">Interplay C93</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in the game Cyberia from Interplay.</td></tr>
  50634. <tr><td width="40%">Delphine Software International CIN</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used by Delphine Software games.</td></tr>
  50635. <tr><td width="40%">Digital Speech Standard (DSS)</td><td width="10%"></td><td width="10%">X</td></tr>
  50636. <tr><td width="40%">CD+G</td><td width="10%"></td><td width="10%">X</td><td width="40%">Video format used by CD+G karaoke disks</td></tr>
  50637. <tr><td width="40%">Phantom Cine</td><td width="10%"></td><td width="10%">X</td></tr>
  50638. <tr><td width="40%">Commodore CDXL</td><td width="10%"></td><td width="10%">X</td><td width="40%">Amiga CD video format</td></tr>
  50639. <tr><td width="40%">Core Audio Format</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Apple Core Audio Format</td></tr>
  50640. <tr><td width="40%">CRC testing format</td><td width="10%">X</td><td width="10%"></td></tr>
  50641. <tr><td width="40%">Creative Voice</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Created for the Sound Blaster Pro.</td></tr>
  50642. <tr><td width="40%">CRYO APC</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used in some games by CRYO Interactive Entertainment.</td></tr>
  50643. <tr><td width="40%">D-Cinema audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  50644. <tr><td width="40%">Deluxe Paint Animation</td><td width="10%"></td><td width="10%">X</td></tr>
  50645. <tr><td width="40%">DCSTR</td><td width="10%"></td><td width="10%">X</td></tr>
  50646. <tr><td width="40%">DFA</td><td width="10%"></td><td width="10%">X</td><td width="40%">This format is used in Chronomaster game</td></tr>
  50647. <tr><td width="40%">DirectDraw Surface</td><td width="10%"></td><td width="10%">X</td></tr>
  50648. <tr><td width="40%">DSD Stream File (DSF)</td><td width="10%"></td><td width="10%">X</td></tr>
  50649. <tr><td width="40%">DV video</td><td width="10%">X</td><td width="10%">X</td></tr>
  50650. <tr><td width="40%">DXA</td><td width="10%"></td><td width="10%">X</td><td width="40%">This format is used in the non-Windows version of the Feeble Files
  50651. game and different game cutscenes repacked for use with ScummVM.</td></tr>
  50652. <tr><td width="40%">Electronic Arts cdata</td><td width="10%"></td><td width="10%">X</td></tr>
  50653. <tr><td width="40%">Electronic Arts Multimedia</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in various EA games; files have extensions like WVE and UV2.</td></tr>
  50654. <tr><td width="40%">Ensoniq Paris Audio File</td><td width="10%"></td><td width="10%">X</td></tr>
  50655. <tr><td width="40%">FFM (FFserver live feed)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50656. <tr><td width="40%">Flash (SWF)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50657. <tr><td width="40%">Flash 9 (AVM2)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Only embedded audio is decoded.</td></tr>
  50658. <tr><td width="40%">FLI/FLC/FLX animation</td><td width="10%"></td><td width="10%">X</td><td width="40%">.fli/.flc files</td></tr>
  50659. <tr><td width="40%">Flash Video (FLV)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Macromedia Flash video files</td></tr>
  50660. <tr><td width="40%">framecrc testing format</td><td width="10%">X</td><td width="10%"></td></tr>
  50661. <tr><td width="40%">FunCom ISS</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used in various games from FunCom like The Longest Journey.</td></tr>
  50662. <tr><td width="40%">G.723.1</td><td width="10%">X</td><td width="10%">X</td></tr>
  50663. <tr><td width="40%">G.726</td><td width="10%"></td><td width="10%">X</td><td width="40%">Both left- and right-justified.</td></tr>
  50664. <tr><td width="40%">G.729 BIT</td><td width="10%">X</td><td width="10%">X</td></tr>
  50665. <tr><td width="40%">G.729 raw</td><td width="10%"></td><td width="10%">X</td></tr>
  50666. <tr><td width="40%">GENH</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format for various games.</td></tr>
  50667. <tr><td width="40%">GIF Animation</td><td width="10%">X</td><td width="10%">X</td></tr>
  50668. <tr><td width="40%">GXF</td><td width="10%">X</td><td width="10%">X</td><td width="40%">General eXchange Format SMPTE 360M, used by Thomson Grass Valley
  50669. playout servers.</td></tr>
  50670. <tr><td width="40%">HNM</td><td width="10%"></td><td width="10%">X</td><td width="40%">Only version 4 supported, used in some games from Cryo Interactive</td></tr>
  50671. <tr><td width="40%">iCEDraw File</td><td width="10%"></td><td width="10%">X</td></tr>
  50672. <tr><td width="40%">ICO</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Microsoft Windows ICO</td></tr>
  50673. <tr><td width="40%">id Quake II CIN video</td><td width="10%"></td><td width="10%">X</td></tr>
  50674. <tr><td width="40%">id RoQ</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in Quake III, Jedi Knight 2 and other computer games.</td></tr>
  50675. <tr><td width="40%">IEC61937 encapsulation</td><td width="10%">X</td><td width="10%">X</td></tr>
  50676. <tr><td width="40%">IFF</td><td width="10%"></td><td width="10%">X</td><td width="40%">Interchange File Format</td></tr>
  50677. <tr><td width="40%">IFV</td><td width="10%"></td><td width="10%">X</td><td width="40%">A format used by some old CCTV DVRs.</td></tr>
  50678. <tr><td width="40%">iLBC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50679. <tr><td width="40%">Interplay MVE</td><td width="10%"></td><td width="10%">X</td><td width="40%">Format used in various Interplay computer games.</td></tr>
  50680. <tr><td width="40%">Iterated Systems ClearVideo</td><td width="10%"></td><td width="10%">X</td><td width="40%">I-frames only</td></tr>
  50681. <tr><td width="40%">IV8</td><td width="10%"></td><td width="10%">X</td><td width="40%">A format generated by IndigoVision 8000 video server.</td></tr>
  50682. <tr><td width="40%">IVF (On2)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">A format used by libvpx</td></tr>
  50683. <tr><td width="40%">Internet Video Recording</td><td width="10%"></td><td width="10%">X</td></tr>
  50684. <tr><td width="40%">IRCAM</td><td width="10%">X</td><td width="10%">X</td></tr>
  50685. <tr><td width="40%">LAF</td><td width="10%"></td><td width="10%">X</td><td width="40%">Limitless Audio Format</td></tr>
  50686. <tr><td width="40%">LATM</td><td width="10%">X</td><td width="10%">X</td></tr>
  50687. <tr><td width="40%">LMLM4</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used by Linux Media Labs MPEG-4 PCI boards</td></tr>
  50688. <tr><td width="40%">LOAS</td><td width="10%"></td><td width="10%">X</td><td width="40%">contains LATM multiplexed AAC audio</td></tr>
  50689. <tr><td width="40%">LRC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50690. <tr><td width="40%">LVF</td><td width="10%"></td><td width="10%">X</td></tr>
  50691. <tr><td width="40%">LXF</td><td width="10%"></td><td width="10%">X</td><td width="40%">VR native stream format, used by Leitch/Harris&rsquo; video servers.</td></tr>
  50692. <tr><td width="40%">Magic Lantern Video (MLV)</td><td width="10%"></td><td width="10%">X</td></tr>
  50693. <tr><td width="40%">Matroska</td><td width="10%">X</td><td width="10%">X</td></tr>
  50694. <tr><td width="40%">Matroska audio</td><td width="10%">X</td><td width="10%"></td></tr>
  50695. <tr><td width="40%">FFmpeg metadata</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Metadata in text format.</td></tr>
  50696. <tr><td width="40%">MAXIS XA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Sim City 3000; file extension .xa.</td></tr>
  50697. <tr><td width="40%">MCA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in some games from Capcom; file extension .mca.</td></tr>
  50698. <tr><td width="40%">MD Studio</td><td width="10%"></td><td width="10%">X</td></tr>
  50699. <tr><td width="40%">Metal Gear Solid: The Twin Snakes</td><td width="10%"></td><td width="10%">X</td></tr>
  50700. <tr><td width="40%">Megalux Frame</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used by Megalux Ultimate Paint</td></tr>
  50701. <tr><td width="40%">MobiClip MODS</td><td width="10%"></td><td width="10%">X</td></tr>
  50702. <tr><td width="40%">MobiClip MOFLEX</td><td width="10%"></td><td width="10%">X</td></tr>
  50703. <tr><td width="40%">Mobotix .mxg</td><td width="10%"></td><td width="10%">X</td></tr>
  50704. <tr><td width="40%">Monkey&rsquo;s Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  50705. <tr><td width="40%">Motion Pixels MVI</td><td width="10%"></td><td width="10%">X</td></tr>
  50706. <tr><td width="40%">MOV/QuickTime/MP4</td><td width="10%">X</td><td width="10%">X</td><td width="40%">3GP, 3GP2, PSP, iPod variants supported</td></tr>
  50707. <tr><td width="40%">MP2</td><td width="10%">X</td><td width="10%">X</td></tr>
  50708. <tr><td width="40%">MP3</td><td width="10%">X</td><td width="10%">X</td></tr>
  50709. <tr><td width="40%">MPEG-1 System</td><td width="10%">X</td><td width="10%">X</td><td width="40%">muxed audio and video, VCD format supported</td></tr>
  50710. <tr><td width="40%">MPEG-PS (program stream)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">also known as <code class="code">VOB</code> file, SVCD and DVD format supported</td></tr>
  50711. <tr><td width="40%">MPEG-TS (transport stream)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">also known as DVB Transport Stream</td></tr>
  50712. <tr><td width="40%">MPEG-4</td><td width="10%">X</td><td width="10%">X</td><td width="40%">MPEG-4 is a variant of QuickTime.</td></tr>
  50713. <tr><td width="40%">MSF</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used on the PS3.</td></tr>
  50714. <tr><td width="40%">Mirillis FIC video</td><td width="10%"></td><td width="10%">X</td><td width="40%">No cursor rendering.</td></tr>
  50715. <tr><td width="40%">MIDI Sample Dump Standard</td><td width="10%"></td><td width="10%">X</td></tr>
  50716. <tr><td width="40%">MIME multipart JPEG</td><td width="10%">X</td><td width="10%"></td></tr>
  50717. <tr><td width="40%">MSN TCP webcam</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used by MSN Messenger webcam streams.</td></tr>
  50718. <tr><td width="40%">MTV</td><td width="10%"></td><td width="10%">X</td></tr>
  50719. <tr><td width="40%">Musepack</td><td width="10%"></td><td width="10%">X</td></tr>
  50720. <tr><td width="40%">Musepack SV8</td><td width="10%"></td><td width="10%">X</td></tr>
  50721. <tr><td width="40%">Material eXchange Format (MXF)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">SMPTE 377M, used by D-Cinema, broadcast industry.</td></tr>
  50722. <tr><td width="40%">Material eXchange Format (MXF), D-10 Mapping</td><td width="10%">X</td><td width="10%">X</td><td width="40%">SMPTE 386M, D-10/IMX Mapping.</td></tr>
  50723. <tr><td width="40%">NC camera feed</td><td width="10%"></td><td width="10%">X</td><td width="40%">NC (AVIP NC4600) camera streams</td></tr>
  50724. <tr><td width="40%">NIST SPeech HEader REsources</td><td width="10%"></td><td width="10%">X</td></tr>
  50725. <tr><td width="40%">Computerized Speech Lab NSP</td><td width="10%"></td><td width="10%">X</td></tr>
  50726. <tr><td width="40%">NTT TwinVQ (VQF)</td><td width="10%"></td><td width="10%">X</td><td width="40%">Nippon Telegraph and Telephone Corporation TwinVQ.</td></tr>
  50727. <tr><td width="40%">Nullsoft Streaming Video</td><td width="10%"></td><td width="10%">X</td></tr>
  50728. <tr><td width="40%">NuppelVideo</td><td width="10%"></td><td width="10%">X</td></tr>
  50729. <tr><td width="40%">NUT</td><td width="10%">X</td><td width="10%">X</td><td width="40%">NUT Open Container Format</td></tr>
  50730. <tr><td width="40%">Ogg</td><td width="10%">X</td><td width="10%">X</td></tr>
  50731. <tr><td width="40%">Playstation Portable PMP</td><td width="10%"></td><td width="10%">X</td></tr>
  50732. <tr><td width="40%">Portable Voice Format</td><td width="10%"></td><td width="10%">X</td></tr>
  50733. <tr><td width="40%">RK Audio (RKA)</td><td width="10%"></td><td width="10%">X</td></tr>
  50734. <tr><td width="40%">TechnoTrend PVA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used by TechnoTrend DVB PCI boards.</td></tr>
  50735. <tr><td width="40%">QCP</td><td width="10%"></td><td width="10%">X</td></tr>
  50736. <tr><td width="40%">raw ADTS (AAC)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50737. <tr><td width="40%">raw AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  50738. <tr><td width="40%">raw AMR-NB</td><td width="10%"></td><td width="10%">X</td></tr>
  50739. <tr><td width="40%">raw AMR-WB</td><td width="10%"></td><td width="10%">X</td></tr>
  50740. <tr><td width="40%">raw APAC</td><td width="10%"></td><td width="10%">X</td></tr>
  50741. <tr><td width="40%">raw APV</td><td width="10%">X</td><td width="10%">X</td></tr>
  50742. <tr><td width="40%">raw aptX</td><td width="10%">X</td><td width="10%">X</td></tr>
  50743. <tr><td width="40%">raw aptX HD</td><td width="10%">X</td><td width="10%">X</td></tr>
  50744. <tr><td width="40%">raw Bonk</td><td width="10%"></td><td width="10%">X</td></tr>
  50745. <tr><td width="40%">raw Chinese AVS video</td><td width="10%">X</td><td width="10%">X</td></tr>
  50746. <tr><td width="40%">raw DFPWM</td><td width="10%">X</td><td width="10%">X</td></tr>
  50747. <tr><td width="40%">raw Dirac</td><td width="10%">X</td><td width="10%">X</td></tr>
  50748. <tr><td width="40%">raw DNxHD</td><td width="10%">X</td><td width="10%">X</td></tr>
  50749. <tr><td width="40%">raw DTS</td><td width="10%">X</td><td width="10%">X</td></tr>
  50750. <tr><td width="40%">raw DTS-HD</td><td width="10%"></td><td width="10%">X</td></tr>
  50751. <tr><td width="40%">raw E-AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  50752. <tr><td width="40%">raw EVC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50753. <tr><td width="40%">raw FLAC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50754. <tr><td width="40%">raw G.728</td><td width="10%"></td><td width="10%">X</td></tr>
  50755. <tr><td width="40%">raw GSM</td><td width="10%"></td><td width="10%">X</td></tr>
  50756. <tr><td width="40%">raw H.261</td><td width="10%">X</td><td width="10%">X</td></tr>
  50757. <tr><td width="40%">raw H.263</td><td width="10%">X</td><td width="10%">X</td></tr>
  50758. <tr><td width="40%">raw H.264</td><td width="10%">X</td><td width="10%">X</td></tr>
  50759. <tr><td width="40%">raw HEVC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50760. <tr><td width="40%">raw Ingenient MJPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  50761. <tr><td width="40%">raw MJPEG</td><td width="10%">X</td><td width="10%">X</td></tr>
  50762. <tr><td width="40%">raw MLP</td><td width="10%"></td><td width="10%">X</td></tr>
  50763. <tr><td width="40%">raw MPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  50764. <tr><td width="40%">raw MPEG-1</td><td width="10%"></td><td width="10%">X</td></tr>
  50765. <tr><td width="40%">raw MPEG-2</td><td width="10%"></td><td width="10%">X</td></tr>
  50766. <tr><td width="40%">raw MPEG-4</td><td width="10%">X</td><td width="10%">X</td></tr>
  50767. <tr><td width="40%">raw NULL</td><td width="10%">X</td><td width="10%"></td></tr>
  50768. <tr><td width="40%">raw video</td><td width="10%">X</td><td width="10%">X</td></tr>
  50769. <tr><td width="40%">raw id RoQ</td><td width="10%">X</td><td width="10%"></td></tr>
  50770. <tr><td width="40%">raw OBU</td><td width="10%">X</td><td width="10%">X</td></tr>
  50771. <tr><td width="40%">raw OSQ</td><td width="10%"></td><td width="10%">X</td></tr>
  50772. <tr><td width="40%">raw SBC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50773. <tr><td width="40%">raw Shorten</td><td width="10%"></td><td width="10%">X</td></tr>
  50774. <tr><td width="40%">raw TAK</td><td width="10%"></td><td width="10%">X</td></tr>
  50775. <tr><td width="40%">raw TrueHD</td><td width="10%">X</td><td width="10%">X</td></tr>
  50776. <tr><td width="40%">raw VC-1</td><td width="10%">X</td><td width="10%">X</td></tr>
  50777. <tr><td width="40%">raw PCM A-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  50778. <tr><td width="40%">raw PCM mu-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  50779. <tr><td width="40%">raw PCM Archimedes VIDC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50780. <tr><td width="40%">raw PCM signed 8 bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  50781. <tr><td width="40%">raw PCM signed 16 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50782. <tr><td width="40%">raw PCM signed 16 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50783. <tr><td width="40%">raw PCM signed 24 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50784. <tr><td width="40%">raw PCM signed 24 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50785. <tr><td width="40%">raw PCM signed 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50786. <tr><td width="40%">raw PCM signed 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50787. <tr><td width="40%">raw PCM signed 64 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50788. <tr><td width="40%">raw PCM signed 64 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50789. <tr><td width="40%">raw PCM unsigned 8 bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  50790. <tr><td width="40%">raw PCM unsigned 16 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50791. <tr><td width="40%">raw PCM unsigned 16 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50792. <tr><td width="40%">raw PCM unsigned 24 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50793. <tr><td width="40%">raw PCM unsigned 24 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50794. <tr><td width="40%">raw PCM unsigned 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50795. <tr><td width="40%">raw PCM unsigned 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50796. <tr><td width="40%">raw PCM 16.8 floating point little-endian</td><td width="10%"></td><td width="10%">X</td></tr>
  50797. <tr><td width="40%">raw PCM 24.0 floating point little-endian</td><td width="10%"></td><td width="10%">X</td></tr>
  50798. <tr><td width="40%">raw PCM floating-point 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50799. <tr><td width="40%">raw PCM floating-point 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50800. <tr><td width="40%">raw PCM floating-point 64 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50801. <tr><td width="40%">raw PCM floating-point 64 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50802. <tr><td width="40%">RDT</td><td width="10%"></td><td width="10%">X</td></tr>
  50803. <tr><td width="40%">REDCODE R3D</td><td width="10%"></td><td width="10%">X</td><td width="40%">File format used by RED Digital cameras, contains JPEG 2000 frames and PCM audio.</td></tr>
  50804. <tr><td width="40%">RealMedia</td><td width="10%">X</td><td width="10%">X</td></tr>
  50805. <tr><td width="40%">Redirector</td><td width="10%"></td><td width="10%">X</td></tr>
  50806. <tr><td width="40%">RedSpark</td><td width="10%"></td><td width="10%">X</td></tr>
  50807. <tr><td width="40%">Renderware TeXture Dictionary</td><td width="10%"></td><td width="10%">X</td></tr>
  50808. <tr><td width="40%">Resolume DXV</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Encoding is only supported for the DXT1 (Normal Quality, No Alpha) texture format.</td></tr>
  50809. <tr><td width="40%">RF64</td><td width="10%"></td><td width="10%">X</td></tr>
  50810. <tr><td width="40%">RL2</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio and video format used in some games by Entertainment Software Partners.</td></tr>
  50811. <tr><td width="40%">RPL/ARMovie</td><td width="10%"></td><td width="10%">X</td></tr>
  50812. <tr><td width="40%">Lego Mindstorms RSO</td><td width="10%">X</td><td width="10%">X</td></tr>
  50813. <tr><td width="40%">RSD</td><td width="10%"></td><td width="10%">X</td></tr>
  50814. <tr><td width="40%">RTMP</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Output is performed by publishing stream to RTMP server</td></tr>
  50815. <tr><td width="40%">RTP</td><td width="10%">X</td><td width="10%">X</td></tr>
  50816. <tr><td width="40%">RTSP</td><td width="10%">X</td><td width="10%">X</td></tr>
  50817. <tr><td width="40%">Sample Dump eXchange</td><td width="10%"></td><td width="10%">X</td></tr>
  50818. <tr><td width="40%">SAP</td><td width="10%">X</td><td width="10%">X</td></tr>
  50819. <tr><td width="40%">SBG</td><td width="10%"></td><td width="10%">X</td></tr>
  50820. <tr><td width="40%">SDNS</td><td width="10%"></td><td width="10%">X</td></tr>
  50821. <tr><td width="40%">SDP</td><td width="10%"></td><td width="10%">X</td></tr>
  50822. <tr><td width="40%">SER</td><td width="10%"></td><td width="10%">X</td></tr>
  50823. <tr><td width="40%">Digital Pictures SGA</td><td width="10%"></td><td width="10%">X</td></tr>
  50824. <tr><td width="40%">Sega FILM/CPK</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in many Sega Saturn console games.</td></tr>
  50825. <tr><td width="40%">Silicon Graphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  50826. <tr><td width="40%">Sierra SOL</td><td width="10%"></td><td width="10%">X</td><td width="40%">.sol files used in Sierra Online games.</td></tr>
  50827. <tr><td width="40%">Sierra VMD</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Sierra CD-ROM games.</td></tr>
  50828. <tr><td width="40%">Smacker</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used by many games.</td></tr>
  50829. <tr><td width="40%">SMJPEG</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in certain Loki game ports.</td></tr>
  50830. <tr><td width="40%">SMPTE 337M encapsulation</td><td width="10%"></td><td width="10%">X</td></tr>
  50831. <tr><td width="40%">Smush</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used in some LucasArts games.</td></tr>
  50832. <tr><td width="40%">Sony OpenMG (OMA)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Audio format used in Sony Sonic Stage and Sony Vegas.</td></tr>
  50833. <tr><td width="40%">Sony PlayStation STR</td><td width="10%"></td><td width="10%">X</td></tr>
  50834. <tr><td width="40%">Sony Wave64 (W64)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50835. <tr><td width="40%">SoX native format</td><td width="10%">X</td><td width="10%">X</td></tr>
  50836. <tr><td width="40%">SUN AU format</td><td width="10%">X</td><td width="10%">X</td></tr>
  50837. <tr><td width="40%">SUP raw PGS subtitles</td><td width="10%">X</td><td width="10%">X</td></tr>
  50838. <tr><td width="40%">SVAG</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used in Konami PS2 games.</td></tr>
  50839. <tr><td width="40%">TDSC</td><td width="10%"></td><td width="10%">X</td></tr>
  50840. <tr><td width="40%">Text files</td><td width="10%"></td><td width="10%">X</td></tr>
  50841. <tr><td width="40%">THP</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used on the Nintendo GameCube.</td></tr>
  50842. <tr><td width="40%">Tiertex Limited SEQ</td><td width="10%"></td><td width="10%">X</td><td width="40%">Tiertex .seq files used in the DOS CD-ROM version of the game Flashback.</td></tr>
  50843. <tr><td width="40%">True Audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  50844. <tr><td width="40%">VAG</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used in many Sony PS2 games.</td></tr>
  50845. <tr><td width="40%">VC-1 test bitstream</td><td width="10%">X</td><td width="10%">X</td></tr>
  50846. <tr><td width="40%">Vidvox Hap</td><td width="10%">X</td><td width="10%">X</td></tr>
  50847. <tr><td width="40%">Vivo</td><td width="10%"></td><td width="10%">X</td></tr>
  50848. <tr><td width="40%">VPK</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used in Sony PS games.</td></tr>
  50849. <tr><td width="40%">Marble WADY</td><td width="10%"></td><td width="10%">X</td></tr>
  50850. <tr><td width="40%">WAV</td><td width="10%">X</td><td width="10%">X</td></tr>
  50851. <tr><td width="40%">Waveform Archiver</td><td width="10%"></td><td width="10%">X</td></tr>
  50852. <tr><td width="40%">WavPack</td><td width="10%">X</td><td width="10%">X</td></tr>
  50853. <tr><td width="40%">WebM</td><td width="10%">X</td><td width="10%">X</td></tr>
  50854. <tr><td width="40%">Windows Televison (WTV)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50855. <tr><td width="40%">Wing Commander III movie</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used in Origin&rsquo;s Wing Commander III computer game.</td></tr>
  50856. <tr><td width="40%">Westwood Studios audio</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Multimedia format used in Westwood Studios games.</td></tr>
  50857. <tr><td width="40%">Westwood Studios VQA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used in Westwood Studios games.</td></tr>
  50858. <tr><td width="40%">Wideband Single-bit Data (WSD)</td><td width="10%"></td><td width="10%">X</td></tr>
  50859. <tr><td width="40%">WVE</td><td width="10%"></td><td width="10%">X</td></tr>
  50860. <tr><td width="40%">Konami XMD</td><td width="10%"></td><td width="10%">X</td></tr>
  50861. <tr><td width="40%">XMV</td><td width="10%"></td><td width="10%">X</td><td width="40%">Microsoft video container used in Xbox games.</td></tr>
  50862. <tr><td width="40%">XVAG</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used on the PS3.</td></tr>
  50863. <tr><td width="40%">xWMA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Microsoft audio container used by XAudio 2.</td></tr>
  50864. <tr><td width="40%">eXtended BINary text (XBIN)</td><td width="10%"></td><td width="10%">X</td></tr>
  50865. <tr><td width="40%">YUV4MPEG pipe</td><td width="10%">X</td><td width="10%">X</td></tr>
  50866. <tr><td width="40%">Psygnosis YOP</td><td width="10%"></td><td width="10%">X</td></tr>
  50867. </tbody>
  50868. </table>
  50869. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  50870. </p>
  50871. <a name="Image-Formats"></a>
  50872. <h3 class="section">44.2 Image Formats<span class="pull-right"><a class="anchor hidden-xs" href="#Image-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Image-Formats" aria-hidden="true">TOC</a></span></h3>
  50873. <p>FFmpeg can read and write images for each frame of a video sequence. The
  50874. following image formats are supported:
  50875. </p>
  50876. <table class="multitable">
  50877. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  50878. <tr><td width="40%">.Y.U.V</td><td width="10%">X</td><td width="10%">X</td><td width="40%">one raw file per component</td></tr>
  50879. <tr><td width="40%">Alias PIX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Alias/Wavefront PIX image format</td></tr>
  50880. <tr><td width="40%">animated GIF</td><td width="10%">X</td><td width="10%">X</td></tr>
  50881. <tr><td width="40%">APNG</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Animated Portable Network Graphics</td></tr>
  50882. <tr><td width="40%">BMP</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Microsoft BMP image</td></tr>
  50883. <tr><td width="40%">BRender PIX</td><td width="10%"></td><td width="10%">X</td><td width="40%">Argonaut BRender 3D engine image format.</td></tr>
  50884. <tr><td width="40%">CRI</td><td width="10%"></td><td width="10%">X</td><td width="40%">Cintel RAW</td></tr>
  50885. <tr><td width="40%">DPX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Digital Picture Exchange</td></tr>
  50886. <tr><td width="40%">EXR</td><td width="10%"></td><td width="10%">X</td><td width="40%">OpenEXR</td></tr>
  50887. <tr><td width="40%">FITS</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Flexible Image Transport System</td></tr>
  50888. <tr><td width="40%">HDR</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Radiance HDR RGBE Image format</td></tr>
  50889. <tr><td width="40%">IMG</td><td width="10%"></td><td width="10%">X</td><td width="40%">GEM Raster image</td></tr>
  50890. <tr><td width="40%">JPEG</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Progressive JPEG is not supported.</td></tr>
  50891. <tr><td width="40%">JPEG 2000</td><td width="10%">X</td><td width="10%">X</td></tr>
  50892. <tr><td width="40%">JPEG-LS</td><td width="10%">X</td><td width="10%">X</td></tr>
  50893. <tr><td width="40%">JPEG-XS</td><td width="10%">E</td><td width="10%">E</td><td width="40%">Supported through external library libsvtjpegxs</td></tr>
  50894. <tr><td width="40%">LJPEG</td><td width="10%">X</td><td width="10%"></td><td width="40%">Lossless JPEG</td></tr>
  50895. <tr><td width="40%">Media 100</td><td width="10%"></td><td width="10%">X</td></tr>
  50896. <tr><td width="40%">MSP</td><td width="10%"></td><td width="10%">X</td><td width="40%">Microsoft Paint image</td></tr>
  50897. <tr><td width="40%">PAM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">PAM is a PNM extension with alpha support.</td></tr>
  50898. <tr><td width="40%">PBM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable BitMap image</td></tr>
  50899. <tr><td width="40%">PCD</td><td width="10%"></td><td width="10%">X</td><td width="40%">PhotoCD</td></tr>
  50900. <tr><td width="40%">PCX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">PC Paintbrush</td></tr>
  50901. <tr><td width="40%">PFM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable FloatMap image</td></tr>
  50902. <tr><td width="40%">PGM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable GrayMap image</td></tr>
  50903. <tr><td width="40%">PGMYUV</td><td width="10%">X</td><td width="10%">X</td><td width="40%">PGM with U and V components in YUV 4:2:0</td></tr>
  50904. <tr><td width="40%">PGX</td><td width="10%"></td><td width="10%">X</td><td width="40%">PGX file decoder</td></tr>
  50905. <tr><td width="40%">PHM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable HalfFloatMap image</td></tr>
  50906. <tr><td width="40%">PIC</td><td width="10%"></td><td width="10%">X</td><td width="40%">Pictor/PC Paint</td></tr>
  50907. <tr><td width="40%">PNG</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable Network Graphics image</td></tr>
  50908. <tr><td width="40%">PPM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable PixelMap image</td></tr>
  50909. <tr><td width="40%">PSD</td><td width="10%"></td><td width="10%">X</td><td width="40%">Photoshop</td></tr>
  50910. <tr><td width="40%">PTX</td><td width="10%"></td><td width="10%">X</td><td width="40%">V.Flash PTX format</td></tr>
  50911. <tr><td width="40%">QOI</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Quite OK Image format</td></tr>
  50912. <tr><td width="40%">SGI</td><td width="10%">X</td><td width="10%">X</td><td width="40%">SGI RGB image format</td></tr>
  50913. <tr><td width="40%">Sun Rasterfile</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Sun RAS image format</td></tr>
  50914. <tr><td width="40%">TIFF</td><td width="10%">X</td><td width="10%">X</td><td width="40%">YUV, JPEG and some extension is not supported yet.</td></tr>
  50915. <tr><td width="40%">Truevision Targa</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Targa (.TGA) image format</td></tr>
  50916. <tr><td width="40%">VBN</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Vizrt Binary Image format</td></tr>
  50917. <tr><td width="40%">WBMP</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Wireless Application Protocol Bitmap image format</td></tr>
  50918. <tr><td width="40%">WebP</td><td width="10%">E</td><td width="10%">X</td><td width="40%">WebP image format, encoding supported through external library libwebp</td></tr>
  50919. <tr><td width="40%">XBM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">X BitMap image format</td></tr>
  50920. <tr><td width="40%">XFace</td><td width="10%">X</td><td width="10%">X</td><td width="40%">X-Face image format</td></tr>
  50921. <tr><td width="40%">XPM</td><td width="10%"></td><td width="10%">X</td><td width="40%">X PixMap image format</td></tr>
  50922. <tr><td width="40%">XWD</td><td width="10%">X</td><td width="10%">X</td><td width="40%">X Window Dump image format</td></tr>
  50923. </tbody>
  50924. </table>
  50925. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  50926. </p>
  50927. <p><code class="code">E</code> means that support is provided through an external library.
  50928. </p>
  50929. <a name="Video-Codecs"></a>
  50930. <h3 class="section">44.3 Video Codecs<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Codecs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Codecs" aria-hidden="true">TOC</a></span></h3>
  50931. <table class="multitable">
  50932. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  50933. <tr><td width="40%">4X Movie</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in certain computer games.</td></tr>
  50934. <tr><td width="40%">8088flex TMV</td><td width="10%"></td><td width="10%">X</td></tr>
  50935. <tr><td width="40%">A64 multicolor</td><td width="10%">X</td><td width="10%"></td><td width="40%">Creates video suitable to be played on a commodore 64 (multicolor mode).</td></tr>
  50936. <tr><td width="40%">Amazing Studio PAF Video</td><td width="10%"></td><td width="10%">X</td></tr>
  50937. <tr><td width="40%">American Laser Games MM</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in games like Mad Dog McCree.</td></tr>
  50938. <tr><td width="40%">Amuse Graphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  50939. <tr><td width="40%">AMV Video</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in Chinese MP3 players.</td></tr>
  50940. <tr><td width="40%">ANSI/ASCII art</td><td width="10%"></td><td width="10%">X</td></tr>
  50941. <tr><td width="40%">Apple Intermediate Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  50942. <tr><td width="40%">Apple MJPEG-B</td><td width="10%"></td><td width="10%">X</td></tr>
  50943. <tr><td width="40%">Apple Pixlet</td><td width="10%"></td><td width="10%">X</td></tr>
  50944. <tr><td width="40%">Apple ProRes</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: apch,apcn,apcs,apco,ap4h,ap4x</td></tr>
  50945. <tr><td width="40%">Apple QuickDraw</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: qdrw</td></tr>
  50946. <tr><td width="40%">APV</td><td width="10%"></td><td width="10%">X</td></tr>
  50947. <tr><td width="40%">Argonaut Video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in some Argonaut games.</td></tr>
  50948. <tr><td width="40%">Asus v1</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: ASV1</td></tr>
  50949. <tr><td width="40%">Asus v2</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: ASV2</td></tr>
  50950. <tr><td width="40%">ATI VCR1</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VCR1</td></tr>
  50951. <tr><td width="40%">ATI VCR2</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VCR2</td></tr>
  50952. <tr><td width="40%">Auravision Aura</td><td width="10%"></td><td width="10%">X</td></tr>
  50953. <tr><td width="40%">Auravision Aura 2</td><td width="10%"></td><td width="10%">X</td></tr>
  50954. <tr><td width="40%">Autodesk Animator Flic video</td><td width="10%"></td><td width="10%">X</td></tr>
  50955. <tr><td width="40%">Autodesk RLE</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: AASC</td></tr>
  50956. <tr><td width="40%">AV1</td><td width="10%">E</td><td width="10%">E</td><td width="40%">Supported through external libraries libaom, libdav1d, librav1e and libsvtav1</td></tr>
  50957. <tr><td width="40%">Avid 1:1 10-bit RGB Packer</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: AVrp</td></tr>
  50958. <tr><td width="40%">AVS (Audio Video Standard) video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Video encoding used by the Creature Shock game.</td></tr>
  50959. <tr><td width="40%">AVS2-P2/IEEE1857.4</td><td width="10%">E</td><td width="10%">E</td><td width="40%">Supported through external libraries libxavs2 and libdavs2</td></tr>
  50960. <tr><td width="40%">AVS3-P2/IEEE1857.10</td><td width="10%"></td><td width="10%">E</td><td width="40%">Supported through external library libuavs3d</td></tr>
  50961. <tr><td width="40%">AYUV</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Microsoft uncompressed packed 4:4:4:4</td></tr>
  50962. <tr><td width="40%">Beam Software VB</td><td width="10%"></td><td width="10%">X</td></tr>
  50963. <tr><td width="40%">Bethesda VID video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in some games from Bethesda Softworks.</td></tr>
  50964. <tr><td width="40%">Bink Video</td><td width="10%"></td><td width="10%">X</td></tr>
  50965. <tr><td width="40%">BitJazz SheerVideo</td><td width="10%"></td><td width="10%">X</td></tr>
  50966. <tr><td width="40%">Bitmap Brothers JV video</td><td width="10%"></td><td width="10%">X</td></tr>
  50967. <tr><td width="40%">y41p Brooktree uncompressed 4:1:1 12-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  50968. <tr><td width="40%">Brooktree ProSumer Video</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: BT20</td></tr>
  50969. <tr><td width="40%">Brute Force &amp; Ignorance</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in the game Flash Traffic: City of Angels.</td></tr>
  50970. <tr><td width="40%">C93 video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in Cyberia game.</td></tr>
  50971. <tr><td width="40%">CamStudio</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: CSCD</td></tr>
  50972. <tr><td width="40%">CD+G</td><td width="10%"></td><td width="10%">X</td><td width="40%">Video codec for CD+G karaoke disks</td></tr>
  50973. <tr><td width="40%">CDXL</td><td width="10%"></td><td width="10%">X</td><td width="40%">Amiga CD video codec</td></tr>
  50974. <tr><td width="40%">Chinese AVS video</td><td width="10%">E</td><td width="10%">X</td><td width="40%">AVS1-P2, JiZhun profile, encoding through external library libxavs</td></tr>
  50975. <tr><td width="40%">Delphine Software International CIN video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in Delphine Software International games.</td></tr>
  50976. <tr><td width="40%">Discworld II BMV Video</td><td width="10%"></td><td width="10%">X</td></tr>
  50977. <tr><td width="40%">CineForm HD</td><td width="10%">X</td><td width="10%">X</td></tr>
  50978. <tr><td width="40%">Canopus HQ</td><td width="10%"></td><td width="10%">X</td></tr>
  50979. <tr><td width="40%">Canopus HQA</td><td width="10%"></td><td width="10%">X</td></tr>
  50980. <tr><td width="40%">Canopus HQX</td><td width="10%"></td><td width="10%">X</td></tr>
  50981. <tr><td width="40%">Canopus Lossless Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  50982. <tr><td width="40%">CDToons</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in various Broderbund games.</td></tr>
  50983. <tr><td width="40%">Cinepak</td><td width="10%"></td><td width="10%">X</td></tr>
  50984. <tr><td width="40%">Cirrus Logic AccuPak</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: CLJR</td></tr>
  50985. <tr><td width="40%">CPiA Video Format</td><td width="10%"></td><td width="10%">X</td></tr>
  50986. <tr><td width="40%">Creative YUV (CYUV)</td><td width="10%"></td><td width="10%">X</td></tr>
  50987. <tr><td width="40%">DFA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in Chronomaster game.</td></tr>
  50988. <tr><td width="40%">Dirac</td><td width="10%">E</td><td width="10%">X</td><td width="40%">supported though the native vc2 (Dirac Pro) encoder</td></tr>
  50989. <tr><td width="40%">Deluxe Paint Animation</td><td width="10%"></td><td width="10%">X</td></tr>
  50990. <tr><td width="40%">DNxHD</td><td width="10%">X</td><td width="10%">X</td><td width="40%">aka SMPTE VC3</td></tr>
  50991. <tr><td width="40%">Duck TrueMotion 1.0</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: DUCK</td></tr>
  50992. <tr><td width="40%">Duck TrueMotion 2.0</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: TM20</td></tr>
  50993. <tr><td width="40%">Duck TrueMotion 2.0 RT</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: TR20</td></tr>
  50994. <tr><td width="40%">DV (Digital Video)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50995. <tr><td width="40%">Dxtory capture format</td><td width="10%"></td><td width="10%">X</td></tr>
  50996. <tr><td width="40%">Feeble Files/ScummVM DXA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec originally used in Feeble Files game.</td></tr>
  50997. <tr><td width="40%">Electronic Arts CMV video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in NHL 95 game.</td></tr>
  50998. <tr><td width="40%">Electronic Arts Madcow video</td><td width="10%"></td><td width="10%">X</td></tr>
  50999. <tr><td width="40%">Electronic Arts TGV video</td><td width="10%"></td><td width="10%">X</td></tr>
  51000. <tr><td width="40%">Electronic Arts TGQ video</td><td width="10%"></td><td width="10%">X</td></tr>
  51001. <tr><td width="40%">Electronic Arts TQI video</td><td width="10%"></td><td width="10%">X</td></tr>
  51002. <tr><td width="40%">Escape 124</td><td width="10%"></td><td width="10%">X</td></tr>
  51003. <tr><td width="40%">Escape 130</td><td width="10%"></td><td width="10%">X</td></tr>
  51004. <tr><td width="40%">EVC / MPEG-5 Part 1</td><td width="10%">E</td><td width="10%">E</td><td width="40%">encoding and decoding supported through external libraries libxeve and libxevd</td></tr>
  51005. <tr><td width="40%">FFmpeg video codec #1</td><td width="10%">X</td><td width="10%">X</td><td width="40%">lossless codec (fourcc: FFV1)</td></tr>
  51006. <tr><td width="40%">Flash Screen Video v1</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: FSV1</td></tr>
  51007. <tr><td width="40%">Flash Screen Video v2</td><td width="10%">X</td><td width="10%">X</td></tr>
  51008. <tr><td width="40%">Flash Video (FLV)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Sorenson H.263 used in Flash</td></tr>
  51009. <tr><td width="40%">FM Screen Capture Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  51010. <tr><td width="40%">Forward Uncompressed</td><td width="10%"></td><td width="10%">X</td></tr>
  51011. <tr><td width="40%">Fraps</td><td width="10%"></td><td width="10%">X</td></tr>
  51012. <tr><td width="40%">Go2Meeting</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: G2M2, G2M3</td></tr>
  51013. <tr><td width="40%">Go2Webinar</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: G2M4</td></tr>
  51014. <tr><td width="40%">Gremlin Digital Video</td><td width="10%"></td><td width="10%">X</td></tr>
  51015. <tr><td width="40%">H.261</td><td width="10%">X</td><td width="10%">X</td></tr>
  51016. <tr><td width="40%">H.263 / H.263-1996</td><td width="10%">X</td><td width="10%">X</td></tr>
  51017. <tr><td width="40%">H.263+ / H.263-1998 / H.263 version 2</td><td width="10%">X</td><td width="10%">X</td></tr>
  51018. <tr><td width="40%">H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libx264 and OpenH264</td></tr>
  51019. <tr><td width="40%">HEVC</td><td width="10%">X</td><td width="10%">X</td><td width="40%">encoding supported through external library libx265 and libkvazaar</td></tr>
  51020. <tr><td width="40%">HNM version 4</td><td width="10%"></td><td width="10%">X</td></tr>
  51021. <tr><td width="40%">HuffYUV</td><td width="10%">X</td><td width="10%">X</td></tr>
  51022. <tr><td width="40%">HuffYUV FFmpeg variant</td><td width="10%">X</td><td width="10%">X</td></tr>
  51023. <tr><td width="40%">IBM Ultimotion</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: ULTI</td></tr>
  51024. <tr><td width="40%">id Cinematic video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Quake II.</td></tr>
  51025. <tr><td width="40%">id RoQ video</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in Quake III, Jedi Knight 2, other computer games.</td></tr>
  51026. <tr><td width="40%">IFF ILBM</td><td width="10%"></td><td width="10%">X</td><td width="40%">IFF interleaved bitmap</td></tr>
  51027. <tr><td width="40%">IFF ByteRun1</td><td width="10%"></td><td width="10%">X</td><td width="40%">IFF run length encoded bitmap</td></tr>
  51028. <tr><td width="40%">Infinity IMM4</td><td width="10%"></td><td width="10%">X</td></tr>
  51029. <tr><td width="40%">Intel H.263</td><td width="10%"></td><td width="10%">X</td></tr>
  51030. <tr><td width="40%">Intel Indeo 2</td><td width="10%"></td><td width="10%">X</td></tr>
  51031. <tr><td width="40%">Intel Indeo 3</td><td width="10%"></td><td width="10%">X</td></tr>
  51032. <tr><td width="40%">Intel Indeo 4</td><td width="10%"></td><td width="10%">X</td></tr>
  51033. <tr><td width="40%">Intel Indeo 5</td><td width="10%"></td><td width="10%">X</td></tr>
  51034. <tr><td width="40%">Interplay C93</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in the game Cyberia from Interplay.</td></tr>
  51035. <tr><td width="40%">Interplay MVE video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Interplay .MVE files.</td></tr>
  51036. <tr><td width="40%">J2K</td><td width="10%">X</td><td width="10%">X</td></tr>
  51037. <tr><td width="40%">Karl Morton&rsquo;s video codec</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in Worms games.</td></tr>
  51038. <tr><td width="40%">Kega Game Video (KGV1)</td><td width="10%"></td><td width="10%">X</td><td width="40%">Kega emulator screen capture codec.</td></tr>
  51039. <tr><td width="40%">Lagarith</td><td width="10%"></td><td width="10%">X</td></tr>
  51040. <tr><td width="40%">LCEVC / MPEG-5 LCEVC / MPEG-5 Part 2</td><td width="10%"></td><td width="10%">E</td><td width="40%">decoding supported through external library liblcevc-dec</td></tr>
  51041. <tr><td width="40%">LCL (LossLess Codec Library) MSZH</td><td width="10%"></td><td width="10%">X</td></tr>
  51042. <tr><td width="40%">LCL (LossLess Codec Library) ZLIB</td><td width="10%">E</td><td width="10%">E</td></tr>
  51043. <tr><td width="40%">LEAD MCMP</td><td width="10%"></td><td width="10%">X</td></tr>
  51044. <tr><td width="40%">LOCO</td><td width="10%"></td><td width="10%">X</td></tr>
  51045. <tr><td width="40%">LucasArts SANM/Smush</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in LucasArts games / SMUSH animations.</td></tr>
  51046. <tr><td width="40%">lossless MJPEG</td><td width="10%">X</td><td width="10%">X</td></tr>
  51047. <tr><td width="40%">MagicYUV Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  51048. <tr><td width="40%">Mandsoft Screen Capture Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  51049. <tr><td width="40%">Microsoft ATC Screen</td><td width="10%"></td><td width="10%">X</td><td width="40%">Also known as Microsoft Screen 3.</td></tr>
  51050. <tr><td width="40%">Microsoft Expression Encoder Screen</td><td width="10%"></td><td width="10%">X</td><td width="40%">Also known as Microsoft Titanium Screen 2.</td></tr>
  51051. <tr><td width="40%">Microsoft RLE</td><td width="10%">X</td><td width="10%">X</td></tr>
  51052. <tr><td width="40%">Microsoft Screen 1</td><td width="10%"></td><td width="10%">X</td><td width="40%">Also known as Windows Media Video V7 Screen.</td></tr>
  51053. <tr><td width="40%">Microsoft Screen 2</td><td width="10%"></td><td width="10%">X</td><td width="40%">Also known as Windows Media Video V9 Screen.</td></tr>
  51054. <tr><td width="40%">Microsoft Video 1</td><td width="10%"></td><td width="10%">X</td></tr>
  51055. <tr><td width="40%">Mimic</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in MSN Messenger Webcam streams.</td></tr>
  51056. <tr><td width="40%">Miro VideoXL</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VIXL</td></tr>
  51057. <tr><td width="40%">MJPEG (Motion JPEG)</td><td width="10%">X</td><td width="10%">X</td></tr>
  51058. <tr><td width="40%">Mobotix MxPEG video</td><td width="10%"></td><td width="10%">X</td></tr>
  51059. <tr><td width="40%">Motion Pixels video</td><td width="10%"></td><td width="10%">X</td></tr>
  51060. <tr><td width="40%">MPEG-1 video</td><td width="10%">X</td><td width="10%">X</td></tr>
  51061. <tr><td width="40%">MPEG-2 video</td><td width="10%">X</td><td width="10%">X</td></tr>
  51062. <tr><td width="40%">MPEG-4 part 2</td><td width="10%">X</td><td width="10%">X</td><td width="40%">libxvidcore can be used alternatively for encoding.</td></tr>
  51063. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 1</td><td width="10%"></td><td width="10%">X</td></tr>
  51064. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 2</td><td width="10%">X</td><td width="10%">X</td></tr>
  51065. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 3</td><td width="10%">X</td><td width="10%">X</td></tr>
  51066. <tr><td width="40%">Newtek SpeedHQ</td><td width="10%">X</td><td width="10%">X</td></tr>
  51067. <tr><td width="40%">Nintendo Gamecube THP video</td><td width="10%"></td><td width="10%">X</td></tr>
  51068. <tr><td width="40%">NotchLC</td><td width="10%"></td><td width="10%">X</td></tr>
  51069. <tr><td width="40%">NuppelVideo/RTjpeg</td><td width="10%"></td><td width="10%">X</td><td width="40%">Video encoding used in NuppelVideo files.</td></tr>
  51070. <tr><td width="40%">On2 VP3</td><td width="10%"></td><td width="10%">X</td><td width="40%">still experimental</td></tr>
  51071. <tr><td width="40%">On2 VP4</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP40</td></tr>
  51072. <tr><td width="40%">On2 VP5</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP50</td></tr>
  51073. <tr><td width="40%">On2 VP6</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP60,VP61,VP62</td></tr>
  51074. <tr><td width="40%">On2 VP7</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP70,VP71</td></tr>
  51075. <tr><td width="40%">VP8</td><td width="10%">E</td><td width="10%">X</td><td width="40%">fourcc: VP80, encoding supported through external library libvpx</td></tr>
  51076. <tr><td width="40%">VP9</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libvpx</td></tr>
  51077. <tr><td width="40%">Pinnacle TARGA CineWave YUV16</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: Y216</td></tr>
  51078. <tr><td width="40%">Q-team QPEG</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourccs: QPEG, Q1.0, Q1.1</td></tr>
  51079. <tr><td width="40%">QuickTime 8BPS video</td><td width="10%"></td><td width="10%">X</td></tr>
  51080. <tr><td width="40%">QuickTime Animation (RLE) video</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: &rsquo;rle &rsquo;</td></tr>
  51081. <tr><td width="40%">QuickTime Graphics (SMC)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: &rsquo;smc &rsquo;</td></tr>
  51082. <tr><td width="40%">QuickTime video (RPZA)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: rpza</td></tr>
  51083. <tr><td width="40%">R10K AJA Kona 10-bit RGB Codec</td><td width="10%">X</td><td width="10%">X</td></tr>
  51084. <tr><td width="40%">R210 Quicktime Uncompressed RGB 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  51085. <tr><td width="40%">Raw Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  51086. <tr><td width="40%">RealVideo 1.0</td><td width="10%">X</td><td width="10%">X</td></tr>
  51087. <tr><td width="40%">RealVideo 2.0</td><td width="10%">X</td><td width="10%">X</td></tr>
  51088. <tr><td width="40%">RealVideo 3.0</td><td width="10%"></td><td width="10%">X</td><td width="40%">still far from ideal</td></tr>
  51089. <tr><td width="40%">RealVideo 4.0</td><td width="10%"></td><td width="10%">X</td></tr>
  51090. <tr><td width="40%">RealVideo 6.0</td><td width="10%"></td><td width="10%">X</td></tr>
  51091. <tr><td width="40%">Renderware TXD (TeXture Dictionary)</td><td width="10%"></td><td width="10%">X</td><td width="40%">Texture dictionaries used by the Renderware Engine.</td></tr>
  51092. <tr><td width="40%">RivaTuner Video</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: &rsquo;RTV1&rsquo;</td></tr>
  51093. <tr><td width="40%">RL2 video</td><td width="10%"></td><td width="10%">X</td><td width="40%">used in some games by Entertainment Software Partners</td></tr>
  51094. <tr><td width="40%">ScreenPressor</td><td width="10%"></td><td width="10%">X</td></tr>
  51095. <tr><td width="40%">Screenpresso</td><td width="10%"></td><td width="10%">X</td></tr>
  51096. <tr><td width="40%">Screen Recorder Gold Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  51097. <tr><td width="40%">Sierra VMD video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Sierra VMD files.</td></tr>
  51098. <tr><td width="40%">Silicon Graphics Motion Video Compressor 1 (MVC1)</td><td width="10%"></td><td width="10%">X</td></tr>
  51099. <tr><td width="40%">Silicon Graphics Motion Video Compressor 2 (MVC2)</td><td width="10%"></td><td width="10%">X</td></tr>
  51100. <tr><td width="40%">Silicon Graphics RLE 8-bit video</td><td width="10%"></td><td width="10%">X</td></tr>
  51101. <tr><td width="40%">Smacker video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Video encoding used in Smacker.</td></tr>
  51102. <tr><td width="40%">SMPTE VC-1</td><td width="10%"></td><td width="10%">X</td></tr>
  51103. <tr><td width="40%">Snow</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental wavelet codec (fourcc: SNOW)</td></tr>
  51104. <tr><td width="40%">Sony PlayStation MDEC (Motion DECoder)</td><td width="10%"></td><td width="10%">X</td></tr>
  51105. <tr><td width="40%">Sorenson Vector Quantizer 1</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: SVQ1</td></tr>
  51106. <tr><td width="40%">Sorenson Vector Quantizer 3</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: SVQ3</td></tr>
  51107. <tr><td width="40%">Sunplus JPEG (SP5X)</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: SP5X</td></tr>
  51108. <tr><td width="40%">TechSmith Screen Capture Codec</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: TSCC</td></tr>
  51109. <tr><td width="40%">TechSmith Screen Capture Codec 2</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: TSC2</td></tr>
  51110. <tr><td width="40%">Theora</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libtheora</td></tr>
  51111. <tr><td width="40%">Tiertex Limited SEQ video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in DOS CD-ROM FlashBack game.</td></tr>
  51112. <tr><td width="40%">Ut Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  51113. <tr><td width="40%">v210 QuickTime uncompressed 4:2:2 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  51114. <tr><td width="40%">v308 QuickTime uncompressed 4:4:4</td><td width="10%">X</td><td width="10%">X</td></tr>
  51115. <tr><td width="40%">v408 QuickTime uncompressed 4:4:4:4</td><td width="10%">X</td><td width="10%">X</td></tr>
  51116. <tr><td width="40%">v410 QuickTime uncompressed 4:4:4 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  51117. <tr><td width="40%">VBLE Lossless Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  51118. <tr><td width="40%">vMix Video</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: &rsquo;VMX1&rsquo;</td></tr>
  51119. <tr><td width="40%">VMware Screen Codec / VMware Video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in videos captured by VMware.</td></tr>
  51120. <tr><td width="40%">Westwood Studios VQA (Vector Quantized Animation) video</td><td width="10%"></td><td width="10%">X</td></tr>
  51121. <tr><td width="40%">Windows Media Image</td><td width="10%"></td><td width="10%">X</td></tr>
  51122. <tr><td width="40%">Windows Media Video 7</td><td width="10%">X</td><td width="10%">X</td></tr>
  51123. <tr><td width="40%">Windows Media Video 8</td><td width="10%">X</td><td width="10%">X</td></tr>
  51124. <tr><td width="40%">Windows Media Video 9</td><td width="10%"></td><td width="10%">X</td><td width="40%">not completely working</td></tr>
  51125. <tr><td width="40%">Wing Commander III / Xan</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Wing Commander III .MVE files.</td></tr>
  51126. <tr><td width="40%">Wing Commander IV / Xan</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Wing Commander IV.</td></tr>
  51127. <tr><td width="40%">Winnov WNV1</td><td width="10%"></td><td width="10%">X</td></tr>
  51128. <tr><td width="40%">WMV7</td><td width="10%">X</td><td width="10%">X</td></tr>
  51129. <tr><td width="40%">YAMAHA SMAF</td><td width="10%">X</td><td width="10%">X</td></tr>
  51130. <tr><td width="40%">Psygnosis YOP Video</td><td width="10%"></td><td width="10%">X</td></tr>
  51131. <tr><td width="40%">yuv4</td><td width="10%">X</td><td width="10%">X</td><td width="40%">libquicktime uncompressed packed 4:2:0</td></tr>
  51132. <tr><td width="40%">ZeroCodec Lossless Video</td><td width="10%"></td><td width="10%">X</td></tr>
  51133. <tr><td width="40%">ZLIB</td><td width="10%">X</td><td width="10%">X</td><td width="40%">part of LCL, encoder experimental</td></tr>
  51134. <tr><td width="40%">Zip Motion Blocks Video</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Encoder works only in PAL8.</td></tr>
  51135. </tbody>
  51136. </table>
  51137. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  51138. </p>
  51139. <p><code class="code">E</code> means that support is provided through an external library.
  51140. </p>
  51141. <a name="Audio-Codecs"></a>
  51142. <h3 class="section">44.4 Audio Codecs<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Codecs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Codecs" aria-hidden="true">TOC</a></span></h3>
  51143. <table class="multitable">
  51144. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  51145. <tr><td width="40%">8SVX exponential</td><td width="10%"></td><td width="10%">X</td></tr>
  51146. <tr><td width="40%">8SVX fibonacci</td><td width="10%"></td><td width="10%">X</td></tr>
  51147. <tr><td width="40%">AAC</td><td width="10%">EX</td><td width="10%">X</td><td width="40%">encoding supported through internal encoder and external library libfdk-aac</td></tr>
  51148. <tr><td width="40%">AAC+</td><td width="10%">E</td><td width="10%">IX</td><td width="40%">encoding supported through external library libfdk-aac</td></tr>
  51149. <tr><td width="40%">AC-3</td><td width="10%">IX</td><td width="10%">IX</td></tr>
  51150. <tr><td width="40%">ACELP.KELVIN</td><td width="10%"></td><td width="10%">X</td></tr>
  51151. <tr><td width="40%">ADPCM 4X Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  51152. <tr><td width="40%">ADPCM Yamaha AICA</td><td width="10%"></td><td width="10%">X</td></tr>
  51153. <tr><td width="40%">ADPCM AmuseGraphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  51154. <tr><td width="40%">ADPCM Argonaut Games</td><td width="10%">X</td><td width="10%">X</td></tr>
  51155. <tr><td width="40%">ADPCM CDROM XA</td><td width="10%"></td><td width="10%">X</td></tr>
  51156. <tr><td width="40%">ADPCM Creative Technology</td><td width="10%"></td><td width="10%">X</td><td width="40%">16 -&gt; 4, 8 -&gt; 4, 8 -&gt; 3, 8 -&gt; 2</td></tr>
  51157. <tr><td width="40%">ADPCM Electronic Arts</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in various EA titles.</td></tr>
  51158. <tr><td width="40%">ADPCM Electronic Arts Maxis CDROM XS</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Sim City 3000.</td></tr>
  51159. <tr><td width="40%">ADPCM Electronic Arts R1</td><td width="10%"></td><td width="10%">X</td></tr>
  51160. <tr><td width="40%">ADPCM Electronic Arts R2</td><td width="10%"></td><td width="10%">X</td></tr>
  51161. <tr><td width="40%">ADPCM Electronic Arts R3</td><td width="10%"></td><td width="10%">X</td></tr>
  51162. <tr><td width="40%">ADPCM Electronic Arts XAS</td><td width="10%"></td><td width="10%">X</td></tr>
  51163. <tr><td width="40%">ADPCM G.722</td><td width="10%">X</td><td width="10%">X</td></tr>
  51164. <tr><td width="40%">ADPCM G.726</td><td width="10%">X</td><td width="10%">X</td></tr>
  51165. <tr><td width="40%">ADPCM IMA Acorn Replay</td><td width="10%"></td><td width="10%">X</td></tr>
  51166. <tr><td width="40%">ADPCM IMA AMV</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in AMV files</td></tr>
  51167. <tr><td width="40%">ADPCM IMA Cunning Developments</td><td width="10%"></td><td width="10%">X</td></tr>
  51168. <tr><td width="40%">ADPCM IMA Electronic Arts EACS</td><td width="10%"></td><td width="10%">X</td></tr>
  51169. <tr><td width="40%">ADPCM IMA Electronic Arts SEAD</td><td width="10%"></td><td width="10%">X</td></tr>
  51170. <tr><td width="40%">ADPCM IMA Funcom</td><td width="10%"></td><td width="10%">X</td></tr>
  51171. <tr><td width="40%">ADPCM IMA High Voltage Software ALP</td><td width="10%">X</td><td width="10%">X</td></tr>
  51172. <tr><td width="40%">ADPCM IMA Mobiclip MOFLEX</td><td width="10%"></td><td width="10%">X</td></tr>
  51173. <tr><td width="40%">ADPCM IMA QuickTime</td><td width="10%">X</td><td width="10%">X</td></tr>
  51174. <tr><td width="40%">ADPCM IMA Simon &amp; Schuster Interactive</td><td width="10%">X</td><td width="10%">X</td></tr>
  51175. <tr><td width="40%">ADPCM IMA Ubisoft APM</td><td width="10%">X</td><td width="10%">X</td></tr>
  51176. <tr><td width="40%">ADPCM IMA Loki SDL MJPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  51177. <tr><td width="40%">ADPCM IMA WAV</td><td width="10%">X</td><td width="10%">X</td></tr>
  51178. <tr><td width="40%">ADPCM IMA Westwood</td><td width="10%"></td><td width="10%">X</td></tr>
  51179. <tr><td width="40%">ADPCM ISS IMA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in FunCom games.</td></tr>
  51180. <tr><td width="40%">ADPCM IMA Dialogic</td><td width="10%"></td><td width="10%">X</td></tr>
  51181. <tr><td width="40%">ADPCM IMA Duck DK3</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in some Sega Saturn console games.</td></tr>
  51182. <tr><td width="40%">ADPCM IMA Duck DK4</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in some Sega Saturn console games.</td></tr>
  51183. <tr><td width="40%">ADPCM IMA Radical</td><td width="10%"></td><td width="10%">X</td></tr>
  51184. <tr><td width="40%">ADPCM IMA Xbox</td><td width="10%"></td><td width="10%">X</td></tr>
  51185. <tr><td width="40%">ADPCM Microsoft</td><td width="10%">X</td><td width="10%">X</td></tr>
  51186. <tr><td width="40%">ADPCM MS IMA</td><td width="10%">X</td><td width="10%">X</td></tr>
  51187. <tr><td width="40%">ADPCM Nintendo Gamecube AFC</td><td width="10%"></td><td width="10%">X</td></tr>
  51188. <tr><td width="40%">ADPCM Nintendo Gamecube DTK</td><td width="10%"></td><td width="10%">X</td></tr>
  51189. <tr><td width="40%">ADPCM Nintendo THP</td><td width="10%"></td><td width="10%">X</td></tr>
  51190. <tr><td width="40%">ADPCM Playstation</td><td width="10%"></td><td width="10%">X</td></tr>
  51191. <tr><td width="40%">ADPCM QT IMA</td><td width="10%">X</td><td width="10%">X</td></tr>
  51192. <tr><td width="40%">ADPCM Sanyo</td><td width="10%"></td><td width="10%">X</td></tr>
  51193. <tr><td width="40%">ADPCM SEGA CRI ADX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in Sega Dreamcast games.</td></tr>
  51194. <tr><td width="40%">ADPCM Shockwave Flash</td><td width="10%">X</td><td width="10%">X</td></tr>
  51195. <tr><td width="40%">ADPCM Sound Blaster Pro 2-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  51196. <tr><td width="40%">ADPCM Sound Blaster Pro 2.6-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  51197. <tr><td width="40%">ADPCM Sound Blaster Pro 4-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  51198. <tr><td width="40%">ADPCM VIMA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in LucasArts SMUSH animations.</td></tr>
  51199. <tr><td width="40%">ADPCM Konami XMD</td><td width="10%"></td><td width="10%">X</td></tr>
  51200. <tr><td width="40%">ADPCM Westwood Studios IMA</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in Westwood Studios games like Command and Conquer.</td></tr>
  51201. <tr><td width="40%">ADPCM Yamaha</td><td width="10%">X</td><td width="10%">X</td></tr>
  51202. <tr><td width="40%">ADPCM Zork</td><td width="10%"></td><td width="10%">X</td></tr>
  51203. <tr><td width="40%">AMR-NB</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libopencore-amrnb</td></tr>
  51204. <tr><td width="40%">AMR-WB</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libvo-amrwbenc</td></tr>
  51205. <tr><td width="40%">Amazing Studio PAF Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  51206. <tr><td width="40%">Apple lossless audio</td><td width="10%">X</td><td width="10%">X</td><td width="40%">QuickTime fourcc &rsquo;alac&rsquo;</td></tr>
  51207. <tr><td width="40%">aptX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in Bluetooth A2DP</td></tr>
  51208. <tr><td width="40%">aptX HD</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in Bluetooth A2DP</td></tr>
  51209. <tr><td width="40%">ATRAC1</td><td width="10%"></td><td width="10%">X</td></tr>
  51210. <tr><td width="40%">ATRAC3</td><td width="10%"></td><td width="10%">X</td></tr>
  51211. <tr><td width="40%">ATRAC3+</td><td width="10%"></td><td width="10%">X</td></tr>
  51212. <tr><td width="40%">ATRAC9</td><td width="10%"></td><td width="10%">X</td></tr>
  51213. <tr><td width="40%">Bink Audio</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Bink and Smacker files in many games.</td></tr>
  51214. <tr><td width="40%">Bonk audio</td><td width="10%"></td><td width="10%">X</td></tr>
  51215. <tr><td width="40%">CELT</td><td width="10%"></td><td width="10%">E</td><td width="40%">decoding supported through external library libcelt</td></tr>
  51216. <tr><td width="40%">codec2</td><td width="10%">E</td><td width="10%">E</td><td width="40%">en/decoding supported through external library libcodec2</td></tr>
  51217. <tr><td width="40%">CRI HCA</td><td width="10%"></td><td width="10%">X</td></tr>
  51218. <tr><td width="40%">Delphine Software International CIN audio</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in Delphine Software International games.</td></tr>
  51219. <tr><td width="40%">DFPWM</td><td width="10%">X</td><td width="10%">X</td></tr>
  51220. <tr><td width="40%">Digital Speech Standard - Standard Play mode (DSS SP)</td><td width="10%"></td><td width="10%">X</td></tr>
  51221. <tr><td width="40%">Discworld II BMV Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  51222. <tr><td width="40%">COOK</td><td width="10%"></td><td width="10%">X</td><td width="40%">All versions except 5.1 are supported.</td></tr>
  51223. <tr><td width="40%">DCA (DTS Coherent Acoustics)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">supported extensions: XCh, XXCH, X96, XBR, XLL, LBR (partially)</td></tr>
  51224. <tr><td width="40%">Dolby E</td><td width="10%"></td><td width="10%">X</td></tr>
  51225. <tr><td width="40%">DPCM Cuberoot-Delta-Exact</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in few games.</td></tr>
  51226. <tr><td width="40%">DPCM Gremlin</td><td width="10%"></td><td width="10%">X</td></tr>
  51227. <tr><td width="40%">DPCM id RoQ</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in Quake III, Jedi Knight 2 and other computer games.</td></tr>
  51228. <tr><td width="40%">DPCM Marble WADY</td><td width="10%"></td><td width="10%">X</td></tr>
  51229. <tr><td width="40%">DPCM Interplay</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in various Interplay computer games.</td></tr>
  51230. <tr><td width="40%">DPCM Squareroot-Delta-Exact</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in various games.</td></tr>
  51231. <tr><td width="40%">DPCM Sierra Online</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Sierra Online game audio files.</td></tr>
  51232. <tr><td width="40%">DPCM Sol</td><td width="10%"></td><td width="10%">X</td></tr>
  51233. <tr><td width="40%">DPCM Xan</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Origin&rsquo;s Wing Commander IV AVI files.</td></tr>
  51234. <tr><td width="40%">DPCM Xilam DERF</td><td width="10%"></td><td width="10%">X</td></tr>
  51235. <tr><td width="40%">DSD (Direct Stream Digital), least significant bit first</td><td width="10%"></td><td width="10%">X</td></tr>
  51236. <tr><td width="40%">DSD (Direct Stream Digital), most significant bit first</td><td width="10%"></td><td width="10%">X</td></tr>
  51237. <tr><td width="40%">DSD (Direct Stream Digital), least significant bit first, planar</td><td width="10%"></td><td width="10%">X</td></tr>
  51238. <tr><td width="40%">DSD (Direct Stream Digital), most significant bit first, planar</td><td width="10%"></td><td width="10%">X</td></tr>
  51239. <tr><td width="40%">DSP Group TrueSpeech</td><td width="10%"></td><td width="10%">X</td></tr>
  51240. <tr><td width="40%">DST (Direct Stream Transfer)</td><td width="10%"></td><td width="10%">X</td></tr>
  51241. <tr><td width="40%">DV audio</td><td width="10%"></td><td width="10%">X</td></tr>
  51242. <tr><td width="40%">Enhanced AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  51243. <tr><td width="40%">EVRC (Enhanced Variable Rate Codec)</td><td width="10%"></td><td width="10%">X</td></tr>
  51244. <tr><td width="40%">FLAC (Free Lossless Audio Codec)</td><td width="10%">X</td><td width="10%">IX</td></tr>
  51245. <tr><td width="40%">FTR Voice</td><td width="10%"></td><td width="10%">X</td></tr>
  51246. <tr><td width="40%">G.723.1</td><td width="10%">X</td><td width="10%">X</td></tr>
  51247. <tr><td width="40%">G.728</td><td width="10%"></td><td width="10%">X</td></tr>
  51248. <tr><td width="40%">G.729</td><td width="10%"></td><td width="10%">X</td></tr>
  51249. <tr><td width="40%">GSM</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libgsm</td></tr>
  51250. <tr><td width="40%">GSM Microsoft variant</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libgsm</td></tr>
  51251. <tr><td width="40%">IAC (Indeo Audio Coder)</td><td width="10%"></td><td width="10%">X</td></tr>
  51252. <tr><td width="40%">iLBC (Internet Low Bitrate Codec)</td><td width="10%">E</td><td width="10%">EX</td><td width="40%">encoding and decoding supported through external library libilbc</td></tr>
  51253. <tr><td width="40%">IMC (Intel Music Coder)</td><td width="10%"></td><td width="10%">X</td></tr>
  51254. <tr><td width="40%">Interplay ACM</td><td width="10%"></td><td width="10%">X</td></tr>
  51255. <tr><td width="40%">LC3</td><td width="10%">E</td><td width="10%">E</td><td width="40%">supported through external library liblc3</td></tr>
  51256. <tr><td width="40%">MACE (Macintosh Audio Compression/Expansion) 6:1</td><td width="10%"></td><td width="10%">X</td></tr>
  51257. <tr><td width="40%">Marian&rsquo;s A-pac audio</td><td width="10%"></td><td width="10%">X</td></tr>
  51258. <tr><td width="40%">MI-SC4 (Micronas SC-4 Audio)</td><td width="10%"></td><td width="10%">X</td></tr>
  51259. <tr><td width="40%">MLP (Meridian Lossless Packing)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in DVD-Audio discs.</td></tr>
  51260. <tr><td width="40%">Monkey&rsquo;s Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  51261. <tr><td width="40%">MP1 (MPEG audio layer 1)</td><td width="10%"></td><td width="10%">IX</td></tr>
  51262. <tr><td width="40%">MP2 (MPEG audio layer 2)</td><td width="10%">IX</td><td width="10%">IX</td><td width="40%">encoding supported also through external library TwoLAME</td></tr>
  51263. <tr><td width="40%">MP3 (MPEG audio layer 3)</td><td width="10%">E</td><td width="10%">IX</td><td width="40%">encoding supported through external library LAME, ADU MP3 and MP3onMP4 also supported</td></tr>
  51264. <tr><td width="40%">MPEG-4 Audio Lossless Coding (ALS)</td><td width="10%"></td><td width="10%">X</td></tr>
  51265. <tr><td width="40%">MPEG-H 3D Audio</td><td width="10%"></td><td width="10%">E</td><td width="40%">decoding supported through external library libmpeghdec</td></tr>
  51266. <tr><td width="40%">MobiClip FastAudio</td><td width="10%"></td><td width="10%">X</td></tr>
  51267. <tr><td width="40%">Musepack SV7</td><td width="10%"></td><td width="10%">X</td></tr>
  51268. <tr><td width="40%">Musepack SV8</td><td width="10%"></td><td width="10%">X</td></tr>
  51269. <tr><td width="40%">Nellymoser Asao</td><td width="10%">X</td><td width="10%">X</td></tr>
  51270. <tr><td width="40%">On2 AVC (Audio for Video Codec)</td><td width="10%"></td><td width="10%">X</td></tr>
  51271. <tr><td width="40%">Opus</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libopus</td></tr>
  51272. <tr><td width="40%">OSQ (Original Sound Quality)</td><td width="10%"></td><td width="10%">X</td></tr>
  51273. <tr><td width="40%">PCM A-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  51274. <tr><td width="40%">PCM mu-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  51275. <tr><td width="40%">PCM Archimedes VIDC</td><td width="10%">X</td><td width="10%">X</td></tr>
  51276. <tr><td width="40%">PCM signed 8-bit planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  51277. <tr><td width="40%">PCM signed 16-bit big-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  51278. <tr><td width="40%">PCM signed 16-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  51279. <tr><td width="40%">PCM signed 24-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  51280. <tr><td width="40%">PCM signed 32-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  51281. <tr><td width="40%">PCM 32-bit floating point big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51282. <tr><td width="40%">PCM 32-bit floating point little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51283. <tr><td width="40%">PCM 64-bit floating point big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51284. <tr><td width="40%">PCM 64-bit floating point little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51285. <tr><td width="40%">PCM D-Cinema audio signed 24-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  51286. <tr><td width="40%">PCM signed 8-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  51287. <tr><td width="40%">PCM signed 16-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51288. <tr><td width="40%">PCM signed 16-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51289. <tr><td width="40%">PCM signed 24-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51290. <tr><td width="40%">PCM signed 24-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51291. <tr><td width="40%">PCM signed 32-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51292. <tr><td width="40%">PCM signed 32-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51293. <tr><td width="40%">PCM signed 16/20/24-bit big-endian in MPEG-TS</td><td width="10%"></td><td width="10%">X</td></tr>
  51294. <tr><td width="40%">PCM unsigned 8-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  51295. <tr><td width="40%">PCM unsigned 16-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51296. <tr><td width="40%">PCM unsigned 16-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51297. <tr><td width="40%">PCM unsigned 24-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51298. <tr><td width="40%">PCM unsigned 24-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51299. <tr><td width="40%">PCM unsigned 32-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51300. <tr><td width="40%">PCM unsigned 32-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51301. <tr><td width="40%">PCM SGA</td><td width="10%"></td><td width="10%">X</td></tr>
  51302. <tr><td width="40%">QCELP / PureVoice</td><td width="10%"></td><td width="10%">X</td></tr>
  51303. <tr><td width="40%">QDesign Music Codec 1</td><td width="10%"></td><td width="10%">X</td></tr>
  51304. <tr><td width="40%">QDesign Music Codec 2</td><td width="10%"></td><td width="10%">X</td><td width="40%">There are still some distortions.</td></tr>
  51305. <tr><td width="40%">RealAudio 1.0 (14.4K)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Real 14400 bit/s codec</td></tr>
  51306. <tr><td width="40%">RealAudio 2.0 (28.8K)</td><td width="10%"></td><td width="10%">X</td><td width="40%">Real 28800 bit/s codec</td></tr>
  51307. <tr><td width="40%">RealAudio 3.0 (dnet)</td><td width="10%">IX</td><td width="10%">X</td><td width="40%">Real low bitrate AC-3 codec</td></tr>
  51308. <tr><td width="40%">RealAudio Lossless</td><td width="10%"></td><td width="10%">X</td></tr>
  51309. <tr><td width="40%">RealAudio SIPR / ACELP.NET</td><td width="10%"></td><td width="10%">X</td></tr>
  51310. <tr><td width="40%">RK Audio (RKA)</td><td width="10%"></td><td width="10%">X</td></tr>
  51311. <tr><td width="40%">SBC (low-complexity subband codec)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in Bluetooth A2DP</td></tr>
  51312. <tr><td width="40%">Shorten</td><td width="10%"></td><td width="10%">X</td></tr>
  51313. <tr><td width="40%">Sierra VMD audio</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Sierra VMD files.</td></tr>
  51314. <tr><td width="40%">Smacker audio</td><td width="10%"></td><td width="10%">X</td></tr>
  51315. <tr><td width="40%">SMPTE 302M AES3 audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  51316. <tr><td width="40%">Sonic</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental codec</td></tr>
  51317. <tr><td width="40%">Sonic lossless</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental codec</td></tr>
  51318. <tr><td width="40%">Speex</td><td width="10%">E</td><td width="10%">EX</td><td width="40%">supported through external library libspeex</td></tr>
  51319. <tr><td width="40%">TAK (Tom&rsquo;s lossless Audio Kompressor)</td><td width="10%"></td><td width="10%">X</td></tr>
  51320. <tr><td width="40%">True Audio (TTA)</td><td width="10%">X</td><td width="10%">X</td></tr>
  51321. <tr><td width="40%">TrueHD</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in HD-DVD and Blu-Ray discs.</td></tr>
  51322. <tr><td width="40%">TwinVQ (VQF flavor)</td><td width="10%"></td><td width="10%">X</td></tr>
  51323. <tr><td width="40%">VIMA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in LucasArts SMUSH animations.</td></tr>
  51324. <tr><td width="40%">ViewQuest VQC</td><td width="10%"></td><td width="10%">X</td></tr>
  51325. <tr><td width="40%">Vorbis</td><td width="10%">E</td><td width="10%">X</td><td width="40%">A native but very primitive encoder exists.</td></tr>
  51326. <tr><td width="40%">Voxware MetaSound</td><td width="10%"></td><td width="10%">X</td></tr>
  51327. <tr><td width="40%">Waveform Archiver</td><td width="10%"></td><td width="10%">X</td></tr>
  51328. <tr><td width="40%">WavPack</td><td width="10%">X</td><td width="10%">X</td></tr>
  51329. <tr><td width="40%">Westwood Audio (SND1)</td><td width="10%"></td><td width="10%">X</td></tr>
  51330. <tr><td width="40%">Windows Media Audio 1</td><td width="10%">X</td><td width="10%">X</td></tr>
  51331. <tr><td width="40%">Windows Media Audio 2</td><td width="10%">X</td><td width="10%">X</td></tr>
  51332. <tr><td width="40%">Windows Media Audio Lossless</td><td width="10%"></td><td width="10%">X</td></tr>
  51333. <tr><td width="40%">Windows Media Audio Pro</td><td width="10%"></td><td width="10%">X</td></tr>
  51334. <tr><td width="40%">Windows Media Audio Voice</td><td width="10%"></td><td width="10%">X</td></tr>
  51335. <tr><td width="40%">Xbox Media Audio 1</td><td width="10%"></td><td width="10%">X</td></tr>
  51336. <tr><td width="40%">Xbox Media Audio 2</td><td width="10%"></td><td width="10%">X</td></tr>
  51337. </tbody>
  51338. </table>
  51339. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  51340. </p>
  51341. <p><code class="code">E</code> means that support is provided through an external library.
  51342. </p>
  51343. <p><code class="code">I</code> means that an integer-only version is available, too (ensures high
  51344. performance on systems without hardware floating point support).
  51345. </p>
  51346. <a name="Subtitle-Formats"></a>
  51347. <h3 class="section">44.5 Subtitle Formats<span class="pull-right"><a class="anchor hidden-xs" href="#Subtitle-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Subtitle-Formats" aria-hidden="true">TOC</a></span></h3>
  51348. <table class="multitable">
  51349. <tbody><tr><td width="40%">Name</td><td width="10%">Muxing</td><td width="10%">Demuxing</td><td width="10%">Encoding</td><td width="10%">Decoding</td></tr>
  51350. <tr><td width="40%">3GPP Timed Text</td><td width="10%"></td><td width="10%"></td><td width="10%">X</td><td width="10%">X</td></tr>
  51351. <tr><td width="40%">AQTitle</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51352. <tr><td width="40%">DVB</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td></tr>
  51353. <tr><td width="40%">DVB teletext</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td><td width="10%">E</td></tr>
  51354. <tr><td width="40%">DVD</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td></tr>
  51355. <tr><td width="40%">JACOsub</td><td width="10%">X</td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51356. <tr><td width="40%">MicroDVD</td><td width="10%">X</td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51357. <tr><td width="40%">MPL2</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51358. <tr><td width="40%">MPsub (MPlayer)</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51359. <tr><td width="40%">PGS</td><td width="10%"></td><td width="10%"></td><td width="10%"></td><td width="10%">X</td></tr>
  51360. <tr><td width="40%">PJS (Phoenix)</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51361. <tr><td width="40%">RealText</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51362. <tr><td width="40%">SAMI</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51363. <tr><td width="40%">Spruce format (STL)</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51364. <tr><td width="40%">SSA/ASS</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td></tr>
  51365. <tr><td width="40%">SubRip (SRT)</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td></tr>
  51366. <tr><td width="40%">SubViewer v1</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51367. <tr><td width="40%">SubViewer</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51368. <tr><td width="40%">TED Talks captions</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51369. <tr><td width="40%">TTML</td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td></tr>
  51370. <tr><td width="40%">VobSub (IDX+SUB)</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51371. <tr><td width="40%">VPlayer</td><td width="10%"></td><td width="10%">X</td><td width="10%"></td><td width="10%">X</td></tr>
  51372. <tr><td width="40%">WebVTT</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td></tr>
  51373. <tr><td width="40%">XSUB</td><td width="10%"></td><td width="10%"></td><td width="10%">X</td><td width="10%">X</td></tr>
  51374. </tbody>
  51375. </table>
  51376. <p><code class="code">X</code> means that the feature is supported.
  51377. </p>
  51378. <p><code class="code">E</code> means that support is provided through an external library.
  51379. </p>
  51380. <a name="Network-Protocols"></a>
  51381. <h3 class="section">44.6 Network Protocols<span class="pull-right"><a class="anchor hidden-xs" href="#Network-Protocols" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Network-Protocols" aria-hidden="true">TOC</a></span></h3>
  51382. <table class="multitable">
  51383. <tbody><tr><td width="40%">Name</td><td width="10%">Support</td></tr>
  51384. <tr><td width="40%">AMQP</td><td width="10%">E</td></tr>
  51385. <tr><td width="40%">file</td><td width="10%">X</td></tr>
  51386. <tr><td width="40%">FTP</td><td width="10%">X</td></tr>
  51387. <tr><td width="40%">Gopher</td><td width="10%">X</td></tr>
  51388. <tr><td width="40%">Gophers</td><td width="10%">X</td></tr>
  51389. <tr><td width="40%">HLS</td><td width="10%">X</td></tr>
  51390. <tr><td width="40%">HTTP</td><td width="10%">X</td></tr>
  51391. <tr><td width="40%">HTTPS</td><td width="10%">X</td></tr>
  51392. <tr><td width="40%">Icecast</td><td width="10%">X</td></tr>
  51393. <tr><td width="40%">MMSH</td><td width="10%">X</td></tr>
  51394. <tr><td width="40%">MMST</td><td width="10%">X</td></tr>
  51395. <tr><td width="40%">pipe</td><td width="10%">X</td></tr>
  51396. <tr><td width="40%">Pro-MPEG FEC</td><td width="10%">X</td></tr>
  51397. <tr><td width="40%">RTMP</td><td width="10%">X</td></tr>
  51398. <tr><td width="40%">RTMPE</td><td width="10%">X</td></tr>
  51399. <tr><td width="40%">RTMPS</td><td width="10%">X</td></tr>
  51400. <tr><td width="40%">RTMPT</td><td width="10%">X</td></tr>
  51401. <tr><td width="40%">RTMPTE</td><td width="10%">X</td></tr>
  51402. <tr><td width="40%">RTMPTS</td><td width="10%">X</td></tr>
  51403. <tr><td width="40%">RTP</td><td width="10%">X</td></tr>
  51404. <tr><td width="40%">SAMBA</td><td width="10%">E</td></tr>
  51405. <tr><td width="40%">SCTP</td><td width="10%">X</td></tr>
  51406. <tr><td width="40%">SFTP</td><td width="10%">E</td></tr>
  51407. <tr><td width="40%">TCP</td><td width="10%">X</td></tr>
  51408. <tr><td width="40%">TLS</td><td width="10%">X</td></tr>
  51409. <tr><td width="40%">UDP</td><td width="10%">X</td></tr>
  51410. <tr><td width="40%">ZMQ</td><td width="10%">E</td></tr>
  51411. </tbody>
  51412. </table>
  51413. <p><code class="code">X</code> means that the protocol is supported.
  51414. </p>
  51415. <p><code class="code">E</code> means that support is provided through an external library.
  51416. </p>
  51417. <a name="Input_002fOutput-Devices"></a>
  51418. <h3 class="section">44.7 Input/Output Devices<span class="pull-right"><a class="anchor hidden-xs" href="#Input_002fOutput-Devices" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Input_002fOutput-Devices" aria-hidden="true">TOC</a></span></h3>
  51419. <table class="multitable">
  51420. <tbody><tr><td width="40%">Name</td><td width="10%">Input</td><td width="10%">Output</td></tr>
  51421. <tr><td width="40%">ALSA</td><td width="10%">X</td><td width="10%">X</td></tr>
  51422. <tr><td width="40%">BKTR</td><td width="10%">X</td><td width="10%"></td></tr>
  51423. <tr><td width="40%">caca</td><td width="10%"></td><td width="10%">X</td></tr>
  51424. <tr><td width="40%">DV1394</td><td width="10%">X</td><td width="10%"></td></tr>
  51425. <tr><td width="40%">Lavfi virtual device</td><td width="10%">X</td><td width="10%"></td></tr>
  51426. <tr><td width="40%">Linux framebuffer</td><td width="10%">X</td><td width="10%">X</td></tr>
  51427. <tr><td width="40%">JACK</td><td width="10%">X</td><td width="10%"></td></tr>
  51428. <tr><td width="40%">LIBCDIO</td><td width="10%">X</td></tr>
  51429. <tr><td width="40%">LIBDC1394</td><td width="10%">X</td><td width="10%"></td></tr>
  51430. <tr><td width="40%">OpenAL</td><td width="10%">X</td></tr>
  51431. <tr><td width="40%">OpenGL</td><td width="10%"></td><td width="10%">X</td></tr>
  51432. <tr><td width="40%">OSS</td><td width="10%">X</td><td width="10%">X</td></tr>
  51433. <tr><td width="40%">PulseAudio</td><td width="10%">X</td><td width="10%">X</td></tr>
  51434. <tr><td width="40%">SDL</td><td width="10%"></td><td width="10%">X</td></tr>
  51435. <tr><td width="40%">Video4Linux2</td><td width="10%">X</td><td width="10%">X</td></tr>
  51436. <tr><td width="40%">VfW capture</td><td width="10%">X</td><td width="10%"></td></tr>
  51437. <tr><td width="40%">X11 grabbing</td><td width="10%">X</td><td width="10%"></td></tr>
  51438. <tr><td width="40%">Win32 grabbing</td><td width="10%">X</td><td width="10%"></td></tr>
  51439. </tbody>
  51440. </table>
  51441. <p><code class="code">X</code> means that input/output is supported.
  51442. </p>
  51443. <a name="Timecode-1"></a>
  51444. <h3 class="section">44.8 Timecode<span class="pull-right"><a class="anchor hidden-xs" href="#Timecode-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Timecode-1" aria-hidden="true">TOC</a></span></h3>
  51445. <table class="multitable">
  51446. <tbody><tr><td width="40%">Codec/format</td><td width="10%">Read</td><td width="10%">Write</td></tr>
  51447. <tr><td width="40%">AVI</td><td width="10%">X</td><td width="10%">X</td></tr>
  51448. <tr><td width="40%">DV</td><td width="10%">X</td><td width="10%">X</td></tr>
  51449. <tr><td width="40%">GXF</td><td width="10%">X</td><td width="10%">X</td></tr>
  51450. <tr><td width="40%">MOV</td><td width="10%">X</td><td width="10%">X</td></tr>
  51451. <tr><td width="40%">MPEG1/2</td><td width="10%">X</td><td width="10%">X</td></tr>
  51452. <tr><td width="40%">MXF</td><td width="10%">X</td><td width="10%">X</td></tr>
  51453. </tbody>
  51454. </table>
  51455. <a name="See-Also"></a>
  51456. <h2 class="chapter">45 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
  51457. <p><a class="url" href="ffprobe.html">ffprobe</a>,
  51458. <a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffplay.html">ffplay</a>,
  51459. <a class="url" href="ffmpeg-utils.html">ffmpeg-utils</a>,
  51460. <a class="url" href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
  51461. <a class="url" href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
  51462. <a class="url" href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
  51463. <a class="url" href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
  51464. <a class="url" href="ffmpeg-formats.html">ffmpeg-formats</a>,
  51465. <a class="url" href="ffmpeg-devices.html">ffmpeg-devices</a>,
  51466. <a class="url" href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
  51467. <a class="url" href="ffmpeg-filters.html">ffmpeg-filters</a>
  51468. </p>
  51469. <a name="Authors"></a>
  51470. <h2 class="chapter">46 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
  51471. <p>The FFmpeg developers.
  51472. </p>
  51473. <p>For details about the authorship, see the Git history of the project
  51474. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  51475. <code class="command">git log</code> in the FFmpeg source directory, or browsing the
  51476. online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
  51477. </p>
  51478. <p>Maintainers for the specific components are listed in the file
  51479. <samp class="file">MAINTAINERS</samp> in the source code tree.
  51480. </p>
  51481. <p style="font-size: small;">
  51482. This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
  51483. </p>
  51484. </div>
  51485. </body>
  51486. </html>