ffplay-all.html 2.1 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652
  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 -->
  4. <head>
  5. <meta charset="utf-8">
  6. <title>
  7. ffplay 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. ffplay Documentation
  17. </h1>
  18. <div class="top-level-extent" id="SEC_Top">
  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. <li><a id="toc-Advanced-options" href="#Advanced-options">3.5 Advanced options</a></li>
  32. <li><a id="toc-While-playing" href="#While-playing">3.6 While playing</a></li>
  33. </ul></li>
  34. <li><a id="toc-Syntax" href="#Syntax">4 Syntax</a>
  35. <ul class="toc-numbered-mark">
  36. <li><a id="toc-Quoting-and-escaping" href="#Quoting-and-escaping">4.1 Quoting and escaping</a>
  37. <ul class="toc-numbered-mark">
  38. <li><a id="toc-Examples" href="#Examples">4.1.1 Examples</a></li>
  39. </ul></li>
  40. <li><a id="toc-Date" href="#Date">4.2 Date</a></li>
  41. <li><a id="toc-Time-duration" href="#Time-duration">4.3 Time duration</a>
  42. <ul class="toc-numbered-mark">
  43. <li><a id="toc-Examples-1" href="#Examples-1">4.3.1 Examples</a></li>
  44. </ul></li>
  45. <li><a id="toc-Video-size" href="#Video-size">4.4 Video size</a></li>
  46. <li><a id="toc-Video-rate" href="#Video-rate">4.5 Video rate</a></li>
  47. <li><a id="toc-Ratio" href="#Ratio">4.6 Ratio</a></li>
  48. <li><a id="toc-Color" href="#Color">4.7 Color</a></li>
  49. <li><a id="toc-Channel-Layout" href="#Channel-Layout">4.8 Channel Layout</a></li>
  50. </ul></li>
  51. <li><a id="toc-Expression-Evaluation" href="#Expression-Evaluation">5 Expression Evaluation</a></li>
  52. <li><a id="toc-Codec-Options" href="#Codec-Options">6 Codec Options</a></li>
  53. <li><a id="toc-Decoders" href="#Decoders">7 Decoders</a></li>
  54. <li><a id="toc-Video-Decoders" href="#Video-Decoders">8 Video Decoders</a>
  55. <ul class="toc-numbered-mark">
  56. <li><a id="toc-av1" href="#av1">8.1 av1</a>
  57. <ul class="toc-numbered-mark">
  58. <li><a id="toc-Options-1" href="#Options-1">8.1.1 Options</a></li>
  59. </ul></li>
  60. <li><a id="toc-rawvideo" href="#rawvideo">8.2 rawvideo</a>
  61. <ul class="toc-numbered-mark">
  62. <li><a id="toc-Options-2" href="#Options-2">8.2.1 Options</a></li>
  63. </ul></li>
  64. <li><a id="toc-libdav1d" href="#libdav1d">8.3 libdav1d</a>
  65. <ul class="toc-numbered-mark">
  66. <li><a id="toc-Options-3" href="#Options-3">8.3.1 Options</a></li>
  67. </ul></li>
  68. <li><a id="toc-libdavs2" href="#libdavs2">8.4 libdavs2</a></li>
  69. <li><a id="toc-libuavs3d" href="#libuavs3d">8.5 libuavs3d</a>
  70. <ul class="toc-numbered-mark">
  71. <li><a id="toc-Options-4" href="#Options-4">8.5.1 Options</a></li>
  72. </ul></li>
  73. <li><a id="toc-libxevd" href="#libxevd">8.6 libxevd</a>
  74. <ul class="toc-numbered-mark">
  75. <li><a id="toc-Options-5" href="#Options-5">8.6.1 Options</a></li>
  76. </ul></li>
  77. <li><a id="toc-QSV-Decoders" href="#QSV-Decoders">8.7 QSV Decoders</a>
  78. <ul class="toc-numbered-mark">
  79. <li><a id="toc-Common-Options" href="#Common-Options">8.7.1 Common Options</a></li>
  80. <li><a id="toc-HEVC-Options" href="#HEVC-Options">8.7.2 HEVC Options</a></li>
  81. </ul></li>
  82. <li><a id="toc-v210" href="#v210">8.8 v210</a>
  83. <ul class="toc-numbered-mark">
  84. <li><a id="toc-Options-6" href="#Options-6">8.8.1 Options</a></li>
  85. </ul></li>
  86. </ul></li>
  87. <li><a id="toc-Audio-Decoders" href="#Audio-Decoders">9 Audio Decoders</a>
  88. <ul class="toc-numbered-mark">
  89. <li><a id="toc-ac3" href="#ac3">9.1 ac3</a>
  90. <ul class="toc-numbered-mark">
  91. <li><a id="toc-AC_002d3-Decoder-Options" href="#AC_002d3-Decoder-Options">9.1.1 AC-3 Decoder Options</a></li>
  92. </ul></li>
  93. <li><a id="toc-flac" href="#flac">9.2 flac</a>
  94. <ul class="toc-numbered-mark">
  95. <li><a id="toc-FLAC-Decoder-options" href="#FLAC-Decoder-options">9.2.1 FLAC Decoder options</a></li>
  96. </ul></li>
  97. <li><a id="toc-ffwavesynth" href="#ffwavesynth">9.3 ffwavesynth</a></li>
  98. <li><a id="toc-libcelt" href="#libcelt">9.4 libcelt</a></li>
  99. <li><a id="toc-libgsm" href="#libgsm">9.5 libgsm</a></li>
  100. <li><a id="toc-libilbc" href="#libilbc">9.6 libilbc</a>
  101. <ul class="toc-numbered-mark">
  102. <li><a id="toc-Options-7" href="#Options-7">9.6.1 Options</a></li>
  103. </ul></li>
  104. <li><a id="toc-libopencore_002damrnb" href="#libopencore_002damrnb">9.7 libopencore-amrnb</a></li>
  105. <li><a id="toc-libopencore_002damrwb" href="#libopencore_002damrwb">9.8 libopencore-amrwb</a></li>
  106. <li><a id="toc-libopus" href="#libopus">9.9 libopus</a></li>
  107. </ul></li>
  108. <li><a id="toc-Subtitles-Decoders" href="#Subtitles-Decoders">10 Subtitles Decoders</a>
  109. <ul class="toc-numbered-mark">
  110. <li><a id="toc-libaribb24" href="#libaribb24">10.1 libaribb24</a>
  111. <ul class="toc-numbered-mark">
  112. <li><a id="toc-libaribb24-Decoder-Options" href="#libaribb24-Decoder-Options">10.1.1 libaribb24 Decoder Options</a></li>
  113. </ul></li>
  114. <li><a id="toc-libaribcaption" href="#libaribcaption">10.2 libaribcaption</a>
  115. <ul class="toc-numbered-mark">
  116. <li><a id="toc-libaribcaption-Decoder-Options" href="#libaribcaption-Decoder-Options">10.2.1 libaribcaption Decoder Options</a></li>
  117. <li><a id="toc-libaribcaption-decoder-usage-examples" href="#libaribcaption-decoder-usage-examples">10.2.2 libaribcaption decoder usage examples</a></li>
  118. </ul></li>
  119. <li><a id="toc-dvbsub" href="#dvbsub">10.3 dvbsub</a>
  120. <ul class="toc-numbered-mark">
  121. <li><a id="toc-Options-8" href="#Options-8">10.3.1 Options</a></li>
  122. </ul></li>
  123. <li><a id="toc-dvdsub" href="#dvdsub">10.4 dvdsub</a>
  124. <ul class="toc-numbered-mark">
  125. <li><a id="toc-Options-9" href="#Options-9">10.4.1 Options</a></li>
  126. </ul></li>
  127. <li><a id="toc-libzvbi_002dteletext" href="#libzvbi_002dteletext">10.5 libzvbi-teletext</a>
  128. <ul class="toc-numbered-mark">
  129. <li><a id="toc-Options-10" href="#Options-10">10.5.1 Options</a></li>
  130. </ul></li>
  131. </ul></li>
  132. <li><a id="toc-Bitstream-Filters" href="#Bitstream-Filters">11 Bitstream Filters</a>
  133. <ul class="toc-numbered-mark">
  134. <li><a id="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">11.1 aac_adtstoasc</a></li>
  135. <li><a id="toc-av1_005fmetadata" href="#av1_005fmetadata">11.2 av1_metadata</a></li>
  136. <li><a id="toc-chomp" href="#chomp">11.3 chomp</a></li>
  137. <li><a id="toc-dca_005fcore" href="#dca_005fcore">11.4 dca_core</a></li>
  138. <li><a id="toc-dump_005fextra" href="#dump_005fextra">11.5 dump_extra</a></li>
  139. <li><a id="toc-dv_005ferror_005fmarker" href="#dv_005ferror_005fmarker">11.6 dv_error_marker</a></li>
  140. <li><a id="toc-eac3_005fcore" href="#eac3_005fcore">11.7 eac3_core</a></li>
  141. <li><a id="toc-extract_005fextradata" href="#extract_005fextradata">11.8 extract_extradata</a></li>
  142. <li><a id="toc-filter_005funits" href="#filter_005funits">11.9 filter_units</a></li>
  143. <li><a id="toc-hapqa_005fextract" href="#hapqa_005fextract">11.10 hapqa_extract</a></li>
  144. <li><a id="toc-h264_005fmetadata" href="#h264_005fmetadata">11.11 h264_metadata</a></li>
  145. <li><a id="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">11.12 h264_mp4toannexb</a></li>
  146. <li><a id="toc-h264_005fredundant_005fpps" href="#h264_005fredundant_005fpps">11.13 h264_redundant_pps</a></li>
  147. <li><a id="toc-hevc_005fmetadata" href="#hevc_005fmetadata">11.14 hevc_metadata</a></li>
  148. <li><a id="toc-hevc_005fmp4toannexb" href="#hevc_005fmp4toannexb">11.15 hevc_mp4toannexb</a></li>
  149. <li><a id="toc-imxdump" href="#imxdump">11.16 imxdump</a></li>
  150. <li><a id="toc-mjpeg2jpeg" href="#mjpeg2jpeg">11.17 mjpeg2jpeg</a></li>
  151. <li><a id="toc-mjpegadump" href="#mjpegadump">11.18 mjpegadump</a></li>
  152. <li><a id="toc-mov2textsub-1" href="#mov2textsub-1">11.19 mov2textsub</a></li>
  153. <li><a id="toc-mpeg2_005fmetadata" href="#mpeg2_005fmetadata">11.20 mpeg2_metadata</a></li>
  154. <li><a id="toc-mpeg4_005funpack_005fbframes" href="#mpeg4_005funpack_005fbframes">11.21 mpeg4_unpack_bframes</a></li>
  155. <li><a id="toc-noise" href="#noise">11.22 noise</a>
  156. <ul class="toc-numbered-mark">
  157. <li><a id="toc-Examples-2" href="#Examples-2">11.22.1 Examples</a></li>
  158. </ul></li>
  159. <li><a id="toc-null" href="#null">11.23 null</a></li>
  160. <li><a id="toc-pcm_005frechunk" href="#pcm_005frechunk">11.24 pcm_rechunk</a></li>
  161. <li><a id="toc-pgs_005fframe_005fmerge" href="#pgs_005fframe_005fmerge">11.25 pgs_frame_merge</a></li>
  162. <li><a id="toc-prores_005fmetadata" href="#prores_005fmetadata">11.26 prores_metadata</a></li>
  163. <li><a id="toc-remove_005fextra" href="#remove_005fextra">11.27 remove_extra</a></li>
  164. <li><a id="toc-setts" href="#setts">11.28 setts</a></li>
  165. <li><a id="toc-showinfo" href="#showinfo">11.29 showinfo</a></li>
  166. <li><a id="toc-text2movsub-1" href="#text2movsub-1">11.30 text2movsub</a></li>
  167. <li><a id="toc-trace_005fheaders" href="#trace_005fheaders">11.31 trace_headers</a></li>
  168. <li><a id="toc-truehd_005fcore" href="#truehd_005fcore">11.32 truehd_core</a></li>
  169. <li><a id="toc-vp9_005fmetadata" href="#vp9_005fmetadata">11.33 vp9_metadata</a></li>
  170. <li><a id="toc-vp9_005fsuperframe" href="#vp9_005fsuperframe">11.34 vp9_superframe</a></li>
  171. <li><a id="toc-vp9_005fsuperframe_005fsplit" href="#vp9_005fsuperframe_005fsplit">11.35 vp9_superframe_split</a></li>
  172. <li><a id="toc-vp9_005fraw_005freorder" href="#vp9_005fraw_005freorder">11.36 vp9_raw_reorder</a></li>
  173. </ul></li>
  174. <li><a id="toc-Format-Options" href="#Format-Options">12 Format Options</a>
  175. <ul class="toc-numbered-mark">
  176. <li><a id="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">12.1 Format stream specifiers</a></li>
  177. </ul></li>
  178. <li><a id="toc-Demuxers" href="#Demuxers">13 Demuxers</a>
  179. <ul class="toc-numbered-mark">
  180. <li><a id="toc-aa" href="#aa">13.1 aa</a></li>
  181. <li><a id="toc-aac" href="#aac">13.2 aac</a></li>
  182. <li><a id="toc-apng" href="#apng">13.3 apng</a></li>
  183. <li><a id="toc-asf" href="#asf">13.4 asf</a></li>
  184. <li><a id="toc-concat-1" href="#concat-1">13.5 concat</a>
  185. <ul class="toc-numbered-mark">
  186. <li><a id="toc-Syntax-1" href="#Syntax-1">13.5.1 Syntax</a></li>
  187. <li><a id="toc-Options-11" href="#Options-11">13.5.2 Options</a></li>
  188. <li><a id="toc-Examples-3" href="#Examples-3">13.5.3 Examples</a></li>
  189. </ul></li>
  190. <li><a id="toc-dash" href="#dash">13.6 dash</a>
  191. <ul class="toc-numbered-mark">
  192. <li><a id="toc-Options-12" href="#Options-12">13.6.1 Options</a></li>
  193. </ul></li>
  194. <li><a id="toc-dvdvideo" href="#dvdvideo">13.7 dvdvideo</a>
  195. <ul class="toc-numbered-mark">
  196. <li><a id="toc-Background" href="#Background">13.7.1 Background</a></li>
  197. <li><a id="toc-Options-13" href="#Options-13">13.7.2 Options</a></li>
  198. <li><a id="toc-Examples-4" href="#Examples-4">13.7.3 Examples</a></li>
  199. </ul></li>
  200. <li><a id="toc-ea" href="#ea">13.8 ea</a>
  201. <ul class="toc-numbered-mark">
  202. <li><a id="toc-Options-14" href="#Options-14">13.8.1 Options</a></li>
  203. </ul></li>
  204. <li><a id="toc-imf" href="#imf">13.9 imf</a></li>
  205. <li><a id="toc-flv_002c-live_005fflv_002c-kux" href="#flv_002c-live_005fflv_002c-kux">13.10 flv, live_flv, kux</a></li>
  206. <li><a id="toc-gif" href="#gif">13.11 gif</a></li>
  207. <li><a id="toc-hls" href="#hls">13.12 hls</a></li>
  208. <li><a id="toc-image2" href="#image2">13.13 image2</a>
  209. <ul class="toc-numbered-mark">
  210. <li><a id="toc-Examples-5" href="#Examples-5">13.13.1 Examples</a></li>
  211. </ul></li>
  212. <li><a id="toc-libgme" href="#libgme">13.14 libgme</a></li>
  213. <li><a id="toc-libmodplug" href="#libmodplug">13.15 libmodplug</a></li>
  214. <li><a id="toc-libopenmpt" href="#libopenmpt">13.16 libopenmpt</a></li>
  215. <li><a id="toc-mov_002fmp4_002f3gp" href="#mov_002fmp4_002f3gp">13.17 mov/mp4/3gp</a>
  216. <ul class="toc-numbered-mark">
  217. <li><a id="toc-Options-15" href="#Options-15">13.17.1 Options</a></li>
  218. <li><a id="toc-Audible-AAX" href="#Audible-AAX">13.17.2 Audible AAX</a></li>
  219. </ul></li>
  220. <li><a id="toc-mpegts" href="#mpegts">13.18 mpegts</a></li>
  221. <li><a id="toc-mpjpeg" href="#mpjpeg">13.19 mpjpeg</a></li>
  222. <li><a id="toc-rawvideo-1" href="#rawvideo-1">13.20 rawvideo</a></li>
  223. <li><a id="toc-sbg" href="#sbg">13.21 sbg</a></li>
  224. <li><a id="toc-tedcaptions" href="#tedcaptions">13.22 tedcaptions</a></li>
  225. <li><a id="toc-vapoursynth" href="#vapoursynth">13.23 vapoursynth</a></li>
  226. <li><a id="toc-w64" href="#w64">13.24 w64</a></li>
  227. <li><a id="toc-wav-1" href="#wav-1">13.25 wav</a></li>
  228. </ul></li>
  229. <li><a id="toc-Metadata" href="#Metadata">14 Metadata</a></li>
  230. <li><a id="toc-Protocol-Options" href="#Protocol-Options">15 Protocol Options</a></li>
  231. <li><a id="toc-Protocols" href="#Protocols">16 Protocols</a>
  232. <ul class="toc-numbered-mark">
  233. <li><a id="toc-amqp" href="#amqp">16.1 amqp</a></li>
  234. <li><a id="toc-async" href="#async">16.2 async</a></li>
  235. <li><a id="toc-bluray" href="#bluray">16.3 bluray</a></li>
  236. <li><a id="toc-cache" href="#cache">16.4 cache</a></li>
  237. <li><a id="toc-concat-2" href="#concat-2">16.5 concat</a></li>
  238. <li><a id="toc-concatf" href="#concatf">16.6 concatf</a></li>
  239. <li><a id="toc-crypto" href="#crypto">16.7 crypto</a></li>
  240. <li><a id="toc-data" href="#data">16.8 data</a></li>
  241. <li><a id="toc-fd" href="#fd">16.9 fd</a></li>
  242. <li><a id="toc-file" href="#file">16.10 file</a></li>
  243. <li><a id="toc-ftp" href="#ftp">16.11 ftp</a></li>
  244. <li><a id="toc-gopher" href="#gopher">16.12 gopher</a></li>
  245. <li><a id="toc-gophers" href="#gophers">16.13 gophers</a></li>
  246. <li><a id="toc-hls-1" href="#hls-1">16.14 hls</a></li>
  247. <li><a id="toc-http" href="#http">16.15 http</a>
  248. <ul class="toc-numbered-mark">
  249. <li><a id="toc-HTTP-Cookies" href="#HTTP-Cookies">16.15.1 HTTP Cookies</a></li>
  250. </ul></li>
  251. <li><a id="toc-Icecast" href="#Icecast">16.16 Icecast</a></li>
  252. <li><a id="toc-ipfs" href="#ipfs">16.17 ipfs</a></li>
  253. <li><a id="toc-mmst" href="#mmst">16.18 mmst</a></li>
  254. <li><a id="toc-mmsh" href="#mmsh">16.19 mmsh</a></li>
  255. <li><a id="toc-md5" href="#md5">16.20 md5</a></li>
  256. <li><a id="toc-pipe" href="#pipe">16.21 pipe</a></li>
  257. <li><a id="toc-prompeg" href="#prompeg">16.22 prompeg</a></li>
  258. <li><a id="toc-rist" href="#rist">16.23 rist</a></li>
  259. <li><a id="toc-rtmp" href="#rtmp">16.24 rtmp</a></li>
  260. <li><a id="toc-rtmpe" href="#rtmpe">16.25 rtmpe</a></li>
  261. <li><a id="toc-rtmps" href="#rtmps">16.26 rtmps</a></li>
  262. <li><a id="toc-rtmpt" href="#rtmpt">16.27 rtmpt</a></li>
  263. <li><a id="toc-rtmpte" href="#rtmpte">16.28 rtmpte</a></li>
  264. <li><a id="toc-rtmpts" href="#rtmpts">16.29 rtmpts</a></li>
  265. <li><a id="toc-libsmbclient" href="#libsmbclient">16.30 libsmbclient</a></li>
  266. <li><a id="toc-libssh" href="#libssh">16.31 libssh</a></li>
  267. <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">16.32 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
  268. <li><a id="toc-rtp" href="#rtp">16.33 rtp</a></li>
  269. <li><a id="toc-rtsp" href="#rtsp">16.34 rtsp</a>
  270. <ul class="toc-numbered-mark">
  271. <li><a id="toc-Muxer" href="#Muxer">16.34.1 Muxer</a></li>
  272. <li><a id="toc-Demuxer" href="#Demuxer">16.34.2 Demuxer</a></li>
  273. <li><a id="toc-Examples-6" href="#Examples-6">16.34.3 Examples</a></li>
  274. </ul></li>
  275. <li><a id="toc-sap" href="#sap">16.35 sap</a>
  276. <ul class="toc-numbered-mark">
  277. <li><a id="toc-Muxer-1" href="#Muxer-1">16.35.1 Muxer</a></li>
  278. <li><a id="toc-Demuxer-1" href="#Demuxer-1">16.35.2 Demuxer</a></li>
  279. </ul></li>
  280. <li><a id="toc-sctp" href="#sctp">16.36 sctp</a></li>
  281. <li><a id="toc-srt" href="#srt">16.37 srt</a></li>
  282. <li><a id="toc-srtp" href="#srtp">16.38 srtp</a></li>
  283. <li><a id="toc-subfile" href="#subfile">16.39 subfile</a></li>
  284. <li><a id="toc-tee" href="#tee">16.40 tee</a></li>
  285. <li><a id="toc-tcp" href="#tcp">16.41 tcp</a></li>
  286. <li><a id="toc-tls" href="#tls">16.42 tls</a></li>
  287. <li><a id="toc-udp" href="#udp">16.43 udp</a>
  288. <ul class="toc-numbered-mark">
  289. <li><a id="toc-Examples-7" href="#Examples-7">16.43.1 Examples</a></li>
  290. </ul></li>
  291. <li><a id="toc-unix" href="#unix">16.44 unix</a></li>
  292. <li><a id="toc-zmq" href="#zmq">16.45 zmq</a></li>
  293. </ul></li>
  294. <li><a id="toc-Device-Options" href="#Device-Options">17 Device Options</a></li>
  295. <li><a id="toc-Input-Devices" href="#Input-Devices">18 Input Devices</a>
  296. <ul class="toc-numbered-mark">
  297. <li><a id="toc-alsa" href="#alsa">18.1 alsa</a>
  298. <ul class="toc-numbered-mark">
  299. <li><a id="toc-Options-16" href="#Options-16">18.1.1 Options</a></li>
  300. </ul></li>
  301. <li><a id="toc-android_005fcamera" href="#android_005fcamera">18.2 android_camera</a>
  302. <ul class="toc-numbered-mark">
  303. <li><a id="toc-Options-17" href="#Options-17">18.2.1 Options</a></li>
  304. </ul></li>
  305. <li><a id="toc-avfoundation" href="#avfoundation">18.3 avfoundation</a>
  306. <ul class="toc-numbered-mark">
  307. <li><a id="toc-Options-18" href="#Options-18">18.3.1 Options</a></li>
  308. <li><a id="toc-Examples-8" href="#Examples-8">18.3.2 Examples</a></li>
  309. </ul></li>
  310. <li><a id="toc-bktr" href="#bktr">18.4 bktr</a>
  311. <ul class="toc-numbered-mark">
  312. <li><a id="toc-Options-19" href="#Options-19">18.4.1 Options</a></li>
  313. </ul></li>
  314. <li><a id="toc-decklink" href="#decklink">18.5 decklink</a>
  315. <ul class="toc-numbered-mark">
  316. <li><a id="toc-Options-20" href="#Options-20">18.5.1 Options</a></li>
  317. <li><a id="toc-Examples-9" href="#Examples-9">18.5.2 Examples</a></li>
  318. </ul></li>
  319. <li><a id="toc-dshow" href="#dshow">18.6 dshow</a>
  320. <ul class="toc-numbered-mark">
  321. <li><a id="toc-Options-21" href="#Options-21">18.6.1 Options</a></li>
  322. <li><a id="toc-Examples-10" href="#Examples-10">18.6.2 Examples</a></li>
  323. </ul></li>
  324. <li><a id="toc-fbdev" href="#fbdev">18.7 fbdev</a>
  325. <ul class="toc-numbered-mark">
  326. <li><a id="toc-Options-22" href="#Options-22">18.7.1 Options</a></li>
  327. </ul></li>
  328. <li><a id="toc-gdigrab" href="#gdigrab">18.8 gdigrab</a>
  329. <ul class="toc-numbered-mark">
  330. <li><a id="toc-Options-23" href="#Options-23">18.8.1 Options</a></li>
  331. </ul></li>
  332. <li><a id="toc-iec61883" href="#iec61883">18.9 iec61883</a>
  333. <ul class="toc-numbered-mark">
  334. <li><a id="toc-Options-24" href="#Options-24">18.9.1 Options</a></li>
  335. <li><a id="toc-Examples-11" href="#Examples-11">18.9.2 Examples</a></li>
  336. </ul></li>
  337. <li><a id="toc-jack" href="#jack">18.10 jack</a>
  338. <ul class="toc-numbered-mark">
  339. <li><a id="toc-Options-25" href="#Options-25">18.10.1 Options</a></li>
  340. </ul></li>
  341. <li><a id="toc-kmsgrab" href="#kmsgrab">18.11 kmsgrab</a>
  342. <ul class="toc-numbered-mark">
  343. <li><a id="toc-Options-26" href="#Options-26">18.11.1 Options</a></li>
  344. <li><a id="toc-Examples-12" href="#Examples-12">18.11.2 Examples</a></li>
  345. </ul></li>
  346. <li><a id="toc-lavfi" href="#lavfi">18.12 lavfi</a>
  347. <ul class="toc-numbered-mark">
  348. <li><a id="toc-Options-27" href="#Options-27">18.12.1 Options</a></li>
  349. <li><a id="toc-Examples-13" href="#Examples-13">18.12.2 Examples</a></li>
  350. </ul></li>
  351. <li><a id="toc-libcdio" href="#libcdio">18.13 libcdio</a>
  352. <ul class="toc-numbered-mark">
  353. <li><a id="toc-Options-28" href="#Options-28">18.13.1 Options</a></li>
  354. </ul></li>
  355. <li><a id="toc-libdc1394" href="#libdc1394">18.14 libdc1394</a>
  356. <ul class="toc-numbered-mark">
  357. <li><a id="toc-Options-29" href="#Options-29">18.14.1 Options</a></li>
  358. </ul></li>
  359. <li><a id="toc-openal" href="#openal">18.15 openal</a>
  360. <ul class="toc-numbered-mark">
  361. <li><a id="toc-Options-30" href="#Options-30">18.15.1 Options</a></li>
  362. <li><a id="toc-Examples-14" href="#Examples-14">18.15.2 Examples</a></li>
  363. </ul></li>
  364. <li><a id="toc-oss" href="#oss">18.16 oss</a>
  365. <ul class="toc-numbered-mark">
  366. <li><a id="toc-Options-31" href="#Options-31">18.16.1 Options</a></li>
  367. </ul></li>
  368. <li><a id="toc-pulse" href="#pulse">18.17 pulse</a>
  369. <ul class="toc-numbered-mark">
  370. <li><a id="toc-Options-32" href="#Options-32">18.17.1 Options</a></li>
  371. <li><a id="toc-Examples-15" href="#Examples-15">18.17.2 Examples</a></li>
  372. </ul></li>
  373. <li><a id="toc-sndio" href="#sndio">18.18 sndio</a>
  374. <ul class="toc-numbered-mark">
  375. <li><a id="toc-Options-33" href="#Options-33">18.18.1 Options</a></li>
  376. </ul></li>
  377. <li><a id="toc-video4linux2_002c-v4l2" href="#video4linux2_002c-v4l2">18.19 video4linux2, v4l2</a>
  378. <ul class="toc-numbered-mark">
  379. <li><a id="toc-Options-34" href="#Options-34">18.19.1 Options</a></li>
  380. </ul></li>
  381. <li><a id="toc-vfwcap" href="#vfwcap">18.20 vfwcap</a>
  382. <ul class="toc-numbered-mark">
  383. <li><a id="toc-Options-35" href="#Options-35">18.20.1 Options</a></li>
  384. </ul></li>
  385. <li><a id="toc-x11grab" href="#x11grab">18.21 x11grab</a>
  386. <ul class="toc-numbered-mark">
  387. <li><a id="toc-Options-36" href="#Options-36">18.21.1 Options</a></li>
  388. </ul></li>
  389. </ul></li>
  390. <li><a id="toc-Resampler-Options" href="#Resampler-Options">19 Resampler Options</a></li>
  391. <li><a id="toc-Scaler-Options" href="#Scaler-Options">20 Scaler Options</a></li>
  392. <li><a id="toc-Filtering-Introduction" href="#Filtering-Introduction">21 Filtering Introduction</a></li>
  393. <li><a id="toc-graph2dot" href="#graph2dot">22 graph2dot</a></li>
  394. <li><a id="toc-Filtergraph-description" href="#Filtergraph-description">23 Filtergraph description</a>
  395. <ul class="toc-numbered-mark">
  396. <li><a id="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">23.1 Filtergraph syntax</a></li>
  397. <li><a id="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">23.2 Notes on filtergraph escaping</a></li>
  398. </ul></li>
  399. <li><a id="toc-Timeline-editing" href="#Timeline-editing">24 Timeline editing</a></li>
  400. <li><a id="toc-Changing-options-at-runtime-with-a-command" href="#Changing-options-at-runtime-with-a-command">25 Changing options at runtime with a command</a></li>
  401. <li><a id="toc-Options-for-filters-with-several-inputs-_0028framesync_0029" href="#Options-for-filters-with-several-inputs-_0028framesync_0029">26 Options for filters with several inputs (framesync)</a></li>
  402. <li><a id="toc-Audio-Filters" href="#Audio-Filters">27 Audio Filters</a>
  403. <ul class="toc-numbered-mark">
  404. <li><a id="toc-aap" href="#aap">27.1 aap</a></li>
  405. <li><a id="toc-acompressor" href="#acompressor">27.2 acompressor</a>
  406. <ul class="toc-numbered-mark">
  407. <li><a id="toc-Commands" href="#Commands">27.2.1 Commands</a></li>
  408. </ul></li>
  409. <li><a id="toc-acontrast" href="#acontrast">27.3 acontrast</a></li>
  410. <li><a id="toc-acopy" href="#acopy">27.4 acopy</a></li>
  411. <li><a id="toc-acrossfade" href="#acrossfade">27.5 acrossfade</a>
  412. <ul class="toc-numbered-mark">
  413. <li><a id="toc-Examples-16" href="#Examples-16">27.5.1 Examples</a></li>
  414. </ul></li>
  415. <li><a id="toc-acrossover" href="#acrossover">27.6 acrossover</a>
  416. <ul class="toc-numbered-mark">
  417. <li><a id="toc-Examples-17" href="#Examples-17">27.6.1 Examples</a></li>
  418. </ul></li>
  419. <li><a id="toc-acrusher" href="#acrusher">27.7 acrusher</a>
  420. <ul class="toc-numbered-mark">
  421. <li><a id="toc-Commands-1" href="#Commands-1">27.7.1 Commands</a></li>
  422. </ul></li>
  423. <li><a id="toc-acue" href="#acue">27.8 acue</a></li>
  424. <li><a id="toc-adeclick" href="#adeclick">27.9 adeclick</a></li>
  425. <li><a id="toc-adeclip" href="#adeclip">27.10 adeclip</a></li>
  426. <li><a id="toc-adecorrelate" href="#adecorrelate">27.11 adecorrelate</a></li>
  427. <li><a id="toc-adelay" href="#adelay">27.12 adelay</a>
  428. <ul class="toc-numbered-mark">
  429. <li><a id="toc-Examples-18" href="#Examples-18">27.12.1 Examples</a></li>
  430. </ul></li>
  431. <li><a id="toc-adenorm" href="#adenorm">27.13 adenorm</a>
  432. <ul class="toc-numbered-mark">
  433. <li><a id="toc-Commands-2" href="#Commands-2">27.13.1 Commands</a></li>
  434. </ul></li>
  435. <li><a id="toc-aderivative_002c-aintegral" href="#aderivative_002c-aintegral">27.14 aderivative, aintegral</a></li>
  436. <li><a id="toc-adrc" href="#adrc">27.15 adrc</a>
  437. <ul class="toc-numbered-mark">
  438. <li><a id="toc-Commands-3" href="#Commands-3">27.15.1 Commands</a></li>
  439. <li><a id="toc-Examples-19" href="#Examples-19">27.15.2 Examples</a></li>
  440. </ul></li>
  441. <li><a id="toc-adynamicequalizer" href="#adynamicequalizer">27.16 adynamicequalizer</a>
  442. <ul class="toc-numbered-mark">
  443. <li><a id="toc-Commands-4" href="#Commands-4">27.16.1 Commands</a></li>
  444. </ul></li>
  445. <li><a id="toc-adynamicsmooth" href="#adynamicsmooth">27.17 adynamicsmooth</a>
  446. <ul class="toc-numbered-mark">
  447. <li><a id="toc-Commands-5" href="#Commands-5">27.17.1 Commands</a></li>
  448. </ul></li>
  449. <li><a id="toc-aecho" href="#aecho">27.18 aecho</a>
  450. <ul class="toc-numbered-mark">
  451. <li><a id="toc-Examples-20" href="#Examples-20">27.18.1 Examples</a></li>
  452. </ul></li>
  453. <li><a id="toc-aemphasis" href="#aemphasis">27.19 aemphasis</a>
  454. <ul class="toc-numbered-mark">
  455. <li><a id="toc-Commands-6" href="#Commands-6">27.19.1 Commands</a></li>
  456. </ul></li>
  457. <li><a id="toc-aeval" href="#aeval">27.20 aeval</a>
  458. <ul class="toc-numbered-mark">
  459. <li><a id="toc-Examples-21" href="#Examples-21">27.20.1 Examples</a></li>
  460. </ul></li>
  461. <li><a id="toc-aexciter" href="#aexciter">27.21 aexciter</a>
  462. <ul class="toc-numbered-mark">
  463. <li><a id="toc-Commands-7" href="#Commands-7">27.21.1 Commands</a></li>
  464. </ul></li>
  465. <li><a id="toc-afade-1" href="#afade-1">27.22 afade</a>
  466. <ul class="toc-numbered-mark">
  467. <li><a id="toc-Commands-8" href="#Commands-8">27.22.1 Commands</a></li>
  468. <li><a id="toc-Examples-22" href="#Examples-22">27.22.2 Examples</a></li>
  469. </ul></li>
  470. <li><a id="toc-afftdn" href="#afftdn">27.23 afftdn</a>
  471. <ul class="toc-numbered-mark">
  472. <li><a id="toc-Commands-9" href="#Commands-9">27.23.1 Commands</a></li>
  473. <li><a id="toc-Examples-23" href="#Examples-23">27.23.2 Examples</a></li>
  474. </ul></li>
  475. <li><a id="toc-afftfilt" href="#afftfilt">27.24 afftfilt</a>
  476. <ul class="toc-numbered-mark">
  477. <li><a id="toc-Examples-24" href="#Examples-24">27.24.1 Examples</a></li>
  478. </ul></li>
  479. <li><a id="toc-afir-1" href="#afir-1">27.25 afir</a>
  480. <ul class="toc-numbered-mark">
  481. <li><a id="toc-Examples-25" href="#Examples-25">27.25.1 Examples</a></li>
  482. </ul></li>
  483. <li><a id="toc-aformat-1" href="#aformat-1">27.26 aformat</a></li>
  484. <li><a id="toc-afreqshift" href="#afreqshift">27.27 afreqshift</a>
  485. <ul class="toc-numbered-mark">
  486. <li><a id="toc-Commands-10" href="#Commands-10">27.27.1 Commands</a></li>
  487. </ul></li>
  488. <li><a id="toc-afwtdn" href="#afwtdn">27.28 afwtdn</a>
  489. <ul class="toc-numbered-mark">
  490. <li><a id="toc-Commands-11" href="#Commands-11">27.28.1 Commands</a></li>
  491. </ul></li>
  492. <li><a id="toc-agate" href="#agate">27.29 agate</a>
  493. <ul class="toc-numbered-mark">
  494. <li><a id="toc-Commands-12" href="#Commands-12">27.29.1 Commands</a></li>
  495. </ul></li>
  496. <li><a id="toc-aiir" href="#aiir">27.30 aiir</a>
  497. <ul class="toc-numbered-mark">
  498. <li><a id="toc-Examples-26" href="#Examples-26">27.30.1 Examples</a></li>
  499. </ul></li>
  500. <li><a id="toc-alimiter" href="#alimiter">27.31 alimiter</a></li>
  501. <li><a id="toc-allpass" href="#allpass">27.32 allpass</a>
  502. <ul class="toc-numbered-mark">
  503. <li><a id="toc-Commands-13" href="#Commands-13">27.32.1 Commands</a></li>
  504. </ul></li>
  505. <li><a id="toc-aloop" href="#aloop">27.33 aloop</a></li>
  506. <li><a id="toc-amerge-1" href="#amerge-1">27.34 amerge</a>
  507. <ul class="toc-numbered-mark">
  508. <li><a id="toc-Examples-27" href="#Examples-27">27.34.1 Examples</a></li>
  509. </ul></li>
  510. <li><a id="toc-amix" href="#amix">27.35 amix</a>
  511. <ul class="toc-numbered-mark">
  512. <li><a id="toc-Examples-28" href="#Examples-28">27.35.1 Examples</a></li>
  513. <li><a id="toc-Commands-14" href="#Commands-14">27.35.2 Commands</a></li>
  514. </ul></li>
  515. <li><a id="toc-amultiply" href="#amultiply">27.36 amultiply</a></li>
  516. <li><a id="toc-anequalizer" href="#anequalizer">27.37 anequalizer</a>
  517. <ul class="toc-numbered-mark">
  518. <li><a id="toc-Examples-29" href="#Examples-29">27.37.1 Examples</a></li>
  519. <li><a id="toc-Commands-15" href="#Commands-15">27.37.2 Commands</a></li>
  520. </ul></li>
  521. <li><a id="toc-anlmdn" href="#anlmdn">27.38 anlmdn</a>
  522. <ul class="toc-numbered-mark">
  523. <li><a id="toc-Commands-16" href="#Commands-16">27.38.1 Commands</a></li>
  524. </ul></li>
  525. <li><a id="toc-anlmf_002c-anlms" href="#anlmf_002c-anlms">27.39 anlmf, anlms</a>
  526. <ul class="toc-numbered-mark">
  527. <li><a id="toc-Examples-30" href="#Examples-30">27.39.1 Examples</a></li>
  528. <li><a id="toc-Commands-17" href="#Commands-17">27.39.2 Commands</a></li>
  529. </ul></li>
  530. <li><a id="toc-anull" href="#anull">27.40 anull</a></li>
  531. <li><a id="toc-apad" href="#apad">27.41 apad</a>
  532. <ul class="toc-numbered-mark">
  533. <li><a id="toc-Examples-31" href="#Examples-31">27.41.1 Examples</a></li>
  534. </ul></li>
  535. <li><a id="toc-aphaser" href="#aphaser">27.42 aphaser</a></li>
  536. <li><a id="toc-aphaseshift" href="#aphaseshift">27.43 aphaseshift</a>
  537. <ul class="toc-numbered-mark">
  538. <li><a id="toc-Commands-18" href="#Commands-18">27.43.1 Commands</a></li>
  539. </ul></li>
  540. <li><a id="toc-apsnr" href="#apsnr">27.44 apsnr</a></li>
  541. <li><a id="toc-apsyclip" href="#apsyclip">27.45 apsyclip</a>
  542. <ul class="toc-numbered-mark">
  543. <li><a id="toc-Commands-19" href="#Commands-19">27.45.1 Commands</a></li>
  544. </ul></li>
  545. <li><a id="toc-apulsator" href="#apulsator">27.46 apulsator</a></li>
  546. <li><a id="toc-aresample-1" href="#aresample-1">27.47 aresample</a>
  547. <ul class="toc-numbered-mark">
  548. <li><a id="toc-Examples-32" href="#Examples-32">27.47.1 Examples</a></li>
  549. </ul></li>
  550. <li><a id="toc-areverse" href="#areverse">27.48 areverse</a>
  551. <ul class="toc-numbered-mark">
  552. <li><a id="toc-Examples-33" href="#Examples-33">27.48.1 Examples</a></li>
  553. </ul></li>
  554. <li><a id="toc-arls" href="#arls">27.49 arls</a></li>
  555. <li><a id="toc-arnndn" href="#arnndn">27.50 arnndn</a>
  556. <ul class="toc-numbered-mark">
  557. <li><a id="toc-Commands-20" href="#Commands-20">27.50.1 Commands</a></li>
  558. </ul></li>
  559. <li><a id="toc-asdr" href="#asdr">27.51 asdr</a></li>
  560. <li><a id="toc-asetnsamples" href="#asetnsamples">27.52 asetnsamples</a></li>
  561. <li><a id="toc-asetrate" href="#asetrate">27.53 asetrate</a></li>
  562. <li><a id="toc-ashowinfo" href="#ashowinfo">27.54 ashowinfo</a></li>
  563. <li><a id="toc-asisdr" href="#asisdr">27.55 asisdr</a></li>
  564. <li><a id="toc-asoftclip" href="#asoftclip">27.56 asoftclip</a>
  565. <ul class="toc-numbered-mark">
  566. <li><a id="toc-Commands-21" href="#Commands-21">27.56.1 Commands</a></li>
  567. </ul></li>
  568. <li><a id="toc-aspectralstats" href="#aspectralstats">27.57 aspectralstats</a></li>
  569. <li><a id="toc-asr" href="#asr">27.58 asr</a></li>
  570. <li><a id="toc-astats-1" href="#astats-1">27.59 astats</a></li>
  571. <li><a id="toc-asubboost" href="#asubboost">27.60 asubboost</a>
  572. <ul class="toc-numbered-mark">
  573. <li><a id="toc-Commands-22" href="#Commands-22">27.60.1 Commands</a></li>
  574. </ul></li>
  575. <li><a id="toc-asubcut" href="#asubcut">27.61 asubcut</a>
  576. <ul class="toc-numbered-mark">
  577. <li><a id="toc-Commands-23" href="#Commands-23">27.61.1 Commands</a></li>
  578. </ul></li>
  579. <li><a id="toc-asupercut" href="#asupercut">27.62 asupercut</a>
  580. <ul class="toc-numbered-mark">
  581. <li><a id="toc-Commands-24" href="#Commands-24">27.62.1 Commands</a></li>
  582. </ul></li>
  583. <li><a id="toc-asuperpass" href="#asuperpass">27.63 asuperpass</a>
  584. <ul class="toc-numbered-mark">
  585. <li><a id="toc-Commands-25" href="#Commands-25">27.63.1 Commands</a></li>
  586. </ul></li>
  587. <li><a id="toc-asuperstop" href="#asuperstop">27.64 asuperstop</a>
  588. <ul class="toc-numbered-mark">
  589. <li><a id="toc-Commands-26" href="#Commands-26">27.64.1 Commands</a></li>
  590. </ul></li>
  591. <li><a id="toc-atempo" href="#atempo">27.65 atempo</a>
  592. <ul class="toc-numbered-mark">
  593. <li><a id="toc-Examples-34" href="#Examples-34">27.65.1 Examples</a></li>
  594. <li><a id="toc-Commands-27" href="#Commands-27">27.65.2 Commands</a></li>
  595. </ul></li>
  596. <li><a id="toc-atilt" href="#atilt">27.66 atilt</a>
  597. <ul class="toc-numbered-mark">
  598. <li><a id="toc-Commands-28" href="#Commands-28">27.66.1 Commands</a></li>
  599. </ul></li>
  600. <li><a id="toc-atrim" href="#atrim">27.67 atrim</a></li>
  601. <li><a id="toc-axcorrelate" href="#axcorrelate">27.68 axcorrelate</a>
  602. <ul class="toc-numbered-mark">
  603. <li><a id="toc-Examples-35" href="#Examples-35">27.68.1 Examples</a></li>
  604. </ul></li>
  605. <li><a id="toc-bandpass" href="#bandpass">27.69 bandpass</a>
  606. <ul class="toc-numbered-mark">
  607. <li><a id="toc-Commands-29" href="#Commands-29">27.69.1 Commands</a></li>
  608. </ul></li>
  609. <li><a id="toc-bandreject" href="#bandreject">27.70 bandreject</a>
  610. <ul class="toc-numbered-mark">
  611. <li><a id="toc-Commands-30" href="#Commands-30">27.70.1 Commands</a></li>
  612. </ul></li>
  613. <li><a id="toc-bass_002c-lowshelf" href="#bass_002c-lowshelf">27.71 bass, lowshelf</a>
  614. <ul class="toc-numbered-mark">
  615. <li><a id="toc-Commands-31" href="#Commands-31">27.71.1 Commands</a></li>
  616. </ul></li>
  617. <li><a id="toc-biquad" href="#biquad">27.72 biquad</a>
  618. <ul class="toc-numbered-mark">
  619. <li><a id="toc-Commands-32" href="#Commands-32">27.72.1 Commands</a></li>
  620. </ul></li>
  621. <li><a id="toc-bs2b" href="#bs2b">27.73 bs2b</a></li>
  622. <li><a id="toc-channelmap" href="#channelmap">27.74 channelmap</a>
  623. <ul class="toc-numbered-mark">
  624. <li><a id="toc-Examples-36" href="#Examples-36">27.74.1 Examples</a></li>
  625. </ul></li>
  626. <li><a id="toc-channelsplit" href="#channelsplit">27.75 channelsplit</a>
  627. <ul class="toc-numbered-mark">
  628. <li><a id="toc-Examples-37" href="#Examples-37">27.75.1 Examples</a></li>
  629. </ul></li>
  630. <li><a id="toc-chorus" href="#chorus">27.76 chorus</a>
  631. <ul class="toc-numbered-mark">
  632. <li><a id="toc-Examples-38" href="#Examples-38">27.76.1 Examples</a></li>
  633. </ul></li>
  634. <li><a id="toc-compand" href="#compand">27.77 compand</a>
  635. <ul class="toc-numbered-mark">
  636. <li><a id="toc-Examples-39" href="#Examples-39">27.77.1 Examples</a></li>
  637. </ul></li>
  638. <li><a id="toc-compensationdelay" href="#compensationdelay">27.78 compensationdelay</a>
  639. <ul class="toc-numbered-mark">
  640. <li><a id="toc-Commands-33" href="#Commands-33">27.78.1 Commands</a></li>
  641. </ul></li>
  642. <li><a id="toc-crossfeed" href="#crossfeed">27.79 crossfeed</a>
  643. <ul class="toc-numbered-mark">
  644. <li><a id="toc-Commands-34" href="#Commands-34">27.79.1 Commands</a></li>
  645. </ul></li>
  646. <li><a id="toc-crystalizer" href="#crystalizer">27.80 crystalizer</a>
  647. <ul class="toc-numbered-mark">
  648. <li><a id="toc-Commands-35" href="#Commands-35">27.80.1 Commands</a></li>
  649. </ul></li>
  650. <li><a id="toc-dcshift" href="#dcshift">27.81 dcshift</a></li>
  651. <li><a id="toc-deesser" href="#deesser">27.82 deesser</a></li>
  652. <li><a id="toc-dialoguenhance" href="#dialoguenhance">27.83 dialoguenhance</a>
  653. <ul class="toc-numbered-mark">
  654. <li><a id="toc-Commands-36" href="#Commands-36">27.83.1 Commands</a></li>
  655. </ul></li>
  656. <li><a id="toc-drmeter" href="#drmeter">27.84 drmeter</a></li>
  657. <li><a id="toc-dynaudnorm" href="#dynaudnorm">27.85 dynaudnorm</a>
  658. <ul class="toc-numbered-mark">
  659. <li><a id="toc-Commands-37" href="#Commands-37">27.85.1 Commands</a></li>
  660. </ul></li>
  661. <li><a id="toc-earwax" href="#earwax">27.86 earwax</a></li>
  662. <li><a id="toc-equalizer" href="#equalizer">27.87 equalizer</a>
  663. <ul class="toc-numbered-mark">
  664. <li><a id="toc-Examples-40" href="#Examples-40">27.87.1 Examples</a></li>
  665. <li><a id="toc-Commands-38" href="#Commands-38">27.87.2 Commands</a></li>
  666. </ul></li>
  667. <li><a id="toc-extrastereo" href="#extrastereo">27.88 extrastereo</a>
  668. <ul class="toc-numbered-mark">
  669. <li><a id="toc-Commands-39" href="#Commands-39">27.88.1 Commands</a></li>
  670. </ul></li>
  671. <li><a id="toc-firequalizer" href="#firequalizer">27.89 firequalizer</a>
  672. <ul class="toc-numbered-mark">
  673. <li><a id="toc-Examples-41" href="#Examples-41">27.89.1 Examples</a></li>
  674. </ul></li>
  675. <li><a id="toc-flanger" href="#flanger">27.90 flanger</a></li>
  676. <li><a id="toc-haas" href="#haas">27.91 haas</a></li>
  677. <li><a id="toc-hdcd" href="#hdcd">27.92 hdcd</a></li>
  678. <li><a id="toc-headphone" href="#headphone">27.93 headphone</a>
  679. <ul class="toc-numbered-mark">
  680. <li><a id="toc-Examples-42" href="#Examples-42">27.93.1 Examples</a></li>
  681. </ul></li>
  682. <li><a id="toc-highpass" href="#highpass">27.94 highpass</a>
  683. <ul class="toc-numbered-mark">
  684. <li><a id="toc-Commands-40" href="#Commands-40">27.94.1 Commands</a></li>
  685. </ul></li>
  686. <li><a id="toc-join" href="#join">27.95 join</a></li>
  687. <li><a id="toc-ladspa" href="#ladspa">27.96 ladspa</a>
  688. <ul class="toc-numbered-mark">
  689. <li><a id="toc-Examples-43" href="#Examples-43">27.96.1 Examples</a></li>
  690. <li><a id="toc-Commands-41" href="#Commands-41">27.96.2 Commands</a></li>
  691. </ul></li>
  692. <li><a id="toc-loudnorm" href="#loudnorm">27.97 loudnorm</a></li>
  693. <li><a id="toc-lowpass" href="#lowpass">27.98 lowpass</a>
  694. <ul class="toc-numbered-mark">
  695. <li><a id="toc-Examples-44" href="#Examples-44">27.98.1 Examples</a></li>
  696. <li><a id="toc-Commands-42" href="#Commands-42">27.98.2 Commands</a></li>
  697. </ul></li>
  698. <li><a id="toc-lv2" href="#lv2">27.99 lv2</a>
  699. <ul class="toc-numbered-mark">
  700. <li><a id="toc-Examples-45" href="#Examples-45">27.99.1 Examples</a></li>
  701. <li><a id="toc-Commands-43" href="#Commands-43">27.99.2 Commands</a></li>
  702. </ul></li>
  703. <li><a id="toc-mcompand" href="#mcompand">27.100 mcompand</a></li>
  704. <li><a id="toc-pan-1" href="#pan-1">27.101 pan</a>
  705. <ul class="toc-numbered-mark">
  706. <li><a id="toc-Mixing-examples" href="#Mixing-examples">27.101.1 Mixing examples</a></li>
  707. <li><a id="toc-Remapping-examples" href="#Remapping-examples">27.101.2 Remapping examples</a></li>
  708. </ul></li>
  709. <li><a id="toc-replaygain" href="#replaygain">27.102 replaygain</a></li>
  710. <li><a id="toc-resample" href="#resample">27.103 resample</a></li>
  711. <li><a id="toc-rubberband" href="#rubberband">27.104 rubberband</a>
  712. <ul class="toc-numbered-mark">
  713. <li><a id="toc-Commands-44" href="#Commands-44">27.104.1 Commands</a></li>
  714. </ul></li>
  715. <li><a id="toc-sidechaincompress" href="#sidechaincompress">27.105 sidechaincompress</a>
  716. <ul class="toc-numbered-mark">
  717. <li><a id="toc-Commands-45" href="#Commands-45">27.105.1 Commands</a></li>
  718. <li><a id="toc-Examples-46" href="#Examples-46">27.105.2 Examples</a></li>
  719. </ul></li>
  720. <li><a id="toc-sidechaingate" href="#sidechaingate">27.106 sidechaingate</a>
  721. <ul class="toc-numbered-mark">
  722. <li><a id="toc-Commands-46" href="#Commands-46">27.106.1 Commands</a></li>
  723. </ul></li>
  724. <li><a id="toc-silencedetect" href="#silencedetect">27.107 silencedetect</a>
  725. <ul class="toc-numbered-mark">
  726. <li><a id="toc-Examples-47" href="#Examples-47">27.107.1 Examples</a></li>
  727. </ul></li>
  728. <li><a id="toc-silenceremove" href="#silenceremove">27.108 silenceremove</a>
  729. <ul class="toc-numbered-mark">
  730. <li><a id="toc-Examples-48" href="#Examples-48">27.108.1 Examples</a></li>
  731. <li><a id="toc-Commands-47" href="#Commands-47">27.108.2 Commands</a></li>
  732. </ul></li>
  733. <li><a id="toc-sofalizer" href="#sofalizer">27.109 sofalizer</a>
  734. <ul class="toc-numbered-mark">
  735. <li><a id="toc-Examples-49" href="#Examples-49">27.109.1 Examples</a></li>
  736. </ul></li>
  737. <li><a id="toc-speechnorm" href="#speechnorm">27.110 speechnorm</a>
  738. <ul class="toc-numbered-mark">
  739. <li><a id="toc-Commands-48" href="#Commands-48">27.110.1 Commands</a></li>
  740. <li><a id="toc-Examples-50" href="#Examples-50">27.110.2 Examples</a></li>
  741. </ul></li>
  742. <li><a id="toc-stereotools" href="#stereotools">27.111 stereotools</a>
  743. <ul class="toc-numbered-mark">
  744. <li><a id="toc-Commands-49" href="#Commands-49">27.111.1 Commands</a></li>
  745. <li><a id="toc-Examples-51" href="#Examples-51">27.111.2 Examples</a></li>
  746. </ul></li>
  747. <li><a id="toc-stereowiden" href="#stereowiden">27.112 stereowiden</a>
  748. <ul class="toc-numbered-mark">
  749. <li><a id="toc-Commands-50" href="#Commands-50">27.112.1 Commands</a></li>
  750. </ul></li>
  751. <li><a id="toc-superequalizer" href="#superequalizer">27.113 superequalizer</a></li>
  752. <li><a id="toc-surround" href="#surround">27.114 surround</a></li>
  753. <li><a id="toc-tiltshelf" href="#tiltshelf">27.115 tiltshelf</a>
  754. <ul class="toc-numbered-mark">
  755. <li><a id="toc-Commands-51" href="#Commands-51">27.115.1 Commands</a></li>
  756. </ul></li>
  757. <li><a id="toc-treble_002c-highshelf" href="#treble_002c-highshelf">27.116 treble, highshelf</a>
  758. <ul class="toc-numbered-mark">
  759. <li><a id="toc-Commands-52" href="#Commands-52">27.116.1 Commands</a></li>
  760. </ul></li>
  761. <li><a id="toc-tremolo" href="#tremolo">27.117 tremolo</a></li>
  762. <li><a id="toc-vibrato" href="#vibrato">27.118 vibrato</a></li>
  763. <li><a id="toc-virtualbass" href="#virtualbass">27.119 virtualbass</a></li>
  764. <li><a id="toc-volume" href="#volume">27.120 volume</a>
  765. <ul class="toc-numbered-mark">
  766. <li><a id="toc-Commands-53" href="#Commands-53">27.120.1 Commands</a></li>
  767. <li><a id="toc-Examples-52" href="#Examples-52">27.120.2 Examples</a></li>
  768. </ul></li>
  769. <li><a id="toc-volumedetect" href="#volumedetect">27.121 volumedetect</a>
  770. <ul class="toc-numbered-mark">
  771. <li><a id="toc-Examples-53" href="#Examples-53">27.121.1 Examples</a></li>
  772. </ul></li>
  773. </ul></li>
  774. <li><a id="toc-Audio-Sources" href="#Audio-Sources">28 Audio Sources</a>
  775. <ul class="toc-numbered-mark">
  776. <li><a id="toc-abuffer" href="#abuffer">28.1 abuffer</a>
  777. <ul class="toc-numbered-mark">
  778. <li><a id="toc-Examples-54" href="#Examples-54">28.1.1 Examples</a></li>
  779. </ul></li>
  780. <li><a id="toc-aevalsrc" href="#aevalsrc">28.2 aevalsrc</a>
  781. <ul class="toc-numbered-mark">
  782. <li><a id="toc-Examples-55" href="#Examples-55">28.2.1 Examples</a></li>
  783. </ul></li>
  784. <li><a id="toc-afdelaysrc" href="#afdelaysrc">28.3 afdelaysrc</a></li>
  785. <li><a id="toc-afireqsrc" href="#afireqsrc">28.4 afireqsrc</a></li>
  786. <li><a id="toc-afirsrc" href="#afirsrc">28.5 afirsrc</a></li>
  787. <li><a id="toc-anullsrc" href="#anullsrc">28.6 anullsrc</a>
  788. <ul class="toc-numbered-mark">
  789. <li><a id="toc-Examples-56" href="#Examples-56">28.6.1 Examples</a></li>
  790. </ul></li>
  791. <li><a id="toc-flite" href="#flite">28.7 flite</a>
  792. <ul class="toc-numbered-mark">
  793. <li><a id="toc-Examples-57" href="#Examples-57">28.7.1 Examples</a></li>
  794. </ul></li>
  795. <li><a id="toc-anoisesrc" href="#anoisesrc">28.8 anoisesrc</a>
  796. <ul class="toc-numbered-mark">
  797. <li><a id="toc-Examples-58" href="#Examples-58">28.8.1 Examples</a></li>
  798. </ul></li>
  799. <li><a id="toc-hilbert" href="#hilbert">28.9 hilbert</a></li>
  800. <li><a id="toc-sinc" href="#sinc">28.10 sinc</a></li>
  801. <li><a id="toc-sine" href="#sine">28.11 sine</a>
  802. <ul class="toc-numbered-mark">
  803. <li><a id="toc-Examples-59" href="#Examples-59">28.11.1 Examples</a></li>
  804. </ul></li>
  805. </ul></li>
  806. <li><a id="toc-Audio-Sinks" href="#Audio-Sinks">29 Audio Sinks</a>
  807. <ul class="toc-numbered-mark">
  808. <li><a id="toc-abuffersink" href="#abuffersink">29.1 abuffersink</a></li>
  809. <li><a id="toc-anullsink" href="#anullsink">29.2 anullsink</a></li>
  810. </ul></li>
  811. <li><a id="toc-Video-Filters" href="#Video-Filters">30 Video Filters</a>
  812. <ul class="toc-numbered-mark">
  813. <li><a id="toc-addroi" href="#addroi">30.1 addroi</a>
  814. <ul class="toc-numbered-mark">
  815. <li><a id="toc-Examples-60" href="#Examples-60">30.1.1 Examples</a></li>
  816. </ul></li>
  817. <li><a id="toc-alphaextract" href="#alphaextract">30.2 alphaextract</a></li>
  818. <li><a id="toc-alphamerge" href="#alphamerge">30.3 alphamerge</a></li>
  819. <li><a id="toc-amplify" href="#amplify">30.4 amplify</a>
  820. <ul class="toc-numbered-mark">
  821. <li><a id="toc-Commands-54" href="#Commands-54">30.4.1 Commands</a></li>
  822. </ul></li>
  823. <li><a id="toc-ass" href="#ass">30.5 ass</a></li>
  824. <li><a id="toc-atadenoise" href="#atadenoise">30.6 atadenoise</a>
  825. <ul class="toc-numbered-mark">
  826. <li><a id="toc-Commands-55" href="#Commands-55">30.6.1 Commands</a></li>
  827. </ul></li>
  828. <li><a id="toc-avgblur" href="#avgblur">30.7 avgblur</a>
  829. <ul class="toc-numbered-mark">
  830. <li><a id="toc-Commands-56" href="#Commands-56">30.7.1 Commands</a></li>
  831. </ul></li>
  832. <li><a id="toc-backgroundkey" href="#backgroundkey">30.8 backgroundkey</a>
  833. <ul class="toc-numbered-mark">
  834. <li><a id="toc-Commands-57" href="#Commands-57">30.8.1 Commands</a></li>
  835. </ul></li>
  836. <li><a id="toc-bbox" href="#bbox">30.9 bbox</a>
  837. <ul class="toc-numbered-mark">
  838. <li><a id="toc-Commands-58" href="#Commands-58">30.9.1 Commands</a></li>
  839. </ul></li>
  840. <li><a id="toc-bilateral" href="#bilateral">30.10 bilateral</a>
  841. <ul class="toc-numbered-mark">
  842. <li><a id="toc-Commands-59" href="#Commands-59">30.10.1 Commands</a></li>
  843. </ul></li>
  844. <li><a id="toc-bilateral_005fcuda" href="#bilateral_005fcuda">30.11 bilateral_cuda</a>
  845. <ul class="toc-numbered-mark">
  846. <li><a id="toc-Examples-61" href="#Examples-61">30.11.1 Examples</a></li>
  847. </ul></li>
  848. <li><a id="toc-bitplanenoise" href="#bitplanenoise">30.12 bitplanenoise</a></li>
  849. <li><a id="toc-blackdetect" href="#blackdetect">30.13 blackdetect</a></li>
  850. <li><a id="toc-blackframe" href="#blackframe">30.14 blackframe</a></li>
  851. <li><a id="toc-blend-1" href="#blend-1">30.15 blend</a>
  852. <ul class="toc-numbered-mark">
  853. <li><a id="toc-Examples-62" href="#Examples-62">30.15.1 Examples</a></li>
  854. <li><a id="toc-Commands-60" href="#Commands-60">30.15.2 Commands</a></li>
  855. </ul></li>
  856. <li><a id="toc-blockdetect-1" href="#blockdetect-1">30.16 blockdetect</a>
  857. <ul class="toc-numbered-mark">
  858. <li><a id="toc-Examples-63" href="#Examples-63">30.16.1 Examples</a></li>
  859. </ul></li>
  860. <li><a id="toc-blurdetect-1" href="#blurdetect-1">30.17 blurdetect</a>
  861. <ul class="toc-numbered-mark">
  862. <li><a id="toc-Examples-64" href="#Examples-64">30.17.1 Examples</a></li>
  863. </ul></li>
  864. <li><a id="toc-bm3d" href="#bm3d">30.18 bm3d</a>
  865. <ul class="toc-numbered-mark">
  866. <li><a id="toc-Examples-65" href="#Examples-65">30.18.1 Examples</a></li>
  867. </ul></li>
  868. <li><a id="toc-boxblur" href="#boxblur">30.19 boxblur</a>
  869. <ul class="toc-numbered-mark">
  870. <li><a id="toc-Examples-66" href="#Examples-66">30.19.1 Examples</a></li>
  871. </ul></li>
  872. <li><a id="toc-bwdif-1" href="#bwdif-1">30.20 bwdif</a></li>
  873. <li><a id="toc-bwdif_005fcuda" href="#bwdif_005fcuda">30.21 bwdif_cuda</a></li>
  874. <li><a id="toc-ccrepack" href="#ccrepack">30.22 ccrepack</a></li>
  875. <li><a id="toc-cas" href="#cas">30.23 cas</a>
  876. <ul class="toc-numbered-mark">
  877. <li><a id="toc-Commands-61" href="#Commands-61">30.23.1 Commands</a></li>
  878. </ul></li>
  879. <li><a id="toc-chromahold" href="#chromahold">30.24 chromahold</a>
  880. <ul class="toc-numbered-mark">
  881. <li><a id="toc-Commands-62" href="#Commands-62">30.24.1 Commands</a></li>
  882. </ul></li>
  883. <li><a id="toc-chromakey-1" href="#chromakey-1">30.25 chromakey</a>
  884. <ul class="toc-numbered-mark">
  885. <li><a id="toc-Commands-63" href="#Commands-63">30.25.1 Commands</a></li>
  886. <li><a id="toc-Examples-67" href="#Examples-67">30.25.2 Examples</a></li>
  887. </ul></li>
  888. <li><a id="toc-chromakey_005fcuda" href="#chromakey_005fcuda">30.26 chromakey_cuda</a>
  889. <ul class="toc-numbered-mark">
  890. <li><a id="toc-Examples-68" href="#Examples-68">30.26.1 Examples</a></li>
  891. </ul></li>
  892. <li><a id="toc-chromanr" href="#chromanr">30.27 chromanr</a>
  893. <ul class="toc-numbered-mark">
  894. <li><a id="toc-Commands-64" href="#Commands-64">30.27.1 Commands</a></li>
  895. </ul></li>
  896. <li><a id="toc-chromashift" href="#chromashift">30.28 chromashift</a>
  897. <ul class="toc-numbered-mark">
  898. <li><a id="toc-Commands-65" href="#Commands-65">30.28.1 Commands</a></li>
  899. </ul></li>
  900. <li><a id="toc-ciescope" href="#ciescope">30.29 ciescope</a></li>
  901. <li><a id="toc-codecview" href="#codecview">30.30 codecview</a>
  902. <ul class="toc-numbered-mark">
  903. <li><a id="toc-Examples-69" href="#Examples-69">30.30.1 Examples</a></li>
  904. </ul></li>
  905. <li><a id="toc-colorbalance" href="#colorbalance">30.31 colorbalance</a>
  906. <ul class="toc-numbered-mark">
  907. <li><a id="toc-Examples-70" href="#Examples-70">30.31.1 Examples</a></li>
  908. <li><a id="toc-Commands-66" href="#Commands-66">30.31.2 Commands</a></li>
  909. </ul></li>
  910. <li><a id="toc-colorcontrast" href="#colorcontrast">30.32 colorcontrast</a>
  911. <ul class="toc-numbered-mark">
  912. <li><a id="toc-Commands-67" href="#Commands-67">30.32.1 Commands</a></li>
  913. </ul></li>
  914. <li><a id="toc-colorcorrect" href="#colorcorrect">30.33 colorcorrect</a>
  915. <ul class="toc-numbered-mark">
  916. <li><a id="toc-Commands-68" href="#Commands-68">30.33.1 Commands</a></li>
  917. </ul></li>
  918. <li><a id="toc-colorchannelmixer" href="#colorchannelmixer">30.34 colorchannelmixer</a>
  919. <ul class="toc-numbered-mark">
  920. <li><a id="toc-Examples-71" href="#Examples-71">30.34.1 Examples</a></li>
  921. <li><a id="toc-Commands-69" href="#Commands-69">30.34.2 Commands</a></li>
  922. </ul></li>
  923. <li><a id="toc-colorize" href="#colorize">30.35 colorize</a>
  924. <ul class="toc-numbered-mark">
  925. <li><a id="toc-Commands-70" href="#Commands-70">30.35.1 Commands</a></li>
  926. </ul></li>
  927. <li><a id="toc-colorkey" href="#colorkey">30.36 colorkey</a>
  928. <ul class="toc-numbered-mark">
  929. <li><a id="toc-Examples-72" href="#Examples-72">30.36.1 Examples</a></li>
  930. <li><a id="toc-Commands-71" href="#Commands-71">30.36.2 Commands</a></li>
  931. </ul></li>
  932. <li><a id="toc-colorhold" href="#colorhold">30.37 colorhold</a>
  933. <ul class="toc-numbered-mark">
  934. <li><a id="toc-Commands-72" href="#Commands-72">30.37.1 Commands</a></li>
  935. </ul></li>
  936. <li><a id="toc-colorlevels" href="#colorlevels">30.38 colorlevels</a>
  937. <ul class="toc-numbered-mark">
  938. <li><a id="toc-Examples-73" href="#Examples-73">30.38.1 Examples</a></li>
  939. <li><a id="toc-Commands-73" href="#Commands-73">30.38.2 Commands</a></li>
  940. </ul></li>
  941. <li><a id="toc-colormap" href="#colormap">30.39 colormap</a></li>
  942. <li><a id="toc-colormatrix" href="#colormatrix">30.40 colormatrix</a></li>
  943. <li><a id="toc-colorspace" href="#colorspace">30.41 colorspace</a></li>
  944. <li><a id="toc-colorspace_005fcuda" href="#colorspace_005fcuda">30.42 colorspace_cuda</a></li>
  945. <li><a id="toc-colortemperature" href="#colortemperature">30.43 colortemperature</a>
  946. <ul class="toc-numbered-mark">
  947. <li><a id="toc-Commands-74" href="#Commands-74">30.43.1 Commands</a></li>
  948. </ul></li>
  949. <li><a id="toc-convolution" href="#convolution">30.44 convolution</a>
  950. <ul class="toc-numbered-mark">
  951. <li><a id="toc-Commands-75" href="#Commands-75">30.44.1 Commands</a></li>
  952. <li><a id="toc-Examples-74" href="#Examples-74">30.44.2 Examples</a></li>
  953. </ul></li>
  954. <li><a id="toc-convolve" href="#convolve">30.45 convolve</a></li>
  955. <li><a id="toc-copy" href="#copy">30.46 copy</a></li>
  956. <li><a id="toc-coreimage-1" href="#coreimage-1">30.47 coreimage</a>
  957. <ul class="toc-numbered-mark">
  958. <li><a id="toc-Examples-75" href="#Examples-75">30.47.1 Examples</a></li>
  959. </ul></li>
  960. <li><a id="toc-corr" href="#corr">30.48 corr</a></li>
  961. <li><a id="toc-cover_005frect" href="#cover_005frect">30.49 cover_rect</a>
  962. <ul class="toc-numbered-mark">
  963. <li><a id="toc-Examples-76" href="#Examples-76">30.49.1 Examples</a></li>
  964. </ul></li>
  965. <li><a id="toc-crop" href="#crop">30.50 crop</a>
  966. <ul class="toc-numbered-mark">
  967. <li><a id="toc-Examples-77" href="#Examples-77">30.50.1 Examples</a></li>
  968. <li><a id="toc-Commands-76" href="#Commands-76">30.50.2 Commands</a></li>
  969. </ul></li>
  970. <li><a id="toc-cropdetect" href="#cropdetect">30.51 cropdetect</a>
  971. <ul class="toc-numbered-mark">
  972. <li><a id="toc-Examples-78" href="#Examples-78">30.51.1 Examples</a></li>
  973. <li><a id="toc-Commands-77" href="#Commands-77">30.51.2 Commands</a></li>
  974. </ul></li>
  975. <li><a id="toc-cue-1" href="#cue-1">30.52 cue</a></li>
  976. <li><a id="toc-curves-1" href="#curves-1">30.53 curves</a>
  977. <ul class="toc-numbered-mark">
  978. <li><a id="toc-Commands-78" href="#Commands-78">30.53.1 Commands</a></li>
  979. <li><a id="toc-Examples-79" href="#Examples-79">30.53.2 Examples</a></li>
  980. </ul></li>
  981. <li><a id="toc-datascope" href="#datascope">30.54 datascope</a>
  982. <ul class="toc-numbered-mark">
  983. <li><a id="toc-Commands-79" href="#Commands-79">30.54.1 Commands</a></li>
  984. </ul></li>
  985. <li><a id="toc-dblur" href="#dblur">30.55 dblur</a>
  986. <ul class="toc-numbered-mark">
  987. <li><a id="toc-Commands-80" href="#Commands-80">30.55.1 Commands</a></li>
  988. </ul></li>
  989. <li><a id="toc-dctdnoiz" href="#dctdnoiz">30.56 dctdnoiz</a>
  990. <ul class="toc-numbered-mark">
  991. <li><a id="toc-Examples-80" href="#Examples-80">30.56.1 Examples</a></li>
  992. </ul></li>
  993. <li><a id="toc-deband" href="#deband">30.57 deband</a>
  994. <ul class="toc-numbered-mark">
  995. <li><a id="toc-Commands-81" href="#Commands-81">30.57.1 Commands</a></li>
  996. </ul></li>
  997. <li><a id="toc-deblock" href="#deblock">30.58 deblock</a>
  998. <ul class="toc-numbered-mark">
  999. <li><a id="toc-Examples-81" href="#Examples-81">30.58.1 Examples</a></li>
  1000. <li><a id="toc-Commands-82" href="#Commands-82">30.58.2 Commands</a></li>
  1001. </ul></li>
  1002. <li><a id="toc-decimate-1" href="#decimate-1">30.59 decimate</a></li>
  1003. <li><a id="toc-deconvolve" href="#deconvolve">30.60 deconvolve</a></li>
  1004. <li><a id="toc-dedot" href="#dedot">30.61 dedot</a></li>
  1005. <li><a id="toc-deflate" href="#deflate">30.62 deflate</a>
  1006. <ul class="toc-numbered-mark">
  1007. <li><a id="toc-Commands-83" href="#Commands-83">30.62.1 Commands</a></li>
  1008. </ul></li>
  1009. <li><a id="toc-deflicker" href="#deflicker">30.63 deflicker</a></li>
  1010. <li><a id="toc-dejudder" href="#dejudder">30.64 dejudder</a></li>
  1011. <li><a id="toc-delogo" href="#delogo">30.65 delogo</a>
  1012. <ul class="toc-numbered-mark">
  1013. <li><a id="toc-Examples-82" href="#Examples-82">30.65.1 Examples</a></li>
  1014. </ul></li>
  1015. <li><a id="toc-derain-1" href="#derain-1">30.66 derain</a></li>
  1016. <li><a id="toc-deshake" href="#deshake">30.67 deshake</a></li>
  1017. <li><a id="toc-despill" href="#despill">30.68 despill</a>
  1018. <ul class="toc-numbered-mark">
  1019. <li><a id="toc-Commands-84" href="#Commands-84">30.68.1 Commands</a></li>
  1020. </ul></li>
  1021. <li><a id="toc-detelecine" href="#detelecine">30.69 detelecine</a></li>
  1022. <li><a id="toc-dilation-1" href="#dilation-1">30.70 dilation</a>
  1023. <ul class="toc-numbered-mark">
  1024. <li><a id="toc-Commands-85" href="#Commands-85">30.70.1 Commands</a></li>
  1025. </ul></li>
  1026. <li><a id="toc-displace" href="#displace">30.71 displace</a>
  1027. <ul class="toc-numbered-mark">
  1028. <li><a id="toc-Examples-83" href="#Examples-83">30.71.1 Examples</a></li>
  1029. </ul></li>
  1030. <li><a id="toc-dnn_005fclassify" href="#dnn_005fclassify">30.72 dnn_classify</a></li>
  1031. <li><a id="toc-dnn_005fdetect" href="#dnn_005fdetect">30.73 dnn_detect</a></li>
  1032. <li><a id="toc-dnn_005fprocessing-1" href="#dnn_005fprocessing-1">30.74 dnn_processing</a>
  1033. <ul class="toc-numbered-mark">
  1034. <li><a id="toc-Examples-84" href="#Examples-84">30.74.1 Examples</a></li>
  1035. </ul></li>
  1036. <li><a id="toc-drawbox" href="#drawbox">30.75 drawbox</a>
  1037. <ul class="toc-numbered-mark">
  1038. <li><a id="toc-Examples-85" href="#Examples-85">30.75.1 Examples</a></li>
  1039. <li><a id="toc-Commands-86" href="#Commands-86">30.75.2 Commands</a></li>
  1040. </ul></li>
  1041. <li><a id="toc-drawgraph-1" href="#drawgraph-1">30.76 drawgraph</a></li>
  1042. <li><a id="toc-drawgrid" href="#drawgrid">30.77 drawgrid</a>
  1043. <ul class="toc-numbered-mark">
  1044. <li><a id="toc-Examples-86" href="#Examples-86">30.77.1 Examples</a></li>
  1045. <li><a id="toc-Commands-87" href="#Commands-87">30.77.2 Commands</a></li>
  1046. </ul></li>
  1047. <li><a id="toc-drawtext-1" href="#drawtext-1">30.78 drawtext</a>
  1048. <ul class="toc-numbered-mark">
  1049. <li><a id="toc-Syntax-2" href="#Syntax-2">30.78.1 Syntax</a></li>
  1050. <li><a id="toc-Text-expansion" href="#Text-expansion">30.78.2 Text expansion</a></li>
  1051. <li><a id="toc-Commands-88" href="#Commands-88">30.78.3 Commands</a></li>
  1052. <li><a id="toc-Examples-87" href="#Examples-87">30.78.4 Examples</a></li>
  1053. </ul></li>
  1054. <li><a id="toc-edgedetect" href="#edgedetect">30.79 edgedetect</a>
  1055. <ul class="toc-numbered-mark">
  1056. <li><a id="toc-Examples-88" href="#Examples-88">30.79.1 Examples</a></li>
  1057. </ul></li>
  1058. <li><a id="toc-elbg" href="#elbg">30.80 elbg</a></li>
  1059. <li><a id="toc-entropy" href="#entropy">30.81 entropy</a></li>
  1060. <li><a id="toc-epx" href="#epx">30.82 epx</a></li>
  1061. <li><a id="toc-eq" href="#eq">30.83 eq</a>
  1062. <ul class="toc-numbered-mark">
  1063. <li><a id="toc-Commands-89" href="#Commands-89">30.83.1 Commands</a></li>
  1064. </ul></li>
  1065. <li><a id="toc-erosion-1" href="#erosion-1">30.84 erosion</a>
  1066. <ul class="toc-numbered-mark">
  1067. <li><a id="toc-Commands-90" href="#Commands-90">30.84.1 Commands</a></li>
  1068. </ul></li>
  1069. <li><a id="toc-estdif" href="#estdif">30.85 estdif</a>
  1070. <ul class="toc-numbered-mark">
  1071. <li><a id="toc-Commands-91" href="#Commands-91">30.85.1 Commands</a></li>
  1072. </ul></li>
  1073. <li><a id="toc-exposure" href="#exposure">30.86 exposure</a>
  1074. <ul class="toc-numbered-mark">
  1075. <li><a id="toc-Commands-92" href="#Commands-92">30.86.1 Commands</a></li>
  1076. </ul></li>
  1077. <li><a id="toc-extractplanes" href="#extractplanes">30.87 extractplanes</a>
  1078. <ul class="toc-numbered-mark">
  1079. <li><a id="toc-Examples-89" href="#Examples-89">30.87.1 Examples</a></li>
  1080. </ul></li>
  1081. <li><a id="toc-fade" href="#fade">30.88 fade</a>
  1082. <ul class="toc-numbered-mark">
  1083. <li><a id="toc-Examples-90" href="#Examples-90">30.88.1 Examples</a></li>
  1084. </ul></li>
  1085. <li><a id="toc-feedback" href="#feedback">30.89 feedback</a>
  1086. <ul class="toc-numbered-mark">
  1087. <li><a id="toc-Examples-91" href="#Examples-91">30.89.1 Examples</a></li>
  1088. </ul></li>
  1089. <li><a id="toc-fftdnoiz" href="#fftdnoiz">30.90 fftdnoiz</a></li>
  1090. <li><a id="toc-fftfilt" href="#fftfilt">30.91 fftfilt</a>
  1091. <ul class="toc-numbered-mark">
  1092. <li><a id="toc-Examples-92" href="#Examples-92">30.91.1 Examples</a></li>
  1093. </ul></li>
  1094. <li><a id="toc-field" href="#field">30.92 field</a></li>
  1095. <li><a id="toc-fieldhint" href="#fieldhint">30.93 fieldhint</a></li>
  1096. <li><a id="toc-fieldmatch" href="#fieldmatch">30.94 fieldmatch</a>
  1097. <ul class="toc-numbered-mark">
  1098. <li><a id="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">30.94.1 p/c/n/u/b meaning</a>
  1099. <ul class="toc-numbered-mark">
  1100. <li><a id="toc-p_002fc_002fn" href="#p_002fc_002fn">30.94.1.1 p/c/n</a></li>
  1101. <li><a id="toc-u_002fb" href="#u_002fb">30.94.1.2 u/b</a></li>
  1102. </ul></li>
  1103. <li><a id="toc-Examples-93" href="#Examples-93">30.94.2 Examples</a></li>
  1104. </ul></li>
  1105. <li><a id="toc-fieldorder" href="#fieldorder">30.95 fieldorder</a></li>
  1106. <li><a id="toc-fillborders" href="#fillborders">30.96 fillborders</a>
  1107. <ul class="toc-numbered-mark">
  1108. <li><a id="toc-Commands-93" href="#Commands-93">30.96.1 Commands</a></li>
  1109. </ul></li>
  1110. <li><a id="toc-find_005frect" href="#find_005frect">30.97 find_rect</a>
  1111. <ul class="toc-numbered-mark">
  1112. <li><a id="toc-Examples-94" href="#Examples-94">30.97.1 Examples</a></li>
  1113. </ul></li>
  1114. <li><a id="toc-floodfill" href="#floodfill">30.98 floodfill</a></li>
  1115. <li><a id="toc-format-1" href="#format-1">30.99 format</a>
  1116. <ul class="toc-numbered-mark">
  1117. <li><a id="toc-Examples-95" href="#Examples-95">30.99.1 Examples</a></li>
  1118. </ul></li>
  1119. <li><a id="toc-fps-1" href="#fps-1">30.100 fps</a>
  1120. <ul class="toc-numbered-mark">
  1121. <li><a id="toc-Examples-96" href="#Examples-96">30.100.1 Examples</a></li>
  1122. </ul></li>
  1123. <li><a id="toc-framepack" href="#framepack">30.101 framepack</a></li>
  1124. <li><a id="toc-framerate" href="#framerate">30.102 framerate</a></li>
  1125. <li><a id="toc-framestep" href="#framestep">30.103 framestep</a></li>
  1126. <li><a id="toc-freezedetect" href="#freezedetect">30.104 freezedetect</a></li>
  1127. <li><a id="toc-freezeframes" href="#freezeframes">30.105 freezeframes</a></li>
  1128. <li><a id="toc-frei0r-1" href="#frei0r-1">30.106 frei0r</a>
  1129. <ul class="toc-numbered-mark">
  1130. <li><a id="toc-Examples-97" href="#Examples-97">30.106.1 Examples</a></li>
  1131. <li><a id="toc-Commands-94" href="#Commands-94">30.106.2 Commands</a></li>
  1132. </ul></li>
  1133. <li><a id="toc-fspp" href="#fspp">30.107 fspp</a></li>
  1134. <li><a id="toc-fsync-1" href="#fsync-1">30.108 fsync</a></li>
  1135. <li><a id="toc-gblur" href="#gblur">30.109 gblur</a>
  1136. <ul class="toc-numbered-mark">
  1137. <li><a id="toc-Commands-95" href="#Commands-95">30.109.1 Commands</a></li>
  1138. </ul></li>
  1139. <li><a id="toc-geq" href="#geq">30.110 geq</a>
  1140. <ul class="toc-numbered-mark">
  1141. <li><a id="toc-Examples-98" href="#Examples-98">30.110.1 Examples</a></li>
  1142. </ul></li>
  1143. <li><a id="toc-gradfun" href="#gradfun">30.111 gradfun</a>
  1144. <ul class="toc-numbered-mark">
  1145. <li><a id="toc-Examples-99" href="#Examples-99">30.111.1 Examples</a></li>
  1146. </ul></li>
  1147. <li><a id="toc-graphmonitor-1" href="#graphmonitor-1">30.112 graphmonitor</a></li>
  1148. <li><a id="toc-grayworld" href="#grayworld">30.113 grayworld</a></li>
  1149. <li><a id="toc-greyedge" href="#greyedge">30.114 greyedge</a>
  1150. <ul class="toc-numbered-mark">
  1151. <li><a id="toc-Examples-100" href="#Examples-100">30.114.1 Examples</a></li>
  1152. </ul></li>
  1153. <li><a id="toc-guided" href="#guided">30.115 guided</a>
  1154. <ul class="toc-numbered-mark">
  1155. <li><a id="toc-Commands-96" href="#Commands-96">30.115.1 Commands</a></li>
  1156. <li><a id="toc-Examples-101" href="#Examples-101">30.115.2 Examples</a></li>
  1157. </ul></li>
  1158. <li><a id="toc-haldclut-1" href="#haldclut-1">30.116 haldclut</a>
  1159. <ul class="toc-numbered-mark">
  1160. <li><a id="toc-Commands-97" href="#Commands-97">30.116.1 Commands</a></li>
  1161. <li><a id="toc-Workflow-examples" href="#Workflow-examples">30.116.2 Workflow examples</a>
  1162. <ul class="toc-numbered-mark">
  1163. <li><a id="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">30.116.2.1 Hald CLUT video stream</a></li>
  1164. <li><a id="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">30.116.2.2 Hald CLUT with preview</a></li>
  1165. </ul></li>
  1166. </ul></li>
  1167. <li><a id="toc-hflip" href="#hflip">30.117 hflip</a></li>
  1168. <li><a id="toc-histeq" href="#histeq">30.118 histeq</a></li>
  1169. <li><a id="toc-histogram-1" href="#histogram-1">30.119 histogram</a>
  1170. <ul class="toc-numbered-mark">
  1171. <li><a id="toc-Examples-102" href="#Examples-102">30.119.1 Examples</a></li>
  1172. </ul></li>
  1173. <li><a id="toc-hqdn3d-1" href="#hqdn3d-1">30.120 hqdn3d</a>
  1174. <ul class="toc-numbered-mark">
  1175. <li><a id="toc-Commands-98" href="#Commands-98">30.120.1 Commands</a></li>
  1176. </ul></li>
  1177. <li><a id="toc-hwdownload-1" href="#hwdownload-1">30.121 hwdownload</a></li>
  1178. <li><a id="toc-hwmap" href="#hwmap">30.122 hwmap</a></li>
  1179. <li><a id="toc-hwupload-1" href="#hwupload-1">30.123 hwupload</a></li>
  1180. <li><a id="toc-hwupload_005fcuda-1" href="#hwupload_005fcuda-1">30.124 hwupload_cuda</a></li>
  1181. <li><a id="toc-hqx" href="#hqx">30.125 hqx</a></li>
  1182. <li><a id="toc-hstack-1" href="#hstack-1">30.126 hstack</a></li>
  1183. <li><a id="toc-hsvhold" href="#hsvhold">30.127 hsvhold</a></li>
  1184. <li><a id="toc-hsvkey" href="#hsvkey">30.128 hsvkey</a></li>
  1185. <li><a id="toc-hue" href="#hue">30.129 hue</a>
  1186. <ul class="toc-numbered-mark">
  1187. <li><a id="toc-Examples-103" href="#Examples-103">30.129.1 Examples</a></li>
  1188. <li><a id="toc-Commands-99" href="#Commands-99">30.129.2 Commands</a></li>
  1189. </ul></li>
  1190. <li><a id="toc-huesaturation" href="#huesaturation">30.130 huesaturation</a></li>
  1191. <li><a id="toc-hysteresis" href="#hysteresis">30.131 hysteresis</a></li>
  1192. <li><a id="toc-iccdetect" href="#iccdetect">30.132 iccdetect</a></li>
  1193. <li><a id="toc-iccgen" href="#iccgen">30.133 iccgen</a></li>
  1194. <li><a id="toc-identity" href="#identity">30.134 identity</a></li>
  1195. <li><a id="toc-idet" href="#idet">30.135 idet</a>
  1196. <ul class="toc-numbered-mark">
  1197. <li><a id="toc-Examples-104" href="#Examples-104">30.135.1 Examples</a></li>
  1198. </ul></li>
  1199. <li><a id="toc-il" href="#il">30.136 il</a>
  1200. <ul class="toc-numbered-mark">
  1201. <li><a id="toc-Commands-100" href="#Commands-100">30.136.1 Commands</a></li>
  1202. </ul></li>
  1203. <li><a id="toc-inflate" href="#inflate">30.137 inflate</a>
  1204. <ul class="toc-numbered-mark">
  1205. <li><a id="toc-Commands-101" href="#Commands-101">30.137.1 Commands</a></li>
  1206. </ul></li>
  1207. <li><a id="toc-interlace" href="#interlace">30.138 interlace</a></li>
  1208. <li><a id="toc-kerndeint" href="#kerndeint">30.139 kerndeint</a>
  1209. <ul class="toc-numbered-mark">
  1210. <li><a id="toc-Examples-105" href="#Examples-105">30.139.1 Examples</a></li>
  1211. </ul></li>
  1212. <li><a id="toc-kirsch" href="#kirsch">30.140 kirsch</a>
  1213. <ul class="toc-numbered-mark">
  1214. <li><a id="toc-Commands-102" href="#Commands-102">30.140.1 Commands</a></li>
  1215. </ul></li>
  1216. <li><a id="toc-lagfun" href="#lagfun">30.141 lagfun</a>
  1217. <ul class="toc-numbered-mark">
  1218. <li><a id="toc-Commands-103" href="#Commands-103">30.141.1 Commands</a></li>
  1219. </ul></li>
  1220. <li><a id="toc-lenscorrection" href="#lenscorrection">30.142 lenscorrection</a>
  1221. <ul class="toc-numbered-mark">
  1222. <li><a id="toc-Options-37" href="#Options-37">30.142.1 Options</a></li>
  1223. <li><a id="toc-Commands-104" href="#Commands-104">30.142.2 Commands</a></li>
  1224. </ul></li>
  1225. <li><a id="toc-lensfun" href="#lensfun">30.143 lensfun</a>
  1226. <ul class="toc-numbered-mark">
  1227. <li><a id="toc-Examples-106" href="#Examples-106">30.143.1 Examples</a></li>
  1228. </ul></li>
  1229. <li><a id="toc-libplacebo" href="#libplacebo">30.144 libplacebo</a>
  1230. <ul class="toc-numbered-mark">
  1231. <li><a id="toc-Options-38" href="#Options-38">30.144.1 Options</a>
  1232. <ul class="toc-numbered-mark">
  1233. <li><a id="toc-Output-mode" href="#Output-mode">30.144.1.1 Output mode</a></li>
  1234. <li><a id="toc-Scaling" href="#Scaling">30.144.1.2 Scaling</a></li>
  1235. <li><a id="toc-Debanding" href="#Debanding">30.144.1.3 Debanding</a></li>
  1236. <li><a id="toc-Color-adjustment" href="#Color-adjustment">30.144.1.4 Color adjustment</a></li>
  1237. <li><a id="toc-Peak-detection" href="#Peak-detection">30.144.1.5 Peak detection</a></li>
  1238. <li><a id="toc-Tone-mapping" href="#Tone-mapping">30.144.1.6 Tone mapping</a></li>
  1239. <li><a id="toc-Dithering" href="#Dithering">30.144.1.7 Dithering</a></li>
  1240. <li><a id="toc-Custom-shaders" href="#Custom-shaders">30.144.1.8 Custom shaders</a></li>
  1241. <li><a id="toc-Debugging-_002f-performance" href="#Debugging-_002f-performance">30.144.1.9 Debugging / performance</a></li>
  1242. </ul></li>
  1243. <li><a id="toc-Commands-105" href="#Commands-105">30.144.2 Commands</a></li>
  1244. <li><a id="toc-Examples-107" href="#Examples-107">30.144.3 Examples</a></li>
  1245. </ul></li>
  1246. <li><a id="toc-libvmaf-1" href="#libvmaf-1">30.145 libvmaf</a>
  1247. <ul class="toc-numbered-mark">
  1248. <li><a id="toc-Examples-108" href="#Examples-108">30.145.1 Examples</a></li>
  1249. </ul></li>
  1250. <li><a id="toc-libvmaf_005fcuda" href="#libvmaf_005fcuda">30.146 libvmaf_cuda</a>
  1251. <ul class="toc-numbered-mark">
  1252. <li><a id="toc-Examples-109" href="#Examples-109">30.146.1 Examples</a></li>
  1253. </ul></li>
  1254. <li><a id="toc-limitdiff" href="#limitdiff">30.147 limitdiff</a>
  1255. <ul class="toc-numbered-mark">
  1256. <li><a id="toc-Commands-106" href="#Commands-106">30.147.1 Commands</a></li>
  1257. </ul></li>
  1258. <li><a id="toc-limiter" href="#limiter">30.148 limiter</a>
  1259. <ul class="toc-numbered-mark">
  1260. <li><a id="toc-Commands-107" href="#Commands-107">30.148.1 Commands</a></li>
  1261. </ul></li>
  1262. <li><a id="toc-loop" href="#loop">30.149 loop</a>
  1263. <ul class="toc-numbered-mark">
  1264. <li><a id="toc-Examples-110" href="#Examples-110">30.149.1 Examples</a></li>
  1265. </ul></li>
  1266. <li><a id="toc-lut1d" href="#lut1d">30.150 lut1d</a>
  1267. <ul class="toc-numbered-mark">
  1268. <li><a id="toc-Commands-108" href="#Commands-108">30.150.1 Commands</a></li>
  1269. </ul></li>
  1270. <li><a id="toc-lut3d-1" href="#lut3d-1">30.151 lut3d</a>
  1271. <ul class="toc-numbered-mark">
  1272. <li><a id="toc-Commands-109" href="#Commands-109">30.151.1 Commands</a></li>
  1273. </ul></li>
  1274. <li><a id="toc-lumakey" href="#lumakey">30.152 lumakey</a>
  1275. <ul class="toc-numbered-mark">
  1276. <li><a id="toc-Commands-110" href="#Commands-110">30.152.1 Commands</a></li>
  1277. </ul></li>
  1278. <li><a id="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">30.153 lut, lutrgb, lutyuv</a>
  1279. <ul class="toc-numbered-mark">
  1280. <li><a id="toc-Commands-111" href="#Commands-111">30.153.1 Commands</a></li>
  1281. <li><a id="toc-Examples-111" href="#Examples-111">30.153.2 Examples</a></li>
  1282. </ul></li>
  1283. <li><a id="toc-lut2_002c-tlut2" href="#lut2_002c-tlut2">30.154 lut2, tlut2</a>
  1284. <ul class="toc-numbered-mark">
  1285. <li><a id="toc-Commands-112" href="#Commands-112">30.154.1 Commands</a></li>
  1286. <li><a id="toc-Examples-112" href="#Examples-112">30.154.2 Examples</a></li>
  1287. </ul></li>
  1288. <li><a id="toc-maskedclamp" href="#maskedclamp">30.155 maskedclamp</a>
  1289. <ul class="toc-numbered-mark">
  1290. <li><a id="toc-Commands-113" href="#Commands-113">30.155.1 Commands</a></li>
  1291. </ul></li>
  1292. <li><a id="toc-maskedmax" href="#maskedmax">30.156 maskedmax</a>
  1293. <ul class="toc-numbered-mark">
  1294. <li><a id="toc-Commands-114" href="#Commands-114">30.156.1 Commands</a></li>
  1295. </ul></li>
  1296. <li><a id="toc-maskedmerge" href="#maskedmerge">30.157 maskedmerge</a>
  1297. <ul class="toc-numbered-mark">
  1298. <li><a id="toc-Commands-115" href="#Commands-115">30.157.1 Commands</a></li>
  1299. </ul></li>
  1300. <li><a id="toc-maskedmin" href="#maskedmin">30.158 maskedmin</a>
  1301. <ul class="toc-numbered-mark">
  1302. <li><a id="toc-Commands-116" href="#Commands-116">30.158.1 Commands</a></li>
  1303. </ul></li>
  1304. <li><a id="toc-maskedthreshold" href="#maskedthreshold">30.159 maskedthreshold</a>
  1305. <ul class="toc-numbered-mark">
  1306. <li><a id="toc-Commands-117" href="#Commands-117">30.159.1 Commands</a></li>
  1307. </ul></li>
  1308. <li><a id="toc-maskfun" href="#maskfun">30.160 maskfun</a>
  1309. <ul class="toc-numbered-mark">
  1310. <li><a id="toc-Commands-118" href="#Commands-118">30.160.1 Commands</a></li>
  1311. </ul></li>
  1312. <li><a id="toc-mcdeint" href="#mcdeint">30.161 mcdeint</a></li>
  1313. <li><a id="toc-median" href="#median">30.162 median</a>
  1314. <ul class="toc-numbered-mark">
  1315. <li><a id="toc-Commands-119" href="#Commands-119">30.162.1 Commands</a></li>
  1316. </ul></li>
  1317. <li><a id="toc-mergeplanes" href="#mergeplanes">30.163 mergeplanes</a>
  1318. <ul class="toc-numbered-mark">
  1319. <li><a id="toc-Examples-113" href="#Examples-113">30.163.1 Examples</a></li>
  1320. </ul></li>
  1321. <li><a id="toc-mestimate" href="#mestimate">30.164 mestimate</a></li>
  1322. <li><a id="toc-midequalizer" href="#midequalizer">30.165 midequalizer</a></li>
  1323. <li><a id="toc-minterpolate" href="#minterpolate">30.166 minterpolate</a></li>
  1324. <li><a id="toc-mix" href="#mix">30.167 mix</a>
  1325. <ul class="toc-numbered-mark">
  1326. <li><a id="toc-Commands-120" href="#Commands-120">30.167.1 Commands</a></li>
  1327. </ul></li>
  1328. <li><a id="toc-monochrome" href="#monochrome">30.168 monochrome</a>
  1329. <ul class="toc-numbered-mark">
  1330. <li><a id="toc-Commands-121" href="#Commands-121">30.168.1 Commands</a></li>
  1331. </ul></li>
  1332. <li><a id="toc-morpho" href="#morpho">30.169 morpho</a>
  1333. <ul class="toc-numbered-mark">
  1334. <li><a id="toc-Commands-122" href="#Commands-122">30.169.1 Commands</a></li>
  1335. </ul></li>
  1336. <li><a id="toc-mpdecimate" href="#mpdecimate">30.170 mpdecimate</a></li>
  1337. <li><a id="toc-msad" href="#msad">30.171 msad</a></li>
  1338. <li><a id="toc-multiply" href="#multiply">30.172 multiply</a>
  1339. <ul class="toc-numbered-mark">
  1340. <li><a id="toc-Commands-123" href="#Commands-123">30.172.1 Commands</a></li>
  1341. </ul></li>
  1342. <li><a id="toc-negate" href="#negate">30.173 negate</a>
  1343. <ul class="toc-numbered-mark">
  1344. <li><a id="toc-Commands-124" href="#Commands-124">30.173.1 Commands</a></li>
  1345. </ul></li>
  1346. <li><a id="toc-nlmeans-1" href="#nlmeans-1">30.174 nlmeans</a></li>
  1347. <li><a id="toc-nnedi" href="#nnedi">30.175 nnedi</a>
  1348. <ul class="toc-numbered-mark">
  1349. <li><a id="toc-Commands-125" href="#Commands-125">30.175.1 Commands</a></li>
  1350. </ul></li>
  1351. <li><a id="toc-noformat" href="#noformat">30.176 noformat</a>
  1352. <ul class="toc-numbered-mark">
  1353. <li><a id="toc-Examples-114" href="#Examples-114">30.176.1 Examples</a></li>
  1354. </ul></li>
  1355. <li><a id="toc-noise-1" href="#noise-1">30.177 noise</a>
  1356. <ul class="toc-numbered-mark">
  1357. <li><a id="toc-Examples-115" href="#Examples-115">30.177.1 Examples</a></li>
  1358. </ul></li>
  1359. <li><a id="toc-normalize" href="#normalize">30.178 normalize</a>
  1360. <ul class="toc-numbered-mark">
  1361. <li><a id="toc-Commands-126" href="#Commands-126">30.178.1 Commands</a></li>
  1362. <li><a id="toc-Examples-116" href="#Examples-116">30.178.2 Examples</a></li>
  1363. </ul></li>
  1364. <li><a id="toc-null-1" href="#null-1">30.179 null</a></li>
  1365. <li><a id="toc-ocr" href="#ocr">30.180 ocr</a></li>
  1366. <li><a id="toc-ocv" href="#ocv">30.181 ocv</a>
  1367. <ul class="toc-numbered-mark">
  1368. <li><a id="toc-dilate-1" href="#dilate-1">30.181.1 dilate</a></li>
  1369. <li><a id="toc-erode" href="#erode">30.181.2 erode</a></li>
  1370. <li><a id="toc-smooth" href="#smooth">30.181.3 smooth</a></li>
  1371. </ul></li>
  1372. <li><a id="toc-oscilloscope" href="#oscilloscope">30.182 oscilloscope</a>
  1373. <ul class="toc-numbered-mark">
  1374. <li><a id="toc-Commands-127" href="#Commands-127">30.182.1 Commands</a></li>
  1375. <li><a id="toc-Examples-117" href="#Examples-117">30.182.2 Examples</a></li>
  1376. </ul></li>
  1377. <li><a id="toc-overlay-1" href="#overlay-1">30.183 overlay</a>
  1378. <ul class="toc-numbered-mark">
  1379. <li><a id="toc-Commands-128" href="#Commands-128">30.183.1 Commands</a></li>
  1380. <li><a id="toc-Examples-118" href="#Examples-118">30.183.2 Examples</a></li>
  1381. </ul></li>
  1382. <li><a id="toc-overlay_005fcuda-1" href="#overlay_005fcuda-1">30.184 overlay_cuda</a></li>
  1383. <li><a id="toc-owdenoise" href="#owdenoise">30.185 owdenoise</a></li>
  1384. <li><a id="toc-pad-1" href="#pad-1">30.186 pad</a>
  1385. <ul class="toc-numbered-mark">
  1386. <li><a id="toc-Examples-119" href="#Examples-119">30.186.1 Examples</a></li>
  1387. </ul></li>
  1388. <li><a id="toc-palettegen-1" href="#palettegen-1">30.187 palettegen</a>
  1389. <ul class="toc-numbered-mark">
  1390. <li><a id="toc-Examples-120" href="#Examples-120">30.187.1 Examples</a></li>
  1391. </ul></li>
  1392. <li><a id="toc-paletteuse" href="#paletteuse">30.188 paletteuse</a>
  1393. <ul class="toc-numbered-mark">
  1394. <li><a id="toc-Examples-121" href="#Examples-121">30.188.1 Examples</a></li>
  1395. </ul></li>
  1396. <li><a id="toc-perspective" href="#perspective">30.189 perspective</a></li>
  1397. <li><a id="toc-phase" href="#phase">30.190 phase</a>
  1398. <ul class="toc-numbered-mark">
  1399. <li><a id="toc-Commands-129" href="#Commands-129">30.190.1 Commands</a></li>
  1400. </ul></li>
  1401. <li><a id="toc-photosensitivity" href="#photosensitivity">30.191 photosensitivity</a></li>
  1402. <li><a id="toc-pixdesctest" href="#pixdesctest">30.192 pixdesctest</a></li>
  1403. <li><a id="toc-pixelize" href="#pixelize">30.193 pixelize</a>
  1404. <ul class="toc-numbered-mark">
  1405. <li><a id="toc-Commands-130" href="#Commands-130">30.193.1 Commands</a></li>
  1406. </ul></li>
  1407. <li><a id="toc-pixscope" href="#pixscope">30.194 pixscope</a>
  1408. <ul class="toc-numbered-mark">
  1409. <li><a id="toc-Commands-131" href="#Commands-131">30.194.1 Commands</a></li>
  1410. </ul></li>
  1411. <li><a id="toc-pp" href="#pp">30.195 pp</a>
  1412. <ul class="toc-numbered-mark">
  1413. <li><a id="toc-Examples-122" href="#Examples-122">30.195.1 Examples</a></li>
  1414. </ul></li>
  1415. <li><a id="toc-pp7" href="#pp7">30.196 pp7</a></li>
  1416. <li><a id="toc-premultiply" href="#premultiply">30.197 premultiply</a></li>
  1417. <li><a id="toc-prewitt" href="#prewitt">30.198 prewitt</a>
  1418. <ul class="toc-numbered-mark">
  1419. <li><a id="toc-Commands-132" href="#Commands-132">30.198.1 Commands</a></li>
  1420. </ul></li>
  1421. <li><a id="toc-pseudocolor" href="#pseudocolor">30.199 pseudocolor</a>
  1422. <ul class="toc-numbered-mark">
  1423. <li><a id="toc-Commands-133" href="#Commands-133">30.199.1 Commands</a></li>
  1424. <li><a id="toc-Examples-123" href="#Examples-123">30.199.2 Examples</a></li>
  1425. </ul></li>
  1426. <li><a id="toc-psnr" href="#psnr">30.200 psnr</a>
  1427. <ul class="toc-numbered-mark">
  1428. <li><a id="toc-Examples-124" href="#Examples-124">30.200.1 Examples</a></li>
  1429. </ul></li>
  1430. <li><a id="toc-pullup-1" href="#pullup-1">30.201 pullup</a></li>
  1431. <li><a id="toc-qp" href="#qp">30.202 qp</a>
  1432. <ul class="toc-numbered-mark">
  1433. <li><a id="toc-Examples-125" href="#Examples-125">30.202.1 Examples</a></li>
  1434. </ul></li>
  1435. <li><a id="toc-qrencode" href="#qrencode">30.203 qrencode</a>
  1436. <ul class="toc-numbered-mark">
  1437. <li><a id="toc-qrencode-Expressions" href="#qrencode-Expressions">30.203.1 qrencode Expressions</a></li>
  1438. <li><a id="toc-qrencode-Text-expansion" href="#qrencode-Text-expansion">30.203.2 qrencode Text expansion</a></li>
  1439. <li><a id="toc-Examples-126" href="#Examples-126">30.203.3 Examples</a></li>
  1440. </ul></li>
  1441. <li><a id="toc-quirc" href="#quirc">30.204 quirc</a></li>
  1442. <li><a id="toc-random" href="#random">30.205 random</a></li>
  1443. <li><a id="toc-readeia608" href="#readeia608">30.206 readeia608</a>
  1444. <ul class="toc-numbered-mark">
  1445. <li><a id="toc-Commands-134" href="#Commands-134">30.206.1 Commands</a></li>
  1446. <li><a id="toc-Examples-127" href="#Examples-127">30.206.2 Examples</a></li>
  1447. </ul></li>
  1448. <li><a id="toc-readvitc" href="#readvitc">30.207 readvitc</a>
  1449. <ul class="toc-numbered-mark">
  1450. <li><a id="toc-Examples-128" href="#Examples-128">30.207.1 Examples</a></li>
  1451. </ul></li>
  1452. <li><a id="toc-remap" href="#remap">30.208 remap</a></li>
  1453. <li><a id="toc-removegrain" href="#removegrain">30.209 removegrain</a></li>
  1454. <li><a id="toc-removelogo" href="#removelogo">30.210 removelogo</a></li>
  1455. <li><a id="toc-repeatfields" href="#repeatfields">30.211 repeatfields</a></li>
  1456. <li><a id="toc-reverse" href="#reverse">30.212 reverse</a>
  1457. <ul class="toc-numbered-mark">
  1458. <li><a id="toc-Examples-129" href="#Examples-129">30.212.1 Examples</a></li>
  1459. </ul></li>
  1460. <li><a id="toc-rgbashift" href="#rgbashift">30.213 rgbashift</a>
  1461. <ul class="toc-numbered-mark">
  1462. <li><a id="toc-Commands-135" href="#Commands-135">30.213.1 Commands</a></li>
  1463. </ul></li>
  1464. <li><a id="toc-roberts" href="#roberts">30.214 roberts</a>
  1465. <ul class="toc-numbered-mark">
  1466. <li><a id="toc-Commands-136" href="#Commands-136">30.214.1 Commands</a></li>
  1467. </ul></li>
  1468. <li><a id="toc-rotate" href="#rotate">30.215 rotate</a>
  1469. <ul class="toc-numbered-mark">
  1470. <li><a id="toc-Examples-130" href="#Examples-130">30.215.1 Examples</a></li>
  1471. <li><a id="toc-Commands-137" href="#Commands-137">30.215.2 Commands</a></li>
  1472. </ul></li>
  1473. <li><a id="toc-sab" href="#sab">30.216 sab</a></li>
  1474. <li><a id="toc-scale-1" href="#scale-1">30.217 scale</a>
  1475. <ul class="toc-numbered-mark">
  1476. <li><a id="toc-Options-39" href="#Options-39">30.217.1 Options</a></li>
  1477. <li><a id="toc-Examples-131" href="#Examples-131">30.217.2 Examples</a></li>
  1478. <li><a id="toc-Commands-138" href="#Commands-138">30.217.3 Commands</a></li>
  1479. </ul></li>
  1480. <li><a id="toc-scale_005fcuda-1" href="#scale_005fcuda-1">30.218 scale_cuda</a>
  1481. <ul class="toc-numbered-mark">
  1482. <li><a id="toc-Examples-132" href="#Examples-132">30.218.1 Examples</a></li>
  1483. </ul></li>
  1484. <li><a id="toc-scale_005fnpp-1" href="#scale_005fnpp-1">30.219 scale_npp</a></li>
  1485. <li><a id="toc-scale2ref" href="#scale2ref">30.220 scale2ref</a>
  1486. <ul class="toc-numbered-mark">
  1487. <li><a id="toc-Examples-133" href="#Examples-133">30.220.1 Examples</a></li>
  1488. <li><a id="toc-Commands-139" href="#Commands-139">30.220.2 Commands</a></li>
  1489. </ul></li>
  1490. <li><a id="toc-scale2ref_005fnpp" href="#scale2ref_005fnpp">30.221 scale2ref_npp</a>
  1491. <ul class="toc-numbered-mark">
  1492. <li><a id="toc-Examples-134" href="#Examples-134">30.221.1 Examples</a></li>
  1493. </ul></li>
  1494. <li><a id="toc-scale_005fvt" href="#scale_005fvt">30.222 scale_vt</a></li>
  1495. <li><a id="toc-scharr" href="#scharr">30.223 scharr</a>
  1496. <ul class="toc-numbered-mark">
  1497. <li><a id="toc-Commands-140" href="#Commands-140">30.223.1 Commands</a></li>
  1498. </ul></li>
  1499. <li><a id="toc-scroll" href="#scroll">30.224 scroll</a>
  1500. <ul class="toc-numbered-mark">
  1501. <li><a id="toc-Commands-141" href="#Commands-141">30.224.1 Commands</a></li>
  1502. </ul></li>
  1503. <li><a id="toc-scdet-1" href="#scdet-1">30.225 scdet</a></li>
  1504. <li><a id="toc-selectivecolor-1" href="#selectivecolor-1">30.226 selectivecolor</a>
  1505. <ul class="toc-numbered-mark">
  1506. <li><a id="toc-Examples-135" href="#Examples-135">30.226.1 Examples</a></li>
  1507. </ul></li>
  1508. <li><a id="toc-separatefields-1" href="#separatefields-1">30.227 separatefields</a></li>
  1509. <li><a id="toc-setdar_002c-setsar" href="#setdar_002c-setsar">30.228 setdar, setsar</a>
  1510. <ul class="toc-numbered-mark">
  1511. <li><a id="toc-Examples-136" href="#Examples-136">30.228.1 Examples</a></li>
  1512. </ul></li>
  1513. <li><a id="toc-setfield-1" href="#setfield-1">30.229 setfield</a></li>
  1514. <li><a id="toc-setparams-1" href="#setparams-1">30.230 setparams</a></li>
  1515. <li><a id="toc-sharpen_005fnpp" href="#sharpen_005fnpp">30.231 sharpen_npp</a></li>
  1516. <li><a id="toc-shear" href="#shear">30.232 shear</a>
  1517. <ul class="toc-numbered-mark">
  1518. <li><a id="toc-Commands-142" href="#Commands-142">30.232.1 Commands</a></li>
  1519. </ul></li>
  1520. <li><a id="toc-showinfo-1" href="#showinfo-1">30.233 showinfo</a></li>
  1521. <li><a id="toc-showpalette" href="#showpalette">30.234 showpalette</a></li>
  1522. <li><a id="toc-shuffleframes" href="#shuffleframes">30.235 shuffleframes</a>
  1523. <ul class="toc-numbered-mark">
  1524. <li><a id="toc-Examples-137" href="#Examples-137">30.235.1 Examples</a></li>
  1525. </ul></li>
  1526. <li><a id="toc-shufflepixels" href="#shufflepixels">30.236 shufflepixels</a></li>
  1527. <li><a id="toc-shuffleplanes" href="#shuffleplanes">30.237 shuffleplanes</a>
  1528. <ul class="toc-numbered-mark">
  1529. <li><a id="toc-Examples-138" href="#Examples-138">30.237.1 Examples</a></li>
  1530. </ul></li>
  1531. <li><a id="toc-signalstats-1" href="#signalstats-1">30.238 signalstats</a>
  1532. <ul class="toc-numbered-mark">
  1533. <li><a id="toc-Examples-139" href="#Examples-139">30.238.1 Examples</a></li>
  1534. </ul></li>
  1535. <li><a id="toc-signature-1" href="#signature-1">30.239 signature</a>
  1536. <ul class="toc-numbered-mark">
  1537. <li><a id="toc-Examples-140" href="#Examples-140">30.239.1 Examples</a></li>
  1538. </ul></li>
  1539. <li><a id="toc-siti-1" href="#siti-1">30.240 siti</a>
  1540. <ul class="toc-numbered-mark">
  1541. <li><a id="toc-Examples-141" href="#Examples-141">30.240.1 Examples</a></li>
  1542. </ul></li>
  1543. <li><a id="toc-smartblur-1" href="#smartblur-1">30.241 smartblur</a></li>
  1544. <li><a id="toc-sobel" href="#sobel">30.242 sobel</a>
  1545. <ul class="toc-numbered-mark">
  1546. <li><a id="toc-Commands-143" href="#Commands-143">30.242.1 Commands</a></li>
  1547. </ul></li>
  1548. <li><a id="toc-spp-1" href="#spp-1">30.243 spp</a>
  1549. <ul class="toc-numbered-mark">
  1550. <li><a id="toc-Commands-144" href="#Commands-144">30.243.1 Commands</a></li>
  1551. </ul></li>
  1552. <li><a id="toc-sr-1" href="#sr-1">30.244 sr</a></li>
  1553. <li><a id="toc-ssim" href="#ssim">30.245 ssim</a>
  1554. <ul class="toc-numbered-mark">
  1555. <li><a id="toc-Examples-142" href="#Examples-142">30.245.1 Examples</a></li>
  1556. </ul></li>
  1557. <li><a id="toc-stereo3d" href="#stereo3d">30.246 stereo3d</a>
  1558. <ul class="toc-numbered-mark">
  1559. <li><a id="toc-Examples-143" href="#Examples-143">30.246.1 Examples</a></li>
  1560. </ul></li>
  1561. <li><a id="toc-streamselect_002c-astreamselect" href="#streamselect_002c-astreamselect">30.247 streamselect, astreamselect</a>
  1562. <ul class="toc-numbered-mark">
  1563. <li><a id="toc-Commands-145" href="#Commands-145">30.247.1 Commands</a></li>
  1564. <li><a id="toc-Examples-144" href="#Examples-144">30.247.2 Examples</a></li>
  1565. </ul></li>
  1566. <li><a id="toc-subtitles-1" href="#subtitles-1">30.248 subtitles</a></li>
  1567. <li><a id="toc-super2xsai" href="#super2xsai">30.249 super2xsai</a></li>
  1568. <li><a id="toc-swaprect" href="#swaprect">30.250 swaprect</a>
  1569. <ul class="toc-numbered-mark">
  1570. <li><a id="toc-Commands-146" href="#Commands-146">30.250.1 Commands</a></li>
  1571. </ul></li>
  1572. <li><a id="toc-swapuv" href="#swapuv">30.251 swapuv</a></li>
  1573. <li><a id="toc-tblend" href="#tblend">30.252 tblend</a></li>
  1574. <li><a id="toc-telecine" href="#telecine">30.253 telecine</a></li>
  1575. <li><a id="toc-thistogram" href="#thistogram">30.254 thistogram</a></li>
  1576. <li><a id="toc-threshold" href="#threshold">30.255 threshold</a>
  1577. <ul class="toc-numbered-mark">
  1578. <li><a id="toc-Commands-147" href="#Commands-147">30.255.1 Commands</a></li>
  1579. <li><a id="toc-Examples-145" href="#Examples-145">30.255.2 Examples</a></li>
  1580. </ul></li>
  1581. <li><a id="toc-thumbnail" href="#thumbnail">30.256 thumbnail</a>
  1582. <ul class="toc-numbered-mark">
  1583. <li><a id="toc-Examples-146" href="#Examples-146">30.256.1 Examples</a></li>
  1584. </ul></li>
  1585. <li><a id="toc-tile-1" href="#tile-1">30.257 tile</a>
  1586. <ul class="toc-numbered-mark">
  1587. <li><a id="toc-Examples-147" href="#Examples-147">30.257.1 Examples</a></li>
  1588. </ul></li>
  1589. <li><a id="toc-tiltandshift" href="#tiltandshift">30.258 tiltandshift</a></li>
  1590. <li><a id="toc-tinterlace" href="#tinterlace">30.259 tinterlace</a></li>
  1591. <li><a id="toc-tmedian" href="#tmedian">30.260 tmedian</a>
  1592. <ul class="toc-numbered-mark">
  1593. <li><a id="toc-Commands-148" href="#Commands-148">30.260.1 Commands</a></li>
  1594. </ul></li>
  1595. <li><a id="toc-tmidequalizer" href="#tmidequalizer">30.261 tmidequalizer</a></li>
  1596. <li><a id="toc-tmix" href="#tmix">30.262 tmix</a>
  1597. <ul class="toc-numbered-mark">
  1598. <li><a id="toc-Examples-148" href="#Examples-148">30.262.1 Examples</a></li>
  1599. <li><a id="toc-Commands-149" href="#Commands-149">30.262.2 Commands</a></li>
  1600. </ul></li>
  1601. <li><a id="toc-tonemap-1" href="#tonemap-1">30.263 tonemap</a>
  1602. <ul class="toc-numbered-mark">
  1603. <li><a id="toc-Options-40" href="#Options-40">30.263.1 Options</a></li>
  1604. </ul></li>
  1605. <li><a id="toc-tpad" href="#tpad">30.264 tpad</a></li>
  1606. <li><a id="toc-transpose-1" href="#transpose-1">30.265 transpose</a></li>
  1607. <li><a id="toc-transpose_005fnpp" href="#transpose_005fnpp">30.266 transpose_npp</a></li>
  1608. <li><a id="toc-trim" href="#trim">30.267 trim</a></li>
  1609. <li><a id="toc-unpremultiply" href="#unpremultiply">30.268 unpremultiply</a></li>
  1610. <li><a id="toc-unsharp-1" href="#unsharp-1">30.269 unsharp</a>
  1611. <ul class="toc-numbered-mark">
  1612. <li><a id="toc-Examples-149" href="#Examples-149">30.269.1 Examples</a></li>
  1613. </ul></li>
  1614. <li><a id="toc-untile-1" href="#untile-1">30.270 untile</a>
  1615. <ul class="toc-numbered-mark">
  1616. <li><a id="toc-Examples-150" href="#Examples-150">30.270.1 Examples</a></li>
  1617. </ul></li>
  1618. <li><a id="toc-uspp" href="#uspp">30.271 uspp</a></li>
  1619. <li><a id="toc-v360" href="#v360">30.272 v360</a>
  1620. <ul class="toc-numbered-mark">
  1621. <li><a id="toc-Examples-151" href="#Examples-151">30.272.1 Examples</a></li>
  1622. <li><a id="toc-Commands-150" href="#Commands-150">30.272.2 Commands</a></li>
  1623. </ul></li>
  1624. <li><a id="toc-vaguedenoiser" href="#vaguedenoiser">30.273 vaguedenoiser</a></li>
  1625. <li><a id="toc-varblur" href="#varblur">30.274 varblur</a>
  1626. <ul class="toc-numbered-mark">
  1627. <li><a id="toc-Commands-151" href="#Commands-151">30.274.1 Commands</a></li>
  1628. </ul></li>
  1629. <li><a id="toc-vectorscope" href="#vectorscope">30.275 vectorscope</a></li>
  1630. <li><a id="toc-vidstabdetect-1" href="#vidstabdetect-1">30.276 vidstabdetect</a>
  1631. <ul class="toc-numbered-mark">
  1632. <li><a id="toc-Examples-152" href="#Examples-152">30.276.1 Examples</a></li>
  1633. </ul></li>
  1634. <li><a id="toc-vidstabtransform-1" href="#vidstabtransform-1">30.277 vidstabtransform</a>
  1635. <ul class="toc-numbered-mark">
  1636. <li><a id="toc-Options-41" href="#Options-41">30.277.1 Options</a></li>
  1637. <li><a id="toc-Examples-153" href="#Examples-153">30.277.2 Examples</a></li>
  1638. </ul></li>
  1639. <li><a id="toc-vflip" href="#vflip">30.278 vflip</a></li>
  1640. <li><a id="toc-vfrdet" href="#vfrdet">30.279 vfrdet</a></li>
  1641. <li><a id="toc-vibrance" href="#vibrance">30.280 vibrance</a>
  1642. <ul class="toc-numbered-mark">
  1643. <li><a id="toc-Commands-152" href="#Commands-152">30.280.1 Commands</a></li>
  1644. </ul></li>
  1645. <li><a id="toc-vif" href="#vif">30.281 vif</a></li>
  1646. <li><a id="toc-vignette-1" href="#vignette-1">30.282 vignette</a>
  1647. <ul class="toc-numbered-mark">
  1648. <li><a id="toc-Expressions" href="#Expressions">30.282.1 Expressions</a></li>
  1649. <li><a id="toc-Examples-154" href="#Examples-154">30.282.2 Examples</a></li>
  1650. </ul></li>
  1651. <li><a id="toc-vmafmotion" href="#vmafmotion">30.283 vmafmotion</a></li>
  1652. <li><a id="toc-vstack-1" href="#vstack-1">30.284 vstack</a></li>
  1653. <li><a id="toc-w3fdif" href="#w3fdif">30.285 w3fdif</a>
  1654. <ul class="toc-numbered-mark">
  1655. <li><a id="toc-Commands-153" href="#Commands-153">30.285.1 Commands</a></li>
  1656. </ul></li>
  1657. <li><a id="toc-waveform" href="#waveform">30.286 waveform</a></li>
  1658. <li><a id="toc-weave_002c-doubleweave" href="#weave_002c-doubleweave">30.287 weave, doubleweave</a>
  1659. <ul class="toc-numbered-mark">
  1660. <li><a id="toc-Examples-155" href="#Examples-155">30.287.1 Examples</a></li>
  1661. </ul></li>
  1662. <li><a id="toc-xbr" href="#xbr">30.288 xbr</a></li>
  1663. <li><a id="toc-xcorrelate" href="#xcorrelate">30.289 xcorrelate</a></li>
  1664. <li><a id="toc-xfade" href="#xfade">30.290 xfade</a>
  1665. <ul class="toc-numbered-mark">
  1666. <li><a id="toc-Examples-156" href="#Examples-156">30.290.1 Examples</a></li>
  1667. </ul></li>
  1668. <li><a id="toc-xmedian" href="#xmedian">30.291 xmedian</a>
  1669. <ul class="toc-numbered-mark">
  1670. <li><a id="toc-Commands-154" href="#Commands-154">30.291.1 Commands</a></li>
  1671. </ul></li>
  1672. <li><a id="toc-xstack-1" href="#xstack-1">30.292 xstack</a>
  1673. <ul class="toc-numbered-mark">
  1674. <li><a id="toc-Examples-157" href="#Examples-157">30.292.1 Examples</a></li>
  1675. </ul></li>
  1676. <li><a id="toc-yadif-1" href="#yadif-1">30.293 yadif</a></li>
  1677. <li><a id="toc-yadif_005fcuda" href="#yadif_005fcuda">30.294 yadif_cuda</a></li>
  1678. <li><a id="toc-yaepblur" href="#yaepblur">30.295 yaepblur</a>
  1679. <ul class="toc-numbered-mark">
  1680. <li><a id="toc-Commands-155" href="#Commands-155">30.295.1 Commands</a></li>
  1681. </ul></li>
  1682. <li><a id="toc-zoompan" href="#zoompan">30.296 zoompan</a>
  1683. <ul class="toc-numbered-mark">
  1684. <li><a id="toc-Examples-158" href="#Examples-158">30.296.1 Examples</a></li>
  1685. </ul></li>
  1686. <li><a id="toc-zscale-1" href="#zscale-1">30.297 zscale</a>
  1687. <ul class="toc-numbered-mark">
  1688. <li><a id="toc-Options-42" href="#Options-42">30.297.1 Options</a></li>
  1689. <li><a id="toc-Commands-156" href="#Commands-156">30.297.2 Commands</a></li>
  1690. </ul></li>
  1691. </ul></li>
  1692. <li><a id="toc-OpenCL-Video-Filters" href="#OpenCL-Video-Filters">31 OpenCL Video Filters</a>
  1693. <ul class="toc-numbered-mark">
  1694. <li><a id="toc-avgblur_005fopencl" href="#avgblur_005fopencl">31.1 avgblur_opencl</a>
  1695. <ul class="toc-numbered-mark">
  1696. <li><a id="toc-Example" href="#Example">31.1.1 Example</a></li>
  1697. </ul></li>
  1698. <li><a id="toc-boxblur_005fopencl" href="#boxblur_005fopencl">31.2 boxblur_opencl</a>
  1699. <ul class="toc-numbered-mark">
  1700. <li><a id="toc-Examples-159" href="#Examples-159">31.2.1 Examples</a></li>
  1701. </ul></li>
  1702. <li><a id="toc-colorkey_005fopencl" href="#colorkey_005fopencl">31.3 colorkey_opencl</a>
  1703. <ul class="toc-numbered-mark">
  1704. <li><a id="toc-Examples-160" href="#Examples-160">31.3.1 Examples</a></li>
  1705. </ul></li>
  1706. <li><a id="toc-convolution_005fopencl" href="#convolution_005fopencl">31.4 convolution_opencl</a>
  1707. <ul class="toc-numbered-mark">
  1708. <li><a id="toc-Examples-161" href="#Examples-161">31.4.1 Examples</a></li>
  1709. </ul></li>
  1710. <li><a id="toc-erosion_005fopencl" href="#erosion_005fopencl">31.5 erosion_opencl</a>
  1711. <ul class="toc-numbered-mark">
  1712. <li><a id="toc-Example-1" href="#Example-1">31.5.1 Example</a></li>
  1713. </ul></li>
  1714. <li><a id="toc-deshake_005fopencl" href="#deshake_005fopencl">31.6 deshake_opencl</a>
  1715. <ul class="toc-numbered-mark">
  1716. <li><a id="toc-Examples-162" href="#Examples-162">31.6.1 Examples</a></li>
  1717. </ul></li>
  1718. <li><a id="toc-dilation_005fopencl" href="#dilation_005fopencl">31.7 dilation_opencl</a>
  1719. <ul class="toc-numbered-mark">
  1720. <li><a id="toc-Example-2" href="#Example-2">31.7.1 Example</a></li>
  1721. </ul></li>
  1722. <li><a id="toc-nlmeans_005fopencl-1" href="#nlmeans_005fopencl-1">31.8 nlmeans_opencl</a></li>
  1723. <li><a id="toc-overlay_005fopencl" href="#overlay_005fopencl">31.9 overlay_opencl</a>
  1724. <ul class="toc-numbered-mark">
  1725. <li><a id="toc-Examples-163" href="#Examples-163">31.9.1 Examples</a></li>
  1726. </ul></li>
  1727. <li><a id="toc-pad_005fopencl" href="#pad_005fopencl">31.10 pad_opencl</a></li>
  1728. <li><a id="toc-prewitt_005fopencl" href="#prewitt_005fopencl">31.11 prewitt_opencl</a>
  1729. <ul class="toc-numbered-mark">
  1730. <li><a id="toc-Example-3" href="#Example-3">31.11.1 Example</a></li>
  1731. </ul></li>
  1732. <li><a id="toc-program_005fopencl-1" href="#program_005fopencl-1">31.12 program_opencl</a></li>
  1733. <li><a id="toc-remap_005fopencl" href="#remap_005fopencl">31.13 remap_opencl</a></li>
  1734. <li><a id="toc-roberts_005fopencl" href="#roberts_005fopencl">31.14 roberts_opencl</a>
  1735. <ul class="toc-numbered-mark">
  1736. <li><a id="toc-Example-4" href="#Example-4">31.14.1 Example</a></li>
  1737. </ul></li>
  1738. <li><a id="toc-sobel_005fopencl" href="#sobel_005fopencl">31.15 sobel_opencl</a>
  1739. <ul class="toc-numbered-mark">
  1740. <li><a id="toc-Example-5" href="#Example-5">31.15.1 Example</a></li>
  1741. </ul></li>
  1742. <li><a id="toc-tonemap_005fopencl" href="#tonemap_005fopencl">31.16 tonemap_opencl</a>
  1743. <ul class="toc-numbered-mark">
  1744. <li><a id="toc-Example-6" href="#Example-6">31.16.1 Example</a></li>
  1745. </ul></li>
  1746. <li><a id="toc-unsharp_005fopencl" href="#unsharp_005fopencl">31.17 unsharp_opencl</a>
  1747. <ul class="toc-numbered-mark">
  1748. <li><a id="toc-Examples-164" href="#Examples-164">31.17.1 Examples</a></li>
  1749. </ul></li>
  1750. <li><a id="toc-xfade_005fopencl" href="#xfade_005fopencl">31.18 xfade_opencl</a></li>
  1751. </ul></li>
  1752. <li><a id="toc-VAAPI-Video-Filters" href="#VAAPI-Video-Filters">32 VAAPI Video Filters</a>
  1753. <ul class="toc-numbered-mark">
  1754. <li><a id="toc-overlay_005fvaapi" href="#overlay_005fvaapi">32.1 overlay_vaapi</a>
  1755. <ul class="toc-numbered-mark">
  1756. <li><a id="toc-Examples-165" href="#Examples-165">32.1.1 Examples</a></li>
  1757. </ul></li>
  1758. <li><a id="toc-tonemap_005fvaapi" href="#tonemap_005fvaapi">32.2 tonemap_vaapi</a>
  1759. <ul class="toc-numbered-mark">
  1760. <li><a id="toc-Example-7" href="#Example-7">32.2.1 Example</a></li>
  1761. </ul></li>
  1762. <li><a id="toc-hstack_005fvaapi" href="#hstack_005fvaapi">32.3 hstack_vaapi</a></li>
  1763. <li><a id="toc-vstack_005fvaapi" href="#vstack_005fvaapi">32.4 vstack_vaapi</a></li>
  1764. <li><a id="toc-xstack_005fvaapi" href="#xstack_005fvaapi">32.5 xstack_vaapi</a></li>
  1765. </ul></li>
  1766. <li><a id="toc-Vulkan-Video-Filters" href="#Vulkan-Video-Filters">33 Vulkan Video Filters</a>
  1767. <ul class="toc-numbered-mark">
  1768. <li><a id="toc-avgblur_005fvulkan" href="#avgblur_005fvulkan">33.1 avgblur_vulkan</a></li>
  1769. <li><a id="toc-blend_005fvulkan" href="#blend_005fvulkan">33.2 blend_vulkan</a></li>
  1770. <li><a id="toc-bwdif_005fvulkan" href="#bwdif_005fvulkan">33.3 bwdif_vulkan</a></li>
  1771. <li><a id="toc-chromaber_005fvulkan" href="#chromaber_005fvulkan">33.4 chromaber_vulkan</a></li>
  1772. <li><a id="toc-color_005fvulkan" href="#color_005fvulkan">33.5 color_vulkan</a></li>
  1773. <li><a id="toc-vflip_005fvulkan" href="#vflip_005fvulkan">33.6 vflip_vulkan</a></li>
  1774. <li><a id="toc-hflip_005fvulkan" href="#hflip_005fvulkan">33.7 hflip_vulkan</a></li>
  1775. <li><a id="toc-flip_005fvulkan" href="#flip_005fvulkan">33.8 flip_vulkan</a></li>
  1776. <li><a id="toc-gblur_005fvulkan" href="#gblur_005fvulkan">33.9 gblur_vulkan</a></li>
  1777. <li><a id="toc-nlmeans_005fvulkan" href="#nlmeans_005fvulkan">33.10 nlmeans_vulkan</a></li>
  1778. <li><a id="toc-overlay_005fvulkan" href="#overlay_005fvulkan">33.11 overlay_vulkan</a></li>
  1779. <li><a id="toc-transpose_005fvt" href="#transpose_005fvt">33.12 transpose_vt</a></li>
  1780. <li><a id="toc-transpose_005fvulkan" href="#transpose_005fvulkan">33.13 transpose_vulkan</a></li>
  1781. </ul></li>
  1782. <li><a id="toc-QSV-Video-Filters" href="#QSV-Video-Filters">34 QSV Video Filters</a>
  1783. <ul class="toc-numbered-mark">
  1784. <li><a id="toc-hstack_005fqsv" href="#hstack_005fqsv">34.1 hstack_qsv</a></li>
  1785. <li><a id="toc-vstack_005fqsv" href="#vstack_005fqsv">34.2 vstack_qsv</a></li>
  1786. <li><a id="toc-xstack_005fqsv" href="#xstack_005fqsv">34.3 xstack_qsv</a></li>
  1787. </ul></li>
  1788. <li><a id="toc-Video-Sources" href="#Video-Sources">35 Video Sources</a>
  1789. <ul class="toc-numbered-mark">
  1790. <li><a id="toc-buffer" href="#buffer">35.1 buffer</a></li>
  1791. <li><a id="toc-cellauto" href="#cellauto">35.2 cellauto</a>
  1792. <ul class="toc-numbered-mark">
  1793. <li><a id="toc-Examples-166" href="#Examples-166">35.2.1 Examples</a></li>
  1794. </ul></li>
  1795. <li><a id="toc-coreimagesrc-1" href="#coreimagesrc-1">35.3 coreimagesrc</a>
  1796. <ul class="toc-numbered-mark">
  1797. <li><a id="toc-Examples-167" href="#Examples-167">35.3.1 Examples</a></li>
  1798. </ul></li>
  1799. <li><a id="toc-ddagrab" href="#ddagrab">35.4 ddagrab</a>
  1800. <ul class="toc-numbered-mark">
  1801. <li><a id="toc-Examples-168" href="#Examples-168">35.4.1 Examples</a></li>
  1802. </ul></li>
  1803. <li><a id="toc-gradients" href="#gradients">35.5 gradients</a>
  1804. <ul class="toc-numbered-mark">
  1805. <li><a id="toc-Commands-157" href="#Commands-157">35.5.1 Commands</a></li>
  1806. </ul></li>
  1807. <li><a id="toc-mandelbrot" href="#mandelbrot">35.6 mandelbrot</a></li>
  1808. <li><a id="toc-mptestsrc" href="#mptestsrc">35.7 mptestsrc</a></li>
  1809. <li><a id="toc-frei0r_005fsrc" href="#frei0r_005fsrc">35.8 frei0r_src</a></li>
  1810. <li><a id="toc-life" href="#life">35.9 life</a>
  1811. <ul class="toc-numbered-mark">
  1812. <li><a id="toc-Examples-169" href="#Examples-169">35.9.1 Examples</a></li>
  1813. </ul></li>
  1814. <li><a id="toc-qrencodesrc" href="#qrencodesrc">35.10 qrencodesrc</a>
  1815. <ul class="toc-numbered-mark">
  1816. <li><a id="toc-Examples-170" href="#Examples-170">35.10.1 Examples</a></li>
  1817. </ul></li>
  1818. <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">35.11 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a>
  1819. <ul class="toc-numbered-mark">
  1820. <li><a id="toc-Examples-171" href="#Examples-171">35.11.1 Examples</a></li>
  1821. <li><a id="toc-Commands-158" href="#Commands-158">35.11.2 Commands</a></li>
  1822. </ul></li>
  1823. <li><a id="toc-openclsrc" href="#openclsrc">35.12 openclsrc</a></li>
  1824. <li><a id="toc-sierpinski" href="#sierpinski">35.13 sierpinski</a></li>
  1825. <li><a id="toc-zoneplate" href="#zoneplate">35.14 zoneplate</a>
  1826. <ul class="toc-numbered-mark">
  1827. <li><a id="toc-Commands-159" href="#Commands-159">35.14.1 Commands</a></li>
  1828. <li><a id="toc-Examples-172" href="#Examples-172">35.14.2 Examples</a></li>
  1829. </ul></li>
  1830. </ul></li>
  1831. <li><a id="toc-Video-Sinks" href="#Video-Sinks">36 Video Sinks</a>
  1832. <ul class="toc-numbered-mark">
  1833. <li><a id="toc-buffersink" href="#buffersink">36.1 buffersink</a></li>
  1834. <li><a id="toc-nullsink" href="#nullsink">36.2 nullsink</a></li>
  1835. </ul></li>
  1836. <li><a id="toc-Multimedia-Filters" href="#Multimedia-Filters">37 Multimedia Filters</a>
  1837. <ul class="toc-numbered-mark">
  1838. <li><a id="toc-a3dscope" href="#a3dscope">37.1 a3dscope</a>
  1839. <ul class="toc-numbered-mark">
  1840. <li><a id="toc-Commands-160" href="#Commands-160">37.1.1 Commands</a></li>
  1841. </ul></li>
  1842. <li><a id="toc-abitscope" href="#abitscope">37.2 abitscope</a></li>
  1843. <li><a id="toc-adrawgraph" href="#adrawgraph">37.3 adrawgraph</a></li>
  1844. <li><a id="toc-agraphmonitor" href="#agraphmonitor">37.4 agraphmonitor</a></li>
  1845. <li><a id="toc-ahistogram" href="#ahistogram">37.5 ahistogram</a></li>
  1846. <li><a id="toc-aphasemeter" href="#aphasemeter">37.6 aphasemeter</a>
  1847. <ul class="toc-numbered-mark">
  1848. <li><a id="toc-phasing-detection" href="#phasing-detection">37.6.1 phasing detection</a></li>
  1849. <li><a id="toc-Examples-173" href="#Examples-173">37.6.2 Examples</a></li>
  1850. </ul></li>
  1851. <li><a id="toc-avectorscope" href="#avectorscope">37.7 avectorscope</a>
  1852. <ul class="toc-numbered-mark">
  1853. <li><a id="toc-Examples-174" href="#Examples-174">37.7.1 Examples</a></li>
  1854. <li><a id="toc-Commands-161" href="#Commands-161">37.7.2 Commands</a></li>
  1855. </ul></li>
  1856. <li><a id="toc-bench_002c-abench" href="#bench_002c-abench">37.8 bench, abench</a>
  1857. <ul class="toc-numbered-mark">
  1858. <li><a id="toc-Examples-175" href="#Examples-175">37.8.1 Examples</a></li>
  1859. </ul></li>
  1860. <li><a id="toc-concat-3" href="#concat-3">37.9 concat</a>
  1861. <ul class="toc-numbered-mark">
  1862. <li><a id="toc-Examples-176" href="#Examples-176">37.9.1 Examples</a></li>
  1863. <li><a id="toc-Commands-162" href="#Commands-162">37.9.2 Commands</a></li>
  1864. </ul></li>
  1865. <li><a id="toc-ebur128-1" href="#ebur128-1">37.10 ebur128</a>
  1866. <ul class="toc-numbered-mark">
  1867. <li><a id="toc-Examples-177" href="#Examples-177">37.10.1 Examples</a></li>
  1868. </ul></li>
  1869. <li><a id="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">37.11 interleave, ainterleave</a>
  1870. <ul class="toc-numbered-mark">
  1871. <li><a id="toc-Examples-178" href="#Examples-178">37.11.1 Examples</a></li>
  1872. </ul></li>
  1873. <li><a id="toc-latency_002c-alatency" href="#latency_002c-alatency">37.12 latency, alatency</a></li>
  1874. <li><a id="toc-metadata_002c-ametadata" href="#metadata_002c-ametadata">37.13 metadata, ametadata</a>
  1875. <ul class="toc-numbered-mark">
  1876. <li><a id="toc-Examples-179" href="#Examples-179">37.13.1 Examples</a></li>
  1877. </ul></li>
  1878. <li><a id="toc-perms_002c-aperms" href="#perms_002c-aperms">37.14 perms, aperms</a></li>
  1879. <li><a id="toc-realtime_002c-arealtime" href="#realtime_002c-arealtime">37.15 realtime, arealtime</a>
  1880. <ul class="toc-numbered-mark">
  1881. <li><a id="toc-Commands-163" href="#Commands-163">37.15.1 Commands</a></li>
  1882. </ul></li>
  1883. <li><a id="toc-segment_002c-asegment" href="#segment_002c-asegment">37.16 segment, asegment</a>
  1884. <ul class="toc-numbered-mark">
  1885. <li><a id="toc-Examples-180" href="#Examples-180">37.16.1 Examples</a></li>
  1886. </ul></li>
  1887. <li><a id="toc-select_002c-aselect" href="#select_002c-aselect">37.17 select, aselect</a>
  1888. <ul class="toc-numbered-mark">
  1889. <li><a id="toc-Examples-181" href="#Examples-181">37.17.1 Examples</a></li>
  1890. </ul></li>
  1891. <li><a id="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">37.18 sendcmd, asendcmd</a>
  1892. <ul class="toc-numbered-mark">
  1893. <li><a id="toc-Commands-syntax" href="#Commands-syntax">37.18.1 Commands syntax</a></li>
  1894. <li><a id="toc-Examples-182" href="#Examples-182">37.18.2 Examples</a></li>
  1895. </ul></li>
  1896. <li><a id="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">37.19 setpts, asetpts</a>
  1897. <ul class="toc-numbered-mark">
  1898. <li><a id="toc-Examples-183" href="#Examples-183">37.19.1 Examples</a></li>
  1899. <li><a id="toc-Commands-164" href="#Commands-164">37.19.2 Commands</a></li>
  1900. </ul></li>
  1901. <li><a id="toc-setrange" href="#setrange">37.20 setrange</a></li>
  1902. <li><a id="toc-settb_002c-asettb" href="#settb_002c-asettb">37.21 settb, asettb</a>
  1903. <ul class="toc-numbered-mark">
  1904. <li><a id="toc-Examples-184" href="#Examples-184">37.21.1 Examples</a></li>
  1905. </ul></li>
  1906. <li><a id="toc-showcqt" href="#showcqt">37.22 showcqt</a>
  1907. <ul class="toc-numbered-mark">
  1908. <li><a id="toc-Examples-185" href="#Examples-185">37.22.1 Examples</a></li>
  1909. </ul></li>
  1910. <li><a id="toc-showcwt" href="#showcwt">37.23 showcwt</a></li>
  1911. <li><a id="toc-showfreqs" href="#showfreqs">37.24 showfreqs</a></li>
  1912. <li><a id="toc-showspatial" href="#showspatial">37.25 showspatial</a></li>
  1913. <li><a id="toc-showspectrum-1" href="#showspectrum-1">37.26 showspectrum</a>
  1914. <ul class="toc-numbered-mark">
  1915. <li><a id="toc-Examples-186" href="#Examples-186">37.26.1 Examples</a></li>
  1916. </ul></li>
  1917. <li><a id="toc-showspectrumpic" href="#showspectrumpic">37.27 showspectrumpic</a>
  1918. <ul class="toc-numbered-mark">
  1919. <li><a id="toc-Examples-187" href="#Examples-187">37.27.1 Examples</a></li>
  1920. </ul></li>
  1921. <li><a id="toc-showvolume" href="#showvolume">37.28 showvolume</a></li>
  1922. <li><a id="toc-showwaves" href="#showwaves">37.29 showwaves</a>
  1923. <ul class="toc-numbered-mark">
  1924. <li><a id="toc-Examples-188" href="#Examples-188">37.29.1 Examples</a></li>
  1925. </ul></li>
  1926. <li><a id="toc-showwavespic" href="#showwavespic">37.30 showwavespic</a>
  1927. <ul class="toc-numbered-mark">
  1928. <li><a id="toc-Examples-189" href="#Examples-189">37.30.1 Examples</a></li>
  1929. </ul></li>
  1930. <li><a id="toc-sidedata_002c-asidedata" href="#sidedata_002c-asidedata">37.31 sidedata, asidedata</a></li>
  1931. <li><a id="toc-spectrumsynth" href="#spectrumsynth">37.32 spectrumsynth</a>
  1932. <ul class="toc-numbered-mark">
  1933. <li><a id="toc-Examples-190" href="#Examples-190">37.32.1 Examples</a></li>
  1934. </ul></li>
  1935. <li><a id="toc-split_002c-asplit" href="#split_002c-asplit">37.33 split, asplit</a>
  1936. <ul class="toc-numbered-mark">
  1937. <li><a id="toc-Examples-191" href="#Examples-191">37.33.1 Examples</a></li>
  1938. </ul></li>
  1939. <li><a id="toc-zmq_002c-azmq" href="#zmq_002c-azmq">37.34 zmq, azmq</a>
  1940. <ul class="toc-numbered-mark">
  1941. <li><a id="toc-Examples-192" href="#Examples-192">37.34.1 Examples</a></li>
  1942. </ul></li>
  1943. </ul></li>
  1944. <li><a id="toc-Multimedia-Sources" href="#Multimedia-Sources">38 Multimedia Sources</a>
  1945. <ul class="toc-numbered-mark">
  1946. <li><a id="toc-amovie" href="#amovie">38.1 amovie</a></li>
  1947. <li><a id="toc-avsynctest" href="#avsynctest">38.2 avsynctest</a>
  1948. <ul class="toc-numbered-mark">
  1949. <li><a id="toc-Commands-165" href="#Commands-165">38.2.1 Commands</a></li>
  1950. </ul></li>
  1951. <li><a id="toc-movie-1" href="#movie-1">38.3 movie</a>
  1952. <ul class="toc-numbered-mark">
  1953. <li><a id="toc-Examples-193" href="#Examples-193">38.3.1 Examples</a></li>
  1954. <li><a id="toc-Commands-166" href="#Commands-166">38.3.2 Commands</a></li>
  1955. </ul></li>
  1956. </ul></li>
  1957. <li><a id="toc-External-libraries" href="#External-libraries">39 External libraries</a>
  1958. <ul class="toc-numbered-mark">
  1959. <li><a id="toc-Alliance-for-Open-Media-_0028AOM_0029" href="#Alliance-for-Open-Media-_0028AOM_0029">39.1 Alliance for Open Media (AOM)</a></li>
  1960. <li><a id="toc-AMD-AMF_002fVCE" href="#AMD-AMF_002fVCE">39.2 AMD AMF/VCE</a></li>
  1961. <li><a id="toc-AviSynth" href="#AviSynth">39.3 AviSynth</a></li>
  1962. <li><a id="toc-Chromaprint" href="#Chromaprint">39.4 Chromaprint</a></li>
  1963. <li><a id="toc-codec2" href="#codec2">39.5 codec2</a></li>
  1964. <li><a id="toc-dav1d" href="#dav1d">39.6 dav1d</a></li>
  1965. <li><a id="toc-davs2" href="#davs2">39.7 davs2</a></li>
  1966. <li><a id="toc-uavs3d" href="#uavs3d">39.8 uavs3d</a></li>
  1967. <li><a id="toc-Game-Music-Emu" href="#Game-Music-Emu">39.9 Game Music Emu</a></li>
  1968. <li><a id="toc-Intel-QuickSync-Video" href="#Intel-QuickSync-Video">39.10 Intel QuickSync Video</a></li>
  1969. <li><a id="toc-Kvazaar" href="#Kvazaar">39.11 Kvazaar</a></li>
  1970. <li><a id="toc-LAME" href="#LAME">39.12 LAME</a></li>
  1971. <li><a id="toc-libilbc-1" href="#libilbc-1">39.13 libilbc</a></li>
  1972. <li><a id="toc-libjxl" href="#libjxl">39.14 libjxl</a></li>
  1973. <li><a id="toc-libvpx" href="#libvpx">39.15 libvpx</a></li>
  1974. <li><a id="toc-ModPlug" href="#ModPlug">39.16 ModPlug</a></li>
  1975. <li><a id="toc-OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries" href="#OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries">39.17 OpenCORE, VisualOn, and Fraunhofer libraries</a>
  1976. <ul class="toc-numbered-mark">
  1977. <li><a id="toc-OpenCORE-AMR" href="#OpenCORE-AMR">39.17.1 OpenCORE AMR</a></li>
  1978. <li><a id="toc-VisualOn-AMR_002dWB-encoder-library" href="#VisualOn-AMR_002dWB-encoder-library">39.17.2 VisualOn AMR-WB encoder library</a></li>
  1979. <li><a id="toc-Fraunhofer-AAC-library" href="#Fraunhofer-AAC-library">39.17.3 Fraunhofer AAC library</a></li>
  1980. </ul></li>
  1981. <li><a id="toc-OpenH264" href="#OpenH264">39.18 OpenH264</a></li>
  1982. <li><a id="toc-OpenJPEG" href="#OpenJPEG">39.19 OpenJPEG</a></li>
  1983. <li><a id="toc-rav1e" href="#rav1e">39.20 rav1e</a></li>
  1984. <li><a id="toc-SVT_002dAV1" href="#SVT_002dAV1">39.21 SVT-AV1</a></li>
  1985. <li><a id="toc-TwoLAME" href="#TwoLAME">39.22 TwoLAME</a></li>
  1986. <li><a id="toc-VapourSynth" href="#VapourSynth">39.23 VapourSynth</a></li>
  1987. <li><a id="toc-x264" href="#x264">39.24 x264</a></li>
  1988. <li><a id="toc-x265" href="#x265">39.25 x265</a></li>
  1989. <li><a id="toc-xavs" href="#xavs">39.26 xavs</a></li>
  1990. <li><a id="toc-xavs2" href="#xavs2">39.27 xavs2</a></li>
  1991. <li><a id="toc-eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029" href="#eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029">39.28 eXtra-fast Essential Video Encoder (XEVE)</a></li>
  1992. <li><a id="toc-eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029" href="#eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029">39.29 eXtra-fast Essential Video Decoder (XEVD)</a></li>
  1993. <li><a id="toc-ZVBI" href="#ZVBI">39.30 ZVBI</a></li>
  1994. </ul></li>
  1995. <li><a id="toc-Supported-File-Formats_002c-Codecs-or-Features" href="#Supported-File-Formats_002c-Codecs-or-Features">40 Supported File Formats, Codecs or Features</a>
  1996. <ul class="toc-numbered-mark">
  1997. <li><a id="toc-File-Formats" href="#File-Formats">40.1 File Formats</a></li>
  1998. <li><a id="toc-Image-Formats" href="#Image-Formats">40.2 Image Formats</a></li>
  1999. <li><a id="toc-Video-Codecs" href="#Video-Codecs">40.3 Video Codecs</a></li>
  2000. <li><a id="toc-Audio-Codecs" href="#Audio-Codecs">40.4 Audio Codecs</a></li>
  2001. <li><a id="toc-Subtitle-Formats" href="#Subtitle-Formats">40.5 Subtitle Formats</a></li>
  2002. <li><a id="toc-Network-Protocols" href="#Network-Protocols">40.6 Network Protocols</a></li>
  2003. <li><a id="toc-Input_002fOutput-Devices" href="#Input_002fOutput-Devices">40.7 Input/Output Devices</a></li>
  2004. <li><a id="toc-Timecode" href="#Timecode">40.8 Timecode</a></li>
  2005. </ul></li>
  2006. <li><a id="toc-See-Also" href="#See-Also">41 See Also</a></li>
  2007. <li><a id="toc-Authors" href="#Authors">42 Authors</a></li>
  2008. </ul>
  2009. </div>
  2010. </div>
  2011. <ul class="mini-toc">
  2012. <li><a href="#Synopsis" accesskey="1">Synopsis</a></li>
  2013. <li><a href="#Description" accesskey="2">Description</a></li>
  2014. <li><a href="#Options" accesskey="3">Options</a></li>
  2015. <li><a href="#Syntax" accesskey="4">Syntax</a></li>
  2016. <li><a href="#Expression-Evaluation" accesskey="5">Expression Evaluation</a></li>
  2017. <li><a href="#Codec-Options" accesskey="6">Codec Options</a></li>
  2018. <li><a href="#Decoders" accesskey="7">Decoders</a></li>
  2019. <li><a href="#Video-Decoders" accesskey="8">Video Decoders</a></li>
  2020. <li><a href="#Audio-Decoders" accesskey="9">Audio Decoders</a></li>
  2021. <li><a href="#Subtitles-Decoders">Subtitles Decoders</a></li>
  2022. <li><a href="#Bitstream-Filters">Bitstream Filters</a></li>
  2023. <li><a href="#Format-Options">Format Options</a></li>
  2024. <li><a href="#Demuxers">Demuxers</a></li>
  2025. <li><a href="#Metadata">Metadata</a></li>
  2026. <li><a href="#Protocol-Options">Protocol Options</a></li>
  2027. <li><a href="#Protocols">Protocols</a></li>
  2028. <li><a href="#Device-Options">Device Options</a></li>
  2029. <li><a href="#Input-Devices">Input Devices</a></li>
  2030. <li><a href="#Resampler-Options">Resampler Options</a></li>
  2031. <li><a href="#Scaler-Options">Scaler Options</a></li>
  2032. <li><a href="#Filtering-Introduction">Filtering Introduction</a></li>
  2033. <li><a href="#graph2dot">graph2dot</a></li>
  2034. <li><a href="#Filtergraph-description">Filtergraph description</a></li>
  2035. <li><a href="#Timeline-editing">Timeline editing</a></li>
  2036. <li><a href="#Changing-options-at-runtime-with-a-command">Changing options at runtime with a command</a></li>
  2037. <li><a href="#Options-for-filters-with-several-inputs-_0028framesync_0029">Options for filters with several inputs (framesync)</a></li>
  2038. <li><a href="#Audio-Filters">Audio Filters</a></li>
  2039. <li><a href="#Audio-Sources">Audio Sources</a></li>
  2040. <li><a href="#Audio-Sinks">Audio Sinks</a></li>
  2041. <li><a href="#Video-Filters">Video Filters</a></li>
  2042. <li><a href="#OpenCL-Video-Filters">OpenCL Video Filters</a></li>
  2043. <li><a href="#VAAPI-Video-Filters">VAAPI Video Filters</a></li>
  2044. <li><a href="#Vulkan-Video-Filters">Vulkan Video Filters</a></li>
  2045. <li><a href="#QSV-Video-Filters">QSV Video Filters</a></li>
  2046. <li><a href="#Video-Sources">Video Sources</a></li>
  2047. <li><a href="#Video-Sinks">Video Sinks</a></li>
  2048. <li><a href="#Multimedia-Filters">Multimedia Filters</a></li>
  2049. <li><a href="#Multimedia-Sources">Multimedia Sources</a></li>
  2050. <li><a href="#External-libraries">External libraries</a></li>
  2051. <li><a href="#Supported-File-Formats_002c-Codecs-or-Features">Supported File Formats, Codecs or Features</a></li>
  2052. <li><a href="#See-Also">See Also</a></li>
  2053. <li><a href="#Authors">Authors</a></li>
  2054. </ul>
  2055. <div class="chapter-level-extent" id="Synopsis">
  2056. <h2 class="chapter"><span>1 Synopsis<a class="copiable-link" href="#Synopsis"> &para;</a></span></h2>
  2057. <p>ffplay [<var class="var">options</var>] [<samp class="file">input_url</samp>]
  2058. </p>
  2059. </div>
  2060. <div class="chapter-level-extent" id="Description">
  2061. <h2 class="chapter"><span>2 Description<a class="copiable-link" href="#Description"> &para;</a></span></h2>
  2062. <p>FFplay is a very simple and portable media player using the FFmpeg
  2063. libraries and the SDL library. It is mostly used as a testbed for the
  2064. various FFmpeg APIs.
  2065. </p>
  2066. </div>
  2067. <div class="chapter-level-extent" id="Options">
  2068. <h2 class="chapter"><span>3 Options<a class="copiable-link" href="#Options"> &para;</a></span></h2>
  2069. <p>All the numerical options, if not specified otherwise, accept a string
  2070. representing a number as input, which may be followed by one of the SI
  2071. unit prefixes, for example: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
  2072. </p>
  2073. <p>If &rsquo;i&rsquo; is appended to the SI unit prefix, the complete prefix will be
  2074. interpreted as a unit prefix for binary multiples, which are based on
  2075. powers of 1024 instead of powers of 1000. Appending &rsquo;B&rsquo; to the SI unit
  2076. prefix multiplies the value by 8. This allows using, for example:
  2077. &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
  2078. </p>
  2079. <p>Options which do not take arguments are boolean options, and set the
  2080. corresponding value to true. They can be set to false by prefixing
  2081. the option name with &quot;no&quot;. For example using &quot;-nofoo&quot;
  2082. will set the boolean option with name &quot;foo&quot; to false.
  2083. </p>
  2084. <p>Options that take arguments support a special syntax where the argument given on
  2085. the command line is interpreted as a path to the file from which the actual
  2086. argument value is loaded. To use this feature, add a forward slash &rsquo;/&rsquo;
  2087. immediately before the option name (after the leading dash). E.g.
  2088. </p><div class="example">
  2089. <pre class="example-preformatted">ffmpeg -i INPUT -/filter:v filter.script OUTPUT
  2090. </pre></div>
  2091. <p>will load a filtergraph description from the file named <samp class="file">filter.script</samp>.
  2092. </p>
  2093. <a class="anchor" id="Stream-specifiers"></a><ul class="mini-toc">
  2094. <li><a href="#Stream-specifiers-1" accesskey="1">Stream specifiers</a></li>
  2095. <li><a href="#Generic-options" accesskey="2">Generic options</a></li>
  2096. <li><a href="#AVOptions" accesskey="3">AVOptions</a></li>
  2097. <li><a href="#Main-options" accesskey="4">Main options</a></li>
  2098. <li><a href="#Advanced-options" accesskey="5">Advanced options</a></li>
  2099. <li><a href="#While-playing" accesskey="6">While playing</a></li>
  2100. </ul>
  2101. <div class="section-level-extent" id="Stream-specifiers-1">
  2102. <h3 class="section"><span>3.1 Stream specifiers<a class="copiable-link" href="#Stream-specifiers-1"> &para;</a></span></h3>
  2103. <p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
  2104. are used to precisely specify which stream(s) a given option belongs to.
  2105. </p>
  2106. <p>A stream specifier is a string generally appended to the option name and
  2107. separated from it by a colon. E.g. <code class="code">-codec:a:1 ac3</code> contains the
  2108. <code class="code">a:1</code> stream specifier, which matches the second audio stream. Therefore, it
  2109. would select the ac3 codec for the second audio stream.
  2110. </p>
  2111. <p>A stream specifier can match several streams, so that the option is applied to all
  2112. of them. E.g. the stream specifier in <code class="code">-b:a 128k</code> matches all audio
  2113. streams.
  2114. </p>
  2115. <p>An empty stream specifier matches all streams. For example, <code class="code">-codec copy</code>
  2116. or <code class="code">-codec: copy</code> would copy all the streams without reencoding.
  2117. </p>
  2118. <p>Possible forms of stream specifiers are:
  2119. </p><dl class="table">
  2120. <dt><samp class="option"><var class="var">stream_index</var></samp></dt>
  2121. <dd><p>Matches the stream with this index. E.g. <code class="code">-threads:1 4</code> would set the
  2122. thread count for the second stream to 4. If <var class="var">stream_index</var> is used as an
  2123. additional stream specifier (see below), then it selects stream number
  2124. <var class="var">stream_index</var> from the matching streams. Stream numbering is based on the
  2125. order of the streams as detected by libavformat except when a stream group
  2126. specifier or program ID is also specified. In this case it is based on the
  2127. ordering of the streams in the group or program.
  2128. </p></dd>
  2129. <dt><samp class="option"><var class="var">stream_type</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  2130. <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;
  2131. for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. &rsquo;v&rsquo; matches all video
  2132. streams, &rsquo;V&rsquo; only matches video streams which are not attached pictures, video
  2133. thumbnails or cover arts. If <var class="var">additional_stream_specifier</var> is used, then
  2134. it matches streams which both have this type and match the
  2135. <var class="var">additional_stream_specifier</var>. Otherwise, it matches all streams of the
  2136. specified type.
  2137. </p></dd>
  2138. <dt><samp class="option">g:<var class="var">group_specifier</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  2139. <dd><p>Matches streams which are in the group with the specifier <var class="var">group_specifier</var>.
  2140. if <var class="var">additional_stream_specifier</var> is used, then it matches streams which both
  2141. are part of the group and match the <var class="var">additional_stream_specifier</var>.
  2142. <var class="var">group_specifier</var> may be one of the following:
  2143. </p><dl class="table">
  2144. <dt><samp class="option"><var class="var">group_index</var></samp></dt>
  2145. <dd><p>Match the stream with this group index.
  2146. </p></dd>
  2147. <dt><samp class="option">#<var class="var">group_id</var> or i:<var class="var">group_id</var></samp></dt>
  2148. <dd><p>Match the stream with this group id.
  2149. </p></dd>
  2150. </dl>
  2151. </dd>
  2152. <dt><samp class="option">p:<var class="var">program_id</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  2153. <dd><p>Matches streams which are in the program with the id <var class="var">program_id</var>. If
  2154. <var class="var">additional_stream_specifier</var> is used, then it matches streams which both
  2155. are part of the program and match the <var class="var">additional_stream_specifier</var>.
  2156. </p>
  2157. </dd>
  2158. <dt><samp class="option">#<var class="var">stream_id</var> or i:<var class="var">stream_id</var></samp></dt>
  2159. <dd><p>Match the stream by stream id (e.g. PID in MPEG-TS container).
  2160. </p></dd>
  2161. <dt><samp class="option">m:<var class="var">key</var>[:<var class="var">value</var>]</samp></dt>
  2162. <dd><p>Matches streams with the metadata tag <var class="var">key</var> having the specified value. If
  2163. <var class="var">value</var> is not given, matches streams that contain the given tag with any
  2164. value.
  2165. </p></dd>
  2166. <dt><samp class="option">u</samp></dt>
  2167. <dd><p>Matches streams with usable configuration, the codec must be defined and the
  2168. essential information such as video dimension or audio sample rate must be present.
  2169. </p>
  2170. <p>Note that in <code class="command">ffmpeg</code>, matching by metadata will only work properly for
  2171. input files.
  2172. </p></dd>
  2173. </dl>
  2174. </div>
  2175. <div class="section-level-extent" id="Generic-options">
  2176. <h3 class="section"><span>3.2 Generic options<a class="copiable-link" href="#Generic-options"> &para;</a></span></h3>
  2177. <p>These options are shared amongst the ff* tools.
  2178. </p>
  2179. <dl class="table">
  2180. <dt><samp class="option">-L</samp></dt>
  2181. <dd><p>Show license.
  2182. </p>
  2183. </dd>
  2184. <dt><samp class="option">-h, -?, -help, --help [<var class="var">arg</var>]</samp></dt>
  2185. <dd><p>Show help. An optional parameter may be specified to print help about a specific
  2186. item. If no argument is specified, only basic (non advanced) tool
  2187. options are shown.
  2188. </p>
  2189. <p>Possible values of <var class="var">arg</var> are:
  2190. </p><dl class="table">
  2191. <dt><samp class="option">long</samp></dt>
  2192. <dd><p>Print advanced tool options in addition to the basic tool options.
  2193. </p>
  2194. </dd>
  2195. <dt><samp class="option">full</samp></dt>
  2196. <dd><p>Print complete list of options, including shared and private options
  2197. for encoders, decoders, demuxers, muxers, filters, etc.
  2198. </p>
  2199. </dd>
  2200. <dt><samp class="option">decoder=<var class="var">decoder_name</var></samp></dt>
  2201. <dd><p>Print detailed information about the decoder named <var class="var">decoder_name</var>. Use the
  2202. <samp class="option">-decoders</samp> option to get a list of all decoders.
  2203. </p>
  2204. </dd>
  2205. <dt><samp class="option">encoder=<var class="var">encoder_name</var></samp></dt>
  2206. <dd><p>Print detailed information about the encoder named <var class="var">encoder_name</var>. Use the
  2207. <samp class="option">-encoders</samp> option to get a list of all encoders.
  2208. </p>
  2209. </dd>
  2210. <dt><samp class="option">demuxer=<var class="var">demuxer_name</var></samp></dt>
  2211. <dd><p>Print detailed information about the demuxer named <var class="var">demuxer_name</var>. Use the
  2212. <samp class="option">-formats</samp> option to get a list of all demuxers and muxers.
  2213. </p>
  2214. </dd>
  2215. <dt><samp class="option">muxer=<var class="var">muxer_name</var></samp></dt>
  2216. <dd><p>Print detailed information about the muxer named <var class="var">muxer_name</var>. Use the
  2217. <samp class="option">-formats</samp> option to get a list of all muxers and demuxers.
  2218. </p>
  2219. </dd>
  2220. <dt><samp class="option">filter=<var class="var">filter_name</var></samp></dt>
  2221. <dd><p>Print detailed information about the filter named <var class="var">filter_name</var>. Use the
  2222. <samp class="option">-filters</samp> option to get a list of all filters.
  2223. </p>
  2224. </dd>
  2225. <dt><samp class="option">bsf=<var class="var">bitstream_filter_name</var></samp></dt>
  2226. <dd><p>Print detailed information about the bitstream filter named <var class="var">bitstream_filter_name</var>.
  2227. Use the <samp class="option">-bsfs</samp> option to get a list of all bitstream filters.
  2228. </p>
  2229. </dd>
  2230. <dt><samp class="option">protocol=<var class="var">protocol_name</var></samp></dt>
  2231. <dd><p>Print detailed information about the protocol named <var class="var">protocol_name</var>.
  2232. Use the <samp class="option">-protocols</samp> option to get a list of all protocols.
  2233. </p></dd>
  2234. </dl>
  2235. </dd>
  2236. <dt><samp class="option">-version</samp></dt>
  2237. <dd><p>Show version.
  2238. </p>
  2239. </dd>
  2240. <dt><samp class="option">-buildconf</samp></dt>
  2241. <dd><p>Show the build configuration, one option per line.
  2242. </p>
  2243. </dd>
  2244. <dt><samp class="option">-formats</samp></dt>
  2245. <dd><p>Show available formats (including devices).
  2246. </p>
  2247. </dd>
  2248. <dt><samp class="option">-demuxers</samp></dt>
  2249. <dd><p>Show available demuxers.
  2250. </p>
  2251. </dd>
  2252. <dt><samp class="option">-muxers</samp></dt>
  2253. <dd><p>Show available muxers.
  2254. </p>
  2255. </dd>
  2256. <dt><samp class="option">-devices</samp></dt>
  2257. <dd><p>Show available devices.
  2258. </p>
  2259. </dd>
  2260. <dt><samp class="option">-codecs</samp></dt>
  2261. <dd><p>Show all codecs known to libavcodec.
  2262. </p>
  2263. <p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
  2264. for what is more correctly called a media bitstream format.
  2265. </p>
  2266. </dd>
  2267. <dt><samp class="option">-decoders</samp></dt>
  2268. <dd><p>Show available decoders.
  2269. </p>
  2270. </dd>
  2271. <dt><samp class="option">-encoders</samp></dt>
  2272. <dd><p>Show all available encoders.
  2273. </p>
  2274. </dd>
  2275. <dt><samp class="option">-bsfs</samp></dt>
  2276. <dd><p>Show available bitstream filters.
  2277. </p>
  2278. </dd>
  2279. <dt><samp class="option">-protocols</samp></dt>
  2280. <dd><p>Show available protocols.
  2281. </p>
  2282. </dd>
  2283. <dt><samp class="option">-filters</samp></dt>
  2284. <dd><p>Show available libavfilter filters.
  2285. </p>
  2286. </dd>
  2287. <dt><samp class="option">-pix_fmts</samp></dt>
  2288. <dd><p>Show available pixel formats.
  2289. </p>
  2290. </dd>
  2291. <dt><samp class="option">-sample_fmts</samp></dt>
  2292. <dd><p>Show available sample formats.
  2293. </p>
  2294. </dd>
  2295. <dt><samp class="option">-layouts</samp></dt>
  2296. <dd><p>Show channel names and standard channel layouts.
  2297. </p>
  2298. </dd>
  2299. <dt><samp class="option">-dispositions</samp></dt>
  2300. <dd><p>Show stream dispositions.
  2301. </p>
  2302. </dd>
  2303. <dt><samp class="option">-colors</samp></dt>
  2304. <dd><p>Show recognized color names.
  2305. </p>
  2306. </dd>
  2307. <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>
  2308. <dd><p>Show autodetected sources of the input device.
  2309. Some devices may provide system-dependent source names that cannot be autodetected.
  2310. The returned list cannot be assumed to be always complete.
  2311. </p><div class="example">
  2312. <pre class="example-preformatted">ffmpeg -sources pulse,server=192.168.0.4
  2313. </pre></div>
  2314. </dd>
  2315. <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>
  2316. <dd><p>Show autodetected sinks of the output device.
  2317. Some devices may provide system-dependent sink names that cannot be autodetected.
  2318. The returned list cannot be assumed to be always complete.
  2319. </p><div class="example">
  2320. <pre class="example-preformatted">ffmpeg -sinks pulse,server=192.168.0.4
  2321. </pre></div>
  2322. </dd>
  2323. <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>
  2324. <dd><p>Set logging level and flags used by the library.
  2325. </p>
  2326. <p>The optional <var class="var">flags</var> prefix can consist of the following values:
  2327. </p><dl class="table">
  2328. <dt>&lsquo;<samp class="samp">repeat</samp>&rsquo;</dt>
  2329. <dd><p>Indicates that repeated log output should not be compressed to the first line
  2330. and the &quot;Last message repeated n times&quot; line will be omitted.
  2331. </p></dd>
  2332. <dt>&lsquo;<samp class="samp">level</samp>&rsquo;</dt>
  2333. <dd><p>Indicates that log output should add a <code class="code">[level]</code> prefix to each message
  2334. line. This can be used as an alternative to log coloring, e.g. when dumping the
  2335. log to file.
  2336. </p></dd>
  2337. </dl>
  2338. <p>Flags can also be used alone by adding a &rsquo;+&rsquo;/&rsquo;-&rsquo; prefix to set/reset a single
  2339. flag without affecting other <var class="var">flags</var> or changing <var class="var">loglevel</var>. When
  2340. setting both <var class="var">flags</var> and <var class="var">loglevel</var>, a &rsquo;+&rsquo; separator is expected
  2341. between the last <var class="var">flags</var> value and before <var class="var">loglevel</var>.
  2342. </p>
  2343. <p><var class="var">loglevel</var> is a string or a number containing one of the following values:
  2344. </p><dl class="table">
  2345. <dt>&lsquo;<samp class="samp">quiet, -8</samp>&rsquo;</dt>
  2346. <dd><p>Show nothing at all; be silent.
  2347. </p></dd>
  2348. <dt>&lsquo;<samp class="samp">panic, 0</samp>&rsquo;</dt>
  2349. <dd><p>Only show fatal errors which could lead the process to crash, such as
  2350. an assertion failure. This is not currently used for anything.
  2351. </p></dd>
  2352. <dt>&lsquo;<samp class="samp">fatal, 8</samp>&rsquo;</dt>
  2353. <dd><p>Only show fatal errors. These are errors after which the process absolutely
  2354. cannot continue.
  2355. </p></dd>
  2356. <dt>&lsquo;<samp class="samp">error, 16</samp>&rsquo;</dt>
  2357. <dd><p>Show all errors, including ones which can be recovered from.
  2358. </p></dd>
  2359. <dt>&lsquo;<samp class="samp">warning, 24</samp>&rsquo;</dt>
  2360. <dd><p>Show all warnings and errors. Any message related to possibly
  2361. incorrect or unexpected events will be shown.
  2362. </p></dd>
  2363. <dt>&lsquo;<samp class="samp">info, 32</samp>&rsquo;</dt>
  2364. <dd><p>Show informative messages during processing. This is in addition to
  2365. warnings and errors. This is the default value.
  2366. </p></dd>
  2367. <dt>&lsquo;<samp class="samp">verbose, 40</samp>&rsquo;</dt>
  2368. <dd><p>Same as <code class="code">info</code>, except more verbose.
  2369. </p></dd>
  2370. <dt>&lsquo;<samp class="samp">debug, 48</samp>&rsquo;</dt>
  2371. <dd><p>Show everything, including debugging information.
  2372. </p></dd>
  2373. <dt>&lsquo;<samp class="samp">trace, 56</samp>&rsquo;</dt>
  2374. </dl>
  2375. <p>For example to enable repeated log output, add the <code class="code">level</code> prefix, and set
  2376. <var class="var">loglevel</var> to <code class="code">verbose</code>:
  2377. </p><div class="example">
  2378. <pre class="example-preformatted">ffmpeg -loglevel repeat+level+verbose -i input output
  2379. </pre></div>
  2380. <p>Another example that enables repeated log output without affecting current
  2381. state of <code class="code">level</code> prefix flag or <var class="var">loglevel</var>:
  2382. </p><div class="example">
  2383. <pre class="example-preformatted">ffmpeg [...] -loglevel +repeat
  2384. </pre></div>
  2385. <p>By default the program logs to stderr. If coloring is supported by the
  2386. terminal, colors are used to mark errors and warnings. Log coloring
  2387. can be disabled setting the environment variable
  2388. <code class="env">AV_LOG_FORCE_NOCOLOR</code>, or can be forced setting
  2389. the environment variable <code class="env">AV_LOG_FORCE_COLOR</code>.
  2390. </p>
  2391. </dd>
  2392. <dt><samp class="option">-report</samp></dt>
  2393. <dd><p>Dump full command line and log output to a file named
  2394. <code class="code"><var class="var">program</var>-<var class="var">YYYYMMDD</var>-<var class="var">HHMMSS</var>.log</code> in the current
  2395. directory.
  2396. This file can be useful for bug reports.
  2397. It also implies <code class="code">-loglevel debug</code>.
  2398. </p>
  2399. <p>Setting the environment variable <code class="env">FFREPORT</code> to any value has the
  2400. same effect. If the value is a &rsquo;:&rsquo;-separated key=value sequence, these
  2401. options will affect the report; option values must be escaped if they
  2402. contain special characters or the options delimiter &rsquo;:&rsquo; (see the
  2403. &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual).
  2404. </p>
  2405. <p>The following options are recognized:
  2406. </p><dl class="table">
  2407. <dt><samp class="option">file</samp></dt>
  2408. <dd><p>set the file name to use for the report; <code class="code">%p</code> is expanded to the name
  2409. of the program, <code class="code">%t</code> is expanded to a timestamp, <code class="code">%%</code> is expanded
  2410. to a plain <code class="code">%</code>
  2411. </p></dd>
  2412. <dt><samp class="option">level</samp></dt>
  2413. <dd><p>set the log verbosity level using a numerical value (see <code class="code">-loglevel</code>).
  2414. </p></dd>
  2415. </dl>
  2416. <p>For example, to output a report to a file named <samp class="file">ffreport.log</samp>
  2417. using a log level of <code class="code">32</code> (alias for log level <code class="code">info</code>):
  2418. </p>
  2419. <div class="example">
  2420. <pre class="example-preformatted">FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
  2421. </pre></div>
  2422. <p>Errors in parsing the environment variable are not fatal, and will not
  2423. appear in the report.
  2424. </p>
  2425. </dd>
  2426. <dt><samp class="option">-hide_banner</samp></dt>
  2427. <dd><p>Suppress printing banner.
  2428. </p>
  2429. <p>All FFmpeg tools will normally show a copyright notice, build options
  2430. and library versions. This option can be used to suppress printing
  2431. this information.
  2432. </p>
  2433. </dd>
  2434. <dt><samp class="option">-cpuflags flags (<em class="emph">global</em>)</samp></dt>
  2435. <dd><p>Allows setting and clearing cpu flags. This option is intended
  2436. for testing. Do not use it unless you know what you&rsquo;re doing.
  2437. </p><div class="example">
  2438. <pre class="example-preformatted">ffmpeg -cpuflags -sse+mmx ...
  2439. ffmpeg -cpuflags mmx ...
  2440. ffmpeg -cpuflags 0 ...
  2441. </pre></div>
  2442. <p>Possible flags for this option are:
  2443. </p><dl class="table">
  2444. <dt>&lsquo;<samp class="samp">x86</samp>&rsquo;</dt>
  2445. <dd><dl class="table">
  2446. <dt>&lsquo;<samp class="samp">mmx</samp>&rsquo;</dt>
  2447. <dt>&lsquo;<samp class="samp">mmxext</samp>&rsquo;</dt>
  2448. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  2449. <dt>&lsquo;<samp class="samp">sse2</samp>&rsquo;</dt>
  2450. <dt>&lsquo;<samp class="samp">sse2slow</samp>&rsquo;</dt>
  2451. <dt>&lsquo;<samp class="samp">sse3</samp>&rsquo;</dt>
  2452. <dt>&lsquo;<samp class="samp">sse3slow</samp>&rsquo;</dt>
  2453. <dt>&lsquo;<samp class="samp">ssse3</samp>&rsquo;</dt>
  2454. <dt>&lsquo;<samp class="samp">atom</samp>&rsquo;</dt>
  2455. <dt>&lsquo;<samp class="samp">sse4.1</samp>&rsquo;</dt>
  2456. <dt>&lsquo;<samp class="samp">sse4.2</samp>&rsquo;</dt>
  2457. <dt>&lsquo;<samp class="samp">avx</samp>&rsquo;</dt>
  2458. <dt>&lsquo;<samp class="samp">avx2</samp>&rsquo;</dt>
  2459. <dt>&lsquo;<samp class="samp">xop</samp>&rsquo;</dt>
  2460. <dt>&lsquo;<samp class="samp">fma3</samp>&rsquo;</dt>
  2461. <dt>&lsquo;<samp class="samp">fma4</samp>&rsquo;</dt>
  2462. <dt>&lsquo;<samp class="samp">3dnow</samp>&rsquo;</dt>
  2463. <dt>&lsquo;<samp class="samp">3dnowext</samp>&rsquo;</dt>
  2464. <dt>&lsquo;<samp class="samp">bmi1</samp>&rsquo;</dt>
  2465. <dt>&lsquo;<samp class="samp">bmi2</samp>&rsquo;</dt>
  2466. <dt>&lsquo;<samp class="samp">cmov</samp>&rsquo;</dt>
  2467. </dl>
  2468. </dd>
  2469. <dt>&lsquo;<samp class="samp">ARM</samp>&rsquo;</dt>
  2470. <dd><dl class="table">
  2471. <dt>&lsquo;<samp class="samp">armv5te</samp>&rsquo;</dt>
  2472. <dt>&lsquo;<samp class="samp">armv6</samp>&rsquo;</dt>
  2473. <dt>&lsquo;<samp class="samp">armv6t2</samp>&rsquo;</dt>
  2474. <dt>&lsquo;<samp class="samp">vfp</samp>&rsquo;</dt>
  2475. <dt>&lsquo;<samp class="samp">vfpv3</samp>&rsquo;</dt>
  2476. <dt>&lsquo;<samp class="samp">neon</samp>&rsquo;</dt>
  2477. <dt>&lsquo;<samp class="samp">setend</samp>&rsquo;</dt>
  2478. </dl>
  2479. </dd>
  2480. <dt>&lsquo;<samp class="samp">AArch64</samp>&rsquo;</dt>
  2481. <dd><dl class="table">
  2482. <dt>&lsquo;<samp class="samp">armv8</samp>&rsquo;</dt>
  2483. <dt>&lsquo;<samp class="samp">vfp</samp>&rsquo;</dt>
  2484. <dt>&lsquo;<samp class="samp">neon</samp>&rsquo;</dt>
  2485. </dl>
  2486. </dd>
  2487. <dt>&lsquo;<samp class="samp">PowerPC</samp>&rsquo;</dt>
  2488. <dd><dl class="table">
  2489. <dt>&lsquo;<samp class="samp">altivec</samp>&rsquo;</dt>
  2490. </dl>
  2491. </dd>
  2492. <dt>&lsquo;<samp class="samp">Specific Processors</samp>&rsquo;</dt>
  2493. <dd><dl class="table">
  2494. <dt>&lsquo;<samp class="samp">pentium2</samp>&rsquo;</dt>
  2495. <dt>&lsquo;<samp class="samp">pentium3</samp>&rsquo;</dt>
  2496. <dt>&lsquo;<samp class="samp">pentium4</samp>&rsquo;</dt>
  2497. <dt>&lsquo;<samp class="samp">k6</samp>&rsquo;</dt>
  2498. <dt>&lsquo;<samp class="samp">k62</samp>&rsquo;</dt>
  2499. <dt>&lsquo;<samp class="samp">athlon</samp>&rsquo;</dt>
  2500. <dt>&lsquo;<samp class="samp">athlonxp</samp>&rsquo;</dt>
  2501. <dt>&lsquo;<samp class="samp">k8</samp>&rsquo;</dt>
  2502. </dl>
  2503. </dd>
  2504. </dl>
  2505. </dd>
  2506. <dt><samp class="option">-cpucount <var class="var">count</var> (<em class="emph">global</em>)</samp></dt>
  2507. <dd><p>Override detection of CPU count. This option is intended
  2508. for testing. Do not use it unless you know what you&rsquo;re doing.
  2509. </p><div class="example">
  2510. <pre class="example-preformatted">ffmpeg -cpucount 2
  2511. </pre></div>
  2512. </dd>
  2513. <dt><samp class="option">-max_alloc <var class="var">bytes</var></samp></dt>
  2514. <dd><p>Set the maximum size limit for allocating a block on the heap by ffmpeg&rsquo;s
  2515. family of malloc functions. Exercise <strong class="strong">extreme caution</strong> when using
  2516. this option. Don&rsquo;t use if you do not understand the full consequence of doing so.
  2517. Default is INT_MAX.
  2518. </p></dd>
  2519. </dl>
  2520. </div>
  2521. <div class="section-level-extent" id="AVOptions">
  2522. <h3 class="section"><span>3.3 AVOptions<a class="copiable-link" href="#AVOptions"> &para;</a></span></h3>
  2523. <p>These options are provided directly by the libavformat, libavdevice and
  2524. libavcodec libraries. To see the list of available AVOptions, use the
  2525. <samp class="option">-help</samp> option. They are separated into two categories:
  2526. </p><dl class="table">
  2527. <dt><samp class="option">generic</samp></dt>
  2528. <dd><p>These options can be set for any container, codec or device. Generic options
  2529. are listed under AVFormatContext options for containers/devices and under
  2530. AVCodecContext options for codecs.
  2531. </p></dd>
  2532. <dt><samp class="option">private</samp></dt>
  2533. <dd><p>These options are specific to the given container, device or codec. Private
  2534. options are listed under their corresponding containers/devices/codecs.
  2535. </p></dd>
  2536. </dl>
  2537. <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
  2538. an MP3 file, use the <samp class="option">id3v2_version</samp> private option of the MP3
  2539. muxer:
  2540. </p><div class="example">
  2541. <pre class="example-preformatted">ffmpeg -i input.flac -id3v2_version 3 out.mp3
  2542. </pre></div>
  2543. <p>All codec AVOptions are per-stream, and thus a stream specifier
  2544. should be attached to them:
  2545. </p><div class="example">
  2546. <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
  2547. </pre></div>
  2548. <p>In the above example, a multichannel audio stream is mapped twice for output.
  2549. The first instance is encoded with codec ac3 and bitrate 640k.
  2550. The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using
  2551. absolute index of the output stream.
  2552. </p>
  2553. <p>Note: the <samp class="option">-nooption</samp> syntax cannot be used for boolean
  2554. AVOptions, use <samp class="option">-option 0</samp>/<samp class="option">-option 1</samp>.
  2555. </p>
  2556. <p>Note: the old undocumented way of specifying per-stream AVOptions by
  2557. prepending v/a/s to the options name is now obsolete and will be
  2558. removed soon.
  2559. </p>
  2560. </div>
  2561. <div class="section-level-extent" id="Main-options">
  2562. <h3 class="section"><span>3.4 Main options<a class="copiable-link" href="#Main-options"> &para;</a></span></h3>
  2563. <dl class="table">
  2564. <dt><samp class="option">-x <var class="var">width</var></samp></dt>
  2565. <dd><p>Force displayed width.
  2566. </p></dd>
  2567. <dt><samp class="option">-y <var class="var">height</var></samp></dt>
  2568. <dd><p>Force displayed height.
  2569. </p></dd>
  2570. <dt><samp class="option">-fs</samp></dt>
  2571. <dd><p>Start in fullscreen mode.
  2572. </p></dd>
  2573. <dt><samp class="option">-an</samp></dt>
  2574. <dd><p>Disable audio.
  2575. </p></dd>
  2576. <dt><samp class="option">-vn</samp></dt>
  2577. <dd><p>Disable video.
  2578. </p></dd>
  2579. <dt><samp class="option">-sn</samp></dt>
  2580. <dd><p>Disable subtitles.
  2581. </p></dd>
  2582. <dt><samp class="option">-ss <var class="var">pos</var></samp></dt>
  2583. <dd><p>Seek to <var class="var">pos</var>. Note that in most formats it is not possible to seek
  2584. exactly, so <code class="command">ffplay</code> will seek to the nearest seek point to
  2585. <var class="var">pos</var>.
  2586. </p>
  2587. <p><var class="var">pos</var> must be a time duration specification,
  2588. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  2589. </p></dd>
  2590. <dt><samp class="option">-t <var class="var">duration</var></samp></dt>
  2591. <dd><p>Play <var class="var">duration</var> seconds of audio/video.
  2592. </p>
  2593. <p><var class="var">duration</var> must be a time duration specification,
  2594. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  2595. </p></dd>
  2596. <dt><samp class="option">-bytes</samp></dt>
  2597. <dd><p>Seek by bytes.
  2598. </p></dd>
  2599. <dt><samp class="option">-seek_interval</samp></dt>
  2600. <dd><p>Set custom interval, in seconds, for seeking using left/right keys. Default is 10 seconds.
  2601. </p></dd>
  2602. <dt><samp class="option">-nodisp</samp></dt>
  2603. <dd><p>Disable graphical display.
  2604. </p></dd>
  2605. <dt><samp class="option">-noborder</samp></dt>
  2606. <dd><p>Borderless window.
  2607. </p></dd>
  2608. <dt><samp class="option">-alwaysontop</samp></dt>
  2609. <dd><p>Window always on top. Available on: X11 with SDL &gt;= 2.0.5, Windows SDL &gt;= 2.0.6.
  2610. </p></dd>
  2611. <dt><samp class="option">-volume</samp></dt>
  2612. <dd><p>Set the startup volume. 0 means silence, 100 means no volume reduction or
  2613. amplification. Negative values are treated as 0, values above 100 are treated
  2614. as 100.
  2615. </p></dd>
  2616. <dt><samp class="option">-f <var class="var">fmt</var></samp></dt>
  2617. <dd><p>Force format.
  2618. </p></dd>
  2619. <dt><samp class="option">-window_title <var class="var">title</var></samp></dt>
  2620. <dd><p>Set window title (default is the input filename).
  2621. </p></dd>
  2622. <dt><samp class="option">-left <var class="var">title</var></samp></dt>
  2623. <dd><p>Set the x position for the left of the window (default is a centered window).
  2624. </p></dd>
  2625. <dt><samp class="option">-top <var class="var">title</var></samp></dt>
  2626. <dd><p>Set the y position for the top of the window (default is a centered window).
  2627. </p></dd>
  2628. <dt><samp class="option">-loop <var class="var">number</var></samp></dt>
  2629. <dd><p>Loops movie playback &lt;number&gt; times. 0 means forever.
  2630. </p></dd>
  2631. <dt><samp class="option">-showmode <var class="var">mode</var></samp></dt>
  2632. <dd><p>Set the show mode to use.
  2633. Available values for <var class="var">mode</var> are:
  2634. </p><dl class="table">
  2635. <dt>&lsquo;<samp class="samp">0, video</samp>&rsquo;</dt>
  2636. <dd><p>show video
  2637. </p></dd>
  2638. <dt>&lsquo;<samp class="samp">1, waves</samp>&rsquo;</dt>
  2639. <dd><p>show audio waves
  2640. </p></dd>
  2641. <dt>&lsquo;<samp class="samp">2, rdft</samp>&rsquo;</dt>
  2642. <dd><p>show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)
  2643. </p></dd>
  2644. </dl>
  2645. <p>Default value is &quot;video&quot;, if video is not present or cannot be played
  2646. &quot;rdft&quot; is automatically selected.
  2647. </p>
  2648. <p>You can interactively cycle through the available show modes by
  2649. pressing the key <kbd class="key">w</kbd>.
  2650. </p>
  2651. </dd>
  2652. <dt><samp class="option">-vf <var class="var">filtergraph</var></samp></dt>
  2653. <dd><p>Create the filtergraph specified by <var class="var">filtergraph</var> and use it to
  2654. filter the video stream.
  2655. </p>
  2656. <p><var class="var">filtergraph</var> is a description of the filtergraph to apply to
  2657. the stream, and must have a single video input and a single video
  2658. output. In the filtergraph, the input is associated to the label
  2659. <code class="code">in</code>, and the output to the label <code class="code">out</code>. See the
  2660. ffmpeg-filters manual for more information about the filtergraph
  2661. syntax.
  2662. </p>
  2663. <p>You can specify this parameter multiple times and cycle through the specified
  2664. filtergraphs along with the show modes by pressing the key <kbd class="key">w</kbd>.
  2665. </p>
  2666. </dd>
  2667. <dt><samp class="option">-af <var class="var">filtergraph</var></samp></dt>
  2668. <dd><p><var class="var">filtergraph</var> is a description of the filtergraph to apply to
  2669. the input audio.
  2670. Use the option &quot;-filters&quot; to show all the available filters (including
  2671. sources and sinks).
  2672. </p>
  2673. </dd>
  2674. <dt><samp class="option">-i <var class="var">input_url</var></samp></dt>
  2675. <dd><p>Read <var class="var">input_url</var>.
  2676. </p></dd>
  2677. </dl>
  2678. </div>
  2679. <div class="section-level-extent" id="Advanced-options">
  2680. <h3 class="section"><span>3.5 Advanced options<a class="copiable-link" href="#Advanced-options"> &para;</a></span></h3>
  2681. <dl class="table">
  2682. <dt><samp class="option">-stats</samp></dt>
  2683. <dd><p>Print several playback statistics, in particular show the stream
  2684. duration, the codec parameters, the current position in the stream and
  2685. the audio/video synchronisation drift. It is shown by default, unless the
  2686. log level is lower than <code class="code">info</code>. Its display can be forced by manually
  2687. specifying this option. To disable it, you need to specify <code class="code">-nostats</code>.
  2688. </p>
  2689. </dd>
  2690. <dt><samp class="option">-fast</samp></dt>
  2691. <dd><p>Non-spec-compliant optimizations.
  2692. </p></dd>
  2693. <dt><samp class="option">-genpts</samp></dt>
  2694. <dd><p>Generate pts.
  2695. </p></dd>
  2696. <dt><samp class="option">-sync <var class="var">type</var></samp></dt>
  2697. <dd><p>Set the master clock to audio (<code class="code">type=audio</code>), video
  2698. (<code class="code">type=video</code>) or external (<code class="code">type=ext</code>). Default is audio. The
  2699. master clock is used to control audio-video synchronization. Most media
  2700. players use audio as master clock, but in some cases (streaming or high
  2701. quality broadcast) it is necessary to change that. This option is mainly
  2702. used for debugging purposes.
  2703. </p></dd>
  2704. <dt><samp class="option">-ast <var class="var">audio_stream_specifier</var></samp></dt>
  2705. <dd><p>Select the desired audio stream using the given stream specifier. The stream
  2706. specifiers are described in the <a class="ref" href="#Stream-specifiers">Stream specifiers</a> chapter. If this option
  2707. is not specified, the &quot;best&quot; audio stream is selected in the program of the
  2708. already selected video stream.
  2709. </p></dd>
  2710. <dt><samp class="option">-vst <var class="var">video_stream_specifier</var></samp></dt>
  2711. <dd><p>Select the desired video stream using the given stream specifier. The stream
  2712. specifiers are described in the <a class="ref" href="#Stream-specifiers">Stream specifiers</a> chapter. If this option
  2713. is not specified, the &quot;best&quot; video stream is selected.
  2714. </p></dd>
  2715. <dt><samp class="option">-sst <var class="var">subtitle_stream_specifier</var></samp></dt>
  2716. <dd><p>Select the desired subtitle stream using the given stream specifier. The stream
  2717. specifiers are described in the <a class="ref" href="#Stream-specifiers">Stream specifiers</a> chapter. If this option
  2718. is not specified, the &quot;best&quot; subtitle stream is selected in the program of the
  2719. already selected video or audio stream.
  2720. </p></dd>
  2721. <dt><samp class="option">-autoexit</samp></dt>
  2722. <dd><p>Exit when video is done playing.
  2723. </p></dd>
  2724. <dt><samp class="option">-exitonkeydown</samp></dt>
  2725. <dd><p>Exit if any key is pressed.
  2726. </p></dd>
  2727. <dt><samp class="option">-exitonmousedown</samp></dt>
  2728. <dd><p>Exit if any mouse button is pressed.
  2729. </p>
  2730. </dd>
  2731. <dt><samp class="option">-codec:<var class="var">media_specifier</var> <var class="var">codec_name</var></samp></dt>
  2732. <dd><p>Force a specific decoder implementation for the stream identified by
  2733. <var class="var">media_specifier</var>, which can assume the values <code class="code">a</code> (audio),
  2734. <code class="code">v</code> (video), and <code class="code">s</code> subtitle.
  2735. </p>
  2736. </dd>
  2737. <dt><samp class="option">-acodec <var class="var">codec_name</var></samp></dt>
  2738. <dd><p>Force a specific audio decoder.
  2739. </p>
  2740. </dd>
  2741. <dt><samp class="option">-vcodec <var class="var">codec_name</var></samp></dt>
  2742. <dd><p>Force a specific video decoder.
  2743. </p>
  2744. </dd>
  2745. <dt><samp class="option">-scodec <var class="var">codec_name</var></samp></dt>
  2746. <dd><p>Force a specific subtitle decoder.
  2747. </p>
  2748. </dd>
  2749. <dt><samp class="option">-autorotate</samp></dt>
  2750. <dd><p>Automatically rotate the video according to file metadata. Enabled by
  2751. default, use <samp class="option">-noautorotate</samp> to disable it.
  2752. </p>
  2753. </dd>
  2754. <dt><samp class="option">-framedrop</samp></dt>
  2755. <dd><p>Drop video frames if video is out of sync. Enabled by default if the master
  2756. clock is not set to video. Use this option to enable frame dropping for all
  2757. master clock sources, use <samp class="option">-noframedrop</samp> to disable it.
  2758. </p>
  2759. </dd>
  2760. <dt><samp class="option">-infbuf</samp></dt>
  2761. <dd><p>Do not limit the input buffer size, read as much data as possible from the
  2762. input as soon as possible. Enabled by default for realtime streams, where data
  2763. may be dropped if not read in time. Use this option to enable infinite buffers
  2764. for all inputs, use <samp class="option">-noinfbuf</samp> to disable it.
  2765. </p>
  2766. </dd>
  2767. <dt><samp class="option">-filter_threads <var class="var">nb_threads</var></samp></dt>
  2768. <dd><p>Defines how many threads are used to process a filter pipeline. Each pipeline
  2769. will produce a thread pool with this many threads available for parallel
  2770. processing. The default is 0 which means that the thread count will be
  2771. determined by the number of available CPUs.
  2772. </p>
  2773. </dd>
  2774. <dt><samp class="option">-enable_vulkan</samp></dt>
  2775. <dd><p>Use vulkan renderer rather than SDL builtin renderer. Depends on libplacebo.
  2776. </p>
  2777. </dd>
  2778. <dt><samp class="option">-vulkan_params</samp></dt>
  2779. <dd>
  2780. <p>Vulkan configuration using a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by
  2781. &quot;:&quot;.
  2782. </p>
  2783. </dd>
  2784. <dt><samp class="option">-hwaccel</samp></dt>
  2785. <dd><p>Use HW accelerated decoding. Enable this option will enable vulkan renderer
  2786. automatically.
  2787. </p>
  2788. </dd>
  2789. </dl>
  2790. </div>
  2791. <div class="section-level-extent" id="While-playing">
  2792. <h3 class="section"><span>3.6 While playing<a class="copiable-link" href="#While-playing"> &para;</a></span></h3>
  2793. <dl class="table">
  2794. <dt><kbd class="key">q, ESC</kbd></dt>
  2795. <dd><p>Quit.
  2796. </p>
  2797. </dd>
  2798. <dt><kbd class="key">f</kbd></dt>
  2799. <dd><p>Toggle full screen.
  2800. </p>
  2801. </dd>
  2802. <dt><kbd class="key">p, SPC</kbd></dt>
  2803. <dd><p>Pause.
  2804. </p>
  2805. </dd>
  2806. <dt><kbd class="key">m</kbd></dt>
  2807. <dd><p>Toggle mute.
  2808. </p>
  2809. </dd>
  2810. <dt><kbd class="key">9, 0</kbd></dt>
  2811. <dt><kbd class="key">/, *</kbd></dt>
  2812. <dd><p>Decrease and increase volume respectively.
  2813. </p>
  2814. </dd>
  2815. <dt><kbd class="key">a</kbd></dt>
  2816. <dd><p>Cycle audio channel in the current program.
  2817. </p>
  2818. </dd>
  2819. <dt><kbd class="key">v</kbd></dt>
  2820. <dd><p>Cycle video channel.
  2821. </p>
  2822. </dd>
  2823. <dt><kbd class="key">t</kbd></dt>
  2824. <dd><p>Cycle subtitle channel in the current program.
  2825. </p>
  2826. </dd>
  2827. <dt><kbd class="key">c</kbd></dt>
  2828. <dd><p>Cycle program.
  2829. </p>
  2830. </dd>
  2831. <dt><kbd class="key">w</kbd></dt>
  2832. <dd><p>Cycle video filters or show modes.
  2833. </p>
  2834. </dd>
  2835. <dt><kbd class="key">s</kbd></dt>
  2836. <dd><p>Step to the next frame.
  2837. </p>
  2838. <p>Pause if the stream is not already paused, step to the next video
  2839. frame, and pause.
  2840. </p>
  2841. </dd>
  2842. <dt><kbd class="key">left/right</kbd></dt>
  2843. <dd><p>Seek backward/forward 10 seconds.
  2844. </p>
  2845. </dd>
  2846. <dt><kbd class="key">down/up</kbd></dt>
  2847. <dd><p>Seek backward/forward 1 minute.
  2848. </p>
  2849. </dd>
  2850. <dt><kbd class="key">page down/page up</kbd></dt>
  2851. <dd><p>Seek to the previous/next chapter.
  2852. or if there are no chapters
  2853. Seek backward/forward 10 minutes.
  2854. </p>
  2855. </dd>
  2856. <dt><kbd class="key">right mouse click</kbd></dt>
  2857. <dd><p>Seek to percentage in file corresponding to fraction of width.
  2858. </p>
  2859. </dd>
  2860. <dt><kbd class="key">left mouse double-click</kbd></dt>
  2861. <dd><p>Toggle full screen.
  2862. </p>
  2863. </dd>
  2864. </dl>
  2865. </div>
  2866. </div>
  2867. <div class="chapter-level-extent" id="Syntax">
  2868. <h2 class="chapter"><span>4 Syntax<a class="copiable-link" href="#Syntax"> &para;</a></span></h2>
  2869. <p>This section documents the syntax and formats employed by the FFmpeg
  2870. libraries and tools.
  2871. </p>
  2872. <a class="anchor" id="quoting_005fand_005fescaping"></a><ul class="mini-toc">
  2873. <li><a href="#Quoting-and-escaping" accesskey="1">Quoting and escaping</a></li>
  2874. <li><a href="#Date" accesskey="2">Date</a></li>
  2875. <li><a href="#Time-duration" accesskey="3">Time duration</a></li>
  2876. <li><a href="#Video-size" accesskey="4">Video size</a></li>
  2877. <li><a href="#Video-rate" accesskey="5">Video rate</a></li>
  2878. <li><a href="#Ratio" accesskey="6">Ratio</a></li>
  2879. <li><a href="#Color" accesskey="7">Color</a></li>
  2880. <li><a href="#Channel-Layout" accesskey="8">Channel Layout</a></li>
  2881. </ul>
  2882. <div class="section-level-extent" id="Quoting-and-escaping">
  2883. <h3 class="section"><span>4.1 Quoting and escaping<a class="copiable-link" href="#Quoting-and-escaping"> &para;</a></span></h3>
  2884. <p>FFmpeg adopts the following quoting and escaping mechanism, unless
  2885. explicitly specified. The following rules are applied:
  2886. </p>
  2887. <ul class="itemize mark-bullet">
  2888. <li>&lsquo;<samp class="samp">'</samp>&rsquo; and &lsquo;<samp class="samp">\</samp>&rsquo; are special characters (respectively used for
  2889. quoting and escaping). In addition to them, there might be other
  2890. special characters depending on the specific syntax where the escaping
  2891. and quoting are employed.
  2892. </li><li>A special character is escaped by prefixing it with a &lsquo;<samp class="samp">\</samp>&rsquo;.
  2893. </li><li>All characters enclosed between &lsquo;<samp class="samp">''</samp>&rsquo; are included literally in the
  2894. parsed string. The quote character &lsquo;<samp class="samp">'</samp>&rsquo; itself cannot be quoted,
  2895. so you may need to close the quote and escape it.
  2896. </li><li>Leading and trailing whitespaces, unless escaped or quoted, are
  2897. removed from the parsed string.
  2898. </li></ul>
  2899. <p>Note that you may need to add a second level of escaping when using
  2900. the command line or a script, which depends on the syntax of the
  2901. adopted shell language.
  2902. </p>
  2903. <p>The function <code class="code">av_get_token</code> defined in
  2904. <samp class="file">libavutil/avstring.h</samp> can be used to parse a token quoted or
  2905. escaped according to the rules defined above.
  2906. </p>
  2907. <p>The tool <samp class="file">tools/ffescape</samp> in the FFmpeg source tree can be used
  2908. to automatically quote or escape a string in a script.
  2909. </p>
  2910. <ul class="mini-toc">
  2911. <li><a href="#Examples" accesskey="1">Examples</a></li>
  2912. </ul>
  2913. <div class="subsection-level-extent" id="Examples">
  2914. <h4 class="subsection"><span>4.1.1 Examples<a class="copiable-link" href="#Examples"> &para;</a></span></h4>
  2915. <ul class="itemize mark-bullet">
  2916. <li>Escape the string <code class="code">Crime d'Amour</code> containing the <code class="code">'</code> special
  2917. character:
  2918. <div class="example">
  2919. <pre class="example-preformatted">Crime d\'Amour
  2920. </pre></div>
  2921. </li><li>The string above contains a quote, so the <code class="code">'</code> needs to be escaped
  2922. when quoting it:
  2923. <div class="example">
  2924. <pre class="example-preformatted">'Crime d'\''Amour'
  2925. </pre></div>
  2926. </li><li>Include leading or trailing whitespaces using quoting:
  2927. <div class="example">
  2928. <pre class="example-preformatted">' this string starts and ends with whitespaces '
  2929. </pre></div>
  2930. </li><li>Escaping and quoting can be mixed together:
  2931. <div class="example">
  2932. <pre class="example-preformatted">' The string '\'string\'' is a string '
  2933. </pre></div>
  2934. </li><li>To include a literal &lsquo;<samp class="samp">\</samp>&rsquo; you can use either escaping or quoting:
  2935. <div class="example">
  2936. <pre class="example-preformatted">'c:\foo' can be written as c:\\foo
  2937. </pre></div>
  2938. </li></ul>
  2939. <a class="anchor" id="date-syntax"></a></div>
  2940. </div>
  2941. <div class="section-level-extent" id="Date">
  2942. <h3 class="section"><span>4.2 Date<a class="copiable-link" href="#Date"> &para;</a></span></h3>
  2943. <p>The accepted syntax is:
  2944. </p><div class="example">
  2945. <pre class="example-preformatted">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
  2946. now
  2947. </pre></div>
  2948. <p>If the value is &quot;now&quot; it takes the current time.
  2949. </p>
  2950. <p>Time is local time unless Z is appended, in which case it is
  2951. interpreted as UTC.
  2952. If the year-month-day part is not specified it takes the current
  2953. year-month-day.
  2954. </p>
  2955. <a class="anchor" id="time-duration-syntax"></a></div>
  2956. <div class="section-level-extent" id="Time-duration">
  2957. <h3 class="section"><span>4.3 Time duration<a class="copiable-link" href="#Time-duration"> &para;</a></span></h3>
  2958. <p>There are two accepted syntaxes for expressing time duration.
  2959. </p>
  2960. <div class="example">
  2961. <pre class="example-preformatted">[-][<var class="var">HH</var>:]<var class="var">MM</var>:<var class="var">SS</var>[.<var class="var">m</var>...]
  2962. </pre></div>
  2963. <p><var class="var">HH</var> expresses the number of hours, <var class="var">MM</var> the number of minutes
  2964. for a maximum of 2 digits, and <var class="var">SS</var> the number of seconds for a
  2965. maximum of 2 digits. The <var class="var">m</var> at the end expresses decimal value for
  2966. <var class="var">SS</var>.
  2967. </p>
  2968. <p><em class="emph">or</em>
  2969. </p>
  2970. <div class="example">
  2971. <pre class="example-preformatted">[-]<var class="var">S</var>+[.<var class="var">m</var>...][s|ms|us]
  2972. </pre></div>
  2973. <p><var class="var">S</var> expresses the number of seconds, with the optional decimal part
  2974. <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;
  2975. indicate to interpret the value as seconds, milliseconds or microseconds,
  2976. respectively.
  2977. </p>
  2978. <p>In both expressions, the optional &lsquo;<samp class="samp">-</samp>&rsquo; indicates negative duration.
  2979. </p>
  2980. <ul class="mini-toc">
  2981. <li><a href="#Examples-1" accesskey="1">Examples</a></li>
  2982. </ul>
  2983. <div class="subsection-level-extent" id="Examples-1">
  2984. <h4 class="subsection"><span>4.3.1 Examples<a class="copiable-link" href="#Examples-1"> &para;</a></span></h4>
  2985. <p>The following examples are all valid time duration:
  2986. </p>
  2987. <dl class="table">
  2988. <dt>&lsquo;<samp class="samp">55</samp>&rsquo;</dt>
  2989. <dd><p>55 seconds
  2990. </p>
  2991. </dd>
  2992. <dt>&lsquo;<samp class="samp">0.2</samp>&rsquo;</dt>
  2993. <dd><p>0.2 seconds
  2994. </p>
  2995. </dd>
  2996. <dt>&lsquo;<samp class="samp">200ms</samp>&rsquo;</dt>
  2997. <dd><p>200 milliseconds, that&rsquo;s 0.2s
  2998. </p>
  2999. </dd>
  3000. <dt>&lsquo;<samp class="samp">200000us</samp>&rsquo;</dt>
  3001. <dd><p>200000 microseconds, that&rsquo;s 0.2s
  3002. </p>
  3003. </dd>
  3004. <dt>&lsquo;<samp class="samp">12:03:45</samp>&rsquo;</dt>
  3005. <dd><p>12 hours, 03 minutes and 45 seconds
  3006. </p>
  3007. </dd>
  3008. <dt>&lsquo;<samp class="samp">23.189</samp>&rsquo;</dt>
  3009. <dd><p>23.189 seconds
  3010. </p></dd>
  3011. </dl>
  3012. <a class="anchor" id="video-size-syntax"></a></div>
  3013. </div>
  3014. <div class="section-level-extent" id="Video-size">
  3015. <h3 class="section"><span>4.4 Video size<a class="copiable-link" href="#Video-size"> &para;</a></span></h3>
  3016. <p>Specify the size of the sourced video, it may be a string of the form
  3017. <var class="var">width</var>x<var class="var">height</var>, or the name of a size abbreviation.
  3018. </p>
  3019. <p>The following abbreviations are recognized:
  3020. </p><dl class="table">
  3021. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  3022. <dd><p>720x480
  3023. </p></dd>
  3024. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  3025. <dd><p>720x576
  3026. </p></dd>
  3027. <dt>&lsquo;<samp class="samp">qntsc</samp>&rsquo;</dt>
  3028. <dd><p>352x240
  3029. </p></dd>
  3030. <dt>&lsquo;<samp class="samp">qpal</samp>&rsquo;</dt>
  3031. <dd><p>352x288
  3032. </p></dd>
  3033. <dt>&lsquo;<samp class="samp">sntsc</samp>&rsquo;</dt>
  3034. <dd><p>640x480
  3035. </p></dd>
  3036. <dt>&lsquo;<samp class="samp">spal</samp>&rsquo;</dt>
  3037. <dd><p>768x576
  3038. </p></dd>
  3039. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  3040. <dd><p>352x240
  3041. </p></dd>
  3042. <dt>&lsquo;<samp class="samp">ntsc-film</samp>&rsquo;</dt>
  3043. <dd><p>352x240
  3044. </p></dd>
  3045. <dt>&lsquo;<samp class="samp">sqcif</samp>&rsquo;</dt>
  3046. <dd><p>128x96
  3047. </p></dd>
  3048. <dt>&lsquo;<samp class="samp">qcif</samp>&rsquo;</dt>
  3049. <dd><p>176x144
  3050. </p></dd>
  3051. <dt>&lsquo;<samp class="samp">cif</samp>&rsquo;</dt>
  3052. <dd><p>352x288
  3053. </p></dd>
  3054. <dt>&lsquo;<samp class="samp">4cif</samp>&rsquo;</dt>
  3055. <dd><p>704x576
  3056. </p></dd>
  3057. <dt>&lsquo;<samp class="samp">16cif</samp>&rsquo;</dt>
  3058. <dd><p>1408x1152
  3059. </p></dd>
  3060. <dt>&lsquo;<samp class="samp">qqvga</samp>&rsquo;</dt>
  3061. <dd><p>160x120
  3062. </p></dd>
  3063. <dt>&lsquo;<samp class="samp">qvga</samp>&rsquo;</dt>
  3064. <dd><p>320x240
  3065. </p></dd>
  3066. <dt>&lsquo;<samp class="samp">vga</samp>&rsquo;</dt>
  3067. <dd><p>640x480
  3068. </p></dd>
  3069. <dt>&lsquo;<samp class="samp">svga</samp>&rsquo;</dt>
  3070. <dd><p>800x600
  3071. </p></dd>
  3072. <dt>&lsquo;<samp class="samp">xga</samp>&rsquo;</dt>
  3073. <dd><p>1024x768
  3074. </p></dd>
  3075. <dt>&lsquo;<samp class="samp">uxga</samp>&rsquo;</dt>
  3076. <dd><p>1600x1200
  3077. </p></dd>
  3078. <dt>&lsquo;<samp class="samp">qxga</samp>&rsquo;</dt>
  3079. <dd><p>2048x1536
  3080. </p></dd>
  3081. <dt>&lsquo;<samp class="samp">sxga</samp>&rsquo;</dt>
  3082. <dd><p>1280x1024
  3083. </p></dd>
  3084. <dt>&lsquo;<samp class="samp">qsxga</samp>&rsquo;</dt>
  3085. <dd><p>2560x2048
  3086. </p></dd>
  3087. <dt>&lsquo;<samp class="samp">hsxga</samp>&rsquo;</dt>
  3088. <dd><p>5120x4096
  3089. </p></dd>
  3090. <dt>&lsquo;<samp class="samp">wvga</samp>&rsquo;</dt>
  3091. <dd><p>852x480
  3092. </p></dd>
  3093. <dt>&lsquo;<samp class="samp">wxga</samp>&rsquo;</dt>
  3094. <dd><p>1366x768
  3095. </p></dd>
  3096. <dt>&lsquo;<samp class="samp">wsxga</samp>&rsquo;</dt>
  3097. <dd><p>1600x1024
  3098. </p></dd>
  3099. <dt>&lsquo;<samp class="samp">wuxga</samp>&rsquo;</dt>
  3100. <dd><p>1920x1200
  3101. </p></dd>
  3102. <dt>&lsquo;<samp class="samp">woxga</samp>&rsquo;</dt>
  3103. <dd><p>2560x1600
  3104. </p></dd>
  3105. <dt>&lsquo;<samp class="samp">wqsxga</samp>&rsquo;</dt>
  3106. <dd><p>3200x2048
  3107. </p></dd>
  3108. <dt>&lsquo;<samp class="samp">wquxga</samp>&rsquo;</dt>
  3109. <dd><p>3840x2400
  3110. </p></dd>
  3111. <dt>&lsquo;<samp class="samp">whsxga</samp>&rsquo;</dt>
  3112. <dd><p>6400x4096
  3113. </p></dd>
  3114. <dt>&lsquo;<samp class="samp">whuxga</samp>&rsquo;</dt>
  3115. <dd><p>7680x4800
  3116. </p></dd>
  3117. <dt>&lsquo;<samp class="samp">cga</samp>&rsquo;</dt>
  3118. <dd><p>320x200
  3119. </p></dd>
  3120. <dt>&lsquo;<samp class="samp">ega</samp>&rsquo;</dt>
  3121. <dd><p>640x350
  3122. </p></dd>
  3123. <dt>&lsquo;<samp class="samp">hd480</samp>&rsquo;</dt>
  3124. <dd><p>852x480
  3125. </p></dd>
  3126. <dt>&lsquo;<samp class="samp">hd720</samp>&rsquo;</dt>
  3127. <dd><p>1280x720
  3128. </p></dd>
  3129. <dt>&lsquo;<samp class="samp">hd1080</samp>&rsquo;</dt>
  3130. <dd><p>1920x1080
  3131. </p></dd>
  3132. <dt>&lsquo;<samp class="samp">2k</samp>&rsquo;</dt>
  3133. <dd><p>2048x1080
  3134. </p></dd>
  3135. <dt>&lsquo;<samp class="samp">2kflat</samp>&rsquo;</dt>
  3136. <dd><p>1998x1080
  3137. </p></dd>
  3138. <dt>&lsquo;<samp class="samp">2kscope</samp>&rsquo;</dt>
  3139. <dd><p>2048x858
  3140. </p></dd>
  3141. <dt>&lsquo;<samp class="samp">4k</samp>&rsquo;</dt>
  3142. <dd><p>4096x2160
  3143. </p></dd>
  3144. <dt>&lsquo;<samp class="samp">4kflat</samp>&rsquo;</dt>
  3145. <dd><p>3996x2160
  3146. </p></dd>
  3147. <dt>&lsquo;<samp class="samp">4kscope</samp>&rsquo;</dt>
  3148. <dd><p>4096x1716
  3149. </p></dd>
  3150. <dt>&lsquo;<samp class="samp">nhd</samp>&rsquo;</dt>
  3151. <dd><p>640x360
  3152. </p></dd>
  3153. <dt>&lsquo;<samp class="samp">hqvga</samp>&rsquo;</dt>
  3154. <dd><p>240x160
  3155. </p></dd>
  3156. <dt>&lsquo;<samp class="samp">wqvga</samp>&rsquo;</dt>
  3157. <dd><p>400x240
  3158. </p></dd>
  3159. <dt>&lsquo;<samp class="samp">fwqvga</samp>&rsquo;</dt>
  3160. <dd><p>432x240
  3161. </p></dd>
  3162. <dt>&lsquo;<samp class="samp">hvga</samp>&rsquo;</dt>
  3163. <dd><p>480x320
  3164. </p></dd>
  3165. <dt>&lsquo;<samp class="samp">qhd</samp>&rsquo;</dt>
  3166. <dd><p>960x540
  3167. </p></dd>
  3168. <dt>&lsquo;<samp class="samp">2kdci</samp>&rsquo;</dt>
  3169. <dd><p>2048x1080
  3170. </p></dd>
  3171. <dt>&lsquo;<samp class="samp">4kdci</samp>&rsquo;</dt>
  3172. <dd><p>4096x2160
  3173. </p></dd>
  3174. <dt>&lsquo;<samp class="samp">uhd2160</samp>&rsquo;</dt>
  3175. <dd><p>3840x2160
  3176. </p></dd>
  3177. <dt>&lsquo;<samp class="samp">uhd4320</samp>&rsquo;</dt>
  3178. <dd><p>7680x4320
  3179. </p></dd>
  3180. </dl>
  3181. <a class="anchor" id="video-rate-syntax"></a></div>
  3182. <div class="section-level-extent" id="Video-rate">
  3183. <h3 class="section"><span>4.5 Video rate<a class="copiable-link" href="#Video-rate"> &para;</a></span></h3>
  3184. <p>Specify the frame rate of a video, expressed as the number of frames
  3185. generated per second. It has to be a string in the format
  3186. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a float
  3187. number or a valid video frame rate abbreviation.
  3188. </p>
  3189. <p>The following abbreviations are recognized:
  3190. </p><dl class="table">
  3191. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  3192. <dd><p>30000/1001
  3193. </p></dd>
  3194. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  3195. <dd><p>25/1
  3196. </p></dd>
  3197. <dt>&lsquo;<samp class="samp">qntsc</samp>&rsquo;</dt>
  3198. <dd><p>30000/1001
  3199. </p></dd>
  3200. <dt>&lsquo;<samp class="samp">qpal</samp>&rsquo;</dt>
  3201. <dd><p>25/1
  3202. </p></dd>
  3203. <dt>&lsquo;<samp class="samp">sntsc</samp>&rsquo;</dt>
  3204. <dd><p>30000/1001
  3205. </p></dd>
  3206. <dt>&lsquo;<samp class="samp">spal</samp>&rsquo;</dt>
  3207. <dd><p>25/1
  3208. </p></dd>
  3209. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  3210. <dd><p>24/1
  3211. </p></dd>
  3212. <dt>&lsquo;<samp class="samp">ntsc-film</samp>&rsquo;</dt>
  3213. <dd><p>24000/1001
  3214. </p></dd>
  3215. </dl>
  3216. <a class="anchor" id="ratio-syntax"></a></div>
  3217. <div class="section-level-extent" id="Ratio">
  3218. <h3 class="section"><span>4.6 Ratio<a class="copiable-link" href="#Ratio"> &para;</a></span></h3>
  3219. <p>A ratio can be expressed as an expression, or in the form
  3220. <var class="var">numerator</var>:<var class="var">denominator</var>.
  3221. </p>
  3222. <p>Note that a ratio with infinite (1/0) or negative value is
  3223. considered valid, so you should check on the returned value if you
  3224. want to exclude those values.
  3225. </p>
  3226. <p>The undefined value can be expressed using the &quot;0:0&quot; string.
  3227. </p>
  3228. <a class="anchor" id="color-syntax"></a></div>
  3229. <div class="section-level-extent" id="Color">
  3230. <h3 class="section"><span>4.7 Color<a class="copiable-link" href="#Color"> &para;</a></span></h3>
  3231. <p>It can be the name of a color as defined below (case insensitive match) or a
  3232. <code class="code">[0x|#]RRGGBB[AA]</code> sequence, possibly followed by @ and a string
  3233. representing the alpha component.
  3234. </p>
  3235. <p>The alpha component may be a string composed by &quot;0x&quot; followed by an
  3236. hexadecimal number or a decimal number between 0.0 and 1.0, which
  3237. represents the opacity value (&lsquo;<samp class="samp">0x00</samp>&rsquo; or &lsquo;<samp class="samp">0.0</samp>&rsquo; means completely
  3238. transparent, &lsquo;<samp class="samp">0xff</samp>&rsquo; or &lsquo;<samp class="samp">1.0</samp>&rsquo; completely opaque). If the alpha
  3239. component is not specified then &lsquo;<samp class="samp">0xff</samp>&rsquo; is assumed.
  3240. </p>
  3241. <p>The string &lsquo;<samp class="samp">random</samp>&rsquo; will result in a random color.
  3242. </p>
  3243. <p>The following names of colors are recognized:
  3244. </p><dl class="table">
  3245. <dt>&lsquo;<samp class="samp">AliceBlue</samp>&rsquo;</dt>
  3246. <dd><p>0xF0F8FF
  3247. </p></dd>
  3248. <dt>&lsquo;<samp class="samp">AntiqueWhite</samp>&rsquo;</dt>
  3249. <dd><p>0xFAEBD7
  3250. </p></dd>
  3251. <dt>&lsquo;<samp class="samp">Aqua</samp>&rsquo;</dt>
  3252. <dd><p>0x00FFFF
  3253. </p></dd>
  3254. <dt>&lsquo;<samp class="samp">Aquamarine</samp>&rsquo;</dt>
  3255. <dd><p>0x7FFFD4
  3256. </p></dd>
  3257. <dt>&lsquo;<samp class="samp">Azure</samp>&rsquo;</dt>
  3258. <dd><p>0xF0FFFF
  3259. </p></dd>
  3260. <dt>&lsquo;<samp class="samp">Beige</samp>&rsquo;</dt>
  3261. <dd><p>0xF5F5DC
  3262. </p></dd>
  3263. <dt>&lsquo;<samp class="samp">Bisque</samp>&rsquo;</dt>
  3264. <dd><p>0xFFE4C4
  3265. </p></dd>
  3266. <dt>&lsquo;<samp class="samp">Black</samp>&rsquo;</dt>
  3267. <dd><p>0x000000
  3268. </p></dd>
  3269. <dt>&lsquo;<samp class="samp">BlanchedAlmond</samp>&rsquo;</dt>
  3270. <dd><p>0xFFEBCD
  3271. </p></dd>
  3272. <dt>&lsquo;<samp class="samp">Blue</samp>&rsquo;</dt>
  3273. <dd><p>0x0000FF
  3274. </p></dd>
  3275. <dt>&lsquo;<samp class="samp">BlueViolet</samp>&rsquo;</dt>
  3276. <dd><p>0x8A2BE2
  3277. </p></dd>
  3278. <dt>&lsquo;<samp class="samp">Brown</samp>&rsquo;</dt>
  3279. <dd><p>0xA52A2A
  3280. </p></dd>
  3281. <dt>&lsquo;<samp class="samp">BurlyWood</samp>&rsquo;</dt>
  3282. <dd><p>0xDEB887
  3283. </p></dd>
  3284. <dt>&lsquo;<samp class="samp">CadetBlue</samp>&rsquo;</dt>
  3285. <dd><p>0x5F9EA0
  3286. </p></dd>
  3287. <dt>&lsquo;<samp class="samp">Chartreuse</samp>&rsquo;</dt>
  3288. <dd><p>0x7FFF00
  3289. </p></dd>
  3290. <dt>&lsquo;<samp class="samp">Chocolate</samp>&rsquo;</dt>
  3291. <dd><p>0xD2691E
  3292. </p></dd>
  3293. <dt>&lsquo;<samp class="samp">Coral</samp>&rsquo;</dt>
  3294. <dd><p>0xFF7F50
  3295. </p></dd>
  3296. <dt>&lsquo;<samp class="samp">CornflowerBlue</samp>&rsquo;</dt>
  3297. <dd><p>0x6495ED
  3298. </p></dd>
  3299. <dt>&lsquo;<samp class="samp">Cornsilk</samp>&rsquo;</dt>
  3300. <dd><p>0xFFF8DC
  3301. </p></dd>
  3302. <dt>&lsquo;<samp class="samp">Crimson</samp>&rsquo;</dt>
  3303. <dd><p>0xDC143C
  3304. </p></dd>
  3305. <dt>&lsquo;<samp class="samp">Cyan</samp>&rsquo;</dt>
  3306. <dd><p>0x00FFFF
  3307. </p></dd>
  3308. <dt>&lsquo;<samp class="samp">DarkBlue</samp>&rsquo;</dt>
  3309. <dd><p>0x00008B
  3310. </p></dd>
  3311. <dt>&lsquo;<samp class="samp">DarkCyan</samp>&rsquo;</dt>
  3312. <dd><p>0x008B8B
  3313. </p></dd>
  3314. <dt>&lsquo;<samp class="samp">DarkGoldenRod</samp>&rsquo;</dt>
  3315. <dd><p>0xB8860B
  3316. </p></dd>
  3317. <dt>&lsquo;<samp class="samp">DarkGray</samp>&rsquo;</dt>
  3318. <dd><p>0xA9A9A9
  3319. </p></dd>
  3320. <dt>&lsquo;<samp class="samp">DarkGreen</samp>&rsquo;</dt>
  3321. <dd><p>0x006400
  3322. </p></dd>
  3323. <dt>&lsquo;<samp class="samp">DarkKhaki</samp>&rsquo;</dt>
  3324. <dd><p>0xBDB76B
  3325. </p></dd>
  3326. <dt>&lsquo;<samp class="samp">DarkMagenta</samp>&rsquo;</dt>
  3327. <dd><p>0x8B008B
  3328. </p></dd>
  3329. <dt>&lsquo;<samp class="samp">DarkOliveGreen</samp>&rsquo;</dt>
  3330. <dd><p>0x556B2F
  3331. </p></dd>
  3332. <dt>&lsquo;<samp class="samp">Darkorange</samp>&rsquo;</dt>
  3333. <dd><p>0xFF8C00
  3334. </p></dd>
  3335. <dt>&lsquo;<samp class="samp">DarkOrchid</samp>&rsquo;</dt>
  3336. <dd><p>0x9932CC
  3337. </p></dd>
  3338. <dt>&lsquo;<samp class="samp">DarkRed</samp>&rsquo;</dt>
  3339. <dd><p>0x8B0000
  3340. </p></dd>
  3341. <dt>&lsquo;<samp class="samp">DarkSalmon</samp>&rsquo;</dt>
  3342. <dd><p>0xE9967A
  3343. </p></dd>
  3344. <dt>&lsquo;<samp class="samp">DarkSeaGreen</samp>&rsquo;</dt>
  3345. <dd><p>0x8FBC8F
  3346. </p></dd>
  3347. <dt>&lsquo;<samp class="samp">DarkSlateBlue</samp>&rsquo;</dt>
  3348. <dd><p>0x483D8B
  3349. </p></dd>
  3350. <dt>&lsquo;<samp class="samp">DarkSlateGray</samp>&rsquo;</dt>
  3351. <dd><p>0x2F4F4F
  3352. </p></dd>
  3353. <dt>&lsquo;<samp class="samp">DarkTurquoise</samp>&rsquo;</dt>
  3354. <dd><p>0x00CED1
  3355. </p></dd>
  3356. <dt>&lsquo;<samp class="samp">DarkViolet</samp>&rsquo;</dt>
  3357. <dd><p>0x9400D3
  3358. </p></dd>
  3359. <dt>&lsquo;<samp class="samp">DeepPink</samp>&rsquo;</dt>
  3360. <dd><p>0xFF1493
  3361. </p></dd>
  3362. <dt>&lsquo;<samp class="samp">DeepSkyBlue</samp>&rsquo;</dt>
  3363. <dd><p>0x00BFFF
  3364. </p></dd>
  3365. <dt>&lsquo;<samp class="samp">DimGray</samp>&rsquo;</dt>
  3366. <dd><p>0x696969
  3367. </p></dd>
  3368. <dt>&lsquo;<samp class="samp">DodgerBlue</samp>&rsquo;</dt>
  3369. <dd><p>0x1E90FF
  3370. </p></dd>
  3371. <dt>&lsquo;<samp class="samp">FireBrick</samp>&rsquo;</dt>
  3372. <dd><p>0xB22222
  3373. </p></dd>
  3374. <dt>&lsquo;<samp class="samp">FloralWhite</samp>&rsquo;</dt>
  3375. <dd><p>0xFFFAF0
  3376. </p></dd>
  3377. <dt>&lsquo;<samp class="samp">ForestGreen</samp>&rsquo;</dt>
  3378. <dd><p>0x228B22
  3379. </p></dd>
  3380. <dt>&lsquo;<samp class="samp">Fuchsia</samp>&rsquo;</dt>
  3381. <dd><p>0xFF00FF
  3382. </p></dd>
  3383. <dt>&lsquo;<samp class="samp">Gainsboro</samp>&rsquo;</dt>
  3384. <dd><p>0xDCDCDC
  3385. </p></dd>
  3386. <dt>&lsquo;<samp class="samp">GhostWhite</samp>&rsquo;</dt>
  3387. <dd><p>0xF8F8FF
  3388. </p></dd>
  3389. <dt>&lsquo;<samp class="samp">Gold</samp>&rsquo;</dt>
  3390. <dd><p>0xFFD700
  3391. </p></dd>
  3392. <dt>&lsquo;<samp class="samp">GoldenRod</samp>&rsquo;</dt>
  3393. <dd><p>0xDAA520
  3394. </p></dd>
  3395. <dt>&lsquo;<samp class="samp">Gray</samp>&rsquo;</dt>
  3396. <dd><p>0x808080
  3397. </p></dd>
  3398. <dt>&lsquo;<samp class="samp">Green</samp>&rsquo;</dt>
  3399. <dd><p>0x008000
  3400. </p></dd>
  3401. <dt>&lsquo;<samp class="samp">GreenYellow</samp>&rsquo;</dt>
  3402. <dd><p>0xADFF2F
  3403. </p></dd>
  3404. <dt>&lsquo;<samp class="samp">HoneyDew</samp>&rsquo;</dt>
  3405. <dd><p>0xF0FFF0
  3406. </p></dd>
  3407. <dt>&lsquo;<samp class="samp">HotPink</samp>&rsquo;</dt>
  3408. <dd><p>0xFF69B4
  3409. </p></dd>
  3410. <dt>&lsquo;<samp class="samp">IndianRed</samp>&rsquo;</dt>
  3411. <dd><p>0xCD5C5C
  3412. </p></dd>
  3413. <dt>&lsquo;<samp class="samp">Indigo</samp>&rsquo;</dt>
  3414. <dd><p>0x4B0082
  3415. </p></dd>
  3416. <dt>&lsquo;<samp class="samp">Ivory</samp>&rsquo;</dt>
  3417. <dd><p>0xFFFFF0
  3418. </p></dd>
  3419. <dt>&lsquo;<samp class="samp">Khaki</samp>&rsquo;</dt>
  3420. <dd><p>0xF0E68C
  3421. </p></dd>
  3422. <dt>&lsquo;<samp class="samp">Lavender</samp>&rsquo;</dt>
  3423. <dd><p>0xE6E6FA
  3424. </p></dd>
  3425. <dt>&lsquo;<samp class="samp">LavenderBlush</samp>&rsquo;</dt>
  3426. <dd><p>0xFFF0F5
  3427. </p></dd>
  3428. <dt>&lsquo;<samp class="samp">LawnGreen</samp>&rsquo;</dt>
  3429. <dd><p>0x7CFC00
  3430. </p></dd>
  3431. <dt>&lsquo;<samp class="samp">LemonChiffon</samp>&rsquo;</dt>
  3432. <dd><p>0xFFFACD
  3433. </p></dd>
  3434. <dt>&lsquo;<samp class="samp">LightBlue</samp>&rsquo;</dt>
  3435. <dd><p>0xADD8E6
  3436. </p></dd>
  3437. <dt>&lsquo;<samp class="samp">LightCoral</samp>&rsquo;</dt>
  3438. <dd><p>0xF08080
  3439. </p></dd>
  3440. <dt>&lsquo;<samp class="samp">LightCyan</samp>&rsquo;</dt>
  3441. <dd><p>0xE0FFFF
  3442. </p></dd>
  3443. <dt>&lsquo;<samp class="samp">LightGoldenRodYellow</samp>&rsquo;</dt>
  3444. <dd><p>0xFAFAD2
  3445. </p></dd>
  3446. <dt>&lsquo;<samp class="samp">LightGreen</samp>&rsquo;</dt>
  3447. <dd><p>0x90EE90
  3448. </p></dd>
  3449. <dt>&lsquo;<samp class="samp">LightGrey</samp>&rsquo;</dt>
  3450. <dd><p>0xD3D3D3
  3451. </p></dd>
  3452. <dt>&lsquo;<samp class="samp">LightPink</samp>&rsquo;</dt>
  3453. <dd><p>0xFFB6C1
  3454. </p></dd>
  3455. <dt>&lsquo;<samp class="samp">LightSalmon</samp>&rsquo;</dt>
  3456. <dd><p>0xFFA07A
  3457. </p></dd>
  3458. <dt>&lsquo;<samp class="samp">LightSeaGreen</samp>&rsquo;</dt>
  3459. <dd><p>0x20B2AA
  3460. </p></dd>
  3461. <dt>&lsquo;<samp class="samp">LightSkyBlue</samp>&rsquo;</dt>
  3462. <dd><p>0x87CEFA
  3463. </p></dd>
  3464. <dt>&lsquo;<samp class="samp">LightSlateGray</samp>&rsquo;</dt>
  3465. <dd><p>0x778899
  3466. </p></dd>
  3467. <dt>&lsquo;<samp class="samp">LightSteelBlue</samp>&rsquo;</dt>
  3468. <dd><p>0xB0C4DE
  3469. </p></dd>
  3470. <dt>&lsquo;<samp class="samp">LightYellow</samp>&rsquo;</dt>
  3471. <dd><p>0xFFFFE0
  3472. </p></dd>
  3473. <dt>&lsquo;<samp class="samp">Lime</samp>&rsquo;</dt>
  3474. <dd><p>0x00FF00
  3475. </p></dd>
  3476. <dt>&lsquo;<samp class="samp">LimeGreen</samp>&rsquo;</dt>
  3477. <dd><p>0x32CD32
  3478. </p></dd>
  3479. <dt>&lsquo;<samp class="samp">Linen</samp>&rsquo;</dt>
  3480. <dd><p>0xFAF0E6
  3481. </p></dd>
  3482. <dt>&lsquo;<samp class="samp">Magenta</samp>&rsquo;</dt>
  3483. <dd><p>0xFF00FF
  3484. </p></dd>
  3485. <dt>&lsquo;<samp class="samp">Maroon</samp>&rsquo;</dt>
  3486. <dd><p>0x800000
  3487. </p></dd>
  3488. <dt>&lsquo;<samp class="samp">MediumAquaMarine</samp>&rsquo;</dt>
  3489. <dd><p>0x66CDAA
  3490. </p></dd>
  3491. <dt>&lsquo;<samp class="samp">MediumBlue</samp>&rsquo;</dt>
  3492. <dd><p>0x0000CD
  3493. </p></dd>
  3494. <dt>&lsquo;<samp class="samp">MediumOrchid</samp>&rsquo;</dt>
  3495. <dd><p>0xBA55D3
  3496. </p></dd>
  3497. <dt>&lsquo;<samp class="samp">MediumPurple</samp>&rsquo;</dt>
  3498. <dd><p>0x9370D8
  3499. </p></dd>
  3500. <dt>&lsquo;<samp class="samp">MediumSeaGreen</samp>&rsquo;</dt>
  3501. <dd><p>0x3CB371
  3502. </p></dd>
  3503. <dt>&lsquo;<samp class="samp">MediumSlateBlue</samp>&rsquo;</dt>
  3504. <dd><p>0x7B68EE
  3505. </p></dd>
  3506. <dt>&lsquo;<samp class="samp">MediumSpringGreen</samp>&rsquo;</dt>
  3507. <dd><p>0x00FA9A
  3508. </p></dd>
  3509. <dt>&lsquo;<samp class="samp">MediumTurquoise</samp>&rsquo;</dt>
  3510. <dd><p>0x48D1CC
  3511. </p></dd>
  3512. <dt>&lsquo;<samp class="samp">MediumVioletRed</samp>&rsquo;</dt>
  3513. <dd><p>0xC71585
  3514. </p></dd>
  3515. <dt>&lsquo;<samp class="samp">MidnightBlue</samp>&rsquo;</dt>
  3516. <dd><p>0x191970
  3517. </p></dd>
  3518. <dt>&lsquo;<samp class="samp">MintCream</samp>&rsquo;</dt>
  3519. <dd><p>0xF5FFFA
  3520. </p></dd>
  3521. <dt>&lsquo;<samp class="samp">MistyRose</samp>&rsquo;</dt>
  3522. <dd><p>0xFFE4E1
  3523. </p></dd>
  3524. <dt>&lsquo;<samp class="samp">Moccasin</samp>&rsquo;</dt>
  3525. <dd><p>0xFFE4B5
  3526. </p></dd>
  3527. <dt>&lsquo;<samp class="samp">NavajoWhite</samp>&rsquo;</dt>
  3528. <dd><p>0xFFDEAD
  3529. </p></dd>
  3530. <dt>&lsquo;<samp class="samp">Navy</samp>&rsquo;</dt>
  3531. <dd><p>0x000080
  3532. </p></dd>
  3533. <dt>&lsquo;<samp class="samp">OldLace</samp>&rsquo;</dt>
  3534. <dd><p>0xFDF5E6
  3535. </p></dd>
  3536. <dt>&lsquo;<samp class="samp">Olive</samp>&rsquo;</dt>
  3537. <dd><p>0x808000
  3538. </p></dd>
  3539. <dt>&lsquo;<samp class="samp">OliveDrab</samp>&rsquo;</dt>
  3540. <dd><p>0x6B8E23
  3541. </p></dd>
  3542. <dt>&lsquo;<samp class="samp">Orange</samp>&rsquo;</dt>
  3543. <dd><p>0xFFA500
  3544. </p></dd>
  3545. <dt>&lsquo;<samp class="samp">OrangeRed</samp>&rsquo;</dt>
  3546. <dd><p>0xFF4500
  3547. </p></dd>
  3548. <dt>&lsquo;<samp class="samp">Orchid</samp>&rsquo;</dt>
  3549. <dd><p>0xDA70D6
  3550. </p></dd>
  3551. <dt>&lsquo;<samp class="samp">PaleGoldenRod</samp>&rsquo;</dt>
  3552. <dd><p>0xEEE8AA
  3553. </p></dd>
  3554. <dt>&lsquo;<samp class="samp">PaleGreen</samp>&rsquo;</dt>
  3555. <dd><p>0x98FB98
  3556. </p></dd>
  3557. <dt>&lsquo;<samp class="samp">PaleTurquoise</samp>&rsquo;</dt>
  3558. <dd><p>0xAFEEEE
  3559. </p></dd>
  3560. <dt>&lsquo;<samp class="samp">PaleVioletRed</samp>&rsquo;</dt>
  3561. <dd><p>0xD87093
  3562. </p></dd>
  3563. <dt>&lsquo;<samp class="samp">PapayaWhip</samp>&rsquo;</dt>
  3564. <dd><p>0xFFEFD5
  3565. </p></dd>
  3566. <dt>&lsquo;<samp class="samp">PeachPuff</samp>&rsquo;</dt>
  3567. <dd><p>0xFFDAB9
  3568. </p></dd>
  3569. <dt>&lsquo;<samp class="samp">Peru</samp>&rsquo;</dt>
  3570. <dd><p>0xCD853F
  3571. </p></dd>
  3572. <dt>&lsquo;<samp class="samp">Pink</samp>&rsquo;</dt>
  3573. <dd><p>0xFFC0CB
  3574. </p></dd>
  3575. <dt>&lsquo;<samp class="samp">Plum</samp>&rsquo;</dt>
  3576. <dd><p>0xDDA0DD
  3577. </p></dd>
  3578. <dt>&lsquo;<samp class="samp">PowderBlue</samp>&rsquo;</dt>
  3579. <dd><p>0xB0E0E6
  3580. </p></dd>
  3581. <dt>&lsquo;<samp class="samp">Purple</samp>&rsquo;</dt>
  3582. <dd><p>0x800080
  3583. </p></dd>
  3584. <dt>&lsquo;<samp class="samp">Red</samp>&rsquo;</dt>
  3585. <dd><p>0xFF0000
  3586. </p></dd>
  3587. <dt>&lsquo;<samp class="samp">RosyBrown</samp>&rsquo;</dt>
  3588. <dd><p>0xBC8F8F
  3589. </p></dd>
  3590. <dt>&lsquo;<samp class="samp">RoyalBlue</samp>&rsquo;</dt>
  3591. <dd><p>0x4169E1
  3592. </p></dd>
  3593. <dt>&lsquo;<samp class="samp">SaddleBrown</samp>&rsquo;</dt>
  3594. <dd><p>0x8B4513
  3595. </p></dd>
  3596. <dt>&lsquo;<samp class="samp">Salmon</samp>&rsquo;</dt>
  3597. <dd><p>0xFA8072
  3598. </p></dd>
  3599. <dt>&lsquo;<samp class="samp">SandyBrown</samp>&rsquo;</dt>
  3600. <dd><p>0xF4A460
  3601. </p></dd>
  3602. <dt>&lsquo;<samp class="samp">SeaGreen</samp>&rsquo;</dt>
  3603. <dd><p>0x2E8B57
  3604. </p></dd>
  3605. <dt>&lsquo;<samp class="samp">SeaShell</samp>&rsquo;</dt>
  3606. <dd><p>0xFFF5EE
  3607. </p></dd>
  3608. <dt>&lsquo;<samp class="samp">Sienna</samp>&rsquo;</dt>
  3609. <dd><p>0xA0522D
  3610. </p></dd>
  3611. <dt>&lsquo;<samp class="samp">Silver</samp>&rsquo;</dt>
  3612. <dd><p>0xC0C0C0
  3613. </p></dd>
  3614. <dt>&lsquo;<samp class="samp">SkyBlue</samp>&rsquo;</dt>
  3615. <dd><p>0x87CEEB
  3616. </p></dd>
  3617. <dt>&lsquo;<samp class="samp">SlateBlue</samp>&rsquo;</dt>
  3618. <dd><p>0x6A5ACD
  3619. </p></dd>
  3620. <dt>&lsquo;<samp class="samp">SlateGray</samp>&rsquo;</dt>
  3621. <dd><p>0x708090
  3622. </p></dd>
  3623. <dt>&lsquo;<samp class="samp">Snow</samp>&rsquo;</dt>
  3624. <dd><p>0xFFFAFA
  3625. </p></dd>
  3626. <dt>&lsquo;<samp class="samp">SpringGreen</samp>&rsquo;</dt>
  3627. <dd><p>0x00FF7F
  3628. </p></dd>
  3629. <dt>&lsquo;<samp class="samp">SteelBlue</samp>&rsquo;</dt>
  3630. <dd><p>0x4682B4
  3631. </p></dd>
  3632. <dt>&lsquo;<samp class="samp">Tan</samp>&rsquo;</dt>
  3633. <dd><p>0xD2B48C
  3634. </p></dd>
  3635. <dt>&lsquo;<samp class="samp">Teal</samp>&rsquo;</dt>
  3636. <dd><p>0x008080
  3637. </p></dd>
  3638. <dt>&lsquo;<samp class="samp">Thistle</samp>&rsquo;</dt>
  3639. <dd><p>0xD8BFD8
  3640. </p></dd>
  3641. <dt>&lsquo;<samp class="samp">Tomato</samp>&rsquo;</dt>
  3642. <dd><p>0xFF6347
  3643. </p></dd>
  3644. <dt>&lsquo;<samp class="samp">Turquoise</samp>&rsquo;</dt>
  3645. <dd><p>0x40E0D0
  3646. </p></dd>
  3647. <dt>&lsquo;<samp class="samp">Violet</samp>&rsquo;</dt>
  3648. <dd><p>0xEE82EE
  3649. </p></dd>
  3650. <dt>&lsquo;<samp class="samp">Wheat</samp>&rsquo;</dt>
  3651. <dd><p>0xF5DEB3
  3652. </p></dd>
  3653. <dt>&lsquo;<samp class="samp">White</samp>&rsquo;</dt>
  3654. <dd><p>0xFFFFFF
  3655. </p></dd>
  3656. <dt>&lsquo;<samp class="samp">WhiteSmoke</samp>&rsquo;</dt>
  3657. <dd><p>0xF5F5F5
  3658. </p></dd>
  3659. <dt>&lsquo;<samp class="samp">Yellow</samp>&rsquo;</dt>
  3660. <dd><p>0xFFFF00
  3661. </p></dd>
  3662. <dt>&lsquo;<samp class="samp">YellowGreen</samp>&rsquo;</dt>
  3663. <dd><p>0x9ACD32
  3664. </p></dd>
  3665. </dl>
  3666. <a class="anchor" id="channel-layout-syntax"></a></div>
  3667. <div class="section-level-extent" id="Channel-Layout">
  3668. <h3 class="section"><span>4.8 Channel Layout<a class="copiable-link" href="#Channel-Layout"> &para;</a></span></h3>
  3669. <p>A channel layout specifies the spatial disposition of the channels in
  3670. a multi-channel audio stream. To specify a channel layout, FFmpeg
  3671. makes use of a special syntax.
  3672. </p>
  3673. <p>Individual channels are identified by an id, as given by the table
  3674. below:
  3675. </p><dl class="table">
  3676. <dt>&lsquo;<samp class="samp">FL</samp>&rsquo;</dt>
  3677. <dd><p>front left
  3678. </p></dd>
  3679. <dt>&lsquo;<samp class="samp">FR</samp>&rsquo;</dt>
  3680. <dd><p>front right
  3681. </p></dd>
  3682. <dt>&lsquo;<samp class="samp">FC</samp>&rsquo;</dt>
  3683. <dd><p>front center
  3684. </p></dd>
  3685. <dt>&lsquo;<samp class="samp">LFE</samp>&rsquo;</dt>
  3686. <dd><p>low frequency
  3687. </p></dd>
  3688. <dt>&lsquo;<samp class="samp">BL</samp>&rsquo;</dt>
  3689. <dd><p>back left
  3690. </p></dd>
  3691. <dt>&lsquo;<samp class="samp">BR</samp>&rsquo;</dt>
  3692. <dd><p>back right
  3693. </p></dd>
  3694. <dt>&lsquo;<samp class="samp">FLC</samp>&rsquo;</dt>
  3695. <dd><p>front left-of-center
  3696. </p></dd>
  3697. <dt>&lsquo;<samp class="samp">FRC</samp>&rsquo;</dt>
  3698. <dd><p>front right-of-center
  3699. </p></dd>
  3700. <dt>&lsquo;<samp class="samp">BC</samp>&rsquo;</dt>
  3701. <dd><p>back center
  3702. </p></dd>
  3703. <dt>&lsquo;<samp class="samp">SL</samp>&rsquo;</dt>
  3704. <dd><p>side left
  3705. </p></dd>
  3706. <dt>&lsquo;<samp class="samp">SR</samp>&rsquo;</dt>
  3707. <dd><p>side right
  3708. </p></dd>
  3709. <dt>&lsquo;<samp class="samp">TC</samp>&rsquo;</dt>
  3710. <dd><p>top center
  3711. </p></dd>
  3712. <dt>&lsquo;<samp class="samp">TFL</samp>&rsquo;</dt>
  3713. <dd><p>top front left
  3714. </p></dd>
  3715. <dt>&lsquo;<samp class="samp">TFC</samp>&rsquo;</dt>
  3716. <dd><p>top front center
  3717. </p></dd>
  3718. <dt>&lsquo;<samp class="samp">TFR</samp>&rsquo;</dt>
  3719. <dd><p>top front right
  3720. </p></dd>
  3721. <dt>&lsquo;<samp class="samp">TBL</samp>&rsquo;</dt>
  3722. <dd><p>top back left
  3723. </p></dd>
  3724. <dt>&lsquo;<samp class="samp">TBC</samp>&rsquo;</dt>
  3725. <dd><p>top back center
  3726. </p></dd>
  3727. <dt>&lsquo;<samp class="samp">TBR</samp>&rsquo;</dt>
  3728. <dd><p>top back right
  3729. </p></dd>
  3730. <dt>&lsquo;<samp class="samp">DL</samp>&rsquo;</dt>
  3731. <dd><p>downmix left
  3732. </p></dd>
  3733. <dt>&lsquo;<samp class="samp">DR</samp>&rsquo;</dt>
  3734. <dd><p>downmix right
  3735. </p></dd>
  3736. <dt>&lsquo;<samp class="samp">WL</samp>&rsquo;</dt>
  3737. <dd><p>wide left
  3738. </p></dd>
  3739. <dt>&lsquo;<samp class="samp">WR</samp>&rsquo;</dt>
  3740. <dd><p>wide right
  3741. </p></dd>
  3742. <dt>&lsquo;<samp class="samp">SDL</samp>&rsquo;</dt>
  3743. <dd><p>surround direct left
  3744. </p></dd>
  3745. <dt>&lsquo;<samp class="samp">SDR</samp>&rsquo;</dt>
  3746. <dd><p>surround direct right
  3747. </p></dd>
  3748. <dt>&lsquo;<samp class="samp">LFE2</samp>&rsquo;</dt>
  3749. <dd><p>low frequency 2
  3750. </p></dd>
  3751. </dl>
  3752. <p>Standard channel layout compositions can be specified by using the
  3753. following identifiers:
  3754. </p><dl class="table">
  3755. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  3756. <dd><p>FC
  3757. </p></dd>
  3758. <dt>&lsquo;<samp class="samp">stereo</samp>&rsquo;</dt>
  3759. <dd><p>FL+FR
  3760. </p></dd>
  3761. <dt>&lsquo;<samp class="samp">2.1</samp>&rsquo;</dt>
  3762. <dd><p>FL+FR+LFE
  3763. </p></dd>
  3764. <dt>&lsquo;<samp class="samp">3.0</samp>&rsquo;</dt>
  3765. <dd><p>FL+FR+FC
  3766. </p></dd>
  3767. <dt>&lsquo;<samp class="samp">3.0(back)</samp>&rsquo;</dt>
  3768. <dd><p>FL+FR+BC
  3769. </p></dd>
  3770. <dt>&lsquo;<samp class="samp">4.0</samp>&rsquo;</dt>
  3771. <dd><p>FL+FR+FC+BC
  3772. </p></dd>
  3773. <dt>&lsquo;<samp class="samp">quad</samp>&rsquo;</dt>
  3774. <dd><p>FL+FR+BL+BR
  3775. </p></dd>
  3776. <dt>&lsquo;<samp class="samp">quad(side)</samp>&rsquo;</dt>
  3777. <dd><p>FL+FR+SL+SR
  3778. </p></dd>
  3779. <dt>&lsquo;<samp class="samp">3.1</samp>&rsquo;</dt>
  3780. <dd><p>FL+FR+FC+LFE
  3781. </p></dd>
  3782. <dt>&lsquo;<samp class="samp">5.0</samp>&rsquo;</dt>
  3783. <dd><p>FL+FR+FC+BL+BR
  3784. </p></dd>
  3785. <dt>&lsquo;<samp class="samp">5.0(side)</samp>&rsquo;</dt>
  3786. <dd><p>FL+FR+FC+SL+SR
  3787. </p></dd>
  3788. <dt>&lsquo;<samp class="samp">4.1</samp>&rsquo;</dt>
  3789. <dd><p>FL+FR+FC+LFE+BC
  3790. </p></dd>
  3791. <dt>&lsquo;<samp class="samp">5.1</samp>&rsquo;</dt>
  3792. <dd><p>FL+FR+FC+LFE+BL+BR
  3793. </p></dd>
  3794. <dt>&lsquo;<samp class="samp">5.1(side)</samp>&rsquo;</dt>
  3795. <dd><p>FL+FR+FC+LFE+SL+SR
  3796. </p></dd>
  3797. <dt>&lsquo;<samp class="samp">6.0</samp>&rsquo;</dt>
  3798. <dd><p>FL+FR+FC+BC+SL+SR
  3799. </p></dd>
  3800. <dt>&lsquo;<samp class="samp">6.0(front)</samp>&rsquo;</dt>
  3801. <dd><p>FL+FR+FLC+FRC+SL+SR
  3802. </p></dd>
  3803. <dt>&lsquo;<samp class="samp">3.1.2</samp>&rsquo;</dt>
  3804. <dd><p>FL+FR+FC+LFE+TFL+TFR
  3805. </p></dd>
  3806. <dt>&lsquo;<samp class="samp">hexagonal</samp>&rsquo;</dt>
  3807. <dd><p>FL+FR+FC+BL+BR+BC
  3808. </p></dd>
  3809. <dt>&lsquo;<samp class="samp">6.1</samp>&rsquo;</dt>
  3810. <dd><p>FL+FR+FC+LFE+BC+SL+SR
  3811. </p></dd>
  3812. <dt>&lsquo;<samp class="samp">6.1</samp>&rsquo;</dt>
  3813. <dd><p>FL+FR+FC+LFE+BL+BR+BC
  3814. </p></dd>
  3815. <dt>&lsquo;<samp class="samp">6.1(front)</samp>&rsquo;</dt>
  3816. <dd><p>FL+FR+LFE+FLC+FRC+SL+SR
  3817. </p></dd>
  3818. <dt>&lsquo;<samp class="samp">7.0</samp>&rsquo;</dt>
  3819. <dd><p>FL+FR+FC+BL+BR+SL+SR
  3820. </p></dd>
  3821. <dt>&lsquo;<samp class="samp">7.0(front)</samp>&rsquo;</dt>
  3822. <dd><p>FL+FR+FC+FLC+FRC+SL+SR
  3823. </p></dd>
  3824. <dt>&lsquo;<samp class="samp">7.1</samp>&rsquo;</dt>
  3825. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
  3826. </p></dd>
  3827. <dt>&lsquo;<samp class="samp">7.1(wide)</samp>&rsquo;</dt>
  3828. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
  3829. </p></dd>
  3830. <dt>&lsquo;<samp class="samp">7.1(wide-side)</samp>&rsquo;</dt>
  3831. <dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
  3832. </p></dd>
  3833. <dt>&lsquo;<samp class="samp">5.1.2</samp>&rsquo;</dt>
  3834. <dd><p>FL+FR+FC+LFE+BL+BR+TFL+TFR
  3835. </p></dd>
  3836. <dt>&lsquo;<samp class="samp">octagonal</samp>&rsquo;</dt>
  3837. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR
  3838. </p></dd>
  3839. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  3840. <dd><p>FL+FR+BL+BR+TFL+TFR+TBL+TBR
  3841. </p></dd>
  3842. <dt>&lsquo;<samp class="samp">5.1.4</samp>&rsquo;</dt>
  3843. <dd><p>FL+FR+FC+LFE+BL+BR+TFL+TFR+TBL+TBR
  3844. </p></dd>
  3845. <dt>&lsquo;<samp class="samp">7.1.2</samp>&rsquo;</dt>
  3846. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR
  3847. </p></dd>
  3848. <dt>&lsquo;<samp class="samp">7.1.4</samp>&rsquo;</dt>
  3849. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBL+TBR
  3850. </p></dd>
  3851. <dt>&lsquo;<samp class="samp">7.2.3</samp>&rsquo;</dt>
  3852. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBC+LFE2
  3853. </p></dd>
  3854. <dt>&lsquo;<samp class="samp">9.1.4</samp>&rsquo;</dt>
  3855. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC+SL+SR+TFL+TFR+TBL+TBR
  3856. </p></dd>
  3857. <dt>&lsquo;<samp class="samp">hexadecagonal</samp>&rsquo;</dt>
  3858. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR
  3859. </p></dd>
  3860. <dt>&lsquo;<samp class="samp">downmix</samp>&rsquo;</dt>
  3861. <dd><p>DL+DR
  3862. </p></dd>
  3863. <dt>&lsquo;<samp class="samp">22.2</samp>&rsquo;</dt>
  3864. <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
  3865. </p></dd>
  3866. </dl>
  3867. <p>A custom channel layout can be specified as a sequence of terms, separated by &rsquo;+&rsquo;.
  3868. Each term can be:
  3869. </p><ul class="itemize mark-bullet">
  3870. <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.),
  3871. each optionally containing a custom name after a &rsquo;@&rsquo;, (e.g. &lsquo;<samp class="samp">FL@Left</samp>&rsquo;,
  3872. &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.)
  3873. </li></ul>
  3874. <p>A standard channel layout can be specified by the following:
  3875. </p><ul class="itemize mark-bullet">
  3876. <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.)
  3877. </li><li>the name of a standard channel layout (e.g. &lsquo;<samp class="samp">mono</samp>&rsquo;,
  3878. &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.)
  3879. </li><li>a number of channels, in decimal, followed by &rsquo;c&rsquo;, yielding the default channel
  3880. layout for that number of channels (see the function
  3881. <code class="code">av_channel_layout_default</code>). Note that not all channel counts have a
  3882. default layout.
  3883. </li><li>a number of channels, in decimal, followed by &rsquo;C&rsquo;, yielding an unknown channel
  3884. layout with the specified number of channels. Note that not all channel layout
  3885. specification strings support unknown channel layouts.
  3886. </li><li>a channel layout mask, in hexadecimal starting with &quot;0x&quot; (see the
  3887. <code class="code">AV_CH_*</code> macros in <samp class="file">libavutil/channel_layout.h</samp>.
  3888. </li></ul>
  3889. <p>Before libavutil version 53 the trailing character &quot;c&quot; to specify a number of
  3890. channels was optional, but now it is required, while a channel layout mask can
  3891. also be specified as a decimal number (if and only if not followed by &quot;c&quot; or &quot;C&quot;).
  3892. </p>
  3893. <p>See also the function <code class="code">av_channel_layout_from_string</code> defined in
  3894. <samp class="file">libavutil/channel_layout.h</samp>.
  3895. </p>
  3896. </div>
  3897. </div>
  3898. <div class="chapter-level-extent" id="Expression-Evaluation">
  3899. <h2 class="chapter"><span>5 Expression Evaluation<a class="copiable-link" href="#Expression-Evaluation"> &para;</a></span></h2>
  3900. <p>When evaluating an arithmetic expression, FFmpeg uses an internal
  3901. formula evaluator, implemented through the <samp class="file">libavutil/eval.h</samp>
  3902. interface.
  3903. </p>
  3904. <p>An expression may contain unary, binary operators, constants, and
  3905. functions.
  3906. </p>
  3907. <p>Two expressions <var class="var">expr1</var> and <var class="var">expr2</var> can be combined to form
  3908. another expression &quot;<var class="var">expr1</var>;<var class="var">expr2</var>&quot;.
  3909. <var class="var">expr1</var> and <var class="var">expr2</var> are evaluated in turn, and the new
  3910. expression evaluates to the value of <var class="var">expr2</var>.
  3911. </p>
  3912. <p>The following binary operators are available: <code class="code">+</code>, <code class="code">-</code>,
  3913. <code class="code">*</code>, <code class="code">/</code>, <code class="code">^</code>.
  3914. </p>
  3915. <p>The following unary operators are available: <code class="code">+</code>, <code class="code">-</code>.
  3916. </p>
  3917. <p>The following functions are available:
  3918. </p><dl class="table">
  3919. <dt><samp class="option">abs(x)</samp></dt>
  3920. <dd><p>Compute absolute value of <var class="var">x</var>.
  3921. </p>
  3922. </dd>
  3923. <dt><samp class="option">acos(x)</samp></dt>
  3924. <dd><p>Compute arccosine of <var class="var">x</var>.
  3925. </p>
  3926. </dd>
  3927. <dt><samp class="option">asin(x)</samp></dt>
  3928. <dd><p>Compute arcsine of <var class="var">x</var>.
  3929. </p>
  3930. </dd>
  3931. <dt><samp class="option">atan(x)</samp></dt>
  3932. <dd><p>Compute arctangent of <var class="var">x</var>.
  3933. </p>
  3934. </dd>
  3935. <dt><samp class="option">atan2(y, x)</samp></dt>
  3936. <dd><p>Compute principal value of the arc tangent of <var class="var">y</var>/<var class="var">x</var>.
  3937. </p>
  3938. </dd>
  3939. <dt><samp class="option">between(x, min, max)</samp></dt>
  3940. <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
  3941. equal to <var class="var">max</var>, 0 otherwise.
  3942. </p>
  3943. </dd>
  3944. <dt><samp class="option">bitand(x, y)</samp></dt>
  3945. <dt><samp class="option">bitor(x, y)</samp></dt>
  3946. <dd><p>Compute bitwise and/or operation on <var class="var">x</var> and <var class="var">y</var>.
  3947. </p>
  3948. <p>The results of the evaluation of <var class="var">x</var> and <var class="var">y</var> are converted to
  3949. integers before executing the bitwise operation.
  3950. </p>
  3951. <p>Note that both the conversion to integer and the conversion back to
  3952. floating point can lose precision. Beware of unexpected results for
  3953. large numbers (usually 2^53 and larger).
  3954. </p>
  3955. </dd>
  3956. <dt><samp class="option">ceil(expr)</samp></dt>
  3957. <dd><p>Round the value of expression <var class="var">expr</var> upwards to the nearest
  3958. integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
  3959. </p>
  3960. </dd>
  3961. <dt><samp class="option">clip(x, min, max)</samp></dt>
  3962. <dd><p>Return the value of <var class="var">x</var> clipped between <var class="var">min</var> and <var class="var">max</var>.
  3963. </p>
  3964. </dd>
  3965. <dt><samp class="option">cos(x)</samp></dt>
  3966. <dd><p>Compute cosine of <var class="var">x</var>.
  3967. </p>
  3968. </dd>
  3969. <dt><samp class="option">cosh(x)</samp></dt>
  3970. <dd><p>Compute hyperbolic cosine of <var class="var">x</var>.
  3971. </p>
  3972. </dd>
  3973. <dt><samp class="option">eq(x, y)</samp></dt>
  3974. <dd><p>Return 1 if <var class="var">x</var> and <var class="var">y</var> are equivalent, 0 otherwise.
  3975. </p>
  3976. </dd>
  3977. <dt><samp class="option">exp(x)</samp></dt>
  3978. <dd><p>Compute exponential of <var class="var">x</var> (with base <code class="code">e</code>, the Euler&rsquo;s number).
  3979. </p>
  3980. </dd>
  3981. <dt><samp class="option">floor(expr)</samp></dt>
  3982. <dd><p>Round the value of expression <var class="var">expr</var> downwards to the nearest
  3983. integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
  3984. </p>
  3985. </dd>
  3986. <dt><samp class="option">gauss(x)</samp></dt>
  3987. <dd><p>Compute Gauss function of <var class="var">x</var>, corresponding to
  3988. <code class="code">exp(-x*x/2) / sqrt(2*PI)</code>.
  3989. </p>
  3990. </dd>
  3991. <dt><samp class="option">gcd(x, y)</samp></dt>
  3992. <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
  3993. <var class="var">y</var> are 0 or either or both are less than zero then behavior is undefined.
  3994. </p>
  3995. </dd>
  3996. <dt><samp class="option">gt(x, y)</samp></dt>
  3997. <dd><p>Return 1 if <var class="var">x</var> is greater than <var class="var">y</var>, 0 otherwise.
  3998. </p>
  3999. </dd>
  4000. <dt><samp class="option">gte(x, y)</samp></dt>
  4001. <dd><p>Return 1 if <var class="var">x</var> is greater than or equal to <var class="var">y</var>, 0 otherwise.
  4002. </p>
  4003. </dd>
  4004. <dt><samp class="option">hypot(x, y)</samp></dt>
  4005. <dd><p>This function is similar to the C function with the same name; it returns
  4006. &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
  4007. right triangle with sides of length <var class="var">x</var> and <var class="var">y</var>, or the distance of the
  4008. point (<var class="var">x</var>, <var class="var">y</var>) from the origin.
  4009. </p>
  4010. </dd>
  4011. <dt><samp class="option">if(x, y)</samp></dt>
  4012. <dd><p>Evaluate <var class="var">x</var>, and if the result is non-zero return the result of
  4013. the evaluation of <var class="var">y</var>, return 0 otherwise.
  4014. </p>
  4015. </dd>
  4016. <dt><samp class="option">if(x, y, z)</samp></dt>
  4017. <dd><p>Evaluate <var class="var">x</var>, and if the result is non-zero return the evaluation
  4018. result of <var class="var">y</var>, otherwise the evaluation result of <var class="var">z</var>.
  4019. </p>
  4020. </dd>
  4021. <dt><samp class="option">ifnot(x, y)</samp></dt>
  4022. <dd><p>Evaluate <var class="var">x</var>, and if the result is zero return the result of the
  4023. evaluation of <var class="var">y</var>, return 0 otherwise.
  4024. </p>
  4025. </dd>
  4026. <dt><samp class="option">ifnot(x, y, z)</samp></dt>
  4027. <dd><p>Evaluate <var class="var">x</var>, and if the result is zero return the evaluation
  4028. result of <var class="var">y</var>, otherwise the evaluation result of <var class="var">z</var>.
  4029. </p>
  4030. </dd>
  4031. <dt><samp class="option">isinf(x)</samp></dt>
  4032. <dd><p>Return 1.0 if <var class="var">x</var> is +/-INFINITY, 0.0 otherwise.
  4033. </p>
  4034. </dd>
  4035. <dt><samp class="option">isnan(x)</samp></dt>
  4036. <dd><p>Return 1.0 if <var class="var">x</var> is NAN, 0.0 otherwise.
  4037. </p>
  4038. </dd>
  4039. <dt><samp class="option">ld(var)</samp></dt>
  4040. <dd><p>Load the value of the internal variable with number
  4041. <var class="var">var</var>, which was previously stored with st(<var class="var">var</var>, <var class="var">expr</var>).
  4042. The function returns the loaded value.
  4043. </p>
  4044. </dd>
  4045. <dt><samp class="option">lerp(x, y, z)</samp></dt>
  4046. <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>.
  4047. </p>
  4048. </dd>
  4049. <dt><samp class="option">log(x)</samp></dt>
  4050. <dd><p>Compute natural logarithm of <var class="var">x</var>.
  4051. </p>
  4052. </dd>
  4053. <dt><samp class="option">lt(x, y)</samp></dt>
  4054. <dd><p>Return 1 if <var class="var">x</var> is lesser than <var class="var">y</var>, 0 otherwise.
  4055. </p>
  4056. </dd>
  4057. <dt><samp class="option">lte(x, y)</samp></dt>
  4058. <dd><p>Return 1 if <var class="var">x</var> is lesser than or equal to <var class="var">y</var>, 0 otherwise.
  4059. </p>
  4060. </dd>
  4061. <dt><samp class="option">max(x, y)</samp></dt>
  4062. <dd><p>Return the maximum between <var class="var">x</var> and <var class="var">y</var>.
  4063. </p>
  4064. </dd>
  4065. <dt><samp class="option">min(x, y)</samp></dt>
  4066. <dd><p>Return the minimum between <var class="var">x</var> and <var class="var">y</var>.
  4067. </p>
  4068. </dd>
  4069. <dt><samp class="option">mod(x, y)</samp></dt>
  4070. <dd><p>Compute the remainder of division of <var class="var">x</var> by <var class="var">y</var>.
  4071. </p>
  4072. </dd>
  4073. <dt><samp class="option">not(expr)</samp></dt>
  4074. <dd><p>Return 1.0 if <var class="var">expr</var> is zero, 0.0 otherwise.
  4075. </p>
  4076. </dd>
  4077. <dt><samp class="option">pow(x, y)</samp></dt>
  4078. <dd><p>Compute the power of <var class="var">x</var> elevated <var class="var">y</var>, it is equivalent to
  4079. &quot;(<var class="var">x</var>)^(<var class="var">y</var>)&quot;.
  4080. </p>
  4081. </dd>
  4082. <dt><samp class="option">print(t)</samp></dt>
  4083. <dt><samp class="option">print(t, l)</samp></dt>
  4084. <dd><p>Print the value of expression <var class="var">t</var> with loglevel <var class="var">l</var>. If
  4085. <var class="var">l</var> is not specified then a default log level is used.
  4086. Returns the value of the expression printed.
  4087. </p>
  4088. <p>Prints t with loglevel l
  4089. </p>
  4090. </dd>
  4091. <dt><samp class="option">random(idx)</samp></dt>
  4092. <dd><p>Return a pseudo random value between 0.0 and 1.0. <var class="var">idx</var> is the
  4093. index of the internal variable which will be used to save the
  4094. seed/state.
  4095. </p>
  4096. </dd>
  4097. <dt><samp class="option">randomi(idx, min, max)</samp></dt>
  4098. <dd><p>Return a pseudo random value in the interval between <var class="var">min</var> and
  4099. <var class="var">max</var>. <var class="var">idx</var> is the index of the internal variable which will
  4100. be used to save the seed/state.
  4101. </p>
  4102. </dd>
  4103. <dt><samp class="option">root(expr, max)</samp></dt>
  4104. <dd><p>Find an input value for which the function represented by <var class="var">expr</var>
  4105. with argument <var class="var">ld(0)</var> is 0 in the interval 0..<var class="var">max</var>.
  4106. </p>
  4107. <p>The expression in <var class="var">expr</var> must denote a continuous function or the
  4108. result is undefined.
  4109. </p>
  4110. <p><var class="var">ld(0)</var> is used to represent the function input value, which means
  4111. that the given expression will be evaluated multiple times with
  4112. various input values that the expression can access through
  4113. <code class="code">ld(0)</code>. When the expression evaluates to 0 then the
  4114. corresponding input value will be returned.
  4115. </p>
  4116. </dd>
  4117. <dt><samp class="option">round(expr)</samp></dt>
  4118. <dd><p>Round the value of expression <var class="var">expr</var> to the nearest integer. For example, &quot;round(1.5)&quot; is &quot;2.0&quot;.
  4119. </p>
  4120. </dd>
  4121. <dt><samp class="option">sgn(x)</samp></dt>
  4122. <dd><p>Compute sign of <var class="var">x</var>.
  4123. </p>
  4124. </dd>
  4125. <dt><samp class="option">sin(x)</samp></dt>
  4126. <dd><p>Compute sine of <var class="var">x</var>.
  4127. </p>
  4128. </dd>
  4129. <dt><samp class="option">sinh(x)</samp></dt>
  4130. <dd><p>Compute hyperbolic sine of <var class="var">x</var>.
  4131. </p>
  4132. </dd>
  4133. <dt><samp class="option">sqrt(expr)</samp></dt>
  4134. <dd><p>Compute the square root of <var class="var">expr</var>. This is equivalent to
  4135. &quot;(<var class="var">expr</var>)^.5&quot;.
  4136. </p>
  4137. </dd>
  4138. <dt><samp class="option">squish(x)</samp></dt>
  4139. <dd><p>Compute expression <code class="code">1/(1 + exp(4*x))</code>.
  4140. </p>
  4141. </dd>
  4142. <dt><samp class="option">st(var, expr)</samp></dt>
  4143. <dd><p>Store the value of the expression <var class="var">expr</var> in an internal
  4144. variable. <var class="var">var</var> specifies the number of the variable where to
  4145. store the value, and it is a value ranging from 0 to 9. The function
  4146. returns the value stored in the internal variable.
  4147. Note, Variables are currently not shared between expressions.
  4148. </p>
  4149. </dd>
  4150. <dt><samp class="option">tan(x)</samp></dt>
  4151. <dd><p>Compute tangent of <var class="var">x</var>.
  4152. </p>
  4153. </dd>
  4154. <dt><samp class="option">tanh(x)</samp></dt>
  4155. <dd><p>Compute hyperbolic tangent of <var class="var">x</var>.
  4156. </p>
  4157. </dd>
  4158. <dt><samp class="option">taylor(expr, x)</samp></dt>
  4159. <dt><samp class="option">taylor(expr, x, id)</samp></dt>
  4160. <dd><p>Evaluate a Taylor series at <var class="var">x</var>, given an expression representing
  4161. the <code class="code">ld(id)</code>-th derivative of a function at 0.
  4162. </p>
  4163. <p>When the series does not converge the result is undefined.
  4164. </p>
  4165. <p><var class="var">ld(id)</var> is used to represent the derivative order in <var class="var">expr</var>,
  4166. which means that the given expression will be evaluated multiple times
  4167. with various input values that the expression can access through
  4168. <code class="code">ld(id)</code>. If <var class="var">id</var> is not specified then 0 is assumed.
  4169. </p>
  4170. <p>Note, when you have the derivatives at y instead of 0,
  4171. <code class="code">taylor(expr, x-y)</code> can be used.
  4172. </p>
  4173. </dd>
  4174. <dt><samp class="option">time(0)</samp></dt>
  4175. <dd><p>Return the current (wallclock) time in seconds.
  4176. </p>
  4177. </dd>
  4178. <dt><samp class="option">trunc(expr)</samp></dt>
  4179. <dd><p>Round the value of expression <var class="var">expr</var> towards zero to the nearest
  4180. integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
  4181. </p>
  4182. </dd>
  4183. <dt><samp class="option">while(cond, expr)</samp></dt>
  4184. <dd><p>Evaluate expression <var class="var">expr</var> while the expression <var class="var">cond</var> is
  4185. non-zero, and returns the value of the last <var class="var">expr</var> evaluation, or
  4186. NAN if <var class="var">cond</var> was always false.
  4187. </p></dd>
  4188. </dl>
  4189. <p>The following constants are available:
  4190. </p><dl class="table">
  4191. <dt><samp class="option">PI</samp></dt>
  4192. <dd><p>area of the unit disc, approximately 3.14
  4193. </p></dd>
  4194. <dt><samp class="option">E</samp></dt>
  4195. <dd><p>exp(1) (Euler&rsquo;s number), approximately 2.718
  4196. </p></dd>
  4197. <dt><samp class="option">PHI</samp></dt>
  4198. <dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
  4199. </p></dd>
  4200. </dl>
  4201. <p>Assuming that an expression is considered &quot;true&quot; if it has a non-zero
  4202. value, note that:
  4203. </p>
  4204. <p><code class="code">*</code> works like AND
  4205. </p>
  4206. <p><code class="code">+</code> works like OR
  4207. </p>
  4208. <p>For example the construct:
  4209. </p><div class="example">
  4210. <pre class="example-preformatted">if (A AND B) then C
  4211. </pre></div>
  4212. <p>is equivalent to:
  4213. </p><div class="example">
  4214. <pre class="example-preformatted">if(A*B, C)
  4215. </pre></div>
  4216. <p>In your C code, you can extend the list of unary and binary functions,
  4217. and define recognized constants, so that they are available for your
  4218. expressions.
  4219. </p>
  4220. <p>The evaluator also recognizes the International System unit prefixes.
  4221. If &rsquo;i&rsquo; is appended after the prefix, binary prefixes are used, which
  4222. are based on powers of 1024 instead of powers of 1000.
  4223. The &rsquo;B&rsquo; postfix multiplies the value by 8, and can be appended after a
  4224. unit prefix or used alone. This allows using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;,
  4225. &rsquo;G&rsquo; and &rsquo;B&rsquo; as number postfix.
  4226. </p>
  4227. <p>The list of available International System prefixes follows, with
  4228. indication of the corresponding powers of 10 and of 2.
  4229. </p><dl class="table">
  4230. <dt><samp class="option">y</samp></dt>
  4231. <dd><p>10^-24 / 2^-80
  4232. </p></dd>
  4233. <dt><samp class="option">z</samp></dt>
  4234. <dd><p>10^-21 / 2^-70
  4235. </p></dd>
  4236. <dt><samp class="option">a</samp></dt>
  4237. <dd><p>10^-18 / 2^-60
  4238. </p></dd>
  4239. <dt><samp class="option">f</samp></dt>
  4240. <dd><p>10^-15 / 2^-50
  4241. </p></dd>
  4242. <dt><samp class="option">p</samp></dt>
  4243. <dd><p>10^-12 / 2^-40
  4244. </p></dd>
  4245. <dt><samp class="option">n</samp></dt>
  4246. <dd><p>10^-9 / 2^-30
  4247. </p></dd>
  4248. <dt><samp class="option">u</samp></dt>
  4249. <dd><p>10^-6 / 2^-20
  4250. </p></dd>
  4251. <dt><samp class="option">m</samp></dt>
  4252. <dd><p>10^-3 / 2^-10
  4253. </p></dd>
  4254. <dt><samp class="option">c</samp></dt>
  4255. <dd><p>10^-2
  4256. </p></dd>
  4257. <dt><samp class="option">d</samp></dt>
  4258. <dd><p>10^-1
  4259. </p></dd>
  4260. <dt><samp class="option">h</samp></dt>
  4261. <dd><p>10^2
  4262. </p></dd>
  4263. <dt><samp class="option">k</samp></dt>
  4264. <dd><p>10^3 / 2^10
  4265. </p></dd>
  4266. <dt><samp class="option">K</samp></dt>
  4267. <dd><p>10^3 / 2^10
  4268. </p></dd>
  4269. <dt><samp class="option">M</samp></dt>
  4270. <dd><p>10^6 / 2^20
  4271. </p></dd>
  4272. <dt><samp class="option">G</samp></dt>
  4273. <dd><p>10^9 / 2^30
  4274. </p></dd>
  4275. <dt><samp class="option">T</samp></dt>
  4276. <dd><p>10^12 / 2^40
  4277. </p></dd>
  4278. <dt><samp class="option">P</samp></dt>
  4279. <dd><p>10^15 / 2^50
  4280. </p></dd>
  4281. <dt><samp class="option">E</samp></dt>
  4282. <dd><p>10^18 / 2^60
  4283. </p></dd>
  4284. <dt><samp class="option">Z</samp></dt>
  4285. <dd><p>10^21 / 2^70
  4286. </p></dd>
  4287. <dt><samp class="option">Y</samp></dt>
  4288. <dd><p>10^24 / 2^80
  4289. </p></dd>
  4290. </dl>
  4291. <a class="anchor" id="codec_002doptions"></a></div>
  4292. <div class="chapter-level-extent" id="Codec-Options">
  4293. <h2 class="chapter"><span>6 Codec Options<a class="copiable-link" href="#Codec-Options"> &para;</a></span></h2>
  4294. <p>libavcodec provides some generic global options, which can be set on
  4295. all the encoders and decoders. In addition, each codec may support
  4296. so-called private options, which are specific for a given codec.
  4297. </p>
  4298. <p>Sometimes, a global option may only affect a specific kind of codec,
  4299. and may be nonsensical or ignored by another, so you need to be aware
  4300. of the meaning of the specified options. Also some options are
  4301. meant only for decoding or encoding.
  4302. </p>
  4303. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  4304. FFmpeg tools, or by setting the value explicitly in the
  4305. <code class="code">AVCodecContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  4306. for programmatic use.
  4307. </p>
  4308. <p>The list of supported options follow:
  4309. </p>
  4310. <dl class="table">
  4311. <dt><samp class="option">b <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  4312. <dd><p>Set bitrate in bits/s. Default value is 200K.
  4313. </p>
  4314. </dd>
  4315. <dt><samp class="option">ab <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  4316. <dd><p>Set audio bitrate (in bits/s). Default value is 128K.
  4317. </p>
  4318. </dd>
  4319. <dt><samp class="option">bt <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4320. <dd><p>Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
  4321. tolerance specifies how far ratecontrol is willing to deviate from the
  4322. target average bitrate value. This is not related to min/max
  4323. bitrate. Lowering tolerance too much has an adverse effect on quality.
  4324. </p>
  4325. </dd>
  4326. <dt><samp class="option">flags <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  4327. <dd><p>Set generic flags.
  4328. </p>
  4329. <p>Possible values:
  4330. </p><dl class="table">
  4331. <dt>&lsquo;<samp class="samp">mv4</samp>&rsquo;</dt>
  4332. <dd><p>Use four motion vector by macroblock (mpeg4).
  4333. </p></dd>
  4334. <dt>&lsquo;<samp class="samp">qpel</samp>&rsquo;</dt>
  4335. <dd><p>Use 1/4 pel motion compensation.
  4336. </p></dd>
  4337. <dt>&lsquo;<samp class="samp">loop</samp>&rsquo;</dt>
  4338. <dd><p>Use loop filter.
  4339. </p></dd>
  4340. <dt>&lsquo;<samp class="samp">qscale</samp>&rsquo;</dt>
  4341. <dd><p>Use fixed qscale.
  4342. </p></dd>
  4343. <dt>&lsquo;<samp class="samp">pass1</samp>&rsquo;</dt>
  4344. <dd><p>Use internal 2pass ratecontrol in first pass mode.
  4345. </p></dd>
  4346. <dt>&lsquo;<samp class="samp">pass2</samp>&rsquo;</dt>
  4347. <dd><p>Use internal 2pass ratecontrol in second pass mode.
  4348. </p></dd>
  4349. <dt>&lsquo;<samp class="samp">gray</samp>&rsquo;</dt>
  4350. <dd><p>Only decode/encode grayscale.
  4351. </p></dd>
  4352. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  4353. <dd><p>Set error[?] variables during encoding.
  4354. </p></dd>
  4355. <dt>&lsquo;<samp class="samp">truncated</samp>&rsquo;</dt>
  4356. <dd><p>Input bitstream might be randomly truncated.
  4357. </p></dd>
  4358. <dt>&lsquo;<samp class="samp">drop_changed</samp>&rsquo;</dt>
  4359. <dd><p>Don&rsquo;t output frames whose parameters differ from first decoded frame in stream.
  4360. Error AVERROR_INPUT_CHANGED is returned when a frame is dropped.
  4361. </p>
  4362. </dd>
  4363. <dt>&lsquo;<samp class="samp">ildct</samp>&rsquo;</dt>
  4364. <dd><p>Use interlaced DCT.
  4365. </p></dd>
  4366. <dt>&lsquo;<samp class="samp">low_delay</samp>&rsquo;</dt>
  4367. <dd><p>Force low delay.
  4368. </p></dd>
  4369. <dt>&lsquo;<samp class="samp">global_header</samp>&rsquo;</dt>
  4370. <dd><p>Place global headers in extradata instead of every keyframe.
  4371. </p></dd>
  4372. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  4373. <dd><p>Only write platform-, build- and time-independent data. (except (I)DCT).
  4374. This ensures that file and data checksums are reproducible and match between
  4375. platforms. Its primary use is for regression testing.
  4376. </p></dd>
  4377. <dt>&lsquo;<samp class="samp">aic</samp>&rsquo;</dt>
  4378. <dd><p>Apply H263 advanced intra coding / mpeg4 ac prediction.
  4379. </p></dd>
  4380. <dt>&lsquo;<samp class="samp">ilme</samp>&rsquo;</dt>
  4381. <dd><p>Apply interlaced motion estimation.
  4382. </p></dd>
  4383. <dt>&lsquo;<samp class="samp">cgop</samp>&rsquo;</dt>
  4384. <dd><p>Use closed gop.
  4385. </p></dd>
  4386. <dt>&lsquo;<samp class="samp">output_corrupt</samp>&rsquo;</dt>
  4387. <dd><p>Output even potentially corrupted frames.
  4388. </p></dd>
  4389. </dl>
  4390. </dd>
  4391. <dt><samp class="option">time_base <var class="var">rational number</var></samp></dt>
  4392. <dd><p>Set codec time base.
  4393. </p>
  4394. <p>It is the fundamental unit of time (in seconds) in terms of which
  4395. frame timestamps are represented. For fixed-fps content, timebase
  4396. should be <code class="code">1 / frame_rate</code> and timestamp increments should be
  4397. identically 1.
  4398. </p>
  4399. </dd>
  4400. <dt><samp class="option">g <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4401. <dd><p>Set the group of picture (GOP) size. Default value is 12.
  4402. </p>
  4403. </dd>
  4404. <dt><samp class="option">ar <var class="var">integer</var> (<em class="emph">decoding/encoding,audio</em>)</samp></dt>
  4405. <dd><p>Set audio sampling rate (in Hz).
  4406. </p>
  4407. </dd>
  4408. <dt><samp class="option">ac <var class="var">integer</var> (<em class="emph">decoding/encoding,audio</em>)</samp></dt>
  4409. <dd><p>Set number of audio channels.
  4410. </p>
  4411. </dd>
  4412. <dt><samp class="option">cutoff <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  4413. <dd><p>Set cutoff bandwidth. (Supported only by selected encoders, see
  4414. their respective documentation sections.)
  4415. </p>
  4416. </dd>
  4417. <dt><samp class="option">frame_size <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  4418. <dd><p>Set audio frame size.
  4419. </p>
  4420. <p>Each submitted frame except the last must contain exactly frame_size
  4421. samples per channel. May be 0 when the codec has
  4422. CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
  4423. restricted. It is set by some decoders to indicate constant frame
  4424. size.
  4425. </p>
  4426. </dd>
  4427. <dt><samp class="option">frame_number <var class="var">integer</var></samp></dt>
  4428. <dd><p>Set the frame number.
  4429. </p>
  4430. </dd>
  4431. <dt><samp class="option">delay <var class="var">integer</var></samp></dt>
  4432. <dt><samp class="option">qcomp <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4433. <dd><p>Set video quantizer scale compression (VBR). It is used as a constant
  4434. in the ratecontrol equation. Recommended range for default rc_eq:
  4435. 0.0-1.0.
  4436. </p>
  4437. </dd>
  4438. <dt><samp class="option">qblur <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4439. <dd><p>Set video quantizer scale blur (VBR).
  4440. </p>
  4441. </dd>
  4442. <dt><samp class="option">qmin <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4443. <dd><p>Set min video quantizer scale (VBR). Must be included between -1 and
  4444. 69, default value is 2.
  4445. </p>
  4446. </dd>
  4447. <dt><samp class="option">qmax <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4448. <dd><p>Set max video quantizer scale (VBR). Must be included between -1 and
  4449. 1024, default value is 31.
  4450. </p>
  4451. </dd>
  4452. <dt><samp class="option">qdiff <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4453. <dd><p>Set max difference between the quantizer scale (VBR).
  4454. </p>
  4455. </dd>
  4456. <dt><samp class="option">bf <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4457. <dd><p>Set max number of B frames between non-B-frames.
  4458. </p>
  4459. <p>Must be an integer between -1 and 16. 0 means that B-frames are
  4460. disabled. If a value of -1 is used, it will choose an automatic value
  4461. depending on the encoder.
  4462. </p>
  4463. <p>Default value is 0.
  4464. </p>
  4465. </dd>
  4466. <dt><samp class="option">b_qfactor <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4467. <dd><p>Set qp factor between P and B frames.
  4468. </p>
  4469. </dd>
  4470. <dt><samp class="option">codec_tag <var class="var">integer</var></samp></dt>
  4471. <dt><samp class="option">bug <var class="var">flags</var> (<em class="emph">decoding,video</em>)</samp></dt>
  4472. <dd><p>Workaround not auto detected encoder bugs.
  4473. </p>
  4474. <p>Possible values:
  4475. </p><dl class="table">
  4476. <dt>&lsquo;<samp class="samp">autodetect</samp>&rsquo;</dt>
  4477. <dt>&lsquo;<samp class="samp">xvid_ilace</samp>&rsquo;</dt>
  4478. <dd><p>Xvid interlacing bug (autodetected if fourcc==XVIX)
  4479. </p></dd>
  4480. <dt>&lsquo;<samp class="samp">ump4</samp>&rsquo;</dt>
  4481. <dd><p>(autodetected if fourcc==UMP4)
  4482. </p></dd>
  4483. <dt>&lsquo;<samp class="samp">no_padding</samp>&rsquo;</dt>
  4484. <dd><p>padding bug (autodetected)
  4485. </p></dd>
  4486. <dt>&lsquo;<samp class="samp">amv</samp>&rsquo;</dt>
  4487. <dt>&lsquo;<samp class="samp">qpel_chroma</samp>&rsquo;</dt>
  4488. <dt>&lsquo;<samp class="samp">std_qpel</samp>&rsquo;</dt>
  4489. <dd><p>old standard qpel (autodetected per fourcc/version)
  4490. </p></dd>
  4491. <dt>&lsquo;<samp class="samp">qpel_chroma2</samp>&rsquo;</dt>
  4492. <dt>&lsquo;<samp class="samp">direct_blocksize</samp>&rsquo;</dt>
  4493. <dd><p>direct-qpel-blocksize bug (autodetected per fourcc/version)
  4494. </p></dd>
  4495. <dt>&lsquo;<samp class="samp">edge</samp>&rsquo;</dt>
  4496. <dd><p>edge padding bug (autodetected per fourcc/version)
  4497. </p></dd>
  4498. <dt>&lsquo;<samp class="samp">hpel_chroma</samp>&rsquo;</dt>
  4499. <dt>&lsquo;<samp class="samp">dc_clip</samp>&rsquo;</dt>
  4500. <dt>&lsquo;<samp class="samp">ms</samp>&rsquo;</dt>
  4501. <dd><p>Workaround various bugs in microsoft broken decoders.
  4502. </p></dd>
  4503. <dt>&lsquo;<samp class="samp">trunc</samp>&rsquo;</dt>
  4504. <dd><p>trancated frames
  4505. </p></dd>
  4506. </dl>
  4507. </dd>
  4508. <dt><samp class="option">strict <var class="var">integer</var> (<em class="emph">decoding/encoding,audio,video</em>)</samp></dt>
  4509. <dd><p>Specify how strictly to follow the standards.
  4510. </p>
  4511. <p>Possible values:
  4512. </p><dl class="table">
  4513. <dt>&lsquo;<samp class="samp">very</samp>&rsquo;</dt>
  4514. <dd><p>strictly conform to an older more strict version of the spec or reference software
  4515. </p></dd>
  4516. <dt>&lsquo;<samp class="samp">strict</samp>&rsquo;</dt>
  4517. <dd><p>strictly conform to all the things in the spec no matter what consequences
  4518. </p></dd>
  4519. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  4520. <dt>&lsquo;<samp class="samp">unofficial</samp>&rsquo;</dt>
  4521. <dd><p>allow unofficial extensions
  4522. </p></dd>
  4523. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  4524. <dd><p>allow non standardized experimental things, experimental
  4525. (unfinished/work in progress/not well tested) decoders and encoders.
  4526. Note: experimental decoders can pose a security risk, do not use this for
  4527. decoding untrusted input.
  4528. </p></dd>
  4529. </dl>
  4530. </dd>
  4531. <dt><samp class="option">b_qoffset <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4532. <dd><p>Set QP offset between P and B frames.
  4533. </p>
  4534. </dd>
  4535. <dt><samp class="option">err_detect <var class="var">flags</var> (<em class="emph">decoding,audio,video</em>)</samp></dt>
  4536. <dd><p>Set error detection flags.
  4537. </p>
  4538. <p>Possible values:
  4539. </p><dl class="table">
  4540. <dt>&lsquo;<samp class="samp">crccheck</samp>&rsquo;</dt>
  4541. <dd><p>verify embedded CRCs
  4542. </p></dd>
  4543. <dt>&lsquo;<samp class="samp">bitstream</samp>&rsquo;</dt>
  4544. <dd><p>detect bitstream specification deviations
  4545. </p></dd>
  4546. <dt>&lsquo;<samp class="samp">buffer</samp>&rsquo;</dt>
  4547. <dd><p>detect improper bitstream length
  4548. </p></dd>
  4549. <dt>&lsquo;<samp class="samp">explode</samp>&rsquo;</dt>
  4550. <dd><p>abort decoding on minor error detection
  4551. </p></dd>
  4552. <dt>&lsquo;<samp class="samp">ignore_err</samp>&rsquo;</dt>
  4553. <dd><p>ignore decoding errors, and continue decoding.
  4554. This is useful if you want to analyze the content of a video and thus want
  4555. everything to be decoded no matter what. This option will not result in a video
  4556. that is pleasing to watch in case of errors.
  4557. </p></dd>
  4558. <dt>&lsquo;<samp class="samp">careful</samp>&rsquo;</dt>
  4559. <dd><p>consider things that violate the spec and have not been seen in the wild as errors
  4560. </p></dd>
  4561. <dt>&lsquo;<samp class="samp">compliant</samp>&rsquo;</dt>
  4562. <dd><p>consider all spec non compliancies as errors
  4563. </p></dd>
  4564. <dt>&lsquo;<samp class="samp">aggressive</samp>&rsquo;</dt>
  4565. <dd><p>consider things that a sane encoder should not do as an error
  4566. </p></dd>
  4567. </dl>
  4568. </dd>
  4569. <dt><samp class="option">has_b_frames <var class="var">integer</var></samp></dt>
  4570. <dt><samp class="option">block_align <var class="var">integer</var></samp></dt>
  4571. <dt><samp class="option">rc_override_count <var class="var">integer</var></samp></dt>
  4572. <dt><samp class="option">maxrate <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  4573. <dd><p>Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
  4574. </p>
  4575. </dd>
  4576. <dt><samp class="option">minrate <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  4577. <dd><p>Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
  4578. encode. It is of little use elsewise.
  4579. </p>
  4580. </dd>
  4581. <dt><samp class="option">bufsize <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  4582. <dd><p>Set ratecontrol buffer size (in bits).
  4583. </p>
  4584. </dd>
  4585. <dt><samp class="option">i_qfactor <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4586. <dd><p>Set QP factor between P and I frames.
  4587. </p>
  4588. </dd>
  4589. <dt><samp class="option">i_qoffset <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4590. <dd><p>Set QP offset between P and I frames.
  4591. </p>
  4592. </dd>
  4593. <dt><samp class="option">dct <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4594. <dd><p>Set DCT algorithm.
  4595. </p>
  4596. <p>Possible values:
  4597. </p><dl class="table">
  4598. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  4599. <dd><p>autoselect a good one (default)
  4600. </p></dd>
  4601. <dt>&lsquo;<samp class="samp">fastint</samp>&rsquo;</dt>
  4602. <dd><p>fast integer
  4603. </p></dd>
  4604. <dt>&lsquo;<samp class="samp">int</samp>&rsquo;</dt>
  4605. <dd><p>accurate integer
  4606. </p></dd>
  4607. <dt>&lsquo;<samp class="samp">mmx</samp>&rsquo;</dt>
  4608. <dt>&lsquo;<samp class="samp">altivec</samp>&rsquo;</dt>
  4609. <dt>&lsquo;<samp class="samp">faan</samp>&rsquo;</dt>
  4610. <dd><p>floating point AAN DCT
  4611. </p></dd>
  4612. </dl>
  4613. </dd>
  4614. <dt><samp class="option">lumi_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4615. <dd><p>Compress bright areas stronger than medium ones.
  4616. </p>
  4617. </dd>
  4618. <dt><samp class="option">tcplx_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4619. <dd><p>Set temporal complexity masking.
  4620. </p>
  4621. </dd>
  4622. <dt><samp class="option">scplx_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4623. <dd><p>Set spatial complexity masking.
  4624. </p>
  4625. </dd>
  4626. <dt><samp class="option">p_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4627. <dd><p>Set inter masking.
  4628. </p>
  4629. </dd>
  4630. <dt><samp class="option">dark_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4631. <dd><p>Compress dark areas stronger than medium ones.
  4632. </p>
  4633. </dd>
  4634. <dt><samp class="option">idct <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  4635. <dd><p>Select IDCT implementation.
  4636. </p>
  4637. <p>Possible values:
  4638. </p><dl class="table">
  4639. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  4640. <dt>&lsquo;<samp class="samp">int</samp>&rsquo;</dt>
  4641. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  4642. <dt>&lsquo;<samp class="samp">simplemmx</samp>&rsquo;</dt>
  4643. <dt>&lsquo;<samp class="samp">simpleauto</samp>&rsquo;</dt>
  4644. <dd><p>Automatically pick a IDCT compatible with the simple one
  4645. </p>
  4646. </dd>
  4647. <dt>&lsquo;<samp class="samp">arm</samp>&rsquo;</dt>
  4648. <dt>&lsquo;<samp class="samp">altivec</samp>&rsquo;</dt>
  4649. <dt>&lsquo;<samp class="samp">sh4</samp>&rsquo;</dt>
  4650. <dt>&lsquo;<samp class="samp">simplearm</samp>&rsquo;</dt>
  4651. <dt>&lsquo;<samp class="samp">simplearmv5te</samp>&rsquo;</dt>
  4652. <dt>&lsquo;<samp class="samp">simplearmv6</samp>&rsquo;</dt>
  4653. <dt>&lsquo;<samp class="samp">simpleneon</samp>&rsquo;</dt>
  4654. <dt>&lsquo;<samp class="samp">xvid</samp>&rsquo;</dt>
  4655. <dt>&lsquo;<samp class="samp">faani</samp>&rsquo;</dt>
  4656. <dd><p>floating point AAN IDCT
  4657. </p></dd>
  4658. </dl>
  4659. </dd>
  4660. <dt><samp class="option">slice_count <var class="var">integer</var></samp></dt>
  4661. <dt><samp class="option">ec <var class="var">flags</var> (<em class="emph">decoding,video</em>)</samp></dt>
  4662. <dd><p>Set error concealment strategy.
  4663. </p>
  4664. <p>Possible values:
  4665. </p><dl class="table">
  4666. <dt>&lsquo;<samp class="samp">guess_mvs</samp>&rsquo;</dt>
  4667. <dd><p>iterative motion vector (MV) search (slow)
  4668. </p></dd>
  4669. <dt>&lsquo;<samp class="samp">deblock</samp>&rsquo;</dt>
  4670. <dd><p>use strong deblock filter for damaged MBs
  4671. </p></dd>
  4672. <dt>&lsquo;<samp class="samp">favor_inter</samp>&rsquo;</dt>
  4673. <dd><p>favor predicting from the previous frame instead of the current
  4674. </p></dd>
  4675. </dl>
  4676. </dd>
  4677. <dt><samp class="option">bits_per_coded_sample <var class="var">integer</var></samp></dt>
  4678. <dt><samp class="option">aspect <var class="var">rational number</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4679. <dd><p>Set sample aspect ratio.
  4680. </p>
  4681. </dd>
  4682. <dt><samp class="option">sar <var class="var">rational number</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4683. <dd><p>Set sample aspect ratio. Alias to <var class="var">aspect</var>.
  4684. </p>
  4685. </dd>
  4686. <dt><samp class="option">debug <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  4687. <dd><p>Print specific debug info.
  4688. </p>
  4689. <p>Possible values:
  4690. </p><dl class="table">
  4691. <dt>&lsquo;<samp class="samp">pict</samp>&rsquo;</dt>
  4692. <dd><p>picture info
  4693. </p></dd>
  4694. <dt>&lsquo;<samp class="samp">rc</samp>&rsquo;</dt>
  4695. <dd><p>rate control
  4696. </p></dd>
  4697. <dt>&lsquo;<samp class="samp">bitstream</samp>&rsquo;</dt>
  4698. <dt>&lsquo;<samp class="samp">mb_type</samp>&rsquo;</dt>
  4699. <dd><p>macroblock (MB) type
  4700. </p></dd>
  4701. <dt>&lsquo;<samp class="samp">qp</samp>&rsquo;</dt>
  4702. <dd><p>per-block quantization parameter (QP)
  4703. </p></dd>
  4704. <dt>&lsquo;<samp class="samp">dct_coeff</samp>&rsquo;</dt>
  4705. <dt>&lsquo;<samp class="samp">green_metadata</samp>&rsquo;</dt>
  4706. <dd><p>display complexity metadata for the upcoming frame, GoP or for a given duration.
  4707. </p>
  4708. </dd>
  4709. <dt>&lsquo;<samp class="samp">skip</samp>&rsquo;</dt>
  4710. <dt>&lsquo;<samp class="samp">startcode</samp>&rsquo;</dt>
  4711. <dt>&lsquo;<samp class="samp">er</samp>&rsquo;</dt>
  4712. <dd><p>error recognition
  4713. </p></dd>
  4714. <dt>&lsquo;<samp class="samp">mmco</samp>&rsquo;</dt>
  4715. <dd><p>memory management control operations (H.264)
  4716. </p></dd>
  4717. <dt>&lsquo;<samp class="samp">bugs</samp>&rsquo;</dt>
  4718. <dt>&lsquo;<samp class="samp">buffers</samp>&rsquo;</dt>
  4719. <dd><p>picture buffer allocations
  4720. </p></dd>
  4721. <dt>&lsquo;<samp class="samp">thread_ops</samp>&rsquo;</dt>
  4722. <dd><p>threading operations
  4723. </p></dd>
  4724. <dt>&lsquo;<samp class="samp">nomc</samp>&rsquo;</dt>
  4725. <dd><p>skip motion compensation
  4726. </p></dd>
  4727. </dl>
  4728. </dd>
  4729. <dt><samp class="option">cmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4730. <dd><p>Set full pel me compare function.
  4731. </p>
  4732. <p>Possible values:
  4733. </p><dl class="table">
  4734. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  4735. <dd><p>sum of absolute differences, fast (default)
  4736. </p></dd>
  4737. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  4738. <dd><p>sum of squared errors
  4739. </p></dd>
  4740. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  4741. <dd><p>sum of absolute Hadamard transformed differences
  4742. </p></dd>
  4743. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  4744. <dd><p>sum of absolute DCT transformed differences
  4745. </p></dd>
  4746. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  4747. <dd><p>sum of squared quantization errors (avoid, low quality)
  4748. </p></dd>
  4749. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  4750. <dd><p>number of bits needed for the block
  4751. </p></dd>
  4752. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  4753. <dd><p>rate distortion optimal, slow
  4754. </p></dd>
  4755. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  4756. <dd><p>0
  4757. </p></dd>
  4758. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  4759. <dd><p>sum of absolute vertical differences
  4760. </p></dd>
  4761. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  4762. <dd><p>sum of squared vertical differences
  4763. </p></dd>
  4764. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  4765. <dd><p>noise preserving sum of squared differences
  4766. </p></dd>
  4767. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  4768. <dd><p>5/3 wavelet, only used in snow
  4769. </p></dd>
  4770. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  4771. <dd><p>9/7 wavelet, only used in snow
  4772. </p></dd>
  4773. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  4774. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  4775. </dl>
  4776. </dd>
  4777. <dt><samp class="option">subcmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4778. <dd><p>Set sub pel me compare function.
  4779. </p>
  4780. <p>Possible values:
  4781. </p><dl class="table">
  4782. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  4783. <dd><p>sum of absolute differences, fast (default)
  4784. </p></dd>
  4785. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  4786. <dd><p>sum of squared errors
  4787. </p></dd>
  4788. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  4789. <dd><p>sum of absolute Hadamard transformed differences
  4790. </p></dd>
  4791. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  4792. <dd><p>sum of absolute DCT transformed differences
  4793. </p></dd>
  4794. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  4795. <dd><p>sum of squared quantization errors (avoid, low quality)
  4796. </p></dd>
  4797. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  4798. <dd><p>number of bits needed for the block
  4799. </p></dd>
  4800. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  4801. <dd><p>rate distortion optimal, slow
  4802. </p></dd>
  4803. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  4804. <dd><p>0
  4805. </p></dd>
  4806. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  4807. <dd><p>sum of absolute vertical differences
  4808. </p></dd>
  4809. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  4810. <dd><p>sum of squared vertical differences
  4811. </p></dd>
  4812. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  4813. <dd><p>noise preserving sum of squared differences
  4814. </p></dd>
  4815. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  4816. <dd><p>5/3 wavelet, only used in snow
  4817. </p></dd>
  4818. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  4819. <dd><p>9/7 wavelet, only used in snow
  4820. </p></dd>
  4821. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  4822. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  4823. </dl>
  4824. </dd>
  4825. <dt><samp class="option">mbcmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4826. <dd><p>Set macroblock compare function.
  4827. </p>
  4828. <p>Possible values:
  4829. </p><dl class="table">
  4830. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  4831. <dd><p>sum of absolute differences, fast (default)
  4832. </p></dd>
  4833. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  4834. <dd><p>sum of squared errors
  4835. </p></dd>
  4836. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  4837. <dd><p>sum of absolute Hadamard transformed differences
  4838. </p></dd>
  4839. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  4840. <dd><p>sum of absolute DCT transformed differences
  4841. </p></dd>
  4842. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  4843. <dd><p>sum of squared quantization errors (avoid, low quality)
  4844. </p></dd>
  4845. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  4846. <dd><p>number of bits needed for the block
  4847. </p></dd>
  4848. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  4849. <dd><p>rate distortion optimal, slow
  4850. </p></dd>
  4851. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  4852. <dd><p>0
  4853. </p></dd>
  4854. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  4855. <dd><p>sum of absolute vertical differences
  4856. </p></dd>
  4857. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  4858. <dd><p>sum of squared vertical differences
  4859. </p></dd>
  4860. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  4861. <dd><p>noise preserving sum of squared differences
  4862. </p></dd>
  4863. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  4864. <dd><p>5/3 wavelet, only used in snow
  4865. </p></dd>
  4866. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  4867. <dd><p>9/7 wavelet, only used in snow
  4868. </p></dd>
  4869. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  4870. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  4871. </dl>
  4872. </dd>
  4873. <dt><samp class="option">ildctcmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4874. <dd><p>Set interlaced dct compare function.
  4875. </p>
  4876. <p>Possible values:
  4877. </p><dl class="table">
  4878. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  4879. <dd><p>sum of absolute differences, fast (default)
  4880. </p></dd>
  4881. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  4882. <dd><p>sum of squared errors
  4883. </p></dd>
  4884. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  4885. <dd><p>sum of absolute Hadamard transformed differences
  4886. </p></dd>
  4887. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  4888. <dd><p>sum of absolute DCT transformed differences
  4889. </p></dd>
  4890. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  4891. <dd><p>sum of squared quantization errors (avoid, low quality)
  4892. </p></dd>
  4893. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  4894. <dd><p>number of bits needed for the block
  4895. </p></dd>
  4896. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  4897. <dd><p>rate distortion optimal, slow
  4898. </p></dd>
  4899. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  4900. <dd><p>0
  4901. </p></dd>
  4902. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  4903. <dd><p>sum of absolute vertical differences
  4904. </p></dd>
  4905. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  4906. <dd><p>sum of squared vertical differences
  4907. </p></dd>
  4908. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  4909. <dd><p>noise preserving sum of squared differences
  4910. </p></dd>
  4911. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  4912. <dd><p>5/3 wavelet, only used in snow
  4913. </p></dd>
  4914. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  4915. <dd><p>9/7 wavelet, only used in snow
  4916. </p></dd>
  4917. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  4918. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  4919. </dl>
  4920. </dd>
  4921. <dt><samp class="option">dia_size <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4922. <dd><p>Set diamond type &amp; size for motion estimation.
  4923. </p><dl class="table">
  4924. <dt>&lsquo;<samp class="samp">(1024, INT_MAX)</samp>&rsquo;</dt>
  4925. <dd><p>full motion estimation(slowest)
  4926. </p></dd>
  4927. <dt>&lsquo;<samp class="samp">(768, 1024]</samp>&rsquo;</dt>
  4928. <dd><p>umh motion estimation
  4929. </p></dd>
  4930. <dt>&lsquo;<samp class="samp">(512, 768]</samp>&rsquo;</dt>
  4931. <dd><p>hex motion estimation
  4932. </p></dd>
  4933. <dt>&lsquo;<samp class="samp">(256, 512]</samp>&rsquo;</dt>
  4934. <dd><p>l2s diamond motion estimation
  4935. </p></dd>
  4936. <dt>&lsquo;<samp class="samp">[2,256]</samp>&rsquo;</dt>
  4937. <dd><p>var diamond motion estimation
  4938. </p></dd>
  4939. <dt>&lsquo;<samp class="samp">(-1, 2)</samp>&rsquo;</dt>
  4940. <dd><p>small diamond motion estimation
  4941. </p></dd>
  4942. <dt>&lsquo;<samp class="samp">-1</samp>&rsquo;</dt>
  4943. <dd><p>funny diamond motion estimation
  4944. </p></dd>
  4945. <dt>&lsquo;<samp class="samp">(INT_MIN, -1)</samp>&rsquo;</dt>
  4946. <dd><p>sab diamond motion estimation
  4947. </p></dd>
  4948. </dl>
  4949. </dd>
  4950. <dt><samp class="option">last_pred <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4951. <dd><p>Set amount of motion predictors from the previous frame.
  4952. </p>
  4953. </dd>
  4954. <dt><samp class="option">precmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  4955. <dd><p>Set pre motion estimation compare function.
  4956. </p>
  4957. <p>Possible values:
  4958. </p><dl class="table">
  4959. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  4960. <dd><p>sum of absolute differences, fast (default)
  4961. </p></dd>
  4962. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  4963. <dd><p>sum of squared errors
  4964. </p></dd>
  4965. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  4966. <dd><p>sum of absolute Hadamard transformed differences
  4967. </p></dd>
  4968. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  4969. <dd><p>sum of absolute DCT transformed differences
  4970. </p></dd>
  4971. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  4972. <dd><p>sum of squared quantization errors (avoid, low quality)
  4973. </p></dd>
  4974. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  4975. <dd><p>number of bits needed for the block
  4976. </p></dd>
  4977. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  4978. <dd><p>rate distortion optimal, slow
  4979. </p></dd>
  4980. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  4981. <dd><p>0
  4982. </p></dd>
  4983. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  4984. <dd><p>sum of absolute vertical differences
  4985. </p></dd>
  4986. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  4987. <dd><p>sum of squared vertical differences
  4988. </p></dd>
  4989. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  4990. <dd><p>noise preserving sum of squared differences
  4991. </p></dd>
  4992. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  4993. <dd><p>5/3 wavelet, only used in snow
  4994. </p></dd>
  4995. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  4996. <dd><p>9/7 wavelet, only used in snow
  4997. </p></dd>
  4998. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  4999. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  5000. </dl>
  5001. </dd>
  5002. <dt><samp class="option">pre_dia_size <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5003. <dd><p>Set diamond type &amp; size for motion estimation pre-pass.
  5004. </p>
  5005. </dd>
  5006. <dt><samp class="option">subq <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5007. <dd><p>Set sub pel motion estimation quality.
  5008. </p>
  5009. </dd>
  5010. <dt><samp class="option">me_range <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5011. <dd><p>Set limit motion vectors range (1023 for DivX player).
  5012. </p>
  5013. </dd>
  5014. <dt><samp class="option">global_quality <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  5015. <dt><samp class="option">slice_flags <var class="var">integer</var></samp></dt>
  5016. <dt><samp class="option">mbd <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5017. <dd><p>Set macroblock decision algorithm (high quality mode).
  5018. </p>
  5019. <p>Possible values:
  5020. </p><dl class="table">
  5021. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  5022. <dd><p>use mbcmp (default)
  5023. </p></dd>
  5024. <dt>&lsquo;<samp class="samp">bits</samp>&rsquo;</dt>
  5025. <dd><p>use fewest bits
  5026. </p></dd>
  5027. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  5028. <dd><p>use best rate distortion
  5029. </p></dd>
  5030. </dl>
  5031. </dd>
  5032. <dt><samp class="option">rc_init_occupancy <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5033. <dd><p>Set number of bits which should be loaded into the rc buffer before
  5034. decoding starts.
  5035. </p>
  5036. </dd>
  5037. <dt><samp class="option">flags2 <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  5038. <dd>
  5039. <p>Possible values:
  5040. </p><dl class="table">
  5041. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  5042. <dd><p>Allow non spec compliant speedup tricks.
  5043. </p></dd>
  5044. <dt>&lsquo;<samp class="samp">noout</samp>&rsquo;</dt>
  5045. <dd><p>Skip bitstream encoding.
  5046. </p></dd>
  5047. <dt>&lsquo;<samp class="samp">ignorecrop</samp>&rsquo;</dt>
  5048. <dd><p>Ignore cropping information from sps.
  5049. </p></dd>
  5050. <dt>&lsquo;<samp class="samp">local_header</samp>&rsquo;</dt>
  5051. <dd><p>Place global headers at every keyframe instead of in extradata.
  5052. </p></dd>
  5053. <dt>&lsquo;<samp class="samp">chunks</samp>&rsquo;</dt>
  5054. <dd><p>Frame data might be split into multiple chunks.
  5055. </p></dd>
  5056. <dt>&lsquo;<samp class="samp">showall</samp>&rsquo;</dt>
  5057. <dd><p>Show all frames before the first keyframe.
  5058. </p></dd>
  5059. <dt>&lsquo;<samp class="samp">export_mvs</samp>&rsquo;</dt>
  5060. <dd><p>Export motion vectors into frame side-data (see <code class="code">AV_FRAME_DATA_MOTION_VECTORS</code>)
  5061. for codecs that support it. See also <samp class="file">doc/examples/export_mvs.c</samp>.
  5062. </p></dd>
  5063. <dt>&lsquo;<samp class="samp">skip_manual</samp>&rsquo;</dt>
  5064. <dd><p>Do not skip samples and export skip information as frame side data.
  5065. </p></dd>
  5066. <dt>&lsquo;<samp class="samp">ass_ro_flush_noop</samp>&rsquo;</dt>
  5067. <dd><p>Do not reset ASS ReadOrder field on flush.
  5068. </p></dd>
  5069. <dt>&lsquo;<samp class="samp">icc_profiles</samp>&rsquo;</dt>
  5070. <dd><p>Generate/parse embedded ICC profiles from/to colorimetry tags.
  5071. </p></dd>
  5072. </dl>
  5073. </dd>
  5074. <dt><samp class="option">export_side_data <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  5075. <dd>
  5076. <p>Possible values:
  5077. </p><dl class="table">
  5078. <dt>&lsquo;<samp class="samp">mvs</samp>&rsquo;</dt>
  5079. <dd><p>Export motion vectors into frame side-data (see <code class="code">AV_FRAME_DATA_MOTION_VECTORS</code>)
  5080. for codecs that support it. See also <samp class="file">doc/examples/export_mvs.c</samp>.
  5081. </p></dd>
  5082. <dt>&lsquo;<samp class="samp">prft</samp>&rsquo;</dt>
  5083. <dd><p>Export encoder Producer Reference Time into packet side-data (see <code class="code">AV_PKT_DATA_PRFT</code>)
  5084. for codecs that support it.
  5085. </p></dd>
  5086. <dt>&lsquo;<samp class="samp">venc_params</samp>&rsquo;</dt>
  5087. <dd><p>Export video encoding parameters through frame side data (see <code class="code">AV_FRAME_DATA_VIDEO_ENC_PARAMS</code>)
  5088. for codecs that support it. At present, those are H.264 and VP9.
  5089. </p></dd>
  5090. <dt>&lsquo;<samp class="samp">film_grain</samp>&rsquo;</dt>
  5091. <dd><p>Export film grain parameters through frame side data (see <code class="code">AV_FRAME_DATA_FILM_GRAIN_PARAMS</code>).
  5092. Supported at present by AV1 decoders.
  5093. </p></dd>
  5094. </dl>
  5095. </dd>
  5096. <dt><samp class="option">threads <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5097. <dd><p>Set the number of threads to be used, in case the selected codec
  5098. implementation supports multi-threading.
  5099. </p>
  5100. <p>Possible values:
  5101. </p><dl class="table">
  5102. <dt>&lsquo;<samp class="samp">auto, 0</samp>&rsquo;</dt>
  5103. <dd><p>automatically select the number of threads to set
  5104. </p></dd>
  5105. </dl>
  5106. <p>Default value is &lsquo;<samp class="samp">auto</samp>&rsquo;.
  5107. </p>
  5108. </dd>
  5109. <dt><samp class="option">dc <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5110. <dd><p>Set intra_dc_precision.
  5111. </p>
  5112. </dd>
  5113. <dt><samp class="option">nssew <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5114. <dd><p>Set nsse weight.
  5115. </p>
  5116. </dd>
  5117. <dt><samp class="option">skip_top <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5118. <dd><p>Set number of macroblock rows at the top which are skipped.
  5119. </p>
  5120. </dd>
  5121. <dt><samp class="option">skip_bottom <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5122. <dd><p>Set number of macroblock rows at the bottom which are skipped.
  5123. </p>
  5124. </dd>
  5125. <dt><samp class="option">profile <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  5126. <dd>
  5127. <p>Set encoder codec profile. Default value is &lsquo;<samp class="samp">unknown</samp>&rsquo;. Encoder specific
  5128. profiles are documented in the relevant encoder documentation.
  5129. </p>
  5130. </dd>
  5131. <dt><samp class="option">level <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  5132. <dd>
  5133. <p>Set the encoder level. This level depends on the specific codec, and
  5134. might correspond to the profile level. It is set by default to
  5135. &lsquo;<samp class="samp">unknown</samp>&rsquo;.
  5136. </p>
  5137. <p>Possible values:
  5138. </p><dl class="table">
  5139. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  5140. </dl>
  5141. </dd>
  5142. <dt><samp class="option">lowres <var class="var">integer</var> (<em class="emph">decoding,audio,video</em>)</samp></dt>
  5143. <dd><p>Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
  5144. </p>
  5145. </dd>
  5146. <dt><samp class="option">mblmin <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5147. <dd><p>Set min macroblock lagrange factor (VBR).
  5148. </p>
  5149. </dd>
  5150. <dt><samp class="option">mblmax <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5151. <dd><p>Set max macroblock lagrange factor (VBR).
  5152. </p>
  5153. </dd>
  5154. <dt><samp class="option">skip_loop_filter <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5155. <dt><samp class="option">skip_idct <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5156. <dt><samp class="option">skip_frame <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5157. <dd>
  5158. <p>Make decoder discard processing depending on the frame type selected
  5159. by the option value.
  5160. </p>
  5161. <p><samp class="option">skip_loop_filter</samp> skips frame loop filtering, <samp class="option">skip_idct</samp>
  5162. skips frame IDCT/dequantization, <samp class="option">skip_frame</samp> skips decoding.
  5163. </p>
  5164. <p>Possible values:
  5165. </p><dl class="table">
  5166. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  5167. <dd><p>Discard no frame.
  5168. </p>
  5169. </dd>
  5170. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  5171. <dd><p>Discard useless frames like 0-sized frames.
  5172. </p>
  5173. </dd>
  5174. <dt>&lsquo;<samp class="samp">noref</samp>&rsquo;</dt>
  5175. <dd><p>Discard all non-reference frames.
  5176. </p>
  5177. </dd>
  5178. <dt>&lsquo;<samp class="samp">bidir</samp>&rsquo;</dt>
  5179. <dd><p>Discard all bidirectional frames.
  5180. </p>
  5181. </dd>
  5182. <dt>&lsquo;<samp class="samp">nokey</samp>&rsquo;</dt>
  5183. <dd><p>Discard all frames excepts keyframes.
  5184. </p>
  5185. </dd>
  5186. <dt>&lsquo;<samp class="samp">nointra</samp>&rsquo;</dt>
  5187. <dd><p>Discard all frames except I frames.
  5188. </p>
  5189. </dd>
  5190. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  5191. <dd><p>Discard all frames.
  5192. </p></dd>
  5193. </dl>
  5194. <p>Default value is &lsquo;<samp class="samp">default</samp>&rsquo;.
  5195. </p>
  5196. </dd>
  5197. <dt><samp class="option">bidir_refine <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5198. <dd><p>Refine the two motion vectors used in bidirectional macroblocks.
  5199. </p>
  5200. </dd>
  5201. <dt><samp class="option">keyint_min <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5202. <dd><p>Set minimum interval between IDR-frames.
  5203. </p>
  5204. </dd>
  5205. <dt><samp class="option">refs <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5206. <dd><p>Set reference frames to consider for motion compensation.
  5207. </p>
  5208. </dd>
  5209. <dt><samp class="option">trellis <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  5210. <dd><p>Set rate-distortion optimal quantization.
  5211. </p>
  5212. </dd>
  5213. <dt><samp class="option">mv0_threshold <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5214. <dt><samp class="option">compression_level <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  5215. <dt><samp class="option">bits_per_raw_sample <var class="var">integer</var></samp></dt>
  5216. <dt><samp class="option">channel_layout <var class="var">integer</var> (<em class="emph">decoding/encoding,audio</em>)</samp></dt>
  5217. <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>
  5218. for the required syntax.
  5219. </p>
  5220. </dd>
  5221. <dt><samp class="option">rc_max_vbv_use <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5222. <dt><samp class="option">rc_min_vbv_use <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5223. <dt><samp class="option">color_primaries <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5224. <dd><p>Possible values:
  5225. </p><dl class="table">
  5226. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  5227. <dd><p>BT.709
  5228. </p></dd>
  5229. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  5230. <dd><p>BT.470 M
  5231. </p></dd>
  5232. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  5233. <dd><p>BT.470 BG
  5234. </p></dd>
  5235. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  5236. <dd><p>SMPTE 170 M
  5237. </p></dd>
  5238. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  5239. <dd><p>SMPTE 240 M
  5240. </p></dd>
  5241. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  5242. <dd><p>Film
  5243. </p></dd>
  5244. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  5245. <dd><p>BT.2020
  5246. </p></dd>
  5247. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  5248. <dt>&lsquo;<samp class="samp">smpte428_1</samp>&rsquo;</dt>
  5249. <dd><p>SMPTE ST 428-1
  5250. </p></dd>
  5251. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  5252. <dd><p>SMPTE 431-2
  5253. </p></dd>
  5254. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  5255. <dd><p>SMPTE 432-1
  5256. </p></dd>
  5257. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  5258. <dd><p>JEDEC P22
  5259. </p></dd>
  5260. </dl>
  5261. </dd>
  5262. <dt><samp class="option">color_trc <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5263. <dd><p>Possible values:
  5264. </p><dl class="table">
  5265. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  5266. <dd><p>BT.709
  5267. </p></dd>
  5268. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  5269. <dd><p>BT.470 M
  5270. </p></dd>
  5271. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  5272. <dd><p>BT.470 BG
  5273. </p></dd>
  5274. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  5275. <dd><p>SMPTE 170 M
  5276. </p></dd>
  5277. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  5278. <dd><p>SMPTE 240 M
  5279. </p></dd>
  5280. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  5281. <dd><p>Linear
  5282. </p></dd>
  5283. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  5284. <dt>&lsquo;<samp class="samp">log100</samp>&rsquo;</dt>
  5285. <dd><p>Log
  5286. </p></dd>
  5287. <dt>&lsquo;<samp class="samp">log_sqrt</samp>&rsquo;</dt>
  5288. <dt>&lsquo;<samp class="samp">log316</samp>&rsquo;</dt>
  5289. <dd><p>Log square root
  5290. </p></dd>
  5291. <dt>&lsquo;<samp class="samp">iec61966_2_4</samp>&rsquo;</dt>
  5292. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  5293. <dd><p>IEC 61966-2-4
  5294. </p></dd>
  5295. <dt>&lsquo;<samp class="samp">bt1361</samp>&rsquo;</dt>
  5296. <dt>&lsquo;<samp class="samp">bt1361e</samp>&rsquo;</dt>
  5297. <dd><p>BT.1361
  5298. </p></dd>
  5299. <dt>&lsquo;<samp class="samp">iec61966_2_1</samp>&rsquo;</dt>
  5300. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  5301. <dd><p>IEC 61966-2-1
  5302. </p></dd>
  5303. <dt>&lsquo;<samp class="samp">bt2020_10</samp>&rsquo;</dt>
  5304. <dt>&lsquo;<samp class="samp">bt2020_10bit</samp>&rsquo;</dt>
  5305. <dd><p>BT.2020 - 10 bit
  5306. </p></dd>
  5307. <dt>&lsquo;<samp class="samp">bt2020_12</samp>&rsquo;</dt>
  5308. <dt>&lsquo;<samp class="samp">bt2020_12bit</samp>&rsquo;</dt>
  5309. <dd><p>BT.2020 - 12 bit
  5310. </p></dd>
  5311. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  5312. <dd><p>SMPTE ST 2084
  5313. </p></dd>
  5314. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  5315. <dt>&lsquo;<samp class="samp">smpte428_1</samp>&rsquo;</dt>
  5316. <dd><p>SMPTE ST 428-1
  5317. </p></dd>
  5318. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  5319. <dd><p>ARIB STD-B67
  5320. </p></dd>
  5321. </dl>
  5322. </dd>
  5323. <dt><samp class="option">colorspace <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5324. <dd><p>Possible values:
  5325. </p><dl class="table">
  5326. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  5327. <dd><p>RGB
  5328. </p></dd>
  5329. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  5330. <dd><p>BT.709
  5331. </p></dd>
  5332. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  5333. <dd><p>FCC
  5334. </p></dd>
  5335. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  5336. <dd><p>BT.470 BG
  5337. </p></dd>
  5338. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  5339. <dd><p>SMPTE 170 M
  5340. </p></dd>
  5341. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  5342. <dd><p>SMPTE 240 M
  5343. </p></dd>
  5344. <dt>&lsquo;<samp class="samp">ycocg</samp>&rsquo;</dt>
  5345. <dd><p>YCOCG
  5346. </p></dd>
  5347. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  5348. <dt>&lsquo;<samp class="samp">bt2020_ncl</samp>&rsquo;</dt>
  5349. <dd><p>BT.2020 NCL
  5350. </p></dd>
  5351. <dt>&lsquo;<samp class="samp">bt2020c</samp>&rsquo;</dt>
  5352. <dt>&lsquo;<samp class="samp">bt2020_cl</samp>&rsquo;</dt>
  5353. <dd><p>BT.2020 CL
  5354. </p></dd>
  5355. <dt>&lsquo;<samp class="samp">smpte2085</samp>&rsquo;</dt>
  5356. <dd><p>SMPTE 2085
  5357. </p></dd>
  5358. <dt>&lsquo;<samp class="samp">chroma-derived-nc</samp>&rsquo;</dt>
  5359. <dd><p>Chroma-derived NCL
  5360. </p></dd>
  5361. <dt>&lsquo;<samp class="samp">chroma-derived-c</samp>&rsquo;</dt>
  5362. <dd><p>Chroma-derived CL
  5363. </p></dd>
  5364. <dt>&lsquo;<samp class="samp">ictcp</samp>&rsquo;</dt>
  5365. <dd><p>ICtCp
  5366. </p></dd>
  5367. </dl>
  5368. </dd>
  5369. <dt><samp class="option">color_range <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5370. <dd><p>If used as input parameter, it serves as a hint to the decoder, which
  5371. color_range the input has.
  5372. Possible values:
  5373. </p><dl class="table">
  5374. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  5375. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  5376. <dt>&lsquo;<samp class="samp">limited</samp>&rsquo;</dt>
  5377. <dd><p>MPEG (219*2^(n-8))
  5378. </p></dd>
  5379. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  5380. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  5381. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  5382. <dd><p>JPEG (2^n-1)
  5383. </p></dd>
  5384. </dl>
  5385. </dd>
  5386. <dt><samp class="option">chroma_sample_location <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5387. <dd><p>Possible values:
  5388. </p><dl class="table">
  5389. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  5390. <dt>&lsquo;<samp class="samp">center</samp>&rsquo;</dt>
  5391. <dt>&lsquo;<samp class="samp">topleft</samp>&rsquo;</dt>
  5392. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  5393. <dt>&lsquo;<samp class="samp">bottomleft</samp>&rsquo;</dt>
  5394. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  5395. </dl>
  5396. </dd>
  5397. <dt><samp class="option">log_level_offset <var class="var">integer</var></samp></dt>
  5398. <dd><p>Set the log level offset.
  5399. </p>
  5400. </dd>
  5401. <dt><samp class="option">slices <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  5402. <dd><p>Number of slices, used in parallelized encoding.
  5403. </p>
  5404. </dd>
  5405. <dt><samp class="option">thread_type <var class="var">flags</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5406. <dd><p>Select which multithreading methods to use.
  5407. </p>
  5408. <p>Use of &lsquo;<samp class="samp">frame</samp>&rsquo; will increase decoding delay by one frame per
  5409. thread, so clients which cannot provide future frames should not use
  5410. it.
  5411. </p>
  5412. <p>Possible values:
  5413. </p><dl class="table">
  5414. <dt>&lsquo;<samp class="samp">slice</samp>&rsquo;</dt>
  5415. <dd><p>Decode more than one part of a single frame at once.
  5416. </p>
  5417. <p>Multithreading using slices works only when the video was encoded with
  5418. slices.
  5419. </p>
  5420. </dd>
  5421. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  5422. <dd><p>Decode more than one frame at once.
  5423. </p></dd>
  5424. </dl>
  5425. <p>Default value is &lsquo;<samp class="samp">slice+frame</samp>&rsquo;.
  5426. </p>
  5427. </dd>
  5428. <dt><samp class="option">audio_service_type <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  5429. <dd><p>Set audio service type.
  5430. </p>
  5431. <p>Possible values:
  5432. </p><dl class="table">
  5433. <dt>&lsquo;<samp class="samp">ma</samp>&rsquo;</dt>
  5434. <dd><p>Main Audio Service
  5435. </p></dd>
  5436. <dt>&lsquo;<samp class="samp">ef</samp>&rsquo;</dt>
  5437. <dd><p>Effects
  5438. </p></dd>
  5439. <dt>&lsquo;<samp class="samp">vi</samp>&rsquo;</dt>
  5440. <dd><p>Visually Impaired
  5441. </p></dd>
  5442. <dt>&lsquo;<samp class="samp">hi</samp>&rsquo;</dt>
  5443. <dd><p>Hearing Impaired
  5444. </p></dd>
  5445. <dt>&lsquo;<samp class="samp">di</samp>&rsquo;</dt>
  5446. <dd><p>Dialogue
  5447. </p></dd>
  5448. <dt>&lsquo;<samp class="samp">co</samp>&rsquo;</dt>
  5449. <dd><p>Commentary
  5450. </p></dd>
  5451. <dt>&lsquo;<samp class="samp">em</samp>&rsquo;</dt>
  5452. <dd><p>Emergency
  5453. </p></dd>
  5454. <dt>&lsquo;<samp class="samp">vo</samp>&rsquo;</dt>
  5455. <dd><p>Voice Over
  5456. </p></dd>
  5457. <dt>&lsquo;<samp class="samp">ka</samp>&rsquo;</dt>
  5458. <dd><p>Karaoke
  5459. </p></dd>
  5460. </dl>
  5461. </dd>
  5462. <dt><samp class="option">request_sample_fmt <var class="var">sample_fmt</var> (<em class="emph">decoding,audio</em>)</samp></dt>
  5463. <dd><p>Set sample format audio decoders should prefer. Default value is
  5464. <code class="code">none</code>.
  5465. </p>
  5466. </dd>
  5467. <dt><samp class="option">pkt_timebase <var class="var">rational number</var></samp></dt>
  5468. <dt><samp class="option">sub_charenc <var class="var">encoding</var> (<em class="emph">decoding,subtitles</em>)</samp></dt>
  5469. <dd><p>Set the input subtitles character encoding.
  5470. </p>
  5471. </dd>
  5472. <dt><samp class="option">field_order <var class="var">field_order</var> (<em class="emph">video</em>)</samp></dt>
  5473. <dd><p>Set/override the field order of the video.
  5474. Possible values:
  5475. </p><dl class="table">
  5476. <dt>&lsquo;<samp class="samp">progressive</samp>&rsquo;</dt>
  5477. <dd><p>Progressive video
  5478. </p></dd>
  5479. <dt>&lsquo;<samp class="samp">tt</samp>&rsquo;</dt>
  5480. <dd><p>Interlaced video, top field coded and displayed first
  5481. </p></dd>
  5482. <dt>&lsquo;<samp class="samp">bb</samp>&rsquo;</dt>
  5483. <dd><p>Interlaced video, bottom field coded and displayed first
  5484. </p></dd>
  5485. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  5486. <dd><p>Interlaced video, top coded first, bottom displayed first
  5487. </p></dd>
  5488. <dt>&lsquo;<samp class="samp">bt</samp>&rsquo;</dt>
  5489. <dd><p>Interlaced video, bottom coded first, top displayed first
  5490. </p></dd>
  5491. </dl>
  5492. </dd>
  5493. <dt><samp class="option">skip_alpha <var class="var">bool</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5494. <dd><p>Set to 1 to disable processing alpha (transparency). This works like the
  5495. &lsquo;<samp class="samp">gray</samp>&rsquo; flag in the <samp class="option">flags</samp> option which skips chroma information
  5496. instead of alpha. Default is 0.
  5497. </p>
  5498. </dd>
  5499. <dt><samp class="option">codec_whitelist <var class="var">list</var> (<em class="emph">input</em>)</samp></dt>
  5500. <dd><p>&quot;,&quot; separated list of allowed decoders. By default all are allowed.
  5501. </p>
  5502. </dd>
  5503. <dt><samp class="option">dump_separator <var class="var">string</var> (<em class="emph">input</em>)</samp></dt>
  5504. <dd><p>Separator used to separate the fields printed on the command line about the
  5505. Stream parameters.
  5506. For example, to separate the fields with newlines and indentation:
  5507. </p><div class="example">
  5508. <pre class="example-preformatted">ffprobe -dump_separator &quot;
  5509. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  5510. </pre></div>
  5511. </dd>
  5512. <dt><samp class="option">max_pixels <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  5513. <dd><p>Maximum number of pixels per image. This value can be used to avoid out of
  5514. memory failures due to large images.
  5515. </p>
  5516. </dd>
  5517. <dt><samp class="option">apply_cropping <var class="var">bool</var> (<em class="emph">decoding,video</em>)</samp></dt>
  5518. <dd><p>Enable cropping if cropping parameters are multiples of the required
  5519. alignment for the left and top parameters. If the alignment is not met the
  5520. cropping will be partially applied to maintain alignment.
  5521. Default is 1 (enabled).
  5522. Note: The required alignment depends on if <code class="code">AV_CODEC_FLAG_UNALIGNED</code> is set and the
  5523. CPU. <code class="code">AV_CODEC_FLAG_UNALIGNED</code> cannot be changed from the command line. Also hardware
  5524. decoders will not apply left/top Cropping.
  5525. </p>
  5526. </dd>
  5527. </dl>
  5528. </div>
  5529. <div class="chapter-level-extent" id="Decoders">
  5530. <h2 class="chapter"><span>7 Decoders<a class="copiable-link" href="#Decoders"> &para;</a></span></h2>
  5531. <p>Decoders are configured elements in FFmpeg which allow the decoding of
  5532. multimedia streams.
  5533. </p>
  5534. <p>When you configure your FFmpeg build, all the supported native decoders
  5535. are enabled by default. Decoders requiring an external library must be enabled
  5536. manually via the corresponding <code class="code">--enable-lib</code> option. You can list all
  5537. available decoders using the configure option <code class="code">--list-decoders</code>.
  5538. </p>
  5539. <p>You can disable all the decoders with the configure option
  5540. <code class="code">--disable-decoders</code> and selectively enable / disable single decoders
  5541. with the options <code class="code">--enable-decoder=<var class="var">DECODER</var></code> /
  5542. <code class="code">--disable-decoder=<var class="var">DECODER</var></code>.
  5543. </p>
  5544. <p>The option <code class="code">-decoders</code> of the ff* tools will display the list of
  5545. enabled decoders.
  5546. </p>
  5547. </div>
  5548. <div class="chapter-level-extent" id="Video-Decoders">
  5549. <h2 class="chapter"><span>8 Video Decoders<a class="copiable-link" href="#Video-Decoders"> &para;</a></span></h2>
  5550. <p>A description of some of the currently available video decoders
  5551. follows.
  5552. </p>
  5553. <ul class="mini-toc">
  5554. <li><a href="#av1" accesskey="1">av1</a></li>
  5555. <li><a href="#rawvideo" accesskey="2">rawvideo</a></li>
  5556. <li><a href="#libdav1d" accesskey="3">libdav1d</a></li>
  5557. <li><a href="#libdavs2" accesskey="4">libdavs2</a></li>
  5558. <li><a href="#libuavs3d" accesskey="5">libuavs3d</a></li>
  5559. <li><a href="#libxevd" accesskey="6">libxevd</a></li>
  5560. <li><a href="#QSV-Decoders" accesskey="7">QSV Decoders</a></li>
  5561. <li><a href="#v210" accesskey="8">v210</a></li>
  5562. </ul>
  5563. <div class="section-level-extent" id="av1">
  5564. <h3 class="section"><span>8.1 av1<a class="copiable-link" href="#av1"> &para;</a></span></h3>
  5565. <p>AOMedia Video 1 (AV1) decoder.
  5566. </p>
  5567. <ul class="mini-toc">
  5568. <li><a href="#Options-1" accesskey="1">Options</a></li>
  5569. </ul>
  5570. <div class="subsection-level-extent" id="Options-1">
  5571. <h4 class="subsection"><span>8.1.1 Options<a class="copiable-link" href="#Options-1"> &para;</a></span></h4>
  5572. <dl class="table">
  5573. <dt><samp class="option">operating_point</samp></dt>
  5574. <dd><p>Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0.
  5575. </p>
  5576. </dd>
  5577. </dl>
  5578. </div>
  5579. </div>
  5580. <div class="section-level-extent" id="rawvideo">
  5581. <h3 class="section"><span>8.2 rawvideo<a class="copiable-link" href="#rawvideo"> &para;</a></span></h3>
  5582. <p>Raw video decoder.
  5583. </p>
  5584. <p>This decoder decodes rawvideo streams.
  5585. </p>
  5586. <ul class="mini-toc">
  5587. <li><a href="#Options-2" accesskey="1">Options</a></li>
  5588. </ul>
  5589. <div class="subsection-level-extent" id="Options-2">
  5590. <h4 class="subsection"><span>8.2.1 Options<a class="copiable-link" href="#Options-2"> &para;</a></span></h4>
  5591. <dl class="table">
  5592. <dt><samp class="option">top <var class="var">top_field_first</var></samp></dt>
  5593. <dd><p>Specify the assumed field type of the input video.
  5594. </p><dl class="table">
  5595. <dt><samp class="option">-1</samp></dt>
  5596. <dd><p>the video is assumed to be progressive (default)
  5597. </p></dd>
  5598. <dt><samp class="option">0</samp></dt>
  5599. <dd><p>bottom-field-first is assumed
  5600. </p></dd>
  5601. <dt><samp class="option">1</samp></dt>
  5602. <dd><p>top-field-first is assumed
  5603. </p></dd>
  5604. </dl>
  5605. </dd>
  5606. </dl>
  5607. </div>
  5608. </div>
  5609. <div class="section-level-extent" id="libdav1d">
  5610. <h3 class="section"><span>8.3 libdav1d<a class="copiable-link" href="#libdav1d"> &para;</a></span></h3>
  5611. <p>dav1d AV1 decoder.
  5612. </p>
  5613. <p>libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec.
  5614. Requires the presence of the libdav1d headers and library during configuration.
  5615. You need to explicitly configure the build with <code class="code">--enable-libdav1d</code>.
  5616. </p>
  5617. <ul class="mini-toc">
  5618. <li><a href="#Options-3" accesskey="1">Options</a></li>
  5619. </ul>
  5620. <div class="subsection-level-extent" id="Options-3">
  5621. <h4 class="subsection"><span>8.3.1 Options<a class="copiable-link" href="#Options-3"> &para;</a></span></h4>
  5622. <p>The following options are supported by the libdav1d wrapper.
  5623. </p>
  5624. <dl class="table">
  5625. <dt><samp class="option">framethreads</samp></dt>
  5626. <dd><p>Set amount of frame threads to use during decoding. The default value is 0 (autodetect).
  5627. This option is deprecated for libdav1d &gt;= 1.0 and will be removed in the future. Use the
  5628. option <code class="code">max_frame_delay</code> and the global option <code class="code">threads</code> instead.
  5629. </p>
  5630. </dd>
  5631. <dt><samp class="option">tilethreads</samp></dt>
  5632. <dd><p>Set amount of tile threads to use during decoding. The default value is 0 (autodetect).
  5633. This option is deprecated for libdav1d &gt;= 1.0 and will be removed in the future. Use the
  5634. global option <code class="code">threads</code> instead.
  5635. </p>
  5636. </dd>
  5637. <dt><samp class="option">max_frame_delay</samp></dt>
  5638. <dd><p>Set max amount of frames the decoder may buffer internally. The default value is 0
  5639. (autodetect).
  5640. </p>
  5641. </dd>
  5642. <dt><samp class="option">filmgrain</samp></dt>
  5643. <dd><p>Apply film grain to the decoded video if present in the bitstream. Defaults to the
  5644. internal default of the library.
  5645. This option is deprecated and will be removed in the future. See the global option
  5646. <code class="code">export_side_data</code> to export Film Grain parameters instead of applying it.
  5647. </p>
  5648. </dd>
  5649. <dt><samp class="option">oppoint</samp></dt>
  5650. <dd><p>Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the
  5651. internal default of the library.
  5652. </p>
  5653. </dd>
  5654. <dt><samp class="option">alllayers</samp></dt>
  5655. <dd><p>Output all spatial layers of a scalable AV1 bitstream. The default value is false.
  5656. </p>
  5657. </dd>
  5658. </dl>
  5659. </div>
  5660. </div>
  5661. <div class="section-level-extent" id="libdavs2">
  5662. <h3 class="section"><span>8.4 libdavs2<a class="copiable-link" href="#libdavs2"> &para;</a></span></h3>
  5663. <p>AVS2-P2/IEEE1857.4 video decoder wrapper.
  5664. </p>
  5665. <p>This decoder allows libavcodec to decode AVS2 streams with davs2 library.
  5666. </p>
  5667. </div>
  5668. <div class="section-level-extent" id="libuavs3d">
  5669. <h3 class="section"><span>8.5 libuavs3d<a class="copiable-link" href="#libuavs3d"> &para;</a></span></h3>
  5670. <p>AVS3-P2/IEEE1857.10 video decoder.
  5671. </p>
  5672. <p>libuavs3d allows libavcodec to decode AVS3 streams.
  5673. Requires the presence of the libuavs3d headers and library during configuration.
  5674. You need to explicitly configure the build with <code class="code">--enable-libuavs3d</code>.
  5675. </p>
  5676. <ul class="mini-toc">
  5677. <li><a href="#Options-4" accesskey="1">Options</a></li>
  5678. </ul>
  5679. <div class="subsection-level-extent" id="Options-4">
  5680. <h4 class="subsection"><span>8.5.1 Options<a class="copiable-link" href="#Options-4"> &para;</a></span></h4>
  5681. <p>The following option is supported by the libuavs3d wrapper.
  5682. </p>
  5683. <dl class="table">
  5684. <dt><samp class="option">frame_threads</samp></dt>
  5685. <dd><p>Set amount of frame threads to use during decoding. The default value is 0 (autodetect).
  5686. </p>
  5687. </dd>
  5688. </dl>
  5689. </div>
  5690. </div>
  5691. <div class="section-level-extent" id="libxevd">
  5692. <h3 class="section"><span>8.6 libxevd<a class="copiable-link" href="#libxevd"> &para;</a></span></h3>
  5693. <p>eXtra-fast Essential Video Decoder (XEVD) MPEG-5 EVC decoder wrapper.
  5694. </p>
  5695. <p>This decoder requires the presence of the libxevd headers and library
  5696. during configuration. You need to explicitly configure the build with
  5697. <samp class="option">--enable-libxevd</samp>.
  5698. </p>
  5699. <p>The xevd project website is at <a class="url" href="https://github.com/mpeg5/xevd">https://github.com/mpeg5/xevd</a>.
  5700. </p>
  5701. <ul class="mini-toc">
  5702. <li><a href="#Options-5" accesskey="1">Options</a></li>
  5703. </ul>
  5704. <div class="subsection-level-extent" id="Options-5">
  5705. <h4 class="subsection"><span>8.6.1 Options<a class="copiable-link" href="#Options-5"> &para;</a></span></h4>
  5706. <p>The following options are supported by the libxevd wrapper.
  5707. The xevd-equivalent options or values are listed in parentheses for easy migration.
  5708. </p>
  5709. <p>To get a more accurate and extensive documentation of the libxevd options,
  5710. invoke the command <code class="code">xevd_app --help</code> or consult the libxevd documentation.
  5711. </p>
  5712. <dl class="table">
  5713. <dt><samp class="option">threads (<em class="emph">threads</em>)</samp></dt>
  5714. <dd><p>Force to use a specific number of threads
  5715. </p>
  5716. </dd>
  5717. </dl>
  5718. </div>
  5719. </div>
  5720. <div class="section-level-extent" id="QSV-Decoders">
  5721. <h3 class="section"><span>8.7 QSV Decoders<a class="copiable-link" href="#QSV-Decoders"> &para;</a></span></h3>
  5722. <p>The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC,
  5723. JPEG/MJPEG, VP8, VP9, AV1).
  5724. </p>
  5725. <ul class="mini-toc">
  5726. <li><a href="#Common-Options" accesskey="1">Common Options</a></li>
  5727. <li><a href="#HEVC-Options" accesskey="2">HEVC Options</a></li>
  5728. </ul>
  5729. <div class="subsection-level-extent" id="Common-Options">
  5730. <h4 class="subsection"><span>8.7.1 Common Options<a class="copiable-link" href="#Common-Options"> &para;</a></span></h4>
  5731. <p>The following options are supported by all qsv decoders.
  5732. </p>
  5733. <dl class="table">
  5734. <dt><samp class="option"><var class="var">async_depth</var></samp></dt>
  5735. <dd><p>Internal parallelization depth, the higher the value the higher the latency.
  5736. </p>
  5737. </dd>
  5738. <dt><samp class="option"><var class="var">gpu_copy</var></samp></dt>
  5739. <dd><p>A GPU-accelerated copy between video and system memory
  5740. </p><dl class="table">
  5741. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  5742. <dt>&lsquo;<samp class="samp">on</samp>&rsquo;</dt>
  5743. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  5744. </dl>
  5745. </dd>
  5746. </dl>
  5747. </div>
  5748. <div class="subsection-level-extent" id="HEVC-Options">
  5749. <h4 class="subsection"><span>8.7.2 HEVC Options<a class="copiable-link" href="#HEVC-Options"> &para;</a></span></h4>
  5750. <p>Extra options for hevc_qsv.
  5751. </p>
  5752. <dl class="table">
  5753. <dt><samp class="option"><var class="var">load_plugin</var></samp></dt>
  5754. <dd><p>A user plugin to load in an internal session
  5755. </p><dl class="table">
  5756. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  5757. <dt>&lsquo;<samp class="samp">hevc_sw</samp>&rsquo;</dt>
  5758. <dt>&lsquo;<samp class="samp">hevc_hw</samp>&rsquo;</dt>
  5759. </dl>
  5760. </dd>
  5761. <dt><samp class="option"><var class="var">load_plugins</var></samp></dt>
  5762. <dd><p>A :-separate list of hexadecimal plugin UIDs to load in an internal session
  5763. </p>
  5764. </dd>
  5765. </dl>
  5766. </div>
  5767. </div>
  5768. <div class="section-level-extent" id="v210">
  5769. <h3 class="section"><span>8.8 v210<a class="copiable-link" href="#v210"> &para;</a></span></h3>
  5770. <p>Uncompressed 4:2:2 10-bit decoder.
  5771. </p>
  5772. <ul class="mini-toc">
  5773. <li><a href="#Options-6" accesskey="1">Options</a></li>
  5774. </ul>
  5775. <div class="subsection-level-extent" id="Options-6">
  5776. <h4 class="subsection"><span>8.8.1 Options<a class="copiable-link" href="#Options-6"> &para;</a></span></h4>
  5777. <dl class="table">
  5778. <dt><samp class="option">custom_stride</samp></dt>
  5779. <dd><p>Set the line size of the v210 data in bytes. The default value is 0
  5780. (autodetect). You can use the special -1 value for a strideless v210 as seen in
  5781. BOXX files.
  5782. </p>
  5783. </dd>
  5784. </dl>
  5785. </div>
  5786. </div>
  5787. </div>
  5788. <div class="chapter-level-extent" id="Audio-Decoders">
  5789. <h2 class="chapter"><span>9 Audio Decoders<a class="copiable-link" href="#Audio-Decoders"> &para;</a></span></h2>
  5790. <p>A description of some of the currently available audio decoders
  5791. follows.
  5792. </p>
  5793. <ul class="mini-toc">
  5794. <li><a href="#ac3" accesskey="1">ac3</a></li>
  5795. <li><a href="#flac" accesskey="2">flac</a></li>
  5796. <li><a href="#ffwavesynth" accesskey="3">ffwavesynth</a></li>
  5797. <li><a href="#libcelt" accesskey="4">libcelt</a></li>
  5798. <li><a href="#libgsm" accesskey="5">libgsm</a></li>
  5799. <li><a href="#libilbc" accesskey="6">libilbc</a></li>
  5800. <li><a href="#libopencore_002damrnb" accesskey="7">libopencore-amrnb</a></li>
  5801. <li><a href="#libopencore_002damrwb" accesskey="8">libopencore-amrwb</a></li>
  5802. <li><a href="#libopus" accesskey="9">libopus</a></li>
  5803. </ul>
  5804. <div class="section-level-extent" id="ac3">
  5805. <h3 class="section"><span>9.1 ac3<a class="copiable-link" href="#ac3"> &para;</a></span></h3>
  5806. <p>AC-3 audio decoder.
  5807. </p>
  5808. <p>This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  5809. the undocumented RealAudio 3 (a.k.a. dnet).
  5810. </p>
  5811. <ul class="mini-toc">
  5812. <li><a href="#AC_002d3-Decoder-Options" accesskey="1">AC-3 Decoder Options</a></li>
  5813. </ul>
  5814. <div class="subsection-level-extent" id="AC_002d3-Decoder-Options">
  5815. <h4 class="subsection"><span>9.1.1 AC-3 Decoder Options<a class="copiable-link" href="#AC_002d3-Decoder-Options"> &para;</a></span></h4>
  5816. <dl class="table">
  5817. <dt><samp class="option">-drc_scale <var class="var">value</var></samp></dt>
  5818. <dd><p>Dynamic Range Scale Factor. The factor to apply to dynamic range values
  5819. from the AC-3 stream. This factor is applied exponentially. The default value is 1.
  5820. There are 3 notable scale factor ranges:
  5821. </p><dl class="table">
  5822. <dt><samp class="option">drc_scale == 0</samp></dt>
  5823. <dd><p>DRC disabled. Produces full range audio.
  5824. </p></dd>
  5825. <dt><samp class="option">0 &lt; drc_scale &lt;= 1</samp></dt>
  5826. <dd><p>DRC enabled. Applies a fraction of the stream DRC value.
  5827. Audio reproduction is between full range and full compression.
  5828. </p></dd>
  5829. <dt><samp class="option">drc_scale &gt; 1</samp></dt>
  5830. <dd><p>DRC enabled. Applies drc_scale asymmetrically.
  5831. Loud sounds are fully compressed. Soft sounds are enhanced.
  5832. </p></dd>
  5833. </dl>
  5834. </dd>
  5835. </dl>
  5836. </div>
  5837. </div>
  5838. <div class="section-level-extent" id="flac">
  5839. <h3 class="section"><span>9.2 flac<a class="copiable-link" href="#flac"> &para;</a></span></h3>
  5840. <p>FLAC audio decoder.
  5841. </p>
  5842. <p>This decoder aims to implement the complete FLAC specification from Xiph.
  5843. </p>
  5844. <ul class="mini-toc">
  5845. <li><a href="#FLAC-Decoder-options" accesskey="1">FLAC Decoder options</a></li>
  5846. </ul>
  5847. <div class="subsection-level-extent" id="FLAC-Decoder-options">
  5848. <h4 class="subsection"><span>9.2.1 FLAC Decoder options<a class="copiable-link" href="#FLAC-Decoder-options"> &para;</a></span></h4>
  5849. <dl class="table">
  5850. <dt><samp class="option">-use_buggy_lpc</samp></dt>
  5851. <dd><p>The lavc FLAC encoder used to produce buggy streams with high lpc values
  5852. (like the default value). This option makes it possible to decode such streams
  5853. correctly by using lavc&rsquo;s old buggy lpc logic for decoding.
  5854. </p>
  5855. </dd>
  5856. </dl>
  5857. </div>
  5858. </div>
  5859. <div class="section-level-extent" id="ffwavesynth">
  5860. <h3 class="section"><span>9.3 ffwavesynth<a class="copiable-link" href="#ffwavesynth"> &para;</a></span></h3>
  5861. <p>Internal wave synthesizer.
  5862. </p>
  5863. <p>This decoder generates wave patterns according to predefined sequences. Its
  5864. use is purely internal and the format of the data it accepts is not publicly
  5865. documented.
  5866. </p>
  5867. </div>
  5868. <div class="section-level-extent" id="libcelt">
  5869. <h3 class="section"><span>9.4 libcelt<a class="copiable-link" href="#libcelt"> &para;</a></span></h3>
  5870. <p>libcelt decoder wrapper.
  5871. </p>
  5872. <p>libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
  5873. Requires the presence of the libcelt headers and library during configuration.
  5874. You need to explicitly configure the build with <code class="code">--enable-libcelt</code>.
  5875. </p>
  5876. </div>
  5877. <div class="section-level-extent" id="libgsm">
  5878. <h3 class="section"><span>9.5 libgsm<a class="copiable-link" href="#libgsm"> &para;</a></span></h3>
  5879. <p>libgsm decoder wrapper.
  5880. </p>
  5881. <p>libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
  5882. the presence of the libgsm headers and library during configuration. You need
  5883. to explicitly configure the build with <code class="code">--enable-libgsm</code>.
  5884. </p>
  5885. <p>This decoder supports both the ordinary GSM and the Microsoft variant.
  5886. </p>
  5887. </div>
  5888. <div class="section-level-extent" id="libilbc">
  5889. <h3 class="section"><span>9.6 libilbc<a class="copiable-link" href="#libilbc"> &para;</a></span></h3>
  5890. <p>libilbc decoder wrapper.
  5891. </p>
  5892. <p>libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
  5893. audio codec. Requires the presence of the libilbc headers and library during
  5894. configuration. You need to explicitly configure the build with
  5895. <code class="code">--enable-libilbc</code>.
  5896. </p>
  5897. <ul class="mini-toc">
  5898. <li><a href="#Options-7" accesskey="1">Options</a></li>
  5899. </ul>
  5900. <div class="subsection-level-extent" id="Options-7">
  5901. <h4 class="subsection"><span>9.6.1 Options<a class="copiable-link" href="#Options-7"> &para;</a></span></h4>
  5902. <p>The following option is supported by the libilbc wrapper.
  5903. </p>
  5904. <dl class="table">
  5905. <dt><samp class="option">enhance</samp></dt>
  5906. <dd>
  5907. <p>Enable the enhancement of the decoded audio when set to 1. The default
  5908. value is 0 (disabled).
  5909. </p>
  5910. </dd>
  5911. </dl>
  5912. </div>
  5913. </div>
  5914. <div class="section-level-extent" id="libopencore_002damrnb">
  5915. <h3 class="section"><span>9.7 libopencore-amrnb<a class="copiable-link" href="#libopencore_002damrnb"> &para;</a></span></h3>
  5916. <p>libopencore-amrnb decoder wrapper.
  5917. </p>
  5918. <p>libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
  5919. Narrowband audio codec. Using it requires the presence of the
  5920. libopencore-amrnb headers and library during configuration. You need to
  5921. explicitly configure the build with <code class="code">--enable-libopencore-amrnb</code>.
  5922. </p>
  5923. <p>An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
  5924. without this library.
  5925. </p>
  5926. </div>
  5927. <div class="section-level-extent" id="libopencore_002damrwb">
  5928. <h3 class="section"><span>9.8 libopencore-amrwb<a class="copiable-link" href="#libopencore_002damrwb"> &para;</a></span></h3>
  5929. <p>libopencore-amrwb decoder wrapper.
  5930. </p>
  5931. <p>libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
  5932. Wideband audio codec. Using it requires the presence of the
  5933. libopencore-amrwb headers and library during configuration. You need to
  5934. explicitly configure the build with <code class="code">--enable-libopencore-amrwb</code>.
  5935. </p>
  5936. <p>An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
  5937. without this library.
  5938. </p>
  5939. </div>
  5940. <div class="section-level-extent" id="libopus">
  5941. <h3 class="section"><span>9.9 libopus<a class="copiable-link" href="#libopus"> &para;</a></span></h3>
  5942. <p>libopus decoder wrapper.
  5943. </p>
  5944. <p>libopus allows libavcodec to decode the Opus Interactive Audio Codec.
  5945. Requires the presence of the libopus headers and library during
  5946. configuration. You need to explicitly configure the build with
  5947. <code class="code">--enable-libopus</code>.
  5948. </p>
  5949. <p>An FFmpeg native decoder for Opus exists, so users can decode Opus
  5950. without this library.
  5951. </p>
  5952. </div>
  5953. </div>
  5954. <div class="chapter-level-extent" id="Subtitles-Decoders">
  5955. <h2 class="chapter"><span>10 Subtitles Decoders<a class="copiable-link" href="#Subtitles-Decoders"> &para;</a></span></h2>
  5956. <ul class="mini-toc">
  5957. <li><a href="#libaribb24" accesskey="1">libaribb24</a></li>
  5958. <li><a href="#libaribcaption" accesskey="2">libaribcaption</a></li>
  5959. <li><a href="#dvbsub" accesskey="3">dvbsub</a></li>
  5960. <li><a href="#dvdsub" accesskey="4">dvdsub</a></li>
  5961. <li><a href="#libzvbi_002dteletext" accesskey="5">libzvbi-teletext</a></li>
  5962. </ul>
  5963. <div class="section-level-extent" id="libaribb24">
  5964. <h3 class="section"><span>10.1 libaribb24<a class="copiable-link" href="#libaribb24"> &para;</a></span></h3>
  5965. <p>ARIB STD-B24 caption decoder.
  5966. </p>
  5967. <p>Implements profiles A and C of the ARIB STD-B24 standard.
  5968. </p>
  5969. <ul class="mini-toc">
  5970. <li><a href="#libaribb24-Decoder-Options" accesskey="1">libaribb24 Decoder Options</a></li>
  5971. </ul>
  5972. <div class="subsection-level-extent" id="libaribb24-Decoder-Options">
  5973. <h4 class="subsection"><span>10.1.1 libaribb24 Decoder Options<a class="copiable-link" href="#libaribb24-Decoder-Options"> &para;</a></span></h4>
  5974. <dl class="table">
  5975. <dt><samp class="option">-aribb24-base-path <var class="var">path</var></samp></dt>
  5976. <dd><p>Sets the base path for the libaribb24 library. This is utilized for reading of
  5977. configuration files (for custom unicode conversions), and for dumping of
  5978. non-text symbols as images under that location.
  5979. </p>
  5980. <p>Unset by default.
  5981. </p>
  5982. </dd>
  5983. <dt><samp class="option">-aribb24-skip-ruby-text <var class="var">boolean</var></samp></dt>
  5984. <dd><p>Tells the decoder wrapper to skip text blocks that contain half-height ruby
  5985. text.
  5986. </p>
  5987. <p>Enabled by default.
  5988. </p>
  5989. </dd>
  5990. </dl>
  5991. </div>
  5992. </div>
  5993. <div class="section-level-extent" id="libaribcaption">
  5994. <h3 class="section"><span>10.2 libaribcaption<a class="copiable-link" href="#libaribcaption"> &para;</a></span></h3>
  5995. <p>Yet another ARIB STD-B24 caption decoder using external <em class="dfn">libaribcaption</em>
  5996. library.
  5997. </p>
  5998. <p>Implements profiles A and C of the Japanse ARIB STD-B24 standard,
  5999. Brazilian ABNT NBR 15606-1, and Philippines version of ISDB-T.
  6000. </p>
  6001. <p>Requires the presence of the libaribcaption headers and library
  6002. (<a class="url" href="https://github.com/xqq/libaribcaption">https://github.com/xqq/libaribcaption</a>) during configuration.
  6003. You need to explicitly configure the build with <code class="code">--enable-libaribcaption</code>.
  6004. If both <em class="dfn">libaribb24</em> and <em class="dfn">libaribcaption</em> are enabled, <em class="dfn">libaribcaption</em>
  6005. decoder precedes.
  6006. </p>
  6007. <ul class="mini-toc">
  6008. <li><a href="#libaribcaption-Decoder-Options" accesskey="1">libaribcaption Decoder Options</a></li>
  6009. <li><a href="#libaribcaption-decoder-usage-examples" accesskey="2">libaribcaption decoder usage examples</a></li>
  6010. </ul>
  6011. <div class="subsection-level-extent" id="libaribcaption-Decoder-Options">
  6012. <h4 class="subsection"><span>10.2.1 libaribcaption Decoder Options<a class="copiable-link" href="#libaribcaption-Decoder-Options"> &para;</a></span></h4>
  6013. <dl class="table">
  6014. <dt><samp class="option">-sub_type <var class="var">subtitle_type</var></samp></dt>
  6015. <dd><p>Specifies the format of the decoded subtitles.
  6016. </p>
  6017. <dl class="table">
  6018. <dt>&lsquo;<samp class="samp">bitmap</samp>&rsquo;</dt>
  6019. <dd><p>Graphical image.
  6020. </p></dd>
  6021. <dt>&lsquo;<samp class="samp">ass</samp>&rsquo;</dt>
  6022. <dd><p>ASS formatted text.
  6023. </p></dd>
  6024. <dt>&lsquo;<samp class="samp">text</samp>&rsquo;</dt>
  6025. <dd><p>Simple text based output without formatting.
  6026. </p></dd>
  6027. </dl>
  6028. <p>The default is <em class="dfn">ass</em> as same as <em class="dfn">libaribb24</em> decoder.
  6029. Some present players (e.g., <em class="dfn">mpv</em>) expect ASS format for ARIB caption.
  6030. </p>
  6031. </dd>
  6032. <dt><samp class="option">-caption_encoding <var class="var">encoding_scheme</var></samp></dt>
  6033. <dd><p>Specifies the encoding scheme of input subtitle text.
  6034. </p>
  6035. <dl class="table">
  6036. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  6037. <dd><p>Automatically detect text encoding (default).
  6038. </p></dd>
  6039. <dt>&lsquo;<samp class="samp">jis</samp>&rsquo;</dt>
  6040. <dd><p>8bit-char JIS encoding defined in ARIB STD B24.
  6041. This encoding used in Japan for ISDB captions.
  6042. </p></dd>
  6043. <dt>&lsquo;<samp class="samp">utf8</samp>&rsquo;</dt>
  6044. <dd><p>UTF-8 encoding defined in ARIB STD B24.
  6045. This encoding is used in Philippines for ISDB-T captions.
  6046. </p></dd>
  6047. <dt>&lsquo;<samp class="samp">latin</samp>&rsquo;</dt>
  6048. <dd><p>Latin character encoding defined in ABNT NBR 15606-1.
  6049. This encoding is used in South America for SBTVD / ISDB-Tb captions.
  6050. </p></dd>
  6051. </dl>
  6052. </dd>
  6053. <dt><samp class="option">-font <var class="var">font_name[,font_name2,...]</var></samp></dt>
  6054. <dd><p>Specify comma-separated list of font family names to be used for <em class="dfn">bitmap</em>
  6055. or <em class="dfn">ass</em> type subtitle rendering.
  6056. Only first font name is used for <em class="dfn">ass</em> type subtitle.
  6057. </p>
  6058. <p>If not specified, use internaly defined default font family.
  6059. </p>
  6060. </dd>
  6061. <dt><samp class="option">-ass_single_rect <var class="var">boolean</var></samp></dt>
  6062. <dd><p>ARIB STD-B24 specifies that some captions may be displayed at different
  6063. positions at a time (multi-rectangle subtitle).
  6064. Since some players (e.g., old <em class="dfn">mpv</em>) can&rsquo;t handle multiple ASS rectangles
  6065. in a single AVSubtitle, or multiple ASS rectangles of indeterminate duration
  6066. with the same start timestamp, this option can change the behavior so that
  6067. all the texts are displayed in a single ASS rectangle.
  6068. </p>
  6069. <p>The default is <var class="var">false</var>.
  6070. </p>
  6071. <p>If your player cannot handle AVSubtitles with multiple ASS rectangles properly,
  6072. set this option to <var class="var">true</var> or define <code class="env">ASS_SINGLE_RECT=1</code> to change
  6073. default behavior at compilation.
  6074. </p>
  6075. </dd>
  6076. <dt><samp class="option">-force_outline_text <var class="var">boolean</var></samp></dt>
  6077. <dd><p>Specify whether always render outline text for all characters regardless of
  6078. the indication by charactor style.
  6079. </p>
  6080. <p>The default is <var class="var">false</var>.
  6081. </p>
  6082. </dd>
  6083. <dt><samp class="option">-outline_width <var class="var">number</var> (0.0 - 3.0)</samp></dt>
  6084. <dd><p>Specify width for outline text, in dots (relative).
  6085. </p>
  6086. <p>The default is <var class="var">1.5</var>.
  6087. </p>
  6088. </dd>
  6089. <dt><samp class="option">-ignore_background <var class="var">boolean</var></samp></dt>
  6090. <dd><p>Specify whether to ignore background color rendering.
  6091. </p>
  6092. <p>The default is <var class="var">false</var>.
  6093. </p>
  6094. </dd>
  6095. <dt><samp class="option">-ignore_ruby <var class="var">boolean</var></samp></dt>
  6096. <dd><p>Specify whether to ignore rendering for ruby-like (furigana) characters.
  6097. </p>
  6098. <p>The default is <var class="var">false</var>.
  6099. </p>
  6100. </dd>
  6101. <dt><samp class="option">-replace_drcs <var class="var">boolean</var></samp></dt>
  6102. <dd><p>Specify whether to render replaced DRCS characters as Unicode characters.
  6103. </p>
  6104. <p>The default is <var class="var">true</var>.
  6105. </p>
  6106. </dd>
  6107. <dt><samp class="option">-replace_msz_ascii <var class="var">boolean</var></samp></dt>
  6108. <dd><p>Specify whether to replace MSZ (Middle Size; half width) fullwidth
  6109. alphanumerics with halfwidth alphanumerics.
  6110. </p>
  6111. <p>The default is <var class="var">true</var>.
  6112. </p>
  6113. </dd>
  6114. <dt><samp class="option">-replace_msz_japanese <var class="var">boolean</var></samp></dt>
  6115. <dd><p>Specify whether to replace some MSZ (Middle Size; half width) fullwidth
  6116. japanese special characters with halfwidth ones.
  6117. </p>
  6118. <p>The default is <var class="var">true</var>.
  6119. </p>
  6120. </dd>
  6121. <dt><samp class="option">-replace_msz_glyph <var class="var">boolean</var></samp></dt>
  6122. <dd><p>Specify whether to replace MSZ (Middle Size; half width) characters
  6123. with halfwidth glyphs if the fonts supports it.
  6124. This option works under FreeType or DirectWrite renderer
  6125. with Adobe-Japan1 compliant fonts.
  6126. e.g., IBM Plex Sans JP, Morisawa BIZ UDGothic, Morisawa BIZ UDMincho,
  6127. Yu Gothic, Yu Mincho, and Meiryo.
  6128. </p>
  6129. <p>The default is <var class="var">true</var>.
  6130. </p>
  6131. </dd>
  6132. <dt><samp class="option">-canvas_size <var class="var">image_size</var></samp></dt>
  6133. <dd><p>Specify the resolution of the canvas to render subtitles to; usually, this
  6134. should be frame size of input video.
  6135. This only applies when <code class="code">-subtitle_type</code> is set to <var class="var">bitmap</var>.
  6136. </p>
  6137. <p>The libaribcaption decoder assumes input frame size for bitmap rendering as below:
  6138. </p><ol class="enumerate">
  6139. <li> PROFILE_A : 1440 x 1080 with SAR (PAR) 4:3
  6140. </li><li> PROFILE_C : 320 x 180 with SAR (PAR) 1:1
  6141. </li></ol>
  6142. <p>If actual frame size of input video does not match above assumption,
  6143. the rendered captions may be distorted.
  6144. To make the captions undistorted, add <code class="code">-canvas_size</code> option to specify
  6145. actual input video size.
  6146. </p>
  6147. <p>Note that the <code class="code">-canvas_size</code> option is not required for video with
  6148. different size but same aspect ratio.
  6149. In such cases, the caption will be stretched or shrunk to actual video size
  6150. if <code class="code">-canvas_size</code> option is not specified.
  6151. If <code class="code">-canvas_size</code> option is specified with different size,
  6152. the caption will be stretched or shrunk as specified size with calculated SAR.
  6153. </p>
  6154. </dd>
  6155. </dl>
  6156. </div>
  6157. <div class="subsection-level-extent" id="libaribcaption-decoder-usage-examples">
  6158. <h4 class="subsection"><span>10.2.2 libaribcaption decoder usage examples<a class="copiable-link" href="#libaribcaption-decoder-usage-examples"> &para;</a></span></h4>
  6159. <p>Display MPEG-TS file with ARIB subtitle by <code class="code">ffplay</code> tool:
  6160. </p><div class="example">
  6161. <pre class="example-preformatted">ffplay -sub_type bitmap MPEG.TS
  6162. </pre></div>
  6163. <p>Display MPEG-TS file with input frame size 1920x1080 by <code class="code">ffplay</code> tool:
  6164. </p><div class="example">
  6165. <pre class="example-preformatted">ffplay -sub_type bitmap -canvas_size 1920x1080 MPEG.TS
  6166. </pre></div>
  6167. <p>Embed ARIB subtitle in transcoded video:
  6168. </p><div class="example">
  6169. <pre class="example-preformatted">ffmpeg -sub_type bitmap -i src.m2t -filter_complex &quot;[0:v][0:s]overlay&quot; -vcodec h264 dest.mp4
  6170. </pre></div>
  6171. </div>
  6172. </div>
  6173. <div class="section-level-extent" id="dvbsub">
  6174. <h3 class="section"><span>10.3 dvbsub<a class="copiable-link" href="#dvbsub"> &para;</a></span></h3>
  6175. <ul class="mini-toc">
  6176. <li><a href="#Options-8" accesskey="1">Options</a></li>
  6177. </ul>
  6178. <div class="subsection-level-extent" id="Options-8">
  6179. <h4 class="subsection"><span>10.3.1 Options<a class="copiable-link" href="#Options-8"> &para;</a></span></h4>
  6180. <dl class="table">
  6181. <dt><samp class="option">compute_clut</samp></dt>
  6182. <dd><dl class="table">
  6183. <dt><samp class="option">-2</samp></dt>
  6184. <dd><p>Compute clut once if no matching CLUT is in the stream.
  6185. </p></dd>
  6186. <dt><samp class="option">-1</samp></dt>
  6187. <dd><p>Compute clut if no matching CLUT is in the stream.
  6188. </p></dd>
  6189. <dt><samp class="option">0</samp></dt>
  6190. <dd><p>Never compute CLUT
  6191. </p></dd>
  6192. <dt><samp class="option">1</samp></dt>
  6193. <dd><p>Always compute CLUT and override the one provided in the stream.
  6194. </p></dd>
  6195. </dl>
  6196. </dd>
  6197. <dt><samp class="option">dvb_substream</samp></dt>
  6198. <dd><p>Selects the dvb substream, or all substreams if -1 which is default.
  6199. </p>
  6200. </dd>
  6201. </dl>
  6202. </div>
  6203. </div>
  6204. <div class="section-level-extent" id="dvdsub">
  6205. <h3 class="section"><span>10.4 dvdsub<a class="copiable-link" href="#dvdsub"> &para;</a></span></h3>
  6206. <p>This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
  6207. also be found in VobSub file pairs and in some Matroska files.
  6208. </p>
  6209. <ul class="mini-toc">
  6210. <li><a href="#Options-9" accesskey="1">Options</a></li>
  6211. </ul>
  6212. <div class="subsection-level-extent" id="Options-9">
  6213. <h4 class="subsection"><span>10.4.1 Options<a class="copiable-link" href="#Options-9"> &para;</a></span></h4>
  6214. <dl class="table">
  6215. <dt><samp class="option">palette</samp></dt>
  6216. <dd><p>Specify the global palette used by the bitmaps. When stored in VobSub, the
  6217. palette is normally specified in the index file; in Matroska, the palette is
  6218. stored in the codec extra-data in the same format as in VobSub. In DVDs, the
  6219. palette is stored in the IFO file, and therefore not available when reading
  6220. from dumped VOB files.
  6221. </p>
  6222. <p>The format for this option is a string containing 16 24-bits hexadecimal
  6223. numbers (without 0x prefix) separated by commas, for example <code class="code">0d00ee,
  6224. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  6225. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
  6226. </p>
  6227. </dd>
  6228. <dt><samp class="option">ifo_palette</samp></dt>
  6229. <dd><p>Specify the IFO file from which the global palette is obtained.
  6230. (experimental)
  6231. </p>
  6232. </dd>
  6233. <dt><samp class="option">forced_subs_only</samp></dt>
  6234. <dd><p>Only decode subtitle entries marked as forced. Some titles have forced
  6235. and non-forced subtitles in the same track. Setting this flag to <code class="code">1</code>
  6236. will only keep the forced subtitles. Default value is <code class="code">0</code>.
  6237. </p></dd>
  6238. </dl>
  6239. </div>
  6240. </div>
  6241. <div class="section-level-extent" id="libzvbi_002dteletext">
  6242. <h3 class="section"><span>10.5 libzvbi-teletext<a class="copiable-link" href="#libzvbi_002dteletext"> &para;</a></span></h3>
  6243. <p>Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext
  6244. subtitles. Requires the presence of the libzvbi headers and library during
  6245. configuration. You need to explicitly configure the build with
  6246. <code class="code">--enable-libzvbi</code>.
  6247. </p>
  6248. <ul class="mini-toc">
  6249. <li><a href="#Options-10" accesskey="1">Options</a></li>
  6250. </ul>
  6251. <div class="subsection-level-extent" id="Options-10">
  6252. <h4 class="subsection"><span>10.5.1 Options<a class="copiable-link" href="#Options-10"> &para;</a></span></h4>
  6253. <dl class="table">
  6254. <dt><samp class="option">txt_page</samp></dt>
  6255. <dd><p>List of teletext page numbers to decode. Pages that do not match the specified
  6256. list are dropped. You may use the special <code class="code">*</code> string to match all pages,
  6257. or <code class="code">subtitle</code> to match all subtitle pages.
  6258. Default value is *.
  6259. </p></dd>
  6260. <dt><samp class="option">txt_default_region</samp></dt>
  6261. <dd><p>Set default character set used for decoding, a value between 0 and 87 (see
  6262. ETS 300 706, Section 15, Table 32). Default value is -1, which does not
  6263. override the libzvbi default. This option is needed for some legacy level 1.0
  6264. transmissions which cannot signal the proper charset.
  6265. </p></dd>
  6266. <dt><samp class="option">txt_chop_top</samp></dt>
  6267. <dd><p>Discards the top teletext line. Default value is 1.
  6268. </p></dd>
  6269. <dt><samp class="option">txt_format</samp></dt>
  6270. <dd><p>Specifies the format of the decoded subtitles.
  6271. </p><dl class="table">
  6272. <dt><samp class="option">bitmap</samp></dt>
  6273. <dd><p>The default format, you should use this for teletext pages, because certain
  6274. graphics and colors cannot be expressed in simple text or even ASS.
  6275. </p></dd>
  6276. <dt><samp class="option">text</samp></dt>
  6277. <dd><p>Simple text based output without formatting.
  6278. </p></dd>
  6279. <dt><samp class="option">ass</samp></dt>
  6280. <dd><p>Formatted ASS output, subtitle pages and teletext pages are returned in
  6281. different styles, subtitle pages are stripped down to text, but an effort is
  6282. made to keep the text alignment and the formatting.
  6283. </p></dd>
  6284. </dl>
  6285. </dd>
  6286. <dt><samp class="option">txt_left</samp></dt>
  6287. <dd><p>X offset of generated bitmaps, default is 0.
  6288. </p></dd>
  6289. <dt><samp class="option">txt_top</samp></dt>
  6290. <dd><p>Y offset of generated bitmaps, default is 0.
  6291. </p></dd>
  6292. <dt><samp class="option">txt_chop_spaces</samp></dt>
  6293. <dd><p>Chops leading and trailing spaces and removes empty lines from the generated
  6294. text. This option is useful for teletext based subtitles where empty spaces may
  6295. be present at the start or at the end of the lines or empty lines may be
  6296. present between the subtitle lines because of double-sized teletext characters.
  6297. Default value is 1.
  6298. </p></dd>
  6299. <dt><samp class="option">txt_duration</samp></dt>
  6300. <dd><p>Sets the display duration of the decoded teletext pages or subtitles in
  6301. milliseconds. Default value is -1 which means infinity or until the next
  6302. subtitle event comes.
  6303. </p></dd>
  6304. <dt><samp class="option">txt_transparent</samp></dt>
  6305. <dd><p>Force transparent background of the generated teletext bitmaps. Default value
  6306. is 0 which means an opaque background.
  6307. </p></dd>
  6308. <dt><samp class="option">txt_opacity</samp></dt>
  6309. <dd><p>Sets the opacity (0-255) of the teletext background. If
  6310. <samp class="option">txt_transparent</samp> is not set, it only affects characters between a start
  6311. box and an end box, typically subtitles. Default value is 0 if
  6312. <samp class="option">txt_transparent</samp> is set, 255 otherwise.
  6313. </p>
  6314. </dd>
  6315. </dl>
  6316. </div>
  6317. </div>
  6318. </div>
  6319. <div class="chapter-level-extent" id="Bitstream-Filters">
  6320. <h2 class="chapter"><span>11 Bitstream Filters<a class="copiable-link" href="#Bitstream-Filters"> &para;</a></span></h2>
  6321. <p>When you configure your FFmpeg build, all the supported bitstream
  6322. filters are enabled by default. You can list all available ones using
  6323. the configure option <code class="code">--list-bsfs</code>.
  6324. </p>
  6325. <p>You can disable all the bitstream filters using the configure option
  6326. <code class="code">--disable-bsfs</code>, and selectively enable any bitstream filter using
  6327. the option <code class="code">--enable-bsf=BSF</code>, or you can disable a particular
  6328. bitstream filter using the option <code class="code">--disable-bsf=BSF</code>.
  6329. </p>
  6330. <p>The option <code class="code">-bsfs</code> of the ff* tools will display the list of
  6331. all the supported bitstream filters included in your build.
  6332. </p>
  6333. <p>The ff* tools have a -bsf option applied per stream, taking a
  6334. comma-separated list of filters, whose parameters follow the filter
  6335. name after a &rsquo;=&rsquo;.
  6336. </p>
  6337. <div class="example">
  6338. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
  6339. </pre></div>
  6340. <p>Below is a description of the currently available bitstream filters,
  6341. with their parameters, if any.
  6342. </p>
  6343. <ul class="mini-toc">
  6344. <li><a href="#aac_005fadtstoasc" accesskey="1">aac_adtstoasc</a></li>
  6345. <li><a href="#av1_005fmetadata" accesskey="2">av1_metadata</a></li>
  6346. <li><a href="#chomp" accesskey="3">chomp</a></li>
  6347. <li><a href="#dca_005fcore" accesskey="4">dca_core</a></li>
  6348. <li><a href="#dump_005fextra" accesskey="5">dump_extra</a></li>
  6349. <li><a href="#dv_005ferror_005fmarker" accesskey="6">dv_error_marker</a></li>
  6350. <li><a href="#eac3_005fcore" accesskey="7">eac3_core</a></li>
  6351. <li><a href="#extract_005fextradata" accesskey="8">extract_extradata</a></li>
  6352. <li><a href="#filter_005funits" accesskey="9">filter_units</a></li>
  6353. <li><a href="#hapqa_005fextract">hapqa_extract</a></li>
  6354. <li><a href="#h264_005fmetadata">h264_metadata</a></li>
  6355. <li><a href="#h264_005fmp4toannexb">h264_mp4toannexb</a></li>
  6356. <li><a href="#h264_005fredundant_005fpps">h264_redundant_pps</a></li>
  6357. <li><a href="#hevc_005fmetadata">hevc_metadata</a></li>
  6358. <li><a href="#hevc_005fmp4toannexb">hevc_mp4toannexb</a></li>
  6359. <li><a href="#imxdump">imxdump</a></li>
  6360. <li><a href="#mjpeg2jpeg">mjpeg2jpeg</a></li>
  6361. <li><a href="#mjpegadump">mjpegadump</a></li>
  6362. <li><a href="#mov2textsub-1">mov2textsub</a></li>
  6363. <li><a href="#mpeg2_005fmetadata">mpeg2_metadata</a></li>
  6364. <li><a href="#mpeg4_005funpack_005fbframes">mpeg4_unpack_bframes</a></li>
  6365. <li><a href="#noise">noise</a></li>
  6366. <li><a href="#null">null</a></li>
  6367. <li><a href="#pcm_005frechunk">pcm_rechunk</a></li>
  6368. <li><a href="#pgs_005fframe_005fmerge">pgs_frame_merge</a></li>
  6369. <li><a href="#prores_005fmetadata">prores_metadata</a></li>
  6370. <li><a href="#remove_005fextra">remove_extra</a></li>
  6371. <li><a href="#setts">setts</a></li>
  6372. <li><a href="#showinfo">showinfo</a></li>
  6373. <li><a href="#text2movsub-1">text2movsub</a></li>
  6374. <li><a href="#trace_005fheaders">trace_headers</a></li>
  6375. <li><a href="#truehd_005fcore">truehd_core</a></li>
  6376. <li><a href="#vp9_005fmetadata">vp9_metadata</a></li>
  6377. <li><a href="#vp9_005fsuperframe">vp9_superframe</a></li>
  6378. <li><a href="#vp9_005fsuperframe_005fsplit">vp9_superframe_split</a></li>
  6379. <li><a href="#vp9_005fraw_005freorder">vp9_raw_reorder</a></li>
  6380. </ul>
  6381. <div class="section-level-extent" id="aac_005fadtstoasc">
  6382. <h3 class="section"><span>11.1 aac_adtstoasc<a class="copiable-link" href="#aac_005fadtstoasc"> &para;</a></span></h3>
  6383. <p>Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration
  6384. bitstream.
  6385. </p>
  6386. <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
  6387. ADTS header and removes the ADTS header.
  6388. </p>
  6389. <p>This filter is required for example when copying an AAC stream from a
  6390. raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or
  6391. to MOV/MP4 files and related formats such as 3GP or M4A. Please note
  6392. that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats.
  6393. </p>
  6394. </div>
  6395. <div class="section-level-extent" id="av1_005fmetadata">
  6396. <h3 class="section"><span>11.2 av1_metadata<a class="copiable-link" href="#av1_005fmetadata"> &para;</a></span></h3>
  6397. <p>Modify metadata embedded in an AV1 stream.
  6398. </p>
  6399. <dl class="table">
  6400. <dt><samp class="option">td</samp></dt>
  6401. <dd><p>Insert or remove temporal delimiter OBUs in all temporal units of the
  6402. stream.
  6403. </p>
  6404. <dl class="table">
  6405. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  6406. <dd><p>Insert a TD at the beginning of every TU which does not already have one.
  6407. </p></dd>
  6408. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  6409. <dd><p>Remove the TD from the beginning of every TU which has one.
  6410. </p></dd>
  6411. </dl>
  6412. </dd>
  6413. <dt><samp class="option">color_primaries</samp></dt>
  6414. <dt><samp class="option">transfer_characteristics</samp></dt>
  6415. <dt><samp class="option">matrix_coefficients</samp></dt>
  6416. <dd><p>Set the color description fields in the stream (see AV1 section 6.4.2).
  6417. </p>
  6418. </dd>
  6419. <dt><samp class="option">color_range</samp></dt>
  6420. <dd><p>Set the color range in the stream (see AV1 section 6.4.2; note that
  6421. this cannot be set for streams using BT.709 primaries, sRGB transfer
  6422. characteristic and identity (RGB) matrix coefficients).
  6423. </p><dl class="table">
  6424. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  6425. <dd><p>Limited range.
  6426. </p></dd>
  6427. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  6428. <dd><p>Full range.
  6429. </p></dd>
  6430. </dl>
  6431. </dd>
  6432. <dt><samp class="option">chroma_sample_position</samp></dt>
  6433. <dd><p>Set the chroma sample location in the stream (see AV1 section 6.4.2).
  6434. This can only be set for 4:2:0 streams.
  6435. </p>
  6436. <dl class="table">
  6437. <dt>&lsquo;<samp class="samp">vertical</samp>&rsquo;</dt>
  6438. <dd><p>Left position (matching the default in MPEG-2 and H.264).
  6439. </p></dd>
  6440. <dt>&lsquo;<samp class="samp">colocated</samp>&rsquo;</dt>
  6441. <dd><p>Top-left position.
  6442. </p></dd>
  6443. </dl>
  6444. </dd>
  6445. <dt><samp class="option">tick_rate</samp></dt>
  6446. <dd><p>Set the tick rate (<em class="emph">time_scale / num_units_in_display_tick</em>) in
  6447. the timing info in the sequence header.
  6448. </p></dd>
  6449. <dt><samp class="option">num_ticks_per_picture</samp></dt>
  6450. <dd><p>Set the number of ticks in each picture, to indicate that the stream
  6451. has a fixed framerate. Ignored if <samp class="option">tick_rate</samp> is not also set.
  6452. </p>
  6453. </dd>
  6454. <dt><samp class="option">delete_padding</samp></dt>
  6455. <dd><p>Deletes Padding OBUs.
  6456. </p>
  6457. </dd>
  6458. </dl>
  6459. </div>
  6460. <div class="section-level-extent" id="chomp">
  6461. <h3 class="section"><span>11.3 chomp<a class="copiable-link" href="#chomp"> &para;</a></span></h3>
  6462. <p>Remove zero padding at the end of a packet.
  6463. </p>
  6464. </div>
  6465. <div class="section-level-extent" id="dca_005fcore">
  6466. <h3 class="section"><span>11.4 dca_core<a class="copiable-link" href="#dca_005fcore"> &para;</a></span></h3>
  6467. <p>Extract the core from a DCA/DTS stream, dropping extensions such as
  6468. DTS-HD.
  6469. </p>
  6470. </div>
  6471. <div class="section-level-extent" id="dump_005fextra">
  6472. <h3 class="section"><span>11.5 dump_extra<a class="copiable-link" href="#dump_005fextra"> &para;</a></span></h3>
  6473. <p>Add extradata to the beginning of the filtered packets except when
  6474. said packets already exactly begin with the extradata that is intended
  6475. to be added.
  6476. </p>
  6477. <dl class="table">
  6478. <dt><samp class="option">freq</samp></dt>
  6479. <dd><p>The additional argument specifies which packets should be filtered.
  6480. It accepts the values:
  6481. </p><dl class="table">
  6482. <dt>&lsquo;<samp class="samp">k</samp>&rsquo;</dt>
  6483. <dt>&lsquo;<samp class="samp">keyframe</samp>&rsquo;</dt>
  6484. <dd><p>add extradata to all key packets
  6485. </p>
  6486. </dd>
  6487. <dt>&lsquo;<samp class="samp">e</samp>&rsquo;</dt>
  6488. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  6489. <dd><p>add extradata to all packets
  6490. </p></dd>
  6491. </dl>
  6492. </dd>
  6493. </dl>
  6494. <p>If not specified it is assumed &lsquo;<samp class="samp">k</samp>&rsquo;.
  6495. </p>
  6496. <p>For example the following <code class="command">ffmpeg</code> command forces a global
  6497. header (thus disabling individual packet headers) in the H.264 packets
  6498. generated by the <code class="code">libx264</code> encoder, but corrects them by adding
  6499. the header stored in extradata to the key packets:
  6500. </p><div class="example">
  6501. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
  6502. </pre></div>
  6503. </div>
  6504. <div class="section-level-extent" id="dv_005ferror_005fmarker">
  6505. <h3 class="section"><span>11.6 dv_error_marker<a class="copiable-link" href="#dv_005ferror_005fmarker"> &para;</a></span></h3>
  6506. <p>Blocks in DV which are marked as damaged are replaced by blocks of the specified color.
  6507. </p>
  6508. <dl class="table">
  6509. <dt><samp class="option">color</samp></dt>
  6510. <dd><p>The color to replace damaged blocks by
  6511. </p></dd>
  6512. <dt><samp class="option">sta</samp></dt>
  6513. <dd><p>A 16 bit mask which specifies which of the 16 possible error status values are
  6514. to be replaced by colored blocks. 0xFFFE is the default which replaces all non 0
  6515. error status values.
  6516. </p><dl class="table">
  6517. <dt>&lsquo;<samp class="samp">ok</samp>&rsquo;</dt>
  6518. <dd><p>No error, no concealment
  6519. </p></dd>
  6520. <dt>&lsquo;<samp class="samp">err</samp>&rsquo;</dt>
  6521. <dd><p>Error, No concealment
  6522. </p></dd>
  6523. <dt>&lsquo;<samp class="samp">res</samp>&rsquo;</dt>
  6524. <dd><p>Reserved
  6525. </p></dd>
  6526. <dt>&lsquo;<samp class="samp">notok</samp>&rsquo;</dt>
  6527. <dd><p>Error or concealment
  6528. </p></dd>
  6529. <dt>&lsquo;<samp class="samp">notres</samp>&rsquo;</dt>
  6530. <dd><p>Not reserved
  6531. </p></dd>
  6532. <dt>&lsquo;<samp class="samp">Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru</samp>&rsquo;</dt>
  6533. <dd><p>The specific error status code
  6534. </p></dd>
  6535. </dl>
  6536. <p>see page 44-46 or section 5.5 of
  6537. <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>
  6538. </p>
  6539. </dd>
  6540. </dl>
  6541. </div>
  6542. <div class="section-level-extent" id="eac3_005fcore">
  6543. <h3 class="section"><span>11.7 eac3_core<a class="copiable-link" href="#eac3_005fcore"> &para;</a></span></h3>
  6544. <p>Extract the core from a E-AC-3 stream, dropping extra channels.
  6545. </p>
  6546. </div>
  6547. <div class="section-level-extent" id="extract_005fextradata">
  6548. <h3 class="section"><span>11.8 extract_extradata<a class="copiable-link" href="#extract_005fextradata"> &para;</a></span></h3>
  6549. <p>Extract the in-band extradata.
  6550. </p>
  6551. <p>Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers,
  6552. or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either &quot;in-band&quot; (i.e. as a part
  6553. of the bitstream containing the coded frames) or &quot;out of band&quot; (e.g. on the
  6554. container level). This latter form is called &quot;extradata&quot; in FFmpeg terminology.
  6555. </p>
  6556. <p>This bitstream filter detects the in-band headers and makes them available as
  6557. extradata.
  6558. </p>
  6559. <dl class="table">
  6560. <dt><samp class="option">remove</samp></dt>
  6561. <dd><p>When this option is enabled, the long-term headers are removed from the
  6562. bitstream after extraction.
  6563. </p></dd>
  6564. </dl>
  6565. </div>
  6566. <div class="section-level-extent" id="filter_005funits">
  6567. <h3 class="section"><span>11.9 filter_units<a class="copiable-link" href="#filter_005funits"> &para;</a></span></h3>
  6568. <p>Remove units with types in or not in a given set from the stream.
  6569. </p>
  6570. <dl class="table">
  6571. <dt><samp class="option">pass_types</samp></dt>
  6572. <dd><p>List of unit types or ranges of unit types to pass through while removing
  6573. all others. This is specified as a &rsquo;|&rsquo;-separated list of unit type values
  6574. or ranges of values with &rsquo;-&rsquo;.
  6575. </p>
  6576. </dd>
  6577. <dt><samp class="option">remove_types</samp></dt>
  6578. <dd><p>Identical to <samp class="option">pass_types</samp>, except the units in the given set
  6579. removed and all others passed through.
  6580. </p></dd>
  6581. </dl>
  6582. <p>The types used by pass_types and remove_types correspond to NAL unit types
  6583. (nal_unit_type) in H.264, HEVC and H.266 (see Table 7-1 in the H.264
  6584. and HEVC specifications or Table 5 in the H.266 specification), to
  6585. marker values for JPEG (without 0xFF prefix) and to start codes without
  6586. start code prefix (i.e. the byte following the 0x000001) for MPEG-2.
  6587. For VP8 and VP9, every unit has type zero.
  6588. </p>
  6589. <p>Extradata is unchanged by this transformation, but note that if the stream
  6590. contains inline parameter sets then the output may be unusable if they are
  6591. removed.
  6592. </p>
  6593. <p>For example, to remove all non-VCL NAL units from an H.264 stream:
  6594. </p><div class="example">
  6595. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
  6596. </pre></div>
  6597. <p>To remove all AUDs, SEI and filler from an H.265 stream:
  6598. </p><div class="example">
  6599. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
  6600. </pre></div>
  6601. <p>To remove all user data from a MPEG-2 stream, including Closed Captions:
  6602. </p><div class="example">
  6603. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=178' OUTPUT
  6604. </pre></div>
  6605. <p>To remove all SEI from a H264 stream, including Closed Captions:
  6606. </p><div class="example">
  6607. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=6' OUTPUT
  6608. </pre></div>
  6609. <p>To remove all prefix and suffix SEI from a HEVC stream, including Closed Captions and dynamic HDR:
  6610. </p><div class="example">
  6611. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=39|40' OUTPUT
  6612. </pre></div>
  6613. </div>
  6614. <div class="section-level-extent" id="hapqa_005fextract">
  6615. <h3 class="section"><span>11.10 hapqa_extract<a class="copiable-link" href="#hapqa_005fextract"> &para;</a></span></h3>
  6616. <p>Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file.
  6617. </p>
  6618. <dl class="table">
  6619. <dt><samp class="option">texture</samp></dt>
  6620. <dd><p>Specifies the texture to keep.
  6621. </p>
  6622. <dl class="table">
  6623. <dt><samp class="option">color</samp></dt>
  6624. <dt><samp class="option">alpha</samp></dt>
  6625. </dl>
  6626. </dd>
  6627. </dl>
  6628. <p>Convert HAPQA to HAPQ
  6629. </p><div class="example">
  6630. <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
  6631. </pre></div>
  6632. <p>Convert HAPQA to HAPAlphaOnly
  6633. </p><div class="example">
  6634. <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
  6635. </pre></div>
  6636. </div>
  6637. <div class="section-level-extent" id="h264_005fmetadata">
  6638. <h3 class="section"><span>11.11 h264_metadata<a class="copiable-link" href="#h264_005fmetadata"> &para;</a></span></h3>
  6639. <p>Modify metadata embedded in an H.264 stream.
  6640. </p>
  6641. <dl class="table">
  6642. <dt><samp class="option">aud</samp></dt>
  6643. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  6644. </p>
  6645. <dl class="table">
  6646. <dt>&lsquo;<samp class="samp">pass</samp>&rsquo;</dt>
  6647. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  6648. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  6649. </dl>
  6650. <p>Default is pass.
  6651. </p>
  6652. </dd>
  6653. <dt><samp class="option">sample_aspect_ratio</samp></dt>
  6654. <dd><p>Set the sample aspect ratio of the stream in the VUI parameters.
  6655. See H.264 table E-1.
  6656. </p>
  6657. </dd>
  6658. <dt><samp class="option">overscan_appropriate_flag</samp></dt>
  6659. <dd><p>Set whether the stream is suitable for display using overscan
  6660. or not (see H.264 section E.2.1).
  6661. </p>
  6662. </dd>
  6663. <dt><samp class="option">video_format</samp></dt>
  6664. <dt><samp class="option">video_full_range_flag</samp></dt>
  6665. <dd><p>Set the video format in the stream (see H.264 section E.2.1 and
  6666. table E-2).
  6667. </p>
  6668. </dd>
  6669. <dt><samp class="option">colour_primaries</samp></dt>
  6670. <dt><samp class="option">transfer_characteristics</samp></dt>
  6671. <dt><samp class="option">matrix_coefficients</samp></dt>
  6672. <dd><p>Set the colour description in the stream (see H.264 section E.2.1
  6673. and tables E-3, E-4 and E-5).
  6674. </p>
  6675. </dd>
  6676. <dt><samp class="option">chroma_sample_loc_type</samp></dt>
  6677. <dd><p>Set the chroma sample location in the stream (see H.264 section
  6678. E.2.1 and figure E-1).
  6679. </p>
  6680. </dd>
  6681. <dt><samp class="option">tick_rate</samp></dt>
  6682. <dd><p>Set the tick rate (time_scale / num_units_in_tick) in the VUI
  6683. parameters. This is the smallest time unit representable in the
  6684. stream, and in many cases represents the field rate of the stream
  6685. (double the frame rate).
  6686. </p></dd>
  6687. <dt><samp class="option">fixed_frame_rate_flag</samp></dt>
  6688. <dd><p>Set whether the stream has fixed framerate - typically this indicates
  6689. that the framerate is exactly half the tick rate, but the exact
  6690. meaning is dependent on interlacing and the picture structure (see
  6691. H.264 section E.2.1 and table E-6).
  6692. </p></dd>
  6693. <dt><samp class="option">zero_new_constraint_set_flags</samp></dt>
  6694. <dd><p>Zero constraint_set4_flag and constraint_set5_flag in the SPS. These
  6695. bits were reserved in a previous version of the H.264 spec, and thus
  6696. some hardware decoders require these to be zero. The result of zeroing
  6697. this is still a valid bitstream.
  6698. </p>
  6699. </dd>
  6700. <dt><samp class="option">crop_left</samp></dt>
  6701. <dt><samp class="option">crop_right</samp></dt>
  6702. <dt><samp class="option">crop_top</samp></dt>
  6703. <dt><samp class="option">crop_bottom</samp></dt>
  6704. <dd><p>Set the frame cropping offsets in the SPS. These values will replace
  6705. the current ones if the stream is already cropped.
  6706. </p>
  6707. <p>These fields are set in pixels. Note that some sizes may not be
  6708. representable if the chroma is subsampled or the stream is interlaced
  6709. (see H.264 section 7.4.2.1.1).
  6710. </p>
  6711. </dd>
  6712. <dt><samp class="option">sei_user_data</samp></dt>
  6713. <dd><p>Insert a string as SEI unregistered user data. The argument must
  6714. be of the form <em class="emph">UUID+string</em>, where the UUID is as hex digits
  6715. possibly separated by hyphens, and the string can be anything.
  6716. </p>
  6717. <p>For example, &lsquo;<samp class="samp">086f3693-b7b3-4f2c-9653-21492feee5b8+hello</samp>&rsquo; will
  6718. insert the string &ldquo;hello&rdquo; associated with the given UUID.
  6719. </p>
  6720. </dd>
  6721. <dt><samp class="option">delete_filler</samp></dt>
  6722. <dd><p>Deletes both filler NAL units and filler SEI messages.
  6723. </p>
  6724. </dd>
  6725. <dt><samp class="option">display_orientation</samp></dt>
  6726. <dd><p>Insert, extract or remove Display orientation SEI messages.
  6727. See H.264 section D.1.27 and D.2.27 for syntax and semantics.
  6728. </p>
  6729. <dl class="table">
  6730. <dt>&lsquo;<samp class="samp">pass</samp>&rsquo;</dt>
  6731. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  6732. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  6733. <dt>&lsquo;<samp class="samp">extract</samp>&rsquo;</dt>
  6734. </dl>
  6735. <p>Default is pass.
  6736. </p>
  6737. <p>Insert mode works in conjunction with <code class="code">rotate</code> and <code class="code">flip</code> options.
  6738. Any pre-existing Display orientation messages will be removed in insert or remove mode.
  6739. Extract mode attaches the display matrix to the packet as side data.
  6740. </p>
  6741. </dd>
  6742. <dt><samp class="option">rotate</samp></dt>
  6743. <dd><p>Set rotation in display orientation SEI (anticlockwise angle in degrees).
  6744. Range is -360 to +360. Default is NaN.
  6745. </p>
  6746. </dd>
  6747. <dt><samp class="option">flip</samp></dt>
  6748. <dd><p>Set flip in display orientation SEI.
  6749. </p>
  6750. <dl class="table">
  6751. <dt>&lsquo;<samp class="samp">horizontal</samp>&rsquo;</dt>
  6752. <dt>&lsquo;<samp class="samp">vertical</samp>&rsquo;</dt>
  6753. </dl>
  6754. <p>Default is unset.
  6755. </p>
  6756. </dd>
  6757. <dt><samp class="option">level</samp></dt>
  6758. <dd><p>Set the level in the SPS. Refer to H.264 section A.3 and tables A-1
  6759. to A-5.
  6760. </p>
  6761. <p>The argument must be the name of a level (for example, &lsquo;<samp class="samp">4.2</samp>&rsquo;), a
  6762. level_idc value (for example, &lsquo;<samp class="samp">42</samp>&rsquo;), or the special name &lsquo;<samp class="samp">auto</samp>&rsquo;
  6763. indicating that the filter should attempt to guess the level from the
  6764. input stream properties.
  6765. </p>
  6766. </dd>
  6767. </dl>
  6768. </div>
  6769. <div class="section-level-extent" id="h264_005fmp4toannexb">
  6770. <h3 class="section"><span>11.12 h264_mp4toannexb<a class="copiable-link" href="#h264_005fmp4toannexb"> &para;</a></span></h3>
  6771. <p>Convert an H.264 bitstream from length prefixed mode to start code
  6772. prefixed mode (as defined in the Annex B of the ITU-T H.264
  6773. specification).
  6774. </p>
  6775. <p>This is required by some streaming formats, typically the MPEG-2
  6776. transport stream format (muxer <code class="code">mpegts</code>).
  6777. </p>
  6778. <p>For example to remux an MP4 file containing an H.264 stream to mpegts
  6779. format with <code class="command">ffmpeg</code>, you can use the command:
  6780. </p>
  6781. <div class="example">
  6782. <pre class="example-preformatted">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
  6783. </pre></div>
  6784. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  6785. <code class="code">mpegts</code>) and raw H.264 (muxer <code class="code">h264</code>) output formats.
  6786. </p>
  6787. </div>
  6788. <div class="section-level-extent" id="h264_005fredundant_005fpps">
  6789. <h3 class="section"><span>11.13 h264_redundant_pps<a class="copiable-link" href="#h264_005fredundant_005fpps"> &para;</a></span></h3>
  6790. <p>This applies a specific fixup to some Blu-ray streams which contain
  6791. redundant PPSs modifying irrelevant parameters of the stream which
  6792. confuse other transformations which require correct extradata.
  6793. </p>
  6794. </div>
  6795. <div class="section-level-extent" id="hevc_005fmetadata">
  6796. <h3 class="section"><span>11.14 hevc_metadata<a class="copiable-link" href="#hevc_005fmetadata"> &para;</a></span></h3>
  6797. <p>Modify metadata embedded in an HEVC stream.
  6798. </p>
  6799. <dl class="table">
  6800. <dt><samp class="option">aud</samp></dt>
  6801. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  6802. </p>
  6803. <dl class="table">
  6804. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  6805. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  6806. </dl>
  6807. </dd>
  6808. <dt><samp class="option">sample_aspect_ratio</samp></dt>
  6809. <dd><p>Set the sample aspect ratio in the stream in the VUI parameters.
  6810. </p>
  6811. </dd>
  6812. <dt><samp class="option">video_format</samp></dt>
  6813. <dt><samp class="option">video_full_range_flag</samp></dt>
  6814. <dd><p>Set the video format in the stream (see H.265 section E.3.1 and
  6815. table E.2).
  6816. </p>
  6817. </dd>
  6818. <dt><samp class="option">colour_primaries</samp></dt>
  6819. <dt><samp class="option">transfer_characteristics</samp></dt>
  6820. <dt><samp class="option">matrix_coefficients</samp></dt>
  6821. <dd><p>Set the colour description in the stream (see H.265 section E.3.1
  6822. and tables E.3, E.4 and E.5).
  6823. </p>
  6824. </dd>
  6825. <dt><samp class="option">chroma_sample_loc_type</samp></dt>
  6826. <dd><p>Set the chroma sample location in the stream (see H.265 section
  6827. E.3.1 and figure E.1).
  6828. </p>
  6829. </dd>
  6830. <dt><samp class="option">tick_rate</samp></dt>
  6831. <dd><p>Set the tick rate in the VPS and VUI parameters (time_scale /
  6832. num_units_in_tick). Combined with <samp class="option">num_ticks_poc_diff_one</samp>, this can
  6833. set a constant framerate in the stream. Note that it is likely to be
  6834. overridden by container parameters when the stream is in a container.
  6835. </p>
  6836. </dd>
  6837. <dt><samp class="option">num_ticks_poc_diff_one</samp></dt>
  6838. <dd><p>Set poc_proportional_to_timing_flag in VPS and VUI and use this value
  6839. to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and
  6840. E.3.1). Ignored if <samp class="option">tick_rate</samp> is not also set.
  6841. </p>
  6842. </dd>
  6843. <dt><samp class="option">crop_left</samp></dt>
  6844. <dt><samp class="option">crop_right</samp></dt>
  6845. <dt><samp class="option">crop_top</samp></dt>
  6846. <dt><samp class="option">crop_bottom</samp></dt>
  6847. <dd><p>Set the conformance window cropping offsets in the SPS. These values
  6848. will replace the current ones if the stream is already cropped.
  6849. </p>
  6850. <p>These fields are set in pixels. Note that some sizes may not be
  6851. representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
  6852. </p>
  6853. </dd>
  6854. <dt><samp class="option">level</samp></dt>
  6855. <dd><p>Set the level in the VPS and SPS. See H.265 section A.4 and tables
  6856. A.6 and A.7.
  6857. </p>
  6858. <p>The argument must be the name of a level (for example, &lsquo;<samp class="samp">5.1</samp>&rsquo;), a
  6859. <em class="emph">general_level_idc</em> value (for example, &lsquo;<samp class="samp">153</samp>&rsquo; for level 5.1),
  6860. or the special name &lsquo;<samp class="samp">auto</samp>&rsquo; indicating that the filter should
  6861. attempt to guess the level from the input stream properties.
  6862. </p>
  6863. </dd>
  6864. </dl>
  6865. </div>
  6866. <div class="section-level-extent" id="hevc_005fmp4toannexb">
  6867. <h3 class="section"><span>11.15 hevc_mp4toannexb<a class="copiable-link" href="#hevc_005fmp4toannexb"> &para;</a></span></h3>
  6868. <p>Convert an HEVC/H.265 bitstream from length prefixed mode to start code
  6869. prefixed mode (as defined in the Annex B of the ITU-T H.265
  6870. specification).
  6871. </p>
  6872. <p>This is required by some streaming formats, typically the MPEG-2
  6873. transport stream format (muxer <code class="code">mpegts</code>).
  6874. </p>
  6875. <p>For example to remux an MP4 file containing an HEVC stream to mpegts
  6876. format with <code class="command">ffmpeg</code>, you can use the command:
  6877. </p>
  6878. <div class="example">
  6879. <pre class="example-preformatted">ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
  6880. </pre></div>
  6881. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  6882. <code class="code">mpegts</code>) and raw HEVC/H.265 (muxer <code class="code">h265</code> or
  6883. <code class="code">hevc</code>) output formats.
  6884. </p>
  6885. </div>
  6886. <div class="section-level-extent" id="imxdump">
  6887. <h3 class="section"><span>11.16 imxdump<a class="copiable-link" href="#imxdump"> &para;</a></span></h3>
  6888. <p>Modifies the bitstream to fit in MOV and to be usable by the Final Cut
  6889. Pro decoder. This filter only applies to the mpeg2video codec, and is
  6890. likely not needed for Final Cut Pro 7 and newer with the appropriate
  6891. <samp class="option">-tag:v</samp>.
  6892. </p>
  6893. <p>For example, to remux 30 MB/sec NTSC IMX to MOV:
  6894. </p>
  6895. <div class="example">
  6896. <pre class="example-preformatted">ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
  6897. </pre></div>
  6898. </div>
  6899. <div class="section-level-extent" id="mjpeg2jpeg">
  6900. <h3 class="section"><span>11.17 mjpeg2jpeg<a class="copiable-link" href="#mjpeg2jpeg"> &para;</a></span></h3>
  6901. <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
  6902. </p>
  6903. <p>MJPEG is a video codec wherein each video frame is essentially a
  6904. JPEG image. The individual frames can be extracted without loss,
  6905. e.g. by
  6906. </p>
  6907. <div class="example">
  6908. <pre class="example-preformatted">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
  6909. </pre></div>
  6910. <p>Unfortunately, these chunks are incomplete JPEG images, because
  6911. they lack the DHT segment required for decoding. Quoting from
  6912. <a class="url" href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
  6913. </p>
  6914. <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
  6915. commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
  6916. MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
  6917. Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
  6918. and it must use basic Huffman encoding, not arithmetic or
  6919. progressive. . . . You can indeed extract the MJPEG frames and
  6920. decode them with a regular JPEG decoder, but you have to prepend
  6921. the DHT segment to them, or else the decoder won&rsquo;t have any idea
  6922. how to decompress the data. The exact table necessary is given in
  6923. the OpenDML spec.&quot;
  6924. </p>
  6925. <p>This bitstream filter patches the header of frames extracted from an MJPEG
  6926. stream (carrying the AVI1 header ID and lacking a DHT segment) to
  6927. produce fully qualified JPEG images.
  6928. </p>
  6929. <div class="example">
  6930. <pre class="example-preformatted">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
  6931. exiftran -i -9 frame*.jpg
  6932. ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
  6933. </pre></div>
  6934. </div>
  6935. <div class="section-level-extent" id="mjpegadump">
  6936. <h3 class="section"><span>11.18 mjpegadump<a class="copiable-link" href="#mjpegadump"> &para;</a></span></h3>
  6937. <p>Add an MJPEG A header to the bitstream, to enable decoding by
  6938. Quicktime.
  6939. </p>
  6940. <a class="anchor" id="mov2textsub"></a></div>
  6941. <div class="section-level-extent" id="mov2textsub-1">
  6942. <h3 class="section"><span>11.19 mov2textsub<a class="copiable-link" href="#mov2textsub-1"> &para;</a></span></h3>
  6943. <p>Extract a representable text file from MOV subtitles, stripping the
  6944. metadata header from each subtitle packet.
  6945. </p>
  6946. <p>See also the <a class="ref" href="#text2movsub">text2movsub</a> filter.
  6947. </p>
  6948. </div>
  6949. <div class="section-level-extent" id="mpeg2_005fmetadata">
  6950. <h3 class="section"><span>11.20 mpeg2_metadata<a class="copiable-link" href="#mpeg2_005fmetadata"> &para;</a></span></h3>
  6951. <p>Modify metadata embedded in an MPEG-2 stream.
  6952. </p>
  6953. <dl class="table">
  6954. <dt><samp class="option">display_aspect_ratio</samp></dt>
  6955. <dd><p>Set the display aspect ratio in the stream.
  6956. </p>
  6957. <p>The following fixed values are supported:
  6958. </p><dl class="table">
  6959. <dt><samp class="option">4/3</samp></dt>
  6960. <dt><samp class="option">16/9</samp></dt>
  6961. <dt><samp class="option">221/100</samp></dt>
  6962. </dl>
  6963. <p>Any other value will result in square pixels being signalled instead
  6964. (see H.262 section 6.3.3 and table 6-3).
  6965. </p>
  6966. </dd>
  6967. <dt><samp class="option">frame_rate</samp></dt>
  6968. <dd><p>Set the frame rate in the stream. This is constructed from a table
  6969. of known values combined with a small multiplier and divisor - if
  6970. the supplied value is not exactly representable, the nearest
  6971. representable value will be used instead (see H.262 section 6.3.3
  6972. and table 6-4).
  6973. </p>
  6974. </dd>
  6975. <dt><samp class="option">video_format</samp></dt>
  6976. <dd><p>Set the video format in the stream (see H.262 section 6.3.6 and
  6977. table 6-6).
  6978. </p>
  6979. </dd>
  6980. <dt><samp class="option">colour_primaries</samp></dt>
  6981. <dt><samp class="option">transfer_characteristics</samp></dt>
  6982. <dt><samp class="option">matrix_coefficients</samp></dt>
  6983. <dd><p>Set the colour description in the stream (see H.262 section 6.3.6
  6984. and tables 6-7, 6-8 and 6-9).
  6985. </p>
  6986. </dd>
  6987. </dl>
  6988. </div>
  6989. <div class="section-level-extent" id="mpeg4_005funpack_005fbframes">
  6990. <h3 class="section"><span>11.21 mpeg4_unpack_bframes<a class="copiable-link" href="#mpeg4_005funpack_005fbframes"> &para;</a></span></h3>
  6991. <p>Unpack DivX-style packed B-frames.
  6992. </p>
  6993. <p>DivX-style packed B-frames are not valid MPEG-4 and were only a
  6994. workaround for the broken Video for Windows subsystem.
  6995. They use more space, can cause minor AV sync issues, require more
  6996. CPU power to decode (unless the player has some decoded picture queue
  6997. to compensate the 2,0,2,0 frame per packet style) and cause
  6998. trouble if copied into a standard container like mp4 or mpeg-ps/ts,
  6999. because MPEG-4 decoders may not be able to decode them, since they are
  7000. not valid MPEG-4.
  7001. </p>
  7002. <p>For example to fix an AVI file containing an MPEG-4 stream with
  7003. DivX-style packed B-frames using <code class="command">ffmpeg</code>, you can use the command:
  7004. </p>
  7005. <div class="example">
  7006. <pre class="example-preformatted">ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
  7007. </pre></div>
  7008. </div>
  7009. <div class="section-level-extent" id="noise">
  7010. <h3 class="section"><span>11.22 noise<a class="copiable-link" href="#noise"> &para;</a></span></h3>
  7011. <p>Damages the contents of packets or simply drops them without damaging the
  7012. container. Can be used for fuzzing or testing error resilience/concealment.
  7013. </p>
  7014. <p>Parameters:
  7015. </p><dl class="table">
  7016. <dt><samp class="option">amount</samp></dt>
  7017. <dd><p>Accepts an expression whose evaluation per-packet determines how often bytes in that
  7018. packet will be modified. A value below 0 will result in a variable frequency.
  7019. Default is 0 which results in no modification. However, if neither amount nor drop is specified,
  7020. amount will be set to <var class="var">-1</var>. See below for accepted variables.
  7021. </p></dd>
  7022. <dt><samp class="option">drop</samp></dt>
  7023. <dd><p>Accepts an expression evaluated per-packet whose value determines whether that packet is dropped.
  7024. Evaluation to a positive value results in the packet being dropped. Evaluation to a negative
  7025. value results in a variable chance of it being dropped, roughly inverse in proportion to the magnitude
  7026. of the value. Default is 0 which results in no drops. See below for accepted variables.
  7027. </p></dd>
  7028. <dt><samp class="option">dropamount</samp></dt>
  7029. <dd><p>Accepts a non-negative integer, which assigns a variable chance of it being dropped, roughly inverse
  7030. in proportion to the value. Default is 0 which results in no drops. This option is kept for backwards
  7031. compatibility and is equivalent to setting drop to a negative value with the same magnitude
  7032. i.e. <code class="code">dropamount=4</code> is the same as <code class="code">drop=-4</code>. Ignored if drop is also specified.
  7033. </p></dd>
  7034. </dl>
  7035. <p>Both <code class="code">amount</code> and <code class="code">drop</code> accept expressions containing the following variables:
  7036. </p>
  7037. <dl class="table">
  7038. <dt>&lsquo;<samp class="samp">n</samp>&rsquo;</dt>
  7039. <dd><p>The index of the packet, starting from zero.
  7040. </p></dd>
  7041. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  7042. <dd><p>The timebase for packet timestamps.
  7043. </p></dd>
  7044. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  7045. <dd><p>Packet presentation timestamp.
  7046. </p></dd>
  7047. <dt>&lsquo;<samp class="samp">dts</samp>&rsquo;</dt>
  7048. <dd><p>Packet decoding timestamp.
  7049. </p></dd>
  7050. <dt>&lsquo;<samp class="samp">nopts</samp>&rsquo;</dt>
  7051. <dd><p>Constant representing AV_NOPTS_VALUE.
  7052. </p></dd>
  7053. <dt>&lsquo;<samp class="samp">startpts</samp>&rsquo;</dt>
  7054. <dd><p>First non-AV_NOPTS_VALUE PTS seen in the stream.
  7055. </p></dd>
  7056. <dt>&lsquo;<samp class="samp">startdts</samp>&rsquo;</dt>
  7057. <dd><p>First non-AV_NOPTS_VALUE DTS seen in the stream.
  7058. </p></dd>
  7059. <dt>&lsquo;<samp class="samp">duration</samp>&rsquo;</dt>
  7060. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  7061. <dd><p>Packet duration, in timebase units.
  7062. </p></dd>
  7063. <dt>&lsquo;<samp class="samp">pos</samp>&rsquo;</dt>
  7064. <dd><p>Packet position in input; may be -1 when unknown or not set.
  7065. </p></dd>
  7066. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  7067. <dd><p>Packet size, in bytes.
  7068. </p></dd>
  7069. <dt>&lsquo;<samp class="samp">key</samp>&rsquo;</dt>
  7070. <dd><p>Whether packet is marked as a keyframe.
  7071. </p></dd>
  7072. <dt>&lsquo;<samp class="samp">state</samp>&rsquo;</dt>
  7073. <dd><p>A pseudo random integer, primarily derived from the content of packet payload.
  7074. </p></dd>
  7075. </dl>
  7076. <ul class="mini-toc">
  7077. <li><a href="#Examples-2" accesskey="1">Examples</a></li>
  7078. </ul>
  7079. <div class="subsection-level-extent" id="Examples-2">
  7080. <h4 class="subsection"><span>11.22.1 Examples<a class="copiable-link" href="#Examples-2"> &para;</a></span></h4>
  7081. <p>Apply modification to every byte but don&rsquo;t drop any packets.
  7082. </p><div class="example">
  7083. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv
  7084. </pre></div>
  7085. <p>Drop every video packet not marked as a keyframe after timestamp 30s but do not
  7086. modify any of the remaining packets.
  7087. </p><div class="example">
  7088. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(t\,30)*not(key)' output.mkv
  7089. </pre></div>
  7090. <p>Drop one second of audio every 10 seconds and add some random noise to the rest.
  7091. </p><div class="example">
  7092. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(t\,10)\,9\,10)' output.mkv
  7093. </pre></div>
  7094. </div>
  7095. </div>
  7096. <div class="section-level-extent" id="null">
  7097. <h3 class="section"><span>11.23 null<a class="copiable-link" href="#null"> &para;</a></span></h3>
  7098. <p>This bitstream filter passes the packets through unchanged.
  7099. </p>
  7100. </div>
  7101. <div class="section-level-extent" id="pcm_005frechunk">
  7102. <h3 class="section"><span>11.24 pcm_rechunk<a class="copiable-link" href="#pcm_005frechunk"> &para;</a></span></h3>
  7103. <p>Repacketize PCM audio to a fixed number of samples per packet or a fixed packet
  7104. rate per second. This is similar to the <a data-manual="ffmpeg-filters" href="ffmpeg-filters.html#asetnsamples">asetnsamples audio
  7105. filter</a> but works on audio packets instead of audio frames.
  7106. </p>
  7107. <dl class="table">
  7108. <dt><samp class="option">nb_out_samples, n</samp></dt>
  7109. <dd><p>Set the number of samples per each output audio packet. The number is intended
  7110. as the number of samples <em class="emph">per each channel</em>. Default value is 1024.
  7111. </p>
  7112. </dd>
  7113. <dt><samp class="option">pad, p</samp></dt>
  7114. <dd><p>If set to 1, the filter will pad the last audio packet with silence, so that it
  7115. will contain the same number of samples (or roughly the same number of samples,
  7116. see <samp class="option">frame_rate</samp>) as the previous ones. Default value is 1.
  7117. </p>
  7118. </dd>
  7119. <dt><samp class="option">frame_rate, r</samp></dt>
  7120. <dd><p>This option makes the filter output a fixed number of packets per second instead
  7121. of a fixed number of samples per packet. If the audio sample rate is not
  7122. divisible by the frame rate then the number of samples will not be constant but
  7123. will vary slightly so that each packet will start as close to the frame
  7124. boundary as possible. Using this option has precedence over <samp class="option">nb_out_samples</samp>.
  7125. </p></dd>
  7126. </dl>
  7127. <p>You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio
  7128. for NTSC frame rate using the <samp class="option">frame_rate</samp> option.
  7129. </p><div class="example">
  7130. <pre class="example-preformatted">ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
  7131. </pre></div>
  7132. </div>
  7133. <div class="section-level-extent" id="pgs_005fframe_005fmerge">
  7134. <h3 class="section"><span>11.25 pgs_frame_merge<a class="copiable-link" href="#pgs_005fframe_005fmerge"> &para;</a></span></h3>
  7135. <p>Merge a sequence of PGS Subtitle segments ending with an &quot;end of display set&quot;
  7136. segment into a single packet.
  7137. </p>
  7138. <p>This is required by some containers that support PGS subtitles
  7139. (muxer <code class="code">matroska</code>).
  7140. </p>
  7141. </div>
  7142. <div class="section-level-extent" id="prores_005fmetadata">
  7143. <h3 class="section"><span>11.26 prores_metadata<a class="copiable-link" href="#prores_005fmetadata"> &para;</a></span></h3>
  7144. <p>Modify color property metadata embedded in prores stream.
  7145. </p>
  7146. <dl class="table">
  7147. <dt><samp class="option">color_primaries</samp></dt>
  7148. <dd><p>Set the color primaries.
  7149. Available values are:
  7150. </p>
  7151. <dl class="table">
  7152. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  7153. <dd><p>Keep the same color primaries property (default).
  7154. </p>
  7155. </dd>
  7156. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  7157. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  7158. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  7159. <dd><p>BT601 625
  7160. </p>
  7161. </dd>
  7162. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  7163. <dd><p>BT601 525
  7164. </p>
  7165. </dd>
  7166. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  7167. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  7168. <dd><p>DCI P3
  7169. </p>
  7170. </dd>
  7171. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  7172. <dd><p>P3 D65
  7173. </p>
  7174. </dd>
  7175. </dl>
  7176. </dd>
  7177. <dt><samp class="option">transfer_characteristics</samp></dt>
  7178. <dd><p>Set the color transfer.
  7179. Available values are:
  7180. </p>
  7181. <dl class="table">
  7182. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  7183. <dd><p>Keep the same transfer characteristics property (default).
  7184. </p>
  7185. </dd>
  7186. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  7187. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  7188. <dd><p>BT 601, BT 709, BT 2020
  7189. </p></dd>
  7190. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  7191. <dd><p>SMPTE ST 2084
  7192. </p></dd>
  7193. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  7194. <dd><p>ARIB STD-B67
  7195. </p></dd>
  7196. </dl>
  7197. </dd>
  7198. <dt><samp class="option">matrix_coefficients</samp></dt>
  7199. <dd><p>Set the matrix coefficient.
  7200. Available values are:
  7201. </p>
  7202. <dl class="table">
  7203. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  7204. <dd><p>Keep the same colorspace property (default).
  7205. </p>
  7206. </dd>
  7207. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  7208. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  7209. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  7210. <dd><p>BT 601
  7211. </p>
  7212. </dd>
  7213. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  7214. </dl>
  7215. </dd>
  7216. </dl>
  7217. <p>Set Rec709 colorspace for each frame of the file
  7218. </p><div class="example">
  7219. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
  7220. </pre></div>
  7221. <p>Set Hybrid Log-Gamma parameters for each frame of the file
  7222. </p><div class="example">
  7223. <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
  7224. </pre></div>
  7225. </div>
  7226. <div class="section-level-extent" id="remove_005fextra">
  7227. <h3 class="section"><span>11.27 remove_extra<a class="copiable-link" href="#remove_005fextra"> &para;</a></span></h3>
  7228. <p>Remove extradata from packets.
  7229. </p>
  7230. <p>It accepts the following parameter:
  7231. </p><dl class="table">
  7232. <dt><samp class="option">freq</samp></dt>
  7233. <dd><p>Set which frame types to remove extradata from.
  7234. </p>
  7235. <dl class="table">
  7236. <dt>&lsquo;<samp class="samp">k</samp>&rsquo;</dt>
  7237. <dd><p>Remove extradata from non-keyframes only.
  7238. </p>
  7239. </dd>
  7240. <dt>&lsquo;<samp class="samp">keyframe</samp>&rsquo;</dt>
  7241. <dd><p>Remove extradata from keyframes only.
  7242. </p>
  7243. </dd>
  7244. <dt>&lsquo;<samp class="samp">e, all</samp>&rsquo;</dt>
  7245. <dd><p>Remove extradata from all frames.
  7246. </p>
  7247. </dd>
  7248. </dl>
  7249. </dd>
  7250. </dl>
  7251. </div>
  7252. <div class="section-level-extent" id="setts">
  7253. <h3 class="section"><span>11.28 setts<a class="copiable-link" href="#setts"> &para;</a></span></h3>
  7254. <p>Set PTS and DTS in packets.
  7255. </p>
  7256. <p>It accepts the following parameters:
  7257. </p><dl class="table">
  7258. <dt><samp class="option">ts</samp></dt>
  7259. <dt><samp class="option">pts</samp></dt>
  7260. <dt><samp class="option">dts</samp></dt>
  7261. <dd><p>Set expressions for PTS, DTS or both.
  7262. </p></dd>
  7263. <dt><samp class="option">duration</samp></dt>
  7264. <dd><p>Set expression for duration.
  7265. </p></dd>
  7266. <dt><samp class="option">time_base</samp></dt>
  7267. <dd><p>Set output time base.
  7268. </p></dd>
  7269. </dl>
  7270. <p>The expressions are evaluated through the eval API and can contain the following
  7271. constants:
  7272. </p>
  7273. <dl class="table">
  7274. <dt><samp class="option">N</samp></dt>
  7275. <dd><p>The count of the input packet. Starting from 0.
  7276. </p>
  7277. </dd>
  7278. <dt><samp class="option">TS</samp></dt>
  7279. <dd><p>The demux timestamp in input in case of <code class="code">ts</code> or <code class="code">dts</code> option or presentation
  7280. timestamp in case of <code class="code">pts</code> option.
  7281. </p>
  7282. </dd>
  7283. <dt><samp class="option">POS</samp></dt>
  7284. <dd><p>The original position in the file of the packet, or undefined if undefined
  7285. for the current packet
  7286. </p>
  7287. </dd>
  7288. <dt><samp class="option">DTS</samp></dt>
  7289. <dd><p>The demux timestamp in input.
  7290. </p>
  7291. </dd>
  7292. <dt><samp class="option">PTS</samp></dt>
  7293. <dd><p>The presentation timestamp in input.
  7294. </p>
  7295. </dd>
  7296. <dt><samp class="option">DURATION</samp></dt>
  7297. <dd><p>The duration in input.
  7298. </p>
  7299. </dd>
  7300. <dt><samp class="option">STARTDTS</samp></dt>
  7301. <dd><p>The DTS of the first packet.
  7302. </p>
  7303. </dd>
  7304. <dt><samp class="option">STARTPTS</samp></dt>
  7305. <dd><p>The PTS of the first packet.
  7306. </p>
  7307. </dd>
  7308. <dt><samp class="option">PREV_INDTS</samp></dt>
  7309. <dd><p>The previous input DTS.
  7310. </p>
  7311. </dd>
  7312. <dt><samp class="option">PREV_INPTS</samp></dt>
  7313. <dd><p>The previous input PTS.
  7314. </p>
  7315. </dd>
  7316. <dt><samp class="option">PREV_INDURATION</samp></dt>
  7317. <dd><p>The previous input duration.
  7318. </p>
  7319. </dd>
  7320. <dt><samp class="option">PREV_OUTDTS</samp></dt>
  7321. <dd><p>The previous output DTS.
  7322. </p>
  7323. </dd>
  7324. <dt><samp class="option">PREV_OUTPTS</samp></dt>
  7325. <dd><p>The previous output PTS.
  7326. </p>
  7327. </dd>
  7328. <dt><samp class="option">PREV_OUTDURATION</samp></dt>
  7329. <dd><p>The previous output duration.
  7330. </p>
  7331. </dd>
  7332. <dt><samp class="option">NEXT_DTS</samp></dt>
  7333. <dd><p>The next input DTS.
  7334. </p>
  7335. </dd>
  7336. <dt><samp class="option">NEXT_PTS</samp></dt>
  7337. <dd><p>The next input PTS.
  7338. </p>
  7339. </dd>
  7340. <dt><samp class="option">NEXT_DURATION</samp></dt>
  7341. <dd><p>The next input duration.
  7342. </p>
  7343. </dd>
  7344. <dt><samp class="option">TB</samp></dt>
  7345. <dd><p>The timebase of stream packet belongs.
  7346. </p>
  7347. </dd>
  7348. <dt><samp class="option">TB_OUT</samp></dt>
  7349. <dd><p>The output timebase.
  7350. </p>
  7351. </dd>
  7352. <dt><samp class="option">SR</samp></dt>
  7353. <dd><p>The sample rate of stream packet belongs.
  7354. </p>
  7355. </dd>
  7356. <dt><samp class="option">NOPTS</samp></dt>
  7357. <dd><p>The AV_NOPTS_VALUE constant.
  7358. </p></dd>
  7359. </dl>
  7360. <p>For example, to set PTS equal to DTS (not recommended if B-frames are involved):
  7361. </p><div class="example">
  7362. <pre class="example-preformatted">ffmpeg -i INPUT -c:a copy -bsf:a setts=pts=DTS out.mkv
  7363. </pre></div>
  7364. </div>
  7365. <div class="section-level-extent" id="showinfo">
  7366. <h3 class="section"><span>11.29 showinfo<a class="copiable-link" href="#showinfo"> &para;</a></span></h3>
  7367. <p>Log basic packet information. Mainly useful for testing, debugging,
  7368. and development.
  7369. </p>
  7370. <a class="anchor" id="text2movsub"></a></div>
  7371. <div class="section-level-extent" id="text2movsub-1">
  7372. <h3 class="section"><span>11.30 text2movsub<a class="copiable-link" href="#text2movsub-1"> &para;</a></span></h3>
  7373. <p>Convert text subtitles to MOV subtitles (as used by the <code class="code">mov_text</code>
  7374. codec) with metadata headers.
  7375. </p>
  7376. <p>See also the <a class="ref" href="#mov2textsub">mov2textsub</a> filter.
  7377. </p>
  7378. </div>
  7379. <div class="section-level-extent" id="trace_005fheaders">
  7380. <h3 class="section"><span>11.31 trace_headers<a class="copiable-link" href="#trace_005fheaders"> &para;</a></span></h3>
  7381. <p>Log trace output containing all syntax elements in the coded stream
  7382. headers (everything above the level of individual coded blocks).
  7383. This can be useful for debugging low-level stream issues.
  7384. </p>
  7385. <p>Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending
  7386. on the build only a subset of these may be available.
  7387. </p>
  7388. </div>
  7389. <div class="section-level-extent" id="truehd_005fcore">
  7390. <h3 class="section"><span>11.32 truehd_core<a class="copiable-link" href="#truehd_005fcore"> &para;</a></span></h3>
  7391. <p>Extract the core from a TrueHD stream, dropping ATMOS data.
  7392. </p>
  7393. </div>
  7394. <div class="section-level-extent" id="vp9_005fmetadata">
  7395. <h3 class="section"><span>11.33 vp9_metadata<a class="copiable-link" href="#vp9_005fmetadata"> &para;</a></span></h3>
  7396. <p>Modify metadata embedded in a VP9 stream.
  7397. </p>
  7398. <dl class="table">
  7399. <dt><samp class="option">color_space</samp></dt>
  7400. <dd><p>Set the color space value in the frame header. Note that any frame
  7401. set to RGB will be implicitly set to PC range and that RGB is
  7402. incompatible with profiles 0 and 2.
  7403. </p><dl class="table">
  7404. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  7405. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  7406. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  7407. <dt>&lsquo;<samp class="samp">smpte170</samp>&rsquo;</dt>
  7408. <dt>&lsquo;<samp class="samp">smpte240</samp>&rsquo;</dt>
  7409. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  7410. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  7411. </dl>
  7412. </dd>
  7413. <dt><samp class="option">color_range</samp></dt>
  7414. <dd><p>Set the color range value in the frame header. Note that any value
  7415. imposed by the color space will take precedence over this value.
  7416. </p><dl class="table">
  7417. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  7418. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  7419. </dl>
  7420. </dd>
  7421. </dl>
  7422. </div>
  7423. <div class="section-level-extent" id="vp9_005fsuperframe">
  7424. <h3 class="section"><span>11.34 vp9_superframe<a class="copiable-link" href="#vp9_005fsuperframe"> &para;</a></span></h3>
  7425. <p>Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This
  7426. fixes merging of split/segmented VP9 streams where the alt-ref frame
  7427. was split from its visible counterpart.
  7428. </p>
  7429. </div>
  7430. <div class="section-level-extent" id="vp9_005fsuperframe_005fsplit">
  7431. <h3 class="section"><span>11.35 vp9_superframe_split<a class="copiable-link" href="#vp9_005fsuperframe_005fsplit"> &para;</a></span></h3>
  7432. <p>Split VP9 superframes into single frames.
  7433. </p>
  7434. </div>
  7435. <div class="section-level-extent" id="vp9_005fraw_005freorder">
  7436. <h3 class="section"><span>11.36 vp9_raw_reorder<a class="copiable-link" href="#vp9_005fraw_005freorder"> &para;</a></span></h3>
  7437. <p>Given a VP9 stream with correct timestamps but possibly out of order,
  7438. insert additional show-existing-frame packets to correct the ordering.
  7439. </p>
  7440. </div>
  7441. </div>
  7442. <div class="chapter-level-extent" id="Format-Options">
  7443. <h2 class="chapter"><span>12 Format Options<a class="copiable-link" href="#Format-Options"> &para;</a></span></h2>
  7444. <p>The libavformat library provides some generic global options, which
  7445. can be set on all the muxers and demuxers. In addition each muxer or
  7446. demuxer may support so-called private options, which are specific for
  7447. that component.
  7448. </p>
  7449. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  7450. FFmpeg tools, or by setting the value explicitly in the
  7451. <code class="code">AVFormatContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  7452. for programmatic use.
  7453. </p>
  7454. <p>The list of supported options follows:
  7455. </p>
  7456. <dl class="table">
  7457. <dt><samp class="option">avioflags <var class="var">flags</var> (<em class="emph">input/output</em>)</samp></dt>
  7458. <dd><p>Possible values:
  7459. </p><dl class="table">
  7460. <dt>&lsquo;<samp class="samp">direct</samp>&rsquo;</dt>
  7461. <dd><p>Reduce buffering.
  7462. </p></dd>
  7463. </dl>
  7464. </dd>
  7465. <dt><samp class="option">probesize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7466. <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
  7467. stream information. A higher value will enable detecting more
  7468. information in case it is dispersed into the stream, but will increase
  7469. latency. Must be an integer not lesser than 32. It is 5000000 by default.
  7470. </p>
  7471. </dd>
  7472. <dt><samp class="option">max_probe_packets <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7473. <dd><p>Set the maximum number of buffered packets when probing a codec.
  7474. Default is 2500 packets.
  7475. </p>
  7476. </dd>
  7477. <dt><samp class="option">packetsize <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7478. <dd><p>Set packet size.
  7479. </p>
  7480. </dd>
  7481. <dt><samp class="option">fflags <var class="var">flags</var></samp></dt>
  7482. <dd><p>Set format flags. Some are implemented for a limited number of formats.
  7483. </p>
  7484. <p>Possible values for input files:
  7485. </p><dl class="table">
  7486. <dt>&lsquo;<samp class="samp">discardcorrupt</samp>&rsquo;</dt>
  7487. <dd><p>Discard corrupted packets.
  7488. </p></dd>
  7489. <dt>&lsquo;<samp class="samp">fastseek</samp>&rsquo;</dt>
  7490. <dd><p>Enable fast, but inaccurate seeks for some formats.
  7491. </p></dd>
  7492. <dt>&lsquo;<samp class="samp">genpts</samp>&rsquo;</dt>
  7493. <dd><p>Generate missing PTS if DTS is present.
  7494. </p></dd>
  7495. <dt>&lsquo;<samp class="samp">igndts</samp>&rsquo;</dt>
  7496. <dd><p>Ignore DTS if PTS is also set. In case the PTS is set, the DTS value
  7497. is set to NOPTS. This is ignored when the <code class="code">nofillin</code> flag is set.
  7498. </p></dd>
  7499. <dt>&lsquo;<samp class="samp">ignidx</samp>&rsquo;</dt>
  7500. <dd><p>Ignore index.
  7501. </p></dd>
  7502. <dt>&lsquo;<samp class="samp">nobuffer</samp>&rsquo;</dt>
  7503. <dd><p>Reduce the latency introduced by buffering during initial input streams analysis.
  7504. </p></dd>
  7505. <dt>&lsquo;<samp class="samp">nofillin</samp>&rsquo;</dt>
  7506. <dd><p>Do not fill in missing values in packet fields that can be exactly calculated.
  7507. </p></dd>
  7508. <dt>&lsquo;<samp class="samp">noparse</samp>&rsquo;</dt>
  7509. <dd><p>Disable AVParsers, this needs <code class="code">+nofillin</code> too.
  7510. </p></dd>
  7511. <dt>&lsquo;<samp class="samp">sortdts</samp>&rsquo;</dt>
  7512. <dd><p>Try to interleave output packets by DTS. At present, available only for AVIs with an index.
  7513. </p></dd>
  7514. </dl>
  7515. <p>Possible values for output files:
  7516. </p><dl class="table">
  7517. <dt>&lsquo;<samp class="samp">autobsf</samp>&rsquo;</dt>
  7518. <dd><p>Automatically apply bitstream filters as required by the output format. Enabled by default.
  7519. </p></dd>
  7520. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  7521. <dd><p>Only write platform-, build- and time-independent data.
  7522. This ensures that file and data checksums are reproducible and match between
  7523. platforms. Its primary use is for regression testing.
  7524. </p></dd>
  7525. <dt>&lsquo;<samp class="samp">flush_packets</samp>&rsquo;</dt>
  7526. <dd><p>Write out packets immediately.
  7527. </p></dd>
  7528. <dt>&lsquo;<samp class="samp">shortest</samp>&rsquo;</dt>
  7529. <dd><p>Stop muxing at the end of the shortest stream.
  7530. It may be needed to increase max_interleave_delta to avoid flushing the longer
  7531. streams before EOF.
  7532. </p></dd>
  7533. </dl>
  7534. </dd>
  7535. <dt><samp class="option">seek2any <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7536. <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  7537. Default is 0.
  7538. </p>
  7539. </dd>
  7540. <dt><samp class="option">analyzeduration <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7541. <dd><p>Specify how many microseconds are analyzed to probe the input. A
  7542. higher value will enable detecting more accurate information, but will
  7543. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  7544. </p>
  7545. </dd>
  7546. <dt><samp class="option">cryptokey <var class="var">hexadecimal string</var> (<em class="emph">input</em>)</samp></dt>
  7547. <dd><p>Set decryption key.
  7548. </p>
  7549. </dd>
  7550. <dt><samp class="option">indexmem <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7551. <dd><p>Set max memory used for timestamp index (per stream).
  7552. </p>
  7553. </dd>
  7554. <dt><samp class="option">rtbufsize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7555. <dd><p>Set max memory used for buffering real-time frames.
  7556. </p>
  7557. </dd>
  7558. <dt><samp class="option">fdebug <var class="var">flags</var> (<em class="emph">input/output</em>)</samp></dt>
  7559. <dd><p>Print specific debug info.
  7560. </p>
  7561. <p>Possible values:
  7562. </p><dl class="table">
  7563. <dt>&lsquo;<samp class="samp">ts</samp>&rsquo;</dt>
  7564. </dl>
  7565. </dd>
  7566. <dt><samp class="option">max_delay <var class="var">integer</var> (<em class="emph">input/output</em>)</samp></dt>
  7567. <dd><p>Set maximum muxing or demuxing delay in microseconds.
  7568. </p>
  7569. </dd>
  7570. <dt><samp class="option">fpsprobesize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7571. <dd><p>Set number of frames used to probe fps.
  7572. </p>
  7573. </dd>
  7574. <dt><samp class="option">audio_preload <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7575. <dd><p>Set microseconds by which audio packets should be interleaved earlier.
  7576. </p>
  7577. </dd>
  7578. <dt><samp class="option">chunk_duration <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7579. <dd><p>Set microseconds for each chunk.
  7580. </p>
  7581. </dd>
  7582. <dt><samp class="option">chunk_size <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7583. <dd><p>Set size in bytes for each chunk.
  7584. </p>
  7585. </dd>
  7586. <dt><samp class="option">err_detect, f_err_detect <var class="var">flags</var> (<em class="emph">input</em>)</samp></dt>
  7587. <dd><p>Set error detection flags. <code class="code">f_err_detect</code> is deprecated and
  7588. should be used only via the <code class="command">ffmpeg</code> tool.
  7589. </p>
  7590. <p>Possible values:
  7591. </p><dl class="table">
  7592. <dt>&lsquo;<samp class="samp">crccheck</samp>&rsquo;</dt>
  7593. <dd><p>Verify embedded CRCs.
  7594. </p></dd>
  7595. <dt>&lsquo;<samp class="samp">bitstream</samp>&rsquo;</dt>
  7596. <dd><p>Detect bitstream specification deviations.
  7597. </p></dd>
  7598. <dt>&lsquo;<samp class="samp">buffer</samp>&rsquo;</dt>
  7599. <dd><p>Detect improper bitstream length.
  7600. </p></dd>
  7601. <dt>&lsquo;<samp class="samp">explode</samp>&rsquo;</dt>
  7602. <dd><p>Abort decoding on minor error detection.
  7603. </p></dd>
  7604. <dt>&lsquo;<samp class="samp">careful</samp>&rsquo;</dt>
  7605. <dd><p>Consider things that violate the spec and have not been seen in the
  7606. wild as errors.
  7607. </p></dd>
  7608. <dt>&lsquo;<samp class="samp">compliant</samp>&rsquo;</dt>
  7609. <dd><p>Consider all spec non compliancies as errors.
  7610. </p></dd>
  7611. <dt>&lsquo;<samp class="samp">aggressive</samp>&rsquo;</dt>
  7612. <dd><p>Consider things that a sane encoder should not do as an error.
  7613. </p></dd>
  7614. </dl>
  7615. </dd>
  7616. <dt><samp class="option">max_interleave_delta <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7617. <dd><p>Set maximum buffering duration for interleaving. The duration is
  7618. expressed in microseconds, and defaults to 10000000 (10 seconds).
  7619. </p>
  7620. <p>To ensure all the streams are interleaved correctly, libavformat will
  7621. wait until it has at least one packet for each stream before actually
  7622. writing any packets to the output file. When some streams are
  7623. &quot;sparse&quot; (i.e. there are large gaps between successive packets), this
  7624. can result in excessive buffering.
  7625. </p>
  7626. <p>This field specifies the maximum difference between the timestamps of the
  7627. first and the last packet in the muxing queue, above which libavformat
  7628. will output a packet regardless of whether it has queued a packet for all
  7629. the streams.
  7630. </p>
  7631. <p>If set to 0, libavformat will continue buffering packets until it has
  7632. a packet for each stream, regardless of the maximum timestamp
  7633. difference between the buffered packets.
  7634. </p>
  7635. </dd>
  7636. <dt><samp class="option">use_wallclock_as_timestamps <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7637. <dd><p>Use wallclock as timestamps if set to 1. Default is 0.
  7638. </p>
  7639. </dd>
  7640. <dt><samp class="option">avoid_negative_ts <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7641. <dd>
  7642. <p>Possible values:
  7643. </p><dl class="table">
  7644. <dt>&lsquo;<samp class="samp">make_non_negative</samp>&rsquo;</dt>
  7645. <dd><p>Shift timestamps to make them non-negative.
  7646. Also note that this affects only leading negative timestamps, and not
  7647. non-monotonic negative timestamps.
  7648. </p></dd>
  7649. <dt>&lsquo;<samp class="samp">make_zero</samp>&rsquo;</dt>
  7650. <dd><p>Shift timestamps so that the first timestamp is 0.
  7651. </p></dd>
  7652. <dt>&lsquo;<samp class="samp">auto (default)</samp>&rsquo;</dt>
  7653. <dd><p>Enables shifting when required by the target format.
  7654. </p></dd>
  7655. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  7656. <dd><p>Disables shifting of timestamp.
  7657. </p></dd>
  7658. </dl>
  7659. <p>When shifting is enabled, all output timestamps are shifted by the
  7660. same amount. Audio, video, and subtitles desynching and relative
  7661. timestamp differences are preserved compared to how they would have
  7662. been without shifting.
  7663. </p>
  7664. </dd>
  7665. <dt><samp class="option">skip_initial_bytes <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7666. <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
  7667. Default is 0.
  7668. </p>
  7669. </dd>
  7670. <dt><samp class="option">correct_ts_overflow <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7671. <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
  7672. </p>
  7673. </dd>
  7674. <dt><samp class="option">flush_packets <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  7675. <dd><p>Flush the underlying I/O stream after each packet. Default is -1 (auto), which
  7676. means that the underlying protocol will decide, 1 enables it, and has the
  7677. effect of reducing the latency, 0 disables it and may increase IO throughput in
  7678. some cases.
  7679. </p>
  7680. </dd>
  7681. <dt><samp class="option">output_ts_offset <var class="var">offset</var> (<em class="emph">output</em>)</samp></dt>
  7682. <dd><p>Set the output time offset.
  7683. </p>
  7684. <p><var class="var">offset</var> must be a time duration specification,
  7685. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  7686. </p>
  7687. <p>The offset is added by the muxer to the output timestamps.
  7688. </p>
  7689. <p>Specifying a positive offset means that the corresponding streams are
  7690. delayed bt the time duration specified in <var class="var">offset</var>. Default value
  7691. is <code class="code">0</code> (meaning that no offset is applied).
  7692. </p>
  7693. </dd>
  7694. <dt><samp class="option">format_whitelist <var class="var">list</var> (<em class="emph">input</em>)</samp></dt>
  7695. <dd><p>&quot;,&quot; separated list of allowed demuxers. By default all are allowed.
  7696. </p>
  7697. </dd>
  7698. <dt><samp class="option">dump_separator <var class="var">string</var> (<em class="emph">input</em>)</samp></dt>
  7699. <dd><p>Separator used to separate the fields printed on the command line about the
  7700. Stream parameters.
  7701. For example, to separate the fields with newlines and indentation:
  7702. </p><div class="example">
  7703. <pre class="example-preformatted">ffprobe -dump_separator &quot;
  7704. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  7705. </pre></div>
  7706. </dd>
  7707. <dt><samp class="option">max_streams <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  7708. <dd><p>Specifies the maximum number of streams. This can be used to reject files that
  7709. would require too many resources due to a large number of streams.
  7710. </p>
  7711. </dd>
  7712. <dt><samp class="option">skip_estimate_duration_from_pts <var class="var">bool</var> (<em class="emph">input</em>)</samp></dt>
  7713. <dd><p>Skip estimation of input duration when calculated using PTS.
  7714. At present, applicable for MPEG-PS and MPEG-TS.
  7715. </p>
  7716. </dd>
  7717. <dt><samp class="option">strict, f_strict <var class="var">integer</var> (<em class="emph">input/output</em>)</samp></dt>
  7718. <dd><p>Specify how strictly to follow the standards. <code class="code">f_strict</code> is deprecated and
  7719. should be used only via the <code class="command">ffmpeg</code> tool.
  7720. </p>
  7721. <p>Possible values:
  7722. </p><dl class="table">
  7723. <dt>&lsquo;<samp class="samp">very</samp>&rsquo;</dt>
  7724. <dd><p>strictly conform to an older more strict version of the spec or reference software
  7725. </p></dd>
  7726. <dt>&lsquo;<samp class="samp">strict</samp>&rsquo;</dt>
  7727. <dd><p>strictly conform to all the things in the spec no matter what consequences
  7728. </p></dd>
  7729. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  7730. <dt>&lsquo;<samp class="samp">unofficial</samp>&rsquo;</dt>
  7731. <dd><p>allow unofficial extensions
  7732. </p></dd>
  7733. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  7734. <dd><p>allow non standardized experimental things, experimental
  7735. (unfinished/work in progress/not well tested) decoders and encoders.
  7736. Note: experimental decoders can pose a security risk, do not use this for
  7737. decoding untrusted input.
  7738. </p></dd>
  7739. </dl>
  7740. </dd>
  7741. </dl>
  7742. <a class="anchor" id="Format-stream-specifiers"></a><ul class="mini-toc">
  7743. <li><a href="#Format-stream-specifiers-1" accesskey="1">Format stream specifiers</a></li>
  7744. </ul>
  7745. <div class="section-level-extent" id="Format-stream-specifiers-1">
  7746. <h3 class="section"><span>12.1 Format stream specifiers<a class="copiable-link" href="#Format-stream-specifiers-1"> &para;</a></span></h3>
  7747. <p>Format stream specifiers allow selection of one or more streams that
  7748. match specific properties.
  7749. </p>
  7750. <p>The exact semantics of stream specifiers is defined by the
  7751. <code class="code">avformat_match_stream_specifier()</code> function declared in the
  7752. <samp class="file">libavformat/avformat.h</samp> header and documented in the
  7753. <a data-manual="ffmpeg" href="ffmpeg.html#Stream-specifiers">Stream specifiers section in the ffmpeg(1) manual</a>.
  7754. </p>
  7755. </div>
  7756. </div>
  7757. <div class="chapter-level-extent" id="Demuxers">
  7758. <h2 class="chapter"><span>13 Demuxers<a class="copiable-link" href="#Demuxers"> &para;</a></span></h2>
  7759. <p>Demuxers are configured elements in FFmpeg that can read the
  7760. multimedia streams from a particular type of file.
  7761. </p>
  7762. <p>When you configure your FFmpeg build, all the supported demuxers
  7763. are enabled by default. You can list all available ones using the
  7764. configure option <code class="code">--list-demuxers</code>.
  7765. </p>
  7766. <p>You can disable all the demuxers using the configure option
  7767. <code class="code">--disable-demuxers</code>, and selectively enable a single demuxer with
  7768. the option <code class="code">--enable-demuxer=<var class="var">DEMUXER</var></code>, or disable it
  7769. with the option <code class="code">--disable-demuxer=<var class="var">DEMUXER</var></code>.
  7770. </p>
  7771. <p>The option <code class="code">-demuxers</code> of the ff* tools will display the list of
  7772. enabled demuxers. Use <code class="code">-formats</code> to view a combined list of
  7773. enabled demuxers and muxers.
  7774. </p>
  7775. <p>The description of some of the currently available demuxers follows.
  7776. </p>
  7777. <ul class="mini-toc">
  7778. <li><a href="#aa" accesskey="1">aa</a></li>
  7779. <li><a href="#aac" accesskey="2">aac</a></li>
  7780. <li><a href="#apng" accesskey="3">apng</a></li>
  7781. <li><a href="#asf" accesskey="4">asf</a></li>
  7782. <li><a href="#concat-1" accesskey="5">concat</a></li>
  7783. <li><a href="#dash" accesskey="6">dash</a></li>
  7784. <li><a href="#dvdvideo" accesskey="7">dvdvideo</a></li>
  7785. <li><a href="#ea" accesskey="8">ea</a></li>
  7786. <li><a href="#imf" accesskey="9">imf</a></li>
  7787. <li><a href="#flv_002c-live_005fflv_002c-kux">flv, live_flv, kux</a></li>
  7788. <li><a href="#gif">gif</a></li>
  7789. <li><a href="#hls">hls</a></li>
  7790. <li><a href="#image2">image2</a></li>
  7791. <li><a href="#libgme">libgme</a></li>
  7792. <li><a href="#libmodplug">libmodplug</a></li>
  7793. <li><a href="#libopenmpt">libopenmpt</a></li>
  7794. <li><a href="#mov_002fmp4_002f3gp">mov/mp4/3gp</a></li>
  7795. <li><a href="#mpegts">mpegts</a></li>
  7796. <li><a href="#mpjpeg">mpjpeg</a></li>
  7797. <li><a href="#rawvideo-1">rawvideo</a></li>
  7798. <li><a href="#sbg">sbg</a></li>
  7799. <li><a href="#tedcaptions">tedcaptions</a></li>
  7800. <li><a href="#vapoursynth">vapoursynth</a></li>
  7801. <li><a href="#w64">w64</a></li>
  7802. <li><a href="#wav-1">wav</a></li>
  7803. </ul>
  7804. <div class="section-level-extent" id="aa">
  7805. <h3 class="section"><span>13.1 aa<a class="copiable-link" href="#aa"> &para;</a></span></h3>
  7806. <p>Audible Format 2, 3, and 4 demuxer.
  7807. </p>
  7808. <p>This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
  7809. </p>
  7810. </div>
  7811. <div class="section-level-extent" id="aac">
  7812. <h3 class="section"><span>13.2 aac<a class="copiable-link" href="#aac"> &para;</a></span></h3>
  7813. <p>Raw Audio Data Transport Stream AAC demuxer.
  7814. </p>
  7815. <p>This demuxer is used to demux an ADTS input containing a single AAC stream
  7816. alongwith any ID3v1/2 or APE tags in it.
  7817. </p>
  7818. </div>
  7819. <div class="section-level-extent" id="apng">
  7820. <h3 class="section"><span>13.3 apng<a class="copiable-link" href="#apng"> &para;</a></span></h3>
  7821. <p>Animated Portable Network Graphics demuxer.
  7822. </p>
  7823. <p>This demuxer is used to demux APNG files.
  7824. All headers, but the PNG signature, up to (but not including) the first
  7825. fcTL chunk are transmitted as extradata.
  7826. Frames are then split as being all the chunks between two fcTL ones, or
  7827. between the last fcTL and IEND chunks.
  7828. </p>
  7829. <dl class="table">
  7830. <dt><samp class="option">-ignore_loop <var class="var">bool</var></samp></dt>
  7831. <dd><p>Ignore the loop variable in the file if set. Default is enabled.
  7832. </p>
  7833. </dd>
  7834. <dt><samp class="option">-max_fps <var class="var">int</var></samp></dt>
  7835. <dd><p>Maximum framerate in frames per second. Default of 0 imposes no limit.
  7836. </p>
  7837. </dd>
  7838. <dt><samp class="option">-default_fps <var class="var">int</var></samp></dt>
  7839. <dd><p>Default framerate in frames per second when none is specified in the file
  7840. (0 meaning as fast as possible). Default is 15.
  7841. </p>
  7842. </dd>
  7843. </dl>
  7844. </div>
  7845. <div class="section-level-extent" id="asf">
  7846. <h3 class="section"><span>13.4 asf<a class="copiable-link" href="#asf"> &para;</a></span></h3>
  7847. <p>Advanced Systems Format demuxer.
  7848. </p>
  7849. <p>This demuxer is used to demux ASF files and MMS network streams.
  7850. </p>
  7851. <dl class="table">
  7852. <dt><samp class="option">-no_resync_search <var class="var">bool</var></samp></dt>
  7853. <dd><p>Do not try to resynchronize by looking for a certain optional start code.
  7854. </p></dd>
  7855. </dl>
  7856. <a class="anchor" id="concat"></a></div>
  7857. <div class="section-level-extent" id="concat-1">
  7858. <h3 class="section"><span>13.5 concat<a class="copiable-link" href="#concat-1"> &para;</a></span></h3>
  7859. <p>Virtual concatenation script demuxer.
  7860. </p>
  7861. <p>This demuxer reads a list of files and other directives from a text file and
  7862. demuxes them one after the other, as if all their packets had been muxed
  7863. together.
  7864. </p>
  7865. <p>The timestamps in the files are adjusted so that the first file starts at 0
  7866. and each next file starts where the previous one finishes. Note that it is
  7867. done globally and may cause gaps if all streams do not have exactly the same
  7868. length.
  7869. </p>
  7870. <p>All files must have the same streams (same codecs, same time base, etc.).
  7871. </p>
  7872. <p>The duration of each file is used to adjust the timestamps of the next file:
  7873. if the duration is incorrect (because it was computed using the bit-rate or
  7874. because the file is truncated, for example), it can cause artifacts. The
  7875. <code class="code">duration</code> directive can be used to override the duration stored in
  7876. each file.
  7877. </p>
  7878. <ul class="mini-toc">
  7879. <li><a href="#Syntax-1" accesskey="1">Syntax</a></li>
  7880. <li><a href="#Options-11" accesskey="2">Options</a></li>
  7881. <li><a href="#Examples-3" accesskey="3">Examples</a></li>
  7882. </ul>
  7883. <div class="subsection-level-extent" id="Syntax-1">
  7884. <h4 class="subsection"><span>13.5.1 Syntax<a class="copiable-link" href="#Syntax-1"> &para;</a></span></h4>
  7885. <p>The script is a text file in extended-ASCII, with one directive per line.
  7886. Empty lines, leading spaces and lines starting with &rsquo;#&rsquo; are ignored. The
  7887. following directive is recognized:
  7888. </p>
  7889. <dl class="table">
  7890. <dt><samp class="option"><code class="code">file <var class="var">path</var></code></samp></dt>
  7891. <dd><p>Path to a file to read; special characters and spaces must be escaped with
  7892. backslash or single quotes.
  7893. </p>
  7894. <p>All subsequent file-related directives apply to that file.
  7895. </p>
  7896. </dd>
  7897. <dt><samp class="option"><code class="code">ffconcat version 1.0</code></samp></dt>
  7898. <dd><p>Identify the script type and version.
  7899. </p>
  7900. <p>To make FFmpeg recognize the format automatically, this directive must
  7901. appear exactly as is (no extra space or byte-order-mark) on the very first
  7902. line of the script.
  7903. </p>
  7904. </dd>
  7905. <dt><samp class="option"><code class="code">duration <var class="var">dur</var></code></samp></dt>
  7906. <dd><p>Duration of the file. This information can be specified from the file;
  7907. specifying it here may be more efficient or help if the information from the
  7908. file is not available or accurate.
  7909. </p>
  7910. <p>If the duration is set for all files, then it is possible to seek in the
  7911. whole concatenated video.
  7912. </p>
  7913. </dd>
  7914. <dt><samp class="option"><code class="code">inpoint <var class="var">timestamp</var></code></samp></dt>
  7915. <dd><p>In point of the file. When the demuxer opens the file it instantly seeks to the
  7916. specified timestamp. Seeking is done so that all streams can be presented
  7917. successfully at In point.
  7918. </p>
  7919. <p>This directive works best with intra frame codecs, because for non-intra frame
  7920. ones you will usually get extra packets before the actual In point and the
  7921. decoded content will most likely contain frames before In point too.
  7922. </p>
  7923. <p>For each file, packets before the file In point will have timestamps less than
  7924. the calculated start timestamp of the file (negative in case of the first
  7925. file), and the duration of the files (if not specified by the <code class="code">duration</code>
  7926. directive) will be reduced based on their specified In point.
  7927. </p>
  7928. <p>Because of potential packets before the specified In point, packet timestamps
  7929. may overlap between two concatenated files.
  7930. </p>
  7931. </dd>
  7932. <dt><samp class="option"><code class="code">outpoint <var class="var">timestamp</var></code></samp></dt>
  7933. <dd><p>Out point of the file. When the demuxer reaches the specified decoding
  7934. timestamp in any of the streams, it handles it as an end of file condition and
  7935. skips the current and all the remaining packets from all streams.
  7936. </p>
  7937. <p>Out point is exclusive, which means that the demuxer will not output packets
  7938. with a decoding timestamp greater or equal to Out point.
  7939. </p>
  7940. <p>This directive works best with intra frame codecs and formats where all streams
  7941. are tightly interleaved. For non-intra frame codecs you will usually get
  7942. additional packets with presentation timestamp after Out point therefore the
  7943. decoded content will most likely contain frames after Out point too. If your
  7944. streams are not tightly interleaved you may not get all the packets from all
  7945. streams before Out point and you may only will be able to decode the earliest
  7946. stream until Out point.
  7947. </p>
  7948. <p>The duration of the files (if not specified by the <code class="code">duration</code>
  7949. directive) will be reduced based on their specified Out point.
  7950. </p>
  7951. </dd>
  7952. <dt><samp class="option"><code class="code">file_packet_metadata <var class="var">key=value</var></code></samp></dt>
  7953. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  7954. each file packet. You can specify this directive multiple times to add multiple
  7955. metadata entries.
  7956. This directive is deprecated, use <code class="code">file_packet_meta</code> instead.
  7957. </p>
  7958. </dd>
  7959. <dt><samp class="option"><code class="code">file_packet_meta <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  7960. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  7961. each file packet. You can specify this directive multiple times to add multiple
  7962. metadata entries.
  7963. </p>
  7964. </dd>
  7965. <dt><samp class="option"><code class="code">option <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  7966. <dd><p>Option to access, open and probe the file.
  7967. Can be present multiple times.
  7968. </p>
  7969. </dd>
  7970. <dt><samp class="option"><code class="code">stream</code></samp></dt>
  7971. <dd><p>Introduce a stream in the virtual file.
  7972. All subsequent stream-related directives apply to the last introduced
  7973. stream.
  7974. Some streams properties must be set in order to allow identifying the
  7975. matching streams in the subfiles.
  7976. If no streams are defined in the script, the streams from the first file are
  7977. copied.
  7978. </p>
  7979. </dd>
  7980. <dt><samp class="option"><code class="code">exact_stream_id <var class="var">id</var></code></samp></dt>
  7981. <dd><p>Set the id of the stream.
  7982. If this directive is given, the string with the corresponding id in the
  7983. subfiles will be used.
  7984. This is especially useful for MPEG-PS (VOB) files, where the order of the
  7985. streams is not reliable.
  7986. </p>
  7987. </dd>
  7988. <dt><samp class="option"><code class="code">stream_meta <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  7989. <dd><p>Metadata for the stream.
  7990. Can be present multiple times.
  7991. </p>
  7992. </dd>
  7993. <dt><samp class="option"><code class="code">stream_codec <var class="var">value</var></code></samp></dt>
  7994. <dd><p>Codec for the stream.
  7995. </p>
  7996. </dd>
  7997. <dt><samp class="option"><code class="code">stream_extradata <var class="var">hex_string</var></code></samp></dt>
  7998. <dd><p>Extradata for the string, encoded in hexadecimal.
  7999. </p>
  8000. </dd>
  8001. <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>
  8002. <dd><p>Add a chapter. <var class="var">id</var> is an unique identifier, possibly small and
  8003. consecutive.
  8004. </p>
  8005. </dd>
  8006. </dl>
  8007. </div>
  8008. <div class="subsection-level-extent" id="Options-11">
  8009. <h4 class="subsection"><span>13.5.2 Options<a class="copiable-link" href="#Options-11"> &para;</a></span></h4>
  8010. <p>This demuxer accepts the following option:
  8011. </p>
  8012. <dl class="table">
  8013. <dt><samp class="option">safe</samp></dt>
  8014. <dd><p>If set to 1, reject unsafe file paths and directives.
  8015. A file path is considered safe if it
  8016. does not contain a protocol specification and is relative and all components
  8017. only contain characters from the portable character set (letters, digits,
  8018. period, underscore and hyphen) and have no period at the beginning of a
  8019. component.
  8020. </p>
  8021. <p>If set to 0, any file name is accepted.
  8022. </p>
  8023. <p>The default is 1.
  8024. </p>
  8025. </dd>
  8026. <dt><samp class="option">auto_convert</samp></dt>
  8027. <dd><p>If set to 1, try to perform automatic conversions on packet data to make the
  8028. streams concatenable.
  8029. The default is 1.
  8030. </p>
  8031. <p>Currently, the only conversion is adding the h264_mp4toannexb bitstream
  8032. filter to H.264 streams in MP4 format. This is necessary in particular if
  8033. there are resolution changes.
  8034. </p>
  8035. </dd>
  8036. <dt><samp class="option">segment_time_metadata</samp></dt>
  8037. <dd><p>If set to 1, every packet will contain the <var class="var">lavf.concat.start_time</var> and the
  8038. <var class="var">lavf.concat.duration</var> packet metadata values which are the start_time and
  8039. the duration of the respective file segments in the concatenated output
  8040. expressed in microseconds. The duration metadata is only set if it is known
  8041. based on the concat file.
  8042. The default is 0.
  8043. </p>
  8044. </dd>
  8045. </dl>
  8046. </div>
  8047. <div class="subsection-level-extent" id="Examples-3">
  8048. <h4 class="subsection"><span>13.5.3 Examples<a class="copiable-link" href="#Examples-3"> &para;</a></span></h4>
  8049. <ul class="itemize mark-bullet">
  8050. <li>Use absolute filenames and include some comments:
  8051. <div class="example">
  8052. <pre class="example-preformatted"># my first filename
  8053. file /mnt/share/file-1.wav
  8054. # my second filename including whitespace
  8055. file '/mnt/share/file 2.wav'
  8056. # my third filename including whitespace plus single quote
  8057. file '/mnt/share/file 3'\''.wav'
  8058. </pre></div>
  8059. </li><li>Allow for input format auto-probing, use safe filenames and set the duration of
  8060. the first file:
  8061. <div class="example">
  8062. <pre class="example-preformatted">ffconcat version 1.0
  8063. file file-1.wav
  8064. duration 20.0
  8065. file subdir/file-2.wav
  8066. </pre></div>
  8067. </li></ul>
  8068. </div>
  8069. </div>
  8070. <div class="section-level-extent" id="dash">
  8071. <h3 class="section"><span>13.6 dash<a class="copiable-link" href="#dash"> &para;</a></span></h3>
  8072. <p>Dynamic Adaptive Streaming over HTTP demuxer.
  8073. </p>
  8074. <p>This demuxer presents all AVStreams found in the manifest.
  8075. By setting the discard flags on AVStreams the caller can decide
  8076. which streams to actually receive.
  8077. Each stream mirrors the <code class="code">id</code> and <code class="code">bandwidth</code> properties from the
  8078. <code class="code">&lt;Representation&gt;</code> as metadata keys named &quot;id&quot; and &quot;variant_bitrate&quot; respectively.
  8079. </p>
  8080. <ul class="mini-toc">
  8081. <li><a href="#Options-12" accesskey="1">Options</a></li>
  8082. </ul>
  8083. <div class="subsection-level-extent" id="Options-12">
  8084. <h4 class="subsection"><span>13.6.1 Options<a class="copiable-link" href="#Options-12"> &para;</a></span></h4>
  8085. <p>This demuxer accepts the following option:
  8086. </p>
  8087. <dl class="table">
  8088. <dt><samp class="option">cenc_decryption_key</samp></dt>
  8089. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  8090. </p>
  8091. </dd>
  8092. </dl>
  8093. </div>
  8094. </div>
  8095. <div class="section-level-extent" id="dvdvideo">
  8096. <h3 class="section"><span>13.7 dvdvideo<a class="copiable-link" href="#dvdvideo"> &para;</a></span></h3>
  8097. <p>DVD-Video demuxer, powered by libdvdnav and libdvdread.
  8098. </p>
  8099. <p>Can directly ingest DVD titles, specifically sequential PGCs, into
  8100. a conversion pipeline. Menu assets, such as background video or audio,
  8101. can also be demuxed given the menu&rsquo;s coordinates (at best effort).
  8102. Seeking is not supported at this time.
  8103. </p>
  8104. <p>Block devices (DVD drives), ISO files, and directory structures are accepted.
  8105. Activate with <code class="code">-f dvdvideo</code> in front of one of these inputs.
  8106. </p>
  8107. <p>This demuxer does NOT have decryption code of any kind. You are on your own
  8108. working with encrypted DVDs, and should not expect support on the matter.
  8109. </p>
  8110. <p>Underlying playback is handled by libdvdnav, and structure parsing by libdvdread.
  8111. FFmpeg must be built with GPL library support available as well as the
  8112. configure switches <code class="code">--enable-libdvdnav</code> and <code class="code">--enable-libdvdread</code>.
  8113. </p>
  8114. <p>You will need to provide either the desired &quot;title number&quot; or exact PGC/PG coordinates.
  8115. Many open-source DVD players and tools can aid in providing this information.
  8116. If not specified, the demuxer will default to title 1 which works for many discs.
  8117. However, due to the flexibility of the format, it is recommended to check manually.
  8118. There are many discs that are authored strangely or with invalid headers.
  8119. </p>
  8120. <p>If the input is a real DVD drive, please note that there are some drives which may
  8121. silently fail on reading bad sectors from the disc, returning random bits instead
  8122. which is effectively corrupt data. This is especially prominent on aging or rotting discs.
  8123. A second pass and integrity checks would be needed to detect the corruption.
  8124. This is not an FFmpeg issue.
  8125. </p>
  8126. <ul class="mini-toc">
  8127. <li><a href="#Background" accesskey="1">Background</a></li>
  8128. <li><a href="#Options-13" accesskey="2">Options</a></li>
  8129. <li><a href="#Examples-4" accesskey="3">Examples</a></li>
  8130. </ul>
  8131. <div class="subsection-level-extent" id="Background">
  8132. <h4 class="subsection"><span>13.7.1 Background<a class="copiable-link" href="#Background"> &para;</a></span></h4>
  8133. <p>DVD-Video is not a directly accessible, linear container format in the
  8134. traditional sense. Instead, it allows for complex and programmatic playback of
  8135. carefully muxed MPEG-PS streams that are stored in headerless VOB files.
  8136. To the end-user, these streams are known simply as &quot;titles&quot;, but the actual
  8137. logical playback sequence is defined by one or more &quot;PGCs&quot;, or Program Group Chains,
  8138. within the title. The PGC is in turn comprised of multiple &quot;PGs&quot;, or Programs&quot;,
  8139. which are the actual video segments (and for a typical video feature, sequentially
  8140. ordered). The PGC structure, along with stream layout and metadata, are stored in
  8141. IFO files that need to be parsed. PGCs can be thought of as playlists in easier terms.
  8142. </p>
  8143. <p>An actual DVD player relies on user GUI interaction via menus and an internal VM
  8144. to drive the direction of demuxing. Generally, the user would either navigate (via menus)
  8145. or automatically be redirected to the PGC of their choice. During this process and
  8146. the subsequent playback, the DVD player&rsquo;s internal VM also maintains a state and
  8147. executes instructions that can create jumps to different sectors during playback.
  8148. This is why libdvdnav is involved, as a linear read of the MPEG-PS blobs on the
  8149. disc (VOBs) is not enough to produce the right sequence in many cases.
  8150. </p>
  8151. <p>There are many other DVD structures (a long subject) that will not be discussed here.
  8152. NAV packets, in particular, are handled by this demuxer to build accurate timing
  8153. but not emitted as a stream. For a good high-level understanding, refer to:
  8154. <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>
  8155. </p>
  8156. </div>
  8157. <div class="subsection-level-extent" id="Options-13">
  8158. <h4 class="subsection"><span>13.7.2 Options<a class="copiable-link" href="#Options-13"> &para;</a></span></h4>
  8159. <p>This demuxer accepts the following options:
  8160. </p>
  8161. <dl class="table">
  8162. <dt><samp class="option">title <var class="var">int</var></samp></dt>
  8163. <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.
  8164. Not applicable to menus.
  8165. Default is 0 (auto), which currently only selects the first available title (title 1)
  8166. and notifies the user about the implications.
  8167. </p>
  8168. </dd>
  8169. <dt><samp class="option">chapter_start <var class="var">int</var></samp></dt>
  8170. <dd><p>The chapter, or PTT (part-of-title), number to start at. Not applicable to menus.
  8171. Default is 1.
  8172. </p>
  8173. </dd>
  8174. <dt><samp class="option">chapter_end <var class="var">int</var></samp></dt>
  8175. <dd><p>The chapter, or PTT (part-of-title), number to end at. Not applicable to menus.
  8176. Default is 0, which is a special value to signal end at the last possible chapter.
  8177. </p>
  8178. </dd>
  8179. <dt><samp class="option">angle <var class="var">int</var></samp></dt>
  8180. <dd><p>The video angle number, referring to what is essentially an additional
  8181. video stream that is composed from alternate frames interleaved in the VOBs.
  8182. Not applicable to menus.
  8183. Default is 1.
  8184. </p>
  8185. </dd>
  8186. <dt><samp class="option">region <var class="var">int</var></samp></dt>
  8187. <dd><p>The region code to use for playback. Some discs may use this to default playback
  8188. at a particular angle in different regions. This option will not affect the region code
  8189. of a real DVD drive, if used as an input. Not applicable to menus.
  8190. Default is 0, &quot;world&quot;.
  8191. </p>
  8192. </dd>
  8193. <dt><samp class="option">menu <var class="var">bool</var></samp></dt>
  8194. <dd><p>Demux menu assets instead of navigating a title. Requires exact coordinates
  8195. 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>).
  8196. Default is false.
  8197. </p>
  8198. </dd>
  8199. <dt><samp class="option">menu_lu <var class="var">int</var></samp></dt>
  8200. <dd><p>The menu language to demux. In DVD, menus are grouped by language.
  8201. Default is 0, the first language unit.
  8202. </p>
  8203. </dd>
  8204. <dt><samp class="option">menu_vts <var class="var">int</var></samp></dt>
  8205. <dd><p>The VTS where the menu lives, or 0 if it is a VMG menu (root-level).
  8206. Default is 0, VMG menu.
  8207. </p>
  8208. </dd>
  8209. <dt><samp class="option">pgc <var class="var">int</var></samp></dt>
  8210. <dd><p>The entry PGC to start playback, in conjunction with <samp class="option">pg</samp>.
  8211. Alternative to setting <samp class="option">title</samp>.
  8212. Chapter markers are not supported at this time.
  8213. Must be explicitly set for menus.
  8214. Default is 0, automatically resolve from value of <samp class="option">title</samp>.
  8215. </p>
  8216. </dd>
  8217. <dt><samp class="option">pg <var class="var">int</var></samp></dt>
  8218. <dd><p>The entry PG to start playback, in conjunction with <samp class="option">pgc</samp>.
  8219. Alternative to setting <samp class="option">title</samp>.
  8220. Chapter markers are not supported at this time.
  8221. Default is 0, automatically resolve from value of <samp class="option">title</samp>, or
  8222. start from the beginning (PG 1) of the menu.
  8223. </p>
  8224. </dd>
  8225. <dt><samp class="option">preindex <var class="var">bool</var></samp></dt>
  8226. <dd><p>Enable this to have accurate chapter (PTT) markers and duration measurement,
  8227. which requires a slow second pass read in order to index the chapter marker
  8228. timestamps from NAV packets. This is non-ideal extra work for real optical drives.
  8229. It is recommended and faster to use this option with a backup of the DVD structure
  8230. stored on a hard drive. Not compatible with <samp class="option">pgc</samp> and <samp class="option">pg</samp>.
  8231. Not applicable to menus.
  8232. Default is 0, false.
  8233. </p>
  8234. </dd>
  8235. <dt><samp class="option">trim <var class="var">bool</var></samp></dt>
  8236. <dd><p>Skip padding cells (i.e. cells shorter than 1 second) from the beginning.
  8237. There exist many discs with filler segments at the beginning of the PGC,
  8238. often with junk data intended for controlling a real DVD player&rsquo;s
  8239. buffering speed and with no other material data value.
  8240. Not applicable to menus.
  8241. Default is 1, true.
  8242. </p>
  8243. </dd>
  8244. </dl>
  8245. </div>
  8246. <div class="subsection-level-extent" id="Examples-4">
  8247. <h4 class="subsection"><span>13.7.3 Examples<a class="copiable-link" href="#Examples-4"> &para;</a></span></h4>
  8248. <ul class="itemize mark-bullet">
  8249. <li>Open title 3 from a given DVD structure:
  8250. <div class="example">
  8251. <pre class="example-preformatted">ffmpeg -f dvdvideo -title 3 -i &lt;path to DVD&gt; ...
  8252. </pre></div>
  8253. </li><li>Open chapters 3-6 from title 1 from a given DVD structure:
  8254. <div class="example">
  8255. <pre class="example-preformatted">ffmpeg -f dvdvideo -chapter_start 3 -chapter_end 6 -title 1 -i &lt;path to DVD&gt; ...
  8256. </pre></div>
  8257. </li><li>Open only chapter 5 from title 1 from a given DVD structure:
  8258. <div class="example">
  8259. <pre class="example-preformatted">ffmpeg -f dvdvideo -chapter_start 5 -chapter_end 5 -title 1 -i &lt;path to DVD&gt; ...
  8260. </pre></div>
  8261. </li><li>Demux menu with language 1 from VTS 1, PGC 1, starting at PG 1:
  8262. <div class="example">
  8263. <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; ...
  8264. </pre></div>
  8265. </li></ul>
  8266. </div>
  8267. </div>
  8268. <div class="section-level-extent" id="ea">
  8269. <h3 class="section"><span>13.8 ea<a class="copiable-link" href="#ea"> &para;</a></span></h3>
  8270. <p>Electronic Arts Multimedia format demuxer.
  8271. </p>
  8272. <p>This format is used by various Electronic Arts games.
  8273. </p>
  8274. <ul class="mini-toc">
  8275. <li><a href="#Options-14" accesskey="1">Options</a></li>
  8276. </ul>
  8277. <div class="subsection-level-extent" id="Options-14">
  8278. <h4 class="subsection"><span>13.8.1 Options<a class="copiable-link" href="#Options-14"> &para;</a></span></h4>
  8279. <dl class="table">
  8280. <dt><samp class="option">merge_alpha <var class="var">bool</var></samp></dt>
  8281. <dd>
  8282. <p>Normally the VP6 alpha channel (if exists) is returned as a secondary video
  8283. stream, by setting this option you can make the demuxer return a single video
  8284. stream which contains the alpha channel in addition to the ordinary video.
  8285. </p>
  8286. </dd>
  8287. </dl>
  8288. </div>
  8289. </div>
  8290. <div class="section-level-extent" id="imf">
  8291. <h3 class="section"><span>13.9 imf<a class="copiable-link" href="#imf"> &para;</a></span></h3>
  8292. <p>Interoperable Master Format demuxer.
  8293. </p>
  8294. <p>This demuxer presents audio and video streams found in an IMF Composition, as
  8295. specified in <a class="url" href="https://doi.org/10.5594/SMPTE.ST2067-2.2020">SMPTE ST 2067-2</a>.
  8296. </p>
  8297. <div class="example">
  8298. <pre class="example-preformatted">ffmpeg [-assetmaps &lt;path of ASSETMAP1&gt;,&lt;path of ASSETMAP2&gt;,...] -i &lt;path of CPL&gt; ...
  8299. </pre></div>
  8300. <p>If <code class="code">-assetmaps</code> is not specified, the demuxer looks for a file called
  8301. <samp class="file">ASSETMAP.xml</samp> in the same directory as the CPL.
  8302. </p>
  8303. </div>
  8304. <div class="section-level-extent" id="flv_002c-live_005fflv_002c-kux">
  8305. <h3 class="section"><span>13.10 flv, live_flv, kux<a class="copiable-link" href="#flv_002c-live_005fflv_002c-kux"> &para;</a></span></h3>
  8306. <p>Adobe Flash Video Format demuxer.
  8307. </p>
  8308. <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.
  8309. KUX is a flv variant used on the Youku platform.
  8310. </p>
  8311. <div class="example">
  8312. <pre class="example-preformatted">ffmpeg -f flv -i myfile.flv ...
  8313. ffmpeg -f live_flv -i rtmp://&lt;any.server&gt;/anything/key ....
  8314. </pre></div>
  8315. <dl class="table">
  8316. <dt><samp class="option">-flv_metadata <var class="var">bool</var></samp></dt>
  8317. <dd><p>Allocate the streams according to the onMetaData array content.
  8318. </p>
  8319. </dd>
  8320. <dt><samp class="option">-flv_ignore_prevtag <var class="var">bool</var></samp></dt>
  8321. <dd><p>Ignore the size of previous tag value.
  8322. </p>
  8323. </dd>
  8324. <dt><samp class="option">-flv_full_metadata <var class="var">bool</var></samp></dt>
  8325. <dd><p>Output all context of the onMetadata.
  8326. </p></dd>
  8327. </dl>
  8328. </div>
  8329. <div class="section-level-extent" id="gif">
  8330. <h3 class="section"><span>13.11 gif<a class="copiable-link" href="#gif"> &para;</a></span></h3>
  8331. <p>Animated GIF demuxer.
  8332. </p>
  8333. <p>It accepts the following options:
  8334. </p>
  8335. <dl class="table">
  8336. <dt><samp class="option">min_delay</samp></dt>
  8337. <dd><p>Set the minimum valid delay between frames in hundredths of seconds.
  8338. Range is 0 to 6000. Default value is 2.
  8339. </p>
  8340. </dd>
  8341. <dt><samp class="option">max_gif_delay</samp></dt>
  8342. <dd><p>Set the maximum valid delay between frames in hundredth of seconds.
  8343. Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
  8344. the maximum value allowed by the specification.
  8345. </p>
  8346. </dd>
  8347. <dt><samp class="option">default_delay</samp></dt>
  8348. <dd><p>Set the default delay between frames in hundredths of seconds.
  8349. Range is 0 to 6000. Default value is 10.
  8350. </p>
  8351. </dd>
  8352. <dt><samp class="option">ignore_loop</samp></dt>
  8353. <dd><p>GIF files can contain information to loop a certain number of times (or
  8354. infinitely). If <samp class="option">ignore_loop</samp> is set to 1, then the loop setting
  8355. from the input will be ignored and looping will not occur. If set to 0,
  8356. then looping will occur and will cycle the number of times according to
  8357. the GIF. Default value is 1.
  8358. </p></dd>
  8359. </dl>
  8360. <p>For example, with the overlay filter, place an infinitely looping GIF
  8361. over another video:
  8362. </p><div class="example">
  8363. <pre class="example-preformatted">ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
  8364. </pre></div>
  8365. <p>Note that in the above example the shortest option for overlay filter is
  8366. used to end the output video at the length of the shortest input file,
  8367. which in this case is <samp class="file">input.mp4</samp> as the GIF in this example loops
  8368. infinitely.
  8369. </p>
  8370. </div>
  8371. <div class="section-level-extent" id="hls">
  8372. <h3 class="section"><span>13.12 hls<a class="copiable-link" href="#hls"> &para;</a></span></h3>
  8373. <p>HLS demuxer
  8374. </p>
  8375. <p>Apple HTTP Live Streaming demuxer.
  8376. </p>
  8377. <p>This demuxer presents all AVStreams from all variant streams.
  8378. The id field is set to the bitrate variant index number. By setting
  8379. the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
  8380. the caller can decide which variant streams to actually receive.
  8381. The total bitrate of the variant that the stream belongs to is
  8382. available in a metadata key named &quot;variant_bitrate&quot;.
  8383. </p>
  8384. <p>It accepts the following options:
  8385. </p>
  8386. <dl class="table">
  8387. <dt><samp class="option">live_start_index</samp></dt>
  8388. <dd><p>segment index to start live streams at (negative values are from the end).
  8389. </p>
  8390. </dd>
  8391. <dt><samp class="option">prefer_x_start</samp></dt>
  8392. <dd><p>prefer to use #EXT-X-START if it&rsquo;s in playlist instead of live_start_index.
  8393. </p>
  8394. </dd>
  8395. <dt><samp class="option">allowed_extensions</samp></dt>
  8396. <dd><p>&rsquo;,&rsquo; separated list of file extensions that hls is allowed to access.
  8397. </p>
  8398. </dd>
  8399. <dt><samp class="option">max_reload</samp></dt>
  8400. <dd><p>Maximum number of times a insufficient list is attempted to be reloaded.
  8401. Default value is 1000.
  8402. </p>
  8403. </dd>
  8404. <dt><samp class="option">m3u8_hold_counters</samp></dt>
  8405. <dd><p>The maximum number of times to load m3u8 when it refreshes without new segments.
  8406. Default value is 1000.
  8407. </p>
  8408. </dd>
  8409. <dt><samp class="option">http_persistent</samp></dt>
  8410. <dd><p>Use persistent HTTP connections. Applicable only for HTTP streams.
  8411. Enabled by default.
  8412. </p>
  8413. </dd>
  8414. <dt><samp class="option">http_multiple</samp></dt>
  8415. <dd><p>Use multiple HTTP connections for downloading HTTP segments.
  8416. Enabled by default for HTTP/1.1 servers.
  8417. </p>
  8418. </dd>
  8419. <dt><samp class="option">http_seekable</samp></dt>
  8420. <dd><p>Use HTTP partial requests for downloading HTTP segments.
  8421. 0 = disable, 1 = enable, -1 = auto, Default is auto.
  8422. </p>
  8423. </dd>
  8424. <dt><samp class="option">seg_format_options</samp></dt>
  8425. <dd><p>Set options for the demuxer of media segments using a list of key=value pairs separated by <code class="code">:</code>.
  8426. </p>
  8427. </dd>
  8428. <dt><samp class="option">seg_max_retry</samp></dt>
  8429. <dd><p>Maximum number of times to reload a segment on error, useful when segment skip on network error is not desired.
  8430. Default value is 0.
  8431. </p></dd>
  8432. </dl>
  8433. </div>
  8434. <div class="section-level-extent" id="image2">
  8435. <h3 class="section"><span>13.13 image2<a class="copiable-link" href="#image2"> &para;</a></span></h3>
  8436. <p>Image file demuxer.
  8437. </p>
  8438. <p>This demuxer reads from a list of image files specified by a pattern.
  8439. The syntax and meaning of the pattern is specified by the
  8440. option <var class="var">pattern_type</var>.
  8441. </p>
  8442. <p>The pattern may contain a suffix which is used to automatically
  8443. determine the format of the images contained in the files.
  8444. </p>
  8445. <p>The size, the pixel format, and the format of each image must be the
  8446. same for all the files in the sequence.
  8447. </p>
  8448. <p>This demuxer accepts the following options:
  8449. </p><dl class="table">
  8450. <dt><samp class="option">framerate</samp></dt>
  8451. <dd><p>Set the frame rate for the video stream. It defaults to 25.
  8452. </p></dd>
  8453. <dt><samp class="option">loop</samp></dt>
  8454. <dd><p>If set to 1, loop over the input. Default value is 0.
  8455. </p></dd>
  8456. <dt><samp class="option">pattern_type</samp></dt>
  8457. <dd><p>Select the pattern type used to interpret the provided filename.
  8458. </p>
  8459. <p><var class="var">pattern_type</var> accepts one of the following values.
  8460. </p><dl class="table">
  8461. <dt><samp class="option">none</samp></dt>
  8462. <dd><p>Disable pattern matching, therefore the video will only contain the specified
  8463. image. You should use this option if you do not want to create sequences from
  8464. multiple images and your filenames may contain special pattern characters.
  8465. </p></dd>
  8466. <dt><samp class="option">sequence</samp></dt>
  8467. <dd><p>Select a sequence pattern type, used to specify a sequence of files
  8468. indexed by sequential numbers.
  8469. </p>
  8470. <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, which
  8471. specifies the position of the characters representing a sequential
  8472. number in each filename matched by the pattern. If the form
  8473. &quot;%d0<var class="var">N</var>d&quot; is used, the string representing the number in each
  8474. filename is 0-padded and <var class="var">N</var> is the total number of 0-padded
  8475. digits representing the number. The literal character &rsquo;%&rsquo; can be
  8476. specified in the pattern with the string &quot;%%&quot;.
  8477. </p>
  8478. <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, the first filename of
  8479. the file list specified by the pattern must contain a number
  8480. inclusively contained between <var class="var">start_number</var> and
  8481. <var class="var">start_number</var>+<var class="var">start_number_range</var>-1, and all the following
  8482. numbers must be sequential.
  8483. </p>
  8484. <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
  8485. filenames of the form <samp class="file">img-001.bmp</samp>, <samp class="file">img-002.bmp</samp>, ...,
  8486. <samp class="file">img-010.bmp</samp>, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
  8487. sequence of filenames of the form <samp class="file">i%m%g-1.jpg</samp>,
  8488. <samp class="file">i%m%g-2.jpg</samp>, ..., <samp class="file">i%m%g-10.jpg</samp>, etc.
  8489. </p>
  8490. <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
  8491. &quot;%0<var class="var">N</var>d&quot;, for example to convert a single image file
  8492. <samp class="file">img.jpeg</samp> you can employ the command:
  8493. </p><div class="example">
  8494. <pre class="example-preformatted">ffmpeg -i img.jpeg img.png
  8495. </pre></div>
  8496. </dd>
  8497. <dt><samp class="option">glob</samp></dt>
  8498. <dd><p>Select a glob wildcard pattern type.
  8499. </p>
  8500. <p>The pattern is interpreted like a <code class="code">glob()</code> pattern. This is only
  8501. selectable if libavformat was compiled with globbing support.
  8502. </p>
  8503. </dd>
  8504. <dt><samp class="option">glob_sequence <em class="emph">(deprecated, will be removed)</em></samp></dt>
  8505. <dd><p>Select a mixed glob wildcard/sequence pattern.
  8506. </p>
  8507. <p>If your version of libavformat was compiled with globbing support, and
  8508. the provided pattern contains at least one glob meta character among
  8509. <code class="code">%*?[]{}</code> that is preceded by an unescaped &quot;%&quot;, the pattern is
  8510. interpreted like a <code class="code">glob()</code> pattern, otherwise it is interpreted
  8511. like a sequence pattern.
  8512. </p>
  8513. <p>All glob special characters <code class="code">%*?[]{}</code> must be prefixed
  8514. with &quot;%&quot;. To escape a literal &quot;%&quot; you shall use &quot;%%&quot;.
  8515. </p>
  8516. <p>For example the pattern <code class="code">foo-%*.jpeg</code> will match all the
  8517. filenames prefixed by &quot;foo-&quot; and terminating with &quot;.jpeg&quot;, and
  8518. <code class="code">foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
  8519. &quot;foo-&quot;, followed by a sequence of three characters, and terminating
  8520. with &quot;.jpeg&quot;.
  8521. </p>
  8522. <p>This pattern type is deprecated in favor of <var class="var">glob</var> and
  8523. <var class="var">sequence</var>.
  8524. </p></dd>
  8525. </dl>
  8526. <p>Default value is <var class="var">glob_sequence</var>.
  8527. </p></dd>
  8528. <dt><samp class="option">pixel_format</samp></dt>
  8529. <dd><p>Set the pixel format of the images to read. If not specified the pixel
  8530. format is guessed from the first image file in the sequence.
  8531. </p></dd>
  8532. <dt><samp class="option">start_number</samp></dt>
  8533. <dd><p>Set the index of the file matched by the image file pattern to start
  8534. to read from. Default value is 0.
  8535. </p></dd>
  8536. <dt><samp class="option">start_number_range</samp></dt>
  8537. <dd><p>Set the index interval range to check when looking for the first image
  8538. file in the sequence, starting from <var class="var">start_number</var>. Default value
  8539. is 5.
  8540. </p></dd>
  8541. <dt><samp class="option">ts_from_file</samp></dt>
  8542. <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
  8543. that monotonity of timestamps is not provided: images go in the same order as
  8544. without this option. Default value is 0.
  8545. If set to 2, will set frame timestamp to the modification time of the image file in
  8546. nanosecond precision.
  8547. </p></dd>
  8548. <dt><samp class="option">video_size</samp></dt>
  8549. <dd><p>Set the video size of the images to read. If not specified the video
  8550. size is guessed from the first image file in the sequence.
  8551. </p></dd>
  8552. <dt><samp class="option">export_path_metadata</samp></dt>
  8553. <dd><p>If set to 1, will add two extra fields to the metadata found in input, making them
  8554. also available for other filters (see <var class="var">drawtext</var> filter for examples). Default
  8555. value is 0. The extra fields are described below:
  8556. </p><dl class="table">
  8557. <dt><samp class="option">lavf.image2dec.source_path</samp></dt>
  8558. <dd><p>Corresponds to the full path to the input file being read.
  8559. </p></dd>
  8560. <dt><samp class="option">lavf.image2dec.source_basename</samp></dt>
  8561. <dd><p>Corresponds to the name of the file being read.
  8562. </p></dd>
  8563. </dl>
  8564. </dd>
  8565. </dl>
  8566. <ul class="mini-toc">
  8567. <li><a href="#Examples-5" accesskey="1">Examples</a></li>
  8568. </ul>
  8569. <div class="subsection-level-extent" id="Examples-5">
  8570. <h4 class="subsection"><span>13.13.1 Examples<a class="copiable-link" href="#Examples-5"> &para;</a></span></h4>
  8571. <ul class="itemize mark-bullet">
  8572. <li>Use <code class="command">ffmpeg</code> for creating a video from the images in the file
  8573. sequence <samp class="file">img-001.jpeg</samp>, <samp class="file">img-002.jpeg</samp>, ..., assuming an
  8574. input frame rate of 10 frames per second:
  8575. <div class="example">
  8576. <pre class="example-preformatted">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
  8577. </pre></div>
  8578. </li><li>As above, but start by reading from a file with index 100 in the sequence:
  8579. <div class="example">
  8580. <pre class="example-preformatted">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
  8581. </pre></div>
  8582. </li><li>Read images matching the &quot;*.png&quot; glob pattern , that is all the files
  8583. terminating with the &quot;.png&quot; suffix:
  8584. <div class="example">
  8585. <pre class="example-preformatted">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
  8586. </pre></div>
  8587. </li></ul>
  8588. </div>
  8589. </div>
  8590. <div class="section-level-extent" id="libgme">
  8591. <h3 class="section"><span>13.14 libgme<a class="copiable-link" href="#libgme"> &para;</a></span></h3>
  8592. <p>The Game Music Emu library is a collection of video game music file emulators.
  8593. </p>
  8594. <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.
  8595. </p>
  8596. <p>It accepts the following options:
  8597. </p>
  8598. <dl class="table">
  8599. <dt><samp class="option">track_index</samp></dt>
  8600. <dd><p>Set the index of which track to demux. The demuxer can only export one track.
  8601. Track indexes start at 0. Default is to pick the first track. Number of tracks
  8602. is exported as <var class="var">tracks</var> metadata entry.
  8603. </p>
  8604. </dd>
  8605. <dt><samp class="option">sample_rate</samp></dt>
  8606. <dd><p>Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100.
  8607. </p>
  8608. </dd>
  8609. <dt><samp class="option">max_size <em class="emph">(bytes)</em></samp></dt>
  8610. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  8611. which in turn, acts as a ceiling for the size of files that can be read.
  8612. Default is 50 MiB.
  8613. </p>
  8614. </dd>
  8615. </dl>
  8616. </div>
  8617. <div class="section-level-extent" id="libmodplug">
  8618. <h3 class="section"><span>13.15 libmodplug<a class="copiable-link" href="#libmodplug"> &para;</a></span></h3>
  8619. <p>ModPlug based module demuxer
  8620. </p>
  8621. <p>See <a class="url" href="https://github.com/Konstanty/libmodplug">https://github.com/Konstanty/libmodplug</a>
  8622. </p>
  8623. <p>It will export one 2-channel 16-bit 44.1 kHz audio stream.
  8624. Optionally, a <code class="code">pal8</code> 16-color video stream can be exported with or without printed metadata.
  8625. </p>
  8626. <p>It accepts the following options:
  8627. </p>
  8628. <dl class="table">
  8629. <dt><samp class="option">noise_reduction</samp></dt>
  8630. <dd><p>Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0.
  8631. </p>
  8632. </dd>
  8633. <dt><samp class="option">reverb_depth</samp></dt>
  8634. <dd><p>Set amount of reverb. Range 0-100. Default is 0.
  8635. </p>
  8636. </dd>
  8637. <dt><samp class="option">reverb_delay</samp></dt>
  8638. <dd><p>Set delay in ms, clamped to 40-250 ms. Default is 0.
  8639. </p>
  8640. </dd>
  8641. <dt><samp class="option">bass_amount</samp></dt>
  8642. <dd><p>Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0.
  8643. </p>
  8644. </dd>
  8645. <dt><samp class="option">bass_range</samp></dt>
  8646. <dd><p>Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0.
  8647. </p>
  8648. </dd>
  8649. <dt><samp class="option">surround_depth</samp></dt>
  8650. <dd><p>Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0.
  8651. </p>
  8652. </dd>
  8653. <dt><samp class="option">surround_delay</samp></dt>
  8654. <dd><p>Set surround delay in ms, clamped to 5-40 ms. Default is 0.
  8655. </p>
  8656. </dd>
  8657. <dt><samp class="option">max_size</samp></dt>
  8658. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  8659. which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB.
  8660. 0 removes buffer size limit (not recommended). Default is 5 MiB.
  8661. </p>
  8662. </dd>
  8663. <dt><samp class="option">video_stream_expr</samp></dt>
  8664. <dd><p>String which is evaluated using the eval API to assign colors to the generated video stream.
  8665. 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>,
  8666. <code class="code">tempo</code>, <code class="code">order</code>, <code class="code">pattern</code> and <code class="code">row</code>.
  8667. </p>
  8668. </dd>
  8669. <dt><samp class="option">video_stream</samp></dt>
  8670. <dd><p>Generate video stream. Can be 1 (on) or 0 (off). Default is 0.
  8671. </p>
  8672. </dd>
  8673. <dt><samp class="option">video_stream_w</samp></dt>
  8674. <dd><p>Set video frame width in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  8675. </p>
  8676. </dd>
  8677. <dt><samp class="option">video_stream_h</samp></dt>
  8678. <dd><p>Set video frame height in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  8679. </p>
  8680. </dd>
  8681. <dt><samp class="option">video_stream_ptxt</samp></dt>
  8682. <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>,
  8683. <code class="code">row</code> and <code class="code">ts</code> (time in ms). Can be 1 (on) or 0 (off). Default is 1.
  8684. </p>
  8685. </dd>
  8686. </dl>
  8687. </div>
  8688. <div class="section-level-extent" id="libopenmpt">
  8689. <h3 class="section"><span>13.16 libopenmpt<a class="copiable-link" href="#libopenmpt"> &para;</a></span></h3>
  8690. <p>libopenmpt based module demuxer
  8691. </p>
  8692. <p>See <a class="url" href="https://lib.openmpt.org/libopenmpt/">https://lib.openmpt.org/libopenmpt/</a> for more information.
  8693. </p>
  8694. <p>Some files have multiple subsongs (tracks) this can be set with the <samp class="option">subsong</samp>
  8695. option.
  8696. </p>
  8697. <p>It accepts the following options:
  8698. </p>
  8699. <dl class="table">
  8700. <dt><samp class="option">subsong</samp></dt>
  8701. <dd><p>Set the subsong index. This can be either &rsquo;all&rsquo;, &rsquo;auto&rsquo;, or the index of the
  8702. subsong. Subsong indexes start at 0. The default is &rsquo;auto&rsquo;.
  8703. </p>
  8704. <p>The default value is to let libopenmpt choose.
  8705. </p>
  8706. </dd>
  8707. <dt><samp class="option">layout</samp></dt>
  8708. <dd><p>Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
  8709. The default value is STEREO.
  8710. </p>
  8711. </dd>
  8712. <dt><samp class="option">sample_rate</samp></dt>
  8713. <dd><p>Set the sample rate for libopenmpt to output.
  8714. Range is from 1000 to INT_MAX. The value default is 48000.
  8715. </p></dd>
  8716. </dl>
  8717. </div>
  8718. <div class="section-level-extent" id="mov_002fmp4_002f3gp">
  8719. <h3 class="section"><span>13.17 mov/mp4/3gp<a class="copiable-link" href="#mov_002fmp4_002f3gp"> &para;</a></span></h3>
  8720. <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).
  8721. </p>
  8722. <p>Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v
  8723. </p>
  8724. <ul class="mini-toc">
  8725. <li><a href="#Options-15" accesskey="1">Options</a></li>
  8726. <li><a href="#Audible-AAX" accesskey="2">Audible AAX</a></li>
  8727. </ul>
  8728. <div class="subsection-level-extent" id="Options-15">
  8729. <h4 class="subsection"><span>13.17.1 Options<a class="copiable-link" href="#Options-15"> &para;</a></span></h4>
  8730. <p>This demuxer accepts the following options:
  8731. </p><dl class="table">
  8732. <dt><samp class="option">enable_drefs</samp></dt>
  8733. <dd><p>Enable loading of external tracks, disabled by default.
  8734. Enabling this can theoretically leak information in some use cases.
  8735. </p>
  8736. </dd>
  8737. <dt><samp class="option">use_absolute_path</samp></dt>
  8738. <dd><p>Allows loading of external tracks via absolute paths, disabled by default.
  8739. Enabling this poses a security risk. It should only be enabled if the source
  8740. is known to be non-malicious.
  8741. </p>
  8742. </dd>
  8743. <dt><samp class="option">seek_streams_individually</samp></dt>
  8744. <dd><p>When seeking, identify the closest point in each stream individually and demux packets in
  8745. that stream from identified point. This can lead to a different sequence of packets compared
  8746. to demuxing linearly from the beginning. Default is true.
  8747. </p>
  8748. </dd>
  8749. <dt><samp class="option">ignore_editlist</samp></dt>
  8750. <dd><p>Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the
  8751. timeline described by the edit list. Default is false.
  8752. </p>
  8753. </dd>
  8754. <dt><samp class="option">advanced_editlist</samp></dt>
  8755. <dd><p>Modify the stream index to reflect the timeline described by the edit list. <code class="code">ignore_editlist</code>
  8756. must be set to false for this option to be effective.
  8757. If both <code class="code">ignore_editlist</code> and this option are set to false, then only the
  8758. start of the stream index is modified to reflect initial dwell time or starting timestamp
  8759. described by the edit list. Default is true.
  8760. </p>
  8761. </dd>
  8762. <dt><samp class="option">ignore_chapters</samp></dt>
  8763. <dd><p>Don&rsquo;t parse chapters. This includes GoPro &rsquo;HiLight&rsquo; tags/moments. Note that chapters are
  8764. only parsed when input is seekable. Default is false.
  8765. </p>
  8766. </dd>
  8767. <dt><samp class="option">use_mfra_for</samp></dt>
  8768. <dd><p>For seekable fragmented input, set fragment&rsquo;s starting timestamp from media fragment random access box, if present.
  8769. </p>
  8770. <p>Following options are available:
  8771. </p><dl class="table">
  8772. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  8773. <dd><p>Auto-detect whether to set mfra timestamps as PTS or DTS <em class="emph">(default)</em>
  8774. </p>
  8775. </dd>
  8776. <dt>&lsquo;<samp class="samp">dts</samp>&rsquo;</dt>
  8777. <dd><p>Set mfra timestamps as DTS
  8778. </p>
  8779. </dd>
  8780. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  8781. <dd><p>Set mfra timestamps as PTS
  8782. </p>
  8783. </dd>
  8784. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  8785. <dd><p>Don&rsquo;t use mfra box to set timestamps
  8786. </p></dd>
  8787. </dl>
  8788. </dd>
  8789. <dt><samp class="option">use_tfdt</samp></dt>
  8790. <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.
  8791. 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.
  8792. 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
  8793. set to pts or dts.
  8794. </p>
  8795. </dd>
  8796. <dt><samp class="option">export_all</samp></dt>
  8797. <dd><p>Export unrecognized boxes within the <var class="var">udta</var> box as metadata entries. The first four
  8798. characters of the box type are set as the key. Default is false.
  8799. </p>
  8800. </dd>
  8801. <dt><samp class="option">export_xmp</samp></dt>
  8802. <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
  8803. 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
  8804. but with key <code class="code">XMP_</code>. Default is false.
  8805. </p>
  8806. </dd>
  8807. <dt><samp class="option">activation_bytes</samp></dt>
  8808. <dd><p>4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below.
  8809. </p>
  8810. </dd>
  8811. <dt><samp class="option">audible_fixed_key</samp></dt>
  8812. <dd><p>Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to
  8813. specify.
  8814. </p>
  8815. </dd>
  8816. <dt><samp class="option">decryption_key</samp></dt>
  8817. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  8818. </p>
  8819. </dd>
  8820. <dt><samp class="option">max_stts_delta</samp></dt>
  8821. <dd><p>Very high sample deltas written in a trak&rsquo;s stts box may occasionally be intended but usually they are written in
  8822. error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets
  8823. the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when
  8824. cast to int32 are used to adjust onward dts.
  8825. </p>
  8826. <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
  8827. a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of <code class="code">uint32</code> range.
  8828. </p>
  8829. </dd>
  8830. <dt><samp class="option">interleaved_read</samp></dt>
  8831. <dd><p>Interleave packets from multiple tracks at demuxer level. For badly interleaved files, this prevents playback issues
  8832. caused by large gaps between packets in different tracks, as MOV/MP4 do not have packet placement requirements.
  8833. However, this can cause excessive seeking on very badly interleaved files, due to seeking between tracks, so disabling
  8834. it may prevent I/O issues, at the expense of playback.
  8835. </p>
  8836. </dd>
  8837. </dl>
  8838. </div>
  8839. <div class="subsection-level-extent" id="Audible-AAX">
  8840. <h4 class="subsection"><span>13.17.2 Audible AAX<a class="copiable-link" href="#Audible-AAX"> &para;</a></span></h4>
  8841. <p>Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
  8842. </p><div class="example">
  8843. <pre class="example-preformatted">ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
  8844. </pre></div>
  8845. </div>
  8846. </div>
  8847. <div class="section-level-extent" id="mpegts">
  8848. <h3 class="section"><span>13.18 mpegts<a class="copiable-link" href="#mpegts"> &para;</a></span></h3>
  8849. <p>MPEG-2 transport stream demuxer.
  8850. </p>
  8851. <p>This demuxer accepts the following options:
  8852. </p><dl class="table">
  8853. <dt><samp class="option">resync_size</samp></dt>
  8854. <dd><p>Set size limit for looking up a new synchronization. Default value is
  8855. 65536.
  8856. </p>
  8857. </dd>
  8858. <dt><samp class="option">skip_unknown_pmt</samp></dt>
  8859. <dd><p>Skip PMTs for programs not defined in the PAT. Default value is 0.
  8860. </p>
  8861. </dd>
  8862. <dt><samp class="option">fix_teletext_pts</samp></dt>
  8863. <dd><p>Override teletext packet PTS and DTS values with the timestamps calculated
  8864. from the PCR of the first program which the teletext stream is part of and is
  8865. not discarded. Default value is 1, set this option to 0 if you want your
  8866. teletext packet PTS and DTS values untouched.
  8867. </p>
  8868. </dd>
  8869. <dt><samp class="option">ts_packetsize</samp></dt>
  8870. <dd><p>Output option carrying the raw packet size in bytes.
  8871. Show the detected raw packet size, cannot be set by the user.
  8872. </p>
  8873. </dd>
  8874. <dt><samp class="option">scan_all_pmts</samp></dt>
  8875. <dd><p>Scan and combine all PMTs. The value is an integer with value from -1
  8876. to 1 (-1 means automatic setting, 1 means enabled, 0 means
  8877. disabled). Default value is -1.
  8878. </p>
  8879. </dd>
  8880. <dt><samp class="option">merge_pmt_versions</samp></dt>
  8881. <dd><p>Re-use existing streams when a PMT&rsquo;s version is updated and elementary
  8882. streams move to different PIDs. Default value is 0.
  8883. </p>
  8884. </dd>
  8885. <dt><samp class="option">max_packet_size</samp></dt>
  8886. <dd><p>Set maximum size, in bytes, of packet emitted by the demuxer. Payloads above this size
  8887. are split across multiple packets. Range is 1 to INT_MAX/2. Default is 204800 bytes.
  8888. </p></dd>
  8889. </dl>
  8890. </div>
  8891. <div class="section-level-extent" id="mpjpeg">
  8892. <h3 class="section"><span>13.19 mpjpeg<a class="copiable-link" href="#mpjpeg"> &para;</a></span></h3>
  8893. <p>MJPEG encapsulated in multi-part MIME demuxer.
  8894. </p>
  8895. <p>This demuxer allows reading of MJPEG, where each frame is represented as a part of
  8896. multipart/x-mixed-replace stream.
  8897. </p><dl class="table">
  8898. <dt><samp class="option">strict_mime_boundary</samp></dt>
  8899. <dd><p>Default implementation applies a relaxed standard to multi-part MIME boundary detection,
  8900. to prevent regression with numerous existing endpoints not generating a proper MIME
  8901. MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check
  8902. of the boundary value.
  8903. </p></dd>
  8904. </dl>
  8905. </div>
  8906. <div class="section-level-extent" id="rawvideo-1">
  8907. <h3 class="section"><span>13.20 rawvideo<a class="copiable-link" href="#rawvideo-1"> &para;</a></span></h3>
  8908. <p>Raw video demuxer.
  8909. </p>
  8910. <p>This demuxer allows one to read raw video data. Since there is no header
  8911. specifying the assumed video parameters, the user must specify them
  8912. in order to be able to decode the data correctly.
  8913. </p>
  8914. <p>This demuxer accepts the following options:
  8915. </p><dl class="table">
  8916. <dt><samp class="option">framerate</samp></dt>
  8917. <dd><p>Set input video frame rate. Default value is 25.
  8918. </p>
  8919. </dd>
  8920. <dt><samp class="option">pixel_format</samp></dt>
  8921. <dd><p>Set the input video pixel format. Default value is <code class="code">yuv420p</code>.
  8922. </p>
  8923. </dd>
  8924. <dt><samp class="option">video_size</samp></dt>
  8925. <dd><p>Set the input video size. This value must be specified explicitly.
  8926. </p></dd>
  8927. </dl>
  8928. <p>For example to read a rawvideo file <samp class="file">input.raw</samp> with
  8929. <code class="command">ffplay</code>, assuming a pixel format of <code class="code">rgb24</code>, a video
  8930. size of <code class="code">320x240</code>, and a frame rate of 10 images per second, use
  8931. the command:
  8932. </p><div class="example">
  8933. <pre class="example-preformatted">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
  8934. </pre></div>
  8935. </div>
  8936. <div class="section-level-extent" id="sbg">
  8937. <h3 class="section"><span>13.21 sbg<a class="copiable-link" href="#sbg"> &para;</a></span></h3>
  8938. <p>SBaGen script demuxer.
  8939. </p>
  8940. <p>This demuxer reads the script language used by SBaGen
  8941. <a class="url" href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
  8942. script looks like that:
  8943. </p><div class="example">
  8944. <pre class="example-preformatted">-SE
  8945. a: 300-2.5/3 440+4.5/0
  8946. b: 300-2.5/0 440+4.5/3
  8947. off: -
  8948. NOW == a
  8949. +0:07:00 == b
  8950. +0:14:00 == a
  8951. +0:21:00 == b
  8952. +0:30:00 off
  8953. </pre></div>
  8954. <p>A SBG script can mix absolute and relative timestamps. If the script uses
  8955. either only absolute timestamps (including the script start time) or only
  8956. relative ones, then its layout is fixed, and the conversion is
  8957. straightforward. On the other hand, if the script mixes both kind of
  8958. timestamps, then the <var class="var">NOW</var> reference for relative timestamps will be
  8959. taken from the current time of day at the time the script is read, and the
  8960. script layout will be frozen according to that reference. That means that if
  8961. the script is directly played, the actual times will match the absolute
  8962. timestamps up to the sound controller&rsquo;s clock accuracy, but if the user
  8963. somehow pauses the playback or seeks, all times will be shifted accordingly.
  8964. </p>
  8965. </div>
  8966. <div class="section-level-extent" id="tedcaptions">
  8967. <h3 class="section"><span>13.22 tedcaptions<a class="copiable-link" href="#tedcaptions"> &para;</a></span></h3>
  8968. <p>JSON captions used for <a class="url" href="http://www.ted.com/">TED Talks</a>.
  8969. </p>
  8970. <p>TED does not provide links to the captions, but they can be guessed from the
  8971. page. The file <samp class="file">tools/bookmarklets.html</samp> from the FFmpeg source tree
  8972. contains a bookmarklet to expose them.
  8973. </p>
  8974. <p>This demuxer accepts the following option:
  8975. </p><dl class="table">
  8976. <dt><samp class="option">start_time</samp></dt>
  8977. <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
  8978. (15s). It is used to sync the captions with the downloadable videos, because
  8979. they include a 15s intro.
  8980. </p></dd>
  8981. </dl>
  8982. <p>Example: convert the captions to a format most players understand:
  8983. </p><div class="example">
  8984. <pre class="example-preformatted">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
  8985. </pre></div>
  8986. </div>
  8987. <div class="section-level-extent" id="vapoursynth">
  8988. <h3 class="section"><span>13.23 vapoursynth<a class="copiable-link" href="#vapoursynth"> &para;</a></span></h3>
  8989. <p>Vapoursynth wrapper.
  8990. </p>
  8991. <p>Due to security concerns, Vapoursynth scripts will not
  8992. be autodetected so the input format has to be forced. For ff* CLI tools,
  8993. add <code class="code">-f vapoursynth</code> before the input <code class="code">-i yourscript.vpy</code>.
  8994. </p>
  8995. <p>This demuxer accepts the following option:
  8996. </p><dl class="table">
  8997. <dt><samp class="option">max_script_size</samp></dt>
  8998. <dd><p>The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size,
  8999. which in turn, acts as a ceiling for the size of scripts that can be read.
  9000. Default is 1 MiB.
  9001. </p></dd>
  9002. </dl>
  9003. </div>
  9004. <div class="section-level-extent" id="w64">
  9005. <h3 class="section"><span>13.24 w64<a class="copiable-link" href="#w64"> &para;</a></span></h3>
  9006. <p>Sony Wave64 Audio demuxer.
  9007. </p>
  9008. <p>This demuxer accepts the following options:
  9009. </p><dl class="table">
  9010. <dt><samp class="option">max_size</samp></dt>
  9011. <dd><p>See the same option for the <a class="ref" href="#wav">wav</a> demuxer.
  9012. </p></dd>
  9013. </dl>
  9014. <a class="anchor" id="wav"></a></div>
  9015. <div class="section-level-extent" id="wav-1">
  9016. <h3 class="section"><span>13.25 wav<a class="copiable-link" href="#wav-1"> &para;</a></span></h3>
  9017. <p>RIFF Wave Audio demuxer.
  9018. </p>
  9019. <p>This demuxer accepts the following options:
  9020. </p><dl class="table">
  9021. <dt><samp class="option">max_size</samp></dt>
  9022. <dd><p>Specify the maximum packet size in bytes for the demuxed packets. By default
  9023. this is set to 0, which means that a sensible value is chosen based on the
  9024. input format.
  9025. </p></dd>
  9026. </dl>
  9027. <a class="anchor" id="metadata"></a></div>
  9028. </div>
  9029. <div class="chapter-level-extent" id="Metadata">
  9030. <h2 class="chapter"><span>14 Metadata<a class="copiable-link" href="#Metadata"> &para;</a></span></h2>
  9031. <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
  9032. INI-like text file and then load it back using the metadata muxer/demuxer.
  9033. </p>
  9034. <p>The file format is as follows:
  9035. </p><ol class="enumerate">
  9036. <li> A file consists of a header and a number of metadata tags divided into sections,
  9037. each on its own line.
  9038. </li><li> The header is a &lsquo;<samp class="samp">;FFMETADATA</samp>&rsquo; string, followed by a version number (now 1).
  9039. </li><li> Metadata tags are of the form &lsquo;<samp class="samp">key=value</samp>&rsquo;
  9040. </li><li> Immediately after header follows global metadata
  9041. </li><li> After global metadata there may be sections with per-stream/per-chapter
  9042. metadata.
  9043. </li><li> A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
  9044. brackets (&lsquo;<samp class="samp">[</samp>&rsquo;, &lsquo;<samp class="samp">]</samp>&rsquo;) and ends with next section or end of file.
  9045. </li><li> At the beginning of a chapter section there may be an optional timebase to be
  9046. used for start/end values. It must be in form
  9047. &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
  9048. integers. If the timebase is missing then start/end times are assumed to
  9049. be in nanoseconds.
  9050. <p>Next a chapter section must contain chapter start and end times in form
  9051. &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
  9052. integer.
  9053. </p>
  9054. </li><li> Empty lines and lines starting with &lsquo;<samp class="samp">;</samp>&rsquo; or &lsquo;<samp class="samp">#</samp>&rsquo; are ignored.
  9055. </li><li> Metadata keys or values containing special characters (&lsquo;<samp class="samp">=</samp>&rsquo;, &lsquo;<samp class="samp">;</samp>&rsquo;,
  9056. &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;.
  9057. </li><li> Note that whitespace in metadata (e.g. &lsquo;<samp class="samp">foo = bar</samp>&rsquo;) is considered to be
  9058. a part of the tag (in the example above key is &lsquo;<samp class="samp">foo </samp>&rsquo;, value is
  9059. &lsquo;<samp class="samp"> bar</samp>&rsquo;).
  9060. </li></ol>
  9061. <p>A ffmetadata file might look like this:
  9062. </p><div class="example">
  9063. <pre class="example-preformatted">;FFMETADATA1
  9064. title=bike\\shed
  9065. ;this is a comment
  9066. artist=FFmpeg troll team
  9067. [CHAPTER]
  9068. TIMEBASE=1/1000
  9069. START=0
  9070. #chapter ends at 0:01:00
  9071. END=60000
  9072. title=chapter \#1
  9073. [STREAM]
  9074. title=multi\
  9075. line
  9076. </pre></div>
  9077. <p>By using the ffmetadata muxer and demuxer it is possible to extract
  9078. metadata from an input file to an ffmetadata file, and then transcode
  9079. the file into an output file with the edited ffmetadata file.
  9080. </p>
  9081. <p>Extracting an ffmetadata file with <samp class="file">ffmpeg</samp> goes as follows:
  9082. </p><div class="example">
  9083. <pre class="example-preformatted">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
  9084. </pre></div>
  9085. <p>Reinserting edited metadata information from the FFMETADATAFILE file can
  9086. be done as:
  9087. </p><div class="example">
  9088. <pre class="example-preformatted">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
  9089. </pre></div>
  9090. </div>
  9091. <div class="chapter-level-extent" id="Protocol-Options">
  9092. <h2 class="chapter"><span>15 Protocol Options<a class="copiable-link" href="#Protocol-Options"> &para;</a></span></h2>
  9093. <p>The libavformat library provides some generic global options, which
  9094. can be set on all the protocols. In addition each protocol may support
  9095. so-called private options, which are specific for that component.
  9096. </p>
  9097. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  9098. FFmpeg tools, or by setting the value explicitly in the
  9099. <code class="code">AVFormatContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  9100. for programmatic use.
  9101. </p>
  9102. <p>The list of supported options follows:
  9103. </p>
  9104. <dl class="table">
  9105. <dt><samp class="option">protocol_whitelist <var class="var">list</var> (<em class="emph">input</em>)</samp></dt>
  9106. <dd><p>Set a &quot;,&quot;-separated list of allowed protocols. &quot;ALL&quot; matches all protocols. Protocols
  9107. prefixed by &quot;-&quot; are disabled.
  9108. All protocols are allowed by default but protocols used by an another
  9109. protocol (nested protocols) are restricted to a per protocol subset.
  9110. </p></dd>
  9111. </dl>
  9112. </div>
  9113. <div class="chapter-level-extent" id="Protocols">
  9114. <h2 class="chapter"><span>16 Protocols<a class="copiable-link" href="#Protocols"> &para;</a></span></h2>
  9115. <p>Protocols are configured elements in FFmpeg that enable access to
  9116. resources that require specific protocols.
  9117. </p>
  9118. <p>When you configure your FFmpeg build, all the supported protocols are
  9119. enabled by default. You can list all available ones using the
  9120. configure option &quot;&ndash;list-protocols&quot;.
  9121. </p>
  9122. <p>You can disable all the protocols using the configure option
  9123. &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
  9124. option &quot;&ndash;enable-protocol=<var class="var">PROTOCOL</var>&quot;, or you can disable a
  9125. particular protocol using the option
  9126. &quot;&ndash;disable-protocol=<var class="var">PROTOCOL</var>&quot;.
  9127. </p>
  9128. <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
  9129. supported protocols.
  9130. </p>
  9131. <p>All protocols accept the following options:
  9132. </p>
  9133. <dl class="table">
  9134. <dt><samp class="option">rw_timeout</samp></dt>
  9135. <dd><p>Maximum time to wait for (network) read/write operations to complete,
  9136. in microseconds.
  9137. </p></dd>
  9138. </dl>
  9139. <p>A description of the currently available protocols follows.
  9140. </p>
  9141. <ul class="mini-toc">
  9142. <li><a href="#amqp" accesskey="1">amqp</a></li>
  9143. <li><a href="#async" accesskey="2">async</a></li>
  9144. <li><a href="#bluray" accesskey="3">bluray</a></li>
  9145. <li><a href="#cache" accesskey="4">cache</a></li>
  9146. <li><a href="#concat-2" accesskey="5">concat</a></li>
  9147. <li><a href="#concatf" accesskey="6">concatf</a></li>
  9148. <li><a href="#crypto" accesskey="7">crypto</a></li>
  9149. <li><a href="#data" accesskey="8">data</a></li>
  9150. <li><a href="#fd" accesskey="9">fd</a></li>
  9151. <li><a href="#file">file</a></li>
  9152. <li><a href="#ftp">ftp</a></li>
  9153. <li><a href="#gopher">gopher</a></li>
  9154. <li><a href="#gophers">gophers</a></li>
  9155. <li><a href="#hls-1">hls</a></li>
  9156. <li><a href="#http">http</a></li>
  9157. <li><a href="#Icecast">Icecast</a></li>
  9158. <li><a href="#ipfs">ipfs</a></li>
  9159. <li><a href="#mmst">mmst</a></li>
  9160. <li><a href="#mmsh">mmsh</a></li>
  9161. <li><a href="#md5">md5</a></li>
  9162. <li><a href="#pipe">pipe</a></li>
  9163. <li><a href="#prompeg">prompeg</a></li>
  9164. <li><a href="#rist">rist</a></li>
  9165. <li><a href="#rtmp">rtmp</a></li>
  9166. <li><a href="#rtmpe">rtmpe</a></li>
  9167. <li><a href="#rtmps">rtmps</a></li>
  9168. <li><a href="#rtmpt">rtmpt</a></li>
  9169. <li><a href="#rtmpte">rtmpte</a></li>
  9170. <li><a href="#rtmpts">rtmpts</a></li>
  9171. <li><a href="#libsmbclient">libsmbclient</a></li>
  9172. <li><a href="#libssh">libssh</a></li>
  9173. <li><a href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
  9174. <li><a href="#rtp">rtp</a></li>
  9175. <li><a href="#rtsp">rtsp</a></li>
  9176. <li><a href="#sap">sap</a></li>
  9177. <li><a href="#sctp">sctp</a></li>
  9178. <li><a href="#srt">srt</a></li>
  9179. <li><a href="#srtp">srtp</a></li>
  9180. <li><a href="#subfile">subfile</a></li>
  9181. <li><a href="#tee">tee</a></li>
  9182. <li><a href="#tcp">tcp</a></li>
  9183. <li><a href="#tls">tls</a></li>
  9184. <li><a href="#udp">udp</a></li>
  9185. <li><a href="#unix">unix</a></li>
  9186. <li><a href="#zmq">zmq</a></li>
  9187. </ul>
  9188. <div class="section-level-extent" id="amqp">
  9189. <h3 class="section"><span>16.1 amqp<a class="copiable-link" href="#amqp"> &para;</a></span></h3>
  9190. <p>Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based
  9191. publish-subscribe communication protocol.
  9192. </p>
  9193. <p>FFmpeg must be compiled with &ndash;enable-librabbitmq to support AMQP. A separate
  9194. AMQP broker must also be run. An example open-source AMQP broker is RabbitMQ.
  9195. </p>
  9196. <p>After starting the broker, an FFmpeg client may stream data to the broker using
  9197. the command:
  9198. </p>
  9199. <div class="example">
  9200. <pre class="example-preformatted">ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@]hostname[:port][/vhost]
  9201. </pre></div>
  9202. <p>Where hostname and port (default is 5672) is the address of the broker. The
  9203. client may also set a user/password for authentication. The default for both
  9204. fields is &quot;guest&quot;. Name of virtual host on broker can be set with vhost. The
  9205. default value is &quot;/&quot;.
  9206. </p>
  9207. <p>Muliple subscribers may stream from the broker using the command:
  9208. </p><div class="example">
  9209. <pre class="example-preformatted">ffplay amqp://[[user]:[password]@]hostname[:port][/vhost]
  9210. </pre></div>
  9211. <p>In RabbitMQ all data published to the broker flows through a specific exchange,
  9212. and each subscribing client has an assigned queue/buffer. When a packet arrives
  9213. at an exchange, it may be copied to a client&rsquo;s queue depending on the exchange
  9214. and routing_key fields.
  9215. </p>
  9216. <p>The following options are supported:
  9217. </p>
  9218. <dl class="table">
  9219. <dt><samp class="option">exchange</samp></dt>
  9220. <dd><p>Sets the exchange to use on the broker. RabbitMQ has several predefined
  9221. exchanges: &quot;amq.direct&quot; is the default exchange, where the publisher and
  9222. subscriber must have a matching routing_key; &quot;amq.fanout&quot; is the same as a
  9223. broadcast operation (i.e. the data is forwarded to all queues on the fanout
  9224. exchange independent of the routing_key); and &quot;amq.topic&quot; is similar to
  9225. &quot;amq.direct&quot;, but allows for more complex pattern matching (refer to the RabbitMQ
  9226. documentation).
  9227. </p>
  9228. </dd>
  9229. <dt><samp class="option">routing_key</samp></dt>
  9230. <dd><p>Sets the routing key. The default value is &quot;amqp&quot;. The routing key is used on
  9231. the &quot;amq.direct&quot; and &quot;amq.topic&quot; exchanges to decide whether packets are written
  9232. to the queue of a subscriber.
  9233. </p>
  9234. </dd>
  9235. <dt><samp class="option">pkt_size</samp></dt>
  9236. <dd><p>Maximum size of each packet sent/received to the broker. Default is 131072.
  9237. Minimum is 4096 and max is any large value (representable by an int). When
  9238. receiving packets, this sets an internal buffer size in FFmpeg. It should be
  9239. equal to or greater than the size of the published packets to the broker. Otherwise
  9240. the received message may be truncated causing decoding errors.
  9241. </p>
  9242. </dd>
  9243. <dt><samp class="option">connection_timeout</samp></dt>
  9244. <dd><p>The timeout in seconds during the initial connection to the broker. The
  9245. default value is rw_timeout, or 5 seconds if rw_timeout is not set.
  9246. </p>
  9247. </dd>
  9248. <dt><samp class="option">delivery_mode <var class="var">mode</var></samp></dt>
  9249. <dd><p>Sets the delivery mode of each message sent to broker.
  9250. The following values are accepted:
  9251. </p><dl class="table">
  9252. <dt>&lsquo;<samp class="samp">persistent</samp>&rsquo;</dt>
  9253. <dd><p>Delivery mode set to &quot;persistent&quot; (2). This is the default value.
  9254. Messages may be written to the broker&rsquo;s disk depending on its setup.
  9255. </p>
  9256. </dd>
  9257. <dt>&lsquo;<samp class="samp">non-persistent</samp>&rsquo;</dt>
  9258. <dd><p>Delivery mode set to &quot;non-persistent&quot; (1).
  9259. Messages will stay in broker&rsquo;s memory unless the broker is under memory
  9260. pressure.
  9261. </p>
  9262. </dd>
  9263. </dl>
  9264. </dd>
  9265. </dl>
  9266. </div>
  9267. <div class="section-level-extent" id="async">
  9268. <h3 class="section"><span>16.2 async<a class="copiable-link" href="#async"> &para;</a></span></h3>
  9269. <p>Asynchronous data filling wrapper for input stream.
  9270. </p>
  9271. <p>Fill data in a background thread, to decouple I/O operation from demux thread.
  9272. </p>
  9273. <div class="example">
  9274. <pre class="example-preformatted">async:<var class="var">URL</var>
  9275. async:http://host/resource
  9276. async:cache:http://host/resource
  9277. </pre></div>
  9278. </div>
  9279. <div class="section-level-extent" id="bluray">
  9280. <h3 class="section"><span>16.3 bluray<a class="copiable-link" href="#bluray"> &para;</a></span></h3>
  9281. <p>Read BluRay playlist.
  9282. </p>
  9283. <p>The accepted options are:
  9284. </p><dl class="table">
  9285. <dt><samp class="option">angle</samp></dt>
  9286. <dd><p>BluRay angle
  9287. </p>
  9288. </dd>
  9289. <dt><samp class="option">chapter</samp></dt>
  9290. <dd><p>Start chapter (1...N)
  9291. </p>
  9292. </dd>
  9293. <dt><samp class="option">playlist</samp></dt>
  9294. <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
  9295. </p>
  9296. </dd>
  9297. </dl>
  9298. <p>Examples:
  9299. </p>
  9300. <p>Read longest playlist from BluRay mounted to /mnt/bluray:
  9301. </p><div class="example">
  9302. <pre class="example-preformatted">bluray:/mnt/bluray
  9303. </pre></div>
  9304. <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
  9305. </p><div class="example">
  9306. <pre class="example-preformatted">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
  9307. </pre></div>
  9308. </div>
  9309. <div class="section-level-extent" id="cache">
  9310. <h3 class="section"><span>16.4 cache<a class="copiable-link" href="#cache"> &para;</a></span></h3>
  9311. <p>Caching wrapper for input stream.
  9312. </p>
  9313. <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
  9314. </p>
  9315. <p>The accepted options are:
  9316. </p><dl class="table">
  9317. <dt><samp class="option">read_ahead_limit</samp></dt>
  9318. <dd><p>Amount in bytes that may be read ahead when seeking isn&rsquo;t supported. Range is -1 to INT_MAX.
  9319. -1 for unlimited. Default is 65536.
  9320. </p>
  9321. </dd>
  9322. </dl>
  9323. <p>URL Syntax is
  9324. </p><div class="example">
  9325. <pre class="example-preformatted">cache:<var class="var">URL</var>
  9326. </pre></div>
  9327. </div>
  9328. <div class="section-level-extent" id="concat-2">
  9329. <h3 class="section"><span>16.5 concat<a class="copiable-link" href="#concat-2"> &para;</a></span></h3>
  9330. <p>Physical concatenation protocol.
  9331. </p>
  9332. <p>Read and seek from many resources in sequence as if they were
  9333. a unique resource.
  9334. </p>
  9335. <p>A URL accepted by this protocol has the syntax:
  9336. </p><div class="example">
  9337. <pre class="example-preformatted">concat:<var class="var">URL1</var>|<var class="var">URL2</var>|...|<var class="var">URLN</var>
  9338. </pre></div>
  9339. <p>where <var class="var">URL1</var>, <var class="var">URL2</var>, ..., <var class="var">URLN</var> are the urls of the
  9340. resource to be concatenated, each one possibly specifying a distinct
  9341. protocol.
  9342. </p>
  9343. <p>For example to read a sequence of files <samp class="file">split1.mpeg</samp>,
  9344. <samp class="file">split2.mpeg</samp>, <samp class="file">split3.mpeg</samp> with <code class="command">ffplay</code> use the
  9345. command:
  9346. </p><div class="example">
  9347. <pre class="example-preformatted">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
  9348. </pre></div>
  9349. <p>Note that you may need to escape the character &quot;|&quot; which is special for
  9350. many shells.
  9351. </p>
  9352. </div>
  9353. <div class="section-level-extent" id="concatf">
  9354. <h3 class="section"><span>16.6 concatf<a class="copiable-link" href="#concatf"> &para;</a></span></h3>
  9355. <p>Physical concatenation protocol using a line break delimited list of
  9356. resources.
  9357. </p>
  9358. <p>Read and seek from many resources in sequence as if they were
  9359. a unique resource.
  9360. </p>
  9361. <p>A URL accepted by this protocol has the syntax:
  9362. </p><div class="example">
  9363. <pre class="example-preformatted">concatf:<var class="var">URL</var>
  9364. </pre></div>
  9365. <p>where <var class="var">URL</var> is the url containing a line break delimited list of
  9366. resources to be concatenated, each one possibly specifying a distinct
  9367. protocol. Special characters must be escaped with backslash or single
  9368. quotes. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">the &quot;Quoting and escaping&quot;
  9369. section in the ffmpeg-utils(1) manual</a>.
  9370. </p>
  9371. <p>For example to read a sequence of files <samp class="file">split1.mpeg</samp>,
  9372. <samp class="file">split2.mpeg</samp>, <samp class="file">split3.mpeg</samp> listed in separate lines within
  9373. a file <samp class="file">split.txt</samp> with <code class="command">ffplay</code> use the command:
  9374. </p><div class="example">
  9375. <pre class="example-preformatted">ffplay concatf:split.txt
  9376. </pre></div>
  9377. <p>Where <samp class="file">split.txt</samp> contains the lines:
  9378. </p><div class="example">
  9379. <pre class="example-preformatted">split1.mpeg
  9380. split2.mpeg
  9381. split3.mpeg
  9382. </pre></div>
  9383. </div>
  9384. <div class="section-level-extent" id="crypto">
  9385. <h3 class="section"><span>16.7 crypto<a class="copiable-link" href="#crypto"> &para;</a></span></h3>
  9386. <p>AES-encrypted stream reading protocol.
  9387. </p>
  9388. <p>The accepted options are:
  9389. </p><dl class="table">
  9390. <dt><samp class="option">key</samp></dt>
  9391. <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
  9392. </p>
  9393. </dd>
  9394. <dt><samp class="option">iv</samp></dt>
  9395. <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
  9396. </p></dd>
  9397. </dl>
  9398. <p>Accepted URL formats:
  9399. </p><div class="example">
  9400. <pre class="example-preformatted">crypto:<var class="var">URL</var>
  9401. crypto+<var class="var">URL</var>
  9402. </pre></div>
  9403. </div>
  9404. <div class="section-level-extent" id="data">
  9405. <h3 class="section"><span>16.8 data<a class="copiable-link" href="#data"> &para;</a></span></h3>
  9406. <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>.
  9407. </p>
  9408. <p>For example, to convert a GIF file given inline with <code class="command">ffmpeg</code>:
  9409. </p><div class="example">
  9410. <pre class="example-preformatted">ffmpeg -i &quot;data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=&quot; smiley.png
  9411. </pre></div>
  9412. </div>
  9413. <div class="section-level-extent" id="fd">
  9414. <h3 class="section"><span>16.9 fd<a class="copiable-link" href="#fd"> &para;</a></span></h3>
  9415. <p>File descriptor access protocol.
  9416. </p>
  9417. <p>The accepted syntax is:
  9418. </p><div class="example">
  9419. <pre class="example-preformatted">fd: -fd <var class="var">file_descriptor</var>
  9420. </pre></div>
  9421. <p>If <samp class="option">fd</samp> is not specified, by default the stdout file descriptor will be
  9422. used for writing, stdin for reading. Unlike the pipe protocol, fd protocol has
  9423. seek support if it corresponding to a regular file. fd protocol doesn&rsquo;t support
  9424. pass file descriptor via URL for security.
  9425. </p>
  9426. <p>This protocol accepts the following options:
  9427. </p>
  9428. <dl class="table">
  9429. <dt><samp class="option">blocksize</samp></dt>
  9430. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  9431. <code class="code">INT_MAX</code>, which results in not limiting the requested block size.
  9432. Setting this value reasonably low improves user termination request reaction
  9433. time, which is valuable if data transmission is slow.
  9434. </p>
  9435. </dd>
  9436. <dt><samp class="option">fd</samp></dt>
  9437. <dd><p>Set file descriptor.
  9438. </p></dd>
  9439. </dl>
  9440. </div>
  9441. <div class="section-level-extent" id="file">
  9442. <h3 class="section"><span>16.10 file<a class="copiable-link" href="#file"> &para;</a></span></h3>
  9443. <p>File access protocol.
  9444. </p>
  9445. <p>Read from or write to a file.
  9446. </p>
  9447. <p>A file URL can have the form:
  9448. </p><div class="example">
  9449. <pre class="example-preformatted">file:<var class="var">filename</var>
  9450. </pre></div>
  9451. <p>where <var class="var">filename</var> is the path of the file to read.
  9452. </p>
  9453. <p>An URL that does not have a protocol prefix will be assumed to be a
  9454. file URL. Depending on the build, an URL that looks like a Windows
  9455. path with the drive letter at the beginning will also be assumed to be
  9456. a file URL (usually not the case in builds for unix-like systems).
  9457. </p>
  9458. <p>For example to read from a file <samp class="file">input.mpeg</samp> with <code class="command">ffmpeg</code>
  9459. use the command:
  9460. </p><div class="example">
  9461. <pre class="example-preformatted">ffmpeg -i file:input.mpeg output.mpeg
  9462. </pre></div>
  9463. <p>This protocol accepts the following options:
  9464. </p>
  9465. <dl class="table">
  9466. <dt><samp class="option">truncate</samp></dt>
  9467. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  9468. truncating. Default value is 1.
  9469. </p>
  9470. </dd>
  9471. <dt><samp class="option">blocksize</samp></dt>
  9472. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  9473. <code class="code">INT_MAX</code>, which results in not limiting the requested block size.
  9474. Setting this value reasonably low improves user termination request reaction
  9475. time, which is valuable for files on slow medium.
  9476. </p>
  9477. </dd>
  9478. <dt><samp class="option">follow</samp></dt>
  9479. <dd><p>If set to 1, the protocol will retry reading at the end of the file, allowing
  9480. reading files that still are being written. In order for this to terminate,
  9481. you either need to use the rw_timeout option, or use the interrupt callback
  9482. (for API users).
  9483. </p>
  9484. </dd>
  9485. <dt><samp class="option">seekable</samp></dt>
  9486. <dd><p>Controls if seekability is advertised on the file. 0 means non-seekable, -1
  9487. means auto (seekable for normal files, non-seekable for named pipes).
  9488. </p>
  9489. <p>Many demuxers handle seekable and non-seekable resources differently,
  9490. overriding this might speed up opening certain files at the cost of losing some
  9491. features (e.g. accurate seeking).
  9492. </p></dd>
  9493. </dl>
  9494. </div>
  9495. <div class="section-level-extent" id="ftp">
  9496. <h3 class="section"><span>16.11 ftp<a class="copiable-link" href="#ftp"> &para;</a></span></h3>
  9497. <p>FTP (File Transfer Protocol).
  9498. </p>
  9499. <p>Read from or write to remote resources using FTP protocol.
  9500. </p>
  9501. <p>Following syntax is required.
  9502. </p><div class="example">
  9503. <pre class="example-preformatted">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  9504. </pre></div>
  9505. <p>This protocol accepts the following options.
  9506. </p>
  9507. <dl class="table">
  9508. <dt><samp class="option">timeout</samp></dt>
  9509. <dd><p>Set timeout in microseconds of socket I/O operations used by the underlying low level
  9510. operation. By default it is set to -1, which means that the timeout is
  9511. not specified.
  9512. </p>
  9513. </dd>
  9514. <dt><samp class="option">ftp-user</samp></dt>
  9515. <dd><p>Set a user to be used for authenticating to the FTP server. This is overridden by the
  9516. user in the FTP URL.
  9517. </p>
  9518. </dd>
  9519. <dt><samp class="option">ftp-password</samp></dt>
  9520. <dd><p>Set a password to be used for authenticating to the FTP server. This is overridden by
  9521. the password in the FTP URL, or by <samp class="option">ftp-anonymous-password</samp> if no user is set.
  9522. </p>
  9523. </dd>
  9524. <dt><samp class="option">ftp-anonymous-password</samp></dt>
  9525. <dd><p>Password used when login as anonymous user. Typically an e-mail address
  9526. should be used.
  9527. </p>
  9528. </dd>
  9529. <dt><samp class="option">ftp-write-seekable</samp></dt>
  9530. <dd><p>Control seekability of connection during encoding. If set to 1 the
  9531. resource is supposed to be seekable, if set to 0 it is assumed not
  9532. to be seekable. Default value is 0.
  9533. </p></dd>
  9534. </dl>
  9535. <p>NOTE: Protocol can be used as output, but it is recommended to not do
  9536. it, unless special care is taken (tests, customized server configuration
  9537. etc.). Different FTP servers behave in different way during seek
  9538. operation. ff* tools may produce incomplete content due to server limitations.
  9539. </p>
  9540. </div>
  9541. <div class="section-level-extent" id="gopher">
  9542. <h3 class="section"><span>16.12 gopher<a class="copiable-link" href="#gopher"> &para;</a></span></h3>
  9543. <p>Gopher protocol.
  9544. </p>
  9545. </div>
  9546. <div class="section-level-extent" id="gophers">
  9547. <h3 class="section"><span>16.13 gophers<a class="copiable-link" href="#gophers"> &para;</a></span></h3>
  9548. <p>Gophers protocol.
  9549. </p>
  9550. <p>The Gopher protocol with TLS encapsulation.
  9551. </p>
  9552. </div>
  9553. <div class="section-level-extent" id="hls-1">
  9554. <h3 class="section"><span>16.14 hls<a class="copiable-link" href="#hls-1"> &para;</a></span></h3>
  9555. <p>Read Apple HTTP Live Streaming compliant segmented stream as
  9556. a uniform one. The M3U8 playlists describing the segments can be
  9557. remote HTTP resources or local files, accessed using the standard
  9558. file protocol.
  9559. The nested protocol is declared by specifying
  9560. &quot;+<var class="var">proto</var>&quot; after the hls URI scheme name, where <var class="var">proto</var>
  9561. is either &quot;file&quot; or &quot;http&quot;.
  9562. </p>
  9563. <div class="example">
  9564. <pre class="example-preformatted">hls+http://host/path/to/remote/resource.m3u8
  9565. hls+file://path/to/local/resource.m3u8
  9566. </pre></div>
  9567. <p>Using this protocol is discouraged - the hls demuxer should work
  9568. just as well (if not, please report the issues) and is more complete.
  9569. To use the hls demuxer instead, simply use the direct URLs to the
  9570. m3u8 files.
  9571. </p>
  9572. </div>
  9573. <div class="section-level-extent" id="http">
  9574. <h3 class="section"><span>16.15 http<a class="copiable-link" href="#http"> &para;</a></span></h3>
  9575. <p>HTTP (Hyper Text Transfer Protocol).
  9576. </p>
  9577. <p>This protocol accepts the following options:
  9578. </p>
  9579. <dl class="table">
  9580. <dt><samp class="option">seekable</samp></dt>
  9581. <dd><p>Control seekability of connection. If set to 1 the resource is
  9582. supposed to be seekable, if set to 0 it is assumed not to be seekable,
  9583. if set to -1 it will try to autodetect if it is seekable. Default
  9584. value is -1.
  9585. </p>
  9586. </dd>
  9587. <dt><samp class="option">chunked_post</samp></dt>
  9588. <dd><p>If set to 1 use chunked Transfer-Encoding for posts, default is 1.
  9589. </p>
  9590. </dd>
  9591. <dt><samp class="option">content_type</samp></dt>
  9592. <dd><p>Set a specific content type for the POST messages or for listen mode.
  9593. </p>
  9594. </dd>
  9595. <dt><samp class="option">http_proxy</samp></dt>
  9596. <dd><p>set HTTP proxy to tunnel through e.g. http://example.com:1234
  9597. </p>
  9598. </dd>
  9599. <dt><samp class="option">headers</samp></dt>
  9600. <dd><p>Set custom HTTP headers, can override built in default headers. The
  9601. value must be a string encoding the headers.
  9602. </p>
  9603. </dd>
  9604. <dt><samp class="option">multiple_requests</samp></dt>
  9605. <dd><p>Use persistent connections if set to 1, default is 0.
  9606. </p>
  9607. </dd>
  9608. <dt><samp class="option">post_data</samp></dt>
  9609. <dd><p>Set custom HTTP post data.
  9610. </p>
  9611. </dd>
  9612. <dt><samp class="option">referer</samp></dt>
  9613. <dd><p>Set the Referer header. Include &rsquo;Referer: URL&rsquo; header in HTTP request.
  9614. </p>
  9615. </dd>
  9616. <dt><samp class="option">user_agent</samp></dt>
  9617. <dd><p>Override the User-Agent header. If not specified the protocol will use a
  9618. string describing the libavformat build. (&quot;Lavf/&lt;version&gt;&quot;)
  9619. </p>
  9620. </dd>
  9621. <dt><samp class="option">reconnect_at_eof</samp></dt>
  9622. <dd><p>If set then eof is treated like an error and causes reconnection, this is useful
  9623. for live / endless streams.
  9624. </p>
  9625. </dd>
  9626. <dt><samp class="option">reconnect_streamed</samp></dt>
  9627. <dd><p>If set then even streamed/non seekable streams will be reconnected on errors.
  9628. </p>
  9629. </dd>
  9630. <dt><samp class="option">reconnect_on_network_error</samp></dt>
  9631. <dd><p>Reconnect automatically in case of TCP/TLS errors during connect.
  9632. </p>
  9633. </dd>
  9634. <dt><samp class="option">reconnect_on_http_error</samp></dt>
  9635. <dd><p>A comma separated list of HTTP status codes to reconnect on. The list can
  9636. include specific status codes (e.g. &rsquo;503&rsquo;) or the strings &rsquo;4xx&rsquo; / &rsquo;5xx&rsquo;.
  9637. </p>
  9638. </dd>
  9639. <dt><samp class="option">reconnect_delay_max</samp></dt>
  9640. <dd><p>Sets the maximum delay in seconds after which to give up reconnecting
  9641. </p>
  9642. </dd>
  9643. <dt><samp class="option">mime_type</samp></dt>
  9644. <dd><p>Export the MIME type.
  9645. </p>
  9646. </dd>
  9647. <dt><samp class="option">http_version</samp></dt>
  9648. <dd><p>Exports the HTTP response version number. Usually &quot;1.0&quot; or &quot;1.1&quot;.
  9649. </p>
  9650. </dd>
  9651. <dt><samp class="option">icy</samp></dt>
  9652. <dd><p>If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
  9653. supports this, the metadata has to be retrieved by the application by reading
  9654. the <samp class="option">icy_metadata_headers</samp> and <samp class="option">icy_metadata_packet</samp> options.
  9655. The default is 1.
  9656. </p>
  9657. </dd>
  9658. <dt><samp class="option">icy_metadata_headers</samp></dt>
  9659. <dd><p>If the server supports ICY metadata, this contains the ICY-specific HTTP reply
  9660. headers, separated by newline characters.
  9661. </p>
  9662. </dd>
  9663. <dt><samp class="option">icy_metadata_packet</samp></dt>
  9664. <dd><p>If the server supports ICY metadata, and <samp class="option">icy</samp> was set to 1, this
  9665. contains the last non-empty metadata packet sent by the server. It should be
  9666. polled in regular intervals by applications interested in mid-stream metadata
  9667. updates.
  9668. </p>
  9669. </dd>
  9670. <dt><samp class="option">cookies</samp></dt>
  9671. <dd><p>Set the cookies to be sent in future requests. The format of each cookie is the
  9672. same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
  9673. delimited by a newline character.
  9674. </p>
  9675. </dd>
  9676. <dt><samp class="option">offset</samp></dt>
  9677. <dd><p>Set initial byte offset.
  9678. </p>
  9679. </dd>
  9680. <dt><samp class="option">end_offset</samp></dt>
  9681. <dd><p>Try to limit the request to bytes preceding this offset.
  9682. </p>
  9683. </dd>
  9684. <dt><samp class="option">method</samp></dt>
  9685. <dd><p>When used as a client option it sets the HTTP method for the request.
  9686. </p>
  9687. <p>When used as a server option it sets the HTTP method that is going to be
  9688. expected from the client(s).
  9689. If the expected and the received HTTP method do not match the client will
  9690. be given a Bad Request response.
  9691. When unset the HTTP method is not checked for now. This will be replaced by
  9692. autodetection in the future.
  9693. </p>
  9694. </dd>
  9695. <dt><samp class="option">listen</samp></dt>
  9696. <dd><p>If set to 1 enables experimental HTTP server. This can be used to send data when
  9697. used as an output option, or read data from a client with HTTP POST when used as
  9698. an input option.
  9699. If set to 2 enables experimental multi-client HTTP server. This is not yet implemented
  9700. in ffmpeg.c and thus must not be used as a command line option.
  9701. </p><div class="example">
  9702. <pre class="example-preformatted"># Server side (sending):
  9703. ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://<var class="var">server</var>:<var class="var">port</var>
  9704. # Client side (receiving):
  9705. ffmpeg -i http://<var class="var">server</var>:<var class="var">port</var> -c copy somefile.ogg
  9706. # Client can also be done with wget:
  9707. wget http://<var class="var">server</var>:<var class="var">port</var> -O somefile.ogg
  9708. # Server side (receiving):
  9709. ffmpeg -listen 1 -i http://<var class="var">server</var>:<var class="var">port</var> -c copy somefile.ogg
  9710. # Client side (sending):
  9711. ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://<var class="var">server</var>:<var class="var">port</var>
  9712. # Client can also be done with wget:
  9713. wget --post-file=somefile.ogg http://<var class="var">server</var>:<var class="var">port</var>
  9714. </pre></div>
  9715. </dd>
  9716. <dt><samp class="option">send_expect_100</samp></dt>
  9717. <dd><p>Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
  9718. to 0 it won&rsquo;t, if set to -1 it will try to send if it is applicable. Default
  9719. value is -1.
  9720. </p>
  9721. </dd>
  9722. <dt><samp class="option">auth_type</samp></dt>
  9723. <dd>
  9724. <p>Set HTTP authentication type. No option for Digest, since this method requires
  9725. getting nonce parameters from the server first and can&rsquo;t be used straight away like
  9726. Basic.
  9727. </p>
  9728. <dl class="table">
  9729. <dt><samp class="option">none</samp></dt>
  9730. <dd><p>Choose the HTTP authentication type automatically. This is the default.
  9731. </p></dd>
  9732. <dt><samp class="option">basic</samp></dt>
  9733. <dd>
  9734. <p>Choose the HTTP basic authentication.
  9735. </p>
  9736. <p>Basic authentication sends a Base64-encoded string that contains a user name and password
  9737. for the client. Base64 is not a form of encryption and should be considered the same as
  9738. sending the user name and password in clear text (Base64 is a reversible encoding).
  9739. If a resource needs to be protected, strongly consider using an authentication scheme
  9740. other than basic authentication. HTTPS/TLS should be used with basic authentication.
  9741. Without these additional security enhancements, basic authentication should not be used
  9742. to protect sensitive or valuable information.
  9743. </p></dd>
  9744. </dl>
  9745. </dd>
  9746. </dl>
  9747. <ul class="mini-toc">
  9748. <li><a href="#HTTP-Cookies" accesskey="1">HTTP Cookies</a></li>
  9749. </ul>
  9750. <div class="subsection-level-extent" id="HTTP-Cookies">
  9751. <h4 class="subsection"><span>16.15.1 HTTP Cookies<a class="copiable-link" href="#HTTP-Cookies"> &para;</a></span></h4>
  9752. <p>Some HTTP requests will be denied unless cookie values are passed in with the
  9753. request. The <samp class="option">cookies</samp> option allows these cookies to be specified. At
  9754. the very least, each cookie must specify a value along with a path and domain.
  9755. HTTP requests that match both the domain and path will automatically include the
  9756. cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
  9757. by a newline.
  9758. </p>
  9759. <p>The required syntax to play a stream specifying a cookie is:
  9760. </p><div class="example">
  9761. <pre class="example-preformatted">ffplay -cookies &quot;nlqptid=nltid=tsn; path=/; domain=somedomain.com;&quot; http://somedomain.com/somestream.m3u8
  9762. </pre></div>
  9763. </div>
  9764. </div>
  9765. <div class="section-level-extent" id="Icecast">
  9766. <h3 class="section"><span>16.16 Icecast<a class="copiable-link" href="#Icecast"> &para;</a></span></h3>
  9767. <p>Icecast protocol (stream to Icecast servers)
  9768. </p>
  9769. <p>This protocol accepts the following options:
  9770. </p>
  9771. <dl class="table">
  9772. <dt><samp class="option">ice_genre</samp></dt>
  9773. <dd><p>Set the stream genre.
  9774. </p>
  9775. </dd>
  9776. <dt><samp class="option">ice_name</samp></dt>
  9777. <dd><p>Set the stream name.
  9778. </p>
  9779. </dd>
  9780. <dt><samp class="option">ice_description</samp></dt>
  9781. <dd><p>Set the stream description.
  9782. </p>
  9783. </dd>
  9784. <dt><samp class="option">ice_url</samp></dt>
  9785. <dd><p>Set the stream website URL.
  9786. </p>
  9787. </dd>
  9788. <dt><samp class="option">ice_public</samp></dt>
  9789. <dd><p>Set if the stream should be public.
  9790. The default is 0 (not public).
  9791. </p>
  9792. </dd>
  9793. <dt><samp class="option">user_agent</samp></dt>
  9794. <dd><p>Override the User-Agent header. If not specified a string of the form
  9795. &quot;Lavf/&lt;version&gt;&quot; will be used.
  9796. </p>
  9797. </dd>
  9798. <dt><samp class="option">password</samp></dt>
  9799. <dd><p>Set the Icecast mountpoint password.
  9800. </p>
  9801. </dd>
  9802. <dt><samp class="option">content_type</samp></dt>
  9803. <dd><p>Set the stream content type. This must be set if it is different from
  9804. audio/mpeg.
  9805. </p>
  9806. </dd>
  9807. <dt><samp class="option">legacy_icecast</samp></dt>
  9808. <dd><p>This enables support for Icecast versions &lt; 2.4.0, that do not support the
  9809. HTTP PUT method but the SOURCE method.
  9810. </p>
  9811. </dd>
  9812. <dt><samp class="option">tls</samp></dt>
  9813. <dd><p>Establish a TLS (HTTPS) connection to Icecast.
  9814. </p>
  9815. </dd>
  9816. </dl>
  9817. <div class="example">
  9818. <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>
  9819. </pre></div>
  9820. </div>
  9821. <div class="section-level-extent" id="ipfs">
  9822. <h3 class="section"><span>16.17 ipfs<a class="copiable-link" href="#ipfs"> &para;</a></span></h3>
  9823. <p>InterPlanetary File System (IPFS) protocol support. One can access files stored
  9824. on the IPFS network through so-called gateways. These are http(s) endpoints.
  9825. This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be sent
  9826. to such a gateway. Users can (and should) host their own node which means this
  9827. protocol will use one&rsquo;s local gateway to access files on the IPFS network.
  9828. </p>
  9829. <p>This protocol accepts the following options:
  9830. </p>
  9831. <dl class="table">
  9832. <dt><samp class="option">gateway</samp></dt>
  9833. <dd><p>Defines the gateway to use. When not set, the protocol will first try
  9834. locating the local gateway by looking at <code class="code">$IPFS_GATEWAY</code>, <code class="code">$IPFS_PATH</code>
  9835. and <code class="code">$HOME/.ipfs/</code>, in that order.
  9836. </p>
  9837. </dd>
  9838. </dl>
  9839. <p>One can use this protocol in 2 ways. Using IPFS:
  9840. </p><div class="example">
  9841. <pre class="example-preformatted">ffplay ipfs://&lt;hash&gt;
  9842. </pre></div>
  9843. <p>Or the IPNS protocol (IPNS is mutable IPFS):
  9844. </p><div class="example">
  9845. <pre class="example-preformatted">ffplay ipns://&lt;hash&gt;
  9846. </pre></div>
  9847. </div>
  9848. <div class="section-level-extent" id="mmst">
  9849. <h3 class="section"><span>16.18 mmst<a class="copiable-link" href="#mmst"> &para;</a></span></h3>
  9850. <p>MMS (Microsoft Media Server) protocol over TCP.
  9851. </p>
  9852. </div>
  9853. <div class="section-level-extent" id="mmsh">
  9854. <h3 class="section"><span>16.19 mmsh<a class="copiable-link" href="#mmsh"> &para;</a></span></h3>
  9855. <p>MMS (Microsoft Media Server) protocol over HTTP.
  9856. </p>
  9857. <p>The required syntax is:
  9858. </p><div class="example">
  9859. <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>]
  9860. </pre></div>
  9861. </div>
  9862. <div class="section-level-extent" id="md5">
  9863. <h3 class="section"><span>16.20 md5<a class="copiable-link" href="#md5"> &para;</a></span></h3>
  9864. <p>MD5 output protocol.
  9865. </p>
  9866. <p>Computes the MD5 hash of the data to be written, and on close writes
  9867. this to the designated output or stdout if none is specified. It can
  9868. be used to test muxers without writing an actual file.
  9869. </p>
  9870. <p>Some examples follow.
  9871. </p><div class="example">
  9872. <pre class="example-preformatted"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
  9873. ffmpeg -i input.flv -f avi -y md5:output.avi.md5
  9874. # Write the MD5 hash of the encoded AVI file to stdout.
  9875. ffmpeg -i input.flv -f avi -y md5:
  9876. </pre></div>
  9877. <p>Note that some formats (typically MOV) require the output protocol to
  9878. be seekable, so they will fail with the MD5 output protocol.
  9879. </p>
  9880. </div>
  9881. <div class="section-level-extent" id="pipe">
  9882. <h3 class="section"><span>16.21 pipe<a class="copiable-link" href="#pipe"> &para;</a></span></h3>
  9883. <p>UNIX pipe access protocol.
  9884. </p>
  9885. <p>Read and write from UNIX pipes.
  9886. </p>
  9887. <p>The accepted syntax is:
  9888. </p><div class="example">
  9889. <pre class="example-preformatted">pipe:[<var class="var">number</var>]
  9890. </pre></div>
  9891. <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
  9892. pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If <var class="var">number</var>
  9893. is not specified, by default the stdout file descriptor will be used
  9894. for writing, stdin for reading.
  9895. </p>
  9896. <p>For example to read from stdin with <code class="command">ffmpeg</code>:
  9897. </p><div class="example">
  9898. <pre class="example-preformatted">cat test.wav | ffmpeg -i pipe:0
  9899. # ...this is the same as...
  9900. cat test.wav | ffmpeg -i pipe:
  9901. </pre></div>
  9902. <p>For writing to stdout with <code class="command">ffmpeg</code>:
  9903. </p><div class="example">
  9904. <pre class="example-preformatted">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
  9905. # ...this is the same as...
  9906. ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
  9907. </pre></div>
  9908. <p>This protocol accepts the following options:
  9909. </p>
  9910. <dl class="table">
  9911. <dt><samp class="option">blocksize</samp></dt>
  9912. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  9913. <code class="code">INT_MAX</code>, which results in not limiting the requested block size.
  9914. Setting this value reasonably low improves user termination request reaction
  9915. time, which is valuable if data transmission is slow.
  9916. </p></dd>
  9917. <dt><samp class="option">fd</samp></dt>
  9918. <dd><p>Set file descriptor.
  9919. </p></dd>
  9920. </dl>
  9921. <p>Note that some formats (typically MOV), require the output protocol to
  9922. be seekable, so they will fail with the pipe output protocol.
  9923. </p>
  9924. </div>
  9925. <div class="section-level-extent" id="prompeg">
  9926. <h3 class="section"><span>16.22 prompeg<a class="copiable-link" href="#prompeg"> &para;</a></span></h3>
  9927. <p>Pro-MPEG Code of Practice #3 Release 2 FEC protocol.
  9928. </p>
  9929. <p>The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism
  9930. for MPEG-2 Transport Streams sent over RTP.
  9931. </p>
  9932. <p>This protocol must be used in conjunction with the <code class="code">rtp_mpegts</code> muxer and
  9933. the <code class="code">rtp</code> protocol.
  9934. </p>
  9935. <p>The required syntax is:
  9936. </p><div class="example">
  9937. <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>
  9938. </pre></div>
  9939. <p>The destination UDP ports are <code class="code">port + 2</code> for the column FEC stream
  9940. and <code class="code">port + 4</code> for the row FEC stream.
  9941. </p>
  9942. <p>This protocol accepts the following options:
  9943. </p><dl class="table">
  9944. <dt><samp class="option">l=<var class="var">n</var></samp></dt>
  9945. <dd><p>The number of columns (4-20, LxD &lt;= 100)
  9946. </p>
  9947. </dd>
  9948. <dt><samp class="option">d=<var class="var">n</var></samp></dt>
  9949. <dd><p>The number of rows (4-20, LxD &lt;= 100)
  9950. </p>
  9951. </dd>
  9952. </dl>
  9953. <p>Example usage:
  9954. </p>
  9955. <div class="example">
  9956. <pre class="example-preformatted">-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://<var class="var">hostname</var>:<var class="var">port</var>
  9957. </pre></div>
  9958. </div>
  9959. <div class="section-level-extent" id="rist">
  9960. <h3 class="section"><span>16.23 rist<a class="copiable-link" href="#rist"> &para;</a></span></h3>
  9961. <p>Reliable Internet Streaming Transport protocol
  9962. </p>
  9963. <p>The accepted options are:
  9964. </p><dl class="table">
  9965. <dt><samp class="option">rist_profile</samp></dt>
  9966. <dd><p>Supported values:
  9967. </p><dl class="table">
  9968. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  9969. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  9970. <dd><p>This one is default.
  9971. </p></dd>
  9972. <dt>&lsquo;<samp class="samp">advanced</samp>&rsquo;</dt>
  9973. </dl>
  9974. </dd>
  9975. <dt><samp class="option">buffer_size</samp></dt>
  9976. <dd><p>Set internal RIST buffer size in milliseconds for retransmission of data.
  9977. Default value is 0 which means the librist default (1 sec). Maximum value is 30
  9978. seconds.
  9979. </p>
  9980. </dd>
  9981. <dt><samp class="option">fifo_size</samp></dt>
  9982. <dd><p>Size of the librist receiver output fifo in number of packets. This must be a
  9983. power of 2.
  9984. Defaults to 8192 (vs the librist default of 1024).
  9985. </p>
  9986. </dd>
  9987. <dt><samp class="option">overrun_nonfatal=<var class="var">1|0</var></samp></dt>
  9988. <dd><p>Survive in case of librist fifo buffer overrun. Default value is 0.
  9989. </p>
  9990. </dd>
  9991. <dt><samp class="option">pkt_size</samp></dt>
  9992. <dd><p>Set maximum packet size for sending data. 1316 by default.
  9993. </p>
  9994. </dd>
  9995. <dt><samp class="option">log_level</samp></dt>
  9996. <dd><p>Set loglevel for RIST logging messages. You only need to set this if you
  9997. explicitly want to enable debug level messages or packet loss simulation,
  9998. otherwise the regular loglevel is respected.
  9999. </p>
  10000. </dd>
  10001. <dt><samp class="option">secret</samp></dt>
  10002. <dd><p>Set override of encryption secret, by default is unset.
  10003. </p>
  10004. </dd>
  10005. <dt><samp class="option">encryption</samp></dt>
  10006. <dd><p>Set encryption type, by default is disabled.
  10007. Acceptable values are 128 and 256.
  10008. </p></dd>
  10009. </dl>
  10010. </div>
  10011. <div class="section-level-extent" id="rtmp">
  10012. <h3 class="section"><span>16.24 rtmp<a class="copiable-link" href="#rtmp"> &para;</a></span></h3>
  10013. <p>Real-Time Messaging Protocol.
  10014. </p>
  10015. <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
  10016. content across a TCP/IP network.
  10017. </p>
  10018. <p>The required syntax is:
  10019. </p><div class="example">
  10020. <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>]
  10021. </pre></div>
  10022. <p>The accepted parameters are:
  10023. </p><dl class="table">
  10024. <dt><samp class="option">username</samp></dt>
  10025. <dd><p>An optional username (mostly for publishing).
  10026. </p>
  10027. </dd>
  10028. <dt><samp class="option">password</samp></dt>
  10029. <dd><p>An optional password (mostly for publishing).
  10030. </p>
  10031. </dd>
  10032. <dt><samp class="option">server</samp></dt>
  10033. <dd><p>The address of the RTMP server.
  10034. </p>
  10035. </dd>
  10036. <dt><samp class="option">port</samp></dt>
  10037. <dd><p>The number of the TCP port to use (by default is 1935).
  10038. </p>
  10039. </dd>
  10040. <dt><samp class="option">app</samp></dt>
  10041. <dd><p>It is the name of the application to access. It usually corresponds to
  10042. the path where the application is installed on the RTMP server
  10043. (e.g. <samp class="file">/ondemand/</samp>, <samp class="file">/flash/live/</samp>, etc.). You can override
  10044. the value parsed from the URI through the <code class="code">rtmp_app</code> option, too.
  10045. </p>
  10046. </dd>
  10047. <dt><samp class="option">playpath</samp></dt>
  10048. <dd><p>It is the path or name of the resource to play with reference to the
  10049. application specified in <var class="var">app</var>, may be prefixed by &quot;mp4:&quot;. You
  10050. can override the value parsed from the URI through the <code class="code">rtmp_playpath</code>
  10051. option, too.
  10052. </p>
  10053. </dd>
  10054. <dt><samp class="option">listen</samp></dt>
  10055. <dd><p>Act as a server, listening for an incoming connection.
  10056. </p>
  10057. </dd>
  10058. <dt><samp class="option">timeout</samp></dt>
  10059. <dd><p>Maximum time to wait for the incoming connection. Implies listen.
  10060. </p></dd>
  10061. </dl>
  10062. <p>Additionally, the following parameters can be set via command line options
  10063. (or in code via <code class="code">AVOption</code>s):
  10064. </p><dl class="table">
  10065. <dt><samp class="option">rtmp_app</samp></dt>
  10066. <dd><p>Name of application to connect on the RTMP server. This option
  10067. overrides the parameter specified in the URI.
  10068. </p>
  10069. </dd>
  10070. <dt><samp class="option">rtmp_buffer</samp></dt>
  10071. <dd><p>Set the client buffer time in milliseconds. The default is 3000.
  10072. </p>
  10073. </dd>
  10074. <dt><samp class="option">rtmp_conn</samp></dt>
  10075. <dd><p>Extra arbitrary AMF connection parameters, parsed from a string,
  10076. e.g. like <code class="code">B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0</code>.
  10077. Each value is prefixed by a single character denoting the type,
  10078. B for Boolean, N for number, S for string, O for object, or Z for null,
  10079. followed by a colon. For Booleans the data must be either 0 or 1 for
  10080. FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
  10081. 1 to end or begin an object, respectively. Data items in subobjects may
  10082. be named, by prefixing the type with &rsquo;N&rsquo; and specifying the name before
  10083. the value (i.e. <code class="code">NB:myFlag:1</code>). This option may be used multiple
  10084. times to construct arbitrary AMF sequences.
  10085. </p>
  10086. </dd>
  10087. <dt><samp class="option">rtmp_enhanced_codecs</samp></dt>
  10088. <dd><p>Specify the list of codecs the client advertises to support in an
  10089. enhanced RTMP stream. This option should be set to a comma separated
  10090. list of fourcc values, like <code class="code">hvc1,av01,vp09</code> for multiple codecs
  10091. or <code class="code">hvc1</code> for only one codec. The specified list will be presented
  10092. in the &quot;fourCcLive&quot; property of the Connect Command Message.
  10093. </p>
  10094. </dd>
  10095. <dt><samp class="option">rtmp_flashver</samp></dt>
  10096. <dd><p>Version of the Flash plugin used to run the SWF player. The default
  10097. is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
  10098. &lt;libavformat version&gt;).)
  10099. </p>
  10100. </dd>
  10101. <dt><samp class="option">rtmp_flush_interval</samp></dt>
  10102. <dd><p>Number of packets flushed in the same request (RTMPT only). The default
  10103. is 10.
  10104. </p>
  10105. </dd>
  10106. <dt><samp class="option">rtmp_live</samp></dt>
  10107. <dd><p>Specify that the media is a live stream. No resuming or seeking in
  10108. live streams is possible. The default value is <code class="code">any</code>, which means the
  10109. subscriber first tries to play the live stream specified in the
  10110. playpath. If a live stream of that name is not found, it plays the
  10111. recorded stream. The other possible values are <code class="code">live</code> and
  10112. <code class="code">recorded</code>.
  10113. </p>
  10114. </dd>
  10115. <dt><samp class="option">rtmp_pageurl</samp></dt>
  10116. <dd><p>URL of the web page in which the media was embedded. By default no
  10117. value will be sent.
  10118. </p>
  10119. </dd>
  10120. <dt><samp class="option">rtmp_playpath</samp></dt>
  10121. <dd><p>Stream identifier to play or to publish. This option overrides the
  10122. parameter specified in the URI.
  10123. </p>
  10124. </dd>
  10125. <dt><samp class="option">rtmp_subscribe</samp></dt>
  10126. <dd><p>Name of live stream to subscribe to. By default no value will be sent.
  10127. It is only sent if the option is specified or if rtmp_live
  10128. is set to live.
  10129. </p>
  10130. </dd>
  10131. <dt><samp class="option">rtmp_swfhash</samp></dt>
  10132. <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
  10133. </p>
  10134. </dd>
  10135. <dt><samp class="option">rtmp_swfsize</samp></dt>
  10136. <dd><p>Size of the decompressed SWF file, required for SWFVerification.
  10137. </p>
  10138. </dd>
  10139. <dt><samp class="option">rtmp_swfurl</samp></dt>
  10140. <dd><p>URL of the SWF player for the media. By default no value will be sent.
  10141. </p>
  10142. </dd>
  10143. <dt><samp class="option">rtmp_swfverify</samp></dt>
  10144. <dd><p>URL to player swf file, compute hash/size automatically.
  10145. </p>
  10146. </dd>
  10147. <dt><samp class="option">rtmp_tcurl</samp></dt>
  10148. <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
  10149. </p>
  10150. </dd>
  10151. <dt><samp class="option">tcp_nodelay=<var class="var">1|0</var></samp></dt>
  10152. <dd><p>Set TCP_NODELAY to disable Nagle&rsquo;s algorithm. Default value is 0.
  10153. </p>
  10154. <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>
  10155. </p>
  10156. </dd>
  10157. </dl>
  10158. <p>For example to read with <code class="command">ffplay</code> a multimedia resource named
  10159. &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
  10160. </p><div class="example">
  10161. <pre class="example-preformatted">ffplay rtmp://myserver/vod/sample
  10162. </pre></div>
  10163. <p>To publish to a password protected server, passing the playpath and
  10164. app names separately:
  10165. </p><div class="example">
  10166. <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/
  10167. </pre></div>
  10168. </div>
  10169. <div class="section-level-extent" id="rtmpe">
  10170. <h3 class="section"><span>16.25 rtmpe<a class="copiable-link" href="#rtmpe"> &para;</a></span></h3>
  10171. <p>Encrypted Real-Time Messaging Protocol.
  10172. </p>
  10173. <p>The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
  10174. streaming multimedia content within standard cryptographic primitives,
  10175. consisting of Diffie-Hellman key exchange and HMACSHA256, generating
  10176. a pair of RC4 keys.
  10177. </p>
  10178. </div>
  10179. <div class="section-level-extent" id="rtmps">
  10180. <h3 class="section"><span>16.26 rtmps<a class="copiable-link" href="#rtmps"> &para;</a></span></h3>
  10181. <p>Real-Time Messaging Protocol over a secure SSL connection.
  10182. </p>
  10183. <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
  10184. multimedia content across an encrypted connection.
  10185. </p>
  10186. </div>
  10187. <div class="section-level-extent" id="rtmpt">
  10188. <h3 class="section"><span>16.27 rtmpt<a class="copiable-link" href="#rtmpt"> &para;</a></span></h3>
  10189. <p>Real-Time Messaging Protocol tunneled through HTTP.
  10190. </p>
  10191. <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
  10192. for streaming multimedia content within HTTP requests to traverse
  10193. firewalls.
  10194. </p>
  10195. </div>
  10196. <div class="section-level-extent" id="rtmpte">
  10197. <h3 class="section"><span>16.28 rtmpte<a class="copiable-link" href="#rtmpte"> &para;</a></span></h3>
  10198. <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
  10199. </p>
  10200. <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
  10201. is used for streaming multimedia content within HTTP requests to traverse
  10202. firewalls.
  10203. </p>
  10204. </div>
  10205. <div class="section-level-extent" id="rtmpts">
  10206. <h3 class="section"><span>16.29 rtmpts<a class="copiable-link" href="#rtmpts"> &para;</a></span></h3>
  10207. <p>Real-Time Messaging Protocol tunneled through HTTPS.
  10208. </p>
  10209. <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
  10210. for streaming multimedia content within HTTPS requests to traverse
  10211. firewalls.
  10212. </p>
  10213. </div>
  10214. <div class="section-level-extent" id="libsmbclient">
  10215. <h3 class="section"><span>16.30 libsmbclient<a class="copiable-link" href="#libsmbclient"> &para;</a></span></h3>
  10216. <p>libsmbclient permits one to manipulate CIFS/SMB network resources.
  10217. </p>
  10218. <p>Following syntax is required.
  10219. </p>
  10220. <div class="example">
  10221. <pre class="example-preformatted">smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
  10222. </pre></div>
  10223. <p>This protocol accepts the following options.
  10224. </p>
  10225. <dl class="table">
  10226. <dt><samp class="option">timeout</samp></dt>
  10227. <dd><p>Set timeout in milliseconds of socket I/O operations used by the underlying
  10228. low level operation. By default it is set to -1, which means that the timeout
  10229. is not specified.
  10230. </p>
  10231. </dd>
  10232. <dt><samp class="option">truncate</samp></dt>
  10233. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  10234. truncating. Default value is 1.
  10235. </p>
  10236. </dd>
  10237. <dt><samp class="option">workgroup</samp></dt>
  10238. <dd><p>Set the workgroup used for making connections. By default workgroup is not specified.
  10239. </p>
  10240. </dd>
  10241. </dl>
  10242. <p>For more information see: <a class="url" href="http://www.samba.org/">http://www.samba.org/</a>.
  10243. </p>
  10244. </div>
  10245. <div class="section-level-extent" id="libssh">
  10246. <h3 class="section"><span>16.31 libssh<a class="copiable-link" href="#libssh"> &para;</a></span></h3>
  10247. <p>Secure File Transfer Protocol via libssh
  10248. </p>
  10249. <p>Read from or write to remote resources using SFTP protocol.
  10250. </p>
  10251. <p>Following syntax is required.
  10252. </p>
  10253. <div class="example">
  10254. <pre class="example-preformatted">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  10255. </pre></div>
  10256. <p>This protocol accepts the following options.
  10257. </p>
  10258. <dl class="table">
  10259. <dt><samp class="option">timeout</samp></dt>
  10260. <dd><p>Set timeout of socket I/O operations used by the underlying low level
  10261. operation. By default it is set to -1, which means that the timeout
  10262. is not specified.
  10263. </p>
  10264. </dd>
  10265. <dt><samp class="option">truncate</samp></dt>
  10266. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  10267. truncating. Default value is 1.
  10268. </p>
  10269. </dd>
  10270. <dt><samp class="option">private_key</samp></dt>
  10271. <dd><p>Specify the path of the file containing private key to use during authorization.
  10272. By default libssh searches for keys in the <samp class="file">~/.ssh/</samp> directory.
  10273. </p>
  10274. </dd>
  10275. </dl>
  10276. <p>Example: Play a file stored on remote server.
  10277. </p>
  10278. <div class="example">
  10279. <pre class="example-preformatted">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
  10280. </pre></div>
  10281. </div>
  10282. <div class="section-level-extent" id="librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">
  10283. <h3 class="section"><span>16.32 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte<a class="copiable-link" href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"> &para;</a></span></h3>
  10284. <p>Real-Time Messaging Protocol and its variants supported through
  10285. librtmp.
  10286. </p>
  10287. <p>Requires the presence of the librtmp headers and library during
  10288. configuration. You need to explicitly configure the build with
  10289. &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
  10290. protocol.
  10291. </p>
  10292. <p>This protocol provides most client functions and a few server
  10293. functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
  10294. encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
  10295. variants of these encrypted types (RTMPTE, RTMPTS).
  10296. </p>
  10297. <p>The required syntax is:
  10298. </p><div class="example">
  10299. <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>
  10300. </pre></div>
  10301. <p>where <var class="var">rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
  10302. &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
  10303. <var class="var">server</var>, <var class="var">port</var>, <var class="var">app</var> and <var class="var">playpath</var> have the same
  10304. meaning as specified for the RTMP native protocol.
  10305. <var class="var">options</var> contains a list of space-separated options of the form
  10306. <var class="var">key</var>=<var class="var">val</var>.
  10307. </p>
  10308. <p>See the librtmp manual page (man 3 librtmp) for more information.
  10309. </p>
  10310. <p>For example, to stream a file in real-time to an RTMP server using
  10311. <code class="command">ffmpeg</code>:
  10312. </p><div class="example">
  10313. <pre class="example-preformatted">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
  10314. </pre></div>
  10315. <p>To play the same stream using <code class="command">ffplay</code>:
  10316. </p><div class="example">
  10317. <pre class="example-preformatted">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
  10318. </pre></div>
  10319. </div>
  10320. <div class="section-level-extent" id="rtp">
  10321. <h3 class="section"><span>16.33 rtp<a class="copiable-link" href="#rtp"> &para;</a></span></h3>
  10322. <p>Real-time Transport Protocol.
  10323. </p>
  10324. <p>The required syntax for an RTP URL is:
  10325. rtp://<var class="var">hostname</var>[:<var class="var">port</var>][?<var class="var">option</var>=<var class="var">val</var>...]
  10326. </p>
  10327. <p><var class="var">port</var> specifies the RTP port to use.
  10328. </p>
  10329. <p>The following URL options are supported:
  10330. </p>
  10331. <dl class="table">
  10332. <dt><samp class="option">ttl=<var class="var">n</var></samp></dt>
  10333. <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
  10334. </p>
  10335. </dd>
  10336. <dt><samp class="option">rtcpport=<var class="var">n</var></samp></dt>
  10337. <dd><p>Set the remote RTCP port to <var class="var">n</var>.
  10338. </p>
  10339. </dd>
  10340. <dt><samp class="option">localrtpport=<var class="var">n</var></samp></dt>
  10341. <dd><p>Set the local RTP port to <var class="var">n</var>.
  10342. </p>
  10343. </dd>
  10344. <dt><samp class="option">localrtcpport=<var class="var">n</var>'</samp></dt>
  10345. <dd><p>Set the local RTCP port to <var class="var">n</var>.
  10346. </p>
  10347. </dd>
  10348. <dt><samp class="option">pkt_size=<var class="var">n</var></samp></dt>
  10349. <dd><p>Set max packet size (in bytes) to <var class="var">n</var>.
  10350. </p>
  10351. </dd>
  10352. <dt><samp class="option">buffer_size=<var class="var">size</var></samp></dt>
  10353. <dd><p>Set the maximum UDP socket buffer size in bytes.
  10354. </p>
  10355. </dd>
  10356. <dt><samp class="option">connect=0|1</samp></dt>
  10357. <dd><p>Do a <code class="code">connect()</code> on the UDP socket (if set to 1) or not (if set
  10358. to 0).
  10359. </p>
  10360. </dd>
  10361. <dt><samp class="option">sources=<var class="var">ip</var>[,<var class="var">ip</var>]</samp></dt>
  10362. <dd><p>List allowed source IP addresses.
  10363. </p>
  10364. </dd>
  10365. <dt><samp class="option">block=<var class="var">ip</var>[,<var class="var">ip</var>]</samp></dt>
  10366. <dd><p>List disallowed (blocked) source IP addresses.
  10367. </p>
  10368. </dd>
  10369. <dt><samp class="option">write_to_source=0|1</samp></dt>
  10370. <dd><p>Send packets to the source address of the latest received packet (if
  10371. set to 1) or to a default remote address (if set to 0).
  10372. </p>
  10373. </dd>
  10374. <dt><samp class="option">localport=<var class="var">n</var></samp></dt>
  10375. <dd><p>Set the local RTP port to <var class="var">n</var>.
  10376. </p>
  10377. </dd>
  10378. <dt><samp class="option">localaddr=<var class="var">addr</var></samp></dt>
  10379. <dd><p>Local IP address of a network interface used for sending packets or joining
  10380. multicast groups.
  10381. </p>
  10382. </dd>
  10383. <dt><samp class="option">timeout=<var class="var">n</var></samp></dt>
  10384. <dd><p>Set timeout (in microseconds) of socket I/O operations to <var class="var">n</var>.
  10385. </p>
  10386. <p>This is a deprecated option. Instead, <samp class="option">localrtpport</samp> should be
  10387. used.
  10388. </p>
  10389. </dd>
  10390. </dl>
  10391. <p>Important notes:
  10392. </p>
  10393. <ol class="enumerate">
  10394. <li> If <samp class="option">rtcpport</samp> is not set the RTCP port will be set to the RTP
  10395. port value plus 1.
  10396. </li><li> If <samp class="option">localrtpport</samp> (the local RTP port) is not set any available
  10397. port will be used for the local RTP and RTCP ports.
  10398. </li><li> If <samp class="option">localrtcpport</samp> (the local RTCP port) is not set it will be
  10399. set to the local RTP port value plus 1.
  10400. </li></ol>
  10401. </div>
  10402. <div class="section-level-extent" id="rtsp">
  10403. <h3 class="section"><span>16.34 rtsp<a class="copiable-link" href="#rtsp"> &para;</a></span></h3>
  10404. <p>Real-Time Streaming Protocol.
  10405. </p>
  10406. <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
  10407. and muxer. The demuxer supports both normal RTSP (with data transferred
  10408. over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
  10409. data transferred over RDT).
  10410. </p>
  10411. <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
  10412. supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
  10413. <a class="uref" href="https://github.com/revmischa/rtsp-server">RTSP server</a>).
  10414. </p>
  10415. <p>The required syntax for a RTSP url is:
  10416. </p><div class="example">
  10417. <pre class="example-preformatted">rtsp://<var class="var">hostname</var>[:<var class="var">port</var>]/<var class="var">path</var>
  10418. </pre></div>
  10419. <p>Options can be set on the <code class="command">ffmpeg</code>/<code class="command">ffplay</code> command
  10420. line, or set in code via <code class="code">AVOption</code>s or in
  10421. <code class="code">avformat_open_input</code>.
  10422. </p>
  10423. <ul class="mini-toc">
  10424. <li><a href="#Muxer" accesskey="1">Muxer</a></li>
  10425. <li><a href="#Demuxer" accesskey="2">Demuxer</a></li>
  10426. <li><a href="#Examples-6" accesskey="3">Examples</a></li>
  10427. </ul>
  10428. <div class="subsection-level-extent" id="Muxer">
  10429. <h4 class="subsection"><span>16.34.1 Muxer<a class="copiable-link" href="#Muxer"> &para;</a></span></h4>
  10430. <p>The following options are supported.
  10431. </p>
  10432. <dl class="table">
  10433. <dt><samp class="option">rtsp_transport</samp></dt>
  10434. <dd><p>Set RTSP transport protocols.
  10435. </p>
  10436. <p>It accepts the following values:
  10437. </p><dl class="table">
  10438. <dt>&lsquo;<samp class="samp">udp</samp>&rsquo;</dt>
  10439. <dd><p>Use UDP as lower transport protocol.
  10440. </p>
  10441. </dd>
  10442. <dt>&lsquo;<samp class="samp">tcp</samp>&rsquo;</dt>
  10443. <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
  10444. transport protocol.
  10445. </p></dd>
  10446. </dl>
  10447. <p>Default value is &lsquo;<samp class="samp">0</samp>&rsquo;.
  10448. </p>
  10449. </dd>
  10450. <dt><samp class="option">rtsp_flags</samp></dt>
  10451. <dd><p>Set RTSP flags.
  10452. </p>
  10453. <p>The following values are accepted:
  10454. </p><dl class="table">
  10455. <dt>&lsquo;<samp class="samp">latm</samp>&rsquo;</dt>
  10456. <dd><p>Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC.
  10457. </p></dd>
  10458. <dt>&lsquo;<samp class="samp">rfc2190</samp>&rsquo;</dt>
  10459. <dd><p>Use RFC 2190 packetization instead of RFC 4629 for H.263.
  10460. </p></dd>
  10461. <dt>&lsquo;<samp class="samp">skip_rtcp</samp>&rsquo;</dt>
  10462. <dd><p>Don&rsquo;t send RTCP sender reports.
  10463. </p></dd>
  10464. <dt>&lsquo;<samp class="samp">h264_mode0</samp>&rsquo;</dt>
  10465. <dd><p>Use mode 0 for H.264 in RTP.
  10466. </p></dd>
  10467. <dt>&lsquo;<samp class="samp">send_bye</samp>&rsquo;</dt>
  10468. <dd><p>Send RTCP BYE packets when finishing.
  10469. </p></dd>
  10470. </dl>
  10471. <p>Default value is &lsquo;<samp class="samp">0</samp>&rsquo;.
  10472. </p>
  10473. </dd>
  10474. <dt><samp class="option">min_port</samp></dt>
  10475. <dd><p>Set minimum local UDP port. Default value is 5000.
  10476. </p>
  10477. </dd>
  10478. <dt><samp class="option">max_port</samp></dt>
  10479. <dd><p>Set maximum local UDP port. Default value is 65000.
  10480. </p>
  10481. </dd>
  10482. <dt><samp class="option">buffer_size</samp></dt>
  10483. <dd><p>Set the maximum socket buffer size in bytes.
  10484. </p>
  10485. </dd>
  10486. <dt><samp class="option">pkt_size</samp></dt>
  10487. <dd><p>Set max send packet size (in bytes). Default value is 1472.
  10488. </p></dd>
  10489. </dl>
  10490. </div>
  10491. <div class="subsection-level-extent" id="Demuxer">
  10492. <h4 class="subsection"><span>16.34.2 Demuxer<a class="copiable-link" href="#Demuxer"> &para;</a></span></h4>
  10493. <p>The following options are supported.
  10494. </p>
  10495. <dl class="table">
  10496. <dt><samp class="option">initial_pause</samp></dt>
  10497. <dd><p>Do not start playing the stream immediately if set to 1. Default value
  10498. is 0.
  10499. </p>
  10500. </dd>
  10501. <dt><samp class="option">rtsp_transport</samp></dt>
  10502. <dd><p>Set RTSP transport protocols.
  10503. </p>
  10504. <p>It accepts the following values:
  10505. </p><dl class="table">
  10506. <dt>&lsquo;<samp class="samp">udp</samp>&rsquo;</dt>
  10507. <dd><p>Use UDP as lower transport protocol.
  10508. </p>
  10509. </dd>
  10510. <dt>&lsquo;<samp class="samp">tcp</samp>&rsquo;</dt>
  10511. <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
  10512. transport protocol.
  10513. </p>
  10514. </dd>
  10515. <dt>&lsquo;<samp class="samp">udp_multicast</samp>&rsquo;</dt>
  10516. <dd><p>Use UDP multicast as lower transport protocol.
  10517. </p>
  10518. </dd>
  10519. <dt>&lsquo;<samp class="samp">http</samp>&rsquo;</dt>
  10520. <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
  10521. passing proxies.
  10522. </p>
  10523. </dd>
  10524. <dt>&lsquo;<samp class="samp">https</samp>&rsquo;</dt>
  10525. <dd><p>Use HTTPs tunneling as lower transport protocol, which is useful for
  10526. passing proxies and widely used for security consideration.
  10527. </p></dd>
  10528. </dl>
  10529. <p>Multiple lower transport protocols may be specified, in that case they are
  10530. tried one at a time (if the setup of one fails, the next one is tried).
  10531. For the muxer, only the &lsquo;<samp class="samp">tcp</samp>&rsquo; and &lsquo;<samp class="samp">udp</samp>&rsquo; options are supported.
  10532. </p>
  10533. </dd>
  10534. <dt><samp class="option">rtsp_flags</samp></dt>
  10535. <dd><p>Set RTSP flags.
  10536. </p>
  10537. <p>The following values are accepted:
  10538. </p><dl class="table">
  10539. <dt>&lsquo;<samp class="samp">filter_src</samp>&rsquo;</dt>
  10540. <dd><p>Accept packets only from negotiated peer address and port.
  10541. </p></dd>
  10542. <dt>&lsquo;<samp class="samp">listen</samp>&rsquo;</dt>
  10543. <dd><p>Act as a server, listening for an incoming connection.
  10544. </p></dd>
  10545. <dt>&lsquo;<samp class="samp">prefer_tcp</samp>&rsquo;</dt>
  10546. <dd><p>Try TCP for RTP transport first, if TCP is available as RTSP RTP transport.
  10547. </p></dd>
  10548. <dt>&lsquo;<samp class="samp">satip_raw</samp>&rsquo;</dt>
  10549. <dd><p>Export raw MPEG-TS stream instead of demuxing. The flag will simply write out
  10550. the raw stream, with the original PAT/PMT/PIDs intact.
  10551. </p></dd>
  10552. </dl>
  10553. <p>Default value is &lsquo;<samp class="samp">none</samp>&rsquo;.
  10554. </p>
  10555. </dd>
  10556. <dt><samp class="option">allowed_media_types</samp></dt>
  10557. <dd><p>Set media types to accept from the server.
  10558. </p>
  10559. <p>The following flags are accepted:
  10560. </p><dl class="table">
  10561. <dt>&lsquo;<samp class="samp">video</samp>&rsquo;</dt>
  10562. <dt>&lsquo;<samp class="samp">audio</samp>&rsquo;</dt>
  10563. <dt>&lsquo;<samp class="samp">data</samp>&rsquo;</dt>
  10564. <dt>&lsquo;<samp class="samp">subtitle</samp>&rsquo;</dt>
  10565. </dl>
  10566. <p>By default it accepts all media types.
  10567. </p>
  10568. </dd>
  10569. <dt><samp class="option">min_port</samp></dt>
  10570. <dd><p>Set minimum local UDP port. Default value is 5000.
  10571. </p>
  10572. </dd>
  10573. <dt><samp class="option">max_port</samp></dt>
  10574. <dd><p>Set maximum local UDP port. Default value is 65000.
  10575. </p>
  10576. </dd>
  10577. <dt><samp class="option">listen_timeout</samp></dt>
  10578. <dd><p>Set maximum timeout (in seconds) to establish an initial connection. Setting
  10579. <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
  10580. which means an infinite timeout when &lsquo;<samp class="samp">listen</samp>&rsquo; mode is set.
  10581. </p>
  10582. </dd>
  10583. <dt><samp class="option">reorder_queue_size</samp></dt>
  10584. <dd><p>Set number of packets to buffer for handling of reordered packets.
  10585. </p>
  10586. </dd>
  10587. <dt><samp class="option">timeout</samp></dt>
  10588. <dd><p>Set socket TCP I/O timeout in microseconds.
  10589. </p>
  10590. </dd>
  10591. <dt><samp class="option">user_agent</samp></dt>
  10592. <dd><p>Override User-Agent header. If not specified, it defaults to the
  10593. libavformat identifier string.
  10594. </p>
  10595. </dd>
  10596. <dt><samp class="option">buffer_size</samp></dt>
  10597. <dd><p>Set the maximum socket buffer size in bytes.
  10598. </p></dd>
  10599. </dl>
  10600. <p>When receiving data over UDP, the demuxer tries to reorder received packets
  10601. (since they may arrive out of order, or packets may get lost totally). This
  10602. can be disabled by setting the maximum demuxing delay to zero (via
  10603. the <code class="code">max_delay</code> field of AVFormatContext).
  10604. </p>
  10605. <p>When watching multi-bitrate Real-RTSP streams with <code class="command">ffplay</code>, the
  10606. streams to display can be chosen with <code class="code">-vst</code> <var class="var">n</var> and
  10607. <code class="code">-ast</code> <var class="var">n</var> for video and audio respectively, and can be switched
  10608. on the fly by pressing <code class="code">v</code> and <code class="code">a</code>.
  10609. </p>
  10610. </div>
  10611. <div class="subsection-level-extent" id="Examples-6">
  10612. <h4 class="subsection"><span>16.34.3 Examples<a class="copiable-link" href="#Examples-6"> &para;</a></span></h4>
  10613. <p>The following examples all make use of the <code class="command">ffplay</code> and
  10614. <code class="command">ffmpeg</code> tools.
  10615. </p>
  10616. <ul class="itemize mark-bullet">
  10617. <li>Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
  10618. <div class="example">
  10619. <pre class="example-preformatted">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
  10620. </pre></div>
  10621. </li><li>Watch a stream tunneled over HTTP:
  10622. <div class="example">
  10623. <pre class="example-preformatted">ffplay -rtsp_transport http rtsp://server/video.mp4
  10624. </pre></div>
  10625. </li><li>Send a stream in realtime to a RTSP server, for others to watch:
  10626. <div class="example">
  10627. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
  10628. </pre></div>
  10629. </li><li>Receive a stream in realtime:
  10630. <div class="example">
  10631. <pre class="example-preformatted">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var class="var">output</var>
  10632. </pre></div>
  10633. </li></ul>
  10634. </div>
  10635. </div>
  10636. <div class="section-level-extent" id="sap">
  10637. <h3 class="section"><span>16.35 sap<a class="copiable-link" href="#sap"> &para;</a></span></h3>
  10638. <p>Session Announcement Protocol (RFC 2974). This is not technically a
  10639. protocol handler in libavformat, it is a muxer and demuxer.
  10640. It is used for signalling of RTP streams, by announcing the SDP for the
  10641. streams regularly on a separate port.
  10642. </p>
  10643. <ul class="mini-toc">
  10644. <li><a href="#Muxer-1" accesskey="1">Muxer</a></li>
  10645. <li><a href="#Demuxer-1" accesskey="2">Demuxer</a></li>
  10646. </ul>
  10647. <div class="subsection-level-extent" id="Muxer-1">
  10648. <h4 class="subsection"><span>16.35.1 Muxer<a class="copiable-link" href="#Muxer-1"> &para;</a></span></h4>
  10649. <p>The syntax for a SAP url given to the muxer is:
  10650. </p><div class="example">
  10651. <pre class="example-preformatted">sap://<var class="var">destination</var>[:<var class="var">port</var>][?<var class="var">options</var>]
  10652. </pre></div>
  10653. <p>The RTP packets are sent to <var class="var">destination</var> on port <var class="var">port</var>,
  10654. or to port 5004 if no port is specified.
  10655. <var class="var">options</var> is a <code class="code">&amp;</code>-separated list. The following options
  10656. are supported:
  10657. </p>
  10658. <dl class="table">
  10659. <dt><samp class="option">announce_addr=<var class="var">address</var></samp></dt>
  10660. <dd><p>Specify the destination IP address for sending the announcements to.
  10661. If omitted, the announcements are sent to the commonly used SAP
  10662. announcement multicast address 224.2.127.254 (sap.mcast.net), or
  10663. ff0e::2:7ffe if <var class="var">destination</var> is an IPv6 address.
  10664. </p>
  10665. </dd>
  10666. <dt><samp class="option">announce_port=<var class="var">port</var></samp></dt>
  10667. <dd><p>Specify the port to send the announcements on, defaults to
  10668. 9875 if not specified.
  10669. </p>
  10670. </dd>
  10671. <dt><samp class="option">ttl=<var class="var">ttl</var></samp></dt>
  10672. <dd><p>Specify the time to live value for the announcements and RTP packets,
  10673. defaults to 255.
  10674. </p>
  10675. </dd>
  10676. <dt><samp class="option">same_port=<var class="var">0|1</var></samp></dt>
  10677. <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
  10678. default), all streams are sent on unique ports, with each stream on a
  10679. port 2 numbers higher than the previous.
  10680. VLC/Live555 requires this to be set to 1, to be able to receive the stream.
  10681. The RTP stack in libavformat for receiving requires all streams to be sent
  10682. on unique ports.
  10683. </p></dd>
  10684. </dl>
  10685. <p>Example command lines follow.
  10686. </p>
  10687. <p>To broadcast a stream on the local subnet, for watching in VLC:
  10688. </p>
  10689. <div class="example">
  10690. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f sap sap://224.0.0.255?same_port=1
  10691. </pre></div>
  10692. <p>Similarly, for watching in <code class="command">ffplay</code>:
  10693. </p>
  10694. <div class="example">
  10695. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f sap sap://224.0.0.255
  10696. </pre></div>
  10697. <p>And for watching in <code class="command">ffplay</code>, over IPv6:
  10698. </p>
  10699. <div class="example">
  10700. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f sap sap://[ff0e::1:2:3:4]
  10701. </pre></div>
  10702. </div>
  10703. <div class="subsection-level-extent" id="Demuxer-1">
  10704. <h4 class="subsection"><span>16.35.2 Demuxer<a class="copiable-link" href="#Demuxer-1"> &para;</a></span></h4>
  10705. <p>The syntax for a SAP url given to the demuxer is:
  10706. </p><div class="example">
  10707. <pre class="example-preformatted">sap://[<var class="var">address</var>][:<var class="var">port</var>]
  10708. </pre></div>
  10709. <p><var class="var">address</var> is the multicast address to listen for announcements on,
  10710. if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var class="var">port</var>
  10711. is the port that is listened on, 9875 if omitted.
  10712. </p>
  10713. <p>The demuxers listens for announcements on the given address and port.
  10714. Once an announcement is received, it tries to receive that particular stream.
  10715. </p>
  10716. <p>Example command lines follow.
  10717. </p>
  10718. <p>To play back the first stream announced on the normal SAP multicast address:
  10719. </p>
  10720. <div class="example">
  10721. <pre class="example-preformatted">ffplay sap://
  10722. </pre></div>
  10723. <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
  10724. </p>
  10725. <div class="example">
  10726. <pre class="example-preformatted">ffplay sap://[ff0e::2:7ffe]
  10727. </pre></div>
  10728. </div>
  10729. </div>
  10730. <div class="section-level-extent" id="sctp">
  10731. <h3 class="section"><span>16.36 sctp<a class="copiable-link" href="#sctp"> &para;</a></span></h3>
  10732. <p>Stream Control Transmission Protocol.
  10733. </p>
  10734. <p>The accepted URL syntax is:
  10735. </p><div class="example">
  10736. <pre class="example-preformatted">sctp://<var class="var">host</var>:<var class="var">port</var>[?<var class="var">options</var>]
  10737. </pre></div>
  10738. <p>The protocol accepts the following options:
  10739. </p><dl class="table">
  10740. <dt><samp class="option">listen</samp></dt>
  10741. <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
  10742. </p>
  10743. </dd>
  10744. <dt><samp class="option">max_streams</samp></dt>
  10745. <dd><p>Set the maximum number of streams. By default no limit is set.
  10746. </p></dd>
  10747. </dl>
  10748. </div>
  10749. <div class="section-level-extent" id="srt">
  10750. <h3 class="section"><span>16.37 srt<a class="copiable-link" href="#srt"> &para;</a></span></h3>
  10751. <p>Haivision Secure Reliable Transport Protocol via libsrt.
  10752. </p>
  10753. <p>The supported syntax for a SRT URL is:
  10754. </p><div class="example">
  10755. <pre class="example-preformatted">srt://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  10756. </pre></div>
  10757. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  10758. <var class="var">key</var>=<var class="var">val</var>.
  10759. </p>
  10760. <p>or
  10761. </p>
  10762. <div class="example">
  10763. <pre class="example-preformatted"><var class="var">options</var> srt://<var class="var">hostname</var>:<var class="var">port</var>
  10764. </pre></div>
  10765. <p><var class="var">options</var> contains a list of &rsquo;-<var class="var">key</var> <var class="var">val</var>&rsquo;
  10766. options.
  10767. </p>
  10768. <p>This protocol accepts the following options.
  10769. </p>
  10770. <dl class="table">
  10771. <dt><samp class="option">connect_timeout=<var class="var">milliseconds</var></samp></dt>
  10772. <dd><p>Connection timeout; SRT cannot connect for RTT &gt; 1500 msec
  10773. (2 handshake exchanges) with the default connect timeout of
  10774. 3 seconds. This option applies to the caller and rendezvous
  10775. connection modes. The connect timeout is 10 times the value
  10776. set for the rendezvous mode (which can be used as a
  10777. workaround for this connection problem with earlier versions).
  10778. </p>
  10779. </dd>
  10780. <dt><samp class="option">ffs=<var class="var">bytes</var></samp></dt>
  10781. <dd><p>Flight Flag Size (Window Size), in bytes. FFS is actually an
  10782. internal parameter and you should set it to not less than
  10783. <samp class="option">recv_buffer_size</samp> and <samp class="option">mss</samp>. The default value
  10784. is relatively large, therefore unless you set a very large receiver buffer,
  10785. you do not need to change this option. Default value is 25600.
  10786. </p>
  10787. </dd>
  10788. <dt><samp class="option">inputbw=<var class="var">bytes/seconds</var></samp></dt>
  10789. <dd><p>Sender nominal input rate, in bytes per seconds. Used along with
  10790. <samp class="option">oheadbw</samp>, when <samp class="option">maxbw</samp> is set to relative (0), to
  10791. calculate maximum sending rate when recovery packets are sent
  10792. along with the main media stream:
  10793. <samp class="option">inputbw</samp> * (100 + <samp class="option">oheadbw</samp>) / 100
  10794. if <samp class="option">inputbw</samp> is not set while <samp class="option">maxbw</samp> is set to
  10795. relative (0), the actual input rate is evaluated inside
  10796. the library. Default value is 0.
  10797. </p>
  10798. </dd>
  10799. <dt><samp class="option">iptos=<var class="var">tos</var></samp></dt>
  10800. <dd><p>IP Type of Service. Applies to sender only. Default value is 0xB8.
  10801. </p>
  10802. </dd>
  10803. <dt><samp class="option">ipttl=<var class="var">ttl</var></samp></dt>
  10804. <dd><p>IP Time To Live. Applies to sender only. Default value is 64.
  10805. </p>
  10806. </dd>
  10807. <dt><samp class="option">latency=<var class="var">microseconds</var></samp></dt>
  10808. <dd><p>Timestamp-based Packet Delivery Delay.
  10809. Used to absorb bursts of missed packet retransmissions.
  10810. This flag sets both <samp class="option">rcvlatency</samp> and <samp class="option">peerlatency</samp>
  10811. to the same value. Note that prior to version 1.3.0
  10812. this is the only flag to set the latency, however
  10813. this is effectively equivalent to setting <samp class="option">peerlatency</samp>,
  10814. when side is sender and <samp class="option">rcvlatency</samp>
  10815. when side is receiver, and the bidirectional stream
  10816. sending is not supported.
  10817. </p>
  10818. </dd>
  10819. <dt><samp class="option">listen_timeout=<var class="var">microseconds</var></samp></dt>
  10820. <dd><p>Set socket listen timeout.
  10821. </p>
  10822. </dd>
  10823. <dt><samp class="option">maxbw=<var class="var">bytes/seconds</var></samp></dt>
  10824. <dd><p>Maximum sending bandwidth, in bytes per seconds.
  10825. -1 infinite (CSRTCC limit is 30mbps)
  10826. 0 relative to input rate (see <samp class="option">inputbw</samp>)
  10827. &gt;0 absolute limit value
  10828. Default value is 0 (relative)
  10829. </p>
  10830. </dd>
  10831. <dt><samp class="option">mode=<var class="var">caller|listener|rendezvous</var></samp></dt>
  10832. <dd><p>Connection mode.
  10833. <samp class="option">caller</samp> opens client connection.
  10834. <samp class="option">listener</samp> starts server to listen for incoming connections.
  10835. <samp class="option">rendezvous</samp> use Rendez-Vous connection mode.
  10836. Default value is caller.
  10837. </p>
  10838. </dd>
  10839. <dt><samp class="option">mss=<var class="var">bytes</var></samp></dt>
  10840. <dd><p>Maximum Segment Size, in bytes. Used for buffer allocation
  10841. and rate calculation using a packet counter assuming fully
  10842. filled packets. The smallest MSS between the peers is
  10843. used. This is 1500 by default in the overall internet.
  10844. This is the maximum size of the UDP packet and can be
  10845. only decreased, unless you have some unusual dedicated
  10846. network settings. Default value is 1500.
  10847. </p>
  10848. </dd>
  10849. <dt><samp class="option">nakreport=<var class="var">1|0</var></samp></dt>
  10850. <dd><p>If set to 1, Receiver will send &lsquo;UMSG_LOSSREPORT&lsquo; messages
  10851. periodically until a lost packet is retransmitted or
  10852. intentionally dropped. Default value is 1.
  10853. </p>
  10854. </dd>
  10855. <dt><samp class="option">oheadbw=<var class="var">percents</var></samp></dt>
  10856. <dd><p>Recovery bandwidth overhead above input rate, in percents.
  10857. See <samp class="option">inputbw</samp>. Default value is 25%.
  10858. </p>
  10859. </dd>
  10860. <dt><samp class="option">passphrase=<var class="var">string</var></samp></dt>
  10861. <dd><p>HaiCrypt Encryption/Decryption Passphrase string, length
  10862. from 10 to 79 characters. The passphrase is the shared
  10863. secret between the sender and the receiver. It is used
  10864. to generate the Key Encrypting Key using PBKDF2
  10865. (Password-Based Key Derivation Function). It is used
  10866. only if <samp class="option">pbkeylen</samp> is non-zero. It is used on
  10867. the receiver only if the received data is encrypted.
  10868. The configured passphrase cannot be recovered (write-only).
  10869. </p>
  10870. </dd>
  10871. <dt><samp class="option">enforced_encryption=<var class="var">1|0</var></samp></dt>
  10872. <dd><p>If true, both connection parties must have the same password
  10873. set (including empty, that is, with no encryption). If the
  10874. password doesn&rsquo;t match or only one side is unencrypted,
  10875. the connection is rejected. Default is true.
  10876. </p>
  10877. </dd>
  10878. <dt><samp class="option">kmrefreshrate=<var class="var">packets</var></samp></dt>
  10879. <dd><p>The number of packets to be transmitted after which the
  10880. encryption key is switched to a new key. Default is -1.
  10881. -1 means auto (0x1000000 in srt library). The range for
  10882. this option is integers in the 0 - <code class="code">INT_MAX</code>.
  10883. </p>
  10884. </dd>
  10885. <dt><samp class="option">kmpreannounce=<var class="var">packets</var></samp></dt>
  10886. <dd><p>The interval between when a new encryption key is sent and
  10887. when switchover occurs. This value also applies to the
  10888. subsequent interval between when switchover occurs and
  10889. when the old encryption key is decommissioned. Default is -1.
  10890. -1 means auto (0x1000 in srt library). The range for
  10891. this option is integers in the 0 - <code class="code">INT_MAX</code>.
  10892. </p>
  10893. </dd>
  10894. <dt><samp class="option">snddropdelay=<var class="var">microseconds</var></samp></dt>
  10895. <dd><p>The sender&rsquo;s extra delay before dropping packets. This delay is
  10896. added to the default drop delay time interval value.
  10897. </p>
  10898. <p>Special value -1: Do not drop packets on the sender at all.
  10899. </p>
  10900. </dd>
  10901. <dt><samp class="option">payload_size=<var class="var">bytes</var></samp></dt>
  10902. <dd><p>Sets the maximum declared size of a packet transferred
  10903. during the single call to the sending function in Live
  10904. mode. Use 0 if this value isn&rsquo;t used (which is default in
  10905. file mode).
  10906. Default is -1 (automatic), which typically means MPEG-TS;
  10907. if you are going to use SRT
  10908. to send any different kind of payload, such as, for example,
  10909. wrapping a live stream in very small frames, then you can
  10910. use a bigger maximum frame size, though not greater than
  10911. 1456 bytes.
  10912. </p>
  10913. </dd>
  10914. <dt><samp class="option">pkt_size=<var class="var">bytes</var></samp></dt>
  10915. <dd><p>Alias for &lsquo;<samp class="samp">payload_size</samp>&rsquo;.
  10916. </p>
  10917. </dd>
  10918. <dt><samp class="option">peerlatency=<var class="var">microseconds</var></samp></dt>
  10919. <dd><p>The latency value (as described in <samp class="option">rcvlatency</samp>) that is
  10920. set by the sender side as a minimum value for the receiver.
  10921. </p>
  10922. </dd>
  10923. <dt><samp class="option">pbkeylen=<var class="var">bytes</var></samp></dt>
  10924. <dd><p>Sender encryption key length, in bytes.
  10925. Only can be set to 0, 16, 24 and 32.
  10926. Enable sender encryption if not 0.
  10927. Not required on receiver (set to 0),
  10928. key size obtained from sender in HaiCrypt handshake.
  10929. Default value is 0.
  10930. </p>
  10931. </dd>
  10932. <dt><samp class="option">rcvlatency=<var class="var">microseconds</var></samp></dt>
  10933. <dd><p>The time that should elapse since the moment when the
  10934. packet was sent and the moment when it&rsquo;s delivered to
  10935. the receiver application in the receiving function.
  10936. This time should be a buffer time large enough to cover
  10937. the time spent for sending, unexpectedly extended RTT
  10938. time, and the time needed to retransmit the lost UDP
  10939. packet. The effective latency value will be the maximum
  10940. of this options&rsquo; value and the value of <samp class="option">peerlatency</samp>
  10941. set by the peer side. Before version 1.3.0 this option
  10942. is only available as <samp class="option">latency</samp>.
  10943. </p>
  10944. </dd>
  10945. <dt><samp class="option">recv_buffer_size=<var class="var">bytes</var></samp></dt>
  10946. <dd><p>Set UDP receive buffer size, expressed in bytes.
  10947. </p>
  10948. </dd>
  10949. <dt><samp class="option">send_buffer_size=<var class="var">bytes</var></samp></dt>
  10950. <dd><p>Set UDP send buffer size, expressed in bytes.
  10951. </p>
  10952. </dd>
  10953. <dt><samp class="option">timeout=<var class="var">microseconds</var></samp></dt>
  10954. <dd><p>Set raise error timeouts for read, write and connect operations. Note that the
  10955. SRT library has internal timeouts which can be controlled separately, the
  10956. value set here is only a cap on those.
  10957. </p>
  10958. </dd>
  10959. <dt><samp class="option">tlpktdrop=<var class="var">1|0</var></samp></dt>
  10960. <dd><p>Too-late Packet Drop. When enabled on receiver, it skips
  10961. missing packets that have not been delivered in time and
  10962. delivers the following packets to the application when
  10963. their time-to-play has come. It also sends a fake ACK to
  10964. the sender. When enabled on sender and enabled on the
  10965. receiving peer, the sender drops the older packets that
  10966. have no chance of being delivered in time. It was
  10967. automatically enabled in the sender if the receiver
  10968. supports it.
  10969. </p>
  10970. </dd>
  10971. <dt><samp class="option">sndbuf=<var class="var">bytes</var></samp></dt>
  10972. <dd><p>Set send buffer size, expressed in bytes.
  10973. </p>
  10974. </dd>
  10975. <dt><samp class="option">rcvbuf=<var class="var">bytes</var></samp></dt>
  10976. <dd><p>Set receive buffer size, expressed in bytes.
  10977. </p>
  10978. <p>Receive buffer must not be greater than <samp class="option">ffs</samp>.
  10979. </p>
  10980. </dd>
  10981. <dt><samp class="option">lossmaxttl=<var class="var">packets</var></samp></dt>
  10982. <dd><p>The value up to which the Reorder Tolerance may grow. When
  10983. Reorder Tolerance is &gt; 0, then packet loss report is delayed
  10984. until that number of packets come in. Reorder Tolerance
  10985. increases every time a &quot;belated&quot; packet has come, but it
  10986. wasn&rsquo;t due to retransmission (that is, when UDP packets tend
  10987. to come out of order), with the difference between the latest
  10988. sequence and this packet&rsquo;s sequence, and not more than the
  10989. value of this option. By default it&rsquo;s 0, which means that this
  10990. mechanism is turned off, and the loss report is always sent
  10991. immediately upon experiencing a &quot;gap&quot; in sequences.
  10992. </p>
  10993. </dd>
  10994. <dt><samp class="option">minversion</samp></dt>
  10995. <dd><p>The minimum SRT version that is required from the peer. A connection
  10996. to a peer that does not satisfy the minimum version requirement
  10997. will be rejected.
  10998. </p>
  10999. <p>The version format in hex is 0xXXYYZZ for x.y.z in human readable
  11000. form.
  11001. </p>
  11002. </dd>
  11003. <dt><samp class="option">streamid=<var class="var">string</var></samp></dt>
  11004. <dd><p>A string limited to 512 characters that can be set on the socket prior
  11005. to connecting. This stream ID will be able to be retrieved by the
  11006. listener side from the socket that is returned from srt_accept and
  11007. was connected by a socket with that set stream ID. SRT does not enforce
  11008. any special interpretation of the contents of this string.
  11009. This option doesn’t make sense in Rendezvous connection; the result
  11010. might be that simply one side will override the value from the other
  11011. side and it’s the matter of luck which one would win
  11012. </p>
  11013. </dd>
  11014. <dt><samp class="option">srt_streamid=<var class="var">string</var></samp></dt>
  11015. <dd><p>Alias for &lsquo;<samp class="samp">streamid</samp>&rsquo; to avoid conflict with ffmpeg command line option.
  11016. </p>
  11017. </dd>
  11018. <dt><samp class="option">smoother=<var class="var">live|file</var></samp></dt>
  11019. <dd><p>The type of Smoother used for the transmission for that socket, which
  11020. is responsible for the transmission and congestion control. The Smoother
  11021. type must be exactly the same on both connecting parties, otherwise
  11022. the connection is rejected.
  11023. </p>
  11024. </dd>
  11025. <dt><samp class="option">messageapi=<var class="var">1|0</var></samp></dt>
  11026. <dd><p>When set, this socket uses the Message API, otherwise it uses Buffer
  11027. API. Note that in live mode (see <samp class="option">transtype</samp>) there’s only
  11028. message API available. In File mode you can chose to use one of two modes:
  11029. </p>
  11030. <p>Stream API (default, when this option is false). In this mode you may
  11031. send as many data as you wish with one sending instruction, or even use
  11032. dedicated functions that read directly from a file. The internal facility
  11033. will take care of any speed and congestion control. When receiving, you
  11034. can also receive as many data as desired, the data not extracted will be
  11035. waiting for the next call. There is no boundary between data portions in
  11036. the Stream mode.
  11037. </p>
  11038. <p>Message API. In this mode your single sending instruction passes exactly
  11039. one piece of data that has boundaries (a message). Contrary to Live mode,
  11040. this message may span across multiple UDP packets and the only size
  11041. limitation is that it shall fit as a whole in the sending buffer. The
  11042. receiver shall use as large buffer as necessary to receive the message,
  11043. otherwise the message will not be given up. When the message is not
  11044. complete (not all packets received or there was a packet loss) it will
  11045. not be given up.
  11046. </p>
  11047. </dd>
  11048. <dt><samp class="option">transtype=<var class="var">live|file</var></samp></dt>
  11049. <dd><p>Sets the transmission type for the socket, in particular, setting this
  11050. option sets multiple other parameters to their default values as required
  11051. for a particular transmission type.
  11052. </p>
  11053. <p>live: Set options as for live transmission. In this mode, you should
  11054. send by one sending instruction only so many data that fit in one UDP packet,
  11055. and limited to the value defined first in <samp class="option">payload_size</samp> (1316 is
  11056. default in this mode). There is no speed control in this mode, only the
  11057. bandwidth control, if configured, in order to not exceed the bandwidth with
  11058. the overhead transmission (retransmitted and control packets).
  11059. </p>
  11060. <p>file: Set options as for non-live transmission. See <samp class="option">messageapi</samp>
  11061. for further explanations
  11062. </p>
  11063. </dd>
  11064. <dt><samp class="option">linger=<var class="var">seconds</var></samp></dt>
  11065. <dd><p>The number of seconds that the socket waits for unsent data when closing.
  11066. Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180
  11067. seconds in file mode). The range for this option is integers in the
  11068. 0 - <code class="code">INT_MAX</code>.
  11069. </p>
  11070. </dd>
  11071. <dt><samp class="option">tsbpd=<var class="var">1|0</var></samp></dt>
  11072. <dd><p>When true, use Timestamp-based Packet Delivery mode. The default behavior
  11073. depends on the transmission type: enabled in live mode, disabled in file
  11074. mode.
  11075. </p>
  11076. </dd>
  11077. </dl>
  11078. <p>For more information see: <a class="url" href="https://github.com/Haivision/srt">https://github.com/Haivision/srt</a>.
  11079. </p>
  11080. </div>
  11081. <div class="section-level-extent" id="srtp">
  11082. <h3 class="section"><span>16.38 srtp<a class="copiable-link" href="#srtp"> &para;</a></span></h3>
  11083. <p>Secure Real-time Transport Protocol.
  11084. </p>
  11085. <p>The accepted options are:
  11086. </p><dl class="table">
  11087. <dt><samp class="option">srtp_in_suite</samp></dt>
  11088. <dt><samp class="option">srtp_out_suite</samp></dt>
  11089. <dd><p>Select input and output encoding suites.
  11090. </p>
  11091. <p>Supported values:
  11092. </p><dl class="table">
  11093. <dt>&lsquo;<samp class="samp">AES_CM_128_HMAC_SHA1_80</samp>&rsquo;</dt>
  11094. <dt>&lsquo;<samp class="samp">SRTP_AES128_CM_HMAC_SHA1_80</samp>&rsquo;</dt>
  11095. <dt>&lsquo;<samp class="samp">AES_CM_128_HMAC_SHA1_32</samp>&rsquo;</dt>
  11096. <dt>&lsquo;<samp class="samp">SRTP_AES128_CM_HMAC_SHA1_32</samp>&rsquo;</dt>
  11097. </dl>
  11098. </dd>
  11099. <dt><samp class="option">srtp_in_params</samp></dt>
  11100. <dt><samp class="option">srtp_out_params</samp></dt>
  11101. <dd><p>Set input and output encoding parameters, which are expressed by a
  11102. base64-encoded representation of a binary block. The first 16 bytes of
  11103. this binary block are used as master key, the following 14 bytes are
  11104. used as master salt.
  11105. </p></dd>
  11106. </dl>
  11107. </div>
  11108. <div class="section-level-extent" id="subfile">
  11109. <h3 class="section"><span>16.39 subfile<a class="copiable-link" href="#subfile"> &para;</a></span></h3>
  11110. <p>Virtually extract a segment of a file or another stream.
  11111. The underlying stream must be seekable.
  11112. </p>
  11113. <p>Accepted options:
  11114. </p><dl class="table">
  11115. <dt><samp class="option">start</samp></dt>
  11116. <dd><p>Start offset of the extracted segment, in bytes.
  11117. </p></dd>
  11118. <dt><samp class="option">end</samp></dt>
  11119. <dd><p>End offset of the extracted segment, in bytes.
  11120. If set to 0, extract till end of file.
  11121. </p></dd>
  11122. </dl>
  11123. <p>Examples:
  11124. </p>
  11125. <p>Extract a chapter from a DVD VOB file (start and end sectors obtained
  11126. externally and multiplied by 2048):
  11127. </p><div class="example">
  11128. <pre class="example-preformatted">subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
  11129. </pre></div>
  11130. <p>Play an AVI file directly from a TAR archive:
  11131. </p><div class="example">
  11132. <pre class="example-preformatted">subfile,,start,183241728,end,366490624,,:archive.tar
  11133. </pre></div>
  11134. <p>Play a MPEG-TS file from start offset till end:
  11135. </p><div class="example">
  11136. <pre class="example-preformatted">subfile,,start,32815239,end,0,,:video.ts
  11137. </pre></div>
  11138. </div>
  11139. <div class="section-level-extent" id="tee">
  11140. <h3 class="section"><span>16.40 tee<a class="copiable-link" href="#tee"> &para;</a></span></h3>
  11141. <p>Writes the output to multiple protocols. The individual outputs are separated
  11142. by |
  11143. </p>
  11144. <div class="example">
  11145. <pre class="example-preformatted">tee:file://path/to/local/this.avi|file://path/to/local/that.avi
  11146. </pre></div>
  11147. </div>
  11148. <div class="section-level-extent" id="tcp">
  11149. <h3 class="section"><span>16.41 tcp<a class="copiable-link" href="#tcp"> &para;</a></span></h3>
  11150. <p>Transmission Control Protocol.
  11151. </p>
  11152. <p>The required syntax for a TCP url is:
  11153. </p><div class="example">
  11154. <pre class="example-preformatted">tcp://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  11155. </pre></div>
  11156. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  11157. <var class="var">key</var>=<var class="var">val</var>.
  11158. </p>
  11159. <p>The list of supported options follows.
  11160. </p>
  11161. <dl class="table">
  11162. <dt><samp class="option">listen=<var class="var">2|1|0</var></samp></dt>
  11163. <dd><p>Listen for an incoming connection. 0 disables listen, 1 enables listen in
  11164. single client mode, 2 enables listen in multi-client mode. Default value is 0.
  11165. </p>
  11166. </dd>
  11167. <dt><samp class="option">local_addr=<var class="var">addr</var></samp></dt>
  11168. <dd><p>Local IP address of a network interface used for tcp socket connect.
  11169. </p>
  11170. </dd>
  11171. <dt><samp class="option">local_port=<var class="var">port</var></samp></dt>
  11172. <dd><p>Local port used for tcp socket connect.
  11173. </p>
  11174. </dd>
  11175. <dt><samp class="option">timeout=<var class="var">microseconds</var></samp></dt>
  11176. <dd><p>Set raise error timeout, expressed in microseconds.
  11177. </p>
  11178. <p>This option is only relevant in read mode: if no data arrived in more
  11179. than this time interval, raise error.
  11180. </p>
  11181. </dd>
  11182. <dt><samp class="option">listen_timeout=<var class="var">milliseconds</var></samp></dt>
  11183. <dd><p>Set listen timeout, expressed in milliseconds.
  11184. </p>
  11185. </dd>
  11186. <dt><samp class="option">recv_buffer_size=<var class="var">bytes</var></samp></dt>
  11187. <dd><p>Set receive buffer size, expressed bytes.
  11188. </p>
  11189. </dd>
  11190. <dt><samp class="option">send_buffer_size=<var class="var">bytes</var></samp></dt>
  11191. <dd><p>Set send buffer size, expressed bytes.
  11192. </p>
  11193. </dd>
  11194. <dt><samp class="option">tcp_nodelay=<var class="var">1|0</var></samp></dt>
  11195. <dd><p>Set TCP_NODELAY to disable Nagle&rsquo;s algorithm. Default value is 0.
  11196. </p>
  11197. <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>
  11198. </p>
  11199. </dd>
  11200. <dt><samp class="option">tcp_mss=<var class="var">bytes</var></samp></dt>
  11201. <dd><p>Set maximum segment size for outgoing TCP packets, expressed in bytes.
  11202. </p></dd>
  11203. </dl>
  11204. <p>The following example shows how to setup a listening TCP connection
  11205. with <code class="command">ffmpeg</code>, which is then accessed with <code class="command">ffplay</code>:
  11206. </p><div class="example">
  11207. <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
  11208. ffplay tcp://<var class="var">hostname</var>:<var class="var">port</var>
  11209. </pre></div>
  11210. </div>
  11211. <div class="section-level-extent" id="tls">
  11212. <h3 class="section"><span>16.42 tls<a class="copiable-link" href="#tls"> &para;</a></span></h3>
  11213. <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
  11214. </p>
  11215. <p>The required syntax for a TLS/SSL url is:
  11216. </p><div class="example">
  11217. <pre class="example-preformatted">tls://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  11218. </pre></div>
  11219. <p>The following parameters can be set via command line options
  11220. (or in code via <code class="code">AVOption</code>s):
  11221. </p>
  11222. <dl class="table">
  11223. <dt><samp class="option">ca_file, cafile=<var class="var">filename</var></samp></dt>
  11224. <dd><p>A file containing certificate authority (CA) root certificates to treat
  11225. as trusted. If the linked TLS library contains a default this might not
  11226. need to be specified for verification to work, but not all libraries and
  11227. setups have defaults built in.
  11228. The file must be in OpenSSL PEM format.
  11229. </p>
  11230. </dd>
  11231. <dt><samp class="option">tls_verify=<var class="var">1|0</var></samp></dt>
  11232. <dd><p>If enabled, try to verify the peer that we are communicating with.
  11233. Note, if using OpenSSL, this currently only makes sure that the
  11234. peer certificate is signed by one of the root certificates in the CA
  11235. database, but it does not validate that the certificate actually
  11236. matches the host name we are trying to connect to. (With other backends,
  11237. the host name is validated as well.)
  11238. </p>
  11239. <p>This is disabled by default since it requires a CA database to be
  11240. provided by the caller in many cases.
  11241. </p>
  11242. </dd>
  11243. <dt><samp class="option">cert_file, cert=<var class="var">filename</var></samp></dt>
  11244. <dd><p>A file containing a certificate to use in the handshake with the peer.
  11245. (When operating as server, in listen mode, this is more often required
  11246. by the peer, while client certificates only are mandated in certain
  11247. setups.)
  11248. </p>
  11249. </dd>
  11250. <dt><samp class="option">key_file, key=<var class="var">filename</var></samp></dt>
  11251. <dd><p>A file containing the private key for the certificate.
  11252. </p>
  11253. </dd>
  11254. <dt><samp class="option">listen=<var class="var">1|0</var></samp></dt>
  11255. <dd><p>If enabled, listen for connections on the provided port, and assume
  11256. the server role in the handshake instead of the client role.
  11257. </p>
  11258. </dd>
  11259. <dt><samp class="option">http_proxy</samp></dt>
  11260. <dd><p>The HTTP proxy to tunnel through, e.g. <code class="code">http://example.com:1234</code>.
  11261. The proxy must support the CONNECT method.
  11262. </p>
  11263. </dd>
  11264. </dl>
  11265. <p>Example command lines:
  11266. </p>
  11267. <p>To create a TLS/SSL server that serves an input stream.
  11268. </p>
  11269. <div class="example">
  11270. <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>
  11271. </pre></div>
  11272. <p>To play back a stream from the TLS/SSL server using <code class="command">ffplay</code>:
  11273. </p>
  11274. <div class="example">
  11275. <pre class="example-preformatted">ffplay tls://<var class="var">hostname</var>:<var class="var">port</var>
  11276. </pre></div>
  11277. </div>
  11278. <div class="section-level-extent" id="udp">
  11279. <h3 class="section"><span>16.43 udp<a class="copiable-link" href="#udp"> &para;</a></span></h3>
  11280. <p>User Datagram Protocol.
  11281. </p>
  11282. <p>The required syntax for an UDP URL is:
  11283. </p><div class="example">
  11284. <pre class="example-preformatted">udp://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  11285. </pre></div>
  11286. <p><var class="var">options</var> contains a list of &amp;-separated options of the form <var class="var">key</var>=<var class="var">val</var>.
  11287. </p>
  11288. <p>In case threading is enabled on the system, a circular buffer is used
  11289. to store the incoming data, which allows one to reduce loss of data due to
  11290. UDP socket buffer overruns. The <var class="var">fifo_size</var> and
  11291. <var class="var">overrun_nonfatal</var> options are related to this buffer.
  11292. </p>
  11293. <p>The list of supported options follows.
  11294. </p>
  11295. <dl class="table">
  11296. <dt><samp class="option">buffer_size=<var class="var">size</var></samp></dt>
  11297. <dd><p>Set the UDP maximum socket buffer size in bytes. This is used to set either
  11298. the receive or send buffer size, depending on what the socket is used for.
  11299. Default is 32 KB for output, 384 KB for input. See also <var class="var">fifo_size</var>.
  11300. </p>
  11301. </dd>
  11302. <dt><samp class="option">bitrate=<var class="var">bitrate</var></samp></dt>
  11303. <dd><p>If set to nonzero, the output will have the specified constant bitrate if the
  11304. input has enough packets to sustain it.
  11305. </p>
  11306. </dd>
  11307. <dt><samp class="option">burst_bits=<var class="var">bits</var></samp></dt>
  11308. <dd><p>When using <var class="var">bitrate</var> this specifies the maximum number of bits in
  11309. packet bursts.
  11310. </p>
  11311. </dd>
  11312. <dt><samp class="option">localport=<var class="var">port</var></samp></dt>
  11313. <dd><p>Override the local UDP port to bind with.
  11314. </p>
  11315. </dd>
  11316. <dt><samp class="option">localaddr=<var class="var">addr</var></samp></dt>
  11317. <dd><p>Local IP address of a network interface used for sending packets or joining
  11318. multicast groups.
  11319. </p>
  11320. </dd>
  11321. <dt><samp class="option">pkt_size=<var class="var">size</var></samp></dt>
  11322. <dd><p>Set the size in bytes of UDP packets.
  11323. </p>
  11324. </dd>
  11325. <dt><samp class="option">reuse=<var class="var">1|0</var></samp></dt>
  11326. <dd><p>Explicitly allow or disallow reusing UDP sockets.
  11327. </p>
  11328. </dd>
  11329. <dt><samp class="option">ttl=<var class="var">ttl</var></samp></dt>
  11330. <dd><p>Set the time to live value (for multicast only).
  11331. </p>
  11332. </dd>
  11333. <dt><samp class="option">connect=<var class="var">1|0</var></samp></dt>
  11334. <dd><p>Initialize the UDP socket with <code class="code">connect()</code>. In this case, the
  11335. destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
  11336. If the destination address isn&rsquo;t known at the start, this option can
  11337. be specified in ff_udp_set_remote_url, too.
  11338. This allows finding out the source address for the packets with getsockname,
  11339. and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
  11340. unreachable&quot; is received.
  11341. For receiving, this gives the benefit of only receiving packets from
  11342. the specified peer address/port.
  11343. </p>
  11344. </dd>
  11345. <dt><samp class="option">sources=<var class="var">address</var>[,<var class="var">address</var>]</samp></dt>
  11346. <dd><p>Only receive packets sent from the specified addresses. In case of multicast,
  11347. also subscribe to multicast traffic coming from these addresses only.
  11348. </p>
  11349. </dd>
  11350. <dt><samp class="option">block=<var class="var">address</var>[,<var class="var">address</var>]</samp></dt>
  11351. <dd><p>Ignore packets sent from the specified addresses. In case of multicast, also
  11352. exclude the source addresses in the multicast subscription.
  11353. </p>
  11354. </dd>
  11355. <dt><samp class="option">fifo_size=<var class="var">units</var></samp></dt>
  11356. <dd><p>Set the UDP receiving circular buffer size, expressed as a number of
  11357. packets with size of 188 bytes. If not specified defaults to 7*4096.
  11358. </p>
  11359. </dd>
  11360. <dt><samp class="option">overrun_nonfatal=<var class="var">1|0</var></samp></dt>
  11361. <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
  11362. value is 0.
  11363. </p>
  11364. </dd>
  11365. <dt><samp class="option">timeout=<var class="var">microseconds</var></samp></dt>
  11366. <dd><p>Set raise error timeout, expressed in microseconds.
  11367. </p>
  11368. <p>This option is only relevant in read mode: if no data arrived in more
  11369. than this time interval, raise error.
  11370. </p>
  11371. </dd>
  11372. <dt><samp class="option">broadcast=<var class="var">1|0</var></samp></dt>
  11373. <dd><p>Explicitly allow or disallow UDP broadcasting.
  11374. </p>
  11375. <p>Note that broadcasting may not work properly on networks having
  11376. a broadcast storm protection.
  11377. </p></dd>
  11378. </dl>
  11379. <ul class="mini-toc">
  11380. <li><a href="#Examples-7" accesskey="1">Examples</a></li>
  11381. </ul>
  11382. <div class="subsection-level-extent" id="Examples-7">
  11383. <h4 class="subsection"><span>16.43.1 Examples<a class="copiable-link" href="#Examples-7"> &para;</a></span></h4>
  11384. <ul class="itemize mark-bullet">
  11385. <li>Use <code class="command">ffmpeg</code> to stream over UDP to a remote endpoint:
  11386. <div class="example">
  11387. <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>
  11388. </pre></div>
  11389. </li><li>Use <code class="command">ffmpeg</code> to stream in mpegts format over UDP using 188
  11390. sized UDP packets, using a large input buffer:
  11391. <div class="example">
  11392. <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
  11393. </pre></div>
  11394. </li><li>Use <code class="command">ffmpeg</code> to receive over UDP from a remote endpoint:
  11395. <div class="example">
  11396. <pre class="example-preformatted">ffmpeg -i udp://[<var class="var">multicast-address</var>]:<var class="var">port</var> ...
  11397. </pre></div>
  11398. </li></ul>
  11399. </div>
  11400. </div>
  11401. <div class="section-level-extent" id="unix">
  11402. <h3 class="section"><span>16.44 unix<a class="copiable-link" href="#unix"> &para;</a></span></h3>
  11403. <p>Unix local socket
  11404. </p>
  11405. <p>The required syntax for a Unix socket URL is:
  11406. </p>
  11407. <div class="example">
  11408. <pre class="example-preformatted">unix://<var class="var">filepath</var>
  11409. </pre></div>
  11410. <p>The following parameters can be set via command line options
  11411. (or in code via <code class="code">AVOption</code>s):
  11412. </p>
  11413. <dl class="table">
  11414. <dt><samp class="option">timeout</samp></dt>
  11415. <dd><p>Timeout in ms.
  11416. </p></dd>
  11417. <dt><samp class="option">listen</samp></dt>
  11418. <dd><p>Create the Unix socket in listening mode.
  11419. </p></dd>
  11420. </dl>
  11421. </div>
  11422. <div class="section-level-extent" id="zmq">
  11423. <h3 class="section"><span>16.45 zmq<a class="copiable-link" href="#zmq"> &para;</a></span></h3>
  11424. <p>ZeroMQ asynchronous messaging using the libzmq library.
  11425. </p>
  11426. <p>This library supports unicast streaming to multiple clients without relying on
  11427. an external server.
  11428. </p>
  11429. <p>The required syntax for streaming or connecting to a stream is:
  11430. </p><div class="example">
  11431. <pre class="example-preformatted">zmq:tcp://ip-address:port
  11432. </pre></div>
  11433. <p>Example:
  11434. Create a localhost stream on port 5555:
  11435. </p><div class="example">
  11436. <pre class="example-preformatted">ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
  11437. </pre></div>
  11438. <p>Multiple clients may connect to the stream using:
  11439. </p><div class="example">
  11440. <pre class="example-preformatted">ffplay zmq:tcp://127.0.0.1:5555
  11441. </pre></div>
  11442. <p>Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern.
  11443. The server side binds to a port and publishes data. Clients connect to the
  11444. server (via IP address/port) and subscribe to the stream. The order in which
  11445. the server and client start generally does not matter.
  11446. </p>
  11447. <p>ffmpeg must be compiled with the &ndash;enable-libzmq option to support
  11448. this protocol.
  11449. </p>
  11450. <p>Options can be set on the <code class="command">ffmpeg</code>/<code class="command">ffplay</code> command
  11451. line. The following options are supported:
  11452. </p>
  11453. <dl class="table">
  11454. <dt><samp class="option">pkt_size</samp></dt>
  11455. <dd><p>Forces the maximum packet size for sending/receiving data. The default value is
  11456. 131,072 bytes. On the server side, this sets the maximum size of sent packets
  11457. via ZeroMQ. On the clients, it sets an internal buffer size for receiving
  11458. packets. Note that pkt_size on the clients should be equal to or greater than
  11459. pkt_size on the server. Otherwise the received message may be truncated causing
  11460. decoding errors.
  11461. </p>
  11462. </dd>
  11463. </dl>
  11464. </div>
  11465. </div>
  11466. <div class="chapter-level-extent" id="Device-Options">
  11467. <h2 class="chapter"><span>17 Device Options<a class="copiable-link" href="#Device-Options"> &para;</a></span></h2>
  11468. <p>The libavdevice library provides the same interface as
  11469. libavformat. Namely, an input device is considered like a demuxer, and
  11470. an output device like a muxer, and the interface and generic device
  11471. options are the same provided by libavformat (see the ffmpeg-formats
  11472. manual).
  11473. </p>
  11474. <p>In addition each input or output device may support so-called private
  11475. options, which are specific for that component.
  11476. </p>
  11477. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  11478. FFmpeg tools, or by setting the value explicitly in the device
  11479. <code class="code">AVFormatContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  11480. for programmatic use.
  11481. </p>
  11482. </div>
  11483. <div class="chapter-level-extent" id="Input-Devices">
  11484. <h2 class="chapter"><span>18 Input Devices<a class="copiable-link" href="#Input-Devices"> &para;</a></span></h2>
  11485. <p>Input devices are configured elements in FFmpeg which enable accessing
  11486. the data coming from a multimedia device attached to your system.
  11487. </p>
  11488. <p>When you configure your FFmpeg build, all the supported input devices
  11489. are enabled by default. You can list all available ones using the
  11490. configure option &quot;&ndash;list-indevs&quot;.
  11491. </p>
  11492. <p>You can disable all the input devices using the configure option
  11493. &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
  11494. option &quot;&ndash;enable-indev=<var class="var">INDEV</var>&quot;, or you can disable a particular
  11495. input device using the option &quot;&ndash;disable-indev=<var class="var">INDEV</var>&quot;.
  11496. </p>
  11497. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  11498. supported input devices.
  11499. </p>
  11500. <p>A description of the currently available input devices follows.
  11501. </p>
  11502. <ul class="mini-toc">
  11503. <li><a href="#alsa" accesskey="1">alsa</a></li>
  11504. <li><a href="#android_005fcamera" accesskey="2">android_camera</a></li>
  11505. <li><a href="#avfoundation" accesskey="3">avfoundation</a></li>
  11506. <li><a href="#bktr" accesskey="4">bktr</a></li>
  11507. <li><a href="#decklink" accesskey="5">decklink</a></li>
  11508. <li><a href="#dshow" accesskey="6">dshow</a></li>
  11509. <li><a href="#fbdev" accesskey="7">fbdev</a></li>
  11510. <li><a href="#gdigrab" accesskey="8">gdigrab</a></li>
  11511. <li><a href="#iec61883" accesskey="9">iec61883</a></li>
  11512. <li><a href="#jack">jack</a></li>
  11513. <li><a href="#kmsgrab">kmsgrab</a></li>
  11514. <li><a href="#lavfi">lavfi</a></li>
  11515. <li><a href="#libcdio">libcdio</a></li>
  11516. <li><a href="#libdc1394">libdc1394</a></li>
  11517. <li><a href="#openal">openal</a></li>
  11518. <li><a href="#oss">oss</a></li>
  11519. <li><a href="#pulse">pulse</a></li>
  11520. <li><a href="#sndio">sndio</a></li>
  11521. <li><a href="#video4linux2_002c-v4l2">video4linux2, v4l2</a></li>
  11522. <li><a href="#vfwcap">vfwcap</a></li>
  11523. <li><a href="#x11grab">x11grab</a></li>
  11524. </ul>
  11525. <div class="section-level-extent" id="alsa">
  11526. <h3 class="section"><span>18.1 alsa<a class="copiable-link" href="#alsa"> &para;</a></span></h3>
  11527. <p>ALSA (Advanced Linux Sound Architecture) input device.
  11528. </p>
  11529. <p>To enable this input device during configuration you need libasound
  11530. installed on your system.
  11531. </p>
  11532. <p>This device allows capturing from an ALSA device. The name of the
  11533. device to capture has to be an ALSA card identifier.
  11534. </p>
  11535. <p>An ALSA identifier has the syntax:
  11536. </p><div class="example">
  11537. <pre class="example-preformatted">hw:<var class="var">CARD</var>[,<var class="var">DEV</var>[,<var class="var">SUBDEV</var>]]
  11538. </pre></div>
  11539. <p>where the <var class="var">DEV</var> and <var class="var">SUBDEV</var> components are optional.
  11540. </p>
  11541. <p>The three arguments (in order: <var class="var">CARD</var>,<var class="var">DEV</var>,<var class="var">SUBDEV</var>)
  11542. specify card number or identifier, device number and subdevice number
  11543. (-1 means any).
  11544. </p>
  11545. <p>To see the list of cards currently recognized by your system check the
  11546. files <samp class="file">/proc/asound/cards</samp> and <samp class="file">/proc/asound/devices</samp>.
  11547. </p>
  11548. <p>For example to capture with <code class="command">ffmpeg</code> from an ALSA device with
  11549. card id 0, you may run the command:
  11550. </p><div class="example">
  11551. <pre class="example-preformatted">ffmpeg -f alsa -i hw:0 alsaout.wav
  11552. </pre></div>
  11553. <p>For more information see:
  11554. <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>
  11555. </p>
  11556. <ul class="mini-toc">
  11557. <li><a href="#Options-16" accesskey="1">Options</a></li>
  11558. </ul>
  11559. <div class="subsection-level-extent" id="Options-16">
  11560. <h4 class="subsection"><span>18.1.1 Options<a class="copiable-link" href="#Options-16"> &para;</a></span></h4>
  11561. <dl class="table">
  11562. <dt><samp class="option">sample_rate</samp></dt>
  11563. <dd><p>Set the sample rate in Hz. Default is 48000.
  11564. </p>
  11565. </dd>
  11566. <dt><samp class="option">channels</samp></dt>
  11567. <dd><p>Set the number of channels. Default is 2.
  11568. </p>
  11569. </dd>
  11570. </dl>
  11571. </div>
  11572. </div>
  11573. <div class="section-level-extent" id="android_005fcamera">
  11574. <h3 class="section"><span>18.2 android_camera<a class="copiable-link" href="#android_005fcamera"> &para;</a></span></h3>
  11575. <p>Android camera input device.
  11576. </p>
  11577. <p>This input devices uses the Android Camera2 NDK API which is
  11578. available on devices with API level 24+. The availability of
  11579. android_camera is autodetected during configuration.
  11580. </p>
  11581. <p>This device allows capturing from all cameras on an Android device,
  11582. which are integrated into the Camera2 NDK API.
  11583. </p>
  11584. <p>The available cameras are enumerated internally and can be selected
  11585. with the <var class="var">camera_index</var> parameter. The input file string is
  11586. discarded.
  11587. </p>
  11588. <p>Generally the back facing camera has index 0 while the front facing
  11589. camera has index 1.
  11590. </p>
  11591. <ul class="mini-toc">
  11592. <li><a href="#Options-17" accesskey="1">Options</a></li>
  11593. </ul>
  11594. <div class="subsection-level-extent" id="Options-17">
  11595. <h4 class="subsection"><span>18.2.1 Options<a class="copiable-link" href="#Options-17"> &para;</a></span></h4>
  11596. <dl class="table">
  11597. <dt><samp class="option">video_size</samp></dt>
  11598. <dd><p>Set the video size given as a string such as 640x480 or hd720.
  11599. Falls back to the first available configuration reported by
  11600. Android if requested video size is not available or by default.
  11601. </p>
  11602. </dd>
  11603. <dt><samp class="option">framerate</samp></dt>
  11604. <dd><p>Set the video framerate.
  11605. Falls back to the first available configuration reported by
  11606. Android if requested framerate is not available or by default (-1).
  11607. </p>
  11608. </dd>
  11609. <dt><samp class="option">camera_index</samp></dt>
  11610. <dd><p>Set the index of the camera to use. Default is 0.
  11611. </p>
  11612. </dd>
  11613. <dt><samp class="option">input_queue_size</samp></dt>
  11614. <dd><p>Set the maximum number of frames to buffer. Default is 5.
  11615. </p>
  11616. </dd>
  11617. </dl>
  11618. </div>
  11619. </div>
  11620. <div class="section-level-extent" id="avfoundation">
  11621. <h3 class="section"><span>18.3 avfoundation<a class="copiable-link" href="#avfoundation"> &para;</a></span></h3>
  11622. <p>AVFoundation input device.
  11623. </p>
  11624. <p>AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX &gt;= 10.7 as well as on iOS.
  11625. </p>
  11626. <p>The input filename has to be given in the following syntax:
  11627. </p><div class="example">
  11628. <pre class="example-preformatted">-i &quot;[[VIDEO]:[AUDIO]]&quot;
  11629. </pre></div>
  11630. <p>The first entry selects the video input while the latter selects the audio input.
  11631. The stream has to be specified by the device name or the device index as shown by the device list.
  11632. Alternatively, the video and/or audio input device can be chosen by index using the
  11633. <samp class="option">
  11634. -video_device_index &lt;INDEX&gt;
  11635. </samp>
  11636. and/or
  11637. <samp class="option">
  11638. -audio_device_index &lt;INDEX&gt;
  11639. </samp>
  11640. , overriding any
  11641. device name or index given in the input filename.
  11642. </p>
  11643. <p>All available devices can be enumerated by using <samp class="option">-list_devices true</samp>, listing
  11644. all device names and corresponding indices.
  11645. </p>
  11646. <p>There are two device name aliases:
  11647. </p><dl class="table">
  11648. <dt><code class="code">default</code></dt>
  11649. <dd><p>Select the AVFoundation default device of the corresponding type.
  11650. </p>
  11651. </dd>
  11652. <dt><code class="code">none</code></dt>
  11653. <dd><p>Do not record the corresponding media type.
  11654. This is equivalent to specifying an empty device name or index.
  11655. </p>
  11656. </dd>
  11657. </dl>
  11658. <ul class="mini-toc">
  11659. <li><a href="#Options-18" accesskey="1">Options</a></li>
  11660. <li><a href="#Examples-8" accesskey="2">Examples</a></li>
  11661. </ul>
  11662. <div class="subsection-level-extent" id="Options-18">
  11663. <h4 class="subsection"><span>18.3.1 Options<a class="copiable-link" href="#Options-18"> &para;</a></span></h4>
  11664. <p>AVFoundation supports the following options:
  11665. </p>
  11666. <dl class="table">
  11667. <dt><samp class="option">-list_devices &lt;TRUE|FALSE&gt;</samp></dt>
  11668. <dd><p>If set to true, a list of all available input devices is given showing all
  11669. device names and indices.
  11670. </p>
  11671. </dd>
  11672. <dt><samp class="option">-video_device_index &lt;INDEX&gt;</samp></dt>
  11673. <dd><p>Specify the video device by its index. Overrides anything given in the input filename.
  11674. </p>
  11675. </dd>
  11676. <dt><samp class="option">-audio_device_index &lt;INDEX&gt;</samp></dt>
  11677. <dd><p>Specify the audio device by its index. Overrides anything given in the input filename.
  11678. </p>
  11679. </dd>
  11680. <dt><samp class="option">-pixel_format &lt;FORMAT&gt;</samp></dt>
  11681. <dd><p>Request the video device to use a specific pixel format.
  11682. If the specified format is not supported, a list of available formats is given
  11683. and the first one in this list is used instead. Available pixel formats are:
  11684. <code class="code">monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
  11685. bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
  11686. yuv420p, nv12, yuyv422, gray</code>
  11687. </p>
  11688. </dd>
  11689. <dt><samp class="option">-framerate</samp></dt>
  11690. <dd><p>Set the grabbing frame rate. Default is <code class="code">ntsc</code>, corresponding to a
  11691. frame rate of <code class="code">30000/1001</code>.
  11692. </p>
  11693. </dd>
  11694. <dt><samp class="option">-video_size</samp></dt>
  11695. <dd><p>Set the video frame size.
  11696. </p>
  11697. </dd>
  11698. <dt><samp class="option">-capture_cursor</samp></dt>
  11699. <dd><p>Capture the mouse pointer. Default is 0.
  11700. </p>
  11701. </dd>
  11702. <dt><samp class="option">-capture_mouse_clicks</samp></dt>
  11703. <dd><p>Capture the screen mouse clicks. Default is 0.
  11704. </p>
  11705. </dd>
  11706. <dt><samp class="option">-capture_raw_data</samp></dt>
  11707. <dd><p>Capture the raw device data. Default is 0.
  11708. 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.
  11709. </p></dd>
  11710. </dl>
  11711. </div>
  11712. <div class="subsection-level-extent" id="Examples-8">
  11713. <h4 class="subsection"><span>18.3.2 Examples<a class="copiable-link" href="#Examples-8"> &para;</a></span></h4>
  11714. <ul class="itemize mark-bullet">
  11715. <li>Print the list of AVFoundation supported devices and exit:
  11716. <div class="example">
  11717. <pre class="example-preformatted">$ ffmpeg -f avfoundation -list_devices true -i &quot;&quot;
  11718. </pre></div>
  11719. </li><li>Record video from video device 0 and audio from audio device 0 into out.avi:
  11720. <div class="example">
  11721. <pre class="example-preformatted">$ ffmpeg -f avfoundation -i &quot;0:0&quot; out.avi
  11722. </pre></div>
  11723. </li><li>Record video from video device 2 and audio from audio device 1 into out.avi:
  11724. <div class="example">
  11725. <pre class="example-preformatted">$ ffmpeg -f avfoundation -video_device_index 2 -i &quot;:1&quot; out.avi
  11726. </pre></div>
  11727. </li><li>Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi:
  11728. <div class="example">
  11729. <pre class="example-preformatted">$ ffmpeg -f avfoundation -pixel_format bgr0 -i &quot;default:none&quot; out.avi
  11730. </pre></div>
  11731. </li><li>Record raw DV data from a suitable input device and write the output into out.dv:
  11732. <div class="example">
  11733. <pre class="example-preformatted">$ ffmpeg -f avfoundation -capture_raw_data true -i &quot;zr100:none&quot; out.dv
  11734. </pre></div>
  11735. </li></ul>
  11736. </div>
  11737. </div>
  11738. <div class="section-level-extent" id="bktr">
  11739. <h3 class="section"><span>18.4 bktr<a class="copiable-link" href="#bktr"> &para;</a></span></h3>
  11740. <p>BSD video input device. Deprecated and will be removed - please contact
  11741. the developers if you are interested in maintaining it.
  11742. </p>
  11743. <ul class="mini-toc">
  11744. <li><a href="#Options-19" accesskey="1">Options</a></li>
  11745. </ul>
  11746. <div class="subsection-level-extent" id="Options-19">
  11747. <h4 class="subsection"><span>18.4.1 Options<a class="copiable-link" href="#Options-19"> &para;</a></span></h4>
  11748. <dl class="table">
  11749. <dt><samp class="option">framerate</samp></dt>
  11750. <dd><p>Set the frame rate.
  11751. </p>
  11752. </dd>
  11753. <dt><samp class="option">video_size</samp></dt>
  11754. <dd><p>Set the video frame size. Default is <code class="code">vga</code>.
  11755. </p>
  11756. </dd>
  11757. <dt><samp class="option">standard</samp></dt>
  11758. <dd>
  11759. <p>Available values are:
  11760. </p><dl class="table">
  11761. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  11762. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  11763. <dt>&lsquo;<samp class="samp">secam</samp>&rsquo;</dt>
  11764. <dt>&lsquo;<samp class="samp">paln</samp>&rsquo;</dt>
  11765. <dt>&lsquo;<samp class="samp">palm</samp>&rsquo;</dt>
  11766. <dt>&lsquo;<samp class="samp">ntscj</samp>&rsquo;</dt>
  11767. </dl>
  11768. </dd>
  11769. </dl>
  11770. </div>
  11771. </div>
  11772. <div class="section-level-extent" id="decklink">
  11773. <h3 class="section"><span>18.5 decklink<a class="copiable-link" href="#decklink"> &para;</a></span></h3>
  11774. <p>The decklink input device provides capture capabilities for Blackmagic
  11775. DeckLink devices.
  11776. </p>
  11777. <p>To enable this input device, you need the Blackmagic DeckLink SDK and you
  11778. need to configure with the appropriate <code class="code">--extra-cflags</code>
  11779. and <code class="code">--extra-ldflags</code>.
  11780. On Windows, you need to run the IDL files through <code class="command">widl</code>.
  11781. </p>
  11782. <p>DeckLink is very picky about the formats it supports. Pixel format of the
  11783. input can be set with <samp class="option">raw_format</samp>.
  11784. Framerate and video size must be determined for your device with
  11785. <code class="command">-list_formats 1</code>. Audio sample rate is always 48 kHz and the number
  11786. of channels can be 2, 8 or 16. Note that all audio channels are bundled in one single
  11787. audio track.
  11788. </p>
  11789. <ul class="mini-toc">
  11790. <li><a href="#Options-20" accesskey="1">Options</a></li>
  11791. <li><a href="#Examples-9" accesskey="2">Examples</a></li>
  11792. </ul>
  11793. <div class="subsection-level-extent" id="Options-20">
  11794. <h4 class="subsection"><span>18.5.1 Options<a class="copiable-link" href="#Options-20"> &para;</a></span></h4>
  11795. <dl class="table">
  11796. <dt><samp class="option">list_devices</samp></dt>
  11797. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  11798. Defaults to <samp class="option">false</samp>. This option is deprecated, please use the
  11799. <code class="code">-sources</code> option of ffmpeg to list the available input devices.
  11800. </p>
  11801. </dd>
  11802. <dt><samp class="option">list_formats</samp></dt>
  11803. <dd><p>If set to <samp class="option">true</samp>, print a list of supported formats and exit.
  11804. Defaults to <samp class="option">false</samp>.
  11805. </p>
  11806. </dd>
  11807. <dt><samp class="option">format_code &lt;FourCC&gt;</samp></dt>
  11808. <dd><p>This sets the input video format to the format given by the FourCC. To see
  11809. the supported values of your device(s) use <samp class="option">list_formats</samp>.
  11810. Note that there is a FourCC <samp class="option">'pal '</samp> that can also be used
  11811. as <samp class="option">pal</samp> (3 letters).
  11812. Default behavior is autodetection of the input video format, if the hardware
  11813. supports it.
  11814. </p>
  11815. </dd>
  11816. <dt><samp class="option">raw_format</samp></dt>
  11817. <dd><p>Set the pixel format of the captured video.
  11818. Available values are:
  11819. </p><dl class="table">
  11820. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  11821. <dd>
  11822. <p>This is the default which means 8-bit YUV 422 or 8-bit ARGB if format
  11823. autodetection is used, 8-bit YUV 422 otherwise.
  11824. </p>
  11825. </dd>
  11826. <dt>&lsquo;<samp class="samp">uyvy422</samp>&rsquo;</dt>
  11827. <dd>
  11828. <p>8-bit YUV 422.
  11829. </p>
  11830. </dd>
  11831. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  11832. <dd>
  11833. <p>10-bit YUV 422.
  11834. </p>
  11835. </dd>
  11836. <dt>&lsquo;<samp class="samp">argb</samp>&rsquo;</dt>
  11837. <dd>
  11838. <p>8-bit RGB.
  11839. </p>
  11840. </dd>
  11841. <dt>&lsquo;<samp class="samp">bgra</samp>&rsquo;</dt>
  11842. <dd>
  11843. <p>8-bit RGB.
  11844. </p>
  11845. </dd>
  11846. <dt>&lsquo;<samp class="samp">rgb10</samp>&rsquo;</dt>
  11847. <dd>
  11848. <p>10-bit RGB.
  11849. </p>
  11850. </dd>
  11851. </dl>
  11852. </dd>
  11853. <dt><samp class="option">teletext_lines</samp></dt>
  11854. <dd><p>If set to nonzero, an additional teletext stream will be captured from the
  11855. vertical ancillary data. Both SD PAL (576i) and HD (1080i or 1080p)
  11856. sources are supported. In case of HD sources, OP47 packets are decoded.
  11857. </p>
  11858. <p>This option is a bitmask of the SD PAL VBI lines captured, specifically lines 6
  11859. to 22, and lines 318 to 335. Line 6 is the LSB in the mask. Selected lines
  11860. which do not contain teletext information will be ignored. You can use the
  11861. special <samp class="option">all</samp> constant to select all possible lines, or
  11862. <samp class="option">standard</samp> to skip lines 6, 318 and 319, which are not compatible with
  11863. all receivers.
  11864. </p>
  11865. <p>For SD sources, ffmpeg needs to be compiled with <code class="code">--enable-libzvbi</code>. For
  11866. HD sources, on older (pre-4K) DeckLink card models you have to capture in 10
  11867. bit mode.
  11868. </p>
  11869. </dd>
  11870. <dt><samp class="option">channels</samp></dt>
  11871. <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;.
  11872. Defaults to &lsquo;<samp class="samp">2</samp>&rsquo;.
  11873. </p>
  11874. </dd>
  11875. <dt><samp class="option">duplex_mode</samp></dt>
  11876. <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;,
  11877. &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;,
  11878. &lsquo;<samp class="samp">four_sub_device_half</samp>&rsquo;
  11879. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  11880. </p>
  11881. <p>Note: DeckLink SDK 11.0 have replaced the duplex property by a profile property.
  11882. For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2
  11883. sub-devices that utilize the same connectors. For the DeckLink 8K Pro, a profile
  11884. is shared between all 4 sub-devices. So DeckLink 8K Pro support four profiles.
  11885. </p>
  11886. <p>Valid profile modes for DeckLink 8K Pro(with DeckLink SDK &gt;= 11.0):
  11887. &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;,
  11888. &lsquo;<samp class="samp">four_sub_device_half</samp>&rsquo;
  11889. </p>
  11890. <p>Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2:
  11891. &lsquo;<samp class="samp">half</samp>&rsquo;, &lsquo;<samp class="samp">full</samp>&rsquo;
  11892. </p>
  11893. </dd>
  11894. <dt><samp class="option">timecode_format</samp></dt>
  11895. <dd><p>Timecode type to include in the frame and video stream metadata. Must be
  11896. &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;,
  11897. &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;.
  11898. Defaults to &lsquo;<samp class="samp">none</samp>&rsquo; (not included).
  11899. </p>
  11900. <p>In order to properly support 50/60 fps timecodes, the ordering of the queried
  11901. timecode types for &lsquo;<samp class="samp">rp188any</samp>&rsquo; is HFR, VITC1, VITC2 and LTC for &gt;30 fps
  11902. content. Note that this is slightly different to the ordering used by the
  11903. DeckLink API, which is HFR, VITC1, LTC, VITC2.
  11904. </p>
  11905. </dd>
  11906. <dt><samp class="option">video_input</samp></dt>
  11907. <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;,
  11908. &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;.
  11909. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  11910. </p>
  11911. </dd>
  11912. <dt><samp class="option">audio_input</samp></dt>
  11913. <dd><p>Sets the audio input source. Must be &lsquo;<samp class="samp">unset</samp>&rsquo;, &lsquo;<samp class="samp">embedded</samp>&rsquo;,
  11914. &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
  11915. &lsquo;<samp class="samp">microphone</samp>&rsquo;. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  11916. </p>
  11917. </dd>
  11918. <dt><samp class="option">video_pts</samp></dt>
  11919. <dd><p>Sets the video packet timestamp source. Must be &lsquo;<samp class="samp">video</samp>&rsquo;, &lsquo;<samp class="samp">audio</samp>&rsquo;,
  11920. &lsquo;<samp class="samp">reference</samp>&rsquo;, &lsquo;<samp class="samp">wallclock</samp>&rsquo; or &lsquo;<samp class="samp">abs_wallclock</samp>&rsquo;.
  11921. Defaults to &lsquo;<samp class="samp">video</samp>&rsquo;.
  11922. </p>
  11923. </dd>
  11924. <dt><samp class="option">audio_pts</samp></dt>
  11925. <dd><p>Sets the audio packet timestamp source. Must be &lsquo;<samp class="samp">video</samp>&rsquo;, &lsquo;<samp class="samp">audio</samp>&rsquo;,
  11926. &lsquo;<samp class="samp">reference</samp>&rsquo;, &lsquo;<samp class="samp">wallclock</samp>&rsquo; or &lsquo;<samp class="samp">abs_wallclock</samp>&rsquo;.
  11927. Defaults to &lsquo;<samp class="samp">audio</samp>&rsquo;.
  11928. </p>
  11929. </dd>
  11930. <dt><samp class="option">draw_bars</samp></dt>
  11931. <dd><p>If set to &lsquo;<samp class="samp">true</samp>&rsquo;, color bars are drawn in the event of a signal loss.
  11932. Defaults to &lsquo;<samp class="samp">true</samp>&rsquo;.
  11933. </p>
  11934. </dd>
  11935. <dt><samp class="option">queue_size</samp></dt>
  11936. <dd><p>Sets maximum input buffer size in bytes. If the buffering reaches this value,
  11937. incoming frames will be dropped.
  11938. Defaults to &lsquo;<samp class="samp">1073741824</samp>&rsquo;.
  11939. </p>
  11940. </dd>
  11941. <dt><samp class="option">audio_depth</samp></dt>
  11942. <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;.
  11943. Defaults to &lsquo;<samp class="samp">16</samp>&rsquo;.
  11944. </p>
  11945. </dd>
  11946. <dt><samp class="option">decklink_copyts</samp></dt>
  11947. <dd><p>If set to <samp class="option">true</samp>, timestamps are forwarded as they are without removing
  11948. the initial offset.
  11949. Defaults to <samp class="option">false</samp>.
  11950. </p>
  11951. </dd>
  11952. <dt><samp class="option">timestamp_align</samp></dt>
  11953. <dd><p>Capture start time alignment in seconds. If set to nonzero, input frames are
  11954. dropped till the system timestamp aligns with configured value.
  11955. Alignment difference of up to one frame duration is tolerated.
  11956. This is useful for maintaining input synchronization across N different
  11957. hardware devices deployed for &rsquo;N-way&rsquo; redundancy. The system time of different
  11958. hardware devices should be synchronized with protocols such as NTP or PTP,
  11959. before using this option.
  11960. Note that this method is not foolproof. In some border cases input
  11961. synchronization may not happen due to thread scheduling jitters in the OS.
  11962. Either sync could go wrong by 1 frame or in a rarer case
  11963. <samp class="option">timestamp_align</samp> seconds.
  11964. Defaults to &lsquo;<samp class="samp">0</samp>&rsquo;.
  11965. </p>
  11966. </dd>
  11967. <dt><samp class="option">wait_for_tc (<em class="emph">bool</em>)</samp></dt>
  11968. <dd><p>Drop frames till a frame with timecode is received. Sometimes serial timecode
  11969. isn&rsquo;t received with the first input frame. If that happens, the stored stream
  11970. timecode will be inaccurate. If this option is set to <samp class="option">true</samp>, input frames
  11971. are dropped till a frame with timecode is received.
  11972. Option <var class="var">timecode_format</var> must be specified.
  11973. Defaults to <samp class="option">false</samp>.
  11974. </p>
  11975. </dd>
  11976. <dt><samp class="option">enable_klv(<em class="emph">bool</em>)</samp></dt>
  11977. <dd><p>If set to <samp class="option">true</samp>, extracts KLV data from VANC and outputs KLV packets.
  11978. KLV VANC packets are joined based on MID and PSC fields and aggregated into
  11979. one KLV packet.
  11980. Defaults to <samp class="option">false</samp>.
  11981. </p>
  11982. </dd>
  11983. </dl>
  11984. </div>
  11985. <div class="subsection-level-extent" id="Examples-9">
  11986. <h4 class="subsection"><span>18.5.2 Examples<a class="copiable-link" href="#Examples-9"> &para;</a></span></h4>
  11987. <ul class="itemize mark-bullet">
  11988. <li>List input devices:
  11989. <div class="example">
  11990. <pre class="example-preformatted">ffmpeg -sources decklink
  11991. </pre></div>
  11992. </li><li>List supported formats:
  11993. <div class="example">
  11994. <pre class="example-preformatted">ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
  11995. </pre></div>
  11996. </li><li>Capture video clip at 1080i50:
  11997. <div class="example">
  11998. <pre class="example-preformatted">ffmpeg -format_code Hi50 -f decklink -i 'Intensity Pro' -c:a copy -c:v copy output.avi
  11999. </pre></div>
  12000. </li><li>Capture video clip at 1080i50 10 bit:
  12001. <div class="example">
  12002. <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
  12003. </pre></div>
  12004. </li><li>Capture video clip at 1080i50 with 16 audio channels:
  12005. <div class="example">
  12006. <pre class="example-preformatted">ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
  12007. </pre></div>
  12008. </li></ul>
  12009. </div>
  12010. </div>
  12011. <div class="section-level-extent" id="dshow">
  12012. <h3 class="section"><span>18.6 dshow<a class="copiable-link" href="#dshow"> &para;</a></span></h3>
  12013. <p>Windows DirectShow input device.
  12014. </p>
  12015. <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
  12016. Currently only audio and video devices are supported.
  12017. </p>
  12018. <p>Multiple devices may be opened as separate inputs, but they may also be
  12019. opened on the same input, which should improve synchronism between them.
  12020. </p>
  12021. <p>The input name should be in the format:
  12022. </p>
  12023. <div class="example">
  12024. <pre class="example-preformatted"><var class="var">TYPE</var>=<var class="var">NAME</var>[:<var class="var">TYPE</var>=<var class="var">NAME</var>]
  12025. </pre></div>
  12026. <p>where <var class="var">TYPE</var> can be either <var class="var">audio</var> or <var class="var">video</var>,
  12027. and <var class="var">NAME</var> is the device&rsquo;s name or alternative name..
  12028. </p>
  12029. <ul class="mini-toc">
  12030. <li><a href="#Options-21" accesskey="1">Options</a></li>
  12031. <li><a href="#Examples-10" accesskey="2">Examples</a></li>
  12032. </ul>
  12033. <div class="subsection-level-extent" id="Options-21">
  12034. <h4 class="subsection"><span>18.6.1 Options<a class="copiable-link" href="#Options-21"> &para;</a></span></h4>
  12035. <p>If no options are specified, the device&rsquo;s defaults are used.
  12036. If the device does not support the requested options, it will
  12037. fail to open.
  12038. </p>
  12039. <dl class="table">
  12040. <dt><samp class="option">video_size</samp></dt>
  12041. <dd><p>Set the video size in the captured video.
  12042. </p>
  12043. </dd>
  12044. <dt><samp class="option">framerate</samp></dt>
  12045. <dd><p>Set the frame rate in the captured video.
  12046. </p>
  12047. </dd>
  12048. <dt><samp class="option">sample_rate</samp></dt>
  12049. <dd><p>Set the sample rate (in Hz) of the captured audio.
  12050. </p>
  12051. </dd>
  12052. <dt><samp class="option">sample_size</samp></dt>
  12053. <dd><p>Set the sample size (in bits) of the captured audio.
  12054. </p>
  12055. </dd>
  12056. <dt><samp class="option">channels</samp></dt>
  12057. <dd><p>Set the number of channels in the captured audio.
  12058. </p>
  12059. </dd>
  12060. <dt><samp class="option">list_devices</samp></dt>
  12061. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  12062. </p>
  12063. </dd>
  12064. <dt><samp class="option">list_options</samp></dt>
  12065. <dd><p>If set to <samp class="option">true</samp>, print a list of selected device&rsquo;s options
  12066. and exit.
  12067. </p>
  12068. </dd>
  12069. <dt><samp class="option">video_device_number</samp></dt>
  12070. <dd><p>Set video device number for devices with the same name (starts at 0,
  12071. defaults to 0).
  12072. </p>
  12073. </dd>
  12074. <dt><samp class="option">audio_device_number</samp></dt>
  12075. <dd><p>Set audio device number for devices with the same name (starts at 0,
  12076. defaults to 0).
  12077. </p>
  12078. </dd>
  12079. <dt><samp class="option">pixel_format</samp></dt>
  12080. <dd><p>Select pixel format to be used by DirectShow. This may only be set when
  12081. the video codec is not set or set to rawvideo.
  12082. </p>
  12083. </dd>
  12084. <dt><samp class="option">audio_buffer_size</samp></dt>
  12085. <dd><p>Set audio device buffer size in milliseconds (which can directly
  12086. impact latency, depending on the device).
  12087. Defaults to using the audio device&rsquo;s
  12088. default buffer size (typically some multiple of 500ms).
  12089. Setting this value too low can degrade performance.
  12090. See also
  12091. <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>
  12092. </p>
  12093. </dd>
  12094. <dt><samp class="option">video_pin_name</samp></dt>
  12095. <dd><p>Select video capture pin to use by name or alternative name.
  12096. </p>
  12097. </dd>
  12098. <dt><samp class="option">audio_pin_name</samp></dt>
  12099. <dd><p>Select audio capture pin to use by name or alternative name.
  12100. </p>
  12101. </dd>
  12102. <dt><samp class="option">crossbar_video_input_pin_number</samp></dt>
  12103. <dd><p>Select video input pin number for crossbar device. This will be
  12104. routed to the crossbar device&rsquo;s Video Decoder output pin.
  12105. Note that changing this value can affect future invocations
  12106. (sets a new default) until system reboot occurs.
  12107. </p>
  12108. </dd>
  12109. <dt><samp class="option">crossbar_audio_input_pin_number</samp></dt>
  12110. <dd><p>Select audio input pin number for crossbar device. This will be
  12111. routed to the crossbar device&rsquo;s Audio Decoder output pin.
  12112. Note that changing this value can affect future invocations
  12113. (sets a new default) until system reboot occurs.
  12114. </p>
  12115. </dd>
  12116. <dt><samp class="option">show_video_device_dialog</samp></dt>
  12117. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display dialog
  12118. to the end user, allowing them to change video filter properties
  12119. and configurations manually.
  12120. Note that for crossbar devices, adjusting values in this dialog
  12121. may be needed at times to toggle between PAL (25 fps) and NTSC (29.97)
  12122. input frame rates, sizes, interlacing, etc. Changing these values can
  12123. enable different scan rates/frame rates and avoiding green bars at
  12124. the bottom, flickering scan lines, etc.
  12125. Note that with some devices, changing these properties can also affect future
  12126. invocations (sets new defaults) until system reboot occurs.
  12127. </p>
  12128. </dd>
  12129. <dt><samp class="option">show_audio_device_dialog</samp></dt>
  12130. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display dialog
  12131. to the end user, allowing them to change audio filter properties
  12132. and configurations manually.
  12133. </p>
  12134. </dd>
  12135. <dt><samp class="option">show_video_crossbar_connection_dialog</samp></dt>
  12136. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  12137. dialog to the end user, allowing them to manually
  12138. modify crossbar pin routings, when it opens a video device.
  12139. </p>
  12140. </dd>
  12141. <dt><samp class="option">show_audio_crossbar_connection_dialog</samp></dt>
  12142. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  12143. dialog to the end user, allowing them to manually
  12144. modify crossbar pin routings, when it opens an audio device.
  12145. </p>
  12146. </dd>
  12147. <dt><samp class="option">show_analog_tv_tuner_dialog</samp></dt>
  12148. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  12149. dialog to the end user, allowing them to manually
  12150. modify TV channels and frequencies.
  12151. </p>
  12152. </dd>
  12153. <dt><samp class="option">show_analog_tv_tuner_audio_dialog</samp></dt>
  12154. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  12155. dialog to the end user, allowing them to manually
  12156. modify TV audio (like mono vs. stereo, Language A,B or C).
  12157. </p>
  12158. </dd>
  12159. <dt><samp class="option">audio_device_load</samp></dt>
  12160. <dd><p>Load an audio capture filter device from file instead of searching
  12161. it by name. It may load additional parameters too, if the filter
  12162. supports the serialization of its properties to.
  12163. To use this an audio capture source has to be specified, but it can
  12164. be anything even fake one.
  12165. </p>
  12166. </dd>
  12167. <dt><samp class="option">audio_device_save</samp></dt>
  12168. <dd><p>Save the currently used audio capture filter device and its
  12169. parameters (if the filter supports it) to a file.
  12170. If a file with the same name exists it will be overwritten.
  12171. </p>
  12172. </dd>
  12173. <dt><samp class="option">video_device_load</samp></dt>
  12174. <dd><p>Load a video capture filter device from file instead of searching
  12175. it by name. It may load additional parameters too, if the filter
  12176. supports the serialization of its properties to.
  12177. To use this a video capture source has to be specified, but it can
  12178. be anything even fake one.
  12179. </p>
  12180. </dd>
  12181. <dt><samp class="option">video_device_save</samp></dt>
  12182. <dd><p>Save the currently used video capture filter device and its
  12183. parameters (if the filter supports it) to a file.
  12184. If a file with the same name exists it will be overwritten.
  12185. </p>
  12186. </dd>
  12187. <dt><samp class="option">use_video_device_timestamps</samp></dt>
  12188. <dd><p>If set to <samp class="option">false</samp>, the timestamp for video frames will be
  12189. derived from the wallclock instead of the timestamp provided by
  12190. the capture device. This allows working around devices that
  12191. provide unreliable timestamps.
  12192. </p>
  12193. </dd>
  12194. </dl>
  12195. </div>
  12196. <div class="subsection-level-extent" id="Examples-10">
  12197. <h4 class="subsection"><span>18.6.2 Examples<a class="copiable-link" href="#Examples-10"> &para;</a></span></h4>
  12198. <ul class="itemize mark-bullet">
  12199. <li>Print the list of DirectShow supported devices and exit:
  12200. <div class="example">
  12201. <pre class="example-preformatted">$ ffmpeg -list_devices true -f dshow -i dummy
  12202. </pre></div>
  12203. </li><li>Open video device <var class="var">Camera</var>:
  12204. <div class="example">
  12205. <pre class="example-preformatted">$ ffmpeg -f dshow -i video=&quot;Camera&quot;
  12206. </pre></div>
  12207. </li><li>Open second video device with name <var class="var">Camera</var>:
  12208. <div class="example">
  12209. <pre class="example-preformatted">$ ffmpeg -f dshow -video_device_number 1 -i video=&quot;Camera&quot;
  12210. </pre></div>
  12211. </li><li>Open video device <var class="var">Camera</var> and audio device <var class="var">Microphone</var>:
  12212. <div class="example">
  12213. <pre class="example-preformatted">$ ffmpeg -f dshow -i video=&quot;Camera&quot;:audio=&quot;Microphone&quot;
  12214. </pre></div>
  12215. </li><li>Print the list of supported options in selected device and exit:
  12216. <div class="example">
  12217. <pre class="example-preformatted">$ ffmpeg -list_options true -f dshow -i video=&quot;Camera&quot;
  12218. </pre></div>
  12219. </li><li>Specify pin names to capture by name or alternative name, specify alternative device name:
  12220. <div class="example">
  12221. <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;
  12222. </pre></div>
  12223. </li><li>Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup:
  12224. <div class="example">
  12225. <pre class="example-preformatted">$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
  12226. -crossbar_audio_input_pin_number 3 -i video=&quot;AVerMedia BDA Analog Capture&quot;:audio=&quot;AVerMedia BDA Analog Capture&quot;
  12227. </pre></div>
  12228. </li></ul>
  12229. </div>
  12230. </div>
  12231. <div class="section-level-extent" id="fbdev">
  12232. <h3 class="section"><span>18.7 fbdev<a class="copiable-link" href="#fbdev"> &para;</a></span></h3>
  12233. <p>Linux framebuffer input device.
  12234. </p>
  12235. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  12236. layer to show graphics on a computer monitor, typically on the
  12237. console. It is accessed through a file device node, usually
  12238. <samp class="file">/dev/fb0</samp>.
  12239. </p>
  12240. <p>For more detailed information read the file
  12241. Documentation/fb/framebuffer.txt included in the Linux source tree.
  12242. </p>
  12243. <p>See also <a class="url" href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  12244. </p>
  12245. <p>To record from the framebuffer device <samp class="file">/dev/fb0</samp> with
  12246. <code class="command">ffmpeg</code>:
  12247. </p><div class="example">
  12248. <pre class="example-preformatted">ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
  12249. </pre></div>
  12250. <p>You can take a single screenshot image with the command:
  12251. </p><div class="example">
  12252. <pre class="example-preformatted">ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
  12253. </pre></div>
  12254. <ul class="mini-toc">
  12255. <li><a href="#Options-22" accesskey="1">Options</a></li>
  12256. </ul>
  12257. <div class="subsection-level-extent" id="Options-22">
  12258. <h4 class="subsection"><span>18.7.1 Options<a class="copiable-link" href="#Options-22"> &para;</a></span></h4>
  12259. <dl class="table">
  12260. <dt><samp class="option">framerate</samp></dt>
  12261. <dd><p>Set the frame rate. Default is 25.
  12262. </p>
  12263. </dd>
  12264. </dl>
  12265. </div>
  12266. </div>
  12267. <div class="section-level-extent" id="gdigrab">
  12268. <h3 class="section"><span>18.8 gdigrab<a class="copiable-link" href="#gdigrab"> &para;</a></span></h3>
  12269. <p>Win32 GDI-based screen capture device.
  12270. </p>
  12271. <p>This device allows you to capture a region of the display on Windows.
  12272. </p>
  12273. <p>Amongst options for the imput filenames are such elements as:
  12274. </p><div class="example">
  12275. <pre class="example-preformatted">desktop
  12276. </pre></div>
  12277. <p>or
  12278. </p><div class="example">
  12279. <pre class="example-preformatted">title=<var class="var">window_title</var>
  12280. </pre></div>
  12281. <p>or
  12282. </p><div class="example">
  12283. <pre class="example-preformatted">hwnd=<var class="var">window_hwnd</var>
  12284. </pre></div>
  12285. <p>The first option will capture the entire desktop, or a fixed region of the
  12286. desktop. The second and third options will instead capture the contents of a single
  12287. window, regardless of its position on the screen.
  12288. </p>
  12289. <p>For example, to grab the entire desktop using <code class="command">ffmpeg</code>:
  12290. </p><div class="example">
  12291. <pre class="example-preformatted">ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
  12292. </pre></div>
  12293. <p>Grab a 640x480 region at position <code class="code">10,20</code>:
  12294. </p><div class="example">
  12295. <pre class="example-preformatted">ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
  12296. </pre></div>
  12297. <p>Grab the contents of the window named &quot;Calculator&quot;
  12298. </p><div class="example">
  12299. <pre class="example-preformatted">ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
  12300. </pre></div>
  12301. <ul class="mini-toc">
  12302. <li><a href="#Options-23" accesskey="1">Options</a></li>
  12303. </ul>
  12304. <div class="subsection-level-extent" id="Options-23">
  12305. <h4 class="subsection"><span>18.8.1 Options<a class="copiable-link" href="#Options-23"> &para;</a></span></h4>
  12306. <dl class="table">
  12307. <dt><samp class="option">draw_mouse</samp></dt>
  12308. <dd><p>Specify whether to draw the mouse pointer. Use the value <code class="code">0</code> to
  12309. not draw the pointer. Default value is <code class="code">1</code>.
  12310. </p>
  12311. </dd>
  12312. <dt><samp class="option">framerate</samp></dt>
  12313. <dd><p>Set the grabbing frame rate. Default value is <code class="code">ntsc</code>,
  12314. corresponding to a frame rate of <code class="code">30000/1001</code>.
  12315. </p>
  12316. </dd>
  12317. <dt><samp class="option">show_region</samp></dt>
  12318. <dd><p>Show grabbed region on screen.
  12319. </p>
  12320. <p>If <var class="var">show_region</var> is specified with <code class="code">1</code>, then the grabbing
  12321. region will be indicated on screen. With this option, it is easy to
  12322. know what is being grabbed if only a portion of the screen is grabbed.
  12323. </p>
  12324. <p>Note that <var class="var">show_region</var> is incompatible with grabbing the contents
  12325. of a single window.
  12326. </p>
  12327. <p>For example:
  12328. </p><div class="example">
  12329. <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
  12330. </pre></div>
  12331. </dd>
  12332. <dt><samp class="option">video_size</samp></dt>
  12333. <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.
  12334. </p>
  12335. </dd>
  12336. <dt><samp class="option">offset_x</samp></dt>
  12337. <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.
  12338. </p>
  12339. <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.
  12340. </p>
  12341. </dd>
  12342. <dt><samp class="option">offset_y</samp></dt>
  12343. <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.
  12344. </p>
  12345. <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.
  12346. </p>
  12347. </dd>
  12348. </dl>
  12349. </div>
  12350. </div>
  12351. <div class="section-level-extent" id="iec61883">
  12352. <h3 class="section"><span>18.9 iec61883<a class="copiable-link" href="#iec61883"> &para;</a></span></h3>
  12353. <p>FireWire DV/HDV input device using libiec61883.
  12354. </p>
  12355. <p>To enable this input device, you need libiec61883, libraw1394 and
  12356. libavc1394 installed on your system. Use the configure option
  12357. <code class="code">--enable-libiec61883</code> to compile with the device enabled.
  12358. </p>
  12359. <p>The iec61883 capture device supports capturing from a video device
  12360. connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
  12361. FireWire stack (juju). This is the default DV/HDV input method in Linux
  12362. Kernel 2.6.37 and later, since the old FireWire stack was removed.
  12363. </p>
  12364. <p>Specify the FireWire port to be used as input file, or &quot;auto&quot;
  12365. to choose the first port connected.
  12366. </p>
  12367. <ul class="mini-toc">
  12368. <li><a href="#Options-24" accesskey="1">Options</a></li>
  12369. <li><a href="#Examples-11" accesskey="2">Examples</a></li>
  12370. </ul>
  12371. <div class="subsection-level-extent" id="Options-24">
  12372. <h4 class="subsection"><span>18.9.1 Options<a class="copiable-link" href="#Options-24"> &para;</a></span></h4>
  12373. <dl class="table">
  12374. <dt><samp class="option">dvtype</samp></dt>
  12375. <dd><p>Override autodetection of DV/HDV. This should only be used if auto
  12376. detection does not work, or if usage of a different device type
  12377. should be prohibited. Treating a DV device as HDV (or vice versa) will
  12378. not work and result in undefined behavior.
  12379. The values <samp class="option">auto</samp>, <samp class="option">dv</samp> and <samp class="option">hdv</samp> are supported.
  12380. </p>
  12381. </dd>
  12382. <dt><samp class="option">dvbuffer</samp></dt>
  12383. <dd><p>Set maximum size of buffer for incoming data, in frames. For DV, this
  12384. is an exact value. For HDV, it is not frame exact, since HDV does
  12385. not have a fixed frame size.
  12386. </p>
  12387. </dd>
  12388. <dt><samp class="option">dvguid</samp></dt>
  12389. <dd><p>Select the capture device by specifying its GUID. Capturing will only
  12390. be performed from the specified device and fails if no device with the
  12391. given GUID is found. This is useful to select the input if multiple
  12392. devices are connected at the same time.
  12393. Look at /sys/bus/firewire/devices to find out the GUIDs.
  12394. </p>
  12395. </dd>
  12396. </dl>
  12397. </div>
  12398. <div class="subsection-level-extent" id="Examples-11">
  12399. <h4 class="subsection"><span>18.9.2 Examples<a class="copiable-link" href="#Examples-11"> &para;</a></span></h4>
  12400. <ul class="itemize mark-bullet">
  12401. <li>Grab and show the input of a FireWire DV/HDV device.
  12402. <div class="example">
  12403. <pre class="example-preformatted">ffplay -f iec61883 -i auto
  12404. </pre></div>
  12405. </li><li>Grab and record the input of a FireWire DV/HDV device,
  12406. using a packet buffer of 100000 packets if the source is HDV.
  12407. <div class="example">
  12408. <pre class="example-preformatted">ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
  12409. </pre></div>
  12410. </li></ul>
  12411. </div>
  12412. </div>
  12413. <div class="section-level-extent" id="jack">
  12414. <h3 class="section"><span>18.10 jack<a class="copiable-link" href="#jack"> &para;</a></span></h3>
  12415. <p>JACK input device.
  12416. </p>
  12417. <p>To enable this input device during configuration you need libjack
  12418. installed on your system.
  12419. </p>
  12420. <p>A JACK input device creates one or more JACK writable clients, one for
  12421. each audio channel, with name <var class="var">client_name</var>:input_<var class="var">N</var>, where
  12422. <var class="var">client_name</var> is the name provided by the application, and <var class="var">N</var>
  12423. is a number which identifies the channel.
  12424. Each writable client will send the acquired data to the FFmpeg input
  12425. device.
  12426. </p>
  12427. <p>Once you have created one or more JACK readable clients, you need to
  12428. connect them to one or more JACK writable clients.
  12429. </p>
  12430. <p>To connect or disconnect JACK clients you can use the <code class="command">jack_connect</code>
  12431. and <code class="command">jack_disconnect</code> programs, or do it through a graphical interface,
  12432. for example with <code class="command">qjackctl</code>.
  12433. </p>
  12434. <p>To list the JACK clients and their properties you can invoke the command
  12435. <code class="command">jack_lsp</code>.
  12436. </p>
  12437. <p>Follows an example which shows how to capture a JACK readable client
  12438. with <code class="command">ffmpeg</code>.
  12439. </p><div class="example">
  12440. <pre class="example-preformatted"># Create a JACK writable client with name &quot;ffmpeg&quot;.
  12441. $ ffmpeg -f jack -i ffmpeg -y out.wav
  12442. # Start the sample jack_metro readable client.
  12443. $ jack_metro -b 120 -d 0.2 -f 4000
  12444. # List the current JACK clients.
  12445. $ jack_lsp -c
  12446. system:capture_1
  12447. system:capture_2
  12448. system:playback_1
  12449. system:playback_2
  12450. ffmpeg:input_1
  12451. metro:120_bpm
  12452. # Connect metro to the ffmpeg writable client.
  12453. $ jack_connect metro:120_bpm ffmpeg:input_1
  12454. </pre></div>
  12455. <p>For more information read:
  12456. <a class="url" href="http://jackaudio.org/">http://jackaudio.org/</a>
  12457. </p>
  12458. <ul class="mini-toc">
  12459. <li><a href="#Options-25" accesskey="1">Options</a></li>
  12460. </ul>
  12461. <div class="subsection-level-extent" id="Options-25">
  12462. <h4 class="subsection"><span>18.10.1 Options<a class="copiable-link" href="#Options-25"> &para;</a></span></h4>
  12463. <dl class="table">
  12464. <dt><samp class="option">channels</samp></dt>
  12465. <dd><p>Set the number of channels. Default is 2.
  12466. </p>
  12467. </dd>
  12468. </dl>
  12469. </div>
  12470. </div>
  12471. <div class="section-level-extent" id="kmsgrab">
  12472. <h3 class="section"><span>18.11 kmsgrab<a class="copiable-link" href="#kmsgrab"> &para;</a></span></h3>
  12473. <p>KMS video input device.
  12474. </p>
  12475. <p>Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a
  12476. DRM object that can be passed to other hardware functions.
  12477. </p>
  12478. <p>Requires either DRM master or CAP_SYS_ADMIN to run.
  12479. </p>
  12480. <p>If you don&rsquo;t understand what all of that means, you probably don&rsquo;t want this. Look at
  12481. <samp class="option">x11grab</samp> instead.
  12482. </p>
  12483. <ul class="mini-toc">
  12484. <li><a href="#Options-26" accesskey="1">Options</a></li>
  12485. <li><a href="#Examples-12" accesskey="2">Examples</a></li>
  12486. </ul>
  12487. <div class="subsection-level-extent" id="Options-26">
  12488. <h4 class="subsection"><span>18.11.1 Options<a class="copiable-link" href="#Options-26"> &para;</a></span></h4>
  12489. <dl class="table">
  12490. <dt><samp class="option">device</samp></dt>
  12491. <dd><p>DRM device to capture on. Defaults to <samp class="option">/dev/dri/card0</samp>.
  12492. </p>
  12493. </dd>
  12494. <dt><samp class="option">format</samp></dt>
  12495. <dd><p>Pixel format of the framebuffer. This can be autodetected if you are running Linux 5.7
  12496. or later, but needs to be provided for earlier versions. Defaults to <samp class="option">bgr0</samp>,
  12497. which is the most common format used by the Linux console and Xorg X server.
  12498. </p>
  12499. </dd>
  12500. <dt><samp class="option">format_modifier</samp></dt>
  12501. <dd><p>Format modifier to signal on output frames. This is necessary to import correctly into
  12502. some APIs. It can be autodetected if you are running Linux 5.7 or later, but will need
  12503. to be provided explicitly when needed in earlier versions. See the libdrm documentation
  12504. for possible values.
  12505. </p>
  12506. </dd>
  12507. <dt><samp class="option">crtc_id</samp></dt>
  12508. <dd><p>KMS CRTC ID to define the capture source. The first active plane on the given CRTC
  12509. will be used.
  12510. </p>
  12511. </dd>
  12512. <dt><samp class="option">plane_id</samp></dt>
  12513. <dd><p>KMS plane ID to define the capture source. Defaults to the first active plane found if
  12514. neither <samp class="option">crtc_id</samp> nor <samp class="option">plane_id</samp> are specified.
  12515. </p>
  12516. </dd>
  12517. <dt><samp class="option">framerate</samp></dt>
  12518. <dd><p>Framerate to capture at. This is not synchronised to any page flipping or framebuffer
  12519. changes - it just defines the interval at which the framebuffer is sampled. Sampling
  12520. faster than the framebuffer update rate will generate independent frames with the same
  12521. content. Defaults to <code class="code">30</code>.
  12522. </p>
  12523. </dd>
  12524. </dl>
  12525. </div>
  12526. <div class="subsection-level-extent" id="Examples-12">
  12527. <h4 class="subsection"><span>18.11.2 Examples<a class="copiable-link" href="#Examples-12"> &para;</a></span></h4>
  12528. <ul class="itemize mark-bullet">
  12529. <li>Capture from the first active plane, download the result to normal frames and encode.
  12530. This will only work if the framebuffer is both linear and mappable - if not, the result
  12531. may be scrambled or fail to download.
  12532. <div class="example">
  12533. <pre class="example-preformatted">ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
  12534. </pre></div>
  12535. </li><li>Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and encode as H.264.
  12536. <div class="example">
  12537. <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
  12538. </pre></div>
  12539. </li><li>To capture only part of a plane the output can be cropped - this can be used to capture
  12540. a single window, as long as it has a known absolute position and size. For example, to
  12541. capture and encode the middle quarter of a 1920x1080 plane:
  12542. <div class="example">
  12543. <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
  12544. </pre></div>
  12545. </li></ul>
  12546. </div>
  12547. </div>
  12548. <div class="section-level-extent" id="lavfi">
  12549. <h3 class="section"><span>18.12 lavfi<a class="copiable-link" href="#lavfi"> &para;</a></span></h3>
  12550. <p>Libavfilter input virtual device.
  12551. </p>
  12552. <p>This input device reads data from the open output pads of a libavfilter
  12553. filtergraph.
  12554. </p>
  12555. <p>For each filtergraph open output, the input device will create a
  12556. corresponding stream which is mapped to the generated output.
  12557. The filtergraph is specified through the option <samp class="option">graph</samp>.
  12558. </p>
  12559. <ul class="mini-toc">
  12560. <li><a href="#Options-27" accesskey="1">Options</a></li>
  12561. <li><a href="#Examples-13" accesskey="2">Examples</a></li>
  12562. </ul>
  12563. <div class="subsection-level-extent" id="Options-27">
  12564. <h4 class="subsection"><span>18.12.1 Options<a class="copiable-link" href="#Options-27"> &para;</a></span></h4>
  12565. <dl class="table">
  12566. <dt><samp class="option">graph</samp></dt>
  12567. <dd><p>Specify the filtergraph to use as input. Each video open output must be
  12568. labelled by a unique string of the form &quot;out<var class="var">N</var>&quot;, where <var class="var">N</var> is a
  12569. number starting from 0 corresponding to the mapped input stream
  12570. generated by the device.
  12571. The first unlabelled output is automatically assigned to the &quot;out0&quot;
  12572. label, but all the others need to be specified explicitly.
  12573. </p>
  12574. <p>The suffix &quot;+subcc&quot; can be appended to the output label to create an extra
  12575. stream with the closed captions packets attached to that output
  12576. (experimental; only for EIA-608 / CEA-708 for now).
  12577. The subcc streams are created after all the normal streams, in the order of
  12578. the corresponding stream.
  12579. For example, if there is &quot;out19+subcc&quot;, &quot;out7+subcc&quot; and up to &quot;out42&quot;, the
  12580. stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
  12581. </p>
  12582. <p>If not specified defaults to the filename specified for the input
  12583. device.
  12584. </p>
  12585. </dd>
  12586. <dt><samp class="option">graph_file</samp></dt>
  12587. <dd><p>Set the filename of the filtergraph to be read and sent to the other
  12588. filters. Syntax of the filtergraph is the same as the one specified by
  12589. the option <var class="var">graph</var>.
  12590. </p>
  12591. </dd>
  12592. <dt><samp class="option">dumpgraph</samp></dt>
  12593. <dd><p>Dump graph to stderr.
  12594. </p>
  12595. </dd>
  12596. </dl>
  12597. </div>
  12598. <div class="subsection-level-extent" id="Examples-13">
  12599. <h4 class="subsection"><span>18.12.2 Examples<a class="copiable-link" href="#Examples-13"> &para;</a></span></h4>
  12600. <ul class="itemize mark-bullet">
  12601. <li>Create a color video stream and play it back with <code class="command">ffplay</code>:
  12602. <div class="example">
  12603. <pre class="example-preformatted">ffplay -f lavfi -graph &quot;color=c=pink [out0]&quot; dummy
  12604. </pre></div>
  12605. </li><li>As the previous example, but use filename for specifying the graph
  12606. description, and omit the &quot;out0&quot; label:
  12607. <div class="example">
  12608. <pre class="example-preformatted">ffplay -f lavfi color=c=pink
  12609. </pre></div>
  12610. </li><li>Create three different video test filtered sources and play them:
  12611. <div class="example">
  12612. <pre class="example-preformatted">ffplay -f lavfi -graph &quot;testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]&quot; test3
  12613. </pre></div>
  12614. </li><li>Read an audio stream from a file using the amovie source and play it
  12615. back with <code class="command">ffplay</code>:
  12616. <div class="example">
  12617. <pre class="example-preformatted">ffplay -f lavfi &quot;amovie=test.wav&quot;
  12618. </pre></div>
  12619. </li><li>Read an audio stream and a video stream and play it back with
  12620. <code class="command">ffplay</code>:
  12621. <div class="example">
  12622. <pre class="example-preformatted">ffplay -f lavfi &quot;movie=test.avi[out0];amovie=test.wav[out1]&quot;
  12623. </pre></div>
  12624. </li><li>Dump decoded frames to images and closed captions to a file (experimental):
  12625. <div class="example">
  12626. <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 rawvideo subcc.bin
  12627. </pre></div>
  12628. </li></ul>
  12629. </div>
  12630. </div>
  12631. <div class="section-level-extent" id="libcdio">
  12632. <h3 class="section"><span>18.13 libcdio<a class="copiable-link" href="#libcdio"> &para;</a></span></h3>
  12633. <p>Audio-CD input device based on libcdio.
  12634. </p>
  12635. <p>To enable this input device during configuration you need libcdio
  12636. installed on your system. It requires the configure option
  12637. <code class="code">--enable-libcdio</code>.
  12638. </p>
  12639. <p>This device allows playing and grabbing from an Audio-CD.
  12640. </p>
  12641. <p>For example to copy with <code class="command">ffmpeg</code> the entire Audio-CD in <samp class="file">/dev/sr0</samp>,
  12642. you may run the command:
  12643. </p><div class="example">
  12644. <pre class="example-preformatted">ffmpeg -f libcdio -i /dev/sr0 cd.wav
  12645. </pre></div>
  12646. <ul class="mini-toc">
  12647. <li><a href="#Options-28" accesskey="1">Options</a></li>
  12648. </ul>
  12649. <div class="subsection-level-extent" id="Options-28">
  12650. <h4 class="subsection"><span>18.13.1 Options<a class="copiable-link" href="#Options-28"> &para;</a></span></h4>
  12651. <dl class="table">
  12652. <dt><samp class="option">speed</samp></dt>
  12653. <dd><p>Set drive reading speed. Default value is 0.
  12654. </p>
  12655. <p>The speed is specified CD-ROM speed units. The speed is set through
  12656. the libcdio <code class="code">cdio_cddap_speed_set</code> function. On many CD-ROM
  12657. drives, specifying a value too large will result in using the fastest
  12658. speed.
  12659. </p>
  12660. </dd>
  12661. <dt><samp class="option">paranoia_mode</samp></dt>
  12662. <dd><p>Set paranoia recovery mode flags. It accepts one of the following values:
  12663. </p>
  12664. <dl class="table">
  12665. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  12666. <dt>&lsquo;<samp class="samp">verify</samp>&rsquo;</dt>
  12667. <dt>&lsquo;<samp class="samp">overlap</samp>&rsquo;</dt>
  12668. <dt>&lsquo;<samp class="samp">neverskip</samp>&rsquo;</dt>
  12669. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  12670. </dl>
  12671. <p>Default value is &lsquo;<samp class="samp">disable</samp>&rsquo;.
  12672. </p>
  12673. <p>For more information about the available recovery modes, consult the
  12674. paranoia project documentation.
  12675. </p></dd>
  12676. </dl>
  12677. </div>
  12678. </div>
  12679. <div class="section-level-extent" id="libdc1394">
  12680. <h3 class="section"><span>18.14 libdc1394<a class="copiable-link" href="#libdc1394"> &para;</a></span></h3>
  12681. <p>IIDC1394 input device, based on libdc1394 and libraw1394.
  12682. </p>
  12683. <p>Requires the configure option <code class="code">--enable-libdc1394</code>.
  12684. </p>
  12685. <ul class="mini-toc">
  12686. <li><a href="#Options-29" accesskey="1">Options</a></li>
  12687. </ul>
  12688. <div class="subsection-level-extent" id="Options-29">
  12689. <h4 class="subsection"><span>18.14.1 Options<a class="copiable-link" href="#Options-29"> &para;</a></span></h4>
  12690. <dl class="table">
  12691. <dt><samp class="option">framerate</samp></dt>
  12692. <dd><p>Set the frame rate. Default is <code class="code">ntsc</code>, corresponding to a frame
  12693. rate of <code class="code">30000/1001</code>.
  12694. </p>
  12695. </dd>
  12696. <dt><samp class="option">pixel_format</samp></dt>
  12697. <dd><p>Select the pixel format. Default is <code class="code">uyvy422</code>.
  12698. </p>
  12699. </dd>
  12700. <dt><samp class="option">video_size</samp></dt>
  12701. <dd><p>Set the video size given as a string such as <code class="code">640x480</code> or <code class="code">hd720</code>.
  12702. Default is <code class="code">qvga</code>.
  12703. </p></dd>
  12704. </dl>
  12705. </div>
  12706. </div>
  12707. <div class="section-level-extent" id="openal">
  12708. <h3 class="section"><span>18.15 openal<a class="copiable-link" href="#openal"> &para;</a></span></h3>
  12709. <p>The OpenAL input device provides audio capture on all systems with a
  12710. working OpenAL 1.1 implementation.
  12711. </p>
  12712. <p>To enable this input device during configuration, you need OpenAL
  12713. headers and libraries installed on your system, and need to configure
  12714. FFmpeg with <code class="code">--enable-openal</code>.
  12715. </p>
  12716. <p>OpenAL headers and libraries should be provided as part of your OpenAL
  12717. implementation, or as an additional download (an SDK). Depending on your
  12718. installation you may need to specify additional flags via the
  12719. <code class="code">--extra-cflags</code> and <code class="code">--extra-ldflags</code> for allowing the build
  12720. system to locate the OpenAL headers and libraries.
  12721. </p>
  12722. <p>An incomplete list of OpenAL implementations follows:
  12723. </p>
  12724. <dl class="table">
  12725. <dt><strong class="strong">Creative</strong></dt>
  12726. <dd><p>The official Windows implementation, providing hardware acceleration
  12727. with supported devices and software fallback.
  12728. See <a class="url" href="http://openal.org/">http://openal.org/</a>.
  12729. </p></dd>
  12730. <dt><strong class="strong">OpenAL Soft</strong></dt>
  12731. <dd><p>Portable, open source (LGPL) software implementation. Includes
  12732. backends for the most common sound APIs on the Windows, Linux,
  12733. Solaris, and BSD operating systems.
  12734. See <a class="url" href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
  12735. </p></dd>
  12736. <dt><strong class="strong">Apple</strong></dt>
  12737. <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
  12738. 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>
  12739. </p></dd>
  12740. </dl>
  12741. <p>This device allows one to capture from an audio input device handled
  12742. through OpenAL.
  12743. </p>
  12744. <p>You need to specify the name of the device to capture in the provided
  12745. filename. If the empty string is provided, the device will
  12746. automatically select the default device. You can get the list of the
  12747. supported devices by using the option <var class="var">list_devices</var>.
  12748. </p>
  12749. <ul class="mini-toc">
  12750. <li><a href="#Options-30" accesskey="1">Options</a></li>
  12751. <li><a href="#Examples-14" accesskey="2">Examples</a></li>
  12752. </ul>
  12753. <div class="subsection-level-extent" id="Options-30">
  12754. <h4 class="subsection"><span>18.15.1 Options<a class="copiable-link" href="#Options-30"> &para;</a></span></h4>
  12755. <dl class="table">
  12756. <dt><samp class="option">channels</samp></dt>
  12757. <dd><p>Set the number of channels in the captured audio. Only the values
  12758. <samp class="option">1</samp> (monaural) and <samp class="option">2</samp> (stereo) are currently supported.
  12759. Defaults to <samp class="option">2</samp>.
  12760. </p>
  12761. </dd>
  12762. <dt><samp class="option">sample_size</samp></dt>
  12763. <dd><p>Set the sample size (in bits) of the captured audio. Only the values
  12764. <samp class="option">8</samp> and <samp class="option">16</samp> are currently supported. Defaults to
  12765. <samp class="option">16</samp>.
  12766. </p>
  12767. </dd>
  12768. <dt><samp class="option">sample_rate</samp></dt>
  12769. <dd><p>Set the sample rate (in Hz) of the captured audio.
  12770. Defaults to <samp class="option">44.1k</samp>.
  12771. </p>
  12772. </dd>
  12773. <dt><samp class="option">list_devices</samp></dt>
  12774. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  12775. Defaults to <samp class="option">false</samp>.
  12776. </p>
  12777. </dd>
  12778. </dl>
  12779. </div>
  12780. <div class="subsection-level-extent" id="Examples-14">
  12781. <h4 class="subsection"><span>18.15.2 Examples<a class="copiable-link" href="#Examples-14"> &para;</a></span></h4>
  12782. <p>Print the list of OpenAL supported devices and exit:
  12783. </p><div class="example">
  12784. <pre class="example-preformatted">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
  12785. </pre></div>
  12786. <p>Capture from the OpenAL device <samp class="file">DR-BT101 via PulseAudio</samp>:
  12787. </p><div class="example">
  12788. <pre class="example-preformatted">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
  12789. </pre></div>
  12790. <p>Capture from the default device (note the empty string &rdquo; as filename):
  12791. </p><div class="example">
  12792. <pre class="example-preformatted">$ ffmpeg -f openal -i '' out.ogg
  12793. </pre></div>
  12794. <p>Capture from two devices simultaneously, writing to two different files,
  12795. within the same <code class="command">ffmpeg</code> command:
  12796. </p><div class="example">
  12797. <pre class="example-preformatted">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
  12798. </pre></div>
  12799. <p>Note: not all OpenAL implementations support multiple simultaneous capture -
  12800. try the latest OpenAL Soft if the above does not work.
  12801. </p>
  12802. </div>
  12803. </div>
  12804. <div class="section-level-extent" id="oss">
  12805. <h3 class="section"><span>18.16 oss<a class="copiable-link" href="#oss"> &para;</a></span></h3>
  12806. <p>Open Sound System input device.
  12807. </p>
  12808. <p>The filename to provide to the input device is the device node
  12809. representing the OSS input device, and is usually set to
  12810. <samp class="file">/dev/dsp</samp>.
  12811. </p>
  12812. <p>For example to grab from <samp class="file">/dev/dsp</samp> using <code class="command">ffmpeg</code> use the
  12813. command:
  12814. </p><div class="example">
  12815. <pre class="example-preformatted">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
  12816. </pre></div>
  12817. <p>For more information about OSS see:
  12818. <a class="url" href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
  12819. </p>
  12820. <ul class="mini-toc">
  12821. <li><a href="#Options-31" accesskey="1">Options</a></li>
  12822. </ul>
  12823. <div class="subsection-level-extent" id="Options-31">
  12824. <h4 class="subsection"><span>18.16.1 Options<a class="copiable-link" href="#Options-31"> &para;</a></span></h4>
  12825. <dl class="table">
  12826. <dt><samp class="option">sample_rate</samp></dt>
  12827. <dd><p>Set the sample rate in Hz. Default is 48000.
  12828. </p>
  12829. </dd>
  12830. <dt><samp class="option">channels</samp></dt>
  12831. <dd><p>Set the number of channels. Default is 2.
  12832. </p>
  12833. </dd>
  12834. </dl>
  12835. </div>
  12836. </div>
  12837. <div class="section-level-extent" id="pulse">
  12838. <h3 class="section"><span>18.17 pulse<a class="copiable-link" href="#pulse"> &para;</a></span></h3>
  12839. <p>PulseAudio input device.
  12840. </p>
  12841. <p>To enable this output device you need to configure FFmpeg with <code class="code">--enable-libpulse</code>.
  12842. </p>
  12843. <p>The filename to provide to the input device is a source device or the
  12844. string &quot;default&quot;
  12845. </p>
  12846. <p>To list the PulseAudio source devices and their properties you can invoke
  12847. the command <code class="command">pactl list sources</code>.
  12848. </p>
  12849. <p>More information about PulseAudio can be found on <a class="url" href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
  12850. </p>
  12851. <ul class="mini-toc">
  12852. <li><a href="#Options-32" accesskey="1">Options</a></li>
  12853. <li><a href="#Examples-15" accesskey="2">Examples</a></li>
  12854. </ul>
  12855. <div class="subsection-level-extent" id="Options-32">
  12856. <h4 class="subsection"><span>18.17.1 Options<a class="copiable-link" href="#Options-32"> &para;</a></span></h4>
  12857. <dl class="table">
  12858. <dt><samp class="option">server</samp></dt>
  12859. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  12860. Default server is used when not provided.
  12861. </p>
  12862. </dd>
  12863. <dt><samp class="option">name</samp></dt>
  12864. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  12865. by default it is the <code class="code">LIBAVFORMAT_IDENT</code> string.
  12866. </p>
  12867. </dd>
  12868. <dt><samp class="option">stream_name</samp></dt>
  12869. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  12870. by default it is &quot;record&quot;.
  12871. </p>
  12872. </dd>
  12873. <dt><samp class="option">sample_rate</samp></dt>
  12874. <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
  12875. </p>
  12876. </dd>
  12877. <dt><samp class="option">channels</samp></dt>
  12878. <dd><p>Specify the channels in use, by default 2 (stereo) is set.
  12879. </p>
  12880. </dd>
  12881. <dt><samp class="option">frame_size</samp></dt>
  12882. <dd><p>This option does nothing and is deprecated.
  12883. </p>
  12884. </dd>
  12885. <dt><samp class="option">fragment_size</samp></dt>
  12886. <dd><p>Specify the size in bytes of the minimal buffering fragment in PulseAudio, it
  12887. will affect the audio latency. By default it is set to 50 ms amount of data.
  12888. </p>
  12889. </dd>
  12890. <dt><samp class="option">wallclock</samp></dt>
  12891. <dd><p>Set the initial PTS using the current time. Default is 1.
  12892. </p>
  12893. </dd>
  12894. </dl>
  12895. </div>
  12896. <div class="subsection-level-extent" id="Examples-15">
  12897. <h4 class="subsection"><span>18.17.2 Examples<a class="copiable-link" href="#Examples-15"> &para;</a></span></h4>
  12898. <p>Record a stream from default device:
  12899. </p><div class="example">
  12900. <pre class="example-preformatted">ffmpeg -f pulse -i default /tmp/pulse.wav
  12901. </pre></div>
  12902. </div>
  12903. </div>
  12904. <div class="section-level-extent" id="sndio">
  12905. <h3 class="section"><span>18.18 sndio<a class="copiable-link" href="#sndio"> &para;</a></span></h3>
  12906. <p>sndio input device.
  12907. </p>
  12908. <p>To enable this input device during configuration you need libsndio
  12909. installed on your system.
  12910. </p>
  12911. <p>The filename to provide to the input device is the device node
  12912. representing the sndio input device, and is usually set to
  12913. <samp class="file">/dev/audio0</samp>.
  12914. </p>
  12915. <p>For example to grab from <samp class="file">/dev/audio0</samp> using <code class="command">ffmpeg</code> use the
  12916. command:
  12917. </p><div class="example">
  12918. <pre class="example-preformatted">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
  12919. </pre></div>
  12920. <ul class="mini-toc">
  12921. <li><a href="#Options-33" accesskey="1">Options</a></li>
  12922. </ul>
  12923. <div class="subsection-level-extent" id="Options-33">
  12924. <h4 class="subsection"><span>18.18.1 Options<a class="copiable-link" href="#Options-33"> &para;</a></span></h4>
  12925. <dl class="table">
  12926. <dt><samp class="option">sample_rate</samp></dt>
  12927. <dd><p>Set the sample rate in Hz. Default is 48000.
  12928. </p>
  12929. </dd>
  12930. <dt><samp class="option">channels</samp></dt>
  12931. <dd><p>Set the number of channels. Default is 2.
  12932. </p>
  12933. </dd>
  12934. </dl>
  12935. </div>
  12936. </div>
  12937. <div class="section-level-extent" id="video4linux2_002c-v4l2">
  12938. <h3 class="section"><span>18.19 video4linux2, v4l2<a class="copiable-link" href="#video4linux2_002c-v4l2"> &para;</a></span></h3>
  12939. <p>Video4Linux2 input video device.
  12940. </p>
  12941. <p>&quot;v4l2&quot; can be used as alias for &quot;video4linux2&quot;.
  12942. </p>
  12943. <p>If FFmpeg is built with v4l-utils support (by using the
  12944. <code class="code">--enable-libv4l2</code> configure option), it is possible to use it with the
  12945. <code class="code">-use_libv4l2</code> input device option.
  12946. </p>
  12947. <p>The name of the device to grab is a file device node, usually Linux
  12948. systems tend to automatically create such nodes when the device
  12949. (e.g. an USB webcam) is plugged into the system, and has a name of the
  12950. kind <samp class="file">/dev/video<var class="var">N</var></samp>, where <var class="var">N</var> is a number associated to
  12951. the device.
  12952. </p>
  12953. <p>Video4Linux2 devices usually support a limited set of
  12954. <var class="var">width</var>x<var class="var">height</var> sizes and frame rates. You can check which are
  12955. supported using <code class="command">-list_formats all</code> for Video4Linux2 devices.
  12956. Some devices, like TV cards, support one or more standards. It is possible
  12957. to list all the supported standards using <code class="command">-list_standards all</code>.
  12958. </p>
  12959. <p>The time base for the timestamps is 1 microsecond. Depending on the kernel
  12960. version and configuration, the timestamps may be derived from the real time
  12961. clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
  12962. boot time, unaffected by NTP or manual changes to the clock). The
  12963. <samp class="option">-timestamps abs</samp> or <samp class="option">-ts abs</samp> option can be used to force
  12964. conversion into the real time clock.
  12965. </p>
  12966. <p>Some usage examples of the video4linux2 device with <code class="command">ffmpeg</code>
  12967. and <code class="command">ffplay</code>:
  12968. </p><ul class="itemize mark-bullet">
  12969. <li>List supported formats for a video4linux2 device:
  12970. <div class="example">
  12971. <pre class="example-preformatted">ffplay -f video4linux2 -list_formats all /dev/video0
  12972. </pre></div>
  12973. </li><li>Grab and show the input of a video4linux2 device:
  12974. <div class="example">
  12975. <pre class="example-preformatted">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
  12976. </pre></div>
  12977. </li><li>Grab and record the input of a video4linux2 device, leave the
  12978. frame rate and size as previously set:
  12979. <div class="example">
  12980. <pre class="example-preformatted">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
  12981. </pre></div>
  12982. </li></ul>
  12983. <p>For more information about Video4Linux, check <a class="url" href="http://linuxtv.org/">http://linuxtv.org/</a>.
  12984. </p>
  12985. <ul class="mini-toc">
  12986. <li><a href="#Options-34" accesskey="1">Options</a></li>
  12987. </ul>
  12988. <div class="subsection-level-extent" id="Options-34">
  12989. <h4 class="subsection"><span>18.19.1 Options<a class="copiable-link" href="#Options-34"> &para;</a></span></h4>
  12990. <dl class="table">
  12991. <dt><samp class="option">standard</samp></dt>
  12992. <dd><p>Set the standard. Must be the name of a supported standard. To get a
  12993. list of the supported standards, use the <samp class="option">list_standards</samp>
  12994. option.
  12995. </p>
  12996. </dd>
  12997. <dt><samp class="option">channel</samp></dt>
  12998. <dd><p>Set the input channel number. Default to -1, which means using the
  12999. previously selected channel.
  13000. </p>
  13001. </dd>
  13002. <dt><samp class="option">video_size</samp></dt>
  13003. <dd><p>Set the video frame size. The argument must be a string in the form
  13004. <var class="var">WIDTH</var>x<var class="var">HEIGHT</var> or a valid size abbreviation.
  13005. </p>
  13006. </dd>
  13007. <dt><samp class="option">pixel_format</samp></dt>
  13008. <dd><p>Select the pixel format (only valid for raw video input).
  13009. </p>
  13010. </dd>
  13011. <dt><samp class="option">input_format</samp></dt>
  13012. <dd><p>Set the preferred pixel format (for raw video) or a codec name.
  13013. This option allows one to select the input format, when several are
  13014. available.
  13015. </p>
  13016. </dd>
  13017. <dt><samp class="option">framerate</samp></dt>
  13018. <dd><p>Set the preferred video frame rate.
  13019. </p>
  13020. </dd>
  13021. <dt><samp class="option">list_formats</samp></dt>
  13022. <dd><p>List available formats (supported pixel formats, codecs, and frame
  13023. sizes) and exit.
  13024. </p>
  13025. <p>Available values are:
  13026. </p><dl class="table">
  13027. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  13028. <dd><p>Show all available (compressed and non-compressed) formats.
  13029. </p>
  13030. </dd>
  13031. <dt>&lsquo;<samp class="samp">raw</samp>&rsquo;</dt>
  13032. <dd><p>Show only raw video (non-compressed) formats.
  13033. </p>
  13034. </dd>
  13035. <dt>&lsquo;<samp class="samp">compressed</samp>&rsquo;</dt>
  13036. <dd><p>Show only compressed formats.
  13037. </p></dd>
  13038. </dl>
  13039. </dd>
  13040. <dt><samp class="option">list_standards</samp></dt>
  13041. <dd><p>List supported standards and exit.
  13042. </p>
  13043. <p>Available values are:
  13044. </p><dl class="table">
  13045. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  13046. <dd><p>Show all supported standards.
  13047. </p></dd>
  13048. </dl>
  13049. </dd>
  13050. <dt><samp class="option">timestamps, ts</samp></dt>
  13051. <dd><p>Set type of timestamps for grabbed frames.
  13052. </p>
  13053. <p>Available values are:
  13054. </p><dl class="table">
  13055. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  13056. <dd><p>Use timestamps from the kernel.
  13057. </p>
  13058. </dd>
  13059. <dt>&lsquo;<samp class="samp">abs</samp>&rsquo;</dt>
  13060. <dd><p>Use absolute timestamps (wall clock).
  13061. </p>
  13062. </dd>
  13063. <dt>&lsquo;<samp class="samp">mono2abs</samp>&rsquo;</dt>
  13064. <dd><p>Force conversion from monotonic to absolute timestamps.
  13065. </p></dd>
  13066. </dl>
  13067. <p>Default value is <code class="code">default</code>.
  13068. </p>
  13069. </dd>
  13070. <dt><samp class="option">use_libv4l2</samp></dt>
  13071. <dd><p>Use libv4l2 (v4l-utils) conversion functions. Default is 0.
  13072. </p>
  13073. </dd>
  13074. </dl>
  13075. </div>
  13076. </div>
  13077. <div class="section-level-extent" id="vfwcap">
  13078. <h3 class="section"><span>18.20 vfwcap<a class="copiable-link" href="#vfwcap"> &para;</a></span></h3>
  13079. <p>VfW (Video for Windows) capture input device.
  13080. </p>
  13081. <p>The filename passed as input is the capture driver number, ranging from
  13082. 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
  13083. other filename will be interpreted as device number 0.
  13084. </p>
  13085. <ul class="mini-toc">
  13086. <li><a href="#Options-35" accesskey="1">Options</a></li>
  13087. </ul>
  13088. <div class="subsection-level-extent" id="Options-35">
  13089. <h4 class="subsection"><span>18.20.1 Options<a class="copiable-link" href="#Options-35"> &para;</a></span></h4>
  13090. <dl class="table">
  13091. <dt><samp class="option">video_size</samp></dt>
  13092. <dd><p>Set the video frame size.
  13093. </p>
  13094. </dd>
  13095. <dt><samp class="option">framerate</samp></dt>
  13096. <dd><p>Set the grabbing frame rate. Default value is <code class="code">ntsc</code>,
  13097. corresponding to a frame rate of <code class="code">30000/1001</code>.
  13098. </p>
  13099. </dd>
  13100. </dl>
  13101. </div>
  13102. </div>
  13103. <div class="section-level-extent" id="x11grab">
  13104. <h3 class="section"><span>18.21 x11grab<a class="copiable-link" href="#x11grab"> &para;</a></span></h3>
  13105. <p>X11 video input device.
  13106. </p>
  13107. <p>To enable this input device during configuration you need libxcb
  13108. installed on your system. It will be automatically detected during
  13109. configuration.
  13110. </p>
  13111. <p>This device allows one to capture a region of an X11 display.
  13112. </p>
  13113. <p>The filename passed as input has the syntax:
  13114. </p><div class="example">
  13115. <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>]
  13116. </pre></div>
  13117. <p><var class="var">hostname</var>:<var class="var">display_number</var>.<var class="var">screen_number</var> specifies the
  13118. X11 display name of the screen to grab from. <var class="var">hostname</var> can be
  13119. omitted, and defaults to &quot;localhost&quot;. The environment variable
  13120. <code class="env">DISPLAY</code> contains the default display name.
  13121. </p>
  13122. <p><var class="var">x_offset</var> and <var class="var">y_offset</var> specify the offsets of the grabbed
  13123. area with respect to the top-left border of the X11 screen. They
  13124. default to 0.
  13125. </p>
  13126. <p>Check the X11 documentation (e.g. <code class="command">man X</code>) for more detailed
  13127. information.
  13128. </p>
  13129. <p>Use the <code class="command">xdpyinfo</code> program for getting basic information about
  13130. the properties of your X11 display (e.g. grep for &quot;name&quot; or
  13131. &quot;dimensions&quot;).
  13132. </p>
  13133. <p>For example to grab from <samp class="file">:0.0</samp> using <code class="command">ffmpeg</code>:
  13134. </p><div class="example">
  13135. <pre class="example-preformatted">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
  13136. </pre></div>
  13137. <p>Grab at position <code class="code">10,20</code>:
  13138. </p><div class="example">
  13139. <pre class="example-preformatted">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  13140. </pre></div>
  13141. <ul class="mini-toc">
  13142. <li><a href="#Options-36" accesskey="1">Options</a></li>
  13143. </ul>
  13144. <div class="subsection-level-extent" id="Options-36">
  13145. <h4 class="subsection"><span>18.21.1 Options<a class="copiable-link" href="#Options-36"> &para;</a></span></h4>
  13146. <dl class="table">
  13147. <dt><samp class="option">select_region</samp></dt>
  13148. <dd><p>Specify whether to select the grabbing area graphically using the pointer.
  13149. A value of <code class="code">1</code> prompts the user to select the grabbing area graphically
  13150. by clicking and dragging. A single click with no dragging will select the
  13151. whole screen. A region with zero width or height will also select the whole
  13152. screen. This option overwrites the <var class="var">video_size</var>, <var class="var">grab_x</var>, and
  13153. <var class="var">grab_y</var> options. Default value is <code class="code">0</code>.
  13154. </p>
  13155. </dd>
  13156. <dt><samp class="option">draw_mouse</samp></dt>
  13157. <dd><p>Specify whether to draw the mouse pointer. A value of <code class="code">0</code> specifies
  13158. not to draw the pointer. Default value is <code class="code">1</code>.
  13159. </p>
  13160. </dd>
  13161. <dt><samp class="option">follow_mouse</samp></dt>
  13162. <dd><p>Make the grabbed area follow the mouse. The argument can be
  13163. <code class="code">centered</code> or a number of pixels <var class="var">PIXELS</var>.
  13164. </p>
  13165. <p>When it is specified with &quot;centered&quot;, the grabbing region follows the mouse
  13166. pointer and keeps the pointer at the center of region; otherwise, the region
  13167. follows only when the mouse pointer reaches within <var class="var">PIXELS</var> (greater than
  13168. zero) to the edge of region.
  13169. </p>
  13170. <p>For example:
  13171. </p><div class="example">
  13172. <pre class="example-preformatted">ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
  13173. </pre></div>
  13174. <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
  13175. </p><div class="example">
  13176. <pre class="example-preformatted">ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
  13177. </pre></div>
  13178. </dd>
  13179. <dt><samp class="option">framerate</samp></dt>
  13180. <dd><p>Set the grabbing frame rate. Default value is <code class="code">ntsc</code>,
  13181. corresponding to a frame rate of <code class="code">30000/1001</code>.
  13182. </p>
  13183. </dd>
  13184. <dt><samp class="option">show_region</samp></dt>
  13185. <dd><p>Show grabbed region on screen.
  13186. </p>
  13187. <p>If <var class="var">show_region</var> is specified with <code class="code">1</code>, then the grabbing
  13188. region will be indicated on screen. With this option, it is easy to
  13189. know what is being grabbed if only a portion of the screen is grabbed.
  13190. </p>
  13191. </dd>
  13192. <dt><samp class="option">region_border</samp></dt>
  13193. <dd><p>Set the region border thickness if <samp class="option">-show_region 1</samp> is used.
  13194. Range is 1 to 128 and default is 3 (XCB-based x11grab only).
  13195. </p>
  13196. <p>For example:
  13197. </p><div class="example">
  13198. <pre class="example-preformatted">ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  13199. </pre></div>
  13200. <p>With <var class="var">follow_mouse</var>:
  13201. </p><div class="example">
  13202. <pre class="example-preformatted">ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
  13203. </pre></div>
  13204. </dd>
  13205. <dt><samp class="option">window_id</samp></dt>
  13206. <dd><p>Grab this window, instead of the whole screen. Default value is 0, which maps to
  13207. the whole screen (root window).
  13208. </p>
  13209. <p>The id of a window can be found using the <code class="command">xwininfo</code> program, possibly with options -tree and
  13210. -root.
  13211. </p>
  13212. <p>If the window is later enlarged, the new area is not recorded. Video ends when
  13213. the window is closed, unmapped (i.e., iconified) or shrunk beyond the video
  13214. size (which defaults to the initial window size).
  13215. </p>
  13216. <p>This option disables options <samp class="option">follow_mouse</samp> and <samp class="option">select_region</samp>.
  13217. </p>
  13218. </dd>
  13219. <dt><samp class="option">video_size</samp></dt>
  13220. <dd><p>Set the video frame size. Default is the full desktop or window.
  13221. </p>
  13222. </dd>
  13223. <dt><samp class="option">grab_x</samp></dt>
  13224. <dt><samp class="option">grab_y</samp></dt>
  13225. <dd><p>Set the grabbing region coordinates. They are expressed as offset from
  13226. the top left corner of the X11 window and correspond to the
  13227. <var class="var">x_offset</var> and <var class="var">y_offset</var> parameters in the device name. The
  13228. default value for both options is 0.
  13229. </p></dd>
  13230. </dl>
  13231. </div>
  13232. </div>
  13233. </div>
  13234. <div class="chapter-level-extent" id="Resampler-Options">
  13235. <h2 class="chapter"><span>19 Resampler Options<a class="copiable-link" href="#Resampler-Options"> &para;</a></span></h2>
  13236. <p>The audio resampler supports the following named options.
  13237. </p>
  13238. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  13239. FFmpeg tools, <var class="var">option</var>=<var class="var">value</var> for the aresample filter,
  13240. by setting the value explicitly in the
  13241. <code class="code">SwrContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API for
  13242. programmatic use.
  13243. </p>
  13244. <dl class="table">
  13245. <dt><samp class="option">uchl, used_chlayout</samp></dt>
  13246. <dd><p>Set used input channel layout. Default is unset. This option is
  13247. only used for special remapping.
  13248. </p>
  13249. </dd>
  13250. <dt><samp class="option">isr, in_sample_rate</samp></dt>
  13251. <dd><p>Set the input sample rate. Default value is 0.
  13252. </p>
  13253. </dd>
  13254. <dt><samp class="option">osr, out_sample_rate</samp></dt>
  13255. <dd><p>Set the output sample rate. Default value is 0.
  13256. </p>
  13257. </dd>
  13258. <dt><samp class="option">isf, in_sample_fmt</samp></dt>
  13259. <dd><p>Specify the input sample format. It is set by default to <code class="code">none</code>.
  13260. </p>
  13261. </dd>
  13262. <dt><samp class="option">osf, out_sample_fmt</samp></dt>
  13263. <dd><p>Specify the output sample format. It is set by default to <code class="code">none</code>.
  13264. </p>
  13265. </dd>
  13266. <dt><samp class="option">tsf, internal_sample_fmt</samp></dt>
  13267. <dd><p>Set the internal sample format. Default value is <code class="code">none</code>.
  13268. This will automatically be chosen when it is not explicitly set.
  13269. </p>
  13270. </dd>
  13271. <dt><samp class="option">ichl, in_chlayout</samp></dt>
  13272. <dt><samp class="option">ochl, out_chlayout</samp></dt>
  13273. <dd><p>Set the input/output channel layout.
  13274. </p>
  13275. <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>
  13276. for the required syntax.
  13277. </p>
  13278. </dd>
  13279. <dt><samp class="option">clev, center_mix_level</samp></dt>
  13280. <dd><p>Set the center mix level. It is a value expressed in deciBel, and must be
  13281. in the interval [-32,32].
  13282. </p>
  13283. </dd>
  13284. <dt><samp class="option">slev, surround_mix_level</samp></dt>
  13285. <dd><p>Set the surround mix level. It is a value expressed in deciBel, and must
  13286. be in the interval [-32,32].
  13287. </p>
  13288. </dd>
  13289. <dt><samp class="option">lfe_mix_level</samp></dt>
  13290. <dd><p>Set LFE mix into non LFE level. It is used when there is a LFE input but no
  13291. LFE output. It is a value expressed in deciBel, and must
  13292. be in the interval [-32,32].
  13293. </p>
  13294. </dd>
  13295. <dt><samp class="option">rmvol, rematrix_volume</samp></dt>
  13296. <dd><p>Set rematrix volume. Default value is 1.0.
  13297. </p>
  13298. </dd>
  13299. <dt><samp class="option">rematrix_maxval</samp></dt>
  13300. <dd><p>Set maximum output value for rematrixing.
  13301. This can be used to prevent clipping vs. preventing volume reduction.
  13302. A value of 1.0 prevents clipping.
  13303. </p>
  13304. </dd>
  13305. <dt><samp class="option">flags, swr_flags</samp></dt>
  13306. <dd><p>Set flags used by the converter. Default value is 0.
  13307. </p>
  13308. <p>It supports the following individual flags:
  13309. </p><dl class="table">
  13310. <dt><samp class="option">res</samp></dt>
  13311. <dd><p>force resampling, this flag forces resampling to be used even when the
  13312. input and output sample rates match.
  13313. </p></dd>
  13314. </dl>
  13315. </dd>
  13316. <dt><samp class="option">dither_scale</samp></dt>
  13317. <dd><p>Set the dither scale. Default value is 1.
  13318. </p>
  13319. </dd>
  13320. <dt><samp class="option">dither_method</samp></dt>
  13321. <dd><p>Set dither method. Default value is 0.
  13322. </p>
  13323. <p>Supported values:
  13324. </p><dl class="table">
  13325. <dt>&lsquo;<samp class="samp">rectangular</samp>&rsquo;</dt>
  13326. <dd><p>select rectangular dither
  13327. </p></dd>
  13328. <dt>&lsquo;<samp class="samp">triangular</samp>&rsquo;</dt>
  13329. <dd><p>select triangular dither
  13330. </p></dd>
  13331. <dt>&lsquo;<samp class="samp">triangular_hp</samp>&rsquo;</dt>
  13332. <dd><p>select triangular dither with high pass
  13333. </p></dd>
  13334. <dt>&lsquo;<samp class="samp">lipshitz</samp>&rsquo;</dt>
  13335. <dd><p>select Lipshitz noise shaping dither.
  13336. </p></dd>
  13337. <dt>&lsquo;<samp class="samp">shibata</samp>&rsquo;</dt>
  13338. <dd><p>select Shibata noise shaping dither.
  13339. </p></dd>
  13340. <dt>&lsquo;<samp class="samp">low_shibata</samp>&rsquo;</dt>
  13341. <dd><p>select low Shibata noise shaping dither.
  13342. </p></dd>
  13343. <dt>&lsquo;<samp class="samp">high_shibata</samp>&rsquo;</dt>
  13344. <dd><p>select high Shibata noise shaping dither.
  13345. </p></dd>
  13346. <dt>&lsquo;<samp class="samp">f_weighted</samp>&rsquo;</dt>
  13347. <dd><p>select f-weighted noise shaping dither
  13348. </p></dd>
  13349. <dt>&lsquo;<samp class="samp">modified_e_weighted</samp>&rsquo;</dt>
  13350. <dd><p>select modified-e-weighted noise shaping dither
  13351. </p></dd>
  13352. <dt>&lsquo;<samp class="samp">improved_e_weighted</samp>&rsquo;</dt>
  13353. <dd><p>select improved-e-weighted noise shaping dither
  13354. </p>
  13355. </dd>
  13356. </dl>
  13357. </dd>
  13358. <dt><samp class="option">resampler</samp></dt>
  13359. <dd><p>Set resampling engine. Default value is swr.
  13360. </p>
  13361. <p>Supported values:
  13362. </p><dl class="table">
  13363. <dt>&lsquo;<samp class="samp">swr</samp>&rsquo;</dt>
  13364. <dd><p>select the native SW Resampler; filter options precision and cheby are not
  13365. applicable in this case.
  13366. </p></dd>
  13367. <dt>&lsquo;<samp class="samp">soxr</samp>&rsquo;</dt>
  13368. <dd><p>select the SoX Resampler (where available); compensation, and filter options
  13369. filter_size, phase_shift, exact_rational, filter_type &amp; kaiser_beta, are not
  13370. applicable in this case.
  13371. </p></dd>
  13372. </dl>
  13373. </dd>
  13374. <dt><samp class="option">filter_size</samp></dt>
  13375. <dd><p>For swr only, set resampling filter size, default value is 32.
  13376. </p>
  13377. </dd>
  13378. <dt><samp class="option">phase_shift</samp></dt>
  13379. <dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
  13380. the interval [0,30].
  13381. </p>
  13382. </dd>
  13383. <dt><samp class="option">linear_interp</samp></dt>
  13384. <dd><p>Use linear interpolation when enabled (the default). Disable it if you want
  13385. to preserve speed instead of quality when exact_rational fails.
  13386. </p>
  13387. </dd>
  13388. <dt><samp class="option">exact_rational</samp></dt>
  13389. <dd><p>For swr only, when enabled, try to use exact phase_count based on input and
  13390. output sample rate. However, if it is larger than <code class="code">1 &lt;&lt; phase_shift</code>,
  13391. the phase_count will be <code class="code">1 &lt;&lt; phase_shift</code> as fallback. Default is enabled.
  13392. </p>
  13393. </dd>
  13394. <dt><samp class="option">cutoff</samp></dt>
  13395. <dd><p>Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
  13396. value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
  13397. (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
  13398. </p>
  13399. </dd>
  13400. <dt><samp class="option">precision</samp></dt>
  13401. <dd><p>For soxr only, the precision in bits to which the resampled signal will be
  13402. calculated. The default value of 20 (which, with suitable dithering, is
  13403. appropriate for a destination bit-depth of 16) gives SoX&rsquo;s &rsquo;High Quality&rsquo;; a
  13404. value of 28 gives SoX&rsquo;s &rsquo;Very High Quality&rsquo;.
  13405. </p>
  13406. </dd>
  13407. <dt><samp class="option">cheby</samp></dt>
  13408. <dd><p>For soxr only, selects passband rolloff none (Chebyshev) &amp; higher-precision
  13409. approximation for &rsquo;irrational&rsquo; ratios. Default value is 0.
  13410. </p>
  13411. </dd>
  13412. <dt><samp class="option">async</samp></dt>
  13413. <dd><p>For swr only, simple 1 parameter audio sync to timestamps using stretching,
  13414. squeezing, filling and trimming. Setting this to 1 will enable filling and
  13415. trimming, larger values represent the maximum amount in samples that the data
  13416. may be stretched or squeezed for each second.
  13417. Default value is 0, thus no compensation is applied to make the samples match
  13418. the audio timestamps.
  13419. </p>
  13420. </dd>
  13421. <dt><samp class="option">first_pts</samp></dt>
  13422. <dd><p>For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
  13423. This allows for padding/trimming at the start of stream. By default, no
  13424. assumption is made about the first frame&rsquo;s expected pts, so no padding or
  13425. trimming is done. For example, this could be set to 0 to pad the beginning with
  13426. silence if an audio stream starts after the video stream or to trim any samples
  13427. with a negative pts due to encoder delay.
  13428. </p>
  13429. </dd>
  13430. <dt><samp class="option">min_comp</samp></dt>
  13431. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  13432. seconds) to trigger stretching/squeezing/filling or trimming of the
  13433. data to make it match the timestamps. The default is that
  13434. stretching/squeezing/filling and trimming is disabled
  13435. (<samp class="option">min_comp</samp> = <code class="code">FLT_MAX</code>).
  13436. </p>
  13437. </dd>
  13438. <dt><samp class="option">min_hard_comp</samp></dt>
  13439. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  13440. seconds) to trigger adding/dropping samples to make it match the
  13441. timestamps. This option effectively is a threshold to select between
  13442. hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
  13443. all compensation is by default disabled through <samp class="option">min_comp</samp>.
  13444. The default is 0.1.
  13445. </p>
  13446. </dd>
  13447. <dt><samp class="option">comp_duration</samp></dt>
  13448. <dd><p>For swr only, set duration (in seconds) over which data is stretched/squeezed
  13449. to make it match the timestamps. Must be a non-negative double float value,
  13450. default value is 1.0.
  13451. </p>
  13452. </dd>
  13453. <dt><samp class="option">max_soft_comp</samp></dt>
  13454. <dd><p>For swr only, set maximum factor by which data is stretched/squeezed to make it
  13455. match the timestamps. Must be a non-negative double float value, default value
  13456. is 0.
  13457. </p>
  13458. </dd>
  13459. <dt><samp class="option">matrix_encoding</samp></dt>
  13460. <dd><p>Select matrixed stereo encoding.
  13461. </p>
  13462. <p>It accepts the following values:
  13463. </p><dl class="table">
  13464. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  13465. <dd><p>select none
  13466. </p></dd>
  13467. <dt>&lsquo;<samp class="samp">dolby</samp>&rsquo;</dt>
  13468. <dd><p>select Dolby
  13469. </p></dd>
  13470. <dt>&lsquo;<samp class="samp">dplii</samp>&rsquo;</dt>
  13471. <dd><p>select Dolby Pro Logic II
  13472. </p></dd>
  13473. </dl>
  13474. <p>Default value is <code class="code">none</code>.
  13475. </p>
  13476. </dd>
  13477. <dt><samp class="option">filter_type</samp></dt>
  13478. <dd><p>For swr only, select resampling filter type. This only affects resampling
  13479. operations.
  13480. </p>
  13481. <p>It accepts the following values:
  13482. </p><dl class="table">
  13483. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  13484. <dd><p>select cubic
  13485. </p></dd>
  13486. <dt>&lsquo;<samp class="samp">blackman_nuttall</samp>&rsquo;</dt>
  13487. <dd><p>select Blackman Nuttall windowed sinc
  13488. </p></dd>
  13489. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  13490. <dd><p>select Kaiser windowed sinc
  13491. </p></dd>
  13492. </dl>
  13493. </dd>
  13494. <dt><samp class="option">kaiser_beta</samp></dt>
  13495. <dd><p>For swr only, set Kaiser window beta value. Must be a double float value in the
  13496. interval [2,16], default value is 9.
  13497. </p>
  13498. </dd>
  13499. <dt><samp class="option">output_sample_bits</samp></dt>
  13500. <dd><p>For swr only, set number of used output sample bits for dithering. Must be an integer in the
  13501. interval [0,64], default value is 0, which means it&rsquo;s not used.
  13502. </p>
  13503. </dd>
  13504. </dl>
  13505. <a class="anchor" id="scaler_005foptions"></a></div>
  13506. <div class="chapter-level-extent" id="Scaler-Options">
  13507. <h2 class="chapter"><span>20 Scaler Options<a class="copiable-link" href="#Scaler-Options"> &para;</a></span></h2>
  13508. <p>The video scaler supports the following named options.
  13509. </p>
  13510. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  13511. FFmpeg tools, with a few API-only exceptions noted below.
  13512. For programmatic use, they can be set explicitly in the
  13513. <code class="code">SwsContext</code> options or through the <samp class="file">libavutil/opt.h</samp> API.
  13514. </p>
  13515. <dl class="table">
  13516. <dd>
  13517. <a class="anchor" id="sws_005fflags"></a></dd>
  13518. <dt><samp class="option">sws_flags</samp></dt>
  13519. <dd><p>Set the scaler flags. This is also used to set the scaling
  13520. algorithm. Only a single algorithm should be selected. Default
  13521. value is &lsquo;<samp class="samp">bicubic</samp>&rsquo;.
  13522. </p>
  13523. <p>It accepts the following values:
  13524. </p><dl class="table">
  13525. <dt>&lsquo;<samp class="samp">fast_bilinear</samp>&rsquo;</dt>
  13526. <dd><p>Select fast bilinear scaling algorithm.
  13527. </p>
  13528. </dd>
  13529. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  13530. <dd><p>Select bilinear scaling algorithm.
  13531. </p>
  13532. </dd>
  13533. <dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
  13534. <dd><p>Select bicubic scaling algorithm.
  13535. </p>
  13536. </dd>
  13537. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  13538. <dd><p>Select experimental scaling algorithm.
  13539. </p>
  13540. </dd>
  13541. <dt>&lsquo;<samp class="samp">neighbor</samp>&rsquo;</dt>
  13542. <dd><p>Select nearest neighbor rescaling algorithm.
  13543. </p>
  13544. </dd>
  13545. <dt>&lsquo;<samp class="samp">area</samp>&rsquo;</dt>
  13546. <dd><p>Select averaging area rescaling algorithm.
  13547. </p>
  13548. </dd>
  13549. <dt>&lsquo;<samp class="samp">bicublin</samp>&rsquo;</dt>
  13550. <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
  13551. chroma components.
  13552. </p>
  13553. </dd>
  13554. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  13555. <dd><p>Select Gaussian rescaling algorithm.
  13556. </p>
  13557. </dd>
  13558. <dt>&lsquo;<samp class="samp">sinc</samp>&rsquo;</dt>
  13559. <dd><p>Select sinc rescaling algorithm.
  13560. </p>
  13561. </dd>
  13562. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  13563. <dd><p>Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be
  13564. changed by setting <code class="code">param0</code>.
  13565. </p>
  13566. </dd>
  13567. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  13568. <dd><p>Select natural bicubic spline rescaling algorithm.
  13569. </p>
  13570. </dd>
  13571. <dt>&lsquo;<samp class="samp">print_info</samp>&rsquo;</dt>
  13572. <dd><p>Enable printing/debug logging.
  13573. </p>
  13574. </dd>
  13575. <dt>&lsquo;<samp class="samp">accurate_rnd</samp>&rsquo;</dt>
  13576. <dd><p>Enable accurate rounding.
  13577. </p>
  13578. </dd>
  13579. <dt>&lsquo;<samp class="samp">full_chroma_int</samp>&rsquo;</dt>
  13580. <dd><p>Enable full chroma interpolation.
  13581. </p>
  13582. </dd>
  13583. <dt>&lsquo;<samp class="samp">full_chroma_inp</samp>&rsquo;</dt>
  13584. <dd><p>Select full chroma input.
  13585. </p>
  13586. </dd>
  13587. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  13588. <dd><p>Enable bitexact output.
  13589. </p></dd>
  13590. </dl>
  13591. </dd>
  13592. <dt><samp class="option">srcw <var class="var">(API only)</var></samp></dt>
  13593. <dd><p>Set source width.
  13594. </p>
  13595. </dd>
  13596. <dt><samp class="option">srch <var class="var">(API only)</var></samp></dt>
  13597. <dd><p>Set source height.
  13598. </p>
  13599. </dd>
  13600. <dt><samp class="option">dstw <var class="var">(API only)</var></samp></dt>
  13601. <dd><p>Set destination width.
  13602. </p>
  13603. </dd>
  13604. <dt><samp class="option">dsth <var class="var">(API only)</var></samp></dt>
  13605. <dd><p>Set destination height.
  13606. </p>
  13607. </dd>
  13608. <dt><samp class="option">src_format <var class="var">(API only)</var></samp></dt>
  13609. <dd><p>Set source pixel format (must be expressed as an integer).
  13610. </p>
  13611. </dd>
  13612. <dt><samp class="option">dst_format <var class="var">(API only)</var></samp></dt>
  13613. <dd><p>Set destination pixel format (must be expressed as an integer).
  13614. </p>
  13615. </dd>
  13616. <dt><samp class="option">src_range <var class="var">(boolean)</var></samp></dt>
  13617. <dd><p>If value is set to <code class="code">1</code>, indicates source is full range. Default value is
  13618. <code class="code">0</code>, which indicates source is limited range.
  13619. </p>
  13620. </dd>
  13621. <dt><samp class="option">dst_range <var class="var">(boolean)</var></samp></dt>
  13622. <dd><p>If value is set to <code class="code">1</code>, enable full range for destination. Default value
  13623. is <code class="code">0</code>, which enables limited range.
  13624. </p>
  13625. <a class="anchor" id="sws_005fparams"></a></dd>
  13626. <dt><samp class="option">param0, param1</samp></dt>
  13627. <dd><p>Set scaling algorithm parameters. The specified values are specific of
  13628. some scaling algorithms and ignored by others. The specified values
  13629. are floating point number values.
  13630. </p>
  13631. </dd>
  13632. <dt><samp class="option">sws_dither</samp></dt>
  13633. <dd><p>Set the dithering algorithm. Accepts one of the following
  13634. values. Default value is &lsquo;<samp class="samp">auto</samp>&rsquo;.
  13635. </p>
  13636. <dl class="table">
  13637. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  13638. <dd><p>automatic choice
  13639. </p>
  13640. </dd>
  13641. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  13642. <dd><p>no dithering
  13643. </p>
  13644. </dd>
  13645. <dt>&lsquo;<samp class="samp">bayer</samp>&rsquo;</dt>
  13646. <dd><p>bayer dither
  13647. </p>
  13648. </dd>
  13649. <dt>&lsquo;<samp class="samp">ed</samp>&rsquo;</dt>
  13650. <dd><p>error diffusion dither
  13651. </p>
  13652. </dd>
  13653. <dt>&lsquo;<samp class="samp">a_dither</samp>&rsquo;</dt>
  13654. <dd><p>arithmetic dither, based using addition
  13655. </p>
  13656. </dd>
  13657. <dt>&lsquo;<samp class="samp">x_dither</samp>&rsquo;</dt>
  13658. <dd><p>arithmetic dither, based using xor (more random/less apparent patterning that
  13659. a_dither).
  13660. </p>
  13661. </dd>
  13662. </dl>
  13663. </dd>
  13664. <dt><samp class="option">alphablend</samp></dt>
  13665. <dd><p>Set the alpha blending to use when the input has alpha but the output does not.
  13666. Default value is &lsquo;<samp class="samp">none</samp>&rsquo;.
  13667. </p>
  13668. <dl class="table">
  13669. <dt>&lsquo;<samp class="samp">uniform_color</samp>&rsquo;</dt>
  13670. <dd><p>Blend onto a uniform background color
  13671. </p>
  13672. </dd>
  13673. <dt>&lsquo;<samp class="samp">checkerboard</samp>&rsquo;</dt>
  13674. <dd><p>Blend onto a checkerboard
  13675. </p>
  13676. </dd>
  13677. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  13678. <dd><p>No blending
  13679. </p>
  13680. </dd>
  13681. </dl>
  13682. </dd>
  13683. </dl>
  13684. </div>
  13685. <div class="chapter-level-extent" id="Filtering-Introduction">
  13686. <h2 class="chapter"><span>21 Filtering Introduction<a class="copiable-link" href="#Filtering-Introduction"> &para;</a></span></h2>
  13687. <p>Filtering in FFmpeg is enabled through the libavfilter library.
  13688. </p>
  13689. <p>In libavfilter, a filter can have multiple inputs and multiple
  13690. outputs.
  13691. To illustrate the sorts of things that are possible, we consider the
  13692. following filtergraph.
  13693. </p>
  13694. <pre class="verbatim"> [main]
  13695. input --&gt; split ---------------------&gt; overlay --&gt; output
  13696. | ^
  13697. |[tmp] [flip]|
  13698. +-----&gt; crop --&gt; vflip -------+
  13699. </pre>
  13700. <p>This filtergraph splits the input stream in two streams, then sends one
  13701. stream through the crop filter and the vflip filter, before merging it
  13702. back with the other stream by overlaying it on top. You can use the
  13703. following command to achieve this:
  13704. </p>
  13705. <div class="example">
  13706. <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
  13707. </pre></div>
  13708. <p>The result will be that the top half of the video is mirrored
  13709. onto the bottom half of the output video.
  13710. </p>
  13711. <p>Filters in the same linear chain are separated by commas, and distinct
  13712. linear chains of filters are separated by semicolons. In our example,
  13713. <var class="var">crop,vflip</var> are in one linear chain, <var class="var">split</var> and
  13714. <var class="var">overlay</var> are separately in another. The points where the linear
  13715. chains join are labelled by names enclosed in square brackets. In the
  13716. example, the split filter generates two outputs that are associated to
  13717. the labels <var class="var">[main]</var> and <var class="var">[tmp]</var>.
  13718. </p>
  13719. <p>The stream sent to the second output of <var class="var">split</var>, labelled as
  13720. <var class="var">[tmp]</var>, is processed through the <var class="var">crop</var> filter, which crops
  13721. away the lower half part of the video, and then vertically flipped. The
  13722. <var class="var">overlay</var> filter takes in input the first unchanged output of the
  13723. split filter (which was labelled as <var class="var">[main]</var>), and overlay on its
  13724. lower half the output generated by the <var class="var">crop,vflip</var> filterchain.
  13725. </p>
  13726. <p>Some filters take in input a list of parameters: they are specified
  13727. after the filter name and an equal sign, and are separated from each other
  13728. by a colon.
  13729. </p>
  13730. <p>There exist so-called <var class="var">source filters</var> that do not have an
  13731. audio/video input, and <var class="var">sink filters</var> that will not have audio/video
  13732. output.
  13733. </p>
  13734. </div>
  13735. <div class="chapter-level-extent" id="graph2dot">
  13736. <h2 class="chapter"><span>22 graph2dot<a class="copiable-link" href="#graph2dot"> &para;</a></span></h2>
  13737. <p>The <samp class="file">graph2dot</samp> program included in the FFmpeg <samp class="file">tools</samp>
  13738. directory can be used to parse a filtergraph description and issue a
  13739. corresponding textual representation in the dot language.
  13740. </p>
  13741. <p>Invoke the command:
  13742. </p><div class="example">
  13743. <pre class="example-preformatted">graph2dot -h
  13744. </pre></div>
  13745. <p>to see how to use <samp class="file">graph2dot</samp>.
  13746. </p>
  13747. <p>You can then pass the dot description to the <samp class="file">dot</samp> program (from
  13748. the graphviz suite of programs) and obtain a graphical representation
  13749. of the filtergraph.
  13750. </p>
  13751. <p>For example the sequence of commands:
  13752. </p><div class="example">
  13753. <pre class="example-preformatted">echo <var class="var">GRAPH_DESCRIPTION</var> | \
  13754. tools/graph2dot -o graph.tmp &amp;&amp; \
  13755. dot -Tpng graph.tmp -o graph.png &amp;&amp; \
  13756. display graph.png
  13757. </pre></div>
  13758. <p>can be used to create and display an image representing the graph
  13759. described by the <var class="var">GRAPH_DESCRIPTION</var> string. Note that this string must be
  13760. a complete self-contained graph, with its inputs and outputs explicitly defined.
  13761. For example if your command line is of the form:
  13762. </p><div class="example">
  13763. <pre class="example-preformatted">ffmpeg -i infile -vf scale=640:360 outfile
  13764. </pre></div>
  13765. <p>your <var class="var">GRAPH_DESCRIPTION</var> string will need to be of the form:
  13766. </p><div class="example">
  13767. <pre class="example-preformatted">nullsrc,scale=640:360,nullsink
  13768. </pre></div>
  13769. <p>you may also need to set the <var class="var">nullsrc</var> parameters and add a <var class="var">format</var>
  13770. filter in order to simulate a specific input file.
  13771. </p>
  13772. </div>
  13773. <div class="chapter-level-extent" id="Filtergraph-description">
  13774. <h2 class="chapter"><span>23 Filtergraph description<a class="copiable-link" href="#Filtergraph-description"> &para;</a></span></h2>
  13775. <p>A filtergraph is a directed graph of connected filters. It can contain
  13776. cycles, and there can be multiple links between a pair of
  13777. filters. Each link has one input pad on one side connecting it to one
  13778. filter from which it takes its input, and one output pad on the other
  13779. side connecting it to one filter accepting its output.
  13780. </p>
  13781. <p>Each filter in a filtergraph is an instance of a filter class
  13782. registered in the application, which defines the features and the
  13783. number of input and output pads of the filter.
  13784. </p>
  13785. <p>A filter with no input pads is called a &quot;source&quot;, and a filter with no
  13786. output pads is called a &quot;sink&quot;.
  13787. </p>
  13788. <a class="anchor" id="Filtergraph-syntax"></a><ul class="mini-toc">
  13789. <li><a href="#Filtergraph-syntax-1" accesskey="1">Filtergraph syntax</a></li>
  13790. <li><a href="#Notes-on-filtergraph-escaping" accesskey="2">Notes on filtergraph escaping</a></li>
  13791. </ul>
  13792. <div class="section-level-extent" id="Filtergraph-syntax-1">
  13793. <h3 class="section"><span>23.1 Filtergraph syntax<a class="copiable-link" href="#Filtergraph-syntax-1"> &para;</a></span></h3>
  13794. <p>A filtergraph has a textual representation, which is recognized by the
  13795. <samp class="option">-filter</samp>/<samp class="option">-vf</samp>/<samp class="option">-af</samp> and
  13796. <samp class="option">-filter_complex</samp> options in <code class="command">ffmpeg</code> and
  13797. <samp class="option">-vf</samp>/<samp class="option">-af</samp> in <code class="command">ffplay</code>, and by the
  13798. <code class="code">avfilter_graph_parse_ptr()</code> function defined in
  13799. <samp class="file">libavfilter/avfilter.h</samp>.
  13800. </p>
  13801. <p>A filterchain consists of a sequence of connected filters, each one
  13802. connected to the previous one in the sequence. A filterchain is
  13803. represented by a list of &quot;,&quot;-separated filter descriptions.
  13804. </p>
  13805. <p>A filtergraph consists of a sequence of filterchains. A sequence of
  13806. filterchains is represented by a list of &quot;;&quot;-separated filterchain
  13807. descriptions.
  13808. </p>
  13809. <p>A filter is represented by a string of the form:
  13810. [<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>]
  13811. </p>
  13812. <p><var class="var">filter_name</var> is the name of the filter class of which the
  13813. described filter is an instance of, and has to be the name of one of
  13814. the filter classes registered in the program optionally followed by &quot;@<var class="var">id</var>&quot;.
  13815. The name of the filter class is optionally followed by a string
  13816. &quot;=<var class="var">arguments</var>&quot;.
  13817. </p>
  13818. <p><var class="var">arguments</var> is a string which contains the parameters used to
  13819. initialize the filter instance. It may have one of two forms:
  13820. </p><ul class="itemize mark-bullet">
  13821. <li>A &rsquo;:&rsquo;-separated list of <var class="var">key=value</var> pairs.
  13822. </li><li>A &rsquo;:&rsquo;-separated list of <var class="var">value</var>. In this case, the keys are assumed to be
  13823. the option names in the order they are declared. E.g. the <code class="code">fade</code> filter
  13824. declares three options in this order &ndash; <samp class="option">type</samp>, <samp class="option">start_frame</samp> and
  13825. <samp class="option">nb_frames</samp>. Then the parameter list <var class="var">in:0:30</var> means that the value
  13826. <var class="var">in</var> is assigned to the option <samp class="option">type</samp>, <var class="var">0</var> to
  13827. <samp class="option">start_frame</samp> and <var class="var">30</var> to <samp class="option">nb_frames</samp>.
  13828. </li><li>A &rsquo;:&rsquo;-separated list of mixed direct <var class="var">value</var> and long <var class="var">key=value</var>
  13829. pairs. The direct <var class="var">value</var> must precede the <var class="var">key=value</var> pairs, and
  13830. follow the same constraints order of the previous point. The following
  13831. <var class="var">key=value</var> pairs can be set in any preferred order.
  13832. </li></ul>
  13833. <p>If the option value itself is a list of items (e.g. the <code class="code">format</code> filter
  13834. takes a list of pixel formats), the items in the list are usually separated by
  13835. &lsquo;<samp class="samp">|</samp>&rsquo;.
  13836. </p>
  13837. <p>The list of arguments can be quoted using the character &lsquo;<samp class="samp">'</samp>&rsquo; as initial
  13838. and ending mark, and the character &lsquo;<samp class="samp">\</samp>&rsquo; for escaping the characters
  13839. within the quoted text; otherwise the argument string is considered
  13840. terminated when the next special character (belonging to the set
  13841. &lsquo;<samp class="samp">[]=;,</samp>&rsquo;) is encountered.
  13842. </p>
  13843. <p>A special syntax implemented in the <code class="command">ffmpeg</code> CLI tool allows loading
  13844. option values from files. This is done be prepending a slash &rsquo;/&rsquo; to the option
  13845. name, then the supplied value is interpreted as a path from which the actual
  13846. value is loaded. E.g.
  13847. </p><div class="example">
  13848. <pre class="example-preformatted">ffmpeg -i &lt;INPUT&gt; -vf drawtext=/text=/tmp/some_text &lt;OUTPUT&gt;
  13849. </pre></div>
  13850. <p>will load the text to be drawn from <samp class="file">/tmp/some_text</samp>. API users wishing to
  13851. implement a similar feature should use the <code class="code">avfilter_graph_segment_*()</code>
  13852. functions together with custom IO code.
  13853. </p>
  13854. <p>The name and arguments of the filter are optionally preceded and
  13855. followed by a list of link labels.
  13856. A link label allows one to name a link and associate it to a filter output
  13857. or input pad. The preceding labels <var class="var">in_link_1</var>
  13858. ... <var class="var">in_link_N</var>, are associated to the filter input pads,
  13859. the following labels <var class="var">out_link_1</var> ... <var class="var">out_link_M</var>, are
  13860. associated to the output pads.
  13861. </p>
  13862. <p>When two link labels with the same name are found in the
  13863. filtergraph, a link between the corresponding input and output pad is
  13864. created.
  13865. </p>
  13866. <p>If an output pad is not labelled, it is linked by default to the first
  13867. unlabelled input pad of the next filter in the filterchain.
  13868. For example in the filterchain
  13869. </p><div class="example">
  13870. <pre class="example-preformatted">nullsrc, split[L1], [L2]overlay, nullsink
  13871. </pre></div>
  13872. <p>the split filter instance has two output pads, and the overlay filter
  13873. instance two input pads. The first output pad of split is labelled
  13874. &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
  13875. output pad of split is linked to the second input pad of overlay,
  13876. which are both unlabelled.
  13877. </p>
  13878. <p>In a filter description, if the input label of the first filter is not
  13879. specified, &quot;in&quot; is assumed; if the output label of the last filter is not
  13880. specified, &quot;out&quot; is assumed.
  13881. </p>
  13882. <p>In a complete filterchain all the unlabelled filter input and output
  13883. pads must be connected. A filtergraph is considered valid if all the
  13884. filter input and output pads of all the filterchains are connected.
  13885. </p>
  13886. <p>Leading and trailing whitespaces (space, tabs, or line feeds) separating tokens
  13887. in the filtergraph specification are ignored. This means that the filtergraph
  13888. can be expressed using empty lines and spaces to improve redability.
  13889. </p>
  13890. <p>For example, the filtergraph:
  13891. </p><div class="example">
  13892. <pre class="example-preformatted">testsrc,split[L1],hflip[L2];[L1][L2] hstack
  13893. </pre></div>
  13894. <p>can be represented as:
  13895. </p><div class="example">
  13896. <pre class="example-preformatted">testsrc,
  13897. split [L1], hflip [L2];
  13898. [L1][L2] hstack
  13899. </pre></div>
  13900. <p>Libavfilter will automatically insert <a class="ref" href="#scale">scale</a> filters where format
  13901. conversion is required. It is possible to specify swscale flags
  13902. for those automatically inserted scalers by prepending
  13903. <code class="code">sws_flags=<var class="var">flags</var>;</code>
  13904. to the filtergraph description.
  13905. </p>
  13906. <p>Here is a BNF description of the filtergraph syntax:
  13907. </p><div class="example">
  13908. <pre class="example-preformatted"><var class="var">NAME</var> ::= sequence of alphanumeric characters and '_'
  13909. <var class="var">FILTER_NAME</var> ::= <var class="var">NAME</var>[&quot;@&quot;<var class="var">NAME</var>]
  13910. <var class="var">LINKLABEL</var> ::= &quot;[&quot; <var class="var">NAME</var> &quot;]&quot;
  13911. <var class="var">LINKLABELS</var> ::= <var class="var">LINKLABEL</var> [<var class="var">LINKLABELS</var>]
  13912. <var class="var">FILTER_ARGUMENTS</var> ::= sequence of chars (possibly quoted)
  13913. <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>]
  13914. <var class="var">FILTERCHAIN</var> ::= <var class="var">FILTER</var> [,<var class="var">FILTERCHAIN</var>]
  13915. <var class="var">FILTERGRAPH</var> ::= [sws_flags=<var class="var">flags</var>;] <var class="var">FILTERCHAIN</var> [;<var class="var">FILTERGRAPH</var>]
  13916. </pre></div>
  13917. <a class="anchor" id="filtergraph-escaping"></a></div>
  13918. <div class="section-level-extent" id="Notes-on-filtergraph-escaping">
  13919. <h3 class="section"><span>23.2 Notes on filtergraph escaping<a class="copiable-link" href="#Notes-on-filtergraph-escaping"> &para;</a></span></h3>
  13920. <p>Filtergraph description composition entails several levels of
  13921. escaping. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">the &quot;Quoting and escaping&quot;
  13922. section in the ffmpeg-utils(1) manual</a> for more
  13923. information about the employed escaping procedure.
  13924. </p>
  13925. <p>A first level escaping affects the content of each filter option
  13926. value, which may contain the special character <code class="code">:</code> used to
  13927. separate values, or one of the escaping characters <code class="code">\'</code>.
  13928. </p>
  13929. <p>A second level escaping affects the whole filter description, which
  13930. may contain the escaping characters <code class="code">\'</code> or the special
  13931. characters <code class="code">[],;</code> used by the filtergraph description.
  13932. </p>
  13933. <p>Finally, when you specify a filtergraph on a shell commandline, you
  13934. need to perform a third level escaping for the shell special
  13935. characters contained within it.
  13936. </p>
  13937. <p>For example, consider the following string to be embedded in
  13938. the <a class="ref" href="#drawtext">drawtext</a> filter description <samp class="option">text</samp> value:
  13939. </p><div class="example">
  13940. <pre class="example-preformatted">this is a 'string': may contain one, or more, special characters
  13941. </pre></div>
  13942. <p>This string contains the <code class="code">'</code> special escaping character, and the
  13943. <code class="code">:</code> special character, so it needs to be escaped in this way:
  13944. </p><div class="example">
  13945. <pre class="example-preformatted">text=this is a \'string\'\: may contain one, or more, special characters
  13946. </pre></div>
  13947. <p>A second level of escaping is required when embedding the filter
  13948. description in a filtergraph description, in order to escape all the
  13949. filtergraph special characters. Thus the example above becomes:
  13950. </p><div class="example">
  13951. <pre class="example-preformatted">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
  13952. </pre></div>
  13953. <p>(note that in addition to the <code class="code">\'</code> escaping special characters,
  13954. also <code class="code">,</code> needs to be escaped).
  13955. </p>
  13956. <p>Finally an additional level of escaping is needed when writing the
  13957. filtergraph description in a shell command, which depends on the
  13958. escaping rules of the adopted shell. For example, assuming that
  13959. <code class="code">\</code> is special and needs to be escaped with another <code class="code">\</code>, the
  13960. previous string will finally result in:
  13961. </p><div class="example">
  13962. <pre class="example-preformatted">-vf &quot;drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&quot;
  13963. </pre></div>
  13964. <p>In order to avoid cumbersome escaping when using a commandline tool accepting a
  13965. filter specification as input, it is advisable to avoid direct inclusion of the
  13966. filter or options specification in the shell.
  13967. </p>
  13968. <p>For example, in case of the <a class="ref" href="#drawtext">drawtext filter</a>, you might prefer to
  13969. use the <samp class="option">textfile</samp> option in place of <samp class="option">text</samp> to specify the text
  13970. to render.
  13971. </p>
  13972. </div>
  13973. </div>
  13974. <div class="chapter-level-extent" id="Timeline-editing">
  13975. <h2 class="chapter"><span>24 Timeline editing<a class="copiable-link" href="#Timeline-editing"> &para;</a></span></h2>
  13976. <p>Some filters support a generic <samp class="option">enable</samp> option. For the filters
  13977. supporting timeline editing, this option can be set to an expression which is
  13978. evaluated before sending a frame to the filter. If the evaluation is non-zero,
  13979. the filter will be enabled, otherwise the frame will be sent unchanged to the
  13980. next filter in the filtergraph.
  13981. </p>
  13982. <p>The expression accepts the following values:
  13983. </p><dl class="table">
  13984. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  13985. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  13986. </p>
  13987. </dd>
  13988. <dt>&lsquo;<samp class="samp">n</samp>&rsquo;</dt>
  13989. <dd><p>sequential number of the input frame, starting from 0
  13990. </p>
  13991. </dd>
  13992. <dt>&lsquo;<samp class="samp">pos</samp>&rsquo;</dt>
  13993. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated, do
  13994. not use
  13995. </p>
  13996. </dd>
  13997. <dt>&lsquo;<samp class="samp">w</samp>&rsquo;</dt>
  13998. <dt>&lsquo;<samp class="samp">h</samp>&rsquo;</dt>
  13999. <dd><p>width and height of the input frame if video
  14000. </p></dd>
  14001. </dl>
  14002. <p>Additionally, these filters support an <samp class="option">enable</samp> command that can be used
  14003. to re-define the expression.
  14004. </p>
  14005. <p>Like any other filtering option, the <samp class="option">enable</samp> option follows the same
  14006. rules.
  14007. </p>
  14008. <p>For example, to enable a blur filter (<a class="ref" href="#smartblur">smartblur</a>) from 10 seconds to 3
  14009. minutes, and a <a class="ref" href="#curves">curves</a> filter starting at 3 seconds:
  14010. </p><div class="example">
  14011. <pre class="example-preformatted">smartblur = enable='between(t,10,3*60)',
  14012. curves = enable='gte(t,3)' : preset=cross_process
  14013. </pre></div>
  14014. <p>See <code class="code">ffmpeg -filters</code> to view which filters have timeline support.
  14015. </p>
  14016. <a class="anchor" id="commands"></a></div>
  14017. <div class="chapter-level-extent" id="Changing-options-at-runtime-with-a-command">
  14018. <h2 class="chapter"><span>25 Changing options at runtime with a command<a class="copiable-link" href="#Changing-options-at-runtime-with-a-command"> &para;</a></span></h2>
  14019. <p>Some options can be changed during the operation of the filter using
  14020. a command. These options are marked &rsquo;T&rsquo; on the output of
  14021. <code class="command">ffmpeg</code> <samp class="option">-h filter=&lt;name of filter&gt;</samp>.
  14022. The name of the command is the name of the option and the argument is
  14023. the new value.
  14024. </p>
  14025. <a class="anchor" id="framesync"></a></div>
  14026. <div class="chapter-level-extent" id="Options-for-filters-with-several-inputs-_0028framesync_0029">
  14027. <h2 class="chapter"><span>26 Options for filters with several inputs (framesync)<a class="copiable-link" href="#Options-for-filters-with-several-inputs-_0028framesync_0029"> &para;</a></span></h2>
  14028. <p>Some filters with several inputs support a common set of options.
  14029. These options can only be set by name, not with the short notation.
  14030. </p>
  14031. <dl class="table">
  14032. <dt><samp class="option">eof_action</samp></dt>
  14033. <dd><p>The action to take when EOF is encountered on the secondary input; it accepts
  14034. one of the following values:
  14035. </p>
  14036. <dl class="table">
  14037. <dt><samp class="option">repeat</samp></dt>
  14038. <dd><p>Repeat the last frame (the default).
  14039. </p></dd>
  14040. <dt><samp class="option">endall</samp></dt>
  14041. <dd><p>End both streams.
  14042. </p></dd>
  14043. <dt><samp class="option">pass</samp></dt>
  14044. <dd><p>Pass the main input through.
  14045. </p></dd>
  14046. </dl>
  14047. </dd>
  14048. <dt><samp class="option">shortest</samp></dt>
  14049. <dd><p>If set to 1, force the output to terminate when the shortest input
  14050. terminates. Default value is 0.
  14051. </p>
  14052. </dd>
  14053. <dt><samp class="option">repeatlast</samp></dt>
  14054. <dd><p>If set to 1, force the filter to extend the last frame of secondary streams
  14055. until the end of the primary stream. A value of 0 disables this behavior.
  14056. Default value is 1.
  14057. </p>
  14058. </dd>
  14059. <dt><samp class="option">ts_sync_mode</samp></dt>
  14060. <dd><p>How strictly to sync streams based on secondary input timestamps; it accepts
  14061. one of the following values:
  14062. </p>
  14063. <dl class="table">
  14064. <dt><samp class="option">default</samp></dt>
  14065. <dd><p>Frame from secondary input with the nearest lower or equal timestamp to the
  14066. primary input frame.
  14067. </p></dd>
  14068. <dt><samp class="option">nearest</samp></dt>
  14069. <dd><p>Frame from secondary input with the absolute nearest timestamp to the primary
  14070. input frame.
  14071. </p></dd>
  14072. </dl>
  14073. </dd>
  14074. </dl>
  14075. </div>
  14076. <div class="chapter-level-extent" id="Audio-Filters">
  14077. <h2 class="chapter"><span>27 Audio Filters<a class="copiable-link" href="#Audio-Filters"> &para;</a></span></h2>
  14078. <p>When you configure your FFmpeg build, you can disable any of the
  14079. existing filters using <code class="code">--disable-filters</code>.
  14080. The configure output will show the audio filters included in your
  14081. build.
  14082. </p>
  14083. <p>Below is a description of the currently available audio filters.
  14084. </p>
  14085. <ul class="mini-toc">
  14086. <li><a href="#aap" accesskey="1">aap</a></li>
  14087. <li><a href="#acompressor" accesskey="2">acompressor</a></li>
  14088. <li><a href="#acontrast" accesskey="3">acontrast</a></li>
  14089. <li><a href="#acopy" accesskey="4">acopy</a></li>
  14090. <li><a href="#acrossfade" accesskey="5">acrossfade</a></li>
  14091. <li><a href="#acrossover" accesskey="6">acrossover</a></li>
  14092. <li><a href="#acrusher" accesskey="7">acrusher</a></li>
  14093. <li><a href="#acue" accesskey="8">acue</a></li>
  14094. <li><a href="#adeclick" accesskey="9">adeclick</a></li>
  14095. <li><a href="#adeclip">adeclip</a></li>
  14096. <li><a href="#adecorrelate">adecorrelate</a></li>
  14097. <li><a href="#adelay">adelay</a></li>
  14098. <li><a href="#adenorm">adenorm</a></li>
  14099. <li><a href="#aderivative_002c-aintegral">aderivative, aintegral</a></li>
  14100. <li><a href="#adrc">adrc</a></li>
  14101. <li><a href="#adynamicequalizer">adynamicequalizer</a></li>
  14102. <li><a href="#adynamicsmooth">adynamicsmooth</a></li>
  14103. <li><a href="#aecho">aecho</a></li>
  14104. <li><a href="#aemphasis">aemphasis</a></li>
  14105. <li><a href="#aeval">aeval</a></li>
  14106. <li><a href="#aexciter">aexciter</a></li>
  14107. <li><a href="#afade-1">afade</a></li>
  14108. <li><a href="#afftdn">afftdn</a></li>
  14109. <li><a href="#afftfilt">afftfilt</a></li>
  14110. <li><a href="#afir-1">afir</a></li>
  14111. <li><a href="#aformat-1">aformat</a></li>
  14112. <li><a href="#afreqshift">afreqshift</a></li>
  14113. <li><a href="#afwtdn">afwtdn</a></li>
  14114. <li><a href="#agate">agate</a></li>
  14115. <li><a href="#aiir">aiir</a></li>
  14116. <li><a href="#alimiter">alimiter</a></li>
  14117. <li><a href="#allpass">allpass</a></li>
  14118. <li><a href="#aloop">aloop</a></li>
  14119. <li><a href="#amerge-1">amerge</a></li>
  14120. <li><a href="#amix">amix</a></li>
  14121. <li><a href="#amultiply">amultiply</a></li>
  14122. <li><a href="#anequalizer">anequalizer</a></li>
  14123. <li><a href="#anlmdn">anlmdn</a></li>
  14124. <li><a href="#anlmf_002c-anlms">anlmf, anlms</a></li>
  14125. <li><a href="#anull">anull</a></li>
  14126. <li><a href="#apad">apad</a></li>
  14127. <li><a href="#aphaser">aphaser</a></li>
  14128. <li><a href="#aphaseshift">aphaseshift</a></li>
  14129. <li><a href="#apsnr">apsnr</a></li>
  14130. <li><a href="#apsyclip">apsyclip</a></li>
  14131. <li><a href="#apulsator">apulsator</a></li>
  14132. <li><a href="#aresample-1">aresample</a></li>
  14133. <li><a href="#areverse">areverse</a></li>
  14134. <li><a href="#arls">arls</a></li>
  14135. <li><a href="#arnndn">arnndn</a></li>
  14136. <li><a href="#asdr">asdr</a></li>
  14137. <li><a href="#asetnsamples">asetnsamples</a></li>
  14138. <li><a href="#asetrate">asetrate</a></li>
  14139. <li><a href="#ashowinfo">ashowinfo</a></li>
  14140. <li><a href="#asisdr">asisdr</a></li>
  14141. <li><a href="#asoftclip">asoftclip</a></li>
  14142. <li><a href="#aspectralstats">aspectralstats</a></li>
  14143. <li><a href="#asr">asr</a></li>
  14144. <li><a href="#astats-1">astats</a></li>
  14145. <li><a href="#asubboost">asubboost</a></li>
  14146. <li><a href="#asubcut">asubcut</a></li>
  14147. <li><a href="#asupercut">asupercut</a></li>
  14148. <li><a href="#asuperpass">asuperpass</a></li>
  14149. <li><a href="#asuperstop">asuperstop</a></li>
  14150. <li><a href="#atempo">atempo</a></li>
  14151. <li><a href="#atilt">atilt</a></li>
  14152. <li><a href="#atrim">atrim</a></li>
  14153. <li><a href="#axcorrelate">axcorrelate</a></li>
  14154. <li><a href="#bandpass">bandpass</a></li>
  14155. <li><a href="#bandreject">bandreject</a></li>
  14156. <li><a href="#bass_002c-lowshelf">bass, lowshelf</a></li>
  14157. <li><a href="#biquad">biquad</a></li>
  14158. <li><a href="#bs2b">bs2b</a></li>
  14159. <li><a href="#channelmap">channelmap</a></li>
  14160. <li><a href="#channelsplit">channelsplit</a></li>
  14161. <li><a href="#chorus">chorus</a></li>
  14162. <li><a href="#compand">compand</a></li>
  14163. <li><a href="#compensationdelay">compensationdelay</a></li>
  14164. <li><a href="#crossfeed">crossfeed</a></li>
  14165. <li><a href="#crystalizer">crystalizer</a></li>
  14166. <li><a href="#dcshift">dcshift</a></li>
  14167. <li><a href="#deesser">deesser</a></li>
  14168. <li><a href="#dialoguenhance">dialoguenhance</a></li>
  14169. <li><a href="#drmeter">drmeter</a></li>
  14170. <li><a href="#dynaudnorm">dynaudnorm</a></li>
  14171. <li><a href="#earwax">earwax</a></li>
  14172. <li><a href="#equalizer">equalizer</a></li>
  14173. <li><a href="#extrastereo">extrastereo</a></li>
  14174. <li><a href="#firequalizer">firequalizer</a></li>
  14175. <li><a href="#flanger">flanger</a></li>
  14176. <li><a href="#haas">haas</a></li>
  14177. <li><a href="#hdcd">hdcd</a></li>
  14178. <li><a href="#headphone">headphone</a></li>
  14179. <li><a href="#highpass">highpass</a></li>
  14180. <li><a href="#join">join</a></li>
  14181. <li><a href="#ladspa">ladspa</a></li>
  14182. <li><a href="#loudnorm">loudnorm</a></li>
  14183. <li><a href="#lowpass">lowpass</a></li>
  14184. <li><a href="#lv2">lv2</a></li>
  14185. <li><a href="#mcompand">mcompand</a></li>
  14186. <li><a href="#pan-1">pan</a></li>
  14187. <li><a href="#replaygain">replaygain</a></li>
  14188. <li><a href="#resample">resample</a></li>
  14189. <li><a href="#rubberband">rubberband</a></li>
  14190. <li><a href="#sidechaincompress">sidechaincompress</a></li>
  14191. <li><a href="#sidechaingate">sidechaingate</a></li>
  14192. <li><a href="#silencedetect">silencedetect</a></li>
  14193. <li><a href="#silenceremove">silenceremove</a></li>
  14194. <li><a href="#sofalizer">sofalizer</a></li>
  14195. <li><a href="#speechnorm">speechnorm</a></li>
  14196. <li><a href="#stereotools">stereotools</a></li>
  14197. <li><a href="#stereowiden">stereowiden</a></li>
  14198. <li><a href="#superequalizer">superequalizer</a></li>
  14199. <li><a href="#surround">surround</a></li>
  14200. <li><a href="#tiltshelf">tiltshelf</a></li>
  14201. <li><a href="#treble_002c-highshelf">treble, highshelf</a></li>
  14202. <li><a href="#tremolo">tremolo</a></li>
  14203. <li><a href="#vibrato">vibrato</a></li>
  14204. <li><a href="#virtualbass">virtualbass</a></li>
  14205. <li><a href="#volume">volume</a></li>
  14206. <li><a href="#volumedetect">volumedetect</a></li>
  14207. </ul>
  14208. <div class="section-level-extent" id="aap">
  14209. <h3 class="section"><span>27.1 aap<a class="copiable-link" href="#aap"> &para;</a></span></h3>
  14210. <p>Apply Affine Projection algorithm to the first audio stream using the second audio stream.
  14211. </p>
  14212. <p>This adaptive filter is used to estimate unknown audio based on multiple input audio samples.
  14213. Affine projection algorithm can make trade-offs between computation complexity with convergence speed.
  14214. </p>
  14215. <p>A description of the accepted options follows.
  14216. </p>
  14217. <dl class="table">
  14218. <dt><samp class="option">order</samp></dt>
  14219. <dd><p>Set the filter order.
  14220. </p>
  14221. </dd>
  14222. <dt><samp class="option">projection</samp></dt>
  14223. <dd><p>Set the projection order.
  14224. </p>
  14225. </dd>
  14226. <dt><samp class="option">mu</samp></dt>
  14227. <dd><p>Set the filter mu.
  14228. </p>
  14229. </dd>
  14230. <dt><samp class="option">delta</samp></dt>
  14231. <dd><p>Set the coefficient to initialize internal covariance matrix.
  14232. </p>
  14233. </dd>
  14234. <dt><samp class="option">out_mode</samp></dt>
  14235. <dd><p>Set the filter output samples. It accepts the following values:
  14236. </p><dl class="table">
  14237. <dt><samp class="option">i</samp></dt>
  14238. <dd><p>Pass the 1st input.
  14239. </p>
  14240. </dd>
  14241. <dt><samp class="option">d</samp></dt>
  14242. <dd><p>Pass the 2nd input.
  14243. </p>
  14244. </dd>
  14245. <dt><samp class="option">o</samp></dt>
  14246. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  14247. </p>
  14248. </dd>
  14249. <dt><samp class="option">n</samp></dt>
  14250. <dd><p>Pass difference between input, 1st input and error signal estimate.
  14251. </p>
  14252. </dd>
  14253. <dt><samp class="option">e</samp></dt>
  14254. <dd><p>Pass error signal estimated samples.
  14255. </p>
  14256. <p>Default value is <var class="var">o</var>.
  14257. </p></dd>
  14258. </dl>
  14259. </dd>
  14260. <dt><samp class="option">precision</samp></dt>
  14261. <dd><p>Set which precision to use when processing samples.
  14262. </p>
  14263. <dl class="table">
  14264. <dt><samp class="option">auto</samp></dt>
  14265. <dd><p>Auto pick internal sample format depending on other filters.
  14266. </p>
  14267. </dd>
  14268. <dt><samp class="option">float</samp></dt>
  14269. <dd><p>Always use single-floating point precision sample format.
  14270. </p>
  14271. </dd>
  14272. <dt><samp class="option">double</samp></dt>
  14273. <dd><p>Always use double-floating point precision sample format.
  14274. </p></dd>
  14275. </dl>
  14276. </dd>
  14277. </dl>
  14278. </div>
  14279. <div class="section-level-extent" id="acompressor">
  14280. <h3 class="section"><span>27.2 acompressor<a class="copiable-link" href="#acompressor"> &para;</a></span></h3>
  14281. <p>A compressor is mainly used to reduce the dynamic range of a signal.
  14282. Especially modern music is mostly compressed at a high ratio to
  14283. improve the overall loudness. It&rsquo;s done to get the highest attention
  14284. of a listener, &quot;fatten&quot; the sound and bring more &quot;power&quot; to the track.
  14285. If a signal is compressed too much it may sound dull or &quot;dead&quot;
  14286. afterwards or it may start to &quot;pump&quot; (which could be a powerful effect
  14287. but can also destroy a track completely).
  14288. The right compression is the key to reach a professional sound and is
  14289. the high art of mixing and mastering. Because of its complex settings
  14290. it may take a long time to get the right feeling for this kind of effect.
  14291. </p>
  14292. <p>Compression is done by detecting the volume above a chosen level
  14293. <code class="code">threshold</code> and dividing it by the factor set with <code class="code">ratio</code>.
  14294. So if you set the threshold to -12dB and your signal reaches -6dB a ratio
  14295. of 2:1 will result in a signal at -9dB. Because an exact manipulation of
  14296. the signal would cause distortion of the waveform the reduction can be
  14297. levelled over the time. This is done by setting &quot;Attack&quot; and &quot;Release&quot;.
  14298. <code class="code">attack</code> determines how long the signal has to rise above the threshold
  14299. before any reduction will occur and <code class="code">release</code> sets the time the signal
  14300. has to fall below the threshold to reduce the reduction again. Shorter signals
  14301. than the chosen attack time will be left untouched.
  14302. The overall reduction of the signal can be made up afterwards with the
  14303. <code class="code">makeup</code> setting. So compressing the peaks of a signal about 6dB and
  14304. raising the makeup to this level results in a signal twice as loud than the
  14305. source. To gain a softer entry in the compression the <code class="code">knee</code> flattens the
  14306. hard edge at the threshold in the range of the chosen decibels.
  14307. </p>
  14308. <p>The filter accepts the following options:
  14309. </p>
  14310. <dl class="table">
  14311. <dt><samp class="option">level_in</samp></dt>
  14312. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  14313. </p>
  14314. </dd>
  14315. <dt><samp class="option">mode</samp></dt>
  14316. <dd><p>Set mode of compressor operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  14317. Default is <code class="code">downward</code>.
  14318. </p>
  14319. </dd>
  14320. <dt><samp class="option">threshold</samp></dt>
  14321. <dd><p>If a signal of stream rises above this level it will affect the gain
  14322. reduction.
  14323. By default it is 0.125. Range is between 0.00097563 and 1.
  14324. </p>
  14325. </dd>
  14326. <dt><samp class="option">ratio</samp></dt>
  14327. <dd><p>Set a ratio by which the signal is reduced. 1:2 means that if the level
  14328. rose 4dB above the threshold, it will be only 2dB above after the reduction.
  14329. Default is 2. Range is between 1 and 20.
  14330. </p>
  14331. </dd>
  14332. <dt><samp class="option">attack</samp></dt>
  14333. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  14334. reduction starts. Default is 20. Range is between 0.01 and 2000.
  14335. </p>
  14336. </dd>
  14337. <dt><samp class="option">release</samp></dt>
  14338. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  14339. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  14340. </p>
  14341. </dd>
  14342. <dt><samp class="option">makeup</samp></dt>
  14343. <dd><p>Set the amount by how much signal will be amplified after processing.
  14344. Default is 1. Range is from 1 to 64.
  14345. </p>
  14346. </dd>
  14347. <dt><samp class="option">knee</samp></dt>
  14348. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  14349. Default is 2.82843. Range is between 1 and 8.
  14350. </p>
  14351. </dd>
  14352. <dt><samp class="option">link</samp></dt>
  14353. <dd><p>Choose if the <code class="code">average</code> level between all channels of input stream
  14354. or the louder(<code class="code">maximum</code>) channel of input stream affects the
  14355. reduction. Default is <code class="code">average</code>.
  14356. </p>
  14357. </dd>
  14358. <dt><samp class="option">detection</samp></dt>
  14359. <dd><p>Should the exact signal be taken in case of <code class="code">peak</code> or an RMS one in case
  14360. of <code class="code">rms</code>. Default is <code class="code">rms</code> which is mostly smoother.
  14361. </p>
  14362. </dd>
  14363. <dt><samp class="option">mix</samp></dt>
  14364. <dd><p>How much to use compressed signal in output. Default is 1.
  14365. Range is between 0 and 1.
  14366. </p></dd>
  14367. </dl>
  14368. <ul class="mini-toc">
  14369. <li><a href="#Commands" accesskey="1">Commands</a></li>
  14370. </ul>
  14371. <div class="subsection-level-extent" id="Commands">
  14372. <h4 class="subsection"><span>27.2.1 Commands<a class="copiable-link" href="#Commands"> &para;</a></span></h4>
  14373. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  14374. </p>
  14375. </div>
  14376. </div>
  14377. <div class="section-level-extent" id="acontrast">
  14378. <h3 class="section"><span>27.3 acontrast<a class="copiable-link" href="#acontrast"> &para;</a></span></h3>
  14379. <p>Simple audio dynamic range compression/expansion filter.
  14380. </p>
  14381. <p>The filter accepts the following options:
  14382. </p>
  14383. <dl class="table">
  14384. <dt><samp class="option">contrast</samp></dt>
  14385. <dd><p>Set contrast. Default is 33. Allowed range is between 0 and 100.
  14386. </p></dd>
  14387. </dl>
  14388. </div>
  14389. <div class="section-level-extent" id="acopy">
  14390. <h3 class="section"><span>27.4 acopy<a class="copiable-link" href="#acopy"> &para;</a></span></h3>
  14391. <p>Copy the input audio source unchanged to the output. This is mainly useful for
  14392. testing purposes.
  14393. </p>
  14394. </div>
  14395. <div class="section-level-extent" id="acrossfade">
  14396. <h3 class="section"><span>27.5 acrossfade<a class="copiable-link" href="#acrossfade"> &para;</a></span></h3>
  14397. <p>Apply cross fade from one input audio stream to another input audio stream.
  14398. The cross fade is applied for specified duration near the end of first stream.
  14399. </p>
  14400. <p>The filter accepts the following options:
  14401. </p>
  14402. <dl class="table">
  14403. <dt><samp class="option">nb_samples, ns</samp></dt>
  14404. <dd><p>Specify the number of samples for which the cross fade effect has to last.
  14405. At the end of the cross fade effect the first input audio will be completely
  14406. silent. Default is 44100.
  14407. </p>
  14408. </dd>
  14409. <dt><samp class="option">duration, d</samp></dt>
  14410. <dd><p>Specify the duration of the cross fade effect. See
  14411. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  14412. for the accepted syntax.
  14413. By default the duration is determined by <var class="var">nb_samples</var>.
  14414. If set this option is used instead of <var class="var">nb_samples</var>.
  14415. </p>
  14416. </dd>
  14417. <dt><samp class="option">overlap, o</samp></dt>
  14418. <dd><p>Should first stream end overlap with second stream start. Default is enabled.
  14419. </p>
  14420. </dd>
  14421. <dt><samp class="option">curve1</samp></dt>
  14422. <dd><p>Set curve for cross fade transition for first stream.
  14423. </p>
  14424. </dd>
  14425. <dt><samp class="option">curve2</samp></dt>
  14426. <dd><p>Set curve for cross fade transition for second stream.
  14427. </p>
  14428. <p>For description of available curve types see <a class="ref" href="#afade">afade</a> filter description.
  14429. </p></dd>
  14430. </dl>
  14431. <ul class="mini-toc">
  14432. <li><a href="#Examples-16" accesskey="1">Examples</a></li>
  14433. </ul>
  14434. <div class="subsection-level-extent" id="Examples-16">
  14435. <h4 class="subsection"><span>27.5.1 Examples<a class="copiable-link" href="#Examples-16"> &para;</a></span></h4>
  14436. <ul class="itemize mark-bullet">
  14437. <li>Cross fade from one input to another:
  14438. <div class="example">
  14439. <pre class="example-preformatted">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
  14440. </pre></div>
  14441. </li><li>Cross fade from one input to another but without overlapping:
  14442. <div class="example">
  14443. <pre class="example-preformatted">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
  14444. </pre></div>
  14445. </li></ul>
  14446. </div>
  14447. </div>
  14448. <div class="section-level-extent" id="acrossover">
  14449. <h3 class="section"><span>27.6 acrossover<a class="copiable-link" href="#acrossover"> &para;</a></span></h3>
  14450. <p>Split audio stream into several bands.
  14451. </p>
  14452. <p>This filter splits audio stream into two or more frequency ranges.
  14453. Summing all streams back will give flat output.
  14454. </p>
  14455. <p>The filter accepts the following options:
  14456. </p>
  14457. <dl class="table">
  14458. <dt><samp class="option">split</samp></dt>
  14459. <dd><p>Set split frequencies. Those must be positive and increasing.
  14460. </p>
  14461. </dd>
  14462. <dt><samp class="option">order</samp></dt>
  14463. <dd><p>Set filter order for each band split. This controls filter roll-off or steepness
  14464. of filter transfer function.
  14465. Available values are:
  14466. </p>
  14467. <dl class="table">
  14468. <dt>&lsquo;<samp class="samp">2nd</samp>&rsquo;</dt>
  14469. <dd><p>12 dB per octave.
  14470. </p></dd>
  14471. <dt>&lsquo;<samp class="samp">4th</samp>&rsquo;</dt>
  14472. <dd><p>24 dB per octave.
  14473. </p></dd>
  14474. <dt>&lsquo;<samp class="samp">6th</samp>&rsquo;</dt>
  14475. <dd><p>36 dB per octave.
  14476. </p></dd>
  14477. <dt>&lsquo;<samp class="samp">8th</samp>&rsquo;</dt>
  14478. <dd><p>48 dB per octave.
  14479. </p></dd>
  14480. <dt>&lsquo;<samp class="samp">10th</samp>&rsquo;</dt>
  14481. <dd><p>60 dB per octave.
  14482. </p></dd>
  14483. <dt>&lsquo;<samp class="samp">12th</samp>&rsquo;</dt>
  14484. <dd><p>72 dB per octave.
  14485. </p></dd>
  14486. <dt>&lsquo;<samp class="samp">14th</samp>&rsquo;</dt>
  14487. <dd><p>84 dB per octave.
  14488. </p></dd>
  14489. <dt>&lsquo;<samp class="samp">16th</samp>&rsquo;</dt>
  14490. <dd><p>96 dB per octave.
  14491. </p></dd>
  14492. <dt>&lsquo;<samp class="samp">18th</samp>&rsquo;</dt>
  14493. <dd><p>108 dB per octave.
  14494. </p></dd>
  14495. <dt>&lsquo;<samp class="samp">20th</samp>&rsquo;</dt>
  14496. <dd><p>120 dB per octave.
  14497. </p></dd>
  14498. </dl>
  14499. <p>Default is <var class="var">4th</var>.
  14500. </p>
  14501. </dd>
  14502. <dt><samp class="option">level</samp></dt>
  14503. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  14504. </p>
  14505. </dd>
  14506. <dt><samp class="option">gains</samp></dt>
  14507. <dd><p>Set output gain for each band. Default value is 1 for all bands.
  14508. </p>
  14509. </dd>
  14510. <dt><samp class="option">precision</samp></dt>
  14511. <dd><p>Set which precision to use when processing samples.
  14512. </p>
  14513. <dl class="table">
  14514. <dt><samp class="option">auto</samp></dt>
  14515. <dd><p>Auto pick internal sample format depending on other filters.
  14516. </p>
  14517. </dd>
  14518. <dt><samp class="option">float</samp></dt>
  14519. <dd><p>Always use single-floating point precision sample format.
  14520. </p>
  14521. </dd>
  14522. <dt><samp class="option">double</samp></dt>
  14523. <dd><p>Always use double-floating point precision sample format.
  14524. </p></dd>
  14525. </dl>
  14526. <p>Default value is <code class="code">auto</code>.
  14527. </p></dd>
  14528. </dl>
  14529. <ul class="mini-toc">
  14530. <li><a href="#Examples-17" accesskey="1">Examples</a></li>
  14531. </ul>
  14532. <div class="subsection-level-extent" id="Examples-17">
  14533. <h4 class="subsection"><span>27.6.1 Examples<a class="copiable-link" href="#Examples-17"> &para;</a></span></h4>
  14534. <ul class="itemize mark-bullet">
  14535. <li>Split input audio stream into two bands (low and high) with split frequency of 1500 Hz,
  14536. each band will be in separate stream:
  14537. <div class="example">
  14538. <pre class="example-preformatted">ffmpeg -i in.flac -filter_complex 'acrossover=split=1500[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
  14539. </pre></div>
  14540. </li><li>Same as above, but with higher filter order:
  14541. <div class="example">
  14542. <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
  14543. </pre></div>
  14544. </li><li>Same as above, but also with additional middle band (frequencies between 1500 and 8000):
  14545. <div class="example">
  14546. <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
  14547. </pre></div>
  14548. </li></ul>
  14549. </div>
  14550. </div>
  14551. <div class="section-level-extent" id="acrusher">
  14552. <h3 class="section"><span>27.7 acrusher<a class="copiable-link" href="#acrusher"> &para;</a></span></h3>
  14553. <p>Reduce audio bit resolution.
  14554. </p>
  14555. <p>This filter is bit crusher with enhanced functionality. A bit crusher
  14556. is used to audibly reduce number of bits an audio signal is sampled
  14557. with. This doesn&rsquo;t change the bit depth at all, it just produces the
  14558. effect. Material reduced in bit depth sounds more harsh and &quot;digital&quot;.
  14559. This filter is able to even round to continuous values instead of discrete
  14560. bit depths.
  14561. Additionally it has a D/C offset which results in different crushing of
  14562. the lower and the upper half of the signal.
  14563. An Anti-Aliasing setting is able to produce &quot;softer&quot; crushing sounds.
  14564. </p>
  14565. <p>Another feature of this filter is the logarithmic mode.
  14566. This setting switches from linear distances between bits to logarithmic ones.
  14567. The result is a much more &quot;natural&quot; sounding crusher which doesn&rsquo;t gate low
  14568. signals for example. The human ear has a logarithmic perception,
  14569. so this kind of crushing is much more pleasant.
  14570. Logarithmic crushing is also able to get anti-aliased.
  14571. </p>
  14572. <p>The filter accepts the following options:
  14573. </p>
  14574. <dl class="table">
  14575. <dt><samp class="option">level_in</samp></dt>
  14576. <dd><p>Set level in.
  14577. </p>
  14578. </dd>
  14579. <dt><samp class="option">level_out</samp></dt>
  14580. <dd><p>Set level out.
  14581. </p>
  14582. </dd>
  14583. <dt><samp class="option">bits</samp></dt>
  14584. <dd><p>Set bit reduction.
  14585. </p>
  14586. </dd>
  14587. <dt><samp class="option">mix</samp></dt>
  14588. <dd><p>Set mixing amount.
  14589. </p>
  14590. </dd>
  14591. <dt><samp class="option">mode</samp></dt>
  14592. <dd><p>Can be linear: <code class="code">lin</code> or logarithmic: <code class="code">log</code>.
  14593. </p>
  14594. </dd>
  14595. <dt><samp class="option">dc</samp></dt>
  14596. <dd><p>Set DC.
  14597. </p>
  14598. </dd>
  14599. <dt><samp class="option">aa</samp></dt>
  14600. <dd><p>Set anti-aliasing.
  14601. </p>
  14602. </dd>
  14603. <dt><samp class="option">samples</samp></dt>
  14604. <dd><p>Set sample reduction.
  14605. </p>
  14606. </dd>
  14607. <dt><samp class="option">lfo</samp></dt>
  14608. <dd><p>Enable LFO. By default disabled.
  14609. </p>
  14610. </dd>
  14611. <dt><samp class="option">lforange</samp></dt>
  14612. <dd><p>Set LFO range.
  14613. </p>
  14614. </dd>
  14615. <dt><samp class="option">lforate</samp></dt>
  14616. <dd><p>Set LFO rate.
  14617. </p></dd>
  14618. </dl>
  14619. <ul class="mini-toc">
  14620. <li><a href="#Commands-1" accesskey="1">Commands</a></li>
  14621. </ul>
  14622. <div class="subsection-level-extent" id="Commands-1">
  14623. <h4 class="subsection"><span>27.7.1 Commands<a class="copiable-link" href="#Commands-1"> &para;</a></span></h4>
  14624. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  14625. </p>
  14626. </div>
  14627. </div>
  14628. <div class="section-level-extent" id="acue">
  14629. <h3 class="section"><span>27.8 acue<a class="copiable-link" href="#acue"> &para;</a></span></h3>
  14630. <p>Delay audio filtering until a given wallclock timestamp. See the <a class="ref" href="#cue">cue</a>
  14631. filter.
  14632. </p>
  14633. </div>
  14634. <div class="section-level-extent" id="adeclick">
  14635. <h3 class="section"><span>27.9 adeclick<a class="copiable-link" href="#adeclick"> &para;</a></span></h3>
  14636. <p>Remove impulsive noise from input audio.
  14637. </p>
  14638. <p>Samples detected as impulsive noise are replaced by interpolated samples using
  14639. autoregressive modelling.
  14640. </p>
  14641. <dl class="table">
  14642. <dt><samp class="option">window, w</samp></dt>
  14643. <dd><p>Set window size, in milliseconds. Allowed range is from <code class="code">10</code> to
  14644. <code class="code">100</code>. Default value is <code class="code">55</code> milliseconds.
  14645. This sets size of window which will be processed at once.
  14646. </p>
  14647. </dd>
  14648. <dt><samp class="option">overlap, o</samp></dt>
  14649. <dd><p>Set window overlap, in percentage of window size. Allowed range is from
  14650. <code class="code">50</code> to <code class="code">95</code>. Default value is <code class="code">75</code> percent.
  14651. Setting this to a very high value increases impulsive noise removal but makes
  14652. whole process much slower.
  14653. </p>
  14654. </dd>
  14655. <dt><samp class="option">arorder, a</samp></dt>
  14656. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  14657. <code class="code">0</code> to <code class="code">25</code>. Default value is <code class="code">2</code> percent. This option also
  14658. controls quality of interpolated samples using neighbour good samples.
  14659. </p>
  14660. </dd>
  14661. <dt><samp class="option">threshold, t</samp></dt>
  14662. <dd><p>Set threshold value. Allowed range is from <code class="code">1</code> to <code class="code">100</code>.
  14663. Default value is <code class="code">2</code>.
  14664. This controls the strength of impulsive noise which is going to be removed.
  14665. The lower value, the more samples will be detected as impulsive noise.
  14666. </p>
  14667. </dd>
  14668. <dt><samp class="option">burst, b</samp></dt>
  14669. <dd><p>Set burst fusion, in percentage of window size. Allowed range is <code class="code">0</code> to
  14670. <code class="code">10</code>. Default value is <code class="code">2</code>.
  14671. If any two samples detected as noise are spaced less than this value then any
  14672. sample between those two samples will be also detected as noise.
  14673. </p>
  14674. </dd>
  14675. <dt><samp class="option">method, m</samp></dt>
  14676. <dd><p>Set overlap method.
  14677. </p>
  14678. <p>It accepts the following values:
  14679. </p><dl class="table">
  14680. <dt><samp class="option">add, a</samp></dt>
  14681. <dd><p>Select overlap-add method. Even not interpolated samples are slightly
  14682. changed with this method.
  14683. </p>
  14684. </dd>
  14685. <dt><samp class="option">save, s</samp></dt>
  14686. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  14687. </p></dd>
  14688. </dl>
  14689. <p>Default value is <code class="code">a</code>.
  14690. </p></dd>
  14691. </dl>
  14692. </div>
  14693. <div class="section-level-extent" id="adeclip">
  14694. <h3 class="section"><span>27.10 adeclip<a class="copiable-link" href="#adeclip"> &para;</a></span></h3>
  14695. <p>Remove clipped samples from input audio.
  14696. </p>
  14697. <p>Samples detected as clipped are replaced by interpolated samples using
  14698. autoregressive modelling.
  14699. </p>
  14700. <dl class="table">
  14701. <dt><samp class="option">window, w</samp></dt>
  14702. <dd><p>Set window size, in milliseconds. Allowed range is from <code class="code">10</code> to <code class="code">100</code>.
  14703. Default value is <code class="code">55</code> milliseconds.
  14704. This sets size of window which will be processed at once.
  14705. </p>
  14706. </dd>
  14707. <dt><samp class="option">overlap, o</samp></dt>
  14708. <dd><p>Set window overlap, in percentage of window size. Allowed range is from <code class="code">50</code>
  14709. to <code class="code">95</code>. Default value is <code class="code">75</code> percent.
  14710. </p>
  14711. </dd>
  14712. <dt><samp class="option">arorder, a</samp></dt>
  14713. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  14714. <code class="code">0</code> to <code class="code">25</code>. Default value is <code class="code">8</code> percent. This option also controls
  14715. quality of interpolated samples using neighbour good samples.
  14716. </p>
  14717. </dd>
  14718. <dt><samp class="option">threshold, t</samp></dt>
  14719. <dd><p>Set threshold value. Allowed range is from <code class="code">1</code> to <code class="code">100</code>.
  14720. Default value is <code class="code">10</code>. Higher values make clip detection less aggressive.
  14721. </p>
  14722. </dd>
  14723. <dt><samp class="option">hsize, n</samp></dt>
  14724. <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>.
  14725. Default value is <code class="code">1000</code>. Higher values make clip detection less aggressive.
  14726. </p>
  14727. </dd>
  14728. <dt><samp class="option">method, m</samp></dt>
  14729. <dd><p>Set overlap method.
  14730. </p>
  14731. <p>It accepts the following values:
  14732. </p><dl class="table">
  14733. <dt><samp class="option">add, a</samp></dt>
  14734. <dd><p>Select overlap-add method. Even not interpolated samples are slightly changed
  14735. with this method.
  14736. </p>
  14737. </dd>
  14738. <dt><samp class="option">save, s</samp></dt>
  14739. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  14740. </p></dd>
  14741. </dl>
  14742. <p>Default value is <code class="code">a</code>.
  14743. </p></dd>
  14744. </dl>
  14745. </div>
  14746. <div class="section-level-extent" id="adecorrelate">
  14747. <h3 class="section"><span>27.11 adecorrelate<a class="copiable-link" href="#adecorrelate"> &para;</a></span></h3>
  14748. <p>Apply decorrelation to input audio stream.
  14749. </p>
  14750. <p>The filter accepts the following options:
  14751. </p>
  14752. <dl class="table">
  14753. <dt><samp class="option">stages</samp></dt>
  14754. <dd><p>Set decorrelation stages of filtering. Allowed
  14755. range is from 1 to 16. Default value is 6.
  14756. </p>
  14757. </dd>
  14758. <dt><samp class="option">seed</samp></dt>
  14759. <dd><p>Set random seed used for setting delay in samples across channels.
  14760. </p></dd>
  14761. </dl>
  14762. </div>
  14763. <div class="section-level-extent" id="adelay">
  14764. <h3 class="section"><span>27.12 adelay<a class="copiable-link" href="#adelay"> &para;</a></span></h3>
  14765. <p>Delay one or more audio channels.
  14766. </p>
  14767. <p>Samples in delayed channel are filled with silence.
  14768. </p>
  14769. <p>The filter accepts the following option:
  14770. </p>
  14771. <dl class="table">
  14772. <dt><samp class="option">delays</samp></dt>
  14773. <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
  14774. Unused delays will be silently ignored. If number of given delays is
  14775. smaller than number of channels all remaining channels will not be delayed.
  14776. If you want to delay exact number of samples, append &rsquo;S&rsquo; to number.
  14777. If you want instead to delay in seconds, append &rsquo;s&rsquo; to number.
  14778. </p>
  14779. </dd>
  14780. <dt><samp class="option">all</samp></dt>
  14781. <dd><p>Use last set delay for all remaining channels. By default is disabled.
  14782. This option if enabled changes how option <code class="code">delays</code> is interpreted.
  14783. </p></dd>
  14784. </dl>
  14785. <ul class="mini-toc">
  14786. <li><a href="#Examples-18" accesskey="1">Examples</a></li>
  14787. </ul>
  14788. <div class="subsection-level-extent" id="Examples-18">
  14789. <h4 class="subsection"><span>27.12.1 Examples<a class="copiable-link" href="#Examples-18"> &para;</a></span></h4>
  14790. <ul class="itemize mark-bullet">
  14791. <li>Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
  14792. the second channel (and any other channels that may be present) unchanged.
  14793. <div class="example">
  14794. <pre class="example-preformatted">adelay=1500|0|500
  14795. </pre></div>
  14796. </li><li>Delay second channel by 500 samples, the third channel by 700 samples and leave
  14797. the first channel (and any other channels that may be present) unchanged.
  14798. <div class="example">
  14799. <pre class="example-preformatted">adelay=0|500S|700S
  14800. </pre></div>
  14801. </li><li>Delay all channels by same number of samples:
  14802. <div class="example">
  14803. <pre class="example-preformatted">adelay=delays=64S:all=1
  14804. </pre></div>
  14805. </li></ul>
  14806. </div>
  14807. </div>
  14808. <div class="section-level-extent" id="adenorm">
  14809. <h3 class="section"><span>27.13 adenorm<a class="copiable-link" href="#adenorm"> &para;</a></span></h3>
  14810. <p>Remedy denormals in audio by adding extremely low-level noise.
  14811. </p>
  14812. <p>This filter shall be placed before any filter that can produce denormals.
  14813. </p>
  14814. <p>A description of the accepted parameters follows.
  14815. </p>
  14816. <dl class="table">
  14817. <dt><samp class="option">level</samp></dt>
  14818. <dd><p>Set level of added noise in dB. Default is <code class="code">-351</code>.
  14819. Allowed range is from -451 to -90.
  14820. </p>
  14821. </dd>
  14822. <dt><samp class="option">type</samp></dt>
  14823. <dd><p>Set type of added noise.
  14824. </p>
  14825. <dl class="table">
  14826. <dt><samp class="option">dc</samp></dt>
  14827. <dd><p>Add DC signal.
  14828. </p></dd>
  14829. <dt><samp class="option">ac</samp></dt>
  14830. <dd><p>Add AC signal.
  14831. </p></dd>
  14832. <dt><samp class="option">square</samp></dt>
  14833. <dd><p>Add square signal.
  14834. </p></dd>
  14835. <dt><samp class="option">pulse</samp></dt>
  14836. <dd><p>Add pulse signal.
  14837. </p></dd>
  14838. </dl>
  14839. <p>Default is <code class="code">dc</code>.
  14840. </p></dd>
  14841. </dl>
  14842. <ul class="mini-toc">
  14843. <li><a href="#Commands-2" accesskey="1">Commands</a></li>
  14844. </ul>
  14845. <div class="subsection-level-extent" id="Commands-2">
  14846. <h4 class="subsection"><span>27.13.1 Commands<a class="copiable-link" href="#Commands-2"> &para;</a></span></h4>
  14847. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  14848. </p>
  14849. </div>
  14850. </div>
  14851. <div class="section-level-extent" id="aderivative_002c-aintegral">
  14852. <h3 class="section"><span>27.14 aderivative, aintegral<a class="copiable-link" href="#aderivative_002c-aintegral"> &para;</a></span></h3>
  14853. <p>Compute derivative/integral of audio stream.
  14854. </p>
  14855. <p>Applying both filters one after another produces original audio.
  14856. </p>
  14857. </div>
  14858. <div class="section-level-extent" id="adrc">
  14859. <h3 class="section"><span>27.15 adrc<a class="copiable-link" href="#adrc"> &para;</a></span></h3>
  14860. <p>Apply spectral dynamic range controller filter to input audio stream.
  14861. </p>
  14862. <p>A description of the accepted options follows.
  14863. </p>
  14864. <dl class="table">
  14865. <dt><samp class="option">transfer</samp></dt>
  14866. <dd><p>Set the transfer expression.
  14867. </p>
  14868. <p>The expression can contain the following constants:
  14869. </p>
  14870. <dl class="table">
  14871. <dt><samp class="option">ch</samp></dt>
  14872. <dd><p>current channel number
  14873. </p>
  14874. </dd>
  14875. <dt><samp class="option">sn</samp></dt>
  14876. <dd><p>current sample number
  14877. </p>
  14878. </dd>
  14879. <dt><samp class="option">nb_channels</samp></dt>
  14880. <dd><p>number of channels
  14881. </p>
  14882. </dd>
  14883. <dt><samp class="option">t</samp></dt>
  14884. <dd><p>timestamp expressed in seconds
  14885. </p>
  14886. </dd>
  14887. <dt><samp class="option">sr</samp></dt>
  14888. <dd><p>sample rate
  14889. </p>
  14890. </dd>
  14891. <dt><samp class="option">p</samp></dt>
  14892. <dd><p>current frequency power value, in dB
  14893. </p>
  14894. </dd>
  14895. <dt><samp class="option">f</samp></dt>
  14896. <dd><p>current frequency in Hz
  14897. </p></dd>
  14898. </dl>
  14899. <p>Default value is <code class="code">p</code>.
  14900. </p>
  14901. </dd>
  14902. <dt><samp class="option">attack</samp></dt>
  14903. <dd><p>Set the attack in milliseconds. Default is <code class="code">50</code> milliseconds.
  14904. Allowed range is from 1 to 1000 milliseconds.
  14905. </p></dd>
  14906. <dt><samp class="option">release</samp></dt>
  14907. <dd><p>Set the release in milliseconds. Default is <code class="code">100</code> milliseconds.
  14908. Allowed range is from 5 to 2000 milliseconds.
  14909. </p></dd>
  14910. <dt><samp class="option">channels</samp></dt>
  14911. <dd><p>Set which channels to filter, by default <code class="code">all</code> channels in audio stream are filtered.
  14912. </p></dd>
  14913. </dl>
  14914. <ul class="mini-toc">
  14915. <li><a href="#Commands-3" accesskey="1">Commands</a></li>
  14916. <li><a href="#Examples-19" accesskey="2">Examples</a></li>
  14917. </ul>
  14918. <div class="subsection-level-extent" id="Commands-3">
  14919. <h4 class="subsection"><span>27.15.1 Commands<a class="copiable-link" href="#Commands-3"> &para;</a></span></h4>
  14920. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  14921. </p>
  14922. </div>
  14923. <div class="subsection-level-extent" id="Examples-19">
  14924. <h4 class="subsection"><span>27.15.2 Examples<a class="copiable-link" href="#Examples-19"> &para;</a></span></h4>
  14925. <ul class="itemize mark-bullet">
  14926. <li>Apply spectral compression to all frequencies with threshold of -50 dB and 1:6 ratio:
  14927. <div class="example">
  14928. <pre class="example-preformatted">adrc=transfer='if(gt(p,-50),-50+(p-(-50))/6,p)':attack=50:release=100
  14929. </pre></div>
  14930. </li><li>Similar to above but with 1:2 ratio and filtering only front center channel:
  14931. <div class="example">
  14932. <pre class="example-preformatted">adrc=transfer='if(gt(p,-50),-50+(p-(-50))/2,p)':attack=50:release=100:channels=FC
  14933. </pre></div>
  14934. </li><li>Apply spectral noise gate to all frequencies with threshold of -85 dB and with short attack time and short release time:
  14935. <div class="example">
  14936. <pre class="example-preformatted">adrc=transfer='if(lte(p,-85),p-800,p)':attack=1:release=5
  14937. </pre></div>
  14938. </li><li>Apply spectral expansion to all frequencies with threshold of -10 dB and 1:2 ratio:
  14939. <div class="example">
  14940. <pre class="example-preformatted">adrc=transfer='if(lt(p,-10),-10+(p-(-10))*2,p)':attack=50:release=100
  14941. </pre></div>
  14942. </li><li>Apply limiter to max -60 dB to all frequencies, with attack of 2 ms and release of 10 ms:
  14943. <div class="example">
  14944. <pre class="example-preformatted">adrc=transfer='min(p,-60)':attack=2:release=10
  14945. </pre></div>
  14946. </li></ul>
  14947. </div>
  14948. </div>
  14949. <div class="section-level-extent" id="adynamicequalizer">
  14950. <h3 class="section"><span>27.16 adynamicequalizer<a class="copiable-link" href="#adynamicequalizer"> &para;</a></span></h3>
  14951. <p>Apply dynamic equalization to input audio stream.
  14952. </p>
  14953. <p>A description of the accepted options follows.
  14954. </p>
  14955. <dl class="table">
  14956. <dt><samp class="option">threshold</samp></dt>
  14957. <dd><p>Set the detection threshold used to trigger equalization.
  14958. Threshold detection is using detection filter.
  14959. Default value is 0. Allowed range is from 0 to 100.
  14960. </p>
  14961. </dd>
  14962. <dt><samp class="option">dfrequency</samp></dt>
  14963. <dd><p>Set the detection frequency in Hz used for detection filter used to trigger equalization.
  14964. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz.
  14965. </p>
  14966. </dd>
  14967. <dt><samp class="option">dqfactor</samp></dt>
  14968. <dd><p>Set the detection resonance factor for detection filter used to trigger equalization.
  14969. Default value is 1. Allowed range is from 0.001 to 1000.
  14970. </p>
  14971. </dd>
  14972. <dt><samp class="option">tfrequency</samp></dt>
  14973. <dd><p>Set the target frequency of equalization filter.
  14974. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz.
  14975. </p>
  14976. </dd>
  14977. <dt><samp class="option">tqfactor</samp></dt>
  14978. <dd><p>Set the target resonance factor for target equalization filter.
  14979. Default value is 1. Allowed range is from 0.001 to 1000.
  14980. </p>
  14981. </dd>
  14982. <dt><samp class="option">attack</samp></dt>
  14983. <dd><p>Set the amount of milliseconds the signal from detection has to rise above
  14984. the detection threshold before equalization starts.
  14985. Default is 20. Allowed range is between 1 and 2000.
  14986. </p>
  14987. </dd>
  14988. <dt><samp class="option">release</samp></dt>
  14989. <dd><p>Set the amount of milliseconds the signal from detection has to fall below the
  14990. detection threshold before equalization ends.
  14991. Default is 200. Allowed range is between 1 and 2000.
  14992. </p>
  14993. </dd>
  14994. <dt><samp class="option">ratio</samp></dt>
  14995. <dd><p>Set the ratio by which the equalization gain is raised.
  14996. Default is 1. Allowed range is between 0 and 30.
  14997. </p>
  14998. </dd>
  14999. <dt><samp class="option">makeup</samp></dt>
  15000. <dd><p>Set the makeup offset by which the equalization gain is raised.
  15001. Default is 0. Allowed range is between 0 and 100.
  15002. </p>
  15003. </dd>
  15004. <dt><samp class="option">range</samp></dt>
  15005. <dd><p>Set the max allowed cut/boost amount. Default is 50.
  15006. Allowed range is from 1 to 200.
  15007. </p>
  15008. </dd>
  15009. <dt><samp class="option">mode</samp></dt>
  15010. <dd><p>Set the mode of filter operation, can be one of the following:
  15011. </p>
  15012. <dl class="table">
  15013. <dt>&lsquo;<samp class="samp">listen</samp>&rsquo;</dt>
  15014. <dd><p>Output only isolated detection signal.
  15015. </p></dd>
  15016. <dt>&lsquo;<samp class="samp">cutbelow</samp>&rsquo;</dt>
  15017. <dd><p>Cut frequencies below detection threshold.
  15018. </p></dd>
  15019. <dt>&lsquo;<samp class="samp">cutabove</samp>&rsquo;</dt>
  15020. <dd><p>Cut frequencies above detection threshold.
  15021. </p></dd>
  15022. <dt>&lsquo;<samp class="samp">boostbelow</samp>&rsquo;</dt>
  15023. <dd><p>Boost frequencies below detection threshold.
  15024. </p></dd>
  15025. <dt>&lsquo;<samp class="samp">boostabove</samp>&rsquo;</dt>
  15026. <dd><p>Boost frequencies above detection threshold.
  15027. </p></dd>
  15028. </dl>
  15029. <p>Default mode is &lsquo;<samp class="samp">cutbelow</samp>&rsquo;.
  15030. </p>
  15031. </dd>
  15032. <dt><samp class="option">dftype</samp></dt>
  15033. <dd><p>Set the type of detection filter, can be one of the following:
  15034. </p>
  15035. <dl class="table">
  15036. <dt>&lsquo;<samp class="samp">bandpass</samp>&rsquo;</dt>
  15037. <dt>&lsquo;<samp class="samp">lowpass</samp>&rsquo;</dt>
  15038. <dt>&lsquo;<samp class="samp">highpass</samp>&rsquo;</dt>
  15039. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  15040. </dl>
  15041. <p>Default type is &lsquo;<samp class="samp">bandpass</samp>&rsquo;.
  15042. </p>
  15043. </dd>
  15044. <dt><samp class="option">tftype</samp></dt>
  15045. <dd><p>Set the type of target filter, can be one of the following:
  15046. </p>
  15047. <dl class="table">
  15048. <dt>&lsquo;<samp class="samp">bell</samp>&rsquo;</dt>
  15049. <dt>&lsquo;<samp class="samp">lowshelf</samp>&rsquo;</dt>
  15050. <dt>&lsquo;<samp class="samp">highshelf</samp>&rsquo;</dt>
  15051. </dl>
  15052. <p>Default type is &lsquo;<samp class="samp">bell</samp>&rsquo;.
  15053. </p>
  15054. </dd>
  15055. <dt><samp class="option">auto</samp></dt>
  15056. <dd><p>Automatically gather threshold from detection filter. By default
  15057. is &lsquo;<samp class="samp">disabled</samp>&rsquo;.
  15058. This option is useful to detect threshold in certain time frame of
  15059. input audio stream, in such case option value is changed at runtime.
  15060. </p>
  15061. <p>Available values are:
  15062. </p><dl class="table">
  15063. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  15064. <dd><p>Disable using automatically gathered threshold value.
  15065. </p></dd>
  15066. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  15067. <dd><p>Stop picking threshold value.
  15068. </p></dd>
  15069. <dt>&lsquo;<samp class="samp">on</samp>&rsquo;</dt>
  15070. <dd><p>Start picking threshold value.
  15071. </p></dd>
  15072. <dt>&lsquo;<samp class="samp">adaptive</samp>&rsquo;</dt>
  15073. <dd><p>Adaptively pick threshold value, by calculating sliding window entropy.
  15074. </p></dd>
  15075. </dl>
  15076. </dd>
  15077. <dt><samp class="option">precision</samp></dt>
  15078. <dd><p>Set which precision to use when processing samples.
  15079. </p>
  15080. <dl class="table">
  15081. <dt><samp class="option">auto</samp></dt>
  15082. <dd><p>Auto pick internal sample format depending on other filters.
  15083. </p>
  15084. </dd>
  15085. <dt><samp class="option">float</samp></dt>
  15086. <dd><p>Always use single-floating point precision sample format.
  15087. </p>
  15088. </dd>
  15089. <dt><samp class="option">double</samp></dt>
  15090. <dd><p>Always use double-floating point precision sample format.
  15091. </p></dd>
  15092. </dl>
  15093. </dd>
  15094. </dl>
  15095. <ul class="mini-toc">
  15096. <li><a href="#Commands-4" accesskey="1">Commands</a></li>
  15097. </ul>
  15098. <div class="subsection-level-extent" id="Commands-4">
  15099. <h4 class="subsection"><span>27.16.1 Commands<a class="copiable-link" href="#Commands-4"> &para;</a></span></h4>
  15100. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  15101. </p>
  15102. </div>
  15103. </div>
  15104. <div class="section-level-extent" id="adynamicsmooth">
  15105. <h3 class="section"><span>27.17 adynamicsmooth<a class="copiable-link" href="#adynamicsmooth"> &para;</a></span></h3>
  15106. <p>Apply dynamic smoothing to input audio stream.
  15107. </p>
  15108. <p>A description of the accepted options follows.
  15109. </p>
  15110. <dl class="table">
  15111. <dt><samp class="option">sensitivity</samp></dt>
  15112. <dd><p>Set an amount of sensitivity to frequency fluctations. Default is 2.
  15113. Allowed range is from 0 to 1e+06.
  15114. </p>
  15115. </dd>
  15116. <dt><samp class="option">basefreq</samp></dt>
  15117. <dd><p>Set a base frequency for smoothing. Default value is 22050.
  15118. Allowed range is from 2 to 1e+06.
  15119. </p></dd>
  15120. </dl>
  15121. <ul class="mini-toc">
  15122. <li><a href="#Commands-5" accesskey="1">Commands</a></li>
  15123. </ul>
  15124. <div class="subsection-level-extent" id="Commands-5">
  15125. <h4 class="subsection"><span>27.17.1 Commands<a class="copiable-link" href="#Commands-5"> &para;</a></span></h4>
  15126. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  15127. </p>
  15128. </div>
  15129. </div>
  15130. <div class="section-level-extent" id="aecho">
  15131. <h3 class="section"><span>27.18 aecho<a class="copiable-link" href="#aecho"> &para;</a></span></h3>
  15132. <p>Apply echoing to the input audio.
  15133. </p>
  15134. <p>Echoes are reflected sound and can occur naturally amongst mountains
  15135. (and sometimes large buildings) when talking or shouting; digital echo
  15136. effects emulate this behaviour and are often used to help fill out the
  15137. sound of a single instrument or vocal. The time difference between the
  15138. original signal and the reflection is the <code class="code">delay</code>, and the
  15139. loudness of the reflected signal is the <code class="code">decay</code>.
  15140. Multiple echoes can have different delays and decays.
  15141. </p>
  15142. <p>A description of the accepted parameters follows.
  15143. </p>
  15144. <dl class="table">
  15145. <dt><samp class="option">in_gain</samp></dt>
  15146. <dd><p>Set input gain of reflected signal. Default is <code class="code">0.6</code>.
  15147. </p>
  15148. </dd>
  15149. <dt><samp class="option">out_gain</samp></dt>
  15150. <dd><p>Set output gain of reflected signal. Default is <code class="code">0.3</code>.
  15151. </p>
  15152. </dd>
  15153. <dt><samp class="option">delays</samp></dt>
  15154. <dd><p>Set list of time intervals in milliseconds between original signal and reflections
  15155. separated by &rsquo;|&rsquo;. Allowed range for each <code class="code">delay</code> is <code class="code">(0 - 90000.0]</code>.
  15156. Default is <code class="code">1000</code>.
  15157. </p>
  15158. </dd>
  15159. <dt><samp class="option">decays</samp></dt>
  15160. <dd><p>Set list of loudness of reflected signals separated by &rsquo;|&rsquo;.
  15161. Allowed range for each <code class="code">decay</code> is <code class="code">(0 - 1.0]</code>.
  15162. Default is <code class="code">0.5</code>.
  15163. </p></dd>
  15164. </dl>
  15165. <ul class="mini-toc">
  15166. <li><a href="#Examples-20" accesskey="1">Examples</a></li>
  15167. </ul>
  15168. <div class="subsection-level-extent" id="Examples-20">
  15169. <h4 class="subsection"><span>27.18.1 Examples<a class="copiable-link" href="#Examples-20"> &para;</a></span></h4>
  15170. <ul class="itemize mark-bullet">
  15171. <li>Make it sound as if there are twice as many instruments as are actually playing:
  15172. <div class="example">
  15173. <pre class="example-preformatted">aecho=0.8:0.88:60:0.4
  15174. </pre></div>
  15175. </li><li>If delay is very short, then it sounds like a (metallic) robot playing music:
  15176. <div class="example">
  15177. <pre class="example-preformatted">aecho=0.8:0.88:6:0.4
  15178. </pre></div>
  15179. </li><li>A longer delay will sound like an open air concert in the mountains:
  15180. <div class="example">
  15181. <pre class="example-preformatted">aecho=0.8:0.9:1000:0.3
  15182. </pre></div>
  15183. </li><li>Same as above but with one more mountain:
  15184. <div class="example">
  15185. <pre class="example-preformatted">aecho=0.8:0.9:1000|1800:0.3|0.25
  15186. </pre></div>
  15187. </li></ul>
  15188. </div>
  15189. </div>
  15190. <div class="section-level-extent" id="aemphasis">
  15191. <h3 class="section"><span>27.19 aemphasis<a class="copiable-link" href="#aemphasis"> &para;</a></span></h3>
  15192. <p>Audio emphasis filter creates or restores material directly taken from LPs or
  15193. emphased CDs with different filter curves. E.g. to store music on vinyl the
  15194. signal has to be altered by a filter first to even out the disadvantages of
  15195. this recording medium.
  15196. Once the material is played back the inverse filter has to be applied to
  15197. restore the distortion of the frequency response.
  15198. </p>
  15199. <p>The filter accepts the following options:
  15200. </p>
  15201. <dl class="table">
  15202. <dt><samp class="option">level_in</samp></dt>
  15203. <dd><p>Set input gain.
  15204. </p>
  15205. </dd>
  15206. <dt><samp class="option">level_out</samp></dt>
  15207. <dd><p>Set output gain.
  15208. </p>
  15209. </dd>
  15210. <dt><samp class="option">mode</samp></dt>
  15211. <dd><p>Set filter mode. For restoring material use <code class="code">reproduction</code> mode, otherwise
  15212. use <code class="code">production</code> mode. Default is <code class="code">reproduction</code> mode.
  15213. </p>
  15214. </dd>
  15215. <dt><samp class="option">type</samp></dt>
  15216. <dd><p>Set filter type. Selects medium. Can be one of the following:
  15217. </p>
  15218. <dl class="table">
  15219. <dt><samp class="option">col</samp></dt>
  15220. <dd><p>select Columbia.
  15221. </p></dd>
  15222. <dt><samp class="option">emi</samp></dt>
  15223. <dd><p>select EMI.
  15224. </p></dd>
  15225. <dt><samp class="option">bsi</samp></dt>
  15226. <dd><p>select BSI (78RPM).
  15227. </p></dd>
  15228. <dt><samp class="option">riaa</samp></dt>
  15229. <dd><p>select RIAA.
  15230. </p></dd>
  15231. <dt><samp class="option">cd</samp></dt>
  15232. <dd><p>select Compact Disc (CD).
  15233. </p></dd>
  15234. <dt><samp class="option">50fm</samp></dt>
  15235. <dd><p>select 50µs (FM).
  15236. </p></dd>
  15237. <dt><samp class="option">75fm</samp></dt>
  15238. <dd><p>select 75µs (FM).
  15239. </p></dd>
  15240. <dt><samp class="option">50kf</samp></dt>
  15241. <dd><p>select 50µs (FM-KF).
  15242. </p></dd>
  15243. <dt><samp class="option">75kf</samp></dt>
  15244. <dd><p>select 75µs (FM-KF).
  15245. </p></dd>
  15246. </dl>
  15247. </dd>
  15248. </dl>
  15249. <ul class="mini-toc">
  15250. <li><a href="#Commands-6" accesskey="1">Commands</a></li>
  15251. </ul>
  15252. <div class="subsection-level-extent" id="Commands-6">
  15253. <h4 class="subsection"><span>27.19.1 Commands<a class="copiable-link" href="#Commands-6"> &para;</a></span></h4>
  15254. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  15255. </p>
  15256. </div>
  15257. </div>
  15258. <div class="section-level-extent" id="aeval">
  15259. <h3 class="section"><span>27.20 aeval<a class="copiable-link" href="#aeval"> &para;</a></span></h3>
  15260. <p>Modify an audio signal according to the specified expressions.
  15261. </p>
  15262. <p>This filter accepts one or more expressions (one for each channel),
  15263. which are evaluated and used to modify a corresponding audio signal.
  15264. </p>
  15265. <p>It accepts the following parameters:
  15266. </p>
  15267. <dl class="table">
  15268. <dt><samp class="option">exprs</samp></dt>
  15269. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. If
  15270. the number of input channels is greater than the number of
  15271. expressions, the last specified expression is used for the remaining
  15272. output channels.
  15273. </p>
  15274. </dd>
  15275. <dt><samp class="option">channel_layout, c</samp></dt>
  15276. <dd><p>Set output channel layout. If not specified, the channel layout is
  15277. specified by the number of expressions. If set to &lsquo;<samp class="samp">same</samp>&rsquo;, it will
  15278. use by default the same input channel layout.
  15279. </p></dd>
  15280. </dl>
  15281. <p>Each expression in <var class="var">exprs</var> can contain the following constants and functions:
  15282. </p>
  15283. <dl class="table">
  15284. <dt><samp class="option">ch</samp></dt>
  15285. <dd><p>channel number of the current expression
  15286. </p>
  15287. </dd>
  15288. <dt><samp class="option">n</samp></dt>
  15289. <dd><p>number of the evaluated sample, starting from 0
  15290. </p>
  15291. </dd>
  15292. <dt><samp class="option">s</samp></dt>
  15293. <dd><p>sample rate
  15294. </p>
  15295. </dd>
  15296. <dt><samp class="option">t</samp></dt>
  15297. <dd><p>time of the evaluated sample expressed in seconds
  15298. </p>
  15299. </dd>
  15300. <dt><samp class="option">nb_in_channels</samp></dt>
  15301. <dt><samp class="option">nb_out_channels</samp></dt>
  15302. <dd><p>input and output number of channels
  15303. </p>
  15304. </dd>
  15305. <dt><samp class="option">val(CH)</samp></dt>
  15306. <dd><p>the value of input channel with number <var class="var">CH</var>
  15307. </p></dd>
  15308. </dl>
  15309. <p>Note: this filter is slow. For faster processing you should use a
  15310. dedicated filter.
  15311. </p>
  15312. <ul class="mini-toc">
  15313. <li><a href="#Examples-21" accesskey="1">Examples</a></li>
  15314. </ul>
  15315. <div class="subsection-level-extent" id="Examples-21">
  15316. <h4 class="subsection"><span>27.20.1 Examples<a class="copiable-link" href="#Examples-21"> &para;</a></span></h4>
  15317. <ul class="itemize mark-bullet">
  15318. <li>Half volume:
  15319. <div class="example">
  15320. <pre class="example-preformatted">aeval=val(ch)/2:c=same
  15321. </pre></div>
  15322. </li><li>Invert phase of the second channel:
  15323. <div class="example">
  15324. <pre class="example-preformatted">aeval=val(0)|-val(1)
  15325. </pre></div>
  15326. </li></ul>
  15327. </div>
  15328. </div>
  15329. <div class="section-level-extent" id="aexciter">
  15330. <h3 class="section"><span>27.21 aexciter<a class="copiable-link" href="#aexciter"> &para;</a></span></h3>
  15331. <p>An exciter is used to produce high sound that is not present in the
  15332. original signal. This is done by creating harmonic distortions of the
  15333. signal which are restricted in range and added to the original signal.
  15334. An Exciter raises the upper end of an audio signal without simply raising
  15335. the higher frequencies like an equalizer would do to create a more
  15336. &quot;crisp&quot; or &quot;brilliant&quot; sound.
  15337. </p>
  15338. <p>The filter accepts the following options:
  15339. </p>
  15340. <dl class="table">
  15341. <dt><samp class="option">level_in</samp></dt>
  15342. <dd><p>Set input level prior processing of signal.
  15343. Allowed range is from 0 to 64.
  15344. Default value is 1.
  15345. </p>
  15346. </dd>
  15347. <dt><samp class="option">level_out</samp></dt>
  15348. <dd><p>Set output level after processing of signal.
  15349. Allowed range is from 0 to 64.
  15350. Default value is 1.
  15351. </p>
  15352. </dd>
  15353. <dt><samp class="option">amount</samp></dt>
  15354. <dd><p>Set the amount of harmonics added to original signal.
  15355. Allowed range is from 0 to 64.
  15356. Default value is 1.
  15357. </p>
  15358. </dd>
  15359. <dt><samp class="option">drive</samp></dt>
  15360. <dd><p>Set the amount of newly created harmonics.
  15361. Allowed range is from 0.1 to 10.
  15362. Default value is 8.5.
  15363. </p>
  15364. </dd>
  15365. <dt><samp class="option">blend</samp></dt>
  15366. <dd><p>Set the octave of newly created harmonics.
  15367. Allowed range is from -10 to 10.
  15368. Default value is 0.
  15369. </p>
  15370. </dd>
  15371. <dt><samp class="option">freq</samp></dt>
  15372. <dd><p>Set the lower frequency limit of producing harmonics in Hz.
  15373. Allowed range is from 2000 to 12000 Hz.
  15374. Default is 7500 Hz.
  15375. </p>
  15376. </dd>
  15377. <dt><samp class="option">ceil</samp></dt>
  15378. <dd><p>Set the upper frequency limit of producing harmonics.
  15379. Allowed range is from 9999 to 20000 Hz.
  15380. If value is lower than 10000 Hz no limit is applied.
  15381. </p>
  15382. </dd>
  15383. <dt><samp class="option">listen</samp></dt>
  15384. <dd><p>Mute the original signal and output only added harmonics.
  15385. By default is disabled.
  15386. </p></dd>
  15387. </dl>
  15388. <ul class="mini-toc">
  15389. <li><a href="#Commands-7" accesskey="1">Commands</a></li>
  15390. </ul>
  15391. <div class="subsection-level-extent" id="Commands-7">
  15392. <h4 class="subsection"><span>27.21.1 Commands<a class="copiable-link" href="#Commands-7"> &para;</a></span></h4>
  15393. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  15394. </p>
  15395. <a class="anchor" id="afade"></a></div>
  15396. </div>
  15397. <div class="section-level-extent" id="afade-1">
  15398. <h3 class="section"><span>27.22 afade<a class="copiable-link" href="#afade-1"> &para;</a></span></h3>
  15399. <p>Apply fade-in/out effect to input audio.
  15400. </p>
  15401. <p>A description of the accepted parameters follows.
  15402. </p>
  15403. <dl class="table">
  15404. <dt><samp class="option">type, t</samp></dt>
  15405. <dd><p>Specify the effect type, can be either <code class="code">in</code> for fade-in, or
  15406. <code class="code">out</code> for a fade-out effect. Default is <code class="code">in</code>.
  15407. </p>
  15408. </dd>
  15409. <dt><samp class="option">start_sample, ss</samp></dt>
  15410. <dd><p>Specify the number of the start sample for starting to apply the fade
  15411. effect. Default is 0.
  15412. </p>
  15413. </dd>
  15414. <dt><samp class="option">nb_samples, ns</samp></dt>
  15415. <dd><p>Specify the number of samples for which the fade effect has to last. At
  15416. the end of the fade-in effect the output audio will have the same
  15417. volume as the input audio, at the end of the fade-out transition
  15418. the output audio will be silence. Default is 44100.
  15419. </p>
  15420. </dd>
  15421. <dt><samp class="option">start_time, st</samp></dt>
  15422. <dd><p>Specify the start time of the fade effect. Default is 0.
  15423. The value must be specified as a time duration; see
  15424. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  15425. for the accepted syntax.
  15426. If set this option is used instead of <var class="var">start_sample</var>.
  15427. </p>
  15428. </dd>
  15429. <dt><samp class="option">duration, d</samp></dt>
  15430. <dd><p>Specify the duration of the fade effect. See
  15431. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  15432. for the accepted syntax.
  15433. At the end of the fade-in effect the output audio will have the same
  15434. volume as the input audio, at the end of the fade-out transition
  15435. the output audio will be silence.
  15436. By default the duration is determined by <var class="var">nb_samples</var>.
  15437. If set this option is used instead of <var class="var">nb_samples</var>.
  15438. </p>
  15439. </dd>
  15440. <dt><samp class="option">curve</samp></dt>
  15441. <dd><p>Set curve for fade transition.
  15442. </p>
  15443. <p>It accepts the following values:
  15444. </p><dl class="table">
  15445. <dt><samp class="option">tri</samp></dt>
  15446. <dd><p>select triangular, linear slope (default)
  15447. </p></dd>
  15448. <dt><samp class="option">qsin</samp></dt>
  15449. <dd><p>select quarter of sine wave
  15450. </p></dd>
  15451. <dt><samp class="option">hsin</samp></dt>
  15452. <dd><p>select half of sine wave
  15453. </p></dd>
  15454. <dt><samp class="option">esin</samp></dt>
  15455. <dd><p>select exponential sine wave
  15456. </p></dd>
  15457. <dt><samp class="option">log</samp></dt>
  15458. <dd><p>select logarithmic
  15459. </p></dd>
  15460. <dt><samp class="option">ipar</samp></dt>
  15461. <dd><p>select inverted parabola
  15462. </p></dd>
  15463. <dt><samp class="option">qua</samp></dt>
  15464. <dd><p>select quadratic
  15465. </p></dd>
  15466. <dt><samp class="option">cub</samp></dt>
  15467. <dd><p>select cubic
  15468. </p></dd>
  15469. <dt><samp class="option">squ</samp></dt>
  15470. <dd><p>select square root
  15471. </p></dd>
  15472. <dt><samp class="option">cbr</samp></dt>
  15473. <dd><p>select cubic root
  15474. </p></dd>
  15475. <dt><samp class="option">par</samp></dt>
  15476. <dd><p>select parabola
  15477. </p></dd>
  15478. <dt><samp class="option">exp</samp></dt>
  15479. <dd><p>select exponential
  15480. </p></dd>
  15481. <dt><samp class="option">iqsin</samp></dt>
  15482. <dd><p>select inverted quarter of sine wave
  15483. </p></dd>
  15484. <dt><samp class="option">ihsin</samp></dt>
  15485. <dd><p>select inverted half of sine wave
  15486. </p></dd>
  15487. <dt><samp class="option">dese</samp></dt>
  15488. <dd><p>select double-exponential seat
  15489. </p></dd>
  15490. <dt><samp class="option">desi</samp></dt>
  15491. <dd><p>select double-exponential sigmoid
  15492. </p></dd>
  15493. <dt><samp class="option">losi</samp></dt>
  15494. <dd><p>select logistic sigmoid
  15495. </p></dd>
  15496. <dt><samp class="option">sinc</samp></dt>
  15497. <dd><p>select sine cardinal function
  15498. </p></dd>
  15499. <dt><samp class="option">isinc</samp></dt>
  15500. <dd><p>select inverted sine cardinal function
  15501. </p></dd>
  15502. <dt><samp class="option">quat</samp></dt>
  15503. <dd><p>select quartic
  15504. </p></dd>
  15505. <dt><samp class="option">quatr</samp></dt>
  15506. <dd><p>select quartic root
  15507. </p></dd>
  15508. <dt><samp class="option">qsin2</samp></dt>
  15509. <dd><p>select squared quarter of sine wave
  15510. </p></dd>
  15511. <dt><samp class="option">hsin2</samp></dt>
  15512. <dd><p>select squared half of sine wave
  15513. </p></dd>
  15514. <dt><samp class="option">nofade</samp></dt>
  15515. <dd><p>no fade applied
  15516. </p></dd>
  15517. </dl>
  15518. </dd>
  15519. <dt><samp class="option">silence</samp></dt>
  15520. <dd><p>Set the initial gain for fade-in or final gain for fade-out.
  15521. Default value is <code class="code">0.0</code>.
  15522. </p>
  15523. </dd>
  15524. <dt><samp class="option">unity</samp></dt>
  15525. <dd><p>Set the initial gain for fade-out or final gain for fade-in.
  15526. Default value is <code class="code">1.0</code>.
  15527. </p></dd>
  15528. </dl>
  15529. <ul class="mini-toc">
  15530. <li><a href="#Commands-8" accesskey="1">Commands</a></li>
  15531. <li><a href="#Examples-22" accesskey="2">Examples</a></li>
  15532. </ul>
  15533. <div class="subsection-level-extent" id="Commands-8">
  15534. <h4 class="subsection"><span>27.22.1 Commands<a class="copiable-link" href="#Commands-8"> &para;</a></span></h4>
  15535. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  15536. </p>
  15537. </div>
  15538. <div class="subsection-level-extent" id="Examples-22">
  15539. <h4 class="subsection"><span>27.22.2 Examples<a class="copiable-link" href="#Examples-22"> &para;</a></span></h4>
  15540. <ul class="itemize mark-bullet">
  15541. <li>Fade in first 15 seconds of audio:
  15542. <div class="example">
  15543. <pre class="example-preformatted">afade=t=in:ss=0:d=15
  15544. </pre></div>
  15545. </li><li>Fade out last 25 seconds of a 900 seconds audio:
  15546. <div class="example">
  15547. <pre class="example-preformatted">afade=t=out:st=875:d=25
  15548. </pre></div>
  15549. </li></ul>
  15550. </div>
  15551. </div>
  15552. <div class="section-level-extent" id="afftdn">
  15553. <h3 class="section"><span>27.23 afftdn<a class="copiable-link" href="#afftdn"> &para;</a></span></h3>
  15554. <p>Denoise audio samples with FFT.
  15555. </p>
  15556. <p>A description of the accepted parameters follows.
  15557. </p>
  15558. <dl class="table">
  15559. <dt><samp class="option">noise_reduction, nr</samp></dt>
  15560. <dd><p>Set the noise reduction in dB, allowed range is 0.01 to 97.
  15561. Default value is 12 dB.
  15562. </p>
  15563. </dd>
  15564. <dt><samp class="option">noise_floor, nf</samp></dt>
  15565. <dd><p>Set the noise floor in dB, allowed range is -80 to -20.
  15566. Default value is -50 dB.
  15567. </p>
  15568. </dd>
  15569. <dt><samp class="option">noise_type, nt</samp></dt>
  15570. <dd><p>Set the noise type.
  15571. </p>
  15572. <p>It accepts the following values:
  15573. </p><dl class="table">
  15574. <dt><samp class="option">white, w</samp></dt>
  15575. <dd><p>Select white noise.
  15576. </p>
  15577. </dd>
  15578. <dt><samp class="option">vinyl, v</samp></dt>
  15579. <dd><p>Select vinyl noise.
  15580. </p>
  15581. </dd>
  15582. <dt><samp class="option">shellac, s</samp></dt>
  15583. <dd><p>Select shellac noise.
  15584. </p>
  15585. </dd>
  15586. <dt><samp class="option">custom, c</samp></dt>
  15587. <dd><p>Select custom noise, defined in <code class="code">bn</code> option.
  15588. </p>
  15589. <p>Default value is white noise.
  15590. </p></dd>
  15591. </dl>
  15592. </dd>
  15593. <dt><samp class="option">band_noise, bn</samp></dt>
  15594. <dd><p>Set custom band noise profile for every one of 15 bands.
  15595. Bands are separated by &rsquo; &rsquo; or &rsquo;|&rsquo;.
  15596. </p>
  15597. </dd>
  15598. <dt><samp class="option">residual_floor, rf</samp></dt>
  15599. <dd><p>Set the residual floor in dB, allowed range is -80 to -20.
  15600. Default value is -38 dB.
  15601. </p>
  15602. </dd>
  15603. <dt><samp class="option">track_noise, tn</samp></dt>
  15604. <dd><p>Enable noise floor tracking. By default is disabled.
  15605. With this enabled, noise floor is automatically adjusted.
  15606. </p>
  15607. </dd>
  15608. <dt><samp class="option">track_residual, tr</samp></dt>
  15609. <dd><p>Enable residual tracking. By default is disabled.
  15610. </p>
  15611. </dd>
  15612. <dt><samp class="option">output_mode, om</samp></dt>
  15613. <dd><p>Set the output mode.
  15614. </p>
  15615. <p>It accepts the following values:
  15616. </p><dl class="table">
  15617. <dt><samp class="option">input, i</samp></dt>
  15618. <dd><p>Pass input unchanged.
  15619. </p>
  15620. </dd>
  15621. <dt><samp class="option">output, o</samp></dt>
  15622. <dd><p>Pass noise filtered out.
  15623. </p>
  15624. </dd>
  15625. <dt><samp class="option">noise, n</samp></dt>
  15626. <dd><p>Pass only noise.
  15627. </p>
  15628. <p>Default value is <var class="var">output</var>.
  15629. </p></dd>
  15630. </dl>
  15631. </dd>
  15632. <dt><samp class="option">adaptivity, ad</samp></dt>
  15633. <dd><p>Set the adaptivity factor, used how fast to adapt gains adjustments per
  15634. each frequency bin. Value <var class="var">0</var> enables instant adaptation, while higher values
  15635. react much slower.
  15636. Allowed range is from <var class="var">0</var> to <var class="var">1</var>. Default value is <var class="var">0.5</var>.
  15637. </p>
  15638. </dd>
  15639. <dt><samp class="option">floor_offset, fo</samp></dt>
  15640. <dd><p>Set the noise floor offset factor. This option is used to adjust offset applied to measured
  15641. noise floor. It is only effective when noise floor tracking is enabled.
  15642. 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>.
  15643. </p>
  15644. </dd>
  15645. <dt><samp class="option">noise_link, nl</samp></dt>
  15646. <dd><p>Set the noise link used for multichannel audio.
  15647. </p>
  15648. <p>It accepts the following values:
  15649. </p><dl class="table">
  15650. <dt><samp class="option">none</samp></dt>
  15651. <dd><p>Use unchanged channel&rsquo;s noise floor.
  15652. </p>
  15653. </dd>
  15654. <dt><samp class="option">min</samp></dt>
  15655. <dd><p>Use measured min noise floor of all channels.
  15656. </p>
  15657. </dd>
  15658. <dt><samp class="option">max</samp></dt>
  15659. <dd><p>Use measured max noise floor of all channels.
  15660. </p>
  15661. </dd>
  15662. <dt><samp class="option">average</samp></dt>
  15663. <dd><p>Use measured average noise floor of all channels.
  15664. </p>
  15665. <p>Default value is <var class="var">min</var>.
  15666. </p></dd>
  15667. </dl>
  15668. </dd>
  15669. <dt><samp class="option">band_multiplier, bm</samp></dt>
  15670. <dd><p>Set the band multiplier factor, used how much to spread bands across frequency bins.
  15671. 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>.
  15672. </p>
  15673. </dd>
  15674. <dt><samp class="option">sample_noise, sn</samp></dt>
  15675. <dd><p>Toggle capturing and measurement of noise profile from input audio.
  15676. </p>
  15677. <p>It accepts the following values:
  15678. </p><dl class="table">
  15679. <dt><samp class="option">start, begin</samp></dt>
  15680. <dd><p>Start sample noise capture.
  15681. </p>
  15682. </dd>
  15683. <dt><samp class="option">stop, end</samp></dt>
  15684. <dd><p>Stop sample noise capture and measure new noise band profile.
  15685. </p>
  15686. <p>Default value is <code class="code">none</code>.
  15687. </p></dd>
  15688. </dl>
  15689. </dd>
  15690. <dt><samp class="option">gain_smooth, gs</samp></dt>
  15691. <dd><p>Set gain smooth spatial radius, used to smooth gains applied to each frequency bin.
  15692. Useful to reduce random music noise artefacts.
  15693. Higher values increases smoothing of gains.
  15694. Allowed range is from <code class="code">0</code> to <code class="code">50</code>.
  15695. Default value is <code class="code">0</code>.
  15696. </p></dd>
  15697. </dl>
  15698. <ul class="mini-toc">
  15699. <li><a href="#Commands-9" accesskey="1">Commands</a></li>
  15700. <li><a href="#Examples-23" accesskey="2">Examples</a></li>
  15701. </ul>
  15702. <div class="subsection-level-extent" id="Commands-9">
  15703. <h4 class="subsection"><span>27.23.1 Commands<a class="copiable-link" href="#Commands-9"> &para;</a></span></h4>
  15704. <p>This filter supports the some above mentioned options as <a class="ref" href="#commands">commands</a>.
  15705. </p>
  15706. </div>
  15707. <div class="subsection-level-extent" id="Examples-23">
  15708. <h4 class="subsection"><span>27.23.2 Examples<a class="copiable-link" href="#Examples-23"> &para;</a></span></h4>
  15709. <ul class="itemize mark-bullet">
  15710. <li>Reduce white noise by 10dB, and use previously measured noise floor of -40dB:
  15711. <div class="example">
  15712. <pre class="example-preformatted">afftdn=nr=10:nf=-40
  15713. </pre></div>
  15714. </li><li>Reduce white noise by 10dB, also set initial noise floor to -80dB and enable automatic
  15715. tracking of noise floor so noise floor will gradually change during processing:
  15716. <div class="example">
  15717. <pre class="example-preformatted">afftdn=nr=10:nf=-80:tn=1
  15718. </pre></div>
  15719. </li><li>Reduce noise by 20dB, using noise floor of -40dB and using commands to take noise profile
  15720. of first 0.4 seconds of input audio:
  15721. <div class="example">
  15722. <pre class="example-preformatted">asendcmd=0.0 afftdn sn start,asendcmd=0.4 afftdn sn stop,afftdn=nr=20:nf=-40
  15723. </pre></div>
  15724. </li></ul>
  15725. </div>
  15726. </div>
  15727. <div class="section-level-extent" id="afftfilt">
  15728. <h3 class="section"><span>27.24 afftfilt<a class="copiable-link" href="#afftfilt"> &para;</a></span></h3>
  15729. <p>Apply arbitrary expressions to samples in frequency domain.
  15730. </p>
  15731. <dl class="table">
  15732. <dt><samp class="option">real</samp></dt>
  15733. <dd><p>Set frequency domain real expression for each separate channel separated
  15734. by &rsquo;|&rsquo;. Default is &quot;re&quot;.
  15735. If the number of input channels is greater than the number of
  15736. expressions, the last specified expression is used for the remaining
  15737. output channels.
  15738. </p>
  15739. </dd>
  15740. <dt><samp class="option">imag</samp></dt>
  15741. <dd><p>Set frequency domain imaginary expression for each separate channel
  15742. separated by &rsquo;|&rsquo;. Default is &quot;im&quot;.
  15743. </p>
  15744. <p>Each expression in <var class="var">real</var> and <var class="var">imag</var> can contain the following
  15745. constants and functions:
  15746. </p>
  15747. <dl class="table">
  15748. <dt><samp class="option">sr</samp></dt>
  15749. <dd><p>sample rate
  15750. </p>
  15751. </dd>
  15752. <dt><samp class="option">b</samp></dt>
  15753. <dd><p>current frequency bin number
  15754. </p>
  15755. </dd>
  15756. <dt><samp class="option">nb</samp></dt>
  15757. <dd><p>number of available bins
  15758. </p>
  15759. </dd>
  15760. <dt><samp class="option">ch</samp></dt>
  15761. <dd><p>channel number of the current expression
  15762. </p>
  15763. </dd>
  15764. <dt><samp class="option">chs</samp></dt>
  15765. <dd><p>number of channels
  15766. </p>
  15767. </dd>
  15768. <dt><samp class="option">pts</samp></dt>
  15769. <dd><p>current frame pts
  15770. </p>
  15771. </dd>
  15772. <dt><samp class="option">re</samp></dt>
  15773. <dd><p>current real part of frequency bin of current channel
  15774. </p>
  15775. </dd>
  15776. <dt><samp class="option">im</samp></dt>
  15777. <dd><p>current imaginary part of frequency bin of current channel
  15778. </p>
  15779. </dd>
  15780. <dt><samp class="option">real(b, ch)</samp></dt>
  15781. <dd><p>Return the value of real part of frequency bin at location (<var class="var">bin</var>,<var class="var">channel</var>)
  15782. </p>
  15783. </dd>
  15784. <dt><samp class="option">imag(b, ch)</samp></dt>
  15785. <dd><p>Return the value of imaginary part of frequency bin at location (<var class="var">bin</var>,<var class="var">channel</var>)
  15786. </p></dd>
  15787. </dl>
  15788. </dd>
  15789. <dt><samp class="option">win_size</samp></dt>
  15790. <dd><p>Set window size. Allowed range is from 16 to 131072.
  15791. Default is <code class="code">4096</code>
  15792. </p>
  15793. </dd>
  15794. <dt><samp class="option">win_func</samp></dt>
  15795. <dd><p>Set window function.
  15796. </p>
  15797. <p>It accepts the following values:
  15798. </p><dl class="table">
  15799. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  15800. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  15801. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  15802. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  15803. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  15804. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  15805. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  15806. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  15807. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  15808. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  15809. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  15810. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  15811. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  15812. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  15813. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  15814. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  15815. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  15816. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  15817. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  15818. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  15819. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  15820. </dl>
  15821. <p>Default is <code class="code">hann</code>.
  15822. </p>
  15823. </dd>
  15824. <dt><samp class="option">overlap</samp></dt>
  15825. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  15826. window function will be picked. Default is <code class="code">0.75</code>.
  15827. </p></dd>
  15828. </dl>
  15829. <ul class="mini-toc">
  15830. <li><a href="#Examples-24" accesskey="1">Examples</a></li>
  15831. </ul>
  15832. <div class="subsection-level-extent" id="Examples-24">
  15833. <h4 class="subsection"><span>27.24.1 Examples<a class="copiable-link" href="#Examples-24"> &para;</a></span></h4>
  15834. <ul class="itemize mark-bullet">
  15835. <li>Leave almost only low frequencies in audio:
  15836. <div class="example">
  15837. <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;
  15838. </pre></div>
  15839. </li><li>Apply robotize effect:
  15840. <div class="example">
  15841. <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;
  15842. </pre></div>
  15843. </li><li>Apply whisper effect:
  15844. <div class="example">
  15845. <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;
  15846. </pre></div>
  15847. </li><li>Apply phase shift:
  15848. <div class="example">
  15849. <pre class="example-preformatted">afftfilt=&quot;real=re*cos(1)-im*sin(1):imag=re*sin(1)+im*cos(1)&quot;
  15850. </pre></div>
  15851. </li></ul>
  15852. <a class="anchor" id="afir"></a></div>
  15853. </div>
  15854. <div class="section-level-extent" id="afir-1">
  15855. <h3 class="section"><span>27.25 afir<a class="copiable-link" href="#afir-1"> &para;</a></span></h3>
  15856. <p>Apply an arbitrary Finite Impulse Response filter.
  15857. </p>
  15858. <p>This filter is designed for applying long FIR filters,
  15859. up to 60 seconds long.
  15860. </p>
  15861. <p>It can be used as component for digital crossover filters,
  15862. room equalization, cross talk cancellation, wavefield synthesis,
  15863. auralization, ambiophonics, ambisonics and spatialization.
  15864. </p>
  15865. <p>This filter uses the streams higher than first one as FIR coefficients.
  15866. If the non-first stream holds a single channel, it will be used
  15867. for all input channels in the first stream, otherwise
  15868. the number of channels in the non-first stream must be same as
  15869. the number of channels in the first stream.
  15870. </p>
  15871. <p>It accepts the following parameters:
  15872. </p>
  15873. <dl class="table">
  15874. <dt><samp class="option">dry</samp></dt>
  15875. <dd><p>Set dry gain. This sets input gain.
  15876. </p>
  15877. </dd>
  15878. <dt><samp class="option">wet</samp></dt>
  15879. <dd><p>Set wet gain. This sets final output gain.
  15880. </p>
  15881. </dd>
  15882. <dt><samp class="option">length</samp></dt>
  15883. <dd><p>Set Impulse Response filter length. Default is 1, which means whole IR is processed.
  15884. </p>
  15885. </dd>
  15886. <dt><samp class="option">gtype</samp></dt>
  15887. <dd><p>This option is deprecated, and does nothing.
  15888. </p>
  15889. </dd>
  15890. <dt><samp class="option">irnorm</samp></dt>
  15891. <dd><p>Set norm to be applied to IR coefficients before filtering.
  15892. Allowed range is from <var class="var">-1</var> to <var class="var">2</var>.
  15893. IR coefficients are normalized with calculated vector norm set by this option.
  15894. For negative values, no norm is calculated, and IR coefficients are not modified at all.
  15895. Default is <var class="var">1</var>.
  15896. </p>
  15897. </dd>
  15898. <dt><samp class="option">irlink</samp></dt>
  15899. <dd><p>For multichannel IR if this option is set to <var class="var">true</var>, all IR channels will be
  15900. normalized with maximal measured gain of all IR channels coefficients as set by <code class="code">irnorm</code> option.
  15901. When disabled, all IR coefficients in each IR channel will be normalized independently.
  15902. Default is <var class="var">true</var>.
  15903. </p>
  15904. </dd>
  15905. <dt><samp class="option">irgain</samp></dt>
  15906. <dd><p>Set gain to be applied to IR coefficients before filtering.
  15907. Allowed range is 0 to 1. This gain is applied after any gain applied with <var class="var">irnorm</var> option.
  15908. </p>
  15909. </dd>
  15910. <dt><samp class="option">irfmt</samp></dt>
  15911. <dd><p>Set format of IR stream. Can be <code class="code">mono</code> or <code class="code">input</code>.
  15912. Default is <code class="code">input</code>.
  15913. </p>
  15914. </dd>
  15915. <dt><samp class="option">maxir</samp></dt>
  15916. <dd><p>Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds.
  15917. Allowed range is 0.1 to 60 seconds.
  15918. </p>
  15919. </dd>
  15920. <dt><samp class="option">response</samp></dt>
  15921. <dd><p>This option is deprecated, and does nothing.
  15922. </p>
  15923. </dd>
  15924. <dt><samp class="option">channel</samp></dt>
  15925. <dd><p>This option is deprecated, and does nothing.
  15926. </p>
  15927. </dd>
  15928. <dt><samp class="option">size</samp></dt>
  15929. <dd><p>This option is deprecated, and does nothing.
  15930. </p>
  15931. </dd>
  15932. <dt><samp class="option">rate</samp></dt>
  15933. <dd><p>This option is deprecated, and does nothing.
  15934. </p>
  15935. </dd>
  15936. <dt><samp class="option">minp</samp></dt>
  15937. <dd><p>Set minimal partition size used for convolution. Default is <var class="var">8192</var>.
  15938. Allowed range is from <var class="var">1</var> to <var class="var">65536</var>.
  15939. Lower values decreases latency at cost of higher CPU usage.
  15940. </p>
  15941. </dd>
  15942. <dt><samp class="option">maxp</samp></dt>
  15943. <dd><p>Set maximal partition size used for convolution. Default is <var class="var">8192</var>.
  15944. Allowed range is from <var class="var">8</var> to <var class="var">65536</var>.
  15945. Lower values may increase CPU usage.
  15946. </p>
  15947. </dd>
  15948. <dt><samp class="option">nbirs</samp></dt>
  15949. <dd><p>Set number of input impulse responses streams which will be switchable at runtime.
  15950. Allowed range is from <var class="var">1</var> to <var class="var">32</var>. Default is <var class="var">1</var>.
  15951. </p>
  15952. </dd>
  15953. <dt><samp class="option">ir</samp></dt>
  15954. <dd><p>Set IR stream which will be used for convolution, starting from <var class="var">0</var>, should always be
  15955. lower than supplied value by <code class="code">nbirs</code> option. Default is <var class="var">0</var>.
  15956. This option can be changed at runtime via <a class="ref" href="#commands">commands</a>.
  15957. </p>
  15958. </dd>
  15959. <dt><samp class="option">precision</samp></dt>
  15960. <dd><p>Set which precision to use when processing samples.
  15961. </p>
  15962. <dl class="table">
  15963. <dt><samp class="option">auto</samp></dt>
  15964. <dd><p>Auto pick internal sample format depending on other filters.
  15965. </p>
  15966. </dd>
  15967. <dt><samp class="option">float</samp></dt>
  15968. <dd><p>Always use single-floating point precision sample format.
  15969. </p>
  15970. </dd>
  15971. <dt><samp class="option">double</samp></dt>
  15972. <dd><p>Always use double-floating point precision sample format.
  15973. </p></dd>
  15974. </dl>
  15975. <p>Default value is auto.
  15976. </p>
  15977. </dd>
  15978. <dt><samp class="option">irload</samp></dt>
  15979. <dd><p>Set when to load IR stream. Can be <code class="code">init</code> or <code class="code">access</code>.
  15980. First one load and prepares all IRs on initialization, second one
  15981. once on first access of specific IR.
  15982. Default is <code class="code">init</code>.
  15983. </p></dd>
  15984. </dl>
  15985. <ul class="mini-toc">
  15986. <li><a href="#Examples-25" accesskey="1">Examples</a></li>
  15987. </ul>
  15988. <div class="subsection-level-extent" id="Examples-25">
  15989. <h4 class="subsection"><span>27.25.1 Examples<a class="copiable-link" href="#Examples-25"> &para;</a></span></h4>
  15990. <ul class="itemize mark-bullet">
  15991. <li>Apply reverb to stream using mono IR file as second input, complete command using ffmpeg:
  15992. <div class="example">
  15993. <pre class="example-preformatted">ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
  15994. </pre></div>
  15995. </li><li>Apply true stereo processing given input stereo stream, and two stereo impulse responses for left and right channel,
  15996. the impulse response files are files with names l_ir.wav and r_ir.wav, and setting irnorm option value:
  15997. <div class="example">
  15998. <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;
  15999. </pre></div>
  16000. </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:
  16001. <div class="example">
  16002. <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;
  16003. </pre></div>
  16004. </li></ul>
  16005. <a class="anchor" id="aformat"></a></div>
  16006. </div>
  16007. <div class="section-level-extent" id="aformat-1">
  16008. <h3 class="section"><span>27.26 aformat<a class="copiable-link" href="#aformat-1"> &para;</a></span></h3>
  16009. <p>Set output format constraints for the input audio. The framework will
  16010. negotiate the most appropriate format to minimize conversions.
  16011. </p>
  16012. <p>It accepts the following parameters:
  16013. </p><dl class="table">
  16014. <dt><samp class="option">sample_fmts, f</samp></dt>
  16015. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
  16016. </p>
  16017. </dd>
  16018. <dt><samp class="option">sample_rates, r</samp></dt>
  16019. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
  16020. </p>
  16021. </dd>
  16022. <dt><samp class="option">channel_layouts, cl</samp></dt>
  16023. <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
  16024. </p>
  16025. <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>
  16026. for the required syntax.
  16027. </p></dd>
  16028. </dl>
  16029. <p>If a parameter is omitted, all values are allowed.
  16030. </p>
  16031. <p>Force the output to either unsigned 8-bit or signed 16-bit stereo
  16032. </p><div class="example">
  16033. <pre class="example-preformatted">aformat=sample_fmts=u8|s16:channel_layouts=stereo
  16034. </pre></div>
  16035. </div>
  16036. <div class="section-level-extent" id="afreqshift">
  16037. <h3 class="section"><span>27.27 afreqshift<a class="copiable-link" href="#afreqshift"> &para;</a></span></h3>
  16038. <p>Apply frequency shift to input audio samples.
  16039. </p>
  16040. <p>The filter accepts the following options:
  16041. </p>
  16042. <dl class="table">
  16043. <dt><samp class="option">shift</samp></dt>
  16044. <dd><p>Specify frequency shift. Allowed range is -INT_MAX to INT_MAX.
  16045. Default value is 0.0.
  16046. </p>
  16047. </dd>
  16048. <dt><samp class="option">level</samp></dt>
  16049. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  16050. Default value is 1.0.
  16051. </p>
  16052. </dd>
  16053. <dt><samp class="option">order</samp></dt>
  16054. <dd><p>Set filter order used for filtering. Allowed range is from 1 to 16.
  16055. Default value is 8.
  16056. </p></dd>
  16057. </dl>
  16058. <ul class="mini-toc">
  16059. <li><a href="#Commands-10" accesskey="1">Commands</a></li>
  16060. </ul>
  16061. <div class="subsection-level-extent" id="Commands-10">
  16062. <h4 class="subsection"><span>27.27.1 Commands<a class="copiable-link" href="#Commands-10"> &para;</a></span></h4>
  16063. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  16064. </p>
  16065. </div>
  16066. </div>
  16067. <div class="section-level-extent" id="afwtdn">
  16068. <h3 class="section"><span>27.28 afwtdn<a class="copiable-link" href="#afwtdn"> &para;</a></span></h3>
  16069. <p>Reduce broadband noise from input samples using Wavelets.
  16070. </p>
  16071. <p>A description of the accepted options follows.
  16072. </p>
  16073. <dl class="table">
  16074. <dt><samp class="option">sigma</samp></dt>
  16075. <dd><p>Set the noise sigma, allowed range is from 0 to 1.
  16076. Default value is 0.
  16077. This option controls strength of denoising applied to input samples.
  16078. Most useful way to set this option is via decibels, eg. -45dB.
  16079. </p>
  16080. </dd>
  16081. <dt><samp class="option">levels</samp></dt>
  16082. <dd><p>Set the number of wavelet levels of decomposition.
  16083. Allowed range is from 1 to 12.
  16084. Default value is 10.
  16085. Setting this too low make denoising performance very poor.
  16086. </p>
  16087. </dd>
  16088. <dt><samp class="option">wavet</samp></dt>
  16089. <dd><p>Set wavelet type for decomposition of input frame.
  16090. They are sorted by number of coefficients, from lowest to highest.
  16091. More coefficients means worse filtering speed, but overall better quality.
  16092. Available wavelets are:
  16093. </p>
  16094. <dl class="table">
  16095. <dt>&lsquo;<samp class="samp">sym2</samp>&rsquo;</dt>
  16096. <dt>&lsquo;<samp class="samp">sym4</samp>&rsquo;</dt>
  16097. <dt>&lsquo;<samp class="samp">rbior68</samp>&rsquo;</dt>
  16098. <dt>&lsquo;<samp class="samp">deb10</samp>&rsquo;</dt>
  16099. <dt>&lsquo;<samp class="samp">sym10</samp>&rsquo;</dt>
  16100. <dt>&lsquo;<samp class="samp">coif5</samp>&rsquo;</dt>
  16101. <dt>&lsquo;<samp class="samp">bl3</samp>&rsquo;</dt>
  16102. </dl>
  16103. </dd>
  16104. <dt><samp class="option">percent</samp></dt>
  16105. <dd><p>Set percent of full denoising. Allowed range is from 0 to 100 percent.
  16106. Default value is 85 percent or partial denoising.
  16107. </p>
  16108. </dd>
  16109. <dt><samp class="option">profile</samp></dt>
  16110. <dd><p>If enabled, first input frame will be used as noise profile.
  16111. If first frame samples contain non-noise performance will be very poor.
  16112. </p>
  16113. </dd>
  16114. <dt><samp class="option">adaptive</samp></dt>
  16115. <dd><p>If enabled, input frames are analyzed for presence of noise.
  16116. If noise is detected with high possibility then input frame profile will be
  16117. used for processing following frames, until new noise frame is detected.
  16118. </p>
  16119. </dd>
  16120. <dt><samp class="option">samples</samp></dt>
  16121. <dd><p>Set size of single frame in number of samples. Allowed range is from 512 to
  16122. 65536. Default frame size is 8192 samples.
  16123. </p>
  16124. </dd>
  16125. <dt><samp class="option">softness</samp></dt>
  16126. <dd><p>Set softness applied inside thresholding function. Allowed range is from 0 to
  16127. 10. Default softness is 1.
  16128. </p></dd>
  16129. </dl>
  16130. <ul class="mini-toc">
  16131. <li><a href="#Commands-11" accesskey="1">Commands</a></li>
  16132. </ul>
  16133. <div class="subsection-level-extent" id="Commands-11">
  16134. <h4 class="subsection"><span>27.28.1 Commands<a class="copiable-link" href="#Commands-11"> &para;</a></span></h4>
  16135. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  16136. </p>
  16137. </div>
  16138. </div>
  16139. <div class="section-level-extent" id="agate">
  16140. <h3 class="section"><span>27.29 agate<a class="copiable-link" href="#agate"> &para;</a></span></h3>
  16141. <p>A gate is mainly used to reduce lower parts of a signal. This kind of signal
  16142. processing reduces disturbing noise between useful signals.
  16143. </p>
  16144. <p>Gating is done by detecting the volume below a chosen level <var class="var">threshold</var>
  16145. and dividing it by the factor set with <var class="var">ratio</var>. The bottom of the noise
  16146. floor is set via <var class="var">range</var>. Because an exact manipulation of the signal
  16147. would cause distortion of the waveform the reduction can be levelled over
  16148. time. This is done by setting <var class="var">attack</var> and <var class="var">release</var>.
  16149. </p>
  16150. <p><var class="var">attack</var> determines how long the signal has to fall below the threshold
  16151. before any reduction will occur and <var class="var">release</var> sets the time the signal
  16152. has to rise above the threshold to reduce the reduction again.
  16153. Shorter signals than the chosen attack time will be left untouched.
  16154. </p>
  16155. <dl class="table">
  16156. <dt><samp class="option">level_in</samp></dt>
  16157. <dd><p>Set input level before filtering.
  16158. Default is 1. Allowed range is from 0.015625 to 64.
  16159. </p>
  16160. </dd>
  16161. <dt><samp class="option">mode</samp></dt>
  16162. <dd><p>Set the mode of operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  16163. Default is <code class="code">downward</code>. If set to <code class="code">upward</code> mode, higher parts of signal
  16164. will be amplified, expanding dynamic range in upward direction.
  16165. Otherwise, in case of <code class="code">downward</code> lower parts of signal will be reduced.
  16166. </p>
  16167. </dd>
  16168. <dt><samp class="option">range</samp></dt>
  16169. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  16170. Default is 0.06125. Allowed range is from 0 to 1.
  16171. Setting this to 0 disables reduction and then filter behaves like expander.
  16172. </p>
  16173. </dd>
  16174. <dt><samp class="option">threshold</samp></dt>
  16175. <dd><p>If a signal rises above this level the gain reduction is released.
  16176. Default is 0.125. Allowed range is from 0 to 1.
  16177. </p>
  16178. </dd>
  16179. <dt><samp class="option">ratio</samp></dt>
  16180. <dd><p>Set a ratio by which the signal is reduced.
  16181. Default is 2. Allowed range is from 1 to 9000.
  16182. </p>
  16183. </dd>
  16184. <dt><samp class="option">attack</samp></dt>
  16185. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  16186. reduction stops.
  16187. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  16188. </p>
  16189. </dd>
  16190. <dt><samp class="option">release</samp></dt>
  16191. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  16192. reduction is increased again. Default is 250 milliseconds.
  16193. Allowed range is from 0.01 to 9000.
  16194. </p>
  16195. </dd>
  16196. <dt><samp class="option">makeup</samp></dt>
  16197. <dd><p>Set amount of amplification of signal after processing.
  16198. Default is 1. Allowed range is from 1 to 64.
  16199. </p>
  16200. </dd>
  16201. <dt><samp class="option">knee</samp></dt>
  16202. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  16203. Default is 2.828427125. Allowed range is from 1 to 8.
  16204. </p>
  16205. </dd>
  16206. <dt><samp class="option">detection</samp></dt>
  16207. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  16208. Default is <code class="code">rms</code>. Can be <code class="code">peak</code> or <code class="code">rms</code>.
  16209. </p>
  16210. </dd>
  16211. <dt><samp class="option">link</samp></dt>
  16212. <dd><p>Choose if the average level between all channels or the louder channel affects
  16213. the reduction.
  16214. Default is <code class="code">average</code>. Can be <code class="code">average</code> or <code class="code">maximum</code>.
  16215. </p></dd>
  16216. </dl>
  16217. <ul class="mini-toc">
  16218. <li><a href="#Commands-12" accesskey="1">Commands</a></li>
  16219. </ul>
  16220. <div class="subsection-level-extent" id="Commands-12">
  16221. <h4 class="subsection"><span>27.29.1 Commands<a class="copiable-link" href="#Commands-12"> &para;</a></span></h4>
  16222. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  16223. </p>
  16224. </div>
  16225. </div>
  16226. <div class="section-level-extent" id="aiir">
  16227. <h3 class="section"><span>27.30 aiir<a class="copiable-link" href="#aiir"> &para;</a></span></h3>
  16228. <p>Apply an arbitrary Infinite Impulse Response filter.
  16229. </p>
  16230. <p>It accepts the following parameters:
  16231. </p>
  16232. <dl class="table">
  16233. <dt><samp class="option">zeros, z</samp></dt>
  16234. <dd><p>Set B/numerator/zeros/reflection coefficients.
  16235. </p>
  16236. </dd>
  16237. <dt><samp class="option">poles, p</samp></dt>
  16238. <dd><p>Set A/denominator/poles/ladder coefficients.
  16239. </p>
  16240. </dd>
  16241. <dt><samp class="option">gains, k</samp></dt>
  16242. <dd><p>Set channels gains.
  16243. </p>
  16244. </dd>
  16245. <dt><samp class="option">dry_gain</samp></dt>
  16246. <dd><p>Set input gain.
  16247. </p>
  16248. </dd>
  16249. <dt><samp class="option">wet_gain</samp></dt>
  16250. <dd><p>Set output gain.
  16251. </p>
  16252. </dd>
  16253. <dt><samp class="option">format, f</samp></dt>
  16254. <dd><p>Set coefficients format.
  16255. </p>
  16256. <dl class="table">
  16257. <dt>&lsquo;<samp class="samp">ll</samp>&rsquo;</dt>
  16258. <dd><p>lattice-ladder function
  16259. </p></dd>
  16260. <dt>&lsquo;<samp class="samp">sf</samp>&rsquo;</dt>
  16261. <dd><p>analog transfer function
  16262. </p></dd>
  16263. <dt>&lsquo;<samp class="samp">tf</samp>&rsquo;</dt>
  16264. <dd><p>digital transfer function
  16265. </p></dd>
  16266. <dt>&lsquo;<samp class="samp">zp</samp>&rsquo;</dt>
  16267. <dd><p>Z-plane zeros/poles, cartesian (default)
  16268. </p></dd>
  16269. <dt>&lsquo;<samp class="samp">pr</samp>&rsquo;</dt>
  16270. <dd><p>Z-plane zeros/poles, polar radians
  16271. </p></dd>
  16272. <dt>&lsquo;<samp class="samp">pd</samp>&rsquo;</dt>
  16273. <dd><p>Z-plane zeros/poles, polar degrees
  16274. </p></dd>
  16275. <dt>&lsquo;<samp class="samp">sp</samp>&rsquo;</dt>
  16276. <dd><p>S-plane zeros/poles
  16277. </p></dd>
  16278. </dl>
  16279. </dd>
  16280. <dt><samp class="option">process, r</samp></dt>
  16281. <dd><p>Set type of processing.
  16282. </p>
  16283. <dl class="table">
  16284. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  16285. <dd><p>direct processing
  16286. </p></dd>
  16287. <dt>&lsquo;<samp class="samp">s</samp>&rsquo;</dt>
  16288. <dd><p>serial processing
  16289. </p></dd>
  16290. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  16291. <dd><p>parallel processing
  16292. </p></dd>
  16293. </dl>
  16294. </dd>
  16295. <dt><samp class="option">precision, e</samp></dt>
  16296. <dd><p>Set filtering precision.
  16297. </p>
  16298. <dl class="table">
  16299. <dt>&lsquo;<samp class="samp">dbl</samp>&rsquo;</dt>
  16300. <dd><p>double-precision floating-point (default)
  16301. </p></dd>
  16302. <dt>&lsquo;<samp class="samp">flt</samp>&rsquo;</dt>
  16303. <dd><p>single-precision floating-point
  16304. </p></dd>
  16305. <dt>&lsquo;<samp class="samp">i32</samp>&rsquo;</dt>
  16306. <dd><p>32-bit integers
  16307. </p></dd>
  16308. <dt>&lsquo;<samp class="samp">i16</samp>&rsquo;</dt>
  16309. <dd><p>16-bit integers
  16310. </p></dd>
  16311. </dl>
  16312. </dd>
  16313. <dt><samp class="option">normalize, n</samp></dt>
  16314. <dd><p>Normalize filter coefficients, by default is enabled.
  16315. Enabling it will normalize magnitude response at DC to 0dB.
  16316. </p>
  16317. </dd>
  16318. <dt><samp class="option">mix</samp></dt>
  16319. <dd><p>How much to use filtered signal in output. Default is 1.
  16320. Range is between 0 and 1.
  16321. </p>
  16322. </dd>
  16323. <dt><samp class="option">response</samp></dt>
  16324. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  16325. By default it is disabled.
  16326. </p>
  16327. </dd>
  16328. <dt><samp class="option">channel</samp></dt>
  16329. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  16330. displayed. This option is used only when <var class="var">response</var> is enabled.
  16331. </p>
  16332. </dd>
  16333. <dt><samp class="option">size</samp></dt>
  16334. <dd><p>Set video stream size. This option is used only when <var class="var">response</var> is enabled.
  16335. </p></dd>
  16336. </dl>
  16337. <p>Coefficients in <code class="code">tf</code> and <code class="code">sf</code> format are separated by spaces and are in ascending
  16338. order.
  16339. </p>
  16340. <p>Coefficients in <code class="code">zp</code> format are separated by spaces and order of coefficients
  16341. doesn&rsquo;t matter. Coefficients in <code class="code">zp</code> format are complex numbers with <var class="var">i</var>
  16342. imaginary unit.
  16343. </p>
  16344. <p>Different coefficients and gains can be provided for every channel, in such case
  16345. use &rsquo;|&rsquo; to separate coefficients or gains. Last provided coefficients will be
  16346. used for all remaining channels.
  16347. </p>
  16348. <ul class="mini-toc">
  16349. <li><a href="#Examples-26" accesskey="1">Examples</a></li>
  16350. </ul>
  16351. <div class="subsection-level-extent" id="Examples-26">
  16352. <h4 class="subsection"><span>27.30.1 Examples<a class="copiable-link" href="#Examples-26"> &para;</a></span></h4>
  16353. <ul class="itemize mark-bullet">
  16354. <li>Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate:
  16355. <div class="example">
  16356. <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
  16357. </pre></div>
  16358. </li><li>Same as above but in <code class="code">zp</code> format:
  16359. <div class="example">
  16360. <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
  16361. </pre></div>
  16362. </li><li>Apply 3-rd order analog normalized Butterworth low-pass filter, using analog transfer function format:
  16363. <div class="example">
  16364. <pre class="example-preformatted">aiir=z=1.3057 0 0 0:p=1.3057 2.3892 2.1860 1:f=sf:r=d
  16365. </pre></div>
  16366. </li></ul>
  16367. </div>
  16368. </div>
  16369. <div class="section-level-extent" id="alimiter">
  16370. <h3 class="section"><span>27.31 alimiter<a class="copiable-link" href="#alimiter"> &para;</a></span></h3>
  16371. <p>The limiter prevents an input signal from rising over a desired threshold.
  16372. This limiter uses lookahead technology to prevent your signal from distorting.
  16373. It means that there is a small delay after the signal is processed. Keep in mind
  16374. that the delay it produces is the attack time you set.
  16375. </p>
  16376. <p>The filter accepts the following options:
  16377. </p>
  16378. <dl class="table">
  16379. <dt><samp class="option">level_in</samp></dt>
  16380. <dd><p>Set input gain. Default is 1.
  16381. </p>
  16382. </dd>
  16383. <dt><samp class="option">level_out</samp></dt>
  16384. <dd><p>Set output gain. Default is 1.
  16385. </p>
  16386. </dd>
  16387. <dt><samp class="option">limit</samp></dt>
  16388. <dd><p>Don&rsquo;t let signals above this level pass the limiter. Default is 1.
  16389. </p>
  16390. </dd>
  16391. <dt><samp class="option">attack</samp></dt>
  16392. <dd><p>The limiter will reach its attenuation level in this amount of time in
  16393. milliseconds. Default is 5 milliseconds.
  16394. </p>
  16395. </dd>
  16396. <dt><samp class="option">release</samp></dt>
  16397. <dd><p>Come back from limiting to attenuation 1.0 in this amount of milliseconds.
  16398. Default is 50 milliseconds.
  16399. </p>
  16400. </dd>
  16401. <dt><samp class="option">asc</samp></dt>
  16402. <dd><p>When gain reduction is always needed ASC takes care of releasing to an
  16403. average reduction level rather than reaching a reduction of 0 in the release
  16404. time.
  16405. </p>
  16406. </dd>
  16407. <dt><samp class="option">asc_level</samp></dt>
  16408. <dd><p>Select how much the release time is affected by ASC, 0 means nearly no changes
  16409. in release time while 1 produces higher release times.
  16410. </p>
  16411. </dd>
  16412. <dt><samp class="option">level</samp></dt>
  16413. <dd><p>Auto level output signal. Default is enabled.
  16414. This normalizes audio back to 0dB if enabled.
  16415. </p>
  16416. </dd>
  16417. <dt><samp class="option">latency</samp></dt>
  16418. <dd><p>Compensate the delay introduced by using the lookahead buffer set with attack
  16419. parameter. Also flush the valid audio data in the lookahead buffer when the
  16420. stream hits EOF.
  16421. </p></dd>
  16422. </dl>
  16423. <p>Depending on picked setting it is recommended to upsample input 2x or 4x times
  16424. with <a class="ref" href="#aresample">aresample</a> before applying this filter.
  16425. </p>
  16426. </div>
  16427. <div class="section-level-extent" id="allpass">
  16428. <h3 class="section"><span>27.32 allpass<a class="copiable-link" href="#allpass"> &para;</a></span></h3>
  16429. <p>Apply a two-pole all-pass filter with central frequency (in Hz)
  16430. <var class="var">frequency</var>, and filter-width <var class="var">width</var>.
  16431. An all-pass filter changes the audio&rsquo;s frequency to phase relationship
  16432. without changing its frequency to amplitude relationship.
  16433. </p>
  16434. <p>The filter accepts the following options:
  16435. </p>
  16436. <dl class="table">
  16437. <dt><samp class="option">frequency, f</samp></dt>
  16438. <dd><p>Set frequency in Hz.
  16439. </p>
  16440. </dd>
  16441. <dt><samp class="option">width_type, t</samp></dt>
  16442. <dd><p>Set method to specify band-width of filter.
  16443. </p><dl class="table">
  16444. <dt><samp class="option">h</samp></dt>
  16445. <dd><p>Hz
  16446. </p></dd>
  16447. <dt><samp class="option">q</samp></dt>
  16448. <dd><p>Q-Factor
  16449. </p></dd>
  16450. <dt><samp class="option">o</samp></dt>
  16451. <dd><p>octave
  16452. </p></dd>
  16453. <dt><samp class="option">s</samp></dt>
  16454. <dd><p>slope
  16455. </p></dd>
  16456. <dt><samp class="option">k</samp></dt>
  16457. <dd><p>kHz
  16458. </p></dd>
  16459. </dl>
  16460. </dd>
  16461. <dt><samp class="option">width, w</samp></dt>
  16462. <dd><p>Specify the band-width of a filter in width_type units.
  16463. </p>
  16464. </dd>
  16465. <dt><samp class="option">mix, m</samp></dt>
  16466. <dd><p>How much to use filtered signal in output. Default is 1.
  16467. Range is between 0 and 1.
  16468. </p>
  16469. </dd>
  16470. <dt><samp class="option">channels, c</samp></dt>
  16471. <dd><p>Specify which channels to filter, by default all available are filtered.
  16472. </p>
  16473. </dd>
  16474. <dt><samp class="option">normalize, n</samp></dt>
  16475. <dd><p>Normalize biquad coefficients, by default is disabled.
  16476. Enabling it will normalize magnitude response at DC to 0dB.
  16477. </p>
  16478. </dd>
  16479. <dt><samp class="option">order, o</samp></dt>
  16480. <dd><p>Set the filter order, can be 1 or 2. Default is 2.
  16481. </p>
  16482. </dd>
  16483. <dt><samp class="option">transform, a</samp></dt>
  16484. <dd><p>Set transform type of IIR filter.
  16485. </p><dl class="table">
  16486. <dt><samp class="option">di</samp></dt>
  16487. <dt><samp class="option">dii</samp></dt>
  16488. <dt><samp class="option">tdi</samp></dt>
  16489. <dt><samp class="option">tdii</samp></dt>
  16490. <dt><samp class="option">latt</samp></dt>
  16491. <dt><samp class="option">svf</samp></dt>
  16492. <dt><samp class="option">zdf</samp></dt>
  16493. </dl>
  16494. </dd>
  16495. <dt><samp class="option">precision, r</samp></dt>
  16496. <dd><p>Set precision of filtering.
  16497. </p><dl class="table">
  16498. <dt><samp class="option">auto</samp></dt>
  16499. <dd><p>Pick automatic sample format depending on surround filters.
  16500. </p></dd>
  16501. <dt><samp class="option">s16</samp></dt>
  16502. <dd><p>Always use signed 16-bit.
  16503. </p></dd>
  16504. <dt><samp class="option">s32</samp></dt>
  16505. <dd><p>Always use signed 32-bit.
  16506. </p></dd>
  16507. <dt><samp class="option">f32</samp></dt>
  16508. <dd><p>Always use float 32-bit.
  16509. </p></dd>
  16510. <dt><samp class="option">f64</samp></dt>
  16511. <dd><p>Always use float 64-bit.
  16512. </p></dd>
  16513. </dl>
  16514. </dd>
  16515. </dl>
  16516. <ul class="mini-toc">
  16517. <li><a href="#Commands-13" accesskey="1">Commands</a></li>
  16518. </ul>
  16519. <div class="subsection-level-extent" id="Commands-13">
  16520. <h4 class="subsection"><span>27.32.1 Commands<a class="copiable-link" href="#Commands-13"> &para;</a></span></h4>
  16521. <p>This filter supports the following commands:
  16522. </p><dl class="table">
  16523. <dt><samp class="option">frequency, f</samp></dt>
  16524. <dd><p>Change allpass frequency.
  16525. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  16526. </p>
  16527. </dd>
  16528. <dt><samp class="option">width_type, t</samp></dt>
  16529. <dd><p>Change allpass width_type.
  16530. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  16531. </p>
  16532. </dd>
  16533. <dt><samp class="option">width, w</samp></dt>
  16534. <dd><p>Change allpass width.
  16535. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  16536. </p>
  16537. </dd>
  16538. <dt><samp class="option">mix, m</samp></dt>
  16539. <dd><p>Change allpass mix.
  16540. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  16541. </p></dd>
  16542. </dl>
  16543. </div>
  16544. </div>
  16545. <div class="section-level-extent" id="aloop">
  16546. <h3 class="section"><span>27.33 aloop<a class="copiable-link" href="#aloop"> &para;</a></span></h3>
  16547. <p>Loop audio samples.
  16548. </p>
  16549. <p>The filter accepts the following options:
  16550. </p>
  16551. <dl class="table">
  16552. <dt><samp class="option">loop</samp></dt>
  16553. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  16554. Default is 0.
  16555. </p>
  16556. </dd>
  16557. <dt><samp class="option">size</samp></dt>
  16558. <dd><p>Set maximal number of samples. Default is 0.
  16559. </p>
  16560. </dd>
  16561. <dt><samp class="option">start</samp></dt>
  16562. <dd><p>Set first sample of loop. Default is 0.
  16563. </p>
  16564. </dd>
  16565. <dt><samp class="option">time</samp></dt>
  16566. <dd><p>Set the time of loop start in seconds.
  16567. Only used if option named <var class="var">start</var> is set to <code class="code">-1</code>.
  16568. </p></dd>
  16569. </dl>
  16570. <a class="anchor" id="amerge"></a></div>
  16571. <div class="section-level-extent" id="amerge-1">
  16572. <h3 class="section"><span>27.34 amerge<a class="copiable-link" href="#amerge-1"> &para;</a></span></h3>
  16573. <p>Merge two or more audio streams into a single multi-channel stream.
  16574. </p>
  16575. <p>The filter accepts the following options:
  16576. </p>
  16577. <dl class="table">
  16578. <dt><samp class="option">inputs</samp></dt>
  16579. <dd><p>Set the number of inputs. Default is 2.
  16580. </p>
  16581. </dd>
  16582. </dl>
  16583. <p>If the channel layouts of the inputs are disjoint, and therefore compatible,
  16584. the channel layout of the output will be set accordingly and the channels
  16585. will be reordered as necessary. If the channel layouts of the inputs are not
  16586. disjoint, the output will have all the channels of the first input then all
  16587. the channels of the second input, in that order, and the channel layout of
  16588. the output will be the default value corresponding to the total number of
  16589. channels.
  16590. </p>
  16591. <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
  16592. is FC+BL+BR, then the output will be in 5.1, with the channels in the
  16593. following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
  16594. first input, b1 is the first channel of the second input).
  16595. </p>
  16596. <p>On the other hand, if both input are in stereo, the output channels will be
  16597. in the default order: a1, a2, b1, b2, and the channel layout will be
  16598. arbitrarily set to 4.0, which may or may not be the expected value.
  16599. </p>
  16600. <p>All inputs must have the same sample rate, and format.
  16601. </p>
  16602. <p>If inputs do not have the same duration, the output will stop with the
  16603. shortest.
  16604. </p>
  16605. <ul class="mini-toc">
  16606. <li><a href="#Examples-27" accesskey="1">Examples</a></li>
  16607. </ul>
  16608. <div class="subsection-level-extent" id="Examples-27">
  16609. <h4 class="subsection"><span>27.34.1 Examples<a class="copiable-link" href="#Examples-27"> &para;</a></span></h4>
  16610. <ul class="itemize mark-bullet">
  16611. <li>Merge two mono files into a stereo stream:
  16612. <div class="example">
  16613. <pre class="example-preformatted">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
  16614. </pre></div>
  16615. </li><li>Multiple merges assuming 1 video stream and 6 audio streams in <samp class="file">input.mkv</samp>:
  16616. <div class="example">
  16617. <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
  16618. </pre></div>
  16619. </li></ul>
  16620. </div>
  16621. </div>
  16622. <div class="section-level-extent" id="amix">
  16623. <h3 class="section"><span>27.35 amix<a class="copiable-link" href="#amix"> &para;</a></span></h3>
  16624. <p>Mixes multiple audio inputs into a single output.
  16625. </p>
  16626. <p>Note that this filter only supports float samples (the <var class="var">amerge</var>
  16627. and <var class="var">pan</var> audio filters support many formats). If the <var class="var">amix</var>
  16628. input has integer samples then <a class="ref" href="#aresample">aresample</a> will be automatically
  16629. inserted to perform the conversion to float samples.
  16630. </p>
  16631. <p>It accepts the following parameters:
  16632. </p><dl class="table">
  16633. <dt><samp class="option">inputs</samp></dt>
  16634. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  16635. </p>
  16636. </dd>
  16637. <dt><samp class="option">duration</samp></dt>
  16638. <dd><p>How to determine the end-of-stream.
  16639. </p><dl class="table">
  16640. <dt><samp class="option">longest</samp></dt>
  16641. <dd><p>The duration of the longest input. (default)
  16642. </p>
  16643. </dd>
  16644. <dt><samp class="option">shortest</samp></dt>
  16645. <dd><p>The duration of the shortest input.
  16646. </p>
  16647. </dd>
  16648. <dt><samp class="option">first</samp></dt>
  16649. <dd><p>The duration of the first input.
  16650. </p>
  16651. </dd>
  16652. </dl>
  16653. </dd>
  16654. <dt><samp class="option">dropout_transition</samp></dt>
  16655. <dd><p>The transition time, in seconds, for volume renormalization when an input
  16656. stream ends. The default value is 2 seconds.
  16657. </p>
  16658. </dd>
  16659. <dt><samp class="option">weights</samp></dt>
  16660. <dd><p>Specify weight of each input audio stream as a sequence of numbers separated
  16661. by a space. If fewer weights are specified compared to number of inputs, the
  16662. last weight is assigned to the remaining inputs.
  16663. Default weight for each input is 1.
  16664. </p>
  16665. </dd>
  16666. <dt><samp class="option">normalize</samp></dt>
  16667. <dd><p>Always scale inputs instead of only doing summation of samples.
  16668. Beware of heavy clipping if inputs are not normalized prior or after filtering
  16669. by this filter if this option is disabled. By default is enabled.
  16670. </p></dd>
  16671. </dl>
  16672. <ul class="mini-toc">
  16673. <li><a href="#Examples-28" accesskey="1">Examples</a></li>
  16674. <li><a href="#Commands-14" accesskey="2">Commands</a></li>
  16675. </ul>
  16676. <div class="subsection-level-extent" id="Examples-28">
  16677. <h4 class="subsection"><span>27.35.1 Examples<a class="copiable-link" href="#Examples-28"> &para;</a></span></h4>
  16678. <ul class="itemize mark-bullet">
  16679. <li>This will mix 3 input audio streams to a single output with the same duration as the
  16680. first input and a dropout transition time of 3 seconds:
  16681. <div class="example">
  16682. <pre class="example-preformatted">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
  16683. </pre></div>
  16684. </li><li>This will mix one vocal and one music input audio stream to a single output with the same duration as the
  16685. longest input. The music will have quarter the weight as the vocals, and the inputs are not normalized:
  16686. <div class="example">
  16687. <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
  16688. </pre></div>
  16689. </li></ul>
  16690. </div>
  16691. <div class="subsection-level-extent" id="Commands-14">
  16692. <h4 class="subsection"><span>27.35.2 Commands<a class="copiable-link" href="#Commands-14"> &para;</a></span></h4>
  16693. <p>This filter supports the following commands:
  16694. </p><dl class="table">
  16695. <dt><samp class="option">weights</samp></dt>
  16696. <dt><samp class="option">normalize</samp></dt>
  16697. <dd><p>Syntax is same as option with same name.
  16698. </p></dd>
  16699. </dl>
  16700. </div>
  16701. </div>
  16702. <div class="section-level-extent" id="amultiply">
  16703. <h3 class="section"><span>27.36 amultiply<a class="copiable-link" href="#amultiply"> &para;</a></span></h3>
  16704. <p>Multiply first audio stream with second audio stream and store result
  16705. in output audio stream. Multiplication is done by multiplying each
  16706. sample from first stream with sample at same position from second stream.
  16707. </p>
  16708. <p>With this element-wise multiplication one can create amplitude fades and
  16709. amplitude modulations.
  16710. </p>
  16711. </div>
  16712. <div class="section-level-extent" id="anequalizer">
  16713. <h3 class="section"><span>27.37 anequalizer<a class="copiable-link" href="#anequalizer"> &para;</a></span></h3>
  16714. <p>High-order parametric multiband equalizer for each channel.
  16715. </p>
  16716. <p>It accepts the following parameters:
  16717. </p><dl class="table">
  16718. <dt><samp class="option">params</samp></dt>
  16719. <dd>
  16720. <p>This option string is in format:
  16721. &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;
  16722. Each equalizer band is separated by &rsquo;|&rsquo;.
  16723. </p>
  16724. <dl class="table">
  16725. <dt><samp class="option">chn</samp></dt>
  16726. <dd><p>Set channel number to which equalization will be applied.
  16727. If input doesn&rsquo;t have that channel the entry is ignored.
  16728. </p>
  16729. </dd>
  16730. <dt><samp class="option">f</samp></dt>
  16731. <dd><p>Set central frequency for band.
  16732. If input doesn&rsquo;t have that frequency the entry is ignored.
  16733. </p>
  16734. </dd>
  16735. <dt><samp class="option">w</samp></dt>
  16736. <dd><p>Set band width in Hertz.
  16737. </p>
  16738. </dd>
  16739. <dt><samp class="option">g</samp></dt>
  16740. <dd><p>Set band gain in dB.
  16741. </p>
  16742. </dd>
  16743. <dt><samp class="option">t</samp></dt>
  16744. <dd><p>Set filter type for band, optional, can be:
  16745. </p>
  16746. <dl class="table">
  16747. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  16748. <dd><p>Butterworth, this is default.
  16749. </p>
  16750. </dd>
  16751. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  16752. <dd><p>Chebyshev type 1.
  16753. </p>
  16754. </dd>
  16755. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  16756. <dd><p>Chebyshev type 2.
  16757. </p></dd>
  16758. </dl>
  16759. </dd>
  16760. </dl>
  16761. </dd>
  16762. <dt><samp class="option">curves</samp></dt>
  16763. <dd><p>With this option activated frequency response of anequalizer is displayed
  16764. in video stream.
  16765. </p>
  16766. </dd>
  16767. <dt><samp class="option">size</samp></dt>
  16768. <dd><p>Set video stream size. Only useful if curves option is activated.
  16769. </p>
  16770. </dd>
  16771. <dt><samp class="option">mgain</samp></dt>
  16772. <dd><p>Set max gain that will be displayed. Only useful if curves option is activated.
  16773. Setting this to a reasonable value makes it possible to display gain which is derived from
  16774. neighbour bands which are too close to each other and thus produce higher gain
  16775. when both are activated.
  16776. </p>
  16777. </dd>
  16778. <dt><samp class="option">fscale</samp></dt>
  16779. <dd><p>Set frequency scale used to draw frequency response in video output.
  16780. Can be linear or logarithmic. Default is logarithmic.
  16781. </p>
  16782. </dd>
  16783. <dt><samp class="option">colors</samp></dt>
  16784. <dd><p>Set color for each channel curve which is going to be displayed in video stream.
  16785. This is list of color names separated by space or by &rsquo;|&rsquo;.
  16786. Unrecognised or missing colors will be replaced by white color.
  16787. </p></dd>
  16788. </dl>
  16789. <ul class="mini-toc">
  16790. <li><a href="#Examples-29" accesskey="1">Examples</a></li>
  16791. <li><a href="#Commands-15" accesskey="2">Commands</a></li>
  16792. </ul>
  16793. <div class="subsection-level-extent" id="Examples-29">
  16794. <h4 class="subsection"><span>27.37.1 Examples<a class="copiable-link" href="#Examples-29"> &para;</a></span></h4>
  16795. <ul class="itemize mark-bullet">
  16796. <li>Lower gain by 10 of central frequency 200Hz and width 100 Hz
  16797. for first 2 channels using Chebyshev type 1 filter:
  16798. <div class="example">
  16799. <pre class="example-preformatted">anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
  16800. </pre></div>
  16801. </li></ul>
  16802. </div>
  16803. <div class="subsection-level-extent" id="Commands-15">
  16804. <h4 class="subsection"><span>27.37.2 Commands<a class="copiable-link" href="#Commands-15"> &para;</a></span></h4>
  16805. <p>This filter supports the following commands:
  16806. </p><dl class="table">
  16807. <dt><samp class="option">change</samp></dt>
  16808. <dd><p>Alter existing filter parameters.
  16809. 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;
  16810. </p>
  16811. <p><var class="var">fN</var> is existing filter number, starting from 0, if no such filter is available
  16812. error is returned.
  16813. <var class="var">freq</var> set new frequency parameter.
  16814. <var class="var">width</var> set new width parameter in Hertz.
  16815. <var class="var">gain</var> set new gain parameter in dB.
  16816. </p>
  16817. <p>Full filter invocation with asendcmd may look like this:
  16818. asendcmd=c=&rsquo;4.0 anequalizer change 0|f=200|w=50|g=1&rsquo;,anequalizer=...
  16819. </p></dd>
  16820. </dl>
  16821. </div>
  16822. </div>
  16823. <div class="section-level-extent" id="anlmdn">
  16824. <h3 class="section"><span>27.38 anlmdn<a class="copiable-link" href="#anlmdn"> &para;</a></span></h3>
  16825. <p>Reduce broadband noise in audio samples using Non-Local Means algorithm.
  16826. </p>
  16827. <p>Each sample is adjusted by looking for other samples with similar contexts. This
  16828. context similarity is defined by comparing their surrounding patches of size
  16829. <samp class="option">p</samp>. Patches are searched in an area of <samp class="option">r</samp> around the sample.
  16830. </p>
  16831. <p>The filter accepts the following options:
  16832. </p>
  16833. <dl class="table">
  16834. <dt><samp class="option">strength, s</samp></dt>
  16835. <dd><p>Set denoising strength. Allowed range is from 0.00001 to 10000. Default value is 0.00001.
  16836. </p>
  16837. </dd>
  16838. <dt><samp class="option">patch, p</samp></dt>
  16839. <dd><p>Set patch radius duration. Allowed range is from 1 to 100 milliseconds.
  16840. Default value is 2 milliseconds.
  16841. </p>
  16842. </dd>
  16843. <dt><samp class="option">research, r</samp></dt>
  16844. <dd><p>Set research radius duration. Allowed range is from 2 to 300 milliseconds.
  16845. Default value is 6 milliseconds.
  16846. </p>
  16847. </dd>
  16848. <dt><samp class="option">output, o</samp></dt>
  16849. <dd><p>Set the output mode.
  16850. </p>
  16851. <p>It accepts the following values:
  16852. </p><dl class="table">
  16853. <dt><samp class="option">i</samp></dt>
  16854. <dd><p>Pass input unchanged.
  16855. </p>
  16856. </dd>
  16857. <dt><samp class="option">o</samp></dt>
  16858. <dd><p>Pass noise filtered out.
  16859. </p>
  16860. </dd>
  16861. <dt><samp class="option">n</samp></dt>
  16862. <dd><p>Pass only noise.
  16863. </p>
  16864. <p>Default value is <var class="var">o</var>.
  16865. </p></dd>
  16866. </dl>
  16867. </dd>
  16868. <dt><samp class="option">smooth, m</samp></dt>
  16869. <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>.
  16870. </p></dd>
  16871. </dl>
  16872. <ul class="mini-toc">
  16873. <li><a href="#Commands-16" accesskey="1">Commands</a></li>
  16874. </ul>
  16875. <div class="subsection-level-extent" id="Commands-16">
  16876. <h4 class="subsection"><span>27.38.1 Commands<a class="copiable-link" href="#Commands-16"> &para;</a></span></h4>
  16877. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  16878. </p>
  16879. </div>
  16880. </div>
  16881. <div class="section-level-extent" id="anlmf_002c-anlms">
  16882. <h3 class="section"><span>27.39 anlmf, anlms<a class="copiable-link" href="#anlmf_002c-anlms"> &para;</a></span></h3>
  16883. <p>Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream.
  16884. </p>
  16885. <p>This adaptive filter is used to mimic a desired filter by finding the filter coefficients that
  16886. relate to producing the least mean square of the error signal (difference between the desired,
  16887. 2nd input audio stream and the actual signal, the 1st input audio stream).
  16888. </p>
  16889. <p>A description of the accepted options follows.
  16890. </p>
  16891. <dl class="table">
  16892. <dt><samp class="option">order</samp></dt>
  16893. <dd><p>Set filter order.
  16894. </p>
  16895. </dd>
  16896. <dt><samp class="option">mu</samp></dt>
  16897. <dd><p>Set filter mu.
  16898. </p>
  16899. </dd>
  16900. <dt><samp class="option">eps</samp></dt>
  16901. <dd><p>Set the filter eps.
  16902. </p>
  16903. </dd>
  16904. <dt><samp class="option">leakage</samp></dt>
  16905. <dd><p>Set the filter leakage.
  16906. </p>
  16907. </dd>
  16908. <dt><samp class="option">out_mode</samp></dt>
  16909. <dd><p>It accepts the following values:
  16910. </p><dl class="table">
  16911. <dt><samp class="option">i</samp></dt>
  16912. <dd><p>Pass the 1st input.
  16913. </p>
  16914. </dd>
  16915. <dt><samp class="option">d</samp></dt>
  16916. <dd><p>Pass the 2nd input.
  16917. </p>
  16918. </dd>
  16919. <dt><samp class="option">o</samp></dt>
  16920. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  16921. </p>
  16922. </dd>
  16923. <dt><samp class="option">n</samp></dt>
  16924. <dd><p>Pass difference between input, 1st input and error signal estimate.
  16925. </p>
  16926. </dd>
  16927. <dt><samp class="option">e</samp></dt>
  16928. <dd><p>Pass error signal estimated samples.
  16929. </p>
  16930. <p>Default value is <var class="var">o</var>.
  16931. </p></dd>
  16932. </dl>
  16933. </dd>
  16934. <dt><samp class="option">precision</samp></dt>
  16935. <dd><p>Set which precision to use when processing samples.
  16936. </p>
  16937. <dl class="table">
  16938. <dt><samp class="option">auto</samp></dt>
  16939. <dd><p>Auto pick internal sample format depending on other filters.
  16940. </p>
  16941. </dd>
  16942. <dt><samp class="option">float</samp></dt>
  16943. <dd><p>Always use single-floating point precision sample format.
  16944. </p>
  16945. </dd>
  16946. <dt><samp class="option">double</samp></dt>
  16947. <dd><p>Always use double-floating point precision sample format.
  16948. </p></dd>
  16949. </dl>
  16950. </dd>
  16951. </dl>
  16952. <ul class="mini-toc">
  16953. <li><a href="#Examples-30" accesskey="1">Examples</a></li>
  16954. <li><a href="#Commands-17" accesskey="2">Commands</a></li>
  16955. </ul>
  16956. <div class="subsection-level-extent" id="Examples-30">
  16957. <h4 class="subsection"><span>27.39.1 Examples<a class="copiable-link" href="#Examples-30"> &para;</a></span></h4>
  16958. <ul class="itemize mark-bullet">
  16959. <li>One of many usages of this filter is noise reduction, input audio is filtered
  16960. with same samples that are delayed by fixed amount, one such example for stereo audio is:
  16961. <div class="example">
  16962. <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
  16963. </pre></div>
  16964. </li></ul>
  16965. </div>
  16966. <div class="subsection-level-extent" id="Commands-17">
  16967. <h4 class="subsection"><span>27.39.2 Commands<a class="copiable-link" href="#Commands-17"> &para;</a></span></h4>
  16968. <p>This filter supports the same commands as options, excluding option <code class="code">order</code>.
  16969. </p>
  16970. </div>
  16971. </div>
  16972. <div class="section-level-extent" id="anull">
  16973. <h3 class="section"><span>27.40 anull<a class="copiable-link" href="#anull"> &para;</a></span></h3>
  16974. <p>Pass the audio source unchanged to the output.
  16975. </p>
  16976. </div>
  16977. <div class="section-level-extent" id="apad">
  16978. <h3 class="section"><span>27.41 apad<a class="copiable-link" href="#apad"> &para;</a></span></h3>
  16979. <p>Pad the end of an audio stream with silence.
  16980. </p>
  16981. <p>This can be used together with <code class="command">ffmpeg</code> <samp class="option">-shortest</samp> to
  16982. extend audio streams to the same length as the video stream.
  16983. </p>
  16984. <p>A description of the accepted options follows.
  16985. </p>
  16986. <dl class="table">
  16987. <dt><samp class="option">packet_size</samp></dt>
  16988. <dd><p>Set silence packet size. Default value is 4096.
  16989. </p>
  16990. </dd>
  16991. <dt><samp class="option">pad_len</samp></dt>
  16992. <dd><p>Set the number of samples of silence to add to the end. After the
  16993. value is reached, the stream is terminated. This option is mutually
  16994. exclusive with <samp class="option">whole_len</samp>.
  16995. </p>
  16996. </dd>
  16997. <dt><samp class="option">whole_len</samp></dt>
  16998. <dd><p>Set the minimum total number of samples in the output audio stream. If
  16999. the value is longer than the input audio length, silence is added to
  17000. the end, until the value is reached. This option is mutually exclusive
  17001. with <samp class="option">pad_len</samp>.
  17002. </p>
  17003. </dd>
  17004. <dt><samp class="option">pad_dur</samp></dt>
  17005. <dd><p>Specify the duration of samples of silence to add. See
  17006. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  17007. for the accepted syntax. Used only if set to non-negative value.
  17008. </p>
  17009. </dd>
  17010. <dt><samp class="option">whole_dur</samp></dt>
  17011. <dd><p>Specify the minimum total duration in the output audio stream. See
  17012. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  17013. for the accepted syntax. Used only if set to non-negative value. If the value is longer than
  17014. the input audio length, silence is added to the end, until the value is reached.
  17015. This option is mutually exclusive with <samp class="option">pad_dur</samp>
  17016. </p></dd>
  17017. </dl>
  17018. <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>
  17019. nor <samp class="option">whole_dur</samp> option is set, the filter will add silence to the end of
  17020. the input stream indefinitely.
  17021. </p>
  17022. <p>Note that for ffmpeg 4.4 and earlier a zero <samp class="option">pad_dur</samp> or
  17023. <samp class="option">whole_dur</samp> also caused the filter to add silence indefinitely.
  17024. </p>
  17025. <ul class="mini-toc">
  17026. <li><a href="#Examples-31" accesskey="1">Examples</a></li>
  17027. </ul>
  17028. <div class="subsection-level-extent" id="Examples-31">
  17029. <h4 class="subsection"><span>27.41.1 Examples<a class="copiable-link" href="#Examples-31"> &para;</a></span></h4>
  17030. <ul class="itemize mark-bullet">
  17031. <li>Add 1024 samples of silence to the end of the input:
  17032. <div class="example">
  17033. <pre class="example-preformatted">apad=pad_len=1024
  17034. </pre></div>
  17035. </li><li>Make sure the audio output will contain at least 10000 samples, pad
  17036. the input with silence if required:
  17037. <div class="example">
  17038. <pre class="example-preformatted">apad=whole_len=10000
  17039. </pre></div>
  17040. </li><li>Use <code class="command">ffmpeg</code> to pad the audio input with silence, so that the
  17041. video stream will always result the shortest and will be converted
  17042. until the end in the output file when using the <samp class="option">shortest</samp>
  17043. option:
  17044. <div class="example">
  17045. <pre class="example-preformatted">ffmpeg -i VIDEO -i AUDIO -filter_complex &quot;[1:0]apad&quot; -shortest OUTPUT
  17046. </pre></div>
  17047. </li></ul>
  17048. </div>
  17049. </div>
  17050. <div class="section-level-extent" id="aphaser">
  17051. <h3 class="section"><span>27.42 aphaser<a class="copiable-link" href="#aphaser"> &para;</a></span></h3>
  17052. <p>Add a phasing effect to the input audio.
  17053. </p>
  17054. <p>A phaser filter creates series of peaks and troughs in the frequency spectrum.
  17055. The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
  17056. </p>
  17057. <p>A description of the accepted parameters follows.
  17058. </p>
  17059. <dl class="table">
  17060. <dt><samp class="option">in_gain</samp></dt>
  17061. <dd><p>Set input gain. Default is 0.4.
  17062. </p>
  17063. </dd>
  17064. <dt><samp class="option">out_gain</samp></dt>
  17065. <dd><p>Set output gain. Default is 0.74
  17066. </p>
  17067. </dd>
  17068. <dt><samp class="option">delay</samp></dt>
  17069. <dd><p>Set delay in milliseconds. Default is 3.0.
  17070. </p>
  17071. </dd>
  17072. <dt><samp class="option">decay</samp></dt>
  17073. <dd><p>Set decay. Default is 0.4.
  17074. </p>
  17075. </dd>
  17076. <dt><samp class="option">speed</samp></dt>
  17077. <dd><p>Set modulation speed in Hz. Default is 0.5.
  17078. </p>
  17079. </dd>
  17080. <dt><samp class="option">type</samp></dt>
  17081. <dd><p>Set modulation type. Default is triangular.
  17082. </p>
  17083. <p>It accepts the following values:
  17084. </p><dl class="table">
  17085. <dt>&lsquo;<samp class="samp">triangular, t</samp>&rsquo;</dt>
  17086. <dt>&lsquo;<samp class="samp">sinusoidal, s</samp>&rsquo;</dt>
  17087. </dl>
  17088. </dd>
  17089. </dl>
  17090. </div>
  17091. <div class="section-level-extent" id="aphaseshift">
  17092. <h3 class="section"><span>27.43 aphaseshift<a class="copiable-link" href="#aphaseshift"> &para;</a></span></h3>
  17093. <p>Apply phase shift to input audio samples.
  17094. </p>
  17095. <p>The filter accepts the following options:
  17096. </p>
  17097. <dl class="table">
  17098. <dt><samp class="option">shift</samp></dt>
  17099. <dd><p>Specify phase shift. Allowed range is from -1.0 to 1.0.
  17100. Default value is 0.0.
  17101. </p>
  17102. </dd>
  17103. <dt><samp class="option">level</samp></dt>
  17104. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  17105. Default value is 1.0.
  17106. </p>
  17107. </dd>
  17108. <dt><samp class="option">order</samp></dt>
  17109. <dd><p>Set filter order used for filtering. Allowed range is from 1 to 16.
  17110. Default value is 8.
  17111. </p></dd>
  17112. </dl>
  17113. <ul class="mini-toc">
  17114. <li><a href="#Commands-18" accesskey="1">Commands</a></li>
  17115. </ul>
  17116. <div class="subsection-level-extent" id="Commands-18">
  17117. <h4 class="subsection"><span>27.43.1 Commands<a class="copiable-link" href="#Commands-18"> &para;</a></span></h4>
  17118. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17119. </p>
  17120. </div>
  17121. </div>
  17122. <div class="section-level-extent" id="apsnr">
  17123. <h3 class="section"><span>27.44 apsnr<a class="copiable-link" href="#apsnr"> &para;</a></span></h3>
  17124. <p>Measure Audio Peak Signal-to-Noise Ratio.
  17125. </p>
  17126. <p>This filter takes two audio streams for input, and outputs first
  17127. audio stream.
  17128. Results are in dB per channel at end of either input.
  17129. </p>
  17130. </div>
  17131. <div class="section-level-extent" id="apsyclip">
  17132. <h3 class="section"><span>27.45 apsyclip<a class="copiable-link" href="#apsyclip"> &para;</a></span></h3>
  17133. <p>Apply Psychoacoustic clipper to input audio stream.
  17134. </p>
  17135. <p>The filter accepts the following options:
  17136. </p>
  17137. <dl class="table">
  17138. <dt><samp class="option">level_in</samp></dt>
  17139. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  17140. </p>
  17141. </dd>
  17142. <dt><samp class="option">level_out</samp></dt>
  17143. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  17144. </p>
  17145. </dd>
  17146. <dt><samp class="option">clip</samp></dt>
  17147. <dd><p>Set the clipping start value. Default value is 0dBFS or 1.
  17148. </p>
  17149. </dd>
  17150. <dt><samp class="option">diff</samp></dt>
  17151. <dd><p>Output only difference samples, useful to hear introduced distortions.
  17152. By default is disabled.
  17153. </p>
  17154. </dd>
  17155. <dt><samp class="option">adaptive</samp></dt>
  17156. <dd><p>Set strength of adaptive distortion applied. Default value is 0.5.
  17157. Allowed range is from 0 to 1.
  17158. </p>
  17159. </dd>
  17160. <dt><samp class="option">iterations</samp></dt>
  17161. <dd><p>Set number of iterations of psychoacoustic clipper.
  17162. Allowed range is from 1 to 20. Default value is 10.
  17163. </p>
  17164. </dd>
  17165. <dt><samp class="option">level</samp></dt>
  17166. <dd><p>Auto level output signal. Default is disabled.
  17167. This normalizes audio back to 0dBFS if enabled.
  17168. </p></dd>
  17169. </dl>
  17170. <ul class="mini-toc">
  17171. <li><a href="#Commands-19" accesskey="1">Commands</a></li>
  17172. </ul>
  17173. <div class="subsection-level-extent" id="Commands-19">
  17174. <h4 class="subsection"><span>27.45.1 Commands<a class="copiable-link" href="#Commands-19"> &para;</a></span></h4>
  17175. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17176. </p>
  17177. </div>
  17178. </div>
  17179. <div class="section-level-extent" id="apulsator">
  17180. <h3 class="section"><span>27.46 apulsator<a class="copiable-link" href="#apulsator"> &para;</a></span></h3>
  17181. <p>Audio pulsator is something between an autopanner and a tremolo.
  17182. But it can produce funny stereo effects as well. Pulsator changes the volume
  17183. of the left and right channel based on a LFO (low frequency oscillator) with
  17184. different waveforms and shifted phases.
  17185. This filter have the ability to define an offset between left and right
  17186. channel. An offset of 0 means that both LFO shapes match each other.
  17187. The left and right channel are altered equally - a conventional tremolo.
  17188. An offset of 50% means that the shape of the right channel is exactly shifted
  17189. in phase (or moved backwards about half of the frequency) - pulsator acts as
  17190. an autopanner. At 1 both curves match again. Every setting in between moves the
  17191. phase shift gapless between all stages and produces some &quot;bypassing&quot; sounds with
  17192. sine and triangle waveforms. The more you set the offset near 1 (starting from
  17193. the 0.5) the faster the signal passes from the left to the right speaker.
  17194. </p>
  17195. <p>The filter accepts the following options:
  17196. </p>
  17197. <dl class="table">
  17198. <dt><samp class="option">level_in</samp></dt>
  17199. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  17200. </p>
  17201. </dd>
  17202. <dt><samp class="option">level_out</samp></dt>
  17203. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  17204. </p>
  17205. </dd>
  17206. <dt><samp class="option">mode</samp></dt>
  17207. <dd><p>Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
  17208. sawup or sawdown. Default is sine.
  17209. </p>
  17210. </dd>
  17211. <dt><samp class="option">amount</samp></dt>
  17212. <dd><p>Set modulation. Define how much of original signal is affected by the LFO.
  17213. </p>
  17214. </dd>
  17215. <dt><samp class="option">offset_l</samp></dt>
  17216. <dd><p>Set left channel offset. Default is 0. Allowed range is [0 - 1].
  17217. </p>
  17218. </dd>
  17219. <dt><samp class="option">offset_r</samp></dt>
  17220. <dd><p>Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
  17221. </p>
  17222. </dd>
  17223. <dt><samp class="option">width</samp></dt>
  17224. <dd><p>Set pulse width. Default is 1. Allowed range is [0 - 2].
  17225. </p>
  17226. </dd>
  17227. <dt><samp class="option">timing</samp></dt>
  17228. <dd><p>Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
  17229. </p>
  17230. </dd>
  17231. <dt><samp class="option">bpm</samp></dt>
  17232. <dd><p>Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
  17233. is set to bpm.
  17234. </p>
  17235. </dd>
  17236. <dt><samp class="option">ms</samp></dt>
  17237. <dd><p>Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
  17238. is set to ms.
  17239. </p>
  17240. </dd>
  17241. <dt><samp class="option">hz</samp></dt>
  17242. <dd><p>Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
  17243. if timing is set to hz.
  17244. </p></dd>
  17245. </dl>
  17246. <a class="anchor" id="aresample"></a></div>
  17247. <div class="section-level-extent" id="aresample-1">
  17248. <h3 class="section"><span>27.47 aresample<a class="copiable-link" href="#aresample-1"> &para;</a></span></h3>
  17249. <p>Resample the input audio to the specified parameters, using the
  17250. libswresample library. If none are specified then the filter will
  17251. automatically convert between its input and output.
  17252. </p>
  17253. <p>This filter is also able to stretch/squeeze the audio data to make it match
  17254. the timestamps or to inject silence / cut out audio to make it match the
  17255. timestamps, do a combination of both or do neither.
  17256. </p>
  17257. <p>The filter accepts the syntax
  17258. [<var class="var">sample_rate</var>:]<var class="var">resampler_options</var>, where <var class="var">sample_rate</var>
  17259. expresses a sample rate and <var class="var">resampler_options</var> is a list of
  17260. <var class="var">key</var>=<var class="var">value</var> pairs, separated by &quot;:&quot;. See the
  17261. <a data-manual="ffmpeg-resampler" href="ffmpeg-resampler.html#Resampler-Options">&quot;Resampler Options&quot; section in the
  17262. ffmpeg-resampler(1) manual</a>
  17263. for the complete list of supported options.
  17264. </p>
  17265. <ul class="mini-toc">
  17266. <li><a href="#Examples-32" accesskey="1">Examples</a></li>
  17267. </ul>
  17268. <div class="subsection-level-extent" id="Examples-32">
  17269. <h4 class="subsection"><span>27.47.1 Examples<a class="copiable-link" href="#Examples-32"> &para;</a></span></h4>
  17270. <ul class="itemize mark-bullet">
  17271. <li>Resample the input audio to 44100Hz:
  17272. <div class="example">
  17273. <pre class="example-preformatted">aresample=44100
  17274. </pre></div>
  17275. </li><li>Stretch/squeeze samples to the given timestamps, with a maximum of 1000
  17276. samples per second compensation:
  17277. <div class="example">
  17278. <pre class="example-preformatted">aresample=async=1000
  17279. </pre></div>
  17280. </li></ul>
  17281. </div>
  17282. </div>
  17283. <div class="section-level-extent" id="areverse">
  17284. <h3 class="section"><span>27.48 areverse<a class="copiable-link" href="#areverse"> &para;</a></span></h3>
  17285. <p>Reverse an audio clip.
  17286. </p>
  17287. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  17288. is suggested.
  17289. </p>
  17290. <ul class="mini-toc">
  17291. <li><a href="#Examples-33" accesskey="1">Examples</a></li>
  17292. </ul>
  17293. <div class="subsection-level-extent" id="Examples-33">
  17294. <h4 class="subsection"><span>27.48.1 Examples<a class="copiable-link" href="#Examples-33"> &para;</a></span></h4>
  17295. <ul class="itemize mark-bullet">
  17296. <li>Take the first 5 seconds of a clip, and reverse it.
  17297. <div class="example">
  17298. <pre class="example-preformatted">atrim=end=5,areverse
  17299. </pre></div>
  17300. </li></ul>
  17301. </div>
  17302. </div>
  17303. <div class="section-level-extent" id="arls">
  17304. <h3 class="section"><span>27.49 arls<a class="copiable-link" href="#arls"> &para;</a></span></h3>
  17305. <p>Apply Recursive Least Squares algorithm to the first audio stream using the second audio stream.
  17306. </p>
  17307. <p>This adaptive filter is used to mimic a desired filter by recursively finding the filter coefficients that
  17308. relate to producing the minimal weighted linear least squares cost function of the error signal (difference
  17309. between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream).
  17310. </p>
  17311. <p>A description of the accepted options follows.
  17312. </p>
  17313. <dl class="table">
  17314. <dt><samp class="option">order</samp></dt>
  17315. <dd><p>Set the filter order.
  17316. </p>
  17317. </dd>
  17318. <dt><samp class="option">lambda</samp></dt>
  17319. <dd><p>Set the forgetting factor.
  17320. </p>
  17321. </dd>
  17322. <dt><samp class="option">delta</samp></dt>
  17323. <dd><p>Set the coefficient to initialize internal covariance matrix.
  17324. </p>
  17325. </dd>
  17326. <dt><samp class="option">out_mode</samp></dt>
  17327. <dd><p>Set the filter output samples. It accepts the following values:
  17328. </p><dl class="table">
  17329. <dt><samp class="option">i</samp></dt>
  17330. <dd><p>Pass the 1st input.
  17331. </p>
  17332. </dd>
  17333. <dt><samp class="option">d</samp></dt>
  17334. <dd><p>Pass the 2nd input.
  17335. </p>
  17336. </dd>
  17337. <dt><samp class="option">o</samp></dt>
  17338. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  17339. </p>
  17340. </dd>
  17341. <dt><samp class="option">n</samp></dt>
  17342. <dd><p>Pass difference between input, 1st input and error signal estimate.
  17343. </p>
  17344. </dd>
  17345. <dt><samp class="option">e</samp></dt>
  17346. <dd><p>Pass error signal estimated samples.
  17347. </p>
  17348. <p>Default value is <var class="var">o</var>.
  17349. </p></dd>
  17350. </dl>
  17351. </dd>
  17352. <dt><samp class="option">precision</samp></dt>
  17353. <dd><p>Set which precision to use when processing samples.
  17354. </p>
  17355. <dl class="table">
  17356. <dt><samp class="option">auto</samp></dt>
  17357. <dd><p>Auto pick internal sample format depending on other filters.
  17358. </p>
  17359. </dd>
  17360. <dt><samp class="option">float</samp></dt>
  17361. <dd><p>Always use single-floating point precision sample format.
  17362. </p>
  17363. </dd>
  17364. <dt><samp class="option">double</samp></dt>
  17365. <dd><p>Always use double-floating point precision sample format.
  17366. </p></dd>
  17367. </dl>
  17368. </dd>
  17369. </dl>
  17370. </div>
  17371. <div class="section-level-extent" id="arnndn">
  17372. <h3 class="section"><span>27.50 arnndn<a class="copiable-link" href="#arnndn"> &para;</a></span></h3>
  17373. <p>Reduce noise from speech using Recurrent Neural Networks.
  17374. </p>
  17375. <p>This filter accepts the following options:
  17376. </p>
  17377. <dl class="table">
  17378. <dt><samp class="option">model, m</samp></dt>
  17379. <dd><p>Set train model file to load. This option is always required.
  17380. </p>
  17381. </dd>
  17382. <dt><samp class="option">mix</samp></dt>
  17383. <dd><p>Set how much to mix filtered samples into final output.
  17384. Allowed range is from -1 to 1. Default value is 1.
  17385. Negative values are special, they set how much to keep filtered noise
  17386. in the final filter output. Set this option to -1 to hear actual
  17387. noise removed from input signal.
  17388. </p></dd>
  17389. </dl>
  17390. <ul class="mini-toc">
  17391. <li><a href="#Commands-20" accesskey="1">Commands</a></li>
  17392. </ul>
  17393. <div class="subsection-level-extent" id="Commands-20">
  17394. <h4 class="subsection"><span>27.50.1 Commands<a class="copiable-link" href="#Commands-20"> &para;</a></span></h4>
  17395. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17396. </p>
  17397. </div>
  17398. </div>
  17399. <div class="section-level-extent" id="asdr">
  17400. <h3 class="section"><span>27.51 asdr<a class="copiable-link" href="#asdr"> &para;</a></span></h3>
  17401. <p>Measure Audio Signal-to-Distortion Ratio.
  17402. </p>
  17403. <p>This filter takes two audio streams for input, and outputs first
  17404. audio stream.
  17405. Results are in dB per channel at end of either input.
  17406. </p>
  17407. </div>
  17408. <div class="section-level-extent" id="asetnsamples">
  17409. <h3 class="section"><span>27.52 asetnsamples<a class="copiable-link" href="#asetnsamples"> &para;</a></span></h3>
  17410. <p>Set the number of samples per each output audio frame.
  17411. </p>
  17412. <p>The last output packet may contain a different number of samples, as
  17413. the filter will flush all the remaining samples when the input audio
  17414. signals its end.
  17415. </p>
  17416. <p>The filter accepts the following options:
  17417. </p>
  17418. <dl class="table">
  17419. <dt><samp class="option">nb_out_samples, n</samp></dt>
  17420. <dd><p>Set the number of frames per each output audio frame. The number is
  17421. intended as the number of samples <em class="emph">per each channel</em>.
  17422. Default value is 1024.
  17423. </p>
  17424. </dd>
  17425. <dt><samp class="option">pad, p</samp></dt>
  17426. <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
  17427. that the last frame will contain the same number of samples as the
  17428. previous ones. Default value is 1.
  17429. </p></dd>
  17430. </dl>
  17431. <p>For example, to set the number of per-frame samples to 1234 and
  17432. disable padding for the last frame, use:
  17433. </p><div class="example">
  17434. <pre class="example-preformatted">asetnsamples=n=1234:p=0
  17435. </pre></div>
  17436. </div>
  17437. <div class="section-level-extent" id="asetrate">
  17438. <h3 class="section"><span>27.53 asetrate<a class="copiable-link" href="#asetrate"> &para;</a></span></h3>
  17439. <p>Set the sample rate without altering the PCM data.
  17440. This will result in a change of speed and pitch.
  17441. </p>
  17442. <p>The filter accepts the following options:
  17443. </p>
  17444. <dl class="table">
  17445. <dt><samp class="option">sample_rate, r</samp></dt>
  17446. <dd><p>Set the output sample rate. Default is 44100 Hz.
  17447. </p></dd>
  17448. </dl>
  17449. </div>
  17450. <div class="section-level-extent" id="ashowinfo">
  17451. <h3 class="section"><span>27.54 ashowinfo<a class="copiable-link" href="#ashowinfo"> &para;</a></span></h3>
  17452. <p>Show a line containing various information for each input audio frame.
  17453. The input audio is not modified.
  17454. </p>
  17455. <p>The shown line contains a sequence of key/value pairs of the form
  17456. <var class="var">key</var>:<var class="var">value</var>.
  17457. </p>
  17458. <p>The following values are shown in the output:
  17459. </p>
  17460. <dl class="table">
  17461. <dt><samp class="option">n</samp></dt>
  17462. <dd><p>The (sequential) number of the input frame, starting from 0.
  17463. </p>
  17464. </dd>
  17465. <dt><samp class="option">pts</samp></dt>
  17466. <dd><p>The presentation timestamp of the input frame, in time base units; the time base
  17467. depends on the filter input pad, and is usually 1/<var class="var">sample_rate</var>.
  17468. </p>
  17469. </dd>
  17470. <dt><samp class="option">pts_time</samp></dt>
  17471. <dd><p>The presentation timestamp of the input frame in seconds.
  17472. </p>
  17473. </dd>
  17474. <dt><samp class="option">fmt</samp></dt>
  17475. <dd><p>The sample format.
  17476. </p>
  17477. </dd>
  17478. <dt><samp class="option">chlayout</samp></dt>
  17479. <dd><p>The channel layout.
  17480. </p>
  17481. </dd>
  17482. <dt><samp class="option">rate</samp></dt>
  17483. <dd><p>The sample rate for the audio frame.
  17484. </p>
  17485. </dd>
  17486. <dt><samp class="option">nb_samples</samp></dt>
  17487. <dd><p>The number of samples (per channel) in the frame.
  17488. </p>
  17489. </dd>
  17490. <dt><samp class="option">checksum</samp></dt>
  17491. <dd><p>The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
  17492. audio, the data is treated as if all the planes were concatenated.
  17493. </p>
  17494. </dd>
  17495. <dt><samp class="option">plane_checksums</samp></dt>
  17496. <dd><p>A list of Adler-32 checksums for each data plane.
  17497. </p></dd>
  17498. </dl>
  17499. </div>
  17500. <div class="section-level-extent" id="asisdr">
  17501. <h3 class="section"><span>27.55 asisdr<a class="copiable-link" href="#asisdr"> &para;</a></span></h3>
  17502. <p>Measure Audio Scaled-Invariant Signal-to-Distortion Ratio.
  17503. </p>
  17504. <p>This filter takes two audio streams for input, and outputs first
  17505. audio stream.
  17506. Results are in dB per channel at end of either input.
  17507. </p>
  17508. </div>
  17509. <div class="section-level-extent" id="asoftclip">
  17510. <h3 class="section"><span>27.56 asoftclip<a class="copiable-link" href="#asoftclip"> &para;</a></span></h3>
  17511. <p>Apply audio soft clipping.
  17512. </p>
  17513. <p>Soft clipping is a type of distortion effect where the amplitude of a signal is saturated
  17514. along a smooth curve, rather than the abrupt shape of hard-clipping.
  17515. </p>
  17516. <p>This filter accepts the following options:
  17517. </p>
  17518. <dl class="table">
  17519. <dt><samp class="option">type</samp></dt>
  17520. <dd><p>Set type of soft-clipping.
  17521. </p>
  17522. <p>It accepts the following values:
  17523. </p><dl class="table">
  17524. <dt><samp class="option">hard</samp></dt>
  17525. <dt><samp class="option">tanh</samp></dt>
  17526. <dt><samp class="option">atan</samp></dt>
  17527. <dt><samp class="option">cubic</samp></dt>
  17528. <dt><samp class="option">exp</samp></dt>
  17529. <dt><samp class="option">alg</samp></dt>
  17530. <dt><samp class="option">quintic</samp></dt>
  17531. <dt><samp class="option">sin</samp></dt>
  17532. <dt><samp class="option">erf</samp></dt>
  17533. </dl>
  17534. </dd>
  17535. <dt><samp class="option">threshold</samp></dt>
  17536. <dd><p>Set threshold from where to start clipping. Default value is 0dB or 1.
  17537. </p>
  17538. </dd>
  17539. <dt><samp class="option">output</samp></dt>
  17540. <dd><p>Set gain applied to output. Default value is 0dB or 1.
  17541. </p>
  17542. </dd>
  17543. <dt><samp class="option">param</samp></dt>
  17544. <dd><p>Set additional parameter which controls sigmoid function.
  17545. </p>
  17546. </dd>
  17547. <dt><samp class="option">oversample</samp></dt>
  17548. <dd><p>Set oversampling factor.
  17549. </p></dd>
  17550. </dl>
  17551. <ul class="mini-toc">
  17552. <li><a href="#Commands-21" accesskey="1">Commands</a></li>
  17553. </ul>
  17554. <div class="subsection-level-extent" id="Commands-21">
  17555. <h4 class="subsection"><span>27.56.1 Commands<a class="copiable-link" href="#Commands-21"> &para;</a></span></h4>
  17556. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17557. </p>
  17558. </div>
  17559. </div>
  17560. <div class="section-level-extent" id="aspectralstats">
  17561. <h3 class="section"><span>27.57 aspectralstats<a class="copiable-link" href="#aspectralstats"> &para;</a></span></h3>
  17562. <p>Display frequency domain statistical information about the audio channels.
  17563. Statistics are calculated and stored as metadata for each audio channel and for each audio frame.
  17564. </p>
  17565. <p>It accepts the following option:
  17566. </p><dl class="table">
  17567. <dt><samp class="option">win_size</samp></dt>
  17568. <dd><p>Set the window length in samples. Default value is 2048.
  17569. Allowed range is from 32 to 65536.
  17570. </p>
  17571. </dd>
  17572. <dt><samp class="option">win_func</samp></dt>
  17573. <dd><p>Set window function.
  17574. </p>
  17575. <p>It accepts the following values:
  17576. </p><dl class="table">
  17577. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  17578. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  17579. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  17580. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  17581. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  17582. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  17583. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  17584. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  17585. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  17586. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  17587. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  17588. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  17589. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  17590. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  17591. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  17592. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  17593. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  17594. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  17595. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  17596. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  17597. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  17598. </dl>
  17599. <p>Default is <code class="code">hann</code>.
  17600. </p>
  17601. </dd>
  17602. <dt><samp class="option">overlap</samp></dt>
  17603. <dd><p>Set window overlap. Allowed range is from <code class="code">0</code>
  17604. to <code class="code">1</code>. Default value is <code class="code">0.5</code>.
  17605. </p>
  17606. </dd>
  17607. <dt><samp class="option">measure</samp></dt>
  17608. <dd><p>Select the parameters which are measured. The metadata keys can
  17609. be used as flags, default is <samp class="option">all</samp> which measures everything.
  17610. <samp class="option">none</samp> disables all measurement.
  17611. </p></dd>
  17612. </dl>
  17613. <p>A list of each metadata key follows:
  17614. </p>
  17615. <dl class="table">
  17616. <dt><samp class="option">mean</samp></dt>
  17617. <dt><samp class="option">variance</samp></dt>
  17618. <dt><samp class="option">centroid</samp></dt>
  17619. <dt><samp class="option">spread</samp></dt>
  17620. <dt><samp class="option">skewness</samp></dt>
  17621. <dt><samp class="option">kurtosis</samp></dt>
  17622. <dt><samp class="option">entropy</samp></dt>
  17623. <dt><samp class="option">flatness</samp></dt>
  17624. <dt><samp class="option">crest</samp></dt>
  17625. <dt><samp class="option">flux</samp></dt>
  17626. <dt><samp class="option">slope</samp></dt>
  17627. <dt><samp class="option">decrease</samp></dt>
  17628. <dt><samp class="option">rolloff</samp></dt>
  17629. </dl>
  17630. </div>
  17631. <div class="section-level-extent" id="asr">
  17632. <h3 class="section"><span>27.58 asr<a class="copiable-link" href="#asr"> &para;</a></span></h3>
  17633. <p>Automatic Speech Recognition
  17634. </p>
  17635. <p>This filter uses PocketSphinx for speech recognition. To enable
  17636. compilation of this filter, you need to configure FFmpeg with
  17637. <code class="code">--enable-pocketsphinx</code>.
  17638. </p>
  17639. <p>It accepts the following options:
  17640. </p>
  17641. <dl class="table">
  17642. <dt><samp class="option">rate</samp></dt>
  17643. <dd><p>Set sampling rate of input audio. Defaults is <code class="code">16000</code>.
  17644. This need to match speech models, otherwise one will get poor results.
  17645. </p>
  17646. </dd>
  17647. <dt><samp class="option">hmm</samp></dt>
  17648. <dd><p>Set dictionary containing acoustic model files.
  17649. </p>
  17650. </dd>
  17651. <dt><samp class="option">dict</samp></dt>
  17652. <dd><p>Set pronunciation dictionary.
  17653. </p>
  17654. </dd>
  17655. <dt><samp class="option">lm</samp></dt>
  17656. <dd><p>Set language model file.
  17657. </p>
  17658. </dd>
  17659. <dt><samp class="option">lmctl</samp></dt>
  17660. <dd><p>Set language model set.
  17661. </p>
  17662. </dd>
  17663. <dt><samp class="option">lmname</samp></dt>
  17664. <dd><p>Set which language model to use.
  17665. </p>
  17666. </dd>
  17667. <dt><samp class="option">logfn</samp></dt>
  17668. <dd><p>Set output for log messages.
  17669. </p></dd>
  17670. </dl>
  17671. <p>The filter exports recognized speech as the frame metadata <code class="code">lavfi.asr.text</code>.
  17672. </p>
  17673. <a class="anchor" id="astats"></a></div>
  17674. <div class="section-level-extent" id="astats-1">
  17675. <h3 class="section"><span>27.59 astats<a class="copiable-link" href="#astats-1"> &para;</a></span></h3>
  17676. <p>Display time domain statistical information about the audio channels.
  17677. Statistics are calculated and displayed for each audio channel and,
  17678. where applicable, an overall figure is also given.
  17679. </p>
  17680. <p>It accepts the following option:
  17681. </p><dl class="table">
  17682. <dt><samp class="option">length</samp></dt>
  17683. <dd><p>Short window length in seconds, used for peak and trough RMS measurement.
  17684. Default is <code class="code">0.05</code> (50 milliseconds). Allowed range is <code class="code">[0 - 10]</code>.
  17685. </p>
  17686. </dd>
  17687. <dt><samp class="option">metadata</samp></dt>
  17688. <dd>
  17689. <p>Set metadata injection. All the metadata keys are prefixed with <code class="code">lavfi.astats.X</code>,
  17690. where <code class="code">X</code> is channel number starting from 1 or string <code class="code">Overall</code>. Default is
  17691. disabled.
  17692. </p>
  17693. <p>Available keys for each channel are:
  17694. <var class="var">Bit_depth</var>
  17695. <var class="var">Crest_factor</var>
  17696. <var class="var">DC_offset</var>
  17697. <var class="var">Dynamic_range</var>
  17698. <var class="var">Entropy</var>
  17699. <var class="var">Flat_factor</var>
  17700. <var class="var">Max_difference</var>
  17701. <var class="var">Max_level</var>
  17702. <var class="var">Mean_difference</var>
  17703. <var class="var">Min_difference</var>
  17704. <var class="var">Min_level</var>
  17705. <var class="var">Noise_floor</var>
  17706. <var class="var">Noise_floor_count</var>
  17707. <var class="var">Number_of_Infs</var>
  17708. <var class="var">Number_of_NaNs</var>
  17709. <var class="var">Number_of_denormals</var>
  17710. <var class="var">Peak_count</var>
  17711. <var class="var">Abs_Peak_count</var>
  17712. <var class="var">Peak_level</var>
  17713. <var class="var">RMS_difference</var>
  17714. <var class="var">RMS_peak</var>
  17715. <var class="var">RMS_trough</var>
  17716. <var class="var">Zero_crossings</var>
  17717. <var class="var">Zero_crossings_rate</var>
  17718. </p>
  17719. <p>and for <code class="code">Overall</code>:
  17720. <var class="var">Bit_depth</var>
  17721. <var class="var">DC_offset</var>
  17722. <var class="var">Entropy</var>
  17723. <var class="var">Flat_factor</var>
  17724. <var class="var">Max_difference</var>
  17725. <var class="var">Max_level</var>
  17726. <var class="var">Mean_difference</var>
  17727. <var class="var">Min_difference</var>
  17728. <var class="var">Min_level</var>
  17729. <var class="var">Noise_floor</var>
  17730. <var class="var">Noise_floor_count</var>
  17731. <var class="var">Number_of_Infs</var>
  17732. <var class="var">Number_of_NaNs</var>
  17733. <var class="var">Number_of_denormals</var>
  17734. <var class="var">Number_of_samples</var>
  17735. <var class="var">Peak_count</var>
  17736. <var class="var">Abs_Peak_count</var>
  17737. <var class="var">Peak_level</var>
  17738. <var class="var">RMS_difference</var>
  17739. <var class="var">RMS_level</var>
  17740. <var class="var">RMS_peak</var>
  17741. <var class="var">RMS_trough</var>
  17742. </p>
  17743. <p>For example, a full key looks like <code class="code">lavfi.astats.1.DC_offset</code> or
  17744. <code class="code">lavfi.astats.Overall.Peak_count</code>.
  17745. </p>
  17746. <p>Read below for the description of the keys.
  17747. </p>
  17748. </dd>
  17749. <dt><samp class="option">reset</samp></dt>
  17750. <dd><p>Set the number of frames over which cumulative stats are calculated before
  17751. being reset. Default is disabled.
  17752. </p>
  17753. </dd>
  17754. <dt><samp class="option">measure_perchannel</samp></dt>
  17755. <dd><p>Select the parameters which are measured per channel. The metadata keys can
  17756. be used as flags, default is <samp class="option">all</samp> which measures everything.
  17757. <samp class="option">none</samp> disables all per channel measurement.
  17758. </p>
  17759. </dd>
  17760. <dt><samp class="option">measure_overall</samp></dt>
  17761. <dd><p>Select the parameters which are measured overall. The metadata keys can
  17762. be used as flags, default is <samp class="option">all</samp> which measures everything.
  17763. <samp class="option">none</samp> disables all overall measurement.
  17764. </p>
  17765. </dd>
  17766. </dl>
  17767. <p>A description of the measure keys follow:
  17768. </p>
  17769. <dl class="table">
  17770. <dt><samp class="option">none</samp></dt>
  17771. <dd><p>no measures
  17772. </p>
  17773. </dd>
  17774. <dt><samp class="option">all</samp></dt>
  17775. <dd><p>all measures
  17776. </p>
  17777. </dd>
  17778. <dt><samp class="option">Bit_depth</samp></dt>
  17779. <dd><p>overall bit depth of audio, i.e. number of bits used for each sample
  17780. </p>
  17781. </dd>
  17782. <dt><samp class="option">Crest_factor</samp></dt>
  17783. <dd><p>standard ratio of peak to RMS level (note: not in dB)
  17784. </p>
  17785. </dd>
  17786. <dt><samp class="option">DC_offset</samp></dt>
  17787. <dd><p>mean amplitude displacement from zero
  17788. </p>
  17789. </dd>
  17790. <dt><samp class="option">Dynamic_range</samp></dt>
  17791. <dd><p>measured dynamic range of audio in dB
  17792. </p>
  17793. </dd>
  17794. <dt><samp class="option">Entropy</samp></dt>
  17795. <dd><p>entropy measured across whole audio, entropy of value near 1.0 is typically measured for white noise
  17796. </p>
  17797. </dd>
  17798. <dt><samp class="option">Flat_factor</samp></dt>
  17799. <dd><p>flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
  17800. (i.e. either <var class="var">Min_level</var> or <var class="var">Max_level</var>)
  17801. </p>
  17802. </dd>
  17803. <dt><samp class="option">Max_difference</samp></dt>
  17804. <dd><p>maximal difference between two consecutive samples
  17805. </p>
  17806. </dd>
  17807. <dt><samp class="option">Max_level</samp></dt>
  17808. <dd><p>maximal sample level
  17809. </p>
  17810. </dd>
  17811. <dt><samp class="option">Mean_difference</samp></dt>
  17812. <dd><p>mean difference between two consecutive samples, i.e. the average of each difference between two consecutive samples
  17813. </p>
  17814. </dd>
  17815. <dt><samp class="option">Min_difference</samp></dt>
  17816. <dd><p>minimal difference between two consecutive samples
  17817. </p>
  17818. </dd>
  17819. <dt><samp class="option">Min_level</samp></dt>
  17820. <dd><p>minimal sample level
  17821. </p>
  17822. </dd>
  17823. <dt><samp class="option">Noise_floor</samp></dt>
  17824. <dd><p>minimum local peak measured in dBFS over a short window
  17825. </p>
  17826. </dd>
  17827. <dt><samp class="option">Noise_floor_count</samp></dt>
  17828. <dd><p>number of occasions (not the number of samples) that the signal attained
  17829. <var class="var">Noise floor</var>
  17830. </p>
  17831. </dd>
  17832. <dt><samp class="option">Number_of_Infs</samp></dt>
  17833. <dd><p>number of samples with an infinite value
  17834. </p>
  17835. </dd>
  17836. <dt><samp class="option">Number_of_NaNs</samp></dt>
  17837. <dd><p>number of samples with a NaN (not a number) value
  17838. </p>
  17839. </dd>
  17840. <dt><samp class="option">Number_of_denormals</samp></dt>
  17841. <dd><p>number of samples with a subnormal value
  17842. </p>
  17843. </dd>
  17844. <dt><samp class="option">Number_of_samples</samp></dt>
  17845. <dd><p>number of samples
  17846. </p>
  17847. </dd>
  17848. <dt><samp class="option">Peak_count</samp></dt>
  17849. <dd><p>number of occasions (not the number of samples) that the signal attained either
  17850. <var class="var">Min_level</var> or <var class="var">Max_level</var>
  17851. </p>
  17852. </dd>
  17853. <dt><samp class="option">Abs_Peak_count</samp></dt>
  17854. <dd><p>number of occasions that the absolute samples taken from the signal attained
  17855. max absolute value of <var class="var">Min_level</var> and <var class="var">Max_level</var>
  17856. </p>
  17857. </dd>
  17858. <dt><samp class="option">Peak_level</samp></dt>
  17859. <dd><p>standard peak level measured in dBFS
  17860. </p>
  17861. </dd>
  17862. <dt><samp class="option">RMS_difference</samp></dt>
  17863. <dd><p>Root Mean Square difference between two consecutive samples
  17864. </p>
  17865. </dd>
  17866. <dt><samp class="option">RMS_level</samp></dt>
  17867. <dd><p>standard RMS level measured in dBFS
  17868. </p>
  17869. </dd>
  17870. <dt><samp class="option">RMS_peak</samp></dt>
  17871. <dt><samp class="option">RMS_trough</samp></dt>
  17872. <dd><p>peak and trough values for RMS level measured over a short window,
  17873. measured in dBFS.
  17874. </p>
  17875. </dd>
  17876. <dt><samp class="option">Zero crossings</samp></dt>
  17877. <dd><p>number of points where the waveform crosses the zero level axis
  17878. </p>
  17879. </dd>
  17880. <dt><samp class="option">Zero crossings rate</samp></dt>
  17881. <dd><p>rate of Zero crossings and number of audio samples
  17882. </p></dd>
  17883. </dl>
  17884. </div>
  17885. <div class="section-level-extent" id="asubboost">
  17886. <h3 class="section"><span>27.60 asubboost<a class="copiable-link" href="#asubboost"> &para;</a></span></h3>
  17887. <p>Boost subwoofer frequencies.
  17888. </p>
  17889. <p>The filter accepts the following options:
  17890. </p>
  17891. <dl class="table">
  17892. <dt><samp class="option">dry</samp></dt>
  17893. <dd><p>Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1.
  17894. Default value is 1.0.
  17895. </p>
  17896. </dd>
  17897. <dt><samp class="option">wet</samp></dt>
  17898. <dd><p>Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1.
  17899. Default value is 1.0.
  17900. </p>
  17901. </dd>
  17902. <dt><samp class="option">boost</samp></dt>
  17903. <dd><p>Set max boost factor. Allowed range is from 1 to 12. Default value is 2.
  17904. </p>
  17905. </dd>
  17906. <dt><samp class="option">decay</samp></dt>
  17907. <dd><p>Set delay line decay gain value. Allowed range is from 0 to 1.
  17908. Default value is 0.0.
  17909. </p>
  17910. </dd>
  17911. <dt><samp class="option">feedback</samp></dt>
  17912. <dd><p>Set delay line feedback gain value. Allowed range is from 0 to 1.
  17913. Default value is 0.9.
  17914. </p>
  17915. </dd>
  17916. <dt><samp class="option">cutoff</samp></dt>
  17917. <dd><p>Set cutoff frequency in Hertz. Allowed range is 50 to 900.
  17918. Default value is 100.
  17919. </p>
  17920. </dd>
  17921. <dt><samp class="option">slope</samp></dt>
  17922. <dd><p>Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1.
  17923. Default value is 0.5.
  17924. </p>
  17925. </dd>
  17926. <dt><samp class="option">delay</samp></dt>
  17927. <dd><p>Set delay. Allowed range is from 1 to 100.
  17928. Default value is 20.
  17929. </p>
  17930. </dd>
  17931. <dt><samp class="option">channels</samp></dt>
  17932. <dd><p>Set the channels to process. Default value is all available.
  17933. </p></dd>
  17934. </dl>
  17935. <ul class="mini-toc">
  17936. <li><a href="#Commands-22" accesskey="1">Commands</a></li>
  17937. </ul>
  17938. <div class="subsection-level-extent" id="Commands-22">
  17939. <h4 class="subsection"><span>27.60.1 Commands<a class="copiable-link" href="#Commands-22"> &para;</a></span></h4>
  17940. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17941. </p>
  17942. </div>
  17943. </div>
  17944. <div class="section-level-extent" id="asubcut">
  17945. <h3 class="section"><span>27.61 asubcut<a class="copiable-link" href="#asubcut"> &para;</a></span></h3>
  17946. <p>Cut subwoofer frequencies.
  17947. </p>
  17948. <p>This filter allows to set custom, steeper
  17949. roll off than highpass filter, and thus is able to more attenuate
  17950. frequency content in stop-band.
  17951. </p>
  17952. <p>The filter accepts the following options:
  17953. </p>
  17954. <dl class="table">
  17955. <dt><samp class="option">cutoff</samp></dt>
  17956. <dd><p>Set cutoff frequency in Hertz. Allowed range is 2 to 200.
  17957. Default value is 20.
  17958. </p>
  17959. </dd>
  17960. <dt><samp class="option">order</samp></dt>
  17961. <dd><p>Set filter order. Available values are from 3 to 20.
  17962. Default value is 10.
  17963. </p>
  17964. </dd>
  17965. <dt><samp class="option">level</samp></dt>
  17966. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  17967. </p></dd>
  17968. </dl>
  17969. <ul class="mini-toc">
  17970. <li><a href="#Commands-23" accesskey="1">Commands</a></li>
  17971. </ul>
  17972. <div class="subsection-level-extent" id="Commands-23">
  17973. <h4 class="subsection"><span>27.61.1 Commands<a class="copiable-link" href="#Commands-23"> &para;</a></span></h4>
  17974. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17975. </p>
  17976. </div>
  17977. </div>
  17978. <div class="section-level-extent" id="asupercut">
  17979. <h3 class="section"><span>27.62 asupercut<a class="copiable-link" href="#asupercut"> &para;</a></span></h3>
  17980. <p>Cut super frequencies.
  17981. </p>
  17982. <p>The filter accepts the following options:
  17983. </p>
  17984. <dl class="table">
  17985. <dt><samp class="option">cutoff</samp></dt>
  17986. <dd><p>Set cutoff frequency in Hertz. Allowed range is 20000 to 192000.
  17987. Default value is 20000.
  17988. </p>
  17989. </dd>
  17990. <dt><samp class="option">order</samp></dt>
  17991. <dd><p>Set filter order. Available values are from 3 to 20.
  17992. Default value is 10.
  17993. </p>
  17994. </dd>
  17995. <dt><samp class="option">level</samp></dt>
  17996. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  17997. </p></dd>
  17998. </dl>
  17999. <ul class="mini-toc">
  18000. <li><a href="#Commands-24" accesskey="1">Commands</a></li>
  18001. </ul>
  18002. <div class="subsection-level-extent" id="Commands-24">
  18003. <h4 class="subsection"><span>27.62.1 Commands<a class="copiable-link" href="#Commands-24"> &para;</a></span></h4>
  18004. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  18005. </p>
  18006. </div>
  18007. </div>
  18008. <div class="section-level-extent" id="asuperpass">
  18009. <h3 class="section"><span>27.63 asuperpass<a class="copiable-link" href="#asuperpass"> &para;</a></span></h3>
  18010. <p>Apply high order Butterworth band-pass filter.
  18011. </p>
  18012. <p>The filter accepts the following options:
  18013. </p>
  18014. <dl class="table">
  18015. <dt><samp class="option">centerf</samp></dt>
  18016. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  18017. Default value is 1000.
  18018. </p>
  18019. </dd>
  18020. <dt><samp class="option">order</samp></dt>
  18021. <dd><p>Set filter order. Available values are from 4 to 20.
  18022. Default value is 4.
  18023. </p>
  18024. </dd>
  18025. <dt><samp class="option">qfactor</samp></dt>
  18026. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  18027. </p>
  18028. </dd>
  18029. <dt><samp class="option">level</samp></dt>
  18030. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  18031. </p></dd>
  18032. </dl>
  18033. <ul class="mini-toc">
  18034. <li><a href="#Commands-25" accesskey="1">Commands</a></li>
  18035. </ul>
  18036. <div class="subsection-level-extent" id="Commands-25">
  18037. <h4 class="subsection"><span>27.63.1 Commands<a class="copiable-link" href="#Commands-25"> &para;</a></span></h4>
  18038. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  18039. </p>
  18040. </div>
  18041. </div>
  18042. <div class="section-level-extent" id="asuperstop">
  18043. <h3 class="section"><span>27.64 asuperstop<a class="copiable-link" href="#asuperstop"> &para;</a></span></h3>
  18044. <p>Apply high order Butterworth band-stop filter.
  18045. </p>
  18046. <p>The filter accepts the following options:
  18047. </p>
  18048. <dl class="table">
  18049. <dt><samp class="option">centerf</samp></dt>
  18050. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  18051. Default value is 1000.
  18052. </p>
  18053. </dd>
  18054. <dt><samp class="option">order</samp></dt>
  18055. <dd><p>Set filter order. Available values are from 4 to 20.
  18056. Default value is 4.
  18057. </p>
  18058. </dd>
  18059. <dt><samp class="option">qfactor</samp></dt>
  18060. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  18061. </p>
  18062. </dd>
  18063. <dt><samp class="option">level</samp></dt>
  18064. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  18065. </p></dd>
  18066. </dl>
  18067. <ul class="mini-toc">
  18068. <li><a href="#Commands-26" accesskey="1">Commands</a></li>
  18069. </ul>
  18070. <div class="subsection-level-extent" id="Commands-26">
  18071. <h4 class="subsection"><span>27.64.1 Commands<a class="copiable-link" href="#Commands-26"> &para;</a></span></h4>
  18072. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  18073. </p>
  18074. </div>
  18075. </div>
  18076. <div class="section-level-extent" id="atempo">
  18077. <h3 class="section"><span>27.65 atempo<a class="copiable-link" href="#atempo"> &para;</a></span></h3>
  18078. <p>Adjust audio tempo.
  18079. </p>
  18080. <p>The filter accepts exactly one parameter, the audio tempo. If not
  18081. specified then the filter will assume nominal 1.0 tempo. Tempo must
  18082. be in the [0.5, 100.0] range.
  18083. </p>
  18084. <p>Note that tempo greater than 2 will skip some samples rather than
  18085. blend them in. If for any reason this is a concern it is always
  18086. possible to daisy-chain several instances of atempo to achieve the
  18087. desired product tempo.
  18088. </p>
  18089. <ul class="mini-toc">
  18090. <li><a href="#Examples-34" accesskey="1">Examples</a></li>
  18091. <li><a href="#Commands-27" accesskey="2">Commands</a></li>
  18092. </ul>
  18093. <div class="subsection-level-extent" id="Examples-34">
  18094. <h4 class="subsection"><span>27.65.1 Examples<a class="copiable-link" href="#Examples-34"> &para;</a></span></h4>
  18095. <ul class="itemize mark-bullet">
  18096. <li>Slow down audio to 80% tempo:
  18097. <div class="example">
  18098. <pre class="example-preformatted">atempo=0.8
  18099. </pre></div>
  18100. </li><li>To speed up audio to 300% tempo:
  18101. <div class="example">
  18102. <pre class="example-preformatted">atempo=3
  18103. </pre></div>
  18104. </li><li>To speed up audio to 300% tempo by daisy-chaining two atempo instances:
  18105. <div class="example">
  18106. <pre class="example-preformatted">atempo=sqrt(3),atempo=sqrt(3)
  18107. </pre></div>
  18108. </li></ul>
  18109. </div>
  18110. <div class="subsection-level-extent" id="Commands-27">
  18111. <h4 class="subsection"><span>27.65.2 Commands<a class="copiable-link" href="#Commands-27"> &para;</a></span></h4>
  18112. <p>This filter supports the following commands:
  18113. </p><dl class="table">
  18114. <dt><samp class="option">tempo</samp></dt>
  18115. <dd><p>Change filter tempo scale factor.
  18116. Syntax for the command is : &quot;<var class="var">tempo</var>&quot;
  18117. </p></dd>
  18118. </dl>
  18119. </div>
  18120. </div>
  18121. <div class="section-level-extent" id="atilt">
  18122. <h3 class="section"><span>27.66 atilt<a class="copiable-link" href="#atilt"> &para;</a></span></h3>
  18123. <p>Apply spectral tilt filter to audio stream.
  18124. </p>
  18125. <p>This filter apply any spectral roll-off slope over any specified frequency band.
  18126. </p>
  18127. <p>The filter accepts the following options:
  18128. </p>
  18129. <dl class="table">
  18130. <dt><samp class="option">freq</samp></dt>
  18131. <dd><p>Set central frequency of tilt in Hz. Default is 10000 Hz.
  18132. </p>
  18133. </dd>
  18134. <dt><samp class="option">slope</samp></dt>
  18135. <dd><p>Set slope direction of tilt. Default is 0. Allowed range is from -1 to 1.
  18136. </p>
  18137. </dd>
  18138. <dt><samp class="option">width</samp></dt>
  18139. <dd><p>Set width of tilt. Default is 1000. Allowed range is from 100 to 10000.
  18140. </p>
  18141. </dd>
  18142. <dt><samp class="option">order</samp></dt>
  18143. <dd><p>Set order of tilt filter.
  18144. </p>
  18145. </dd>
  18146. <dt><samp class="option">level</samp></dt>
  18147. <dd><p>Set input volume level. Allowed range is from 0 to 4.
  18148. Default is 1.
  18149. </p></dd>
  18150. </dl>
  18151. <ul class="mini-toc">
  18152. <li><a href="#Commands-28" accesskey="1">Commands</a></li>
  18153. </ul>
  18154. <div class="subsection-level-extent" id="Commands-28">
  18155. <h4 class="subsection"><span>27.66.1 Commands<a class="copiable-link" href="#Commands-28"> &para;</a></span></h4>
  18156. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  18157. </p>
  18158. </div>
  18159. </div>
  18160. <div class="section-level-extent" id="atrim">
  18161. <h3 class="section"><span>27.67 atrim<a class="copiable-link" href="#atrim"> &para;</a></span></h3>
  18162. <p>Trim the input so that the output contains one continuous subpart of the input.
  18163. </p>
  18164. <p>It accepts the following parameters:
  18165. </p><dl class="table">
  18166. <dt><samp class="option">start</samp></dt>
  18167. <dd><p>Timestamp (in seconds) of the start of the section to keep. I.e. the audio
  18168. sample with the timestamp <var class="var">start</var> will be the first sample in the output.
  18169. </p>
  18170. </dd>
  18171. <dt><samp class="option">end</samp></dt>
  18172. <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
  18173. audio sample immediately preceding the one with the timestamp <var class="var">end</var> will be
  18174. the last sample in the output.
  18175. </p>
  18176. </dd>
  18177. <dt><samp class="option">start_pts</samp></dt>
  18178. <dd><p>Same as <var class="var">start</var>, except this option sets the start timestamp in samples
  18179. instead of seconds.
  18180. </p>
  18181. </dd>
  18182. <dt><samp class="option">end_pts</samp></dt>
  18183. <dd><p>Same as <var class="var">end</var>, except this option sets the end timestamp in samples instead
  18184. of seconds.
  18185. </p>
  18186. </dd>
  18187. <dt><samp class="option">duration</samp></dt>
  18188. <dd><p>The maximum duration of the output in seconds.
  18189. </p>
  18190. </dd>
  18191. <dt><samp class="option">start_sample</samp></dt>
  18192. <dd><p>The number of the first sample that should be output.
  18193. </p>
  18194. </dd>
  18195. <dt><samp class="option">end_sample</samp></dt>
  18196. <dd><p>The number of the first sample that should be dropped.
  18197. </p></dd>
  18198. </dl>
  18199. <p><samp class="option">start</samp>, <samp class="option">end</samp>, and <samp class="option">duration</samp> are expressed as time
  18200. duration specifications; see
  18201. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  18202. </p>
  18203. <p>Note that the first two sets of the start/end options and the <samp class="option">duration</samp>
  18204. option look at the frame timestamp, while the _sample options simply count the
  18205. samples that pass through the filter. So start/end_pts and start/end_sample will
  18206. give different results when the timestamps are wrong, inexact or do not start at
  18207. zero. Also note that this filter does not modify the timestamps. If you wish
  18208. to have the output timestamps start at zero, insert the asetpts filter after the
  18209. atrim filter.
  18210. </p>
  18211. <p>If multiple start or end options are set, this filter tries to be greedy and
  18212. keep all samples that match at least one of the specified constraints. To keep
  18213. only the part that matches all the constraints at once, chain multiple atrim
  18214. filters.
  18215. </p>
  18216. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  18217. just the end values to keep everything before the specified time.
  18218. </p>
  18219. <p>Examples:
  18220. </p><ul class="itemize mark-bullet">
  18221. <li>Drop everything except the second minute of input:
  18222. <div class="example">
  18223. <pre class="example-preformatted">ffmpeg -i INPUT -af atrim=60:120
  18224. </pre></div>
  18225. </li><li>Keep only the first 1000 samples:
  18226. <div class="example">
  18227. <pre class="example-preformatted">ffmpeg -i INPUT -af atrim=end_sample=1000
  18228. </pre></div>
  18229. </li></ul>
  18230. </div>
  18231. <div class="section-level-extent" id="axcorrelate">
  18232. <h3 class="section"><span>27.68 axcorrelate<a class="copiable-link" href="#axcorrelate"> &para;</a></span></h3>
  18233. <p>Calculate normalized windowed cross-correlation between two input audio streams.
  18234. </p>
  18235. <p>Resulted samples are always between -1 and 1 inclusive.
  18236. If result is 1 it means two input samples are highly correlated in that selected segment.
  18237. Result 0 means they are not correlated at all.
  18238. If result is -1 it means two input samples are out of phase, which means they cancel each
  18239. other.
  18240. </p>
  18241. <p>The filter accepts the following options:
  18242. </p>
  18243. <dl class="table">
  18244. <dt><samp class="option">size</samp></dt>
  18245. <dd><p>Set size of segment over which cross-correlation is calculated.
  18246. Default is 256. Allowed range is from 2 to 131072.
  18247. </p>
  18248. </dd>
  18249. <dt><samp class="option">algo</samp></dt>
  18250. <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>.
  18251. Default is <code class="code">best</code>. Fast algorithm assumes mean values over any given segment
  18252. are always zero and thus need much less calculations to make.
  18253. This is generally not true, but is valid for typical audio streams.
  18254. </p></dd>
  18255. </dl>
  18256. <ul class="mini-toc">
  18257. <li><a href="#Examples-35" accesskey="1">Examples</a></li>
  18258. </ul>
  18259. <div class="subsection-level-extent" id="Examples-35">
  18260. <h4 class="subsection"><span>27.68.1 Examples<a class="copiable-link" href="#Examples-35"> &para;</a></span></h4>
  18261. <ul class="itemize mark-bullet">
  18262. <li>Calculate correlation between channels in stereo audio stream:
  18263. <div class="example">
  18264. <pre class="example-preformatted">ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
  18265. </pre></div>
  18266. </li></ul>
  18267. </div>
  18268. </div>
  18269. <div class="section-level-extent" id="bandpass">
  18270. <h3 class="section"><span>27.69 bandpass<a class="copiable-link" href="#bandpass"> &para;</a></span></h3>
  18271. <p>Apply a two-pole Butterworth band-pass filter with central
  18272. frequency <var class="var">frequency</var>, and (3dB-point) band-width width.
  18273. The <var class="var">csg</var> option selects a constant skirt gain (peak gain = Q)
  18274. instead of the default: constant 0dB peak gain.
  18275. The filter roll off at 6dB per octave (20dB per decade).
  18276. </p>
  18277. <p>The filter accepts the following options:
  18278. </p>
  18279. <dl class="table">
  18280. <dt><samp class="option">frequency, f</samp></dt>
  18281. <dd><p>Set the filter&rsquo;s central frequency. Default is <code class="code">3000</code>.
  18282. </p>
  18283. </dd>
  18284. <dt><samp class="option">csg</samp></dt>
  18285. <dd><p>Constant skirt gain if set to 1. Defaults to 0.
  18286. </p>
  18287. </dd>
  18288. <dt><samp class="option">width_type, t</samp></dt>
  18289. <dd><p>Set method to specify band-width of filter.
  18290. </p><dl class="table">
  18291. <dt><samp class="option">h</samp></dt>
  18292. <dd><p>Hz
  18293. </p></dd>
  18294. <dt><samp class="option">q</samp></dt>
  18295. <dd><p>Q-Factor
  18296. </p></dd>
  18297. <dt><samp class="option">o</samp></dt>
  18298. <dd><p>octave
  18299. </p></dd>
  18300. <dt><samp class="option">s</samp></dt>
  18301. <dd><p>slope
  18302. </p></dd>
  18303. <dt><samp class="option">k</samp></dt>
  18304. <dd><p>kHz
  18305. </p></dd>
  18306. </dl>
  18307. </dd>
  18308. <dt><samp class="option">width, w</samp></dt>
  18309. <dd><p>Specify the band-width of a filter in width_type units.
  18310. </p>
  18311. </dd>
  18312. <dt><samp class="option">mix, m</samp></dt>
  18313. <dd><p>How much to use filtered signal in output. Default is 1.
  18314. Range is between 0 and 1.
  18315. </p>
  18316. </dd>
  18317. <dt><samp class="option">channels, c</samp></dt>
  18318. <dd><p>Specify which channels to filter, by default all available are filtered.
  18319. </p>
  18320. </dd>
  18321. <dt><samp class="option">normalize, n</samp></dt>
  18322. <dd><p>Normalize biquad coefficients, by default is disabled.
  18323. Enabling it will normalize magnitude response at DC to 0dB.
  18324. </p>
  18325. </dd>
  18326. <dt><samp class="option">transform, a</samp></dt>
  18327. <dd><p>Set transform type of IIR filter.
  18328. </p><dl class="table">
  18329. <dt><samp class="option">di</samp></dt>
  18330. <dt><samp class="option">dii</samp></dt>
  18331. <dt><samp class="option">tdi</samp></dt>
  18332. <dt><samp class="option">tdii</samp></dt>
  18333. <dt><samp class="option">latt</samp></dt>
  18334. <dt><samp class="option">svf</samp></dt>
  18335. <dt><samp class="option">zdf</samp></dt>
  18336. </dl>
  18337. </dd>
  18338. <dt><samp class="option">precision, r</samp></dt>
  18339. <dd><p>Set precision of filtering.
  18340. </p><dl class="table">
  18341. <dt><samp class="option">auto</samp></dt>
  18342. <dd><p>Pick automatic sample format depending on surround filters.
  18343. </p></dd>
  18344. <dt><samp class="option">s16</samp></dt>
  18345. <dd><p>Always use signed 16-bit.
  18346. </p></dd>
  18347. <dt><samp class="option">s32</samp></dt>
  18348. <dd><p>Always use signed 32-bit.
  18349. </p></dd>
  18350. <dt><samp class="option">f32</samp></dt>
  18351. <dd><p>Always use float 32-bit.
  18352. </p></dd>
  18353. <dt><samp class="option">f64</samp></dt>
  18354. <dd><p>Always use float 64-bit.
  18355. </p></dd>
  18356. </dl>
  18357. </dd>
  18358. <dt><samp class="option">block_size, b</samp></dt>
  18359. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  18360. value (higher than impulse response length truncated when reaches near zero values) filtering
  18361. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  18362. </p>
  18363. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  18364. </p></dd>
  18365. </dl>
  18366. <ul class="mini-toc">
  18367. <li><a href="#Commands-29" accesskey="1">Commands</a></li>
  18368. </ul>
  18369. <div class="subsection-level-extent" id="Commands-29">
  18370. <h4 class="subsection"><span>27.69.1 Commands<a class="copiable-link" href="#Commands-29"> &para;</a></span></h4>
  18371. <p>This filter supports the following commands:
  18372. </p><dl class="table">
  18373. <dt><samp class="option">frequency, f</samp></dt>
  18374. <dd><p>Change bandpass frequency.
  18375. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  18376. </p>
  18377. </dd>
  18378. <dt><samp class="option">width_type, t</samp></dt>
  18379. <dd><p>Change bandpass width_type.
  18380. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  18381. </p>
  18382. </dd>
  18383. <dt><samp class="option">width, w</samp></dt>
  18384. <dd><p>Change bandpass width.
  18385. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  18386. </p>
  18387. </dd>
  18388. <dt><samp class="option">mix, m</samp></dt>
  18389. <dd><p>Change bandpass mix.
  18390. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  18391. </p></dd>
  18392. </dl>
  18393. </div>
  18394. </div>
  18395. <div class="section-level-extent" id="bandreject">
  18396. <h3 class="section"><span>27.70 bandreject<a class="copiable-link" href="#bandreject"> &para;</a></span></h3>
  18397. <p>Apply a two-pole Butterworth band-reject filter with central
  18398. frequency <var class="var">frequency</var>, and (3dB-point) band-width <var class="var">width</var>.
  18399. The filter roll off at 6dB per octave (20dB per decade).
  18400. </p>
  18401. <p>The filter accepts the following options:
  18402. </p>
  18403. <dl class="table">
  18404. <dt><samp class="option">frequency, f</samp></dt>
  18405. <dd><p>Set the filter&rsquo;s central frequency. Default is <code class="code">3000</code>.
  18406. </p>
  18407. </dd>
  18408. <dt><samp class="option">width_type, t</samp></dt>
  18409. <dd><p>Set method to specify band-width of filter.
  18410. </p><dl class="table">
  18411. <dt><samp class="option">h</samp></dt>
  18412. <dd><p>Hz
  18413. </p></dd>
  18414. <dt><samp class="option">q</samp></dt>
  18415. <dd><p>Q-Factor
  18416. </p></dd>
  18417. <dt><samp class="option">o</samp></dt>
  18418. <dd><p>octave
  18419. </p></dd>
  18420. <dt><samp class="option">s</samp></dt>
  18421. <dd><p>slope
  18422. </p></dd>
  18423. <dt><samp class="option">k</samp></dt>
  18424. <dd><p>kHz
  18425. </p></dd>
  18426. </dl>
  18427. </dd>
  18428. <dt><samp class="option">width, w</samp></dt>
  18429. <dd><p>Specify the band-width of a filter in width_type units.
  18430. </p>
  18431. </dd>
  18432. <dt><samp class="option">mix, m</samp></dt>
  18433. <dd><p>How much to use filtered signal in output. Default is 1.
  18434. Range is between 0 and 1.
  18435. </p>
  18436. </dd>
  18437. <dt><samp class="option">channels, c</samp></dt>
  18438. <dd><p>Specify which channels to filter, by default all available are filtered.
  18439. </p>
  18440. </dd>
  18441. <dt><samp class="option">normalize, n</samp></dt>
  18442. <dd><p>Normalize biquad coefficients, by default is disabled.
  18443. Enabling it will normalize magnitude response at DC to 0dB.
  18444. </p>
  18445. </dd>
  18446. <dt><samp class="option">transform, a</samp></dt>
  18447. <dd><p>Set transform type of IIR filter.
  18448. </p><dl class="table">
  18449. <dt><samp class="option">di</samp></dt>
  18450. <dt><samp class="option">dii</samp></dt>
  18451. <dt><samp class="option">tdi</samp></dt>
  18452. <dt><samp class="option">tdii</samp></dt>
  18453. <dt><samp class="option">latt</samp></dt>
  18454. <dt><samp class="option">svf</samp></dt>
  18455. <dt><samp class="option">zdf</samp></dt>
  18456. </dl>
  18457. </dd>
  18458. <dt><samp class="option">precision, r</samp></dt>
  18459. <dd><p>Set precision of filtering.
  18460. </p><dl class="table">
  18461. <dt><samp class="option">auto</samp></dt>
  18462. <dd><p>Pick automatic sample format depending on surround filters.
  18463. </p></dd>
  18464. <dt><samp class="option">s16</samp></dt>
  18465. <dd><p>Always use signed 16-bit.
  18466. </p></dd>
  18467. <dt><samp class="option">s32</samp></dt>
  18468. <dd><p>Always use signed 32-bit.
  18469. </p></dd>
  18470. <dt><samp class="option">f32</samp></dt>
  18471. <dd><p>Always use float 32-bit.
  18472. </p></dd>
  18473. <dt><samp class="option">f64</samp></dt>
  18474. <dd><p>Always use float 64-bit.
  18475. </p></dd>
  18476. </dl>
  18477. </dd>
  18478. <dt><samp class="option">block_size, b</samp></dt>
  18479. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  18480. value (higher than impulse response length truncated when reaches near zero values) filtering
  18481. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  18482. </p>
  18483. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  18484. </p></dd>
  18485. </dl>
  18486. <ul class="mini-toc">
  18487. <li><a href="#Commands-30" accesskey="1">Commands</a></li>
  18488. </ul>
  18489. <div class="subsection-level-extent" id="Commands-30">
  18490. <h4 class="subsection"><span>27.70.1 Commands<a class="copiable-link" href="#Commands-30"> &para;</a></span></h4>
  18491. <p>This filter supports the following commands:
  18492. </p><dl class="table">
  18493. <dt><samp class="option">frequency, f</samp></dt>
  18494. <dd><p>Change bandreject frequency.
  18495. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  18496. </p>
  18497. </dd>
  18498. <dt><samp class="option">width_type, t</samp></dt>
  18499. <dd><p>Change bandreject width_type.
  18500. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  18501. </p>
  18502. </dd>
  18503. <dt><samp class="option">width, w</samp></dt>
  18504. <dd><p>Change bandreject width.
  18505. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  18506. </p>
  18507. </dd>
  18508. <dt><samp class="option">mix, m</samp></dt>
  18509. <dd><p>Change bandreject mix.
  18510. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  18511. </p></dd>
  18512. </dl>
  18513. </div>
  18514. </div>
  18515. <div class="section-level-extent" id="bass_002c-lowshelf">
  18516. <h3 class="section"><span>27.71 bass, lowshelf<a class="copiable-link" href="#bass_002c-lowshelf"> &para;</a></span></h3>
  18517. <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
  18518. shelving filter with a response similar to that of a standard
  18519. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  18520. </p>
  18521. <p>The filter accepts the following options:
  18522. </p>
  18523. <dl class="table">
  18524. <dt><samp class="option">gain, g</samp></dt>
  18525. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  18526. (for a large cut) to +20 (for a large boost).
  18527. Beware of clipping when using a positive gain.
  18528. </p>
  18529. </dd>
  18530. <dt><samp class="option">frequency, f</samp></dt>
  18531. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  18532. to extend or reduce the frequency range to be boosted or cut.
  18533. The default value is <code class="code">100</code> Hz.
  18534. </p>
  18535. </dd>
  18536. <dt><samp class="option">width_type, t</samp></dt>
  18537. <dd><p>Set method to specify band-width of filter.
  18538. </p><dl class="table">
  18539. <dt><samp class="option">h</samp></dt>
  18540. <dd><p>Hz
  18541. </p></dd>
  18542. <dt><samp class="option">q</samp></dt>
  18543. <dd><p>Q-Factor
  18544. </p></dd>
  18545. <dt><samp class="option">o</samp></dt>
  18546. <dd><p>octave
  18547. </p></dd>
  18548. <dt><samp class="option">s</samp></dt>
  18549. <dd><p>slope
  18550. </p></dd>
  18551. <dt><samp class="option">k</samp></dt>
  18552. <dd><p>kHz
  18553. </p></dd>
  18554. </dl>
  18555. </dd>
  18556. <dt><samp class="option">width, w</samp></dt>
  18557. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  18558. </p>
  18559. </dd>
  18560. <dt><samp class="option">poles, p</samp></dt>
  18561. <dd><p>Set number of poles. Default is 2.
  18562. </p>
  18563. </dd>
  18564. <dt><samp class="option">mix, m</samp></dt>
  18565. <dd><p>How much to use filtered signal in output. Default is 1.
  18566. Range is between 0 and 1.
  18567. </p>
  18568. </dd>
  18569. <dt><samp class="option">channels, c</samp></dt>
  18570. <dd><p>Specify which channels to filter, by default all available are filtered.
  18571. </p>
  18572. </dd>
  18573. <dt><samp class="option">normalize, n</samp></dt>
  18574. <dd><p>Normalize biquad coefficients, by default is disabled.
  18575. Enabling it will normalize magnitude response at DC to 0dB.
  18576. </p>
  18577. </dd>
  18578. <dt><samp class="option">transform, a</samp></dt>
  18579. <dd><p>Set transform type of IIR filter.
  18580. </p><dl class="table">
  18581. <dt><samp class="option">di</samp></dt>
  18582. <dt><samp class="option">dii</samp></dt>
  18583. <dt><samp class="option">tdi</samp></dt>
  18584. <dt><samp class="option">tdii</samp></dt>
  18585. <dt><samp class="option">latt</samp></dt>
  18586. <dt><samp class="option">svf</samp></dt>
  18587. <dt><samp class="option">zdf</samp></dt>
  18588. </dl>
  18589. </dd>
  18590. <dt><samp class="option">precision, r</samp></dt>
  18591. <dd><p>Set precision of filtering.
  18592. </p><dl class="table">
  18593. <dt><samp class="option">auto</samp></dt>
  18594. <dd><p>Pick automatic sample format depending on surround filters.
  18595. </p></dd>
  18596. <dt><samp class="option">s16</samp></dt>
  18597. <dd><p>Always use signed 16-bit.
  18598. </p></dd>
  18599. <dt><samp class="option">s32</samp></dt>
  18600. <dd><p>Always use signed 32-bit.
  18601. </p></dd>
  18602. <dt><samp class="option">f32</samp></dt>
  18603. <dd><p>Always use float 32-bit.
  18604. </p></dd>
  18605. <dt><samp class="option">f64</samp></dt>
  18606. <dd><p>Always use float 64-bit.
  18607. </p></dd>
  18608. </dl>
  18609. </dd>
  18610. <dt><samp class="option">block_size, b</samp></dt>
  18611. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  18612. value (higher than impulse response length truncated when reaches near zero values) filtering
  18613. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  18614. </p>
  18615. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  18616. </p></dd>
  18617. </dl>
  18618. <ul class="mini-toc">
  18619. <li><a href="#Commands-31" accesskey="1">Commands</a></li>
  18620. </ul>
  18621. <div class="subsection-level-extent" id="Commands-31">
  18622. <h4 class="subsection"><span>27.71.1 Commands<a class="copiable-link" href="#Commands-31"> &para;</a></span></h4>
  18623. <p>This filter supports the following commands:
  18624. </p><dl class="table">
  18625. <dt><samp class="option">frequency, f</samp></dt>
  18626. <dd><p>Change bass frequency.
  18627. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  18628. </p>
  18629. </dd>
  18630. <dt><samp class="option">width_type, t</samp></dt>
  18631. <dd><p>Change bass width_type.
  18632. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  18633. </p>
  18634. </dd>
  18635. <dt><samp class="option">width, w</samp></dt>
  18636. <dd><p>Change bass width.
  18637. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  18638. </p>
  18639. </dd>
  18640. <dt><samp class="option">gain, g</samp></dt>
  18641. <dd><p>Change bass gain.
  18642. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  18643. </p>
  18644. </dd>
  18645. <dt><samp class="option">mix, m</samp></dt>
  18646. <dd><p>Change bass mix.
  18647. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  18648. </p></dd>
  18649. </dl>
  18650. </div>
  18651. </div>
  18652. <div class="section-level-extent" id="biquad">
  18653. <h3 class="section"><span>27.72 biquad<a class="copiable-link" href="#biquad"> &para;</a></span></h3>
  18654. <p>Apply a biquad IIR filter with the given coefficients.
  18655. 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>
  18656. are the numerator and denominator coefficients respectively.
  18657. and <var class="var">channels</var>, <var class="var">c</var> specify which channels to filter, by default all
  18658. available are filtered.
  18659. </p>
  18660. <ul class="mini-toc">
  18661. <li><a href="#Commands-32" accesskey="1">Commands</a></li>
  18662. </ul>
  18663. <div class="subsection-level-extent" id="Commands-32">
  18664. <h4 class="subsection"><span>27.72.1 Commands<a class="copiable-link" href="#Commands-32"> &para;</a></span></h4>
  18665. <p>This filter supports the following commands:
  18666. </p><dl class="table">
  18667. <dt><samp class="option">a0</samp></dt>
  18668. <dt><samp class="option">a1</samp></dt>
  18669. <dt><samp class="option">a2</samp></dt>
  18670. <dt><samp class="option">b0</samp></dt>
  18671. <dt><samp class="option">b1</samp></dt>
  18672. <dt><samp class="option">b2</samp></dt>
  18673. <dd><p>Change biquad parameter.
  18674. Syntax for the command is : &quot;<var class="var">value</var>&quot;
  18675. </p>
  18676. </dd>
  18677. <dt><samp class="option">mix, m</samp></dt>
  18678. <dd><p>How much to use filtered signal in output. Default is 1.
  18679. Range is between 0 and 1.
  18680. </p>
  18681. </dd>
  18682. <dt><samp class="option">channels, c</samp></dt>
  18683. <dd><p>Specify which channels to filter, by default all available are filtered.
  18684. </p>
  18685. </dd>
  18686. <dt><samp class="option">normalize, n</samp></dt>
  18687. <dd><p>Normalize biquad coefficients, by default is disabled.
  18688. Enabling it will normalize magnitude response at DC to 0dB.
  18689. </p>
  18690. </dd>
  18691. <dt><samp class="option">transform, a</samp></dt>
  18692. <dd><p>Set transform type of IIR filter.
  18693. </p><dl class="table">
  18694. <dt><samp class="option">di</samp></dt>
  18695. <dt><samp class="option">dii</samp></dt>
  18696. <dt><samp class="option">tdi</samp></dt>
  18697. <dt><samp class="option">tdii</samp></dt>
  18698. <dt><samp class="option">latt</samp></dt>
  18699. <dt><samp class="option">svf</samp></dt>
  18700. <dt><samp class="option">zdf</samp></dt>
  18701. </dl>
  18702. </dd>
  18703. <dt><samp class="option">precision, r</samp></dt>
  18704. <dd><p>Set precision of filtering.
  18705. </p><dl class="table">
  18706. <dt><samp class="option">auto</samp></dt>
  18707. <dd><p>Pick automatic sample format depending on surround filters.
  18708. </p></dd>
  18709. <dt><samp class="option">s16</samp></dt>
  18710. <dd><p>Always use signed 16-bit.
  18711. </p></dd>
  18712. <dt><samp class="option">s32</samp></dt>
  18713. <dd><p>Always use signed 32-bit.
  18714. </p></dd>
  18715. <dt><samp class="option">f32</samp></dt>
  18716. <dd><p>Always use float 32-bit.
  18717. </p></dd>
  18718. <dt><samp class="option">f64</samp></dt>
  18719. <dd><p>Always use float 64-bit.
  18720. </p></dd>
  18721. </dl>
  18722. </dd>
  18723. <dt><samp class="option">block_size, b</samp></dt>
  18724. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  18725. value (higher than impulse response length truncated when reaches near zero values) filtering
  18726. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  18727. </p>
  18728. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  18729. </p></dd>
  18730. </dl>
  18731. </div>
  18732. </div>
  18733. <div class="section-level-extent" id="bs2b">
  18734. <h3 class="section"><span>27.73 bs2b<a class="copiable-link" href="#bs2b"> &para;</a></span></h3>
  18735. <p>Bauer stereo to binaural transformation, which improves headphone listening of
  18736. stereo audio records.
  18737. </p>
  18738. <p>To enable compilation of this filter you need to configure FFmpeg with
  18739. <code class="code">--enable-libbs2b</code>.
  18740. </p>
  18741. <p>It accepts the following parameters:
  18742. </p><dl class="table">
  18743. <dt><samp class="option">profile</samp></dt>
  18744. <dd><p>Pre-defined crossfeed level.
  18745. </p><dl class="table">
  18746. <dt><samp class="option">default</samp></dt>
  18747. <dd><p>Default level (fcut=700, feed=50).
  18748. </p>
  18749. </dd>
  18750. <dt><samp class="option">cmoy</samp></dt>
  18751. <dd><p>Chu Moy circuit (fcut=700, feed=60).
  18752. </p>
  18753. </dd>
  18754. <dt><samp class="option">jmeier</samp></dt>
  18755. <dd><p>Jan Meier circuit (fcut=650, feed=95).
  18756. </p>
  18757. </dd>
  18758. </dl>
  18759. </dd>
  18760. <dt><samp class="option">fcut</samp></dt>
  18761. <dd><p>Cut frequency (in Hz).
  18762. </p>
  18763. </dd>
  18764. <dt><samp class="option">feed</samp></dt>
  18765. <dd><p>Feed level (in Hz).
  18766. </p>
  18767. </dd>
  18768. </dl>
  18769. </div>
  18770. <div class="section-level-extent" id="channelmap">
  18771. <h3 class="section"><span>27.74 channelmap<a class="copiable-link" href="#channelmap"> &para;</a></span></h3>
  18772. <p>Remap input channels to new locations.
  18773. </p>
  18774. <p>It accepts the following parameters:
  18775. </p><dl class="table">
  18776. <dt><samp class="option">map</samp></dt>
  18777. <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-separated list of
  18778. mappings, each in the <code class="code"><var class="var">in_channel</var>-<var class="var">out_channel</var></code> or
  18779. <code class="code"><var class="var">in_channel</var></code> form. <var class="var">in_channel</var> can be either the name of the
  18780. input channel (e.g. FL for front left) or its index in the input channel
  18781. layout. <var class="var">out_channel</var> is the name of the output channel or its index in the
  18782. output channel layout. If <var class="var">out_channel</var> is not given then it is implicitly
  18783. an index, starting with zero and increasing by one for each mapping. Mixing
  18784. different types of mappings is not allowed and will result in a parse error.
  18785. </p>
  18786. </dd>
  18787. <dt><samp class="option">channel_layout</samp></dt>
  18788. <dd><p>The channel layout of the output stream. If not specified, then filter will
  18789. guess it based on the <var class="var">out_channel</var> names or the number of mappings.
  18790. Guessed layouts will not necessarily contain channels in the order of the
  18791. mappings.
  18792. </p></dd>
  18793. </dl>
  18794. <p>If no mapping is present, the filter will implicitly map input channels to
  18795. output channels, preserving indices.
  18796. </p>
  18797. <ul class="mini-toc">
  18798. <li><a href="#Examples-36" accesskey="1">Examples</a></li>
  18799. </ul>
  18800. <div class="subsection-level-extent" id="Examples-36">
  18801. <h4 class="subsection"><span>27.74.1 Examples<a class="copiable-link" href="#Examples-36"> &para;</a></span></h4>
  18802. <ul class="itemize mark-bullet">
  18803. <li>For example, assuming a 5.1+downmix input MOV file,
  18804. <div class="example">
  18805. <pre class="example-preformatted">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
  18806. </pre></div>
  18807. <p>will create an output WAV file tagged as stereo from the downmix channels of
  18808. the input.
  18809. </p>
  18810. </li><li>To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
  18811. <div class="example">
  18812. <pre class="example-preformatted">ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
  18813. </pre></div>
  18814. </li></ul>
  18815. </div>
  18816. </div>
  18817. <div class="section-level-extent" id="channelsplit">
  18818. <h3 class="section"><span>27.75 channelsplit<a class="copiable-link" href="#channelsplit"> &para;</a></span></h3>
  18819. <p>Split each channel from an input audio stream into a separate output stream.
  18820. </p>
  18821. <p>It accepts the following parameters:
  18822. </p><dl class="table">
  18823. <dt><samp class="option">channel_layout</samp></dt>
  18824. <dd><p>The channel layout of the input stream. The default is &quot;stereo&quot;.
  18825. </p></dd>
  18826. <dt><samp class="option">channels</samp></dt>
  18827. <dd><p>A channel layout describing the channels to be extracted as separate output streams
  18828. or &quot;all&quot; to extract each input channel as a separate stream. The default is &quot;all&quot;.
  18829. </p>
  18830. <p>Choosing channels not present in channel layout in the input will result in an error.
  18831. </p></dd>
  18832. </dl>
  18833. <ul class="mini-toc">
  18834. <li><a href="#Examples-37" accesskey="1">Examples</a></li>
  18835. </ul>
  18836. <div class="subsection-level-extent" id="Examples-37">
  18837. <h4 class="subsection"><span>27.75.1 Examples<a class="copiable-link" href="#Examples-37"> &para;</a></span></h4>
  18838. <ul class="itemize mark-bullet">
  18839. <li>For example, assuming a stereo input MP3 file,
  18840. <div class="example">
  18841. <pre class="example-preformatted">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
  18842. </pre></div>
  18843. <p>will create an output Matroska file with two audio streams, one containing only
  18844. the left channel and the other the right channel.
  18845. </p>
  18846. </li><li>Split a 5.1 WAV file into per-channel files:
  18847. <div class="example">
  18848. <pre class="example-preformatted">ffmpeg -i in.wav -filter_complex
  18849. 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
  18850. -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
  18851. front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
  18852. side_right.wav
  18853. </pre></div>
  18854. </li><li>Extract only LFE from a 5.1 WAV file:
  18855. <div class="example">
  18856. <pre class="example-preformatted">ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
  18857. -map '[LFE]' lfe.wav
  18858. </pre></div>
  18859. </li></ul>
  18860. </div>
  18861. </div>
  18862. <div class="section-level-extent" id="chorus">
  18863. <h3 class="section"><span>27.76 chorus<a class="copiable-link" href="#chorus"> &para;</a></span></h3>
  18864. <p>Add a chorus effect to the audio.
  18865. </p>
  18866. <p>Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
  18867. </p>
  18868. <p>Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
  18869. constant, with chorus, it is varied using using sinusoidal or triangular modulation.
  18870. The modulation depth defines the range the modulated delay is played before or after
  18871. the delay. Hence the delayed sound will sound slower or faster, that is the delayed
  18872. sound tuned around the original one, like in a chorus where some vocals are slightly
  18873. off key.
  18874. </p>
  18875. <p>It accepts the following parameters:
  18876. </p><dl class="table">
  18877. <dt><samp class="option">in_gain</samp></dt>
  18878. <dd><p>Set input gain. Default is 0.4.
  18879. </p>
  18880. </dd>
  18881. <dt><samp class="option">out_gain</samp></dt>
  18882. <dd><p>Set output gain. Default is 0.4.
  18883. </p>
  18884. </dd>
  18885. <dt><samp class="option">delays</samp></dt>
  18886. <dd><p>Set delays. A typical delay is around 40ms to 60ms.
  18887. </p>
  18888. </dd>
  18889. <dt><samp class="option">decays</samp></dt>
  18890. <dd><p>Set decays.
  18891. </p>
  18892. </dd>
  18893. <dt><samp class="option">speeds</samp></dt>
  18894. <dd><p>Set speeds.
  18895. </p>
  18896. </dd>
  18897. <dt><samp class="option">depths</samp></dt>
  18898. <dd><p>Set depths.
  18899. </p></dd>
  18900. </dl>
  18901. <ul class="mini-toc">
  18902. <li><a href="#Examples-38" accesskey="1">Examples</a></li>
  18903. </ul>
  18904. <div class="subsection-level-extent" id="Examples-38">
  18905. <h4 class="subsection"><span>27.76.1 Examples<a class="copiable-link" href="#Examples-38"> &para;</a></span></h4>
  18906. <ul class="itemize mark-bullet">
  18907. <li>A single delay:
  18908. <div class="example">
  18909. <pre class="example-preformatted">chorus=0.7:0.9:55:0.4:0.25:2
  18910. </pre></div>
  18911. </li><li>Two delays:
  18912. <div class="example">
  18913. <pre class="example-preformatted">chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
  18914. </pre></div>
  18915. </li><li>Fuller sounding chorus with three delays:
  18916. <div class="example">
  18917. <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
  18918. </pre></div>
  18919. </li></ul>
  18920. </div>
  18921. </div>
  18922. <div class="section-level-extent" id="compand">
  18923. <h3 class="section"><span>27.77 compand<a class="copiable-link" href="#compand"> &para;</a></span></h3>
  18924. <p>Compress or expand the audio&rsquo;s dynamic range.
  18925. </p>
  18926. <p>It accepts the following parameters:
  18927. </p>
  18928. <dl class="table">
  18929. <dt><samp class="option">attacks</samp></dt>
  18930. <dt><samp class="option">decays</samp></dt>
  18931. <dd><p>A list of times in seconds for each channel over which the instantaneous level
  18932. of the input signal is averaged to determine its volume. <var class="var">attacks</var> refers to
  18933. increase of volume and <var class="var">decays</var> refers to decrease of volume. For most
  18934. situations, the attack time (response to the audio getting louder) should be
  18935. shorter than the decay time, because the human ear is more sensitive to sudden
  18936. loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
  18937. a typical value for decay is 0.8 seconds.
  18938. If specified number of attacks &amp; decays is lower than number of channels, the last
  18939. set attack/decay will be used for all remaining channels.
  18940. </p>
  18941. </dd>
  18942. <dt><samp class="option">points</samp></dt>
  18943. <dd><p>A list of points for the transfer function, specified in dB relative to the
  18944. maximum possible signal amplitude. Each key points list must be defined using
  18945. the following syntax: <code class="code">x0/y0|x1/y1|x2/y2|....</code> or
  18946. <code class="code">x0/y0 x1/y1 x2/y2 ....</code>
  18947. </p>
  18948. <p>The input values must be in strictly increasing order but the transfer function
  18949. does not have to be monotonically rising. The point <code class="code">0/0</code> is assumed but
  18950. may be overridden (by <code class="code">0/out-dBn</code>). Typical values for the transfer
  18951. function are <code class="code">-70/-70|-60/-20|1/0</code>.
  18952. </p>
  18953. </dd>
  18954. <dt><samp class="option">soft-knee</samp></dt>
  18955. <dd><p>Set the curve radius in dB for all joints. It defaults to 0.01.
  18956. </p>
  18957. </dd>
  18958. <dt><samp class="option">gain</samp></dt>
  18959. <dd><p>Set the additional gain in dB to be applied at all points on the transfer
  18960. function. This allows for easy adjustment of the overall gain.
  18961. It defaults to 0.
  18962. </p>
  18963. </dd>
  18964. <dt><samp class="option">volume</samp></dt>
  18965. <dd><p>Set an initial volume, in dB, to be assumed for each channel when filtering
  18966. starts. This permits the user to supply a nominal level initially, so that, for
  18967. example, a very large gain is not applied to initial signal levels before the
  18968. companding has begun to operate. A typical value for audio which is initially
  18969. quiet is -90 dB. It defaults to 0.
  18970. </p>
  18971. </dd>
  18972. <dt><samp class="option">delay</samp></dt>
  18973. <dd><p>Set a delay, in seconds. The input audio is analyzed immediately, but audio is
  18974. delayed before being fed to the volume adjuster. Specifying a delay
  18975. approximately equal to the attack/decay times allows the filter to effectively
  18976. operate in predictive rather than reactive mode. It defaults to 0.
  18977. </p>
  18978. </dd>
  18979. </dl>
  18980. <ul class="mini-toc">
  18981. <li><a href="#Examples-39" accesskey="1">Examples</a></li>
  18982. </ul>
  18983. <div class="subsection-level-extent" id="Examples-39">
  18984. <h4 class="subsection"><span>27.77.1 Examples<a class="copiable-link" href="#Examples-39"> &para;</a></span></h4>
  18985. <ul class="itemize mark-bullet">
  18986. <li>Make music with both quiet and loud passages suitable for listening to in a
  18987. noisy environment:
  18988. <div class="example">
  18989. <pre class="example-preformatted">compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
  18990. </pre></div>
  18991. <p>Another example for audio with whisper and explosion parts:
  18992. </p><div class="example">
  18993. <pre class="example-preformatted">compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
  18994. </pre></div>
  18995. </li><li>A noise gate for when the noise is at a lower level than the signal:
  18996. <div class="example">
  18997. <pre class="example-preformatted">compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
  18998. </pre></div>
  18999. </li><li>Here is another noise gate, this time for when the noise is at a higher level
  19000. than the signal (making it, in some ways, similar to squelch):
  19001. <div class="example">
  19002. <pre class="example-preformatted">compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
  19003. </pre></div>
  19004. </li><li>2:1 compression starting at -6dB:
  19005. <div class="example">
  19006. <pre class="example-preformatted">compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
  19007. </pre></div>
  19008. </li><li>2:1 compression starting at -9dB:
  19009. <div class="example">
  19010. <pre class="example-preformatted">compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
  19011. </pre></div>
  19012. </li><li>2:1 compression starting at -12dB:
  19013. <div class="example">
  19014. <pre class="example-preformatted">compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
  19015. </pre></div>
  19016. </li><li>2:1 compression starting at -18dB:
  19017. <div class="example">
  19018. <pre class="example-preformatted">compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
  19019. </pre></div>
  19020. </li><li>3:1 compression starting at -15dB:
  19021. <div class="example">
  19022. <pre class="example-preformatted">compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
  19023. </pre></div>
  19024. </li><li>Compressor/Gate:
  19025. <div class="example">
  19026. <pre class="example-preformatted">compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
  19027. </pre></div>
  19028. </li><li>Expander:
  19029. <div class="example">
  19030. <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
  19031. </pre></div>
  19032. </li><li>Hard limiter at -6dB:
  19033. <div class="example">
  19034. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-6/-6|20/-6
  19035. </pre></div>
  19036. </li><li>Hard limiter at -12dB:
  19037. <div class="example">
  19038. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-12/-12|20/-12
  19039. </pre></div>
  19040. </li><li>Hard noise gate at -35 dB:
  19041. <div class="example">
  19042. <pre class="example-preformatted">compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
  19043. </pre></div>
  19044. </li><li>Soft limiter:
  19045. <div class="example">
  19046. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
  19047. </pre></div>
  19048. </li></ul>
  19049. </div>
  19050. </div>
  19051. <div class="section-level-extent" id="compensationdelay">
  19052. <h3 class="section"><span>27.78 compensationdelay<a class="copiable-link" href="#compensationdelay"> &para;</a></span></h3>
  19053. <p>Compensation Delay Line is a metric based delay to compensate differing
  19054. positions of microphones or speakers.
  19055. </p>
  19056. <p>For example, you have recorded guitar with two microphones placed in
  19057. different locations. Because the front of sound wave has fixed speed in
  19058. normal conditions, the phasing of microphones can vary and depends on
  19059. their location and interposition. The best sound mix can be achieved when
  19060. these microphones are in phase (synchronized). Note that a distance of
  19061. ~30 cm between microphones makes one microphone capture the signal in
  19062. antiphase to the other microphone. That makes the final mix sound moody.
  19063. This filter helps to solve phasing problems by adding different delays
  19064. to each microphone track and make them synchronized.
  19065. </p>
  19066. <p>The best result can be reached when you take one track as base and
  19067. synchronize other tracks one by one with it.
  19068. Remember that synchronization/delay tolerance depends on sample rate, too.
  19069. Higher sample rates will give more tolerance.
  19070. </p>
  19071. <p>The filter accepts the following parameters:
  19072. </p>
  19073. <dl class="table">
  19074. <dt><samp class="option">mm</samp></dt>
  19075. <dd><p>Set millimeters distance. This is compensation distance for fine tuning.
  19076. Default is 0.
  19077. </p>
  19078. </dd>
  19079. <dt><samp class="option">cm</samp></dt>
  19080. <dd><p>Set cm distance. This is compensation distance for tightening distance setup.
  19081. Default is 0.
  19082. </p>
  19083. </dd>
  19084. <dt><samp class="option">m</samp></dt>
  19085. <dd><p>Set meters distance. This is compensation distance for hard distance setup.
  19086. Default is 0.
  19087. </p>
  19088. </dd>
  19089. <dt><samp class="option">dry</samp></dt>
  19090. <dd><p>Set dry amount. Amount of unprocessed (dry) signal.
  19091. Default is 0.
  19092. </p>
  19093. </dd>
  19094. <dt><samp class="option">wet</samp></dt>
  19095. <dd><p>Set wet amount. Amount of processed (wet) signal.
  19096. Default is 1.
  19097. </p>
  19098. </dd>
  19099. <dt><samp class="option">temp</samp></dt>
  19100. <dd><p>Set temperature in degrees Celsius. This is the temperature of the environment.
  19101. Default is 20.
  19102. </p></dd>
  19103. </dl>
  19104. <ul class="mini-toc">
  19105. <li><a href="#Commands-33" accesskey="1">Commands</a></li>
  19106. </ul>
  19107. <div class="subsection-level-extent" id="Commands-33">
  19108. <h4 class="subsection"><span>27.78.1 Commands<a class="copiable-link" href="#Commands-33"> &para;</a></span></h4>
  19109. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  19110. </p>
  19111. </div>
  19112. </div>
  19113. <div class="section-level-extent" id="crossfeed">
  19114. <h3 class="section"><span>27.79 crossfeed<a class="copiable-link" href="#crossfeed"> &para;</a></span></h3>
  19115. <p>Apply headphone crossfeed filter.
  19116. </p>
  19117. <p>Crossfeed is the process of blending the left and right channels of stereo
  19118. audio recording.
  19119. It is mainly used to reduce extreme stereo separation of low frequencies.
  19120. </p>
  19121. <p>The intent is to produce more speaker like sound to the listener.
  19122. </p>
  19123. <p>The filter accepts the following options:
  19124. </p>
  19125. <dl class="table">
  19126. <dt><samp class="option">strength</samp></dt>
  19127. <dd><p>Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1.
  19128. This sets gain of low shelf filter for side part of stereo image.
  19129. Default is -6dB. Max allowed is -30db when strength is set to 1.
  19130. </p>
  19131. </dd>
  19132. <dt><samp class="option">range</samp></dt>
  19133. <dd><p>Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1.
  19134. This sets cut off frequency of low shelf filter. Default is cut off near
  19135. 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz.
  19136. </p>
  19137. </dd>
  19138. <dt><samp class="option">slope</samp></dt>
  19139. <dd><p>Set curve slope of low shelf filter. Default is 0.5.
  19140. Allowed range is from 0.01 to 1.
  19141. </p>
  19142. </dd>
  19143. <dt><samp class="option">level_in</samp></dt>
  19144. <dd><p>Set input gain. Default is 0.9.
  19145. </p>
  19146. </dd>
  19147. <dt><samp class="option">level_out</samp></dt>
  19148. <dd><p>Set output gain. Default is 1.
  19149. </p>
  19150. </dd>
  19151. <dt><samp class="option">block_size</samp></dt>
  19152. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  19153. value (higher than impulse response length truncated when reaches near zero values) filtering
  19154. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  19155. </p>
  19156. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  19157. </p></dd>
  19158. </dl>
  19159. <ul class="mini-toc">
  19160. <li><a href="#Commands-34" accesskey="1">Commands</a></li>
  19161. </ul>
  19162. <div class="subsection-level-extent" id="Commands-34">
  19163. <h4 class="subsection"><span>27.79.1 Commands<a class="copiable-link" href="#Commands-34"> &para;</a></span></h4>
  19164. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  19165. </p>
  19166. </div>
  19167. </div>
  19168. <div class="section-level-extent" id="crystalizer">
  19169. <h3 class="section"><span>27.80 crystalizer<a class="copiable-link" href="#crystalizer"> &para;</a></span></h3>
  19170. <p>Simple algorithm for audio noise sharpening.
  19171. </p>
  19172. <p>This filter linearly increases differences between each audio sample.
  19173. </p>
  19174. <p>The filter accepts the following options:
  19175. </p>
  19176. <dl class="table">
  19177. <dt><samp class="option">i</samp></dt>
  19178. <dd><p>Sets the intensity of effect (default: 2.0). Must be in range between -10.0 to 0
  19179. (unchanged sound) to 10.0 (maximum effect).
  19180. To inverse filtering use negative value.
  19181. </p>
  19182. </dd>
  19183. <dt><samp class="option">c</samp></dt>
  19184. <dd><p>Enable clipping. By default is enabled.
  19185. </p></dd>
  19186. </dl>
  19187. <ul class="mini-toc">
  19188. <li><a href="#Commands-35" accesskey="1">Commands</a></li>
  19189. </ul>
  19190. <div class="subsection-level-extent" id="Commands-35">
  19191. <h4 class="subsection"><span>27.80.1 Commands<a class="copiable-link" href="#Commands-35"> &para;</a></span></h4>
  19192. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  19193. </p>
  19194. </div>
  19195. </div>
  19196. <div class="section-level-extent" id="dcshift">
  19197. <h3 class="section"><span>27.81 dcshift<a class="copiable-link" href="#dcshift"> &para;</a></span></h3>
  19198. <p>Apply a DC shift to the audio.
  19199. </p>
  19200. <p>This can be useful to remove a DC offset (caused perhaps by a hardware problem
  19201. in the recording chain) from the audio. The effect of a DC offset is reduced
  19202. headroom and hence volume. The <a class="ref" href="#astats">astats</a> filter can be used to determine if
  19203. a signal has a DC offset.
  19204. </p>
  19205. <dl class="table">
  19206. <dt><samp class="option">shift</samp></dt>
  19207. <dd><p>Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
  19208. the audio.
  19209. </p>
  19210. </dd>
  19211. <dt><samp class="option">limitergain</samp></dt>
  19212. <dd><p>Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
  19213. used to prevent clipping.
  19214. </p></dd>
  19215. </dl>
  19216. </div>
  19217. <div class="section-level-extent" id="deesser">
  19218. <h3 class="section"><span>27.82 deesser<a class="copiable-link" href="#deesser"> &para;</a></span></h3>
  19219. <p>Apply de-essing to the audio samples.
  19220. </p>
  19221. <dl class="table">
  19222. <dt><samp class="option">i</samp></dt>
  19223. <dd><p>Set intensity for triggering de-essing. Allowed range is from 0 to 1.
  19224. Default is 0.
  19225. </p>
  19226. </dd>
  19227. <dt><samp class="option">m</samp></dt>
  19228. <dd><p>Set amount of ducking on treble part of sound. Allowed range is from 0 to 1.
  19229. Default is 0.5.
  19230. </p>
  19231. </dd>
  19232. <dt><samp class="option">f</samp></dt>
  19233. <dd><p>How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1.
  19234. Default is 0.5.
  19235. </p>
  19236. </dd>
  19237. <dt><samp class="option">s</samp></dt>
  19238. <dd><p>Set the output mode.
  19239. </p>
  19240. <p>It accepts the following values:
  19241. </p><dl class="table">
  19242. <dt><samp class="option">i</samp></dt>
  19243. <dd><p>Pass input unchanged.
  19244. </p>
  19245. </dd>
  19246. <dt><samp class="option">o</samp></dt>
  19247. <dd><p>Pass ess filtered out.
  19248. </p>
  19249. </dd>
  19250. <dt><samp class="option">e</samp></dt>
  19251. <dd><p>Pass only ess.
  19252. </p>
  19253. <p>Default value is <var class="var">o</var>.
  19254. </p></dd>
  19255. </dl>
  19256. </dd>
  19257. </dl>
  19258. </div>
  19259. <div class="section-level-extent" id="dialoguenhance">
  19260. <h3 class="section"><span>27.83 dialoguenhance<a class="copiable-link" href="#dialoguenhance"> &para;</a></span></h3>
  19261. <p>Enhance dialogue in stereo audio.
  19262. </p>
  19263. <p>This filter accepts stereo input and produce surround (3.0) channels output.
  19264. The newly produced front center channel have enhanced speech dialogue originally
  19265. available in both stereo channels.
  19266. This filter outputs front left and front right channels same as available in stereo input.
  19267. </p>
  19268. <p>The filter accepts the following options:
  19269. </p>
  19270. <dl class="table">
  19271. <dt><samp class="option">original</samp></dt>
  19272. <dd><p>Set the original center factor to keep in front center channel output.
  19273. Allowed range is from 0 to 1. Default value is 1.
  19274. </p>
  19275. </dd>
  19276. <dt><samp class="option">enhance</samp></dt>
  19277. <dd><p>Set the dialogue enhance factor to put in front center channel output.
  19278. Allowed range is from 0 to 3. Default value is 1.
  19279. </p>
  19280. </dd>
  19281. <dt><samp class="option">voice</samp></dt>
  19282. <dd><p>Set the voice detection factor.
  19283. Allowed range is from 2 to 32. Default value is 2.
  19284. </p></dd>
  19285. </dl>
  19286. <ul class="mini-toc">
  19287. <li><a href="#Commands-36" accesskey="1">Commands</a></li>
  19288. </ul>
  19289. <div class="subsection-level-extent" id="Commands-36">
  19290. <h4 class="subsection"><span>27.83.1 Commands<a class="copiable-link" href="#Commands-36"> &para;</a></span></h4>
  19291. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  19292. </p>
  19293. </div>
  19294. </div>
  19295. <div class="section-level-extent" id="drmeter">
  19296. <h3 class="section"><span>27.84 drmeter<a class="copiable-link" href="#drmeter"> &para;</a></span></h3>
  19297. <p>Measure audio dynamic range.
  19298. </p>
  19299. <p>DR values of 14 and higher is found in very dynamic material. DR of 8 to 13
  19300. is found in transition material. And anything less that 8 have very poor dynamics
  19301. and is very compressed.
  19302. </p>
  19303. <p>The filter accepts the following options:
  19304. </p>
  19305. <dl class="table">
  19306. <dt><samp class="option">length</samp></dt>
  19307. <dd><p>Set window length in seconds used to split audio into segments of equal length.
  19308. Default is 3 seconds.
  19309. </p></dd>
  19310. </dl>
  19311. </div>
  19312. <div class="section-level-extent" id="dynaudnorm">
  19313. <h3 class="section"><span>27.85 dynaudnorm<a class="copiable-link" href="#dynaudnorm"> &para;</a></span></h3>
  19314. <p>Dynamic Audio Normalizer.
  19315. </p>
  19316. <p>This filter applies a certain amount of gain to the input audio in order
  19317. to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
  19318. contrast to more &quot;simple&quot; normalization algorithms, the Dynamic Audio
  19319. Normalizer *dynamically* re-adjusts the gain factor to the input audio.
  19320. This allows for applying extra gain to the &quot;quiet&quot; sections of the audio
  19321. while avoiding distortions or clipping the &quot;loud&quot; sections. In other words:
  19322. The Dynamic Audio Normalizer will &quot;even out&quot; the volume of quiet and loud
  19323. sections, in the sense that the volume of each section is brought to the
  19324. same target level. Note, however, that the Dynamic Audio Normalizer achieves
  19325. this goal *without* applying &quot;dynamic range compressing&quot;. It will retain 100%
  19326. of the dynamic range *within* each section of the audio file.
  19327. </p>
  19328. <dl class="table">
  19329. <dt><samp class="option">framelen, f</samp></dt>
  19330. <dd><p>Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
  19331. Default is 500 milliseconds.
  19332. The Dynamic Audio Normalizer processes the input audio in small chunks,
  19333. referred to as frames. This is required, because a peak magnitude has no
  19334. meaning for just a single sample value. Instead, we need to determine the
  19335. peak magnitude for a contiguous sequence of sample values. While a &quot;standard&quot;
  19336. normalizer would simply use the peak magnitude of the complete file, the
  19337. Dynamic Audio Normalizer determines the peak magnitude individually for each
  19338. frame. The length of a frame is specified in milliseconds. By default, the
  19339. Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
  19340. been found to give good results with most files.
  19341. Note that the exact frame length, in number of samples, will be determined
  19342. automatically, based on the sampling rate of the individual input audio file.
  19343. </p>
  19344. </dd>
  19345. <dt><samp class="option">gausssize, g</samp></dt>
  19346. <dd><p>Set the Gaussian filter window size. In range from 3 to 301, must be odd
  19347. number. Default is 31.
  19348. Probably the most important parameter of the Dynamic Audio Normalizer is the
  19349. <code class="code">window size</code> of the Gaussian smoothing filter. The filter&rsquo;s window size
  19350. is specified in frames, centered around the current frame. For the sake of
  19351. simplicity, this must be an odd number. Consequently, the default value of 31
  19352. takes into account the current frame, as well as the 15 preceding frames and
  19353. the 15 subsequent frames. Using a larger window results in a stronger
  19354. smoothing effect and thus in less gain variation, i.e. slower gain
  19355. adaptation. Conversely, using a smaller window results in a weaker smoothing
  19356. effect and thus in more gain variation, i.e. faster gain adaptation.
  19357. In other words, the more you increase this value, the more the Dynamic Audio
  19358. Normalizer will behave like a &quot;traditional&quot; normalization filter. On the
  19359. contrary, the more you decrease this value, the more the Dynamic Audio
  19360. Normalizer will behave like a dynamic range compressor.
  19361. </p>
  19362. </dd>
  19363. <dt><samp class="option">peak, p</samp></dt>
  19364. <dd><p>Set the target peak value. This specifies the highest permissible magnitude
  19365. level for the normalized audio input. This filter will try to approach the
  19366. target peak magnitude as closely as possible, but at the same time it also
  19367. makes sure that the normalized signal will never exceed the peak magnitude.
  19368. A frame&rsquo;s maximum local gain factor is imposed directly by the target peak
  19369. magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
  19370. It is not recommended to go above this value.
  19371. </p>
  19372. </dd>
  19373. <dt><samp class="option">maxgain, m</samp></dt>
  19374. <dd><p>Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
  19375. The Dynamic Audio Normalizer determines the maximum possible (local) gain
  19376. factor for each input frame, i.e. the maximum gain factor that does not
  19377. result in clipping or distortion. The maximum gain factor is determined by
  19378. the frame&rsquo;s highest magnitude sample. However, the Dynamic Audio Normalizer
  19379. additionally bounds the frame&rsquo;s maximum gain factor by a predetermined
  19380. (global) maximum gain factor. This is done in order to avoid excessive gain
  19381. factors in &quot;silent&quot; or almost silent frames. By default, the maximum gain
  19382. factor is 10.0, For most inputs the default value should be sufficient and
  19383. it usually is not recommended to increase this value. Though, for input
  19384. with an extremely low overall volume level, it may be necessary to allow even
  19385. higher gain factors. Note, however, that the Dynamic Audio Normalizer does
  19386. not simply apply a &quot;hard&quot; threshold (i.e. cut off values above the threshold).
  19387. Instead, a &quot;sigmoid&quot; threshold function will be applied. This way, the
  19388. gain factors will smoothly approach the threshold value, but never exceed that
  19389. value.
  19390. </p>
  19391. </dd>
  19392. <dt><samp class="option">targetrms, r</samp></dt>
  19393. <dd><p>Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
  19394. By default, the Dynamic Audio Normalizer performs &quot;peak&quot; normalization.
  19395. This means that the maximum local gain factor for each frame is defined
  19396. (only) by the frame&rsquo;s highest magnitude sample. This way, the samples can
  19397. be amplified as much as possible without exceeding the maximum signal
  19398. level, i.e. without clipping. Optionally, however, the Dynamic Audio
  19399. Normalizer can also take into account the frame&rsquo;s root mean square,
  19400. abbreviated RMS. In electrical engineering, the RMS is commonly used to
  19401. determine the power of a time-varying signal. It is therefore considered
  19402. that the RMS is a better approximation of the &quot;perceived loudness&quot; than
  19403. just looking at the signal&rsquo;s peak magnitude. Consequently, by adjusting all
  19404. frames to a constant RMS value, a uniform &quot;perceived loudness&quot; can be
  19405. established. If a target RMS value has been specified, a frame&rsquo;s local gain
  19406. factor is defined as the factor that would result in exactly that RMS value.
  19407. Note, however, that the maximum local gain factor is still restricted by the
  19408. frame&rsquo;s highest magnitude sample, in order to prevent clipping.
  19409. </p>
  19410. </dd>
  19411. <dt><samp class="option">coupling, n</samp></dt>
  19412. <dd><p>Enable channels coupling. By default is enabled.
  19413. By default, the Dynamic Audio Normalizer will amplify all channels by the same
  19414. amount. This means the same gain factor will be applied to all channels, i.e.
  19415. the maximum possible gain factor is determined by the &quot;loudest&quot; channel.
  19416. However, in some recordings, it may happen that the volume of the different
  19417. channels is uneven, e.g. one channel may be &quot;quieter&quot; than the other one(s).
  19418. In this case, this option can be used to disable the channel coupling. This way,
  19419. the gain factor will be determined independently for each channel, depending
  19420. only on the individual channel&rsquo;s highest magnitude sample. This allows for
  19421. harmonizing the volume of the different channels.
  19422. </p>
  19423. </dd>
  19424. <dt><samp class="option">correctdc, c</samp></dt>
  19425. <dd><p>Enable DC bias correction. By default is disabled.
  19426. An audio signal (in the time domain) is a sequence of sample values.
  19427. In the Dynamic Audio Normalizer these sample values are represented in the
  19428. -1.0 to 1.0 range, regardless of the original input format. Normally, the
  19429. audio signal, or &quot;waveform&quot;, should be centered around the zero point.
  19430. That means if we calculate the mean value of all samples in a file, or in a
  19431. single frame, then the result should be 0.0 or at least very close to that
  19432. value. If, however, there is a significant deviation of the mean value from
  19433. 0.0, in either positive or negative direction, this is referred to as a
  19434. DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
  19435. Audio Normalizer provides optional DC bias correction.
  19436. With DC bias correction enabled, the Dynamic Audio Normalizer will determine
  19437. the mean value, or &quot;DC correction&quot; offset, of each input frame and subtract
  19438. that value from all of the frame&rsquo;s sample values which ensures those samples
  19439. are centered around 0.0 again. Also, in order to avoid &quot;gaps&quot; at the frame
  19440. boundaries, the DC correction offset values will be interpolated smoothly
  19441. between neighbouring frames.
  19442. </p>
  19443. </dd>
  19444. <dt><samp class="option">altboundary, b</samp></dt>
  19445. <dd><p>Enable alternative boundary mode. By default is disabled.
  19446. The Dynamic Audio Normalizer takes into account a certain neighbourhood
  19447. around each frame. This includes the preceding frames as well as the
  19448. subsequent frames. However, for the &quot;boundary&quot; frames, located at the very
  19449. beginning and at the very end of the audio file, not all neighbouring
  19450. frames are available. In particular, for the first few frames in the audio
  19451. file, the preceding frames are not known. And, similarly, for the last few
  19452. frames in the audio file, the subsequent frames are not known. Thus, the
  19453. question arises which gain factors should be assumed for the missing frames
  19454. in the &quot;boundary&quot; region. The Dynamic Audio Normalizer implements two modes
  19455. to deal with this situation. The default boundary mode assumes a gain factor
  19456. of exactly 1.0 for the missing frames, resulting in a smooth &quot;fade in&quot; and
  19457. &quot;fade out&quot; at the beginning and at the end of the input, respectively.
  19458. </p>
  19459. </dd>
  19460. <dt><samp class="option">compress, s</samp></dt>
  19461. <dd><p>Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
  19462. By default, the Dynamic Audio Normalizer does not apply &quot;traditional&quot;
  19463. compression. This means that signal peaks will not be pruned and thus the
  19464. full dynamic range will be retained within each local neighbourhood. However,
  19465. in some cases it may be desirable to combine the Dynamic Audio Normalizer&rsquo;s
  19466. normalization algorithm with a more &quot;traditional&quot; compression.
  19467. For this purpose, the Dynamic Audio Normalizer provides an optional compression
  19468. (thresholding) function. If (and only if) the compression feature is enabled,
  19469. all input frames will be processed by a soft knee thresholding function prior
  19470. to the actual normalization process. Put simply, the thresholding function is
  19471. going to prune all samples whose magnitude exceeds a certain threshold value.
  19472. However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
  19473. value. Instead, the threshold value will be adjusted for each individual
  19474. frame.
  19475. In general, smaller parameters result in stronger compression, and vice versa.
  19476. Values below 3.0 are not recommended, because audible distortion may appear.
  19477. </p>
  19478. </dd>
  19479. <dt><samp class="option">threshold, t</samp></dt>
  19480. <dd><p>Set the target threshold value. This specifies the lowest permissible
  19481. magnitude level for the audio input which will be normalized.
  19482. If input frame volume is above this value frame will be normalized.
  19483. Otherwise frame may not be normalized at all. The default value is set
  19484. to 0, which means all input frames will be normalized.
  19485. This option is mostly useful if digital noise is not wanted to be amplified.
  19486. </p>
  19487. </dd>
  19488. <dt><samp class="option">channels, h</samp></dt>
  19489. <dd><p>Specify which channels to filter, by default all available channels are filtered.
  19490. </p>
  19491. </dd>
  19492. <dt><samp class="option">overlap, o</samp></dt>
  19493. <dd><p>Specify overlap for frames. If set to 0 (default) no frame overlapping is done.
  19494. Using &gt;0 and &lt;1 values will make less conservative gain adjustments, like
  19495. when framelen option is set to smaller value, if framelen option value is
  19496. compensated for non-zero overlap then gain adjustments will be smoother across time
  19497. compared to zero overlap case.
  19498. </p>
  19499. </dd>
  19500. <dt><samp class="option">curve, v</samp></dt>
  19501. <dd><p>Specify the peak mapping curve expression which is going to be used when calculating
  19502. gain applied to frames. The max output frame gain will still be limited by other
  19503. options mentioned previously for this filter.
  19504. </p>
  19505. <p>The expression can contain the following constants:
  19506. </p>
  19507. <dl class="table">
  19508. <dt><samp class="option">ch</samp></dt>
  19509. <dd><p>current channel number
  19510. </p>
  19511. </dd>
  19512. <dt><samp class="option">sn</samp></dt>
  19513. <dd><p>current sample number
  19514. </p>
  19515. </dd>
  19516. <dt><samp class="option">nb_channels</samp></dt>
  19517. <dd><p>number of channels
  19518. </p>
  19519. </dd>
  19520. <dt><samp class="option">t</samp></dt>
  19521. <dd><p>timestamp expressed in seconds
  19522. </p>
  19523. </dd>
  19524. <dt><samp class="option">sr</samp></dt>
  19525. <dd><p>sample rate
  19526. </p>
  19527. </dd>
  19528. <dt><samp class="option">p</samp></dt>
  19529. <dd><p>current frame peak value
  19530. </p></dd>
  19531. </dl>
  19532. </dd>
  19533. </dl>
  19534. <ul class="mini-toc">
  19535. <li><a href="#Commands-37" accesskey="1">Commands</a></li>
  19536. </ul>
  19537. <div class="subsection-level-extent" id="Commands-37">
  19538. <h4 class="subsection"><span>27.85.1 Commands<a class="copiable-link" href="#Commands-37"> &para;</a></span></h4>
  19539. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  19540. </p>
  19541. </div>
  19542. </div>
  19543. <div class="section-level-extent" id="earwax">
  19544. <h3 class="section"><span>27.86 earwax<a class="copiable-link" href="#earwax"> &para;</a></span></h3>
  19545. <p>Make audio easier to listen to on headphones.
  19546. </p>
  19547. <p>This filter adds &lsquo;cues&rsquo; to 44.1kHz stereo (i.e. audio CD format) audio
  19548. so that when listened to on headphones the stereo image is moved from
  19549. inside your head (standard for headphones) to outside and in front of
  19550. the listener (standard for speakers).
  19551. </p>
  19552. <p>Ported from SoX.
  19553. </p>
  19554. </div>
  19555. <div class="section-level-extent" id="equalizer">
  19556. <h3 class="section"><span>27.87 equalizer<a class="copiable-link" href="#equalizer"> &para;</a></span></h3>
  19557. <p>Apply a two-pole peaking equalisation (EQ) filter. With this
  19558. filter, the signal-level at and around a selected frequency can
  19559. be increased or decreased, whilst (unlike bandpass and bandreject
  19560. filters) that at all other frequencies is unchanged.
  19561. </p>
  19562. <p>In order to produce complex equalisation curves, this filter can
  19563. be given several times, each with a different central frequency.
  19564. </p>
  19565. <p>The filter accepts the following options:
  19566. </p>
  19567. <dl class="table">
  19568. <dt><samp class="option">frequency, f</samp></dt>
  19569. <dd><p>Set the filter&rsquo;s central frequency in Hz.
  19570. </p>
  19571. </dd>
  19572. <dt><samp class="option">width_type, t</samp></dt>
  19573. <dd><p>Set method to specify band-width of filter.
  19574. </p><dl class="table">
  19575. <dt><samp class="option">h</samp></dt>
  19576. <dd><p>Hz
  19577. </p></dd>
  19578. <dt><samp class="option">q</samp></dt>
  19579. <dd><p>Q-Factor
  19580. </p></dd>
  19581. <dt><samp class="option">o</samp></dt>
  19582. <dd><p>octave
  19583. </p></dd>
  19584. <dt><samp class="option">s</samp></dt>
  19585. <dd><p>slope
  19586. </p></dd>
  19587. <dt><samp class="option">k</samp></dt>
  19588. <dd><p>kHz
  19589. </p></dd>
  19590. </dl>
  19591. </dd>
  19592. <dt><samp class="option">width, w</samp></dt>
  19593. <dd><p>Specify the band-width of a filter in width_type units.
  19594. </p>
  19595. </dd>
  19596. <dt><samp class="option">gain, g</samp></dt>
  19597. <dd><p>Set the required gain or attenuation in dB.
  19598. Beware of clipping when using a positive gain.
  19599. </p>
  19600. </dd>
  19601. <dt><samp class="option">mix, m</samp></dt>
  19602. <dd><p>How much to use filtered signal in output. Default is 1.
  19603. Range is between 0 and 1.
  19604. </p>
  19605. </dd>
  19606. <dt><samp class="option">channels, c</samp></dt>
  19607. <dd><p>Specify which channels to filter, by default all available are filtered.
  19608. </p>
  19609. </dd>
  19610. <dt><samp class="option">normalize, n</samp></dt>
  19611. <dd><p>Normalize biquad coefficients, by default is disabled.
  19612. Enabling it will normalize magnitude response at DC to 0dB.
  19613. </p>
  19614. </dd>
  19615. <dt><samp class="option">transform, a</samp></dt>
  19616. <dd><p>Set transform type of IIR filter.
  19617. </p><dl class="table">
  19618. <dt><samp class="option">di</samp></dt>
  19619. <dt><samp class="option">dii</samp></dt>
  19620. <dt><samp class="option">tdi</samp></dt>
  19621. <dt><samp class="option">tdii</samp></dt>
  19622. <dt><samp class="option">latt</samp></dt>
  19623. <dt><samp class="option">svf</samp></dt>
  19624. <dt><samp class="option">zdf</samp></dt>
  19625. </dl>
  19626. </dd>
  19627. <dt><samp class="option">precision, r</samp></dt>
  19628. <dd><p>Set precision of filtering.
  19629. </p><dl class="table">
  19630. <dt><samp class="option">auto</samp></dt>
  19631. <dd><p>Pick automatic sample format depending on surround filters.
  19632. </p></dd>
  19633. <dt><samp class="option">s16</samp></dt>
  19634. <dd><p>Always use signed 16-bit.
  19635. </p></dd>
  19636. <dt><samp class="option">s32</samp></dt>
  19637. <dd><p>Always use signed 32-bit.
  19638. </p></dd>
  19639. <dt><samp class="option">f32</samp></dt>
  19640. <dd><p>Always use float 32-bit.
  19641. </p></dd>
  19642. <dt><samp class="option">f64</samp></dt>
  19643. <dd><p>Always use float 64-bit.
  19644. </p></dd>
  19645. </dl>
  19646. </dd>
  19647. <dt><samp class="option">block_size, b</samp></dt>
  19648. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  19649. value (higher than impulse response length truncated when reaches near zero values) filtering
  19650. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  19651. </p>
  19652. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  19653. </p></dd>
  19654. </dl>
  19655. <ul class="mini-toc">
  19656. <li><a href="#Examples-40" accesskey="1">Examples</a></li>
  19657. <li><a href="#Commands-38" accesskey="2">Commands</a></li>
  19658. </ul>
  19659. <div class="subsection-level-extent" id="Examples-40">
  19660. <h4 class="subsection"><span>27.87.1 Examples<a class="copiable-link" href="#Examples-40"> &para;</a></span></h4>
  19661. <ul class="itemize mark-bullet">
  19662. <li>Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
  19663. <div class="example">
  19664. <pre class="example-preformatted">equalizer=f=1000:t=h:width=200:g=-10
  19665. </pre></div>
  19666. </li><li>Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
  19667. <div class="example">
  19668. <pre class="example-preformatted">equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
  19669. </pre></div>
  19670. </li></ul>
  19671. </div>
  19672. <div class="subsection-level-extent" id="Commands-38">
  19673. <h4 class="subsection"><span>27.87.2 Commands<a class="copiable-link" href="#Commands-38"> &para;</a></span></h4>
  19674. <p>This filter supports the following commands:
  19675. </p><dl class="table">
  19676. <dt><samp class="option">frequency, f</samp></dt>
  19677. <dd><p>Change equalizer frequency.
  19678. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  19679. </p>
  19680. </dd>
  19681. <dt><samp class="option">width_type, t</samp></dt>
  19682. <dd><p>Change equalizer width_type.
  19683. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  19684. </p>
  19685. </dd>
  19686. <dt><samp class="option">width, w</samp></dt>
  19687. <dd><p>Change equalizer width.
  19688. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  19689. </p>
  19690. </dd>
  19691. <dt><samp class="option">gain, g</samp></dt>
  19692. <dd><p>Change equalizer gain.
  19693. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  19694. </p>
  19695. </dd>
  19696. <dt><samp class="option">mix, m</samp></dt>
  19697. <dd><p>Change equalizer mix.
  19698. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  19699. </p></dd>
  19700. </dl>
  19701. </div>
  19702. </div>
  19703. <div class="section-level-extent" id="extrastereo">
  19704. <h3 class="section"><span>27.88 extrastereo<a class="copiable-link" href="#extrastereo"> &para;</a></span></h3>
  19705. <p>Linearly increases the difference between left and right channels which
  19706. adds some sort of &quot;live&quot; effect to playback.
  19707. </p>
  19708. <p>The filter accepts the following options:
  19709. </p>
  19710. <dl class="table">
  19711. <dt><samp class="option">m</samp></dt>
  19712. <dd><p>Sets the difference coefficient (default: 2.5). 0.0 means mono sound
  19713. (average of both channels), with 1.0 sound will be unchanged, with
  19714. -1.0 left and right channels will be swapped.
  19715. </p>
  19716. </dd>
  19717. <dt><samp class="option">c</samp></dt>
  19718. <dd><p>Enable clipping. By default is enabled.
  19719. </p></dd>
  19720. </dl>
  19721. <ul class="mini-toc">
  19722. <li><a href="#Commands-39" accesskey="1">Commands</a></li>
  19723. </ul>
  19724. <div class="subsection-level-extent" id="Commands-39">
  19725. <h4 class="subsection"><span>27.88.1 Commands<a class="copiable-link" href="#Commands-39"> &para;</a></span></h4>
  19726. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  19727. </p>
  19728. </div>
  19729. </div>
  19730. <div class="section-level-extent" id="firequalizer">
  19731. <h3 class="section"><span>27.89 firequalizer<a class="copiable-link" href="#firequalizer"> &para;</a></span></h3>
  19732. <p>Apply FIR Equalization using arbitrary frequency response.
  19733. </p>
  19734. <p>The filter accepts the following option:
  19735. </p>
  19736. <dl class="table">
  19737. <dt><samp class="option">gain</samp></dt>
  19738. <dd><p>Set gain curve equation (in dB). The expression can contain variables:
  19739. </p><dl class="table">
  19740. <dt><samp class="option">f</samp></dt>
  19741. <dd><p>the evaluated frequency
  19742. </p></dd>
  19743. <dt><samp class="option">sr</samp></dt>
  19744. <dd><p>sample rate
  19745. </p></dd>
  19746. <dt><samp class="option">ch</samp></dt>
  19747. <dd><p>channel number, set to 0 when multichannels evaluation is disabled
  19748. </p></dd>
  19749. <dt><samp class="option">chid</samp></dt>
  19750. <dd><p>channel id, see libavutil/channel_layout.h, set to the first channel id when
  19751. multichannels evaluation is disabled
  19752. </p></dd>
  19753. <dt><samp class="option">chs</samp></dt>
  19754. <dd><p>number of channels
  19755. </p></dd>
  19756. <dt><samp class="option">chlayout</samp></dt>
  19757. <dd><p>channel_layout, see libavutil/channel_layout.h
  19758. </p>
  19759. </dd>
  19760. </dl>
  19761. <p>and functions:
  19762. </p><dl class="table">
  19763. <dt><samp class="option">gain_interpolate(f)</samp></dt>
  19764. <dd><p>interpolate gain on frequency f based on gain_entry
  19765. </p></dd>
  19766. <dt><samp class="option">cubic_interpolate(f)</samp></dt>
  19767. <dd><p>same as gain_interpolate, but smoother
  19768. </p></dd>
  19769. </dl>
  19770. <p>This option is also available as command. Default is <code class="code">gain_interpolate(f)</code>.
  19771. </p>
  19772. </dd>
  19773. <dt><samp class="option">gain_entry</samp></dt>
  19774. <dd><p>Set gain entry for gain_interpolate function. The expression can
  19775. contain functions:
  19776. </p><dl class="table">
  19777. <dt><samp class="option">entry(f, g)</samp></dt>
  19778. <dd><p>store gain entry at frequency f with value g
  19779. </p></dd>
  19780. </dl>
  19781. <p>This option is also available as command.
  19782. </p>
  19783. </dd>
  19784. <dt><samp class="option">delay</samp></dt>
  19785. <dd><p>Set filter delay in seconds. Higher value means more accurate.
  19786. Default is <code class="code">0.01</code>.
  19787. </p>
  19788. </dd>
  19789. <dt><samp class="option">accuracy</samp></dt>
  19790. <dd><p>Set filter accuracy in Hz. Lower value means more accurate.
  19791. Default is <code class="code">5</code>.
  19792. </p>
  19793. </dd>
  19794. <dt><samp class="option">wfunc</samp></dt>
  19795. <dd><p>Set window function. Acceptable values are:
  19796. </p><dl class="table">
  19797. <dt><samp class="option">rectangular</samp></dt>
  19798. <dd><p>rectangular window, useful when gain curve is already smooth
  19799. </p></dd>
  19800. <dt><samp class="option">hann</samp></dt>
  19801. <dd><p>hann window (default)
  19802. </p></dd>
  19803. <dt><samp class="option">hamming</samp></dt>
  19804. <dd><p>hamming window
  19805. </p></dd>
  19806. <dt><samp class="option">blackman</samp></dt>
  19807. <dd><p>blackman window
  19808. </p></dd>
  19809. <dt><samp class="option">nuttall3</samp></dt>
  19810. <dd><p>3-terms continuous 1st derivative nuttall window
  19811. </p></dd>
  19812. <dt><samp class="option">mnuttall3</samp></dt>
  19813. <dd><p>minimum 3-terms discontinuous nuttall window
  19814. </p></dd>
  19815. <dt><samp class="option">nuttall</samp></dt>
  19816. <dd><p>4-terms continuous 1st derivative nuttall window
  19817. </p></dd>
  19818. <dt><samp class="option">bnuttall</samp></dt>
  19819. <dd><p>minimum 4-terms discontinuous nuttall (blackman-nuttall) window
  19820. </p></dd>
  19821. <dt><samp class="option">bharris</samp></dt>
  19822. <dd><p>blackman-harris window
  19823. </p></dd>
  19824. <dt><samp class="option">tukey</samp></dt>
  19825. <dd><p>tukey window
  19826. </p></dd>
  19827. </dl>
  19828. </dd>
  19829. <dt><samp class="option">fixed</samp></dt>
  19830. <dd><p>If enabled, use fixed number of audio samples. This improves speed when
  19831. filtering with large delay. Default is disabled.
  19832. </p>
  19833. </dd>
  19834. <dt><samp class="option">multi</samp></dt>
  19835. <dd><p>Enable multichannels evaluation on gain. Default is disabled.
  19836. </p>
  19837. </dd>
  19838. <dt><samp class="option">zero_phase</samp></dt>
  19839. <dd><p>Enable zero phase mode by subtracting timestamp to compensate delay.
  19840. Default is disabled.
  19841. </p>
  19842. </dd>
  19843. <dt><samp class="option">scale</samp></dt>
  19844. <dd><p>Set scale used by gain. Acceptable values are:
  19845. </p><dl class="table">
  19846. <dt><samp class="option">linlin</samp></dt>
  19847. <dd><p>linear frequency, linear gain
  19848. </p></dd>
  19849. <dt><samp class="option">linlog</samp></dt>
  19850. <dd><p>linear frequency, logarithmic (in dB) gain (default)
  19851. </p></dd>
  19852. <dt><samp class="option">loglin</samp></dt>
  19853. <dd><p>logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
  19854. </p></dd>
  19855. <dt><samp class="option">loglog</samp></dt>
  19856. <dd><p>logarithmic frequency, logarithmic gain
  19857. </p></dd>
  19858. </dl>
  19859. </dd>
  19860. <dt><samp class="option">dumpfile</samp></dt>
  19861. <dd><p>Set file for dumping, suitable for gnuplot.
  19862. </p>
  19863. </dd>
  19864. <dt><samp class="option">dumpscale</samp></dt>
  19865. <dd><p>Set scale for dumpfile. Acceptable values are same with scale option.
  19866. Default is linlog.
  19867. </p>
  19868. </dd>
  19869. <dt><samp class="option">fft2</samp></dt>
  19870. <dd><p>Enable 2-channel convolution using complex FFT. This improves speed significantly.
  19871. Default is disabled.
  19872. </p>
  19873. </dd>
  19874. <dt><samp class="option">min_phase</samp></dt>
  19875. <dd><p>Enable minimum phase impulse response. Default is disabled.
  19876. </p></dd>
  19877. </dl>
  19878. <ul class="mini-toc">
  19879. <li><a href="#Examples-41" accesskey="1">Examples</a></li>
  19880. </ul>
  19881. <div class="subsection-level-extent" id="Examples-41">
  19882. <h4 class="subsection"><span>27.89.1 Examples<a class="copiable-link" href="#Examples-41"> &para;</a></span></h4>
  19883. <ul class="itemize mark-bullet">
  19884. <li>lowpass at 1000 Hz:
  19885. <div class="example">
  19886. <pre class="example-preformatted">firequalizer=gain='if(lt(f,1000), 0, -INF)'
  19887. </pre></div>
  19888. </li><li>lowpass at 1000 Hz with gain_entry:
  19889. <div class="example">
  19890. <pre class="example-preformatted">firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
  19891. </pre></div>
  19892. </li><li>custom equalization:
  19893. <div class="example">
  19894. <pre class="example-preformatted">firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
  19895. </pre></div>
  19896. </li><li>higher delay with zero phase to compensate delay:
  19897. <div class="example">
  19898. <pre class="example-preformatted">firequalizer=delay=0.1:fixed=on:zero_phase=on
  19899. </pre></div>
  19900. </li><li>lowpass on left channel, highpass on right channel:
  19901. <div class="example">
  19902. <pre class="example-preformatted">firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
  19903. :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
  19904. </pre></div>
  19905. </li></ul>
  19906. </div>
  19907. </div>
  19908. <div class="section-level-extent" id="flanger">
  19909. <h3 class="section"><span>27.90 flanger<a class="copiable-link" href="#flanger"> &para;</a></span></h3>
  19910. <p>Apply a flanging effect to the audio.
  19911. </p>
  19912. <p>The filter accepts the following options:
  19913. </p>
  19914. <dl class="table">
  19915. <dt><samp class="option">delay</samp></dt>
  19916. <dd><p>Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
  19917. </p>
  19918. </dd>
  19919. <dt><samp class="option">depth</samp></dt>
  19920. <dd><p>Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2.
  19921. </p>
  19922. </dd>
  19923. <dt><samp class="option">regen</samp></dt>
  19924. <dd><p>Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
  19925. Default value is 0.
  19926. </p>
  19927. </dd>
  19928. <dt><samp class="option">width</samp></dt>
  19929. <dd><p>Set percentage of delayed signal mixed with original. Range from 0 to 100.
  19930. Default value is 71.
  19931. </p>
  19932. </dd>
  19933. <dt><samp class="option">speed</samp></dt>
  19934. <dd><p>Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
  19935. </p>
  19936. </dd>
  19937. <dt><samp class="option">shape</samp></dt>
  19938. <dd><p>Set swept wave shape, can be <var class="var">triangular</var> or <var class="var">sinusoidal</var>.
  19939. Default value is <var class="var">sinusoidal</var>.
  19940. </p>
  19941. </dd>
  19942. <dt><samp class="option">phase</samp></dt>
  19943. <dd><p>Set swept wave percentage-shift for multi channel. Range from 0 to 100.
  19944. Default value is 25.
  19945. </p>
  19946. </dd>
  19947. <dt><samp class="option">interp</samp></dt>
  19948. <dd><p>Set delay-line interpolation, <var class="var">linear</var> or <var class="var">quadratic</var>.
  19949. Default is <var class="var">linear</var>.
  19950. </p></dd>
  19951. </dl>
  19952. </div>
  19953. <div class="section-level-extent" id="haas">
  19954. <h3 class="section"><span>27.91 haas<a class="copiable-link" href="#haas"> &para;</a></span></h3>
  19955. <p>Apply Haas effect to audio.
  19956. </p>
  19957. <p>Note that this makes most sense to apply on mono signals.
  19958. With this filter applied to mono signals it give some directionality and
  19959. stretches its stereo image.
  19960. </p>
  19961. <p>The filter accepts the following options:
  19962. </p>
  19963. <dl class="table">
  19964. <dt><samp class="option">level_in</samp></dt>
  19965. <dd><p>Set input level. By default is <var class="var">1</var>, or 0dB
  19966. </p>
  19967. </dd>
  19968. <dt><samp class="option">level_out</samp></dt>
  19969. <dd><p>Set output level. By default is <var class="var">1</var>, or 0dB.
  19970. </p>
  19971. </dd>
  19972. <dt><samp class="option">side_gain</samp></dt>
  19973. <dd><p>Set gain applied to side part of signal. By default is <var class="var">1</var>.
  19974. </p>
  19975. </dd>
  19976. <dt><samp class="option">middle_source</samp></dt>
  19977. <dd><p>Set kind of middle source. Can be one of the following:
  19978. </p>
  19979. <dl class="table">
  19980. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  19981. <dd><p>Pick left channel.
  19982. </p>
  19983. </dd>
  19984. <dt>&lsquo;<samp class="samp">right</samp>&rsquo;</dt>
  19985. <dd><p>Pick right channel.
  19986. </p>
  19987. </dd>
  19988. <dt>&lsquo;<samp class="samp">mid</samp>&rsquo;</dt>
  19989. <dd><p>Pick middle part signal of stereo image.
  19990. </p>
  19991. </dd>
  19992. <dt>&lsquo;<samp class="samp">side</samp>&rsquo;</dt>
  19993. <dd><p>Pick side part signal of stereo image.
  19994. </p></dd>
  19995. </dl>
  19996. </dd>
  19997. <dt><samp class="option">middle_phase</samp></dt>
  19998. <dd><p>Change middle phase. By default is disabled.
  19999. </p>
  20000. </dd>
  20001. <dt><samp class="option">left_delay</samp></dt>
  20002. <dd><p>Set left channel delay. By default is <var class="var">2.05</var> milliseconds.
  20003. </p>
  20004. </dd>
  20005. <dt><samp class="option">left_balance</samp></dt>
  20006. <dd><p>Set left channel balance. By default is <var class="var">-1</var>.
  20007. </p>
  20008. </dd>
  20009. <dt><samp class="option">left_gain</samp></dt>
  20010. <dd><p>Set left channel gain. By default is <var class="var">1</var>.
  20011. </p>
  20012. </dd>
  20013. <dt><samp class="option">left_phase</samp></dt>
  20014. <dd><p>Change left phase. By default is disabled.
  20015. </p>
  20016. </dd>
  20017. <dt><samp class="option">right_delay</samp></dt>
  20018. <dd><p>Set right channel delay. By defaults is <var class="var">2.12</var> milliseconds.
  20019. </p>
  20020. </dd>
  20021. <dt><samp class="option">right_balance</samp></dt>
  20022. <dd><p>Set right channel balance. By default is <var class="var">1</var>.
  20023. </p>
  20024. </dd>
  20025. <dt><samp class="option">right_gain</samp></dt>
  20026. <dd><p>Set right channel gain. By default is <var class="var">1</var>.
  20027. </p>
  20028. </dd>
  20029. <dt><samp class="option">right_phase</samp></dt>
  20030. <dd><p>Change right phase. By default is enabled.
  20031. </p></dd>
  20032. </dl>
  20033. </div>
  20034. <div class="section-level-extent" id="hdcd">
  20035. <h3 class="section"><span>27.92 hdcd<a class="copiable-link" href="#hdcd"> &para;</a></span></h3>
  20036. <p>Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with
  20037. embedded HDCD codes is expanded into a 20-bit PCM stream.
  20038. </p>
  20039. <p>The filter supports the Peak Extend and Low-level Gain Adjustment features
  20040. of HDCD, and detects the Transient Filter flag.
  20041. </p>
  20042. <div class="example">
  20043. <pre class="example-preformatted">ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
  20044. </pre></div>
  20045. <p>When using the filter with wav, note the default encoding for wav is 16-bit,
  20046. so the resulting 20-bit stream will be truncated back to 16-bit. Use something
  20047. like <code class="command">-acodec pcm_s24le</code> after the filter to get 24-bit PCM output.
  20048. </p><div class="example">
  20049. <pre class="example-preformatted">ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
  20050. ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
  20051. </pre></div>
  20052. <p>The filter accepts the following options:
  20053. </p>
  20054. <dl class="table">
  20055. <dt><samp class="option">disable_autoconvert</samp></dt>
  20056. <dd><p>Disable any automatic format conversion or resampling in the filter graph.
  20057. </p>
  20058. </dd>
  20059. <dt><samp class="option">process_stereo</samp></dt>
  20060. <dd><p>Process the stereo channels together. If target_gain does not match between
  20061. channels, consider it invalid and use the last valid target_gain.
  20062. </p>
  20063. </dd>
  20064. <dt><samp class="option">cdt_ms</samp></dt>
  20065. <dd><p>Set the code detect timer period in ms.
  20066. </p>
  20067. </dd>
  20068. <dt><samp class="option">force_pe</samp></dt>
  20069. <dd><p>Always extend peaks above -3dBFS even if PE isn&rsquo;t signaled.
  20070. </p>
  20071. </dd>
  20072. <dt><samp class="option">analyze_mode</samp></dt>
  20073. <dd><p>Replace audio with a solid tone and adjust the amplitude to signal some
  20074. specific aspect of the decoding process. The output file can be loaded in
  20075. an audio editor alongside the original to aid analysis.
  20076. </p>
  20077. <p><code class="code">analyze_mode=pe:force_pe=true</code> can be used to see all samples above the PE level.
  20078. </p>
  20079. <p>Modes are:
  20080. </p><dl class="table">
  20081. <dt>&lsquo;<samp class="samp">0, off</samp>&rsquo;</dt>
  20082. <dd><p>Disabled
  20083. </p></dd>
  20084. <dt>&lsquo;<samp class="samp">1, lle</samp>&rsquo;</dt>
  20085. <dd><p>Gain adjustment level at each sample
  20086. </p></dd>
  20087. <dt>&lsquo;<samp class="samp">2, pe</samp>&rsquo;</dt>
  20088. <dd><p>Samples where peak extend occurs
  20089. </p></dd>
  20090. <dt>&lsquo;<samp class="samp">3, cdt</samp>&rsquo;</dt>
  20091. <dd><p>Samples where the code detect timer is active
  20092. </p></dd>
  20093. <dt>&lsquo;<samp class="samp">4, tgm</samp>&rsquo;</dt>
  20094. <dd><p>Samples where the target gain does not match between channels
  20095. </p></dd>
  20096. </dl>
  20097. </dd>
  20098. </dl>
  20099. </div>
  20100. <div class="section-level-extent" id="headphone">
  20101. <h3 class="section"><span>27.93 headphone<a class="copiable-link" href="#headphone"> &para;</a></span></h3>
  20102. <p>Apply head-related transfer functions (HRTFs) to create virtual
  20103. loudspeakers around the user for binaural listening via headphones.
  20104. The HRIRs are provided via additional streams, for each channel
  20105. one stereo input stream is needed.
  20106. </p>
  20107. <p>The filter accepts the following options:
  20108. </p>
  20109. <dl class="table">
  20110. <dt><samp class="option">map</samp></dt>
  20111. <dd><p>Set mapping of input streams for convolution.
  20112. The argument is a &rsquo;|&rsquo;-separated list of channel names in order as they
  20113. are given as additional stream inputs for filter.
  20114. This also specify number of input streams. Number of input streams
  20115. must be not less than number of channels in first stream plus one.
  20116. </p>
  20117. </dd>
  20118. <dt><samp class="option">gain</samp></dt>
  20119. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  20120. </p>
  20121. </dd>
  20122. <dt><samp class="option">type</samp></dt>
  20123. <dd><p>Set processing type. Can be <var class="var">time</var> or <var class="var">freq</var>. <var class="var">time</var> is
  20124. processing audio in time domain which is slow.
  20125. <var class="var">freq</var> is processing audio in frequency domain which is fast.
  20126. Default is <var class="var">freq</var>.
  20127. </p>
  20128. </dd>
  20129. <dt><samp class="option">lfe</samp></dt>
  20130. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  20131. </p>
  20132. </dd>
  20133. <dt><samp class="option">size</samp></dt>
  20134. <dd><p>Set size of frame in number of samples which will be processed at once.
  20135. Default value is <var class="var">1024</var>. Allowed range is from 1024 to 96000.
  20136. </p>
  20137. </dd>
  20138. <dt><samp class="option">hrir</samp></dt>
  20139. <dd><p>Set format of hrir stream.
  20140. Default value is <var class="var">stereo</var>. Alternative value is <var class="var">multich</var>.
  20141. If value is set to <var class="var">stereo</var>, number of additional streams should
  20142. be greater or equal to number of input channels in first input stream.
  20143. Also each additional stream should have stereo number of channels.
  20144. If value is set to <var class="var">multich</var>, number of additional streams should
  20145. be exactly one. Also number of input channels of additional stream
  20146. should be equal or greater than twice number of channels of first input
  20147. stream.
  20148. </p></dd>
  20149. </dl>
  20150. <ul class="mini-toc">
  20151. <li><a href="#Examples-42" accesskey="1">Examples</a></li>
  20152. </ul>
  20153. <div class="subsection-level-extent" id="Examples-42">
  20154. <h4 class="subsection"><span>27.93.1 Examples<a class="copiable-link" href="#Examples-42"> &para;</a></span></h4>
  20155. <ul class="itemize mark-bullet">
  20156. <li>Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  20157. each amovie filter use stereo file with IR coefficients as input.
  20158. The files give coefficients for each position of virtual loudspeaker:
  20159. <div class="example">
  20160. <pre class="example-preformatted">ffmpeg -i input.wav
  20161. -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;
  20162. output.wav
  20163. </pre></div>
  20164. </li><li>Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  20165. but now in <var class="var">multich</var> <var class="var">hrir</var> format.
  20166. <div class="example">
  20167. <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;
  20168. output.wav
  20169. </pre></div>
  20170. </li></ul>
  20171. </div>
  20172. </div>
  20173. <div class="section-level-extent" id="highpass">
  20174. <h3 class="section"><span>27.94 highpass<a class="copiable-link" href="#highpass"> &para;</a></span></h3>
  20175. <p>Apply a high-pass filter with 3dB point frequency.
  20176. The filter can be either single-pole, or double-pole (the default).
  20177. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  20178. </p>
  20179. <p>The filter accepts the following options:
  20180. </p>
  20181. <dl class="table">
  20182. <dt><samp class="option">frequency, f</samp></dt>
  20183. <dd><p>Set frequency in Hz. Default is 3000.
  20184. </p>
  20185. </dd>
  20186. <dt><samp class="option">poles, p</samp></dt>
  20187. <dd><p>Set number of poles. Default is 2.
  20188. </p>
  20189. </dd>
  20190. <dt><samp class="option">width_type, t</samp></dt>
  20191. <dd><p>Set method to specify band-width of filter.
  20192. </p><dl class="table">
  20193. <dt><samp class="option">h</samp></dt>
  20194. <dd><p>Hz
  20195. </p></dd>
  20196. <dt><samp class="option">q</samp></dt>
  20197. <dd><p>Q-Factor
  20198. </p></dd>
  20199. <dt><samp class="option">o</samp></dt>
  20200. <dd><p>octave
  20201. </p></dd>
  20202. <dt><samp class="option">s</samp></dt>
  20203. <dd><p>slope
  20204. </p></dd>
  20205. <dt><samp class="option">k</samp></dt>
  20206. <dd><p>kHz
  20207. </p></dd>
  20208. </dl>
  20209. </dd>
  20210. <dt><samp class="option">width, w</samp></dt>
  20211. <dd><p>Specify the band-width of a filter in width_type units.
  20212. Applies only to double-pole filter.
  20213. The default is 0.707q and gives a Butterworth response.
  20214. </p>
  20215. </dd>
  20216. <dt><samp class="option">mix, m</samp></dt>
  20217. <dd><p>How much to use filtered signal in output. Default is 1.
  20218. Range is between 0 and 1.
  20219. </p>
  20220. </dd>
  20221. <dt><samp class="option">channels, c</samp></dt>
  20222. <dd><p>Specify which channels to filter, by default all available are filtered.
  20223. </p>
  20224. </dd>
  20225. <dt><samp class="option">normalize, n</samp></dt>
  20226. <dd><p>Normalize biquad coefficients, by default is disabled.
  20227. Enabling it will normalize magnitude response at DC to 0dB.
  20228. </p>
  20229. </dd>
  20230. <dt><samp class="option">transform, a</samp></dt>
  20231. <dd><p>Set transform type of IIR filter.
  20232. </p><dl class="table">
  20233. <dt><samp class="option">di</samp></dt>
  20234. <dt><samp class="option">dii</samp></dt>
  20235. <dt><samp class="option">tdi</samp></dt>
  20236. <dt><samp class="option">tdii</samp></dt>
  20237. <dt><samp class="option">latt</samp></dt>
  20238. <dt><samp class="option">svf</samp></dt>
  20239. <dt><samp class="option">zdf</samp></dt>
  20240. </dl>
  20241. </dd>
  20242. <dt><samp class="option">precision, r</samp></dt>
  20243. <dd><p>Set precision of filtering.
  20244. </p><dl class="table">
  20245. <dt><samp class="option">auto</samp></dt>
  20246. <dd><p>Pick automatic sample format depending on surround filters.
  20247. </p></dd>
  20248. <dt><samp class="option">s16</samp></dt>
  20249. <dd><p>Always use signed 16-bit.
  20250. </p></dd>
  20251. <dt><samp class="option">s32</samp></dt>
  20252. <dd><p>Always use signed 32-bit.
  20253. </p></dd>
  20254. <dt><samp class="option">f32</samp></dt>
  20255. <dd><p>Always use float 32-bit.
  20256. </p></dd>
  20257. <dt><samp class="option">f64</samp></dt>
  20258. <dd><p>Always use float 64-bit.
  20259. </p></dd>
  20260. </dl>
  20261. </dd>
  20262. <dt><samp class="option">block_size, b</samp></dt>
  20263. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  20264. value (higher than impulse response length truncated when reaches near zero values) filtering
  20265. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  20266. </p>
  20267. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  20268. </p></dd>
  20269. </dl>
  20270. <ul class="mini-toc">
  20271. <li><a href="#Commands-40" accesskey="1">Commands</a></li>
  20272. </ul>
  20273. <div class="subsection-level-extent" id="Commands-40">
  20274. <h4 class="subsection"><span>27.94.1 Commands<a class="copiable-link" href="#Commands-40"> &para;</a></span></h4>
  20275. <p>This filter supports the following commands:
  20276. </p><dl class="table">
  20277. <dt><samp class="option">frequency, f</samp></dt>
  20278. <dd><p>Change highpass frequency.
  20279. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  20280. </p>
  20281. </dd>
  20282. <dt><samp class="option">width_type, t</samp></dt>
  20283. <dd><p>Change highpass width_type.
  20284. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  20285. </p>
  20286. </dd>
  20287. <dt><samp class="option">width, w</samp></dt>
  20288. <dd><p>Change highpass width.
  20289. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  20290. </p>
  20291. </dd>
  20292. <dt><samp class="option">mix, m</samp></dt>
  20293. <dd><p>Change highpass mix.
  20294. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  20295. </p></dd>
  20296. </dl>
  20297. </div>
  20298. </div>
  20299. <div class="section-level-extent" id="join">
  20300. <h3 class="section"><span>27.95 join<a class="copiable-link" href="#join"> &para;</a></span></h3>
  20301. <p>Join multiple input streams into one multi-channel stream.
  20302. </p>
  20303. <p>It accepts the following parameters:
  20304. </p><dl class="table">
  20305. <dt><samp class="option">inputs</samp></dt>
  20306. <dd><p>The number of input streams. It defaults to 2.
  20307. </p>
  20308. </dd>
  20309. <dt><samp class="option">channel_layout</samp></dt>
  20310. <dd><p>The desired output channel layout. It defaults to stereo.
  20311. </p>
  20312. </dd>
  20313. <dt><samp class="option">map</samp></dt>
  20314. <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-separated list of
  20315. 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>
  20316. form. <var class="var">input_idx</var> is the 0-based index of the input stream. <var class="var">in_channel</var>
  20317. can be either the name of the input channel (e.g. FL for front left) or its
  20318. index in the specified input stream. <var class="var">out_channel</var> is the name of the output
  20319. channel.
  20320. </p></dd>
  20321. </dl>
  20322. <p>The filter will attempt to guess the mappings when they are not specified
  20323. explicitly. It does so by first trying to find an unused matching input channel
  20324. and if that fails it picks the first unused input channel.
  20325. </p>
  20326. <p>Join 3 inputs (with properly set channel layouts):
  20327. </p><div class="example">
  20328. <pre class="example-preformatted">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
  20329. </pre></div>
  20330. <p>Build a 5.1 output from 6 single-channel streams:
  20331. </p><div class="example">
  20332. <pre class="example-preformatted">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
  20333. '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'
  20334. out
  20335. </pre></div>
  20336. </div>
  20337. <div class="section-level-extent" id="ladspa">
  20338. <h3 class="section"><span>27.96 ladspa<a class="copiable-link" href="#ladspa"> &para;</a></span></h3>
  20339. <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
  20340. </p>
  20341. <p>To enable compilation of this filter you need to configure FFmpeg with
  20342. <code class="code">--enable-ladspa</code>.
  20343. </p>
  20344. <dl class="table">
  20345. <dt><samp class="option">file, f</samp></dt>
  20346. <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
  20347. variable <code class="env">LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
  20348. each one of the directories specified by the colon separated list in
  20349. <code class="env">LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
  20350. this order: <samp class="file">HOME/.ladspa/lib/</samp>, <samp class="file">/usr/local/lib/ladspa/</samp>,
  20351. <samp class="file">/usr/lib/ladspa/</samp>.
  20352. </p>
  20353. </dd>
  20354. <dt><samp class="option">plugin, p</samp></dt>
  20355. <dd><p>Specifies the plugin within the library. Some libraries contain only
  20356. one plugin, but others contain many of them. If this is not set filter
  20357. will list all available plugins within the specified library.
  20358. </p>
  20359. </dd>
  20360. <dt><samp class="option">controls, c</samp></dt>
  20361. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  20362. values that determine the behavior of the loaded plugin (for example delay,
  20363. threshold or gain).
  20364. Controls need to be defined using the following syntax:
  20365. c0=<var class="var">value0</var>|c1=<var class="var">value1</var>|c2=<var class="var">value2</var>|..., where
  20366. <var class="var">valuei</var> is the value set on the <var class="var">i</var>-th control.
  20367. Alternatively they can be also defined using the following syntax:
  20368. <var class="var">value0</var>|<var class="var">value1</var>|<var class="var">value2</var>|..., where
  20369. <var class="var">valuei</var> is the value set on the <var class="var">i</var>-th control.
  20370. If <samp class="option">controls</samp> is set to <code class="code">help</code>, all available controls and
  20371. their valid ranges are printed.
  20372. </p>
  20373. </dd>
  20374. <dt><samp class="option">sample_rate, s</samp></dt>
  20375. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  20376. zero inputs.
  20377. </p>
  20378. </dd>
  20379. <dt><samp class="option">nb_samples, n</samp></dt>
  20380. <dd><p>Set the number of samples per channel per each output frame, default
  20381. is 1024. Only used if plugin have zero inputs.
  20382. </p>
  20383. </dd>
  20384. <dt><samp class="option">duration, d</samp></dt>
  20385. <dd><p>Set the minimum duration of the sourced audio. See
  20386. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  20387. for the accepted syntax.
  20388. Note that the resulting duration may be greater than the specified duration,
  20389. as the generated audio is always cut at the end of a complete frame.
  20390. If not specified, or the expressed duration is negative, the audio is
  20391. supposed to be generated forever.
  20392. Only used if plugin have zero inputs.
  20393. </p>
  20394. </dd>
  20395. <dt><samp class="option">latency, l</samp></dt>
  20396. <dd><p>Enable latency compensation, by default is disabled.
  20397. Only used if plugin have inputs.
  20398. </p></dd>
  20399. </dl>
  20400. <ul class="mini-toc">
  20401. <li><a href="#Examples-43" accesskey="1">Examples</a></li>
  20402. <li><a href="#Commands-41" accesskey="2">Commands</a></li>
  20403. </ul>
  20404. <div class="subsection-level-extent" id="Examples-43">
  20405. <h4 class="subsection"><span>27.96.1 Examples<a class="copiable-link" href="#Examples-43"> &para;</a></span></h4>
  20406. <ul class="itemize mark-bullet">
  20407. <li>List all available plugins within amp (LADSPA example plugin) library:
  20408. <div class="example">
  20409. <pre class="example-preformatted">ladspa=file=amp
  20410. </pre></div>
  20411. </li><li>List all available controls and their valid ranges for <code class="code">vcf_notch</code>
  20412. plugin from <code class="code">VCF</code> library:
  20413. <div class="example">
  20414. <pre class="example-preformatted">ladspa=f=vcf:p=vcf_notch:c=help
  20415. </pre></div>
  20416. </li><li>Simulate low quality audio equipment using <code class="code">Computer Music Toolkit</code> (CMT)
  20417. plugin library:
  20418. <div class="example">
  20419. <pre class="example-preformatted">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
  20420. </pre></div>
  20421. </li><li>Add reverberation to the audio using TAP-plugins
  20422. (Tom&rsquo;s Audio Processing plugins):
  20423. <div class="example">
  20424. <pre class="example-preformatted">ladspa=file=tap_reverb:tap_reverb
  20425. </pre></div>
  20426. </li><li>Generate white noise, with 0.2 amplitude:
  20427. <div class="example">
  20428. <pre class="example-preformatted">ladspa=file=cmt:noise_source_white:c=c0=.2
  20429. </pre></div>
  20430. </li><li>Generate 20 bpm clicks using plugin <code class="code">C* Click - Metronome</code> from the
  20431. <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  20432. <div class="example">
  20433. <pre class="example-preformatted">ladspa=file=caps:Click:c=c1=20'
  20434. </pre></div>
  20435. </li><li>Apply <code class="code">C* Eq10X2 - Stereo 10-band equaliser</code> effect:
  20436. <div class="example">
  20437. <pre class="example-preformatted">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
  20438. </pre></div>
  20439. </li><li>Increase volume by 20dB using fast lookahead limiter from Steve Harris
  20440. <code class="code">SWH Plugins</code> collection:
  20441. <div class="example">
  20442. <pre class="example-preformatted">ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
  20443. </pre></div>
  20444. </li><li>Attenuate low frequencies using Multiband EQ from Steve Harris
  20445. <code class="code">SWH Plugins</code> collection:
  20446. <div class="example">
  20447. <pre class="example-preformatted">ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
  20448. </pre></div>
  20449. </li><li>Reduce stereo image using <code class="code">Narrower</code> from the <code class="code">C* Audio Plugin Suite</code>
  20450. (CAPS) library:
  20451. <div class="example">
  20452. <pre class="example-preformatted">ladspa=caps:Narrower
  20453. </pre></div>
  20454. </li><li>Another white noise, now using <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  20455. <div class="example">
  20456. <pre class="example-preformatted">ladspa=caps:White:.2
  20457. </pre></div>
  20458. </li><li>Some fractal noise, using <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  20459. <div class="example">
  20460. <pre class="example-preformatted">ladspa=caps:Fractal:c=c1=1
  20461. </pre></div>
  20462. </li><li>Dynamic volume normalization using <code class="code">VLevel</code> plugin:
  20463. <div class="example">
  20464. <pre class="example-preformatted">ladspa=vlevel-ladspa:vlevel_mono
  20465. </pre></div>
  20466. </li></ul>
  20467. </div>
  20468. <div class="subsection-level-extent" id="Commands-41">
  20469. <h4 class="subsection"><span>27.96.2 Commands<a class="copiable-link" href="#Commands-41"> &para;</a></span></h4>
  20470. <p>This filter supports the following commands:
  20471. </p><dl class="table">
  20472. <dt><samp class="option">cN</samp></dt>
  20473. <dd><p>Modify the <var class="var">N</var>-th control value.
  20474. </p>
  20475. <p>If the specified value is not valid, it is ignored and prior one is kept.
  20476. </p></dd>
  20477. </dl>
  20478. </div>
  20479. </div>
  20480. <div class="section-level-extent" id="loudnorm">
  20481. <h3 class="section"><span>27.97 loudnorm<a class="copiable-link" href="#loudnorm"> &para;</a></span></h3>
  20482. <p>EBU R128 loudness normalization. Includes both dynamic and linear normalization modes.
  20483. Support for both single pass (livestreams, files) and double pass (files) modes.
  20484. This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately
  20485. detect true peaks, the audio stream will be upsampled to 192 kHz.
  20486. Use the <code class="code">-ar</code> option or <code class="code">aresample</code> filter to explicitly set an output sample rate.
  20487. </p>
  20488. <p>The filter accepts the following options:
  20489. </p>
  20490. <dl class="table">
  20491. <dt><samp class="option">I, i</samp></dt>
  20492. <dd><p>Set integrated loudness target.
  20493. Range is -70.0 - -5.0. Default value is -24.0.
  20494. </p>
  20495. </dd>
  20496. <dt><samp class="option">LRA, lra</samp></dt>
  20497. <dd><p>Set loudness range target.
  20498. Range is 1.0 - 50.0. Default value is 7.0.
  20499. </p>
  20500. </dd>
  20501. <dt><samp class="option">TP, tp</samp></dt>
  20502. <dd><p>Set maximum true peak.
  20503. Range is -9.0 - +0.0. Default value is -2.0.
  20504. </p>
  20505. </dd>
  20506. <dt><samp class="option">measured_I, measured_i</samp></dt>
  20507. <dd><p>Measured IL of input file.
  20508. Range is -99.0 - +0.0.
  20509. </p>
  20510. </dd>
  20511. <dt><samp class="option">measured_LRA, measured_lra</samp></dt>
  20512. <dd><p>Measured LRA of input file.
  20513. Range is 0.0 - 99.0.
  20514. </p>
  20515. </dd>
  20516. <dt><samp class="option">measured_TP, measured_tp</samp></dt>
  20517. <dd><p>Measured true peak of input file.
  20518. Range is -99.0 - +99.0.
  20519. </p>
  20520. </dd>
  20521. <dt><samp class="option">measured_thresh</samp></dt>
  20522. <dd><p>Measured threshold of input file.
  20523. Range is -99.0 - +0.0.
  20524. </p>
  20525. </dd>
  20526. <dt><samp class="option">offset</samp></dt>
  20527. <dd><p>Set offset gain. Gain is applied before the true-peak limiter.
  20528. Range is -99.0 - +99.0. Default is +0.0.
  20529. </p>
  20530. </dd>
  20531. <dt><samp class="option">linear</samp></dt>
  20532. <dd><p>Normalize by linearly scaling the source audio.
  20533. <code class="code">measured_I</code>, <code class="code">measured_LRA</code>, <code class="code">measured_TP</code>,
  20534. and <code class="code">measured_thresh</code> must all be specified. Target LRA shouldn&rsquo;t
  20535. be lower than source LRA and the change in integrated loudness shouldn&rsquo;t
  20536. result in a true peak which exceeds the target TP. If any of these
  20537. conditions aren&rsquo;t met, normalization mode will revert to <var class="var">dynamic</var>.
  20538. Options are <code class="code">true</code> or <code class="code">false</code>. Default is <code class="code">true</code>.
  20539. </p>
  20540. </dd>
  20541. <dt><samp class="option">dual_mono</samp></dt>
  20542. <dd><p>Treat mono input files as &quot;dual-mono&quot;. If a mono file is intended for playback
  20543. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  20544. If set to <code class="code">true</code>, this option will compensate for this effect.
  20545. Multi-channel input files are not affected by this option.
  20546. Options are true or false. Default is false.
  20547. </p>
  20548. </dd>
  20549. <dt><samp class="option">print_format</samp></dt>
  20550. <dd><p>Set print format for stats. Options are summary, json, or none.
  20551. Default value is none.
  20552. </p></dd>
  20553. </dl>
  20554. </div>
  20555. <div class="section-level-extent" id="lowpass">
  20556. <h3 class="section"><span>27.98 lowpass<a class="copiable-link" href="#lowpass"> &para;</a></span></h3>
  20557. <p>Apply a low-pass filter with 3dB point frequency.
  20558. The filter can be either single-pole or double-pole (the default).
  20559. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  20560. </p>
  20561. <p>The filter accepts the following options:
  20562. </p>
  20563. <dl class="table">
  20564. <dt><samp class="option">frequency, f</samp></dt>
  20565. <dd><p>Set frequency in Hz. Default is 500.
  20566. </p>
  20567. </dd>
  20568. <dt><samp class="option">poles, p</samp></dt>
  20569. <dd><p>Set number of poles. Default is 2.
  20570. </p>
  20571. </dd>
  20572. <dt><samp class="option">width_type, t</samp></dt>
  20573. <dd><p>Set method to specify band-width of filter.
  20574. </p><dl class="table">
  20575. <dt><samp class="option">h</samp></dt>
  20576. <dd><p>Hz
  20577. </p></dd>
  20578. <dt><samp class="option">q</samp></dt>
  20579. <dd><p>Q-Factor
  20580. </p></dd>
  20581. <dt><samp class="option">o</samp></dt>
  20582. <dd><p>octave
  20583. </p></dd>
  20584. <dt><samp class="option">s</samp></dt>
  20585. <dd><p>slope
  20586. </p></dd>
  20587. <dt><samp class="option">k</samp></dt>
  20588. <dd><p>kHz
  20589. </p></dd>
  20590. </dl>
  20591. </dd>
  20592. <dt><samp class="option">width, w</samp></dt>
  20593. <dd><p>Specify the band-width of a filter in width_type units.
  20594. Applies only to double-pole filter.
  20595. The default is 0.707q and gives a Butterworth response.
  20596. </p>
  20597. </dd>
  20598. <dt><samp class="option">mix, m</samp></dt>
  20599. <dd><p>How much to use filtered signal in output. Default is 1.
  20600. Range is between 0 and 1.
  20601. </p>
  20602. </dd>
  20603. <dt><samp class="option">channels, c</samp></dt>
  20604. <dd><p>Specify which channels to filter, by default all available are filtered.
  20605. </p>
  20606. </dd>
  20607. <dt><samp class="option">normalize, n</samp></dt>
  20608. <dd><p>Normalize biquad coefficients, by default is disabled.
  20609. Enabling it will normalize magnitude response at DC to 0dB.
  20610. </p>
  20611. </dd>
  20612. <dt><samp class="option">transform, a</samp></dt>
  20613. <dd><p>Set transform type of IIR filter.
  20614. </p><dl class="table">
  20615. <dt><samp class="option">di</samp></dt>
  20616. <dt><samp class="option">dii</samp></dt>
  20617. <dt><samp class="option">tdi</samp></dt>
  20618. <dt><samp class="option">tdii</samp></dt>
  20619. <dt><samp class="option">latt</samp></dt>
  20620. <dt><samp class="option">svf</samp></dt>
  20621. <dt><samp class="option">zdf</samp></dt>
  20622. </dl>
  20623. </dd>
  20624. <dt><samp class="option">precision, r</samp></dt>
  20625. <dd><p>Set precision of filtering.
  20626. </p><dl class="table">
  20627. <dt><samp class="option">auto</samp></dt>
  20628. <dd><p>Pick automatic sample format depending on surround filters.
  20629. </p></dd>
  20630. <dt><samp class="option">s16</samp></dt>
  20631. <dd><p>Always use signed 16-bit.
  20632. </p></dd>
  20633. <dt><samp class="option">s32</samp></dt>
  20634. <dd><p>Always use signed 32-bit.
  20635. </p></dd>
  20636. <dt><samp class="option">f32</samp></dt>
  20637. <dd><p>Always use float 32-bit.
  20638. </p></dd>
  20639. <dt><samp class="option">f64</samp></dt>
  20640. <dd><p>Always use float 64-bit.
  20641. </p></dd>
  20642. </dl>
  20643. </dd>
  20644. <dt><samp class="option">block_size, b</samp></dt>
  20645. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  20646. value (higher than impulse response length truncated when reaches near zero values) filtering
  20647. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  20648. </p>
  20649. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  20650. </p></dd>
  20651. </dl>
  20652. <ul class="mini-toc">
  20653. <li><a href="#Examples-44" accesskey="1">Examples</a></li>
  20654. <li><a href="#Commands-42" accesskey="2">Commands</a></li>
  20655. </ul>
  20656. <div class="subsection-level-extent" id="Examples-44">
  20657. <h4 class="subsection"><span>27.98.1 Examples<a class="copiable-link" href="#Examples-44"> &para;</a></span></h4>
  20658. <ul class="itemize mark-bullet">
  20659. <li>Lowpass only LFE channel, it LFE is not present it does nothing:
  20660. <div class="example">
  20661. <pre class="example-preformatted">lowpass=c=LFE
  20662. </pre></div>
  20663. </li></ul>
  20664. </div>
  20665. <div class="subsection-level-extent" id="Commands-42">
  20666. <h4 class="subsection"><span>27.98.2 Commands<a class="copiable-link" href="#Commands-42"> &para;</a></span></h4>
  20667. <p>This filter supports the following commands:
  20668. </p><dl class="table">
  20669. <dt><samp class="option">frequency, f</samp></dt>
  20670. <dd><p>Change lowpass frequency.
  20671. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  20672. </p>
  20673. </dd>
  20674. <dt><samp class="option">width_type, t</samp></dt>
  20675. <dd><p>Change lowpass width_type.
  20676. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  20677. </p>
  20678. </dd>
  20679. <dt><samp class="option">width, w</samp></dt>
  20680. <dd><p>Change lowpass width.
  20681. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  20682. </p>
  20683. </dd>
  20684. <dt><samp class="option">mix, m</samp></dt>
  20685. <dd><p>Change lowpass mix.
  20686. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  20687. </p></dd>
  20688. </dl>
  20689. </div>
  20690. </div>
  20691. <div class="section-level-extent" id="lv2">
  20692. <h3 class="section"><span>27.99 lv2<a class="copiable-link" href="#lv2"> &para;</a></span></h3>
  20693. <p>Load a LV2 (LADSPA Version 2) plugin.
  20694. </p>
  20695. <p>To enable compilation of this filter you need to configure FFmpeg with
  20696. <code class="code">--enable-lv2</code>.
  20697. </p>
  20698. <dl class="table">
  20699. <dt><samp class="option">plugin, p</samp></dt>
  20700. <dd><p>Specifies the plugin URI. You may need to escape &rsquo;:&rsquo;.
  20701. </p>
  20702. </dd>
  20703. <dt><samp class="option">controls, c</samp></dt>
  20704. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  20705. values that determine the behavior of the loaded plugin (for example delay,
  20706. threshold or gain).
  20707. If <samp class="option">controls</samp> is set to <code class="code">help</code>, all available controls and
  20708. their valid ranges are printed.
  20709. </p>
  20710. </dd>
  20711. <dt><samp class="option">sample_rate, s</samp></dt>
  20712. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  20713. zero inputs.
  20714. </p>
  20715. </dd>
  20716. <dt><samp class="option">nb_samples, n</samp></dt>
  20717. <dd><p>Set the number of samples per channel per each output frame, default
  20718. is 1024. Only used if plugin have zero inputs.
  20719. </p>
  20720. </dd>
  20721. <dt><samp class="option">duration, d</samp></dt>
  20722. <dd><p>Set the minimum duration of the sourced audio. See
  20723. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  20724. for the accepted syntax.
  20725. Note that the resulting duration may be greater than the specified duration,
  20726. as the generated audio is always cut at the end of a complete frame.
  20727. If not specified, or the expressed duration is negative, the audio is
  20728. supposed to be generated forever.
  20729. Only used if plugin have zero inputs.
  20730. </p></dd>
  20731. </dl>
  20732. <ul class="mini-toc">
  20733. <li><a href="#Examples-45" accesskey="1">Examples</a></li>
  20734. <li><a href="#Commands-43" accesskey="2">Commands</a></li>
  20735. </ul>
  20736. <div class="subsection-level-extent" id="Examples-45">
  20737. <h4 class="subsection"><span>27.99.1 Examples<a class="copiable-link" href="#Examples-45"> &para;</a></span></h4>
  20738. <ul class="itemize mark-bullet">
  20739. <li>Apply bass enhancer plugin from Calf:
  20740. <div class="example">
  20741. <pre class="example-preformatted">lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
  20742. </pre></div>
  20743. </li><li>Apply vinyl plugin from Calf:
  20744. <div class="example">
  20745. <pre class="example-preformatted">lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
  20746. </pre></div>
  20747. </li><li>Apply bit crusher plugin from ArtyFX:
  20748. <div class="example">
  20749. <pre class="example-preformatted">lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
  20750. </pre></div>
  20751. </li></ul>
  20752. </div>
  20753. <div class="subsection-level-extent" id="Commands-43">
  20754. <h4 class="subsection"><span>27.99.2 Commands<a class="copiable-link" href="#Commands-43"> &para;</a></span></h4>
  20755. <p>This filter supports all options that are exported by plugin as commands.
  20756. </p>
  20757. </div>
  20758. </div>
  20759. <div class="section-level-extent" id="mcompand">
  20760. <h3 class="section"><span>27.100 mcompand<a class="copiable-link" href="#mcompand"> &para;</a></span></h3>
  20761. <p>Multiband Compress or expand the audio&rsquo;s dynamic range.
  20762. </p>
  20763. <p>The input audio is divided into bands using 4th order Linkwitz-Riley IIRs.
  20764. This is akin to the crossover of a loudspeaker, and results in flat frequency
  20765. response when absent compander action.
  20766. </p>
  20767. <p>It accepts the following parameters:
  20768. </p>
  20769. <dl class="table">
  20770. <dt><samp class="option">args</samp></dt>
  20771. <dd><p>This option syntax is:
  20772. attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ...
  20773. For explanation of each item refer to compand filter documentation.
  20774. </p></dd>
  20775. </dl>
  20776. <a class="anchor" id="pan"></a></div>
  20777. <div class="section-level-extent" id="pan-1">
  20778. <h3 class="section"><span>27.101 pan<a class="copiable-link" href="#pan-1"> &para;</a></span></h3>
  20779. <p>Mix channels with specific gain levels. The filter accepts the output
  20780. channel layout followed by a set of channels definitions.
  20781. </p>
  20782. <p>This filter is also designed to efficiently remap the channels of an audio
  20783. stream.
  20784. </p>
  20785. <p>The filter accepts parameters of the form:
  20786. &quot;<var class="var">l</var>|<var class="var">outdef</var>|<var class="var">outdef</var>|...&quot;
  20787. </p>
  20788. <dl class="table">
  20789. <dt><samp class="option">l</samp></dt>
  20790. <dd><p>output channel layout or number of channels
  20791. </p>
  20792. </dd>
  20793. <dt><samp class="option">outdef</samp></dt>
  20794. <dd><p>output channel specification, of the form:
  20795. &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;
  20796. </p>
  20797. </dd>
  20798. <dt><samp class="option">out_name</samp></dt>
  20799. <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
  20800. number (c0, c1, etc.)
  20801. </p>
  20802. </dd>
  20803. <dt><samp class="option">gain</samp></dt>
  20804. <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
  20805. </p>
  20806. </dd>
  20807. <dt><samp class="option">in_name</samp></dt>
  20808. <dd><p>input channel to use, see out_name for details; it is not possible to mix
  20809. named and numbered input channels
  20810. </p></dd>
  20811. </dl>
  20812. <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
  20813. that specification will be renormalized so that the total is 1, thus
  20814. avoiding clipping noise.
  20815. </p>
  20816. <ul class="mini-toc">
  20817. <li><a href="#Mixing-examples" accesskey="1">Mixing examples</a></li>
  20818. <li><a href="#Remapping-examples" accesskey="2">Remapping examples</a></li>
  20819. </ul>
  20820. <div class="subsection-level-extent" id="Mixing-examples">
  20821. <h4 class="subsection"><span>27.101.1 Mixing examples<a class="copiable-link" href="#Mixing-examples"> &para;</a></span></h4>
  20822. <p>For example, if you want to down-mix from stereo to mono, but with a bigger
  20823. factor for the left channel:
  20824. </p><div class="example">
  20825. <pre class="example-preformatted">pan=1c|c0=0.9*c0+0.1*c1
  20826. </pre></div>
  20827. <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
  20828. 7-channels surround:
  20829. </p><div class="example">
  20830. <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
  20831. </pre></div>
  20832. <p>Note that <code class="command">ffmpeg</code> integrates a default down-mix (and up-mix) system
  20833. that should be preferred (see &quot;-ac&quot; option) unless you have very specific
  20834. needs.
  20835. </p>
  20836. </div>
  20837. <div class="subsection-level-extent" id="Remapping-examples">
  20838. <h4 class="subsection"><span>27.101.2 Remapping examples<a class="copiable-link" href="#Remapping-examples"> &para;</a></span></h4>
  20839. <p>The channel remapping will be effective if, and only if:
  20840. </p>
  20841. <ul class="itemize mark-bullet">
  20842. <li>gain coefficients are zeroes or ones,
  20843. </li><li>only one input per channel output,
  20844. </li></ul>
  20845. <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
  20846. channel mapping detected&quot;), and use an optimized and lossless method to do the
  20847. remapping.
  20848. </p>
  20849. <p>For example, if you have a 5.1 source and want a stereo audio stream by
  20850. dropping the extra channels:
  20851. </p><div class="example">
  20852. <pre class="example-preformatted">pan=&quot;stereo| c0=FL | c1=FR&quot;
  20853. </pre></div>
  20854. <p>Given the same source, you can also switch front left and front right channels
  20855. and keep the input channel layout:
  20856. </p><div class="example">
  20857. <pre class="example-preformatted">pan=&quot;5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5&quot;
  20858. </pre></div>
  20859. <p>If the input is a stereo audio stream, you can mute the front left channel (and
  20860. still keep the stereo channel layout) with:
  20861. </p><div class="example">
  20862. <pre class="example-preformatted">pan=&quot;stereo|c1=c1&quot;
  20863. </pre></div>
  20864. <p>Still with a stereo audio stream input, you can copy the right channel in both
  20865. front left and right:
  20866. </p><div class="example">
  20867. <pre class="example-preformatted">pan=&quot;stereo| c0=FR | c1=FR&quot;
  20868. </pre></div>
  20869. </div>
  20870. </div>
  20871. <div class="section-level-extent" id="replaygain">
  20872. <h3 class="section"><span>27.102 replaygain<a class="copiable-link" href="#replaygain"> &para;</a></span></h3>
  20873. <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
  20874. outputs it unchanged.
  20875. At end of filtering it displays <code class="code">track_gain</code> and <code class="code">track_peak</code>.
  20876. </p>
  20877. <p>The filter accepts the following exported read-only options:
  20878. </p>
  20879. <dl class="table">
  20880. <dt><samp class="option">track_gain</samp></dt>
  20881. <dd><p>Exported track gain in dB at end of stream.
  20882. </p>
  20883. </dd>
  20884. <dt><samp class="option">track_peak</samp></dt>
  20885. <dd><p>Exported track peak at end of stream.
  20886. </p></dd>
  20887. </dl>
  20888. </div>
  20889. <div class="section-level-extent" id="resample">
  20890. <h3 class="section"><span>27.103 resample<a class="copiable-link" href="#resample"> &para;</a></span></h3>
  20891. <p>Convert the audio sample format, sample rate and channel layout. It is
  20892. not meant to be used directly.
  20893. </p>
  20894. </div>
  20895. <div class="section-level-extent" id="rubberband">
  20896. <h3 class="section"><span>27.104 rubberband<a class="copiable-link" href="#rubberband"> &para;</a></span></h3>
  20897. <p>Apply time-stretching and pitch-shifting with librubberband.
  20898. </p>
  20899. <p>To enable compilation of this filter, you need to configure FFmpeg with
  20900. <code class="code">--enable-librubberband</code>.
  20901. </p>
  20902. <p>The filter accepts the following options:
  20903. </p>
  20904. <dl class="table">
  20905. <dt><samp class="option">tempo</samp></dt>
  20906. <dd><p>Set tempo scale factor.
  20907. </p>
  20908. </dd>
  20909. <dt><samp class="option">pitch</samp></dt>
  20910. <dd><p>Set pitch scale factor.
  20911. </p>
  20912. </dd>
  20913. <dt><samp class="option">transients</samp></dt>
  20914. <dd><p>Set transients detector.
  20915. Possible values are:
  20916. </p><dl class="table">
  20917. <dt><var class="var">crisp</var></dt>
  20918. <dt><var class="var">mixed</var></dt>
  20919. <dt><var class="var">smooth</var></dt>
  20920. </dl>
  20921. </dd>
  20922. <dt><samp class="option">detector</samp></dt>
  20923. <dd><p>Set detector.
  20924. Possible values are:
  20925. </p><dl class="table">
  20926. <dt><var class="var">compound</var></dt>
  20927. <dt><var class="var">percussive</var></dt>
  20928. <dt><var class="var">soft</var></dt>
  20929. </dl>
  20930. </dd>
  20931. <dt><samp class="option">phase</samp></dt>
  20932. <dd><p>Set phase.
  20933. Possible values are:
  20934. </p><dl class="table">
  20935. <dt><var class="var">laminar</var></dt>
  20936. <dt><var class="var">independent</var></dt>
  20937. </dl>
  20938. </dd>
  20939. <dt><samp class="option">window</samp></dt>
  20940. <dd><p>Set processing window size.
  20941. Possible values are:
  20942. </p><dl class="table">
  20943. <dt><var class="var">standard</var></dt>
  20944. <dt><var class="var">short</var></dt>
  20945. <dt><var class="var">long</var></dt>
  20946. </dl>
  20947. </dd>
  20948. <dt><samp class="option">smoothing</samp></dt>
  20949. <dd><p>Set smoothing.
  20950. Possible values are:
  20951. </p><dl class="table">
  20952. <dt><var class="var">off</var></dt>
  20953. <dt><var class="var">on</var></dt>
  20954. </dl>
  20955. </dd>
  20956. <dt><samp class="option">formant</samp></dt>
  20957. <dd><p>Enable formant preservation when shift pitching.
  20958. Possible values are:
  20959. </p><dl class="table">
  20960. <dt><var class="var">shifted</var></dt>
  20961. <dt><var class="var">preserved</var></dt>
  20962. </dl>
  20963. </dd>
  20964. <dt><samp class="option">pitchq</samp></dt>
  20965. <dd><p>Set pitch quality.
  20966. Possible values are:
  20967. </p><dl class="table">
  20968. <dt><var class="var">quality</var></dt>
  20969. <dt><var class="var">speed</var></dt>
  20970. <dt><var class="var">consistency</var></dt>
  20971. </dl>
  20972. </dd>
  20973. <dt><samp class="option">channels</samp></dt>
  20974. <dd><p>Set channels.
  20975. Possible values are:
  20976. </p><dl class="table">
  20977. <dt><var class="var">apart</var></dt>
  20978. <dt><var class="var">together</var></dt>
  20979. </dl>
  20980. </dd>
  20981. </dl>
  20982. <ul class="mini-toc">
  20983. <li><a href="#Commands-44" accesskey="1">Commands</a></li>
  20984. </ul>
  20985. <div class="subsection-level-extent" id="Commands-44">
  20986. <h4 class="subsection"><span>27.104.1 Commands<a class="copiable-link" href="#Commands-44"> &para;</a></span></h4>
  20987. <p>This filter supports the following commands:
  20988. </p><dl class="table">
  20989. <dt><samp class="option">tempo</samp></dt>
  20990. <dd><p>Change filter tempo scale factor.
  20991. Syntax for the command is : &quot;<var class="var">tempo</var>&quot;
  20992. </p>
  20993. </dd>
  20994. <dt><samp class="option">pitch</samp></dt>
  20995. <dd><p>Change filter pitch scale factor.
  20996. Syntax for the command is : &quot;<var class="var">pitch</var>&quot;
  20997. </p></dd>
  20998. </dl>
  20999. </div>
  21000. </div>
  21001. <div class="section-level-extent" id="sidechaincompress">
  21002. <h3 class="section"><span>27.105 sidechaincompress<a class="copiable-link" href="#sidechaincompress"> &para;</a></span></h3>
  21003. <p>This filter acts like normal compressor but has the ability to compress
  21004. detected signal using second input signal.
  21005. It needs two input streams and returns one output stream.
  21006. First input stream will be processed depending on second stream signal.
  21007. The filtered signal then can be filtered with other filters in later stages of
  21008. processing. See <a class="ref" href="#pan">pan</a> and <a class="ref" href="#amerge">amerge</a> filter.
  21009. </p>
  21010. <p>The filter accepts the following options:
  21011. </p>
  21012. <dl class="table">
  21013. <dt><samp class="option">level_in</samp></dt>
  21014. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  21015. </p>
  21016. </dd>
  21017. <dt><samp class="option">mode</samp></dt>
  21018. <dd><p>Set mode of compressor operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  21019. Default is <code class="code">downward</code>.
  21020. </p>
  21021. </dd>
  21022. <dt><samp class="option">threshold</samp></dt>
  21023. <dd><p>If a signal of second stream raises above this level it will affect the gain
  21024. reduction of first stream.
  21025. By default is 0.125. Range is between 0.00097563 and 1.
  21026. </p>
  21027. </dd>
  21028. <dt><samp class="option">ratio</samp></dt>
  21029. <dd><p>Set a ratio about which the signal is reduced. 1:2 means that if the level
  21030. raised 4dB above the threshold, it will be only 2dB above after the reduction.
  21031. Default is 2. Range is between 1 and 20.
  21032. </p>
  21033. </dd>
  21034. <dt><samp class="option">attack</samp></dt>
  21035. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  21036. reduction starts. Default is 20. Range is between 0.01 and 2000.
  21037. </p>
  21038. </dd>
  21039. <dt><samp class="option">release</samp></dt>
  21040. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  21041. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  21042. </p>
  21043. </dd>
  21044. <dt><samp class="option">makeup</samp></dt>
  21045. <dd><p>Set the amount by how much signal will be amplified after processing.
  21046. Default is 1. Range is from 1 to 64.
  21047. </p>
  21048. </dd>
  21049. <dt><samp class="option">knee</samp></dt>
  21050. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  21051. Default is 2.82843. Range is between 1 and 8.
  21052. </p>
  21053. </dd>
  21054. <dt><samp class="option">link</samp></dt>
  21055. <dd><p>Choose if the <code class="code">average</code> level between all channels of side-chain stream
  21056. or the louder(<code class="code">maximum</code>) channel of side-chain stream affects the
  21057. reduction. Default is <code class="code">average</code>.
  21058. </p>
  21059. </dd>
  21060. <dt><samp class="option">detection</samp></dt>
  21061. <dd><p>Should the exact signal be taken in case of <code class="code">peak</code> or an RMS one in case
  21062. of <code class="code">rms</code>. Default is <code class="code">rms</code> which is mainly smoother.
  21063. </p>
  21064. </dd>
  21065. <dt><samp class="option">level_sc</samp></dt>
  21066. <dd><p>Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
  21067. </p>
  21068. </dd>
  21069. <dt><samp class="option">mix</samp></dt>
  21070. <dd><p>How much to use compressed signal in output. Default is 1.
  21071. Range is between 0 and 1.
  21072. </p></dd>
  21073. </dl>
  21074. <ul class="mini-toc">
  21075. <li><a href="#Commands-45" accesskey="1">Commands</a></li>
  21076. <li><a href="#Examples-46" accesskey="2">Examples</a></li>
  21077. </ul>
  21078. <div class="subsection-level-extent" id="Commands-45">
  21079. <h4 class="subsection"><span>27.105.1 Commands<a class="copiable-link" href="#Commands-45"> &para;</a></span></h4>
  21080. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  21081. </p>
  21082. </div>
  21083. <div class="subsection-level-extent" id="Examples-46">
  21084. <h4 class="subsection"><span>27.105.2 Examples<a class="copiable-link" href="#Examples-46"> &para;</a></span></h4>
  21085. <ul class="itemize mark-bullet">
  21086. <li>Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
  21087. depending on the signal of 2nd input and later compressed signal to be
  21088. merged with 2nd input:
  21089. <div class="example">
  21090. <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;
  21091. </pre></div>
  21092. </li></ul>
  21093. </div>
  21094. </div>
  21095. <div class="section-level-extent" id="sidechaingate">
  21096. <h3 class="section"><span>27.106 sidechaingate<a class="copiable-link" href="#sidechaingate"> &para;</a></span></h3>
  21097. <p>A sidechain gate acts like a normal (wideband) gate but has the ability to
  21098. filter the detected signal before sending it to the gain reduction stage.
  21099. Normally a gate uses the full range signal to detect a level above the
  21100. threshold.
  21101. For example: If you cut all lower frequencies from your sidechain signal
  21102. the gate will decrease the volume of your track only if not enough highs
  21103. appear. With this technique you are able to reduce the resonation of a
  21104. natural drum or remove &quot;rumbling&quot; of muted strokes from a heavily distorted
  21105. guitar.
  21106. It needs two input streams and returns one output stream.
  21107. First input stream will be processed depending on second stream signal.
  21108. </p>
  21109. <p>The filter accepts the following options:
  21110. </p>
  21111. <dl class="table">
  21112. <dt><samp class="option">level_in</samp></dt>
  21113. <dd><p>Set input level before filtering.
  21114. Default is 1. Allowed range is from 0.015625 to 64.
  21115. </p>
  21116. </dd>
  21117. <dt><samp class="option">mode</samp></dt>
  21118. <dd><p>Set the mode of operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  21119. Default is <code class="code">downward</code>. If set to <code class="code">upward</code> mode, higher parts of signal
  21120. will be amplified, expanding dynamic range in upward direction.
  21121. Otherwise, in case of <code class="code">downward</code> lower parts of signal will be reduced.
  21122. </p>
  21123. </dd>
  21124. <dt><samp class="option">range</samp></dt>
  21125. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  21126. Default is 0.06125. Allowed range is from 0 to 1.
  21127. Setting this to 0 disables reduction and then filter behaves like expander.
  21128. </p>
  21129. </dd>
  21130. <dt><samp class="option">threshold</samp></dt>
  21131. <dd><p>If a signal rises above this level the gain reduction is released.
  21132. Default is 0.125. Allowed range is from 0 to 1.
  21133. </p>
  21134. </dd>
  21135. <dt><samp class="option">ratio</samp></dt>
  21136. <dd><p>Set a ratio about which the signal is reduced.
  21137. Default is 2. Allowed range is from 1 to 9000.
  21138. </p>
  21139. </dd>
  21140. <dt><samp class="option">attack</samp></dt>
  21141. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  21142. reduction stops.
  21143. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  21144. </p>
  21145. </dd>
  21146. <dt><samp class="option">release</samp></dt>
  21147. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  21148. reduction is increased again. Default is 250 milliseconds.
  21149. Allowed range is from 0.01 to 9000.
  21150. </p>
  21151. </dd>
  21152. <dt><samp class="option">makeup</samp></dt>
  21153. <dd><p>Set amount of amplification of signal after processing.
  21154. Default is 1. Allowed range is from 1 to 64.
  21155. </p>
  21156. </dd>
  21157. <dt><samp class="option">knee</samp></dt>
  21158. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  21159. Default is 2.828427125. Allowed range is from 1 to 8.
  21160. </p>
  21161. </dd>
  21162. <dt><samp class="option">detection</samp></dt>
  21163. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  21164. Default is rms. Can be peak or rms.
  21165. </p>
  21166. </dd>
  21167. <dt><samp class="option">link</samp></dt>
  21168. <dd><p>Choose if the average level between all channels or the louder channel affects
  21169. the reduction.
  21170. Default is average. Can be average or maximum.
  21171. </p>
  21172. </dd>
  21173. <dt><samp class="option">level_sc</samp></dt>
  21174. <dd><p>Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
  21175. </p></dd>
  21176. </dl>
  21177. <ul class="mini-toc">
  21178. <li><a href="#Commands-46" accesskey="1">Commands</a></li>
  21179. </ul>
  21180. <div class="subsection-level-extent" id="Commands-46">
  21181. <h4 class="subsection"><span>27.106.1 Commands<a class="copiable-link" href="#Commands-46"> &para;</a></span></h4>
  21182. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  21183. </p>
  21184. </div>
  21185. </div>
  21186. <div class="section-level-extent" id="silencedetect">
  21187. <h3 class="section"><span>27.107 silencedetect<a class="copiable-link" href="#silencedetect"> &para;</a></span></h3>
  21188. <p>Detect silence in an audio stream.
  21189. </p>
  21190. <p>This filter logs a message when it detects that the input audio volume is less
  21191. or equal to a noise tolerance value for a duration greater or equal to the
  21192. minimum detected noise duration.
  21193. </p>
  21194. <p>The printed times and duration are expressed in seconds. The
  21195. <code class="code">lavfi.silence_start</code> or <code class="code">lavfi.silence_start.X</code> metadata key
  21196. is set on the first frame whose timestamp equals or exceeds the detection
  21197. duration and it contains the timestamp of the first frame of the silence.
  21198. </p>
  21199. <p>The <code class="code">lavfi.silence_duration</code> or <code class="code">lavfi.silence_duration.X</code>
  21200. and <code class="code">lavfi.silence_end</code> or <code class="code">lavfi.silence_end.X</code> metadata
  21201. keys are set on the first frame after the silence. If <samp class="option">mono</samp> is
  21202. enabled, and each channel is evaluated separately, the <code class="code">.X</code>
  21203. suffixed keys are used, and <code class="code">X</code> corresponds to the channel number.
  21204. </p>
  21205. <p>The filter accepts the following options:
  21206. </p>
  21207. <dl class="table">
  21208. <dt><samp class="option">noise, n</samp></dt>
  21209. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  21210. specified value) or amplitude ratio. Default is -60dB, or 0.001.
  21211. </p>
  21212. </dd>
  21213. <dt><samp class="option">duration, d</samp></dt>
  21214. <dd><p>Set silence duration until notification (default is 2 seconds). See
  21215. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  21216. for the accepted syntax.
  21217. </p>
  21218. </dd>
  21219. <dt><samp class="option">mono, m</samp></dt>
  21220. <dd><p>Process each channel separately, instead of combined. By default is disabled.
  21221. </p></dd>
  21222. </dl>
  21223. <ul class="mini-toc">
  21224. <li><a href="#Examples-47" accesskey="1">Examples</a></li>
  21225. </ul>
  21226. <div class="subsection-level-extent" id="Examples-47">
  21227. <h4 class="subsection"><span>27.107.1 Examples<a class="copiable-link" href="#Examples-47"> &para;</a></span></h4>
  21228. <ul class="itemize mark-bullet">
  21229. <li>Detect 5 seconds of silence with -50dB noise tolerance:
  21230. <div class="example">
  21231. <pre class="example-preformatted">silencedetect=n=-50dB:d=5
  21232. </pre></div>
  21233. </li><li>Complete example with <code class="command">ffmpeg</code> to detect silence with 0.0001 noise
  21234. tolerance in <samp class="file">silence.mp3</samp>:
  21235. <div class="example">
  21236. <pre class="example-preformatted">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
  21237. </pre></div>
  21238. </li></ul>
  21239. </div>
  21240. </div>
  21241. <div class="section-level-extent" id="silenceremove">
  21242. <h3 class="section"><span>27.108 silenceremove<a class="copiable-link" href="#silenceremove"> &para;</a></span></h3>
  21243. <p>Remove silence from the beginning, middle or end of the audio.
  21244. </p>
  21245. <p>The filter accepts the following options:
  21246. </p>
  21247. <dl class="table">
  21248. <dt><samp class="option">start_periods</samp></dt>
  21249. <dd><p>This value is used to indicate if audio should be trimmed at beginning of
  21250. the audio. A value of zero indicates no silence should be trimmed from the
  21251. beginning. When specifying a non-zero value, it trims audio up until it
  21252. finds non-silence. Normally, when trimming silence from beginning of audio
  21253. the <var class="var">start_periods</var> will be <code class="code">1</code> but it can be increased to higher
  21254. values to trim all audio up to specific count of non-silence periods.
  21255. Default value is <code class="code">0</code>.
  21256. </p>
  21257. </dd>
  21258. <dt><samp class="option">start_duration</samp></dt>
  21259. <dd><p>Specify the amount of time that non-silence must be detected before it stops
  21260. trimming audio. By increasing the duration, bursts of noises can be treated
  21261. as silence and trimmed off. Default value is <code class="code">0</code>.
  21262. </p>
  21263. </dd>
  21264. <dt><samp class="option">start_threshold</samp></dt>
  21265. <dd><p>This indicates what sample value should be treated as silence. For digital
  21266. audio, a value of <code class="code">0</code> may be fine but for audio recorded from analog,
  21267. you may wish to increase the value to account for background noise.
  21268. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  21269. or amplitude ratio. Default value is <code class="code">0</code>.
  21270. </p>
  21271. </dd>
  21272. <dt><samp class="option">start_silence</samp></dt>
  21273. <dd><p>Specify max duration of silence at beginning that will be kept after
  21274. trimming. Default is 0, which is equal to trimming all samples detected
  21275. as silence.
  21276. </p>
  21277. </dd>
  21278. <dt><samp class="option">start_mode</samp></dt>
  21279. <dd><p>Specify mode of detection of silence end at start of multi-channel audio.
  21280. Can be <var class="var">any</var> or <var class="var">all</var>. Default is <var class="var">any</var>.
  21281. With <var class="var">any</var>, any sample from any channel that is detected as non-silence
  21282. will trigger end of silence trimming at start of audio stream.
  21283. With <var class="var">all</var>, only if every sample from every channel is detected as non-silence
  21284. will trigger end of silence trimming at start of audio stream, limited usage.
  21285. </p>
  21286. </dd>
  21287. <dt><samp class="option">stop_periods</samp></dt>
  21288. <dd><p>Set the count for trimming silence from the end of audio. When specifying a
  21289. positive value, it trims audio after it finds specified silence period.
  21290. To remove silence from the middle of a file, specify a <var class="var">stop_periods</var>
  21291. that is negative. This value is then treated as a positive value and is
  21292. used to indicate the effect should restart processing as specified by
  21293. <var class="var">stop_periods</var>, making it suitable for removing periods of silence
  21294. in the middle of the audio.
  21295. Default value is <code class="code">0</code>.
  21296. </p>
  21297. </dd>
  21298. <dt><samp class="option">stop_duration</samp></dt>
  21299. <dd><p>Specify a duration of silence that must exist before audio is not copied any
  21300. more. By specifying a higher duration, silence that is wanted can be left in
  21301. the audio.
  21302. Default value is <code class="code">0</code>.
  21303. </p>
  21304. </dd>
  21305. <dt><samp class="option">stop_threshold</samp></dt>
  21306. <dd><p>This is the same as <samp class="option">start_threshold</samp> but for trimming silence from
  21307. the end of audio.
  21308. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  21309. or amplitude ratio. Default value is <code class="code">0</code>.
  21310. </p>
  21311. </dd>
  21312. <dt><samp class="option">stop_silence</samp></dt>
  21313. <dd><p>Specify max duration of silence at end that will be kept after
  21314. trimming. Default is 0, which is equal to trimming all samples detected
  21315. as silence.
  21316. </p>
  21317. </dd>
  21318. <dt><samp class="option">stop_mode</samp></dt>
  21319. <dd><p>Specify mode of detection of silence start after start of multi-channel audio.
  21320. Can be <var class="var">any</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  21321. With <var class="var">any</var>, any sample from any channel that is detected as silence
  21322. will trigger start of silence trimming after start of audio stream, limited usage.
  21323. With <var class="var">all</var>, only if every sample from every channel is detected as silence
  21324. will trigger start of silence trimming after start of audio stream.
  21325. </p>
  21326. </dd>
  21327. <dt><samp class="option">detection</samp></dt>
  21328. <dd><p>Set how is silence detected.
  21329. </p><dl class="table">
  21330. <dt><samp class="option">avg</samp></dt>
  21331. <dd><p>Mean of absolute values of samples in moving window.
  21332. </p></dd>
  21333. <dt><samp class="option">rms</samp></dt>
  21334. <dd><p>Root squared mean of absolute values of samples in moving window.
  21335. </p></dd>
  21336. <dt><samp class="option">peak</samp></dt>
  21337. <dd><p>Maximum of absolute values of samples in moving window.
  21338. </p></dd>
  21339. <dt><samp class="option">median</samp></dt>
  21340. <dd><p>Median of absolute values of samples in moving window.
  21341. </p></dd>
  21342. <dt><samp class="option">ptp</samp></dt>
  21343. <dd><p>Absolute of max peak to min peak difference of samples in moving window.
  21344. </p></dd>
  21345. <dt><samp class="option">dev</samp></dt>
  21346. <dd><p>Standard deviation of values of samples in moving window.
  21347. </p></dd>
  21348. </dl>
  21349. <p>Default value is <code class="code">rms</code>.
  21350. </p>
  21351. </dd>
  21352. <dt><samp class="option">window</samp></dt>
  21353. <dd><p>Set duration in number of seconds used to calculate size of window in number
  21354. of samples for detecting silence. Using <code class="code">0</code> will effectively disable
  21355. any windowing and use only single sample per channel for silence detection.
  21356. In that case it may be needed to also set <samp class="option">start_silence</samp> and/or
  21357. <samp class="option">stop_silence</samp> to nonzero values with also <samp class="option">start_duration</samp> and/or
  21358. <samp class="option">stop_duration</samp> to nonzero values.
  21359. Default value is <code class="code">0.02</code>. Allowed range is from <code class="code">0</code> to <code class="code">10</code>.
  21360. </p>
  21361. </dd>
  21362. <dt><samp class="option">timestamp</samp></dt>
  21363. <dd><p>Set processing mode of every audio frame output timestamp.
  21364. </p><dl class="table">
  21365. <dt><samp class="option">write</samp></dt>
  21366. <dd><p>Full timestamps rewrite, keep only the start time for the first output frame.
  21367. </p></dd>
  21368. <dt><samp class="option">copy</samp></dt>
  21369. <dd><p>Non-dropped frames are left with same timestamp as input audio frame.
  21370. </p></dd>
  21371. </dl>
  21372. <p>Defaults value is <code class="code">write</code>.
  21373. </p></dd>
  21374. </dl>
  21375. <ul class="mini-toc">
  21376. <li><a href="#Examples-48" accesskey="1">Examples</a></li>
  21377. <li><a href="#Commands-47" accesskey="2">Commands</a></li>
  21378. </ul>
  21379. <div class="subsection-level-extent" id="Examples-48">
  21380. <h4 class="subsection"><span>27.108.1 Examples<a class="copiable-link" href="#Examples-48"> &para;</a></span></h4>
  21381. <ul class="itemize mark-bullet">
  21382. <li>The following example shows how this filter can be used to start a recording
  21383. that does not contain the delay at the start which usually occurs between
  21384. pressing the record button and the start of the performance:
  21385. <div class="example">
  21386. <pre class="example-preformatted">silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
  21387. </pre></div>
  21388. </li><li>Trim all silence encountered from beginning to end where there is more than 1
  21389. second of silence in audio:
  21390. <div class="example">
  21391. <pre class="example-preformatted">silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
  21392. </pre></div>
  21393. </li><li>Trim all digital silence samples, using peak detection, from beginning to end
  21394. where there is more than 0 samples of digital silence in audio and digital
  21395. silence is detected in all channels at same positions in stream:
  21396. <div class="example">
  21397. <pre class="example-preformatted">silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
  21398. </pre></div>
  21399. </li><li>Trim every 2nd encountered silence period from beginning to end where there is
  21400. more than 1 second of silence per silence period in audio:
  21401. <div class="example">
  21402. <pre class="example-preformatted">silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB
  21403. </pre></div>
  21404. </li><li>Similar as above, but keep maximum of 0.5 seconds of silence from each trimmed period:
  21405. <div class="example">
  21406. <pre class="example-preformatted">silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB:stop_silence=0.5
  21407. </pre></div>
  21408. </li><li>Similar as above, but keep maximum of 1.5 seconds of silence from start of audio:
  21409. <div class="example">
  21410. <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
  21411. </pre></div>
  21412. </li></ul>
  21413. </div>
  21414. <div class="subsection-level-extent" id="Commands-47">
  21415. <h4 class="subsection"><span>27.108.2 Commands<a class="copiable-link" href="#Commands-47"> &para;</a></span></h4>
  21416. <p>This filter supports some above options as <a class="ref" href="#commands">commands</a>.
  21417. </p>
  21418. </div>
  21419. </div>
  21420. <div class="section-level-extent" id="sofalizer">
  21421. <h3 class="section"><span>27.109 sofalizer<a class="copiable-link" href="#sofalizer"> &para;</a></span></h3>
  21422. <p>SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
  21423. loudspeakers around the user for binaural listening via headphones (audio
  21424. formats up to 9 channels supported).
  21425. The HRTFs are stored in SOFA files (see <a class="url" href="http://www.sofacoustics.org/">http://www.sofacoustics.org/</a> for a database).
  21426. SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
  21427. Austrian Academy of Sciences.
  21428. </p>
  21429. <p>To enable compilation of this filter you need to configure FFmpeg with
  21430. <code class="code">--enable-libmysofa</code>.
  21431. </p>
  21432. <p>The filter accepts the following options:
  21433. </p>
  21434. <dl class="table">
  21435. <dt><samp class="option">sofa</samp></dt>
  21436. <dd><p>Set the SOFA file used for rendering.
  21437. </p>
  21438. </dd>
  21439. <dt><samp class="option">gain</samp></dt>
  21440. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  21441. </p>
  21442. </dd>
  21443. <dt><samp class="option">rotation</samp></dt>
  21444. <dd><p>Set rotation of virtual loudspeakers in deg. Default is 0.
  21445. </p>
  21446. </dd>
  21447. <dt><samp class="option">elevation</samp></dt>
  21448. <dd><p>Set elevation of virtual speakers in deg. Default is 0.
  21449. </p>
  21450. </dd>
  21451. <dt><samp class="option">radius</samp></dt>
  21452. <dd><p>Set distance in meters between loudspeakers and the listener with near-field
  21453. HRTFs. Default is 1.
  21454. </p>
  21455. </dd>
  21456. <dt><samp class="option">type</samp></dt>
  21457. <dd><p>Set processing type. Can be <var class="var">time</var> or <var class="var">freq</var>. <var class="var">time</var> is
  21458. processing audio in time domain which is slow.
  21459. <var class="var">freq</var> is processing audio in frequency domain which is fast.
  21460. Default is <var class="var">freq</var>.
  21461. </p>
  21462. </dd>
  21463. <dt><samp class="option">speakers</samp></dt>
  21464. <dd><p>Set custom positions of virtual loudspeakers. Syntax for this option is:
  21465. &lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;[|&lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;|...].
  21466. Each virtual loudspeaker is described with short channel name following with
  21467. azimuth and elevation in degrees.
  21468. Each virtual loudspeaker description is separated by &rsquo;|&rsquo;.
  21469. For example to override front left and front right channel positions use:
  21470. &rsquo;speakers=FL 45 15|FR 345 15&rsquo;.
  21471. Descriptions with unrecognised channel names are ignored.
  21472. </p>
  21473. </dd>
  21474. <dt><samp class="option">lfegain</samp></dt>
  21475. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  21476. </p>
  21477. </dd>
  21478. <dt><samp class="option">framesize</samp></dt>
  21479. <dd><p>Set custom frame size in number of samples. Default is 1024.
  21480. Allowed range is from 1024 to 96000. Only used if option &lsquo;<samp class="samp">type</samp>&rsquo;
  21481. is set to <var class="var">freq</var>.
  21482. </p>
  21483. </dd>
  21484. <dt><samp class="option">normalize</samp></dt>
  21485. <dd><p>Should all IRs be normalized upon importing SOFA file.
  21486. By default is enabled.
  21487. </p>
  21488. </dd>
  21489. <dt><samp class="option">interpolate</samp></dt>
  21490. <dd><p>Should nearest IRs be interpolated with neighbor IRs if exact position
  21491. does not match. By default is disabled.
  21492. </p>
  21493. </dd>
  21494. <dt><samp class="option">minphase</samp></dt>
  21495. <dd><p>Minphase all IRs upon loading of SOFA file. By default is disabled.
  21496. </p>
  21497. </dd>
  21498. <dt><samp class="option">anglestep</samp></dt>
  21499. <dd><p>Set neighbor search angle step. Only used if option <var class="var">interpolate</var> is enabled.
  21500. </p>
  21501. </dd>
  21502. <dt><samp class="option">radstep</samp></dt>
  21503. <dd><p>Set neighbor search radius step. Only used if option <var class="var">interpolate</var> is enabled.
  21504. </p></dd>
  21505. </dl>
  21506. <ul class="mini-toc">
  21507. <li><a href="#Examples-49" accesskey="1">Examples</a></li>
  21508. </ul>
  21509. <div class="subsection-level-extent" id="Examples-49">
  21510. <h4 class="subsection"><span>27.109.1 Examples<a class="copiable-link" href="#Examples-49"> &para;</a></span></h4>
  21511. <ul class="itemize mark-bullet">
  21512. <li>Using ClubFritz6 sofa file:
  21513. <div class="example">
  21514. <pre class="example-preformatted">sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
  21515. </pre></div>
  21516. </li><li>Using ClubFritz12 sofa file and bigger radius with small rotation:
  21517. <div class="example">
  21518. <pre class="example-preformatted">sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
  21519. </pre></div>
  21520. </li><li>Similar as above but with custom speaker positions for front left, front right, back left and back right
  21521. and also with custom gain:
  21522. <div class="example">
  21523. <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;
  21524. </pre></div>
  21525. </li></ul>
  21526. </div>
  21527. </div>
  21528. <div class="section-level-extent" id="speechnorm">
  21529. <h3 class="section"><span>27.110 speechnorm<a class="copiable-link" href="#speechnorm"> &para;</a></span></h3>
  21530. <p>Speech Normalizer.
  21531. </p>
  21532. <p>This filter expands or compresses each half-cycle of audio samples
  21533. (local set of samples all above or all below zero and between two nearest zero crossings) depending
  21534. on threshold value, so audio reaches target peak value under conditions controlled by below options.
  21535. </p>
  21536. <p>The filter accepts the following options:
  21537. </p>
  21538. <dl class="table">
  21539. <dt><samp class="option">peak, p</samp></dt>
  21540. <dd><p>Set the expansion target peak value. This specifies the highest allowed absolute amplitude
  21541. level for the normalized audio input. Default value is 0.95. Allowed range is from 0.0 to 1.0.
  21542. </p>
  21543. </dd>
  21544. <dt><samp class="option">expansion, e</samp></dt>
  21545. <dd><p>Set the maximum expansion factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  21546. This option controls maximum local half-cycle of samples expansion. The maximum expansion
  21547. would be such that local peak value reaches target peak value but never to surpass it and that
  21548. ratio between new and previous peak value does not surpass this option value.
  21549. </p>
  21550. </dd>
  21551. <dt><samp class="option">compression, c</samp></dt>
  21552. <dd><p>Set the maximum compression factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  21553. This option controls maximum local half-cycle of samples compression. This option is used
  21554. only if <samp class="option">threshold</samp> option is set to value greater than 0.0, then in such cases
  21555. when local peak is lower or same as value set by <samp class="option">threshold</samp> all samples belonging to
  21556. that peak&rsquo;s half-cycle will be compressed by current compression factor.
  21557. </p>
  21558. </dd>
  21559. <dt><samp class="option">threshold, t</samp></dt>
  21560. <dd><p>Set the threshold value. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  21561. This option specifies which half-cycles of samples will be compressed and which will be expanded.
  21562. Any half-cycle samples with their local peak value below or same as this option value will be
  21563. compressed by current compression factor, otherwise, if greater than threshold value they will be
  21564. expanded with expansion factor so that it could reach peak target value but never surpass it.
  21565. </p>
  21566. </dd>
  21567. <dt><samp class="option">raise, r</samp></dt>
  21568. <dd><p>Set the expansion raising amount per each half-cycle of samples. Default value is 0.001.
  21569. Allowed range is from 0.0 to 1.0. This controls how fast expansion factor is raised per
  21570. each new half-cycle until it reaches <samp class="option">expansion</samp> value.
  21571. Setting this options too high may lead to distortions.
  21572. </p>
  21573. </dd>
  21574. <dt><samp class="option">fall, f</samp></dt>
  21575. <dd><p>Set the compression raising amount per each half-cycle of samples. Default value is 0.001.
  21576. Allowed range is from 0.0 to 1.0. This controls how fast compression factor is raised per
  21577. each new half-cycle until it reaches <samp class="option">compression</samp> value.
  21578. </p>
  21579. </dd>
  21580. <dt><samp class="option">channels, h</samp></dt>
  21581. <dd><p>Specify which channels to filter, by default all available channels are filtered.
  21582. </p>
  21583. </dd>
  21584. <dt><samp class="option">invert, i</samp></dt>
  21585. <dd><p>Enable inverted filtering, by default is disabled. This inverts interpretation of <samp class="option">threshold</samp>
  21586. option. When enabled any half-cycle of samples with their local peak value below or same as
  21587. <samp class="option">threshold</samp> option will be expanded otherwise it will be compressed.
  21588. </p>
  21589. </dd>
  21590. <dt><samp class="option">link, l</samp></dt>
  21591. <dd><p>Link channels when calculating gain applied to each filtered channel sample, by default is disabled.
  21592. When disabled each filtered channel gain calculation is independent, otherwise when this option
  21593. is enabled the minimum of all possible gains for each filtered channel is used.
  21594. </p>
  21595. </dd>
  21596. <dt><samp class="option">rms, m</samp></dt>
  21597. <dd><p>Set the expansion target RMS value. This specifies the highest allowed RMS level for the normalized
  21598. audio input. Default value is 0.0, thus disabled. Allowed range is from 0.0 to 1.0.
  21599. </p></dd>
  21600. </dl>
  21601. <ul class="mini-toc">
  21602. <li><a href="#Commands-48" accesskey="1">Commands</a></li>
  21603. <li><a href="#Examples-50" accesskey="2">Examples</a></li>
  21604. </ul>
  21605. <div class="subsection-level-extent" id="Commands-48">
  21606. <h4 class="subsection"><span>27.110.1 Commands<a class="copiable-link" href="#Commands-48"> &para;</a></span></h4>
  21607. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  21608. </p>
  21609. </div>
  21610. <div class="subsection-level-extent" id="Examples-50">
  21611. <h4 class="subsection"><span>27.110.2 Examples<a class="copiable-link" href="#Examples-50"> &para;</a></span></h4>
  21612. <ul class="itemize mark-bullet">
  21613. <li>Weak and slow amplification:
  21614. <div class="example">
  21615. <pre class="example-preformatted">speechnorm=e=3:r=0.00001:l=1
  21616. </pre></div>
  21617. </li><li>Moderate and slow amplification:
  21618. <div class="example">
  21619. <pre class="example-preformatted">speechnorm=e=6.25:r=0.00001:l=1
  21620. </pre></div>
  21621. </li><li>Strong and fast amplification:
  21622. <div class="example">
  21623. <pre class="example-preformatted">speechnorm=e=12.5:r=0.0001:l=1
  21624. </pre></div>
  21625. </li><li>Very strong and fast amplification:
  21626. <div class="example">
  21627. <pre class="example-preformatted">speechnorm=e=25:r=0.0001:l=1
  21628. </pre></div>
  21629. </li><li>Extreme and fast amplification:
  21630. <div class="example">
  21631. <pre class="example-preformatted">speechnorm=e=50:r=0.0001:l=1
  21632. </pre></div>
  21633. </li></ul>
  21634. </div>
  21635. </div>
  21636. <div class="section-level-extent" id="stereotools">
  21637. <h3 class="section"><span>27.111 stereotools<a class="copiable-link" href="#stereotools"> &para;</a></span></h3>
  21638. <p>This filter has some handy utilities to manage stereo signals, for converting
  21639. M/S stereo recordings to L/R signal while having control over the parameters
  21640. or spreading the stereo image of master track.
  21641. </p>
  21642. <p>The filter accepts the following options:
  21643. </p>
  21644. <dl class="table">
  21645. <dt><samp class="option">level_in</samp></dt>
  21646. <dd><p>Set input level before filtering for both channels. Defaults is 1.
  21647. Allowed range is from 0.015625 to 64.
  21648. </p>
  21649. </dd>
  21650. <dt><samp class="option">level_out</samp></dt>
  21651. <dd><p>Set output level after filtering for both channels. Defaults is 1.
  21652. Allowed range is from 0.015625 to 64.
  21653. </p>
  21654. </dd>
  21655. <dt><samp class="option">balance_in</samp></dt>
  21656. <dd><p>Set input balance between both channels. Default is 0.
  21657. Allowed range is from -1 to 1.
  21658. </p>
  21659. </dd>
  21660. <dt><samp class="option">balance_out</samp></dt>
  21661. <dd><p>Set output balance between both channels. Default is 0.
  21662. Allowed range is from -1 to 1.
  21663. </p>
  21664. </dd>
  21665. <dt><samp class="option">softclip</samp></dt>
  21666. <dd><p>Enable softclipping. Results in analog distortion instead of harsh digital 0dB
  21667. clipping. Disabled by default.
  21668. </p>
  21669. </dd>
  21670. <dt><samp class="option">mutel</samp></dt>
  21671. <dd><p>Mute the left channel. Disabled by default.
  21672. </p>
  21673. </dd>
  21674. <dt><samp class="option">muter</samp></dt>
  21675. <dd><p>Mute the right channel. Disabled by default.
  21676. </p>
  21677. </dd>
  21678. <dt><samp class="option">phasel</samp></dt>
  21679. <dd><p>Change the phase of the left channel. Disabled by default.
  21680. </p>
  21681. </dd>
  21682. <dt><samp class="option">phaser</samp></dt>
  21683. <dd><p>Change the phase of the right channel. Disabled by default.
  21684. </p>
  21685. </dd>
  21686. <dt><samp class="option">mode</samp></dt>
  21687. <dd><p>Set stereo mode. Available values are:
  21688. </p>
  21689. <dl class="table">
  21690. <dt>&lsquo;<samp class="samp">lr&gt;lr</samp>&rsquo;</dt>
  21691. <dd><p>Left/Right to Left/Right, this is default.
  21692. </p>
  21693. </dd>
  21694. <dt>&lsquo;<samp class="samp">lr&gt;ms</samp>&rsquo;</dt>
  21695. <dd><p>Left/Right to Mid/Side.
  21696. </p>
  21697. </dd>
  21698. <dt>&lsquo;<samp class="samp">ms&gt;lr</samp>&rsquo;</dt>
  21699. <dd><p>Mid/Side to Left/Right.
  21700. </p>
  21701. </dd>
  21702. <dt>&lsquo;<samp class="samp">lr&gt;ll</samp>&rsquo;</dt>
  21703. <dd><p>Left/Right to Left/Left.
  21704. </p>
  21705. </dd>
  21706. <dt>&lsquo;<samp class="samp">lr&gt;rr</samp>&rsquo;</dt>
  21707. <dd><p>Left/Right to Right/Right.
  21708. </p>
  21709. </dd>
  21710. <dt>&lsquo;<samp class="samp">lr&gt;l+r</samp>&rsquo;</dt>
  21711. <dd><p>Left/Right to Left + Right.
  21712. </p>
  21713. </dd>
  21714. <dt>&lsquo;<samp class="samp">lr&gt;rl</samp>&rsquo;</dt>
  21715. <dd><p>Left/Right to Right/Left.
  21716. </p>
  21717. </dd>
  21718. <dt>&lsquo;<samp class="samp">ms&gt;ll</samp>&rsquo;</dt>
  21719. <dd><p>Mid/Side to Left/Left.
  21720. </p>
  21721. </dd>
  21722. <dt>&lsquo;<samp class="samp">ms&gt;rr</samp>&rsquo;</dt>
  21723. <dd><p>Mid/Side to Right/Right.
  21724. </p>
  21725. </dd>
  21726. <dt>&lsquo;<samp class="samp">ms&gt;rl</samp>&rsquo;</dt>
  21727. <dd><p>Mid/Side to Right/Left.
  21728. </p>
  21729. </dd>
  21730. <dt>&lsquo;<samp class="samp">lr&gt;l-r</samp>&rsquo;</dt>
  21731. <dd><p>Left/Right to Left - Right.
  21732. </p></dd>
  21733. </dl>
  21734. </dd>
  21735. <dt><samp class="option">slev</samp></dt>
  21736. <dd><p>Set level of side signal. Default is 1.
  21737. Allowed range is from 0.015625 to 64.
  21738. </p>
  21739. </dd>
  21740. <dt><samp class="option">sbal</samp></dt>
  21741. <dd><p>Set balance of side signal. Default is 0.
  21742. Allowed range is from -1 to 1.
  21743. </p>
  21744. </dd>
  21745. <dt><samp class="option">mlev</samp></dt>
  21746. <dd><p>Set level of the middle signal. Default is 1.
  21747. Allowed range is from 0.015625 to 64.
  21748. </p>
  21749. </dd>
  21750. <dt><samp class="option">mpan</samp></dt>
  21751. <dd><p>Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
  21752. </p>
  21753. </dd>
  21754. <dt><samp class="option">base</samp></dt>
  21755. <dd><p>Set stereo base between mono and inversed channels. Default is 0.
  21756. Allowed range is from -1 to 1.
  21757. </p>
  21758. </dd>
  21759. <dt><samp class="option">delay</samp></dt>
  21760. <dd><p>Set delay in milliseconds how much to delay left from right channel and
  21761. vice versa. Default is 0. Allowed range is from -20 to 20.
  21762. </p>
  21763. </dd>
  21764. <dt><samp class="option">sclevel</samp></dt>
  21765. <dd><p>Set S/C level. Default is 1. Allowed range is from 1 to 100.
  21766. </p>
  21767. </dd>
  21768. <dt><samp class="option">phase</samp></dt>
  21769. <dd><p>Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
  21770. </p>
  21771. </dd>
  21772. <dt><samp class="option">bmode_in, bmode_out</samp></dt>
  21773. <dd><p>Set balance mode for balance_in/balance_out option.
  21774. </p>
  21775. <p>Can be one of the following:
  21776. </p>
  21777. <dl class="table">
  21778. <dt>&lsquo;<samp class="samp">balance</samp>&rsquo;</dt>
  21779. <dd><p>Classic balance mode. Attenuate one channel at time.
  21780. Gain is raised up to 1.
  21781. </p>
  21782. </dd>
  21783. <dt>&lsquo;<samp class="samp">amplitude</samp>&rsquo;</dt>
  21784. <dd><p>Similar as classic mode above but gain is raised up to 2.
  21785. </p>
  21786. </dd>
  21787. <dt>&lsquo;<samp class="samp">power</samp>&rsquo;</dt>
  21788. <dd><p>Equal power distribution, from -6dB to +6dB range.
  21789. </p></dd>
  21790. </dl>
  21791. </dd>
  21792. </dl>
  21793. <ul class="mini-toc">
  21794. <li><a href="#Commands-49" accesskey="1">Commands</a></li>
  21795. <li><a href="#Examples-51" accesskey="2">Examples</a></li>
  21796. </ul>
  21797. <div class="subsection-level-extent" id="Commands-49">
  21798. <h4 class="subsection"><span>27.111.1 Commands<a class="copiable-link" href="#Commands-49"> &para;</a></span></h4>
  21799. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  21800. </p>
  21801. </div>
  21802. <div class="subsection-level-extent" id="Examples-51">
  21803. <h4 class="subsection"><span>27.111.2 Examples<a class="copiable-link" href="#Examples-51"> &para;</a></span></h4>
  21804. <ul class="itemize mark-bullet">
  21805. <li>Apply karaoke like effect:
  21806. <div class="example">
  21807. <pre class="example-preformatted">stereotools=mlev=0.015625
  21808. </pre></div>
  21809. </li><li>Convert M/S signal to L/R:
  21810. <div class="example">
  21811. <pre class="example-preformatted">&quot;stereotools=mode=ms&gt;lr&quot;
  21812. </pre></div>
  21813. </li></ul>
  21814. </div>
  21815. </div>
  21816. <div class="section-level-extent" id="stereowiden">
  21817. <h3 class="section"><span>27.112 stereowiden<a class="copiable-link" href="#stereowiden"> &para;</a></span></h3>
  21818. <p>This filter enhance the stereo effect by suppressing signal common to both
  21819. channels and by delaying the signal of left into right and vice versa,
  21820. thereby widening the stereo effect.
  21821. </p>
  21822. <p>The filter accepts the following options:
  21823. </p>
  21824. <dl class="table">
  21825. <dt><samp class="option">delay</samp></dt>
  21826. <dd><p>Time in milliseconds of the delay of left signal into right and vice versa.
  21827. Default is 20 milliseconds.
  21828. </p>
  21829. </dd>
  21830. <dt><samp class="option">feedback</samp></dt>
  21831. <dd><p>Amount of gain in delayed signal into right and vice versa. Gives a delay
  21832. effect of left signal in right output and vice versa which gives widening
  21833. effect. Default is 0.3.
  21834. </p>
  21835. </dd>
  21836. <dt><samp class="option">crossfeed</samp></dt>
  21837. <dd><p>Cross feed of left into right with inverted phase. This helps in suppressing
  21838. the mono. If the value is 1 it will cancel all the signal common to both
  21839. channels. Default is 0.3.
  21840. </p>
  21841. </dd>
  21842. <dt><samp class="option">drymix</samp></dt>
  21843. <dd><p>Set level of input signal of original channel. Default is 0.8.
  21844. </p></dd>
  21845. </dl>
  21846. <ul class="mini-toc">
  21847. <li><a href="#Commands-50" accesskey="1">Commands</a></li>
  21848. </ul>
  21849. <div class="subsection-level-extent" id="Commands-50">
  21850. <h4 class="subsection"><span>27.112.1 Commands<a class="copiable-link" href="#Commands-50"> &para;</a></span></h4>
  21851. <p>This filter supports the all above options except <code class="code">delay</code> as <a class="ref" href="#commands">commands</a>.
  21852. </p>
  21853. </div>
  21854. </div>
  21855. <div class="section-level-extent" id="superequalizer">
  21856. <h3 class="section"><span>27.113 superequalizer<a class="copiable-link" href="#superequalizer"> &para;</a></span></h3>
  21857. <p>Apply 18 band equalizer.
  21858. </p>
  21859. <p>The filter accepts the following options:
  21860. </p><dl class="table">
  21861. <dt><samp class="option">1b</samp></dt>
  21862. <dd><p>Set 65Hz band gain.
  21863. </p></dd>
  21864. <dt><samp class="option">2b</samp></dt>
  21865. <dd><p>Set 92Hz band gain.
  21866. </p></dd>
  21867. <dt><samp class="option">3b</samp></dt>
  21868. <dd><p>Set 131Hz band gain.
  21869. </p></dd>
  21870. <dt><samp class="option">4b</samp></dt>
  21871. <dd><p>Set 185Hz band gain.
  21872. </p></dd>
  21873. <dt><samp class="option">5b</samp></dt>
  21874. <dd><p>Set 262Hz band gain.
  21875. </p></dd>
  21876. <dt><samp class="option">6b</samp></dt>
  21877. <dd><p>Set 370Hz band gain.
  21878. </p></dd>
  21879. <dt><samp class="option">7b</samp></dt>
  21880. <dd><p>Set 523Hz band gain.
  21881. </p></dd>
  21882. <dt><samp class="option">8b</samp></dt>
  21883. <dd><p>Set 740Hz band gain.
  21884. </p></dd>
  21885. <dt><samp class="option">9b</samp></dt>
  21886. <dd><p>Set 1047Hz band gain.
  21887. </p></dd>
  21888. <dt><samp class="option">10b</samp></dt>
  21889. <dd><p>Set 1480Hz band gain.
  21890. </p></dd>
  21891. <dt><samp class="option">11b</samp></dt>
  21892. <dd><p>Set 2093Hz band gain.
  21893. </p></dd>
  21894. <dt><samp class="option">12b</samp></dt>
  21895. <dd><p>Set 2960Hz band gain.
  21896. </p></dd>
  21897. <dt><samp class="option">13b</samp></dt>
  21898. <dd><p>Set 4186Hz band gain.
  21899. </p></dd>
  21900. <dt><samp class="option">14b</samp></dt>
  21901. <dd><p>Set 5920Hz band gain.
  21902. </p></dd>
  21903. <dt><samp class="option">15b</samp></dt>
  21904. <dd><p>Set 8372Hz band gain.
  21905. </p></dd>
  21906. <dt><samp class="option">16b</samp></dt>
  21907. <dd><p>Set 11840Hz band gain.
  21908. </p></dd>
  21909. <dt><samp class="option">17b</samp></dt>
  21910. <dd><p>Set 16744Hz band gain.
  21911. </p></dd>
  21912. <dt><samp class="option">18b</samp></dt>
  21913. <dd><p>Set 20000Hz band gain.
  21914. </p></dd>
  21915. </dl>
  21916. </div>
  21917. <div class="section-level-extent" id="surround">
  21918. <h3 class="section"><span>27.114 surround<a class="copiable-link" href="#surround"> &para;</a></span></h3>
  21919. <p>Apply audio surround upmix filter.
  21920. </p>
  21921. <p>This filter allows to produce multichannel output from audio stream.
  21922. </p>
  21923. <p>The filter accepts the following options:
  21924. </p>
  21925. <dl class="table">
  21926. <dt><samp class="option">chl_out</samp></dt>
  21927. <dd><p>Set output channel layout. By default, this is <var class="var">5.1</var>.
  21928. </p>
  21929. <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>
  21930. for the required syntax.
  21931. </p>
  21932. </dd>
  21933. <dt><samp class="option">chl_in</samp></dt>
  21934. <dd><p>Set input channel layout. By default, this is <var class="var">stereo</var>.
  21935. </p>
  21936. <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>
  21937. for the required syntax.
  21938. </p>
  21939. </dd>
  21940. <dt><samp class="option">level_in</samp></dt>
  21941. <dd><p>Set input volume level. By default, this is <var class="var">1</var>.
  21942. </p>
  21943. </dd>
  21944. <dt><samp class="option">level_out</samp></dt>
  21945. <dd><p>Set output volume level. By default, this is <var class="var">1</var>.
  21946. </p>
  21947. </dd>
  21948. <dt><samp class="option">lfe</samp></dt>
  21949. <dd><p>Enable LFE channel output if output channel layout has it. By default, this is enabled.
  21950. </p>
  21951. </dd>
  21952. <dt><samp class="option">lfe_low</samp></dt>
  21953. <dd><p>Set LFE low cut off frequency. By default, this is <var class="var">128</var> Hz.
  21954. </p>
  21955. </dd>
  21956. <dt><samp class="option">lfe_high</samp></dt>
  21957. <dd><p>Set LFE high cut off frequency. By default, this is <var class="var">256</var> Hz.
  21958. </p>
  21959. </dd>
  21960. <dt><samp class="option">lfe_mode</samp></dt>
  21961. <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>.
  21962. In <var class="var">add</var> mode, LFE channel is created from input audio and added to output.
  21963. In <var class="var">sub</var> mode, LFE channel is created from input audio and added to output but
  21964. also all non-LFE output channels are subtracted with output LFE channel.
  21965. </p>
  21966. </dd>
  21967. <dt><samp class="option">smooth</samp></dt>
  21968. <dd><p>Set temporal smoothness strength, used to gradually change factors when transforming
  21969. stereo sound in time. Allowed range is from <var class="var">0.0</var> to <var class="var">1.0</var>.
  21970. Useful to improve output quality with <var class="var">focus</var> option values greater than <var class="var">0.0</var>.
  21971. Default is <var class="var">0.0</var>. Only values inside this range and without edges are effective.
  21972. </p>
  21973. </dd>
  21974. <dt><samp class="option">angle</samp></dt>
  21975. <dd><p>Set angle of stereo surround transform, Allowed range is from <var class="var">0</var> to <var class="var">360</var>.
  21976. Default is <var class="var">90</var>.
  21977. </p>
  21978. </dd>
  21979. <dt><samp class="option">focus</samp></dt>
  21980. <dd><p>Set focus of stereo surround transform, Allowed range is from <var class="var">-1</var> to <var class="var">1</var>.
  21981. Default is <var class="var">0</var>.
  21982. </p>
  21983. </dd>
  21984. <dt><samp class="option">fc_in</samp></dt>
  21985. <dd><p>Set front center input volume. By default, this is <var class="var">1</var>.
  21986. </p>
  21987. </dd>
  21988. <dt><samp class="option">fc_out</samp></dt>
  21989. <dd><p>Set front center output volume. By default, this is <var class="var">1</var>.
  21990. </p>
  21991. </dd>
  21992. <dt><samp class="option">fl_in</samp></dt>
  21993. <dd><p>Set front left input volume. By default, this is <var class="var">1</var>.
  21994. </p>
  21995. </dd>
  21996. <dt><samp class="option">fl_out</samp></dt>
  21997. <dd><p>Set front left output volume. By default, this is <var class="var">1</var>.
  21998. </p>
  21999. </dd>
  22000. <dt><samp class="option">fr_in</samp></dt>
  22001. <dd><p>Set front right input volume. By default, this is <var class="var">1</var>.
  22002. </p>
  22003. </dd>
  22004. <dt><samp class="option">fr_out</samp></dt>
  22005. <dd><p>Set front right output volume. By default, this is <var class="var">1</var>.
  22006. </p>
  22007. </dd>
  22008. <dt><samp class="option">sl_in</samp></dt>
  22009. <dd><p>Set side left input volume. By default, this is <var class="var">1</var>.
  22010. </p>
  22011. </dd>
  22012. <dt><samp class="option">sl_out</samp></dt>
  22013. <dd><p>Set side left output volume. By default, this is <var class="var">1</var>.
  22014. </p>
  22015. </dd>
  22016. <dt><samp class="option">sr_in</samp></dt>
  22017. <dd><p>Set side right input volume. By default, this is <var class="var">1</var>.
  22018. </p>
  22019. </dd>
  22020. <dt><samp class="option">sr_out</samp></dt>
  22021. <dd><p>Set side right output volume. By default, this is <var class="var">1</var>.
  22022. </p>
  22023. </dd>
  22024. <dt><samp class="option">bl_in</samp></dt>
  22025. <dd><p>Set back left input volume. By default, this is <var class="var">1</var>.
  22026. </p>
  22027. </dd>
  22028. <dt><samp class="option">bl_out</samp></dt>
  22029. <dd><p>Set back left output volume. By default, this is <var class="var">1</var>.
  22030. </p>
  22031. </dd>
  22032. <dt><samp class="option">br_in</samp></dt>
  22033. <dd><p>Set back right input volume. By default, this is <var class="var">1</var>.
  22034. </p>
  22035. </dd>
  22036. <dt><samp class="option">br_out</samp></dt>
  22037. <dd><p>Set back right output volume. By default, this is <var class="var">1</var>.
  22038. </p>
  22039. </dd>
  22040. <dt><samp class="option">bc_in</samp></dt>
  22041. <dd><p>Set back center input volume. By default, this is <var class="var">1</var>.
  22042. </p>
  22043. </dd>
  22044. <dt><samp class="option">bc_out</samp></dt>
  22045. <dd><p>Set back center output volume. By default, this is <var class="var">1</var>.
  22046. </p>
  22047. </dd>
  22048. <dt><samp class="option">lfe_in</samp></dt>
  22049. <dd><p>Set LFE input volume. By default, this is <var class="var">1</var>.
  22050. </p>
  22051. </dd>
  22052. <dt><samp class="option">lfe_out</samp></dt>
  22053. <dd><p>Set LFE output volume. By default, this is <var class="var">1</var>.
  22054. </p>
  22055. </dd>
  22056. <dt><samp class="option">allx</samp></dt>
  22057. <dd><p>Set spread usage of stereo image across X axis for all channels.
  22058. Allowed range is from <var class="var">-1</var> to <var class="var">15</var>.
  22059. By default this value is negative <var class="var">-1</var>, and thus unused.
  22060. </p>
  22061. </dd>
  22062. <dt><samp class="option">ally</samp></dt>
  22063. <dd><p>Set spread usage of stereo image across Y axis for all channels.
  22064. Allowed range is from <var class="var">-1</var> to <var class="var">15</var>.
  22065. By default this value is negative <var class="var">-1</var>, and thus unused.
  22066. </p>
  22067. </dd>
  22068. <dt><samp class="option">fcx, flx, frx, blx, brx, slx, srx, bcx</samp></dt>
  22069. <dd><p>Set spread usage of stereo image across X axis for each channel.
  22070. Allowed range is from <var class="var">0.06</var> to <var class="var">15</var>.
  22071. By default this value is <var class="var">0.5</var>.
  22072. </p>
  22073. </dd>
  22074. <dt><samp class="option">fcy, fly, fry, bly, bry, sly, sry, bcy</samp></dt>
  22075. <dd><p>Set spread usage of stereo image across Y axis for each channel.
  22076. Allowed range is from <var class="var">0.06</var> to <var class="var">15</var>.
  22077. By default this value is <var class="var">0.5</var>.
  22078. </p>
  22079. </dd>
  22080. <dt><samp class="option">win_size</samp></dt>
  22081. <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>.
  22082. </p>
  22083. </dd>
  22084. <dt><samp class="option">win_func</samp></dt>
  22085. <dd><p>Set window function.
  22086. </p>
  22087. <p>It accepts the following values:
  22088. </p><dl class="table">
  22089. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  22090. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  22091. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  22092. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  22093. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  22094. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  22095. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  22096. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  22097. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  22098. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  22099. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  22100. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  22101. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  22102. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  22103. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  22104. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  22105. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  22106. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  22107. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  22108. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  22109. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  22110. </dl>
  22111. <p>Default is <code class="code">hann</code>.
  22112. </p>
  22113. </dd>
  22114. <dt><samp class="option">overlap</samp></dt>
  22115. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  22116. window function will be picked. Default is <code class="code">0.5</code>.
  22117. </p></dd>
  22118. </dl>
  22119. </div>
  22120. <div class="section-level-extent" id="tiltshelf">
  22121. <h3 class="section"><span>27.115 tiltshelf<a class="copiable-link" href="#tiltshelf"> &para;</a></span></h3>
  22122. <p>Boost or cut the lower frequencies and cut or boost higher frequencies
  22123. of the audio using a two-pole shelving filter with a response similar to
  22124. that of a standard hi-fi&rsquo;s tone-controls.
  22125. This is also known as shelving equalisation (EQ).
  22126. </p>
  22127. <p>The filter accepts the following options:
  22128. </p>
  22129. <dl class="table">
  22130. <dt><samp class="option">gain, g</samp></dt>
  22131. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  22132. (for a large cut) to +20 (for a large boost).
  22133. Beware of clipping when using a positive gain.
  22134. </p>
  22135. </dd>
  22136. <dt><samp class="option">frequency, f</samp></dt>
  22137. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  22138. to extend or reduce the frequency range to be boosted or cut.
  22139. The default value is <code class="code">3000</code> Hz.
  22140. </p>
  22141. </dd>
  22142. <dt><samp class="option">width_type, t</samp></dt>
  22143. <dd><p>Set method to specify band-width of filter.
  22144. </p><dl class="table">
  22145. <dt><samp class="option">h</samp></dt>
  22146. <dd><p>Hz
  22147. </p></dd>
  22148. <dt><samp class="option">q</samp></dt>
  22149. <dd><p>Q-Factor
  22150. </p></dd>
  22151. <dt><samp class="option">o</samp></dt>
  22152. <dd><p>octave
  22153. </p></dd>
  22154. <dt><samp class="option">s</samp></dt>
  22155. <dd><p>slope
  22156. </p></dd>
  22157. <dt><samp class="option">k</samp></dt>
  22158. <dd><p>kHz
  22159. </p></dd>
  22160. </dl>
  22161. </dd>
  22162. <dt><samp class="option">width, w</samp></dt>
  22163. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  22164. </p>
  22165. </dd>
  22166. <dt><samp class="option">poles, p</samp></dt>
  22167. <dd><p>Set number of poles. Default is 2.
  22168. </p>
  22169. </dd>
  22170. <dt><samp class="option">mix, m</samp></dt>
  22171. <dd><p>How much to use filtered signal in output. Default is 1.
  22172. Range is between 0 and 1.
  22173. </p>
  22174. </dd>
  22175. <dt><samp class="option">channels, c</samp></dt>
  22176. <dd><p>Specify which channels to filter, by default all available are filtered.
  22177. </p>
  22178. </dd>
  22179. <dt><samp class="option">normalize, n</samp></dt>
  22180. <dd><p>Normalize biquad coefficients, by default is disabled.
  22181. Enabling it will normalize magnitude response at DC to 0dB.
  22182. </p>
  22183. </dd>
  22184. <dt><samp class="option">transform, a</samp></dt>
  22185. <dd><p>Set transform type of IIR filter.
  22186. </p><dl class="table">
  22187. <dt><samp class="option">di</samp></dt>
  22188. <dt><samp class="option">dii</samp></dt>
  22189. <dt><samp class="option">tdi</samp></dt>
  22190. <dt><samp class="option">tdii</samp></dt>
  22191. <dt><samp class="option">latt</samp></dt>
  22192. <dt><samp class="option">svf</samp></dt>
  22193. <dt><samp class="option">zdf</samp></dt>
  22194. </dl>
  22195. </dd>
  22196. <dt><samp class="option">precision, r</samp></dt>
  22197. <dd><p>Set precision of filtering.
  22198. </p><dl class="table">
  22199. <dt><samp class="option">auto</samp></dt>
  22200. <dd><p>Pick automatic sample format depending on surround filters.
  22201. </p></dd>
  22202. <dt><samp class="option">s16</samp></dt>
  22203. <dd><p>Always use signed 16-bit.
  22204. </p></dd>
  22205. <dt><samp class="option">s32</samp></dt>
  22206. <dd><p>Always use signed 32-bit.
  22207. </p></dd>
  22208. <dt><samp class="option">f32</samp></dt>
  22209. <dd><p>Always use float 32-bit.
  22210. </p></dd>
  22211. <dt><samp class="option">f64</samp></dt>
  22212. <dd><p>Always use float 64-bit.
  22213. </p></dd>
  22214. </dl>
  22215. </dd>
  22216. <dt><samp class="option">block_size, b</samp></dt>
  22217. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  22218. value (higher than impulse response length truncated when reaches near zero values) filtering
  22219. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  22220. </p>
  22221. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  22222. </p></dd>
  22223. </dl>
  22224. <ul class="mini-toc">
  22225. <li><a href="#Commands-51" accesskey="1">Commands</a></li>
  22226. </ul>
  22227. <div class="subsection-level-extent" id="Commands-51">
  22228. <h4 class="subsection"><span>27.115.1 Commands<a class="copiable-link" href="#Commands-51"> &para;</a></span></h4>
  22229. <p>This filter supports some options as <a class="ref" href="#commands">commands</a>.
  22230. </p>
  22231. </div>
  22232. </div>
  22233. <div class="section-level-extent" id="treble_002c-highshelf">
  22234. <h3 class="section"><span>27.116 treble, highshelf<a class="copiable-link" href="#treble_002c-highshelf"> &para;</a></span></h3>
  22235. <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
  22236. shelving filter with a response similar to that of a standard
  22237. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  22238. </p>
  22239. <p>The filter accepts the following options:
  22240. </p>
  22241. <dl class="table">
  22242. <dt><samp class="option">gain, g</samp></dt>
  22243. <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
  22244. Nyquist frequency. Its useful range is about -20 (for a large cut)
  22245. to +20 (for a large boost). Beware of clipping when using a positive gain.
  22246. </p>
  22247. </dd>
  22248. <dt><samp class="option">frequency, f</samp></dt>
  22249. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  22250. to extend or reduce the frequency range to be boosted or cut.
  22251. The default value is <code class="code">3000</code> Hz.
  22252. </p>
  22253. </dd>
  22254. <dt><samp class="option">width_type, t</samp></dt>
  22255. <dd><p>Set method to specify band-width of filter.
  22256. </p><dl class="table">
  22257. <dt><samp class="option">h</samp></dt>
  22258. <dd><p>Hz
  22259. </p></dd>
  22260. <dt><samp class="option">q</samp></dt>
  22261. <dd><p>Q-Factor
  22262. </p></dd>
  22263. <dt><samp class="option">o</samp></dt>
  22264. <dd><p>octave
  22265. </p></dd>
  22266. <dt><samp class="option">s</samp></dt>
  22267. <dd><p>slope
  22268. </p></dd>
  22269. <dt><samp class="option">k</samp></dt>
  22270. <dd><p>kHz
  22271. </p></dd>
  22272. </dl>
  22273. </dd>
  22274. <dt><samp class="option">width, w</samp></dt>
  22275. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  22276. </p>
  22277. </dd>
  22278. <dt><samp class="option">poles, p</samp></dt>
  22279. <dd><p>Set number of poles. Default is 2.
  22280. </p>
  22281. </dd>
  22282. <dt><samp class="option">mix, m</samp></dt>
  22283. <dd><p>How much to use filtered signal in output. Default is 1.
  22284. Range is between 0 and 1.
  22285. </p>
  22286. </dd>
  22287. <dt><samp class="option">channels, c</samp></dt>
  22288. <dd><p>Specify which channels to filter, by default all available are filtered.
  22289. </p>
  22290. </dd>
  22291. <dt><samp class="option">normalize, n</samp></dt>
  22292. <dd><p>Normalize biquad coefficients, by default is disabled.
  22293. Enabling it will normalize magnitude response at DC to 0dB.
  22294. </p>
  22295. </dd>
  22296. <dt><samp class="option">transform, a</samp></dt>
  22297. <dd><p>Set transform type of IIR filter.
  22298. </p><dl class="table">
  22299. <dt><samp class="option">di</samp></dt>
  22300. <dt><samp class="option">dii</samp></dt>
  22301. <dt><samp class="option">tdi</samp></dt>
  22302. <dt><samp class="option">tdii</samp></dt>
  22303. <dt><samp class="option">latt</samp></dt>
  22304. <dt><samp class="option">svf</samp></dt>
  22305. <dt><samp class="option">zdf</samp></dt>
  22306. </dl>
  22307. </dd>
  22308. <dt><samp class="option">precision, r</samp></dt>
  22309. <dd><p>Set precision of filtering.
  22310. </p><dl class="table">
  22311. <dt><samp class="option">auto</samp></dt>
  22312. <dd><p>Pick automatic sample format depending on surround filters.
  22313. </p></dd>
  22314. <dt><samp class="option">s16</samp></dt>
  22315. <dd><p>Always use signed 16-bit.
  22316. </p></dd>
  22317. <dt><samp class="option">s32</samp></dt>
  22318. <dd><p>Always use signed 32-bit.
  22319. </p></dd>
  22320. <dt><samp class="option">f32</samp></dt>
  22321. <dd><p>Always use float 32-bit.
  22322. </p></dd>
  22323. <dt><samp class="option">f64</samp></dt>
  22324. <dd><p>Always use float 64-bit.
  22325. </p></dd>
  22326. </dl>
  22327. </dd>
  22328. <dt><samp class="option">block_size, b</samp></dt>
  22329. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  22330. value (higher than impulse response length truncated when reaches near zero values) filtering
  22331. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  22332. </p>
  22333. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  22334. </p></dd>
  22335. </dl>
  22336. <ul class="mini-toc">
  22337. <li><a href="#Commands-52" accesskey="1">Commands</a></li>
  22338. </ul>
  22339. <div class="subsection-level-extent" id="Commands-52">
  22340. <h4 class="subsection"><span>27.116.1 Commands<a class="copiable-link" href="#Commands-52"> &para;</a></span></h4>
  22341. <p>This filter supports the following commands:
  22342. </p><dl class="table">
  22343. <dt><samp class="option">frequency, f</samp></dt>
  22344. <dd><p>Change treble frequency.
  22345. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  22346. </p>
  22347. </dd>
  22348. <dt><samp class="option">width_type, t</samp></dt>
  22349. <dd><p>Change treble width_type.
  22350. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  22351. </p>
  22352. </dd>
  22353. <dt><samp class="option">width, w</samp></dt>
  22354. <dd><p>Change treble width.
  22355. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  22356. </p>
  22357. </dd>
  22358. <dt><samp class="option">gain, g</samp></dt>
  22359. <dd><p>Change treble gain.
  22360. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  22361. </p>
  22362. </dd>
  22363. <dt><samp class="option">mix, m</samp></dt>
  22364. <dd><p>Change treble mix.
  22365. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  22366. </p></dd>
  22367. </dl>
  22368. </div>
  22369. </div>
  22370. <div class="section-level-extent" id="tremolo">
  22371. <h3 class="section"><span>27.117 tremolo<a class="copiable-link" href="#tremolo"> &para;</a></span></h3>
  22372. <p>Sinusoidal amplitude modulation.
  22373. </p>
  22374. <p>The filter accepts the following options:
  22375. </p>
  22376. <dl class="table">
  22377. <dt><samp class="option">f</samp></dt>
  22378. <dd><p>Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
  22379. (20 Hz or lower) will result in a tremolo effect.
  22380. This filter may also be used as a ring modulator by specifying
  22381. a modulation frequency higher than 20 Hz.
  22382. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  22383. </p>
  22384. </dd>
  22385. <dt><samp class="option">d</samp></dt>
  22386. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  22387. Default value is 0.5.
  22388. </p></dd>
  22389. </dl>
  22390. </div>
  22391. <div class="section-level-extent" id="vibrato">
  22392. <h3 class="section"><span>27.118 vibrato<a class="copiable-link" href="#vibrato"> &para;</a></span></h3>
  22393. <p>Sinusoidal phase modulation.
  22394. </p>
  22395. <p>The filter accepts the following options:
  22396. </p>
  22397. <dl class="table">
  22398. <dt><samp class="option">f</samp></dt>
  22399. <dd><p>Modulation frequency in Hertz.
  22400. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  22401. </p>
  22402. </dd>
  22403. <dt><samp class="option">d</samp></dt>
  22404. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  22405. Default value is 0.5.
  22406. </p></dd>
  22407. </dl>
  22408. </div>
  22409. <div class="section-level-extent" id="virtualbass">
  22410. <h3 class="section"><span>27.119 virtualbass<a class="copiable-link" href="#virtualbass"> &para;</a></span></h3>
  22411. <p>Apply audio Virtual Bass filter.
  22412. </p>
  22413. <p>This filter accepts stereo input and produce stereo with LFE (2.1) channels output.
  22414. The newly produced LFE channel have enhanced virtual bass originally obtained from both stereo channels.
  22415. This filter outputs front left and front right channels unchanged as available in stereo input.
  22416. </p>
  22417. <p>The filter accepts the following options:
  22418. </p>
  22419. <dl class="table">
  22420. <dt><samp class="option">cutoff</samp></dt>
  22421. <dd><p>Set the virtual bass cutoff frequency. Default value is 250 Hz.
  22422. Allowed range is from 100 to 500 Hz.
  22423. </p>
  22424. </dd>
  22425. <dt><samp class="option">strength</samp></dt>
  22426. <dd><p>Set the virtual bass strength. Allowed range is from 0.5 to 3.
  22427. Default value is 3.
  22428. </p></dd>
  22429. </dl>
  22430. </div>
  22431. <div class="section-level-extent" id="volume">
  22432. <h3 class="section"><span>27.120 volume<a class="copiable-link" href="#volume"> &para;</a></span></h3>
  22433. <p>Adjust the input audio volume.
  22434. </p>
  22435. <p>It accepts the following parameters:
  22436. </p><dl class="table">
  22437. <dt><samp class="option">volume</samp></dt>
  22438. <dd><p>Set audio volume expression.
  22439. </p>
  22440. <p>Output values are clipped to the maximum value.
  22441. </p>
  22442. <p>The output audio volume is given by the relation:
  22443. </p><div class="example">
  22444. <pre class="example-preformatted"><var class="var">output_volume</var> = <var class="var">volume</var> * <var class="var">input_volume</var>
  22445. </pre></div>
  22446. <p>The default value for <var class="var">volume</var> is &quot;1.0&quot;.
  22447. </p>
  22448. </dd>
  22449. <dt><samp class="option">precision</samp></dt>
  22450. <dd><p>This parameter represents the mathematical precision.
  22451. </p>
  22452. <p>It determines which input sample formats will be allowed, which affects the
  22453. precision of the volume scaling.
  22454. </p>
  22455. <dl class="table">
  22456. <dt><samp class="option">fixed</samp></dt>
  22457. <dd><p>8-bit fixed-point; this limits input sample format to U8, S16, and S32.
  22458. </p></dd>
  22459. <dt><samp class="option">float</samp></dt>
  22460. <dd><p>32-bit floating-point; this limits input sample format to FLT. (default)
  22461. </p></dd>
  22462. <dt><samp class="option">double</samp></dt>
  22463. <dd><p>64-bit floating-point; this limits input sample format to DBL.
  22464. </p></dd>
  22465. </dl>
  22466. </dd>
  22467. <dt><samp class="option">replaygain</samp></dt>
  22468. <dd><p>Choose the behaviour on encountering ReplayGain side data in input frames.
  22469. </p>
  22470. <dl class="table">
  22471. <dt><samp class="option">drop</samp></dt>
  22472. <dd><p>Remove ReplayGain side data, ignoring its contents (the default).
  22473. </p>
  22474. </dd>
  22475. <dt><samp class="option">ignore</samp></dt>
  22476. <dd><p>Ignore ReplayGain side data, but leave it in the frame.
  22477. </p>
  22478. </dd>
  22479. <dt><samp class="option">track</samp></dt>
  22480. <dd><p>Prefer the track gain, if present.
  22481. </p>
  22482. </dd>
  22483. <dt><samp class="option">album</samp></dt>
  22484. <dd><p>Prefer the album gain, if present.
  22485. </p></dd>
  22486. </dl>
  22487. </dd>
  22488. <dt><samp class="option">replaygain_preamp</samp></dt>
  22489. <dd><p>Pre-amplification gain in dB to apply to the selected replaygain gain.
  22490. </p>
  22491. <p>Default value for <var class="var">replaygain_preamp</var> is 0.0.
  22492. </p>
  22493. </dd>
  22494. <dt><samp class="option">replaygain_noclip</samp></dt>
  22495. <dd><p>Prevent clipping by limiting the gain applied.
  22496. </p>
  22497. <p>Default value for <var class="var">replaygain_noclip</var> is 1.
  22498. </p>
  22499. </dd>
  22500. <dt><samp class="option">eval</samp></dt>
  22501. <dd><p>Set when the volume expression is evaluated.
  22502. </p>
  22503. <p>It accepts the following values:
  22504. </p><dl class="table">
  22505. <dt>&lsquo;<samp class="samp">once</samp>&rsquo;</dt>
  22506. <dd><p>only evaluate expression once during the filter initialization, or
  22507. when the &lsquo;<samp class="samp">volume</samp>&rsquo; command is sent
  22508. </p>
  22509. </dd>
  22510. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  22511. <dd><p>evaluate expression for each incoming frame
  22512. </p></dd>
  22513. </dl>
  22514. <p>Default value is &lsquo;<samp class="samp">once</samp>&rsquo;.
  22515. </p></dd>
  22516. </dl>
  22517. <p>The volume expression can contain the following parameters.
  22518. </p>
  22519. <dl class="table">
  22520. <dt><samp class="option">n</samp></dt>
  22521. <dd><p>frame number (starting at zero)
  22522. </p></dd>
  22523. <dt><samp class="option">nb_channels</samp></dt>
  22524. <dd><p>number of channels
  22525. </p></dd>
  22526. <dt><samp class="option">nb_consumed_samples</samp></dt>
  22527. <dd><p>number of samples consumed by the filter
  22528. </p></dd>
  22529. <dt><samp class="option">nb_samples</samp></dt>
  22530. <dd><p>number of samples in the current frame
  22531. </p></dd>
  22532. <dt><samp class="option">pos</samp></dt>
  22533. <dd><p>original frame position in the file; deprecated, do not use
  22534. </p></dd>
  22535. <dt><samp class="option">pts</samp></dt>
  22536. <dd><p>frame PTS
  22537. </p></dd>
  22538. <dt><samp class="option">sample_rate</samp></dt>
  22539. <dd><p>sample rate
  22540. </p></dd>
  22541. <dt><samp class="option">startpts</samp></dt>
  22542. <dd><p>PTS at start of stream
  22543. </p></dd>
  22544. <dt><samp class="option">startt</samp></dt>
  22545. <dd><p>time at start of stream
  22546. </p></dd>
  22547. <dt><samp class="option">t</samp></dt>
  22548. <dd><p>frame time
  22549. </p></dd>
  22550. <dt><samp class="option">tb</samp></dt>
  22551. <dd><p>timestamp timebase
  22552. </p></dd>
  22553. <dt><samp class="option">volume</samp></dt>
  22554. <dd><p>last set volume value
  22555. </p></dd>
  22556. </dl>
  22557. <p>Note that when <samp class="option">eval</samp> is set to &lsquo;<samp class="samp">once</samp>&rsquo; only the
  22558. <var class="var">sample_rate</var> and <var class="var">tb</var> variables are available, all other
  22559. variables will evaluate to NAN.
  22560. </p>
  22561. <ul class="mini-toc">
  22562. <li><a href="#Commands-53" accesskey="1">Commands</a></li>
  22563. <li><a href="#Examples-52" accesskey="2">Examples</a></li>
  22564. </ul>
  22565. <div class="subsection-level-extent" id="Commands-53">
  22566. <h4 class="subsection"><span>27.120.1 Commands<a class="copiable-link" href="#Commands-53"> &para;</a></span></h4>
  22567. <p>This filter supports the following commands:
  22568. </p><dl class="table">
  22569. <dt><samp class="option">volume</samp></dt>
  22570. <dd><p>Modify the volume expression.
  22571. The command accepts the same syntax of the corresponding option.
  22572. </p>
  22573. <p>If the specified expression is not valid, it is kept at its current
  22574. value.
  22575. </p></dd>
  22576. </dl>
  22577. </div>
  22578. <div class="subsection-level-extent" id="Examples-52">
  22579. <h4 class="subsection"><span>27.120.2 Examples<a class="copiable-link" href="#Examples-52"> &para;</a></span></h4>
  22580. <ul class="itemize mark-bullet">
  22581. <li>Halve the input audio volume:
  22582. <div class="example">
  22583. <pre class="example-preformatted">volume=volume=0.5
  22584. volume=volume=1/2
  22585. volume=volume=-6.0206dB
  22586. </pre></div>
  22587. <p>In all the above example the named key for <samp class="option">volume</samp> can be
  22588. omitted, for example like in:
  22589. </p><div class="example">
  22590. <pre class="example-preformatted">volume=0.5
  22591. </pre></div>
  22592. </li><li>Increase input audio power by 6 decibels using fixed-point precision:
  22593. <div class="example">
  22594. <pre class="example-preformatted">volume=volume=6dB:precision=fixed
  22595. </pre></div>
  22596. </li><li>Fade volume after time 10 with an annihilation period of 5 seconds:
  22597. <div class="example">
  22598. <pre class="example-preformatted">volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
  22599. </pre></div>
  22600. </li></ul>
  22601. </div>
  22602. </div>
  22603. <div class="section-level-extent" id="volumedetect">
  22604. <h3 class="section"><span>27.121 volumedetect<a class="copiable-link" href="#volumedetect"> &para;</a></span></h3>
  22605. <p>Detect the volume of the input video.
  22606. </p>
  22607. <p>The filter has no parameters. It supports only 16-bit signed integer samples,
  22608. so the input will be converted when needed. Statistics about the volume will
  22609. be printed in the log when the input stream end is reached.
  22610. </p>
  22611. <p>In particular it will show the mean volume (root mean square), maximum
  22612. volume (on a per-sample basis), and the beginning of a histogram of the
  22613. registered volume values (from the maximum value to a cumulated 1/1000 of
  22614. the samples).
  22615. </p>
  22616. <p>All volumes are in decibels relative to the maximum PCM value.
  22617. </p>
  22618. <ul class="mini-toc">
  22619. <li><a href="#Examples-53" accesskey="1">Examples</a></li>
  22620. </ul>
  22621. <div class="subsection-level-extent" id="Examples-53">
  22622. <h4 class="subsection"><span>27.121.1 Examples<a class="copiable-link" href="#Examples-53"> &para;</a></span></h4>
  22623. <p>Here is an excerpt of the output:
  22624. </p><div class="example">
  22625. <pre class="example-preformatted">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
  22626. [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
  22627. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
  22628. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
  22629. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
  22630. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
  22631. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
  22632. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
  22633. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
  22634. </pre></div>
  22635. <p>It means that:
  22636. </p><ul class="itemize mark-bullet">
  22637. <li>The mean square energy is approximately -27 dB, or 10^-2.7.
  22638. </li><li>The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
  22639. </li><li>There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
  22640. </li></ul>
  22641. <p>In other words, raising the volume by +4 dB does not cause any clipping,
  22642. raising it by +5 dB causes clipping for 6 samples, etc.
  22643. </p>
  22644. </div>
  22645. </div>
  22646. </div>
  22647. <div class="chapter-level-extent" id="Audio-Sources">
  22648. <h2 class="chapter"><span>28 Audio Sources<a class="copiable-link" href="#Audio-Sources"> &para;</a></span></h2>
  22649. <p>Below is a description of the currently available audio sources.
  22650. </p>
  22651. <ul class="mini-toc">
  22652. <li><a href="#abuffer" accesskey="1">abuffer</a></li>
  22653. <li><a href="#aevalsrc" accesskey="2">aevalsrc</a></li>
  22654. <li><a href="#afdelaysrc" accesskey="3">afdelaysrc</a></li>
  22655. <li><a href="#afireqsrc" accesskey="4">afireqsrc</a></li>
  22656. <li><a href="#afirsrc" accesskey="5">afirsrc</a></li>
  22657. <li><a href="#anullsrc" accesskey="6">anullsrc</a></li>
  22658. <li><a href="#flite" accesskey="7">flite</a></li>
  22659. <li><a href="#anoisesrc" accesskey="8">anoisesrc</a></li>
  22660. <li><a href="#hilbert" accesskey="9">hilbert</a></li>
  22661. <li><a href="#sinc">sinc</a></li>
  22662. <li><a href="#sine">sine</a></li>
  22663. </ul>
  22664. <div class="section-level-extent" id="abuffer">
  22665. <h3 class="section"><span>28.1 abuffer<a class="copiable-link" href="#abuffer"> &para;</a></span></h3>
  22666. <p>Buffer audio frames, and make them available to the filter chain.
  22667. </p>
  22668. <p>This source is mainly intended for a programmatic use, in particular
  22669. through the interface defined in <samp class="file">libavfilter/buffersrc.h</samp>.
  22670. </p>
  22671. <p>It accepts the following parameters:
  22672. </p><dl class="table">
  22673. <dt><samp class="option">time_base</samp></dt>
  22674. <dd><p>The timebase which will be used for timestamps of submitted frames. It must be
  22675. either a floating-point number or in <var class="var">numerator</var>/<var class="var">denominator</var> form.
  22676. </p>
  22677. </dd>
  22678. <dt><samp class="option">sample_rate</samp></dt>
  22679. <dd><p>The sample rate of the incoming audio buffers.
  22680. </p>
  22681. </dd>
  22682. <dt><samp class="option">sample_fmt</samp></dt>
  22683. <dd><p>The sample format of the incoming audio buffers.
  22684. Either a sample format name or its corresponding integer representation from
  22685. the enum AVSampleFormat in <samp class="file">libavutil/samplefmt.h</samp>
  22686. </p>
  22687. </dd>
  22688. <dt><samp class="option">channel_layout</samp></dt>
  22689. <dd><p>The channel layout of the incoming audio buffers.
  22690. Either a channel layout name from channel_layout_map in
  22691. <samp class="file">libavutil/channel_layout.c</samp> or its corresponding integer representation
  22692. from the AV_CH_LAYOUT_* macros in <samp class="file">libavutil/channel_layout.h</samp>
  22693. </p>
  22694. </dd>
  22695. <dt><samp class="option">channels</samp></dt>
  22696. <dd><p>The number of channels of the incoming audio buffers.
  22697. If both <var class="var">channels</var> and <var class="var">channel_layout</var> are specified, then they
  22698. must be consistent.
  22699. </p>
  22700. </dd>
  22701. </dl>
  22702. <ul class="mini-toc">
  22703. <li><a href="#Examples-54" accesskey="1">Examples</a></li>
  22704. </ul>
  22705. <div class="subsection-level-extent" id="Examples-54">
  22706. <h4 class="subsection"><span>28.1.1 Examples<a class="copiable-link" href="#Examples-54"> &para;</a></span></h4>
  22707. <div class="example">
  22708. <pre class="example-preformatted">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
  22709. </pre></div>
  22710. <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
  22711. Since the sample format with name &quot;s16p&quot; corresponds to the number
  22712. 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
  22713. equivalent to:
  22714. </p><div class="example">
  22715. <pre class="example-preformatted">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
  22716. </pre></div>
  22717. </div>
  22718. </div>
  22719. <div class="section-level-extent" id="aevalsrc">
  22720. <h3 class="section"><span>28.2 aevalsrc<a class="copiable-link" href="#aevalsrc"> &para;</a></span></h3>
  22721. <p>Generate an audio signal specified by an expression.
  22722. </p>
  22723. <p>This source accepts in input one or more expressions (one for each
  22724. channel), which are evaluated and used to generate a corresponding
  22725. audio signal.
  22726. </p>
  22727. <p>This source accepts the following options:
  22728. </p>
  22729. <dl class="table">
  22730. <dt><samp class="option">exprs</samp></dt>
  22731. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
  22732. <samp class="option">channel_layout</samp> option is not specified, the selected channel layout
  22733. depends on the number of provided expressions. Otherwise the last
  22734. specified expression is applied to the remaining output channels.
  22735. </p>
  22736. </dd>
  22737. <dt><samp class="option">channel_layout, c</samp></dt>
  22738. <dd><p>Set the channel layout. The number of channels in the specified layout
  22739. must be equal to the number of specified expressions.
  22740. </p>
  22741. </dd>
  22742. <dt><samp class="option">duration, d</samp></dt>
  22743. <dd><p>Set the minimum duration of the sourced audio. See
  22744. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  22745. for the accepted syntax.
  22746. Note that the resulting duration may be greater than the specified
  22747. duration, as the generated audio is always cut at the end of a
  22748. complete frame.
  22749. </p>
  22750. <p>If not specified, or the expressed duration is negative, the audio is
  22751. supposed to be generated forever.
  22752. </p>
  22753. </dd>
  22754. <dt><samp class="option">nb_samples, n</samp></dt>
  22755. <dd><p>Set the number of samples per channel per each output frame,
  22756. default to 1024.
  22757. </p>
  22758. </dd>
  22759. <dt><samp class="option">sample_rate, s</samp></dt>
  22760. <dd><p>Specify the sample rate, default to 44100.
  22761. </p></dd>
  22762. </dl>
  22763. <p>Each expression in <var class="var">exprs</var> can contain the following constants:
  22764. </p>
  22765. <dl class="table">
  22766. <dt><samp class="option">n</samp></dt>
  22767. <dd><p>number of the evaluated sample, starting from 0
  22768. </p>
  22769. </dd>
  22770. <dt><samp class="option">t</samp></dt>
  22771. <dd><p>time of the evaluated sample expressed in seconds, starting from 0
  22772. </p>
  22773. </dd>
  22774. <dt><samp class="option">s</samp></dt>
  22775. <dd><p>sample rate
  22776. </p>
  22777. </dd>
  22778. </dl>
  22779. <ul class="mini-toc">
  22780. <li><a href="#Examples-55" accesskey="1">Examples</a></li>
  22781. </ul>
  22782. <div class="subsection-level-extent" id="Examples-55">
  22783. <h4 class="subsection"><span>28.2.1 Examples<a class="copiable-link" href="#Examples-55"> &para;</a></span></h4>
  22784. <ul class="itemize mark-bullet">
  22785. <li>Generate silence:
  22786. <div class="example">
  22787. <pre class="example-preformatted">aevalsrc=0
  22788. </pre></div>
  22789. </li><li>Generate a sin signal with frequency of 440 Hz, set sample rate to
  22790. 8000 Hz:
  22791. <div class="example">
  22792. <pre class="example-preformatted">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
  22793. </pre></div>
  22794. </li><li>Generate a two channels signal, specify the channel layout (Front
  22795. Center + Back Center) explicitly:
  22796. <div class="example">
  22797. <pre class="example-preformatted">aevalsrc=&quot;sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC&quot;
  22798. </pre></div>
  22799. </li><li>Generate white noise:
  22800. <div class="example">
  22801. <pre class="example-preformatted">aevalsrc=&quot;-2+random(0)&quot;
  22802. </pre></div>
  22803. </li><li>Generate an amplitude modulated signal:
  22804. <div class="example">
  22805. <pre class="example-preformatted">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
  22806. </pre></div>
  22807. </li><li>Generate 2.5 Hz binaural beats on a 360 Hz carrier:
  22808. <div class="example">
  22809. <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;
  22810. </pre></div>
  22811. </li></ul>
  22812. </div>
  22813. </div>
  22814. <div class="section-level-extent" id="afdelaysrc">
  22815. <h3 class="section"><span>28.3 afdelaysrc<a class="copiable-link" href="#afdelaysrc"> &para;</a></span></h3>
  22816. <p>Generate a fractional delay FIR coefficients.
  22817. </p>
  22818. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  22819. </p>
  22820. <p>The filter accepts the following options:
  22821. </p>
  22822. <dl class="table">
  22823. <dt><samp class="option">delay, d</samp></dt>
  22824. <dd><p>Set the fractional delay. Default is 0.
  22825. </p>
  22826. </dd>
  22827. <dt><samp class="option">sample_rate, r</samp></dt>
  22828. <dd><p>Set the sample rate, default is 44100.
  22829. </p>
  22830. </dd>
  22831. <dt><samp class="option">nb_samples, n</samp></dt>
  22832. <dd><p>Set the number of samples per each frame. Default is 1024.
  22833. </p>
  22834. </dd>
  22835. <dt><samp class="option">taps, t</samp></dt>
  22836. <dd><p>Set the number of filter coefficients in output audio stream.
  22837. Default value is 0.
  22838. </p>
  22839. </dd>
  22840. <dt><samp class="option">channel_layout, c</samp></dt>
  22841. <dd><p>Specifies the channel layout, and can be a string representing a channel layout.
  22842. The default value of <var class="var">channel_layout</var> is &quot;stereo&quot;.
  22843. </p></dd>
  22844. </dl>
  22845. </div>
  22846. <div class="section-level-extent" id="afireqsrc">
  22847. <h3 class="section"><span>28.4 afireqsrc<a class="copiable-link" href="#afireqsrc"> &para;</a></span></h3>
  22848. <p>Generate a FIR equalizer coefficients.
  22849. </p>
  22850. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  22851. </p>
  22852. <p>The filter accepts the following options:
  22853. </p>
  22854. <dl class="table">
  22855. <dt><samp class="option">preset, p</samp></dt>
  22856. <dd><p>Set equalizer preset.
  22857. Default preset is <code class="code">flat</code>.
  22858. </p>
  22859. <p>Available presets are:
  22860. </p><dl class="table">
  22861. <dt>&lsquo;<samp class="samp">custom</samp>&rsquo;</dt>
  22862. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  22863. <dt>&lsquo;<samp class="samp">acoustic</samp>&rsquo;</dt>
  22864. <dt>&lsquo;<samp class="samp">bass</samp>&rsquo;</dt>
  22865. <dt>&lsquo;<samp class="samp">beats</samp>&rsquo;</dt>
  22866. <dt>&lsquo;<samp class="samp">classic</samp>&rsquo;</dt>
  22867. <dt>&lsquo;<samp class="samp">clear</samp>&rsquo;</dt>
  22868. <dt>&lsquo;<samp class="samp">deep bass</samp>&rsquo;</dt>
  22869. <dt>&lsquo;<samp class="samp">dubstep</samp>&rsquo;</dt>
  22870. <dt>&lsquo;<samp class="samp">electronic</samp>&rsquo;</dt>
  22871. <dt>&lsquo;<samp class="samp">hard-style</samp>&rsquo;</dt>
  22872. <dt>&lsquo;<samp class="samp">hip-hop</samp>&rsquo;</dt>
  22873. <dt>&lsquo;<samp class="samp">jazz</samp>&rsquo;</dt>
  22874. <dt>&lsquo;<samp class="samp">metal</samp>&rsquo;</dt>
  22875. <dt>&lsquo;<samp class="samp">movie</samp>&rsquo;</dt>
  22876. <dt>&lsquo;<samp class="samp">pop</samp>&rsquo;</dt>
  22877. <dt>&lsquo;<samp class="samp">r&amp;b</samp>&rsquo;</dt>
  22878. <dt>&lsquo;<samp class="samp">rock</samp>&rsquo;</dt>
  22879. <dt>&lsquo;<samp class="samp">vocal booster</samp>&rsquo;</dt>
  22880. </dl>
  22881. </dd>
  22882. <dt><samp class="option">gains, g</samp></dt>
  22883. <dd><p>Set custom gains for each band. Only used if the preset option is set to <code class="code">custom</code>.
  22884. Gains are separated by white spaces and each gain is set in dBFS.
  22885. Default is <code class="code">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</code>.
  22886. </p>
  22887. </dd>
  22888. <dt><samp class="option">bands, b</samp></dt>
  22889. <dd><p>Set the custom bands from where custon equalizer gains are set.
  22890. This must be in strictly increasing order. Only used if the preset option is set to <code class="code">custom</code>.
  22891. Bands are separated by white spaces and each band represent frequency in Hz.
  22892. Default is <code class="code">25 40 63 100 160 250 400 630 1000 1600 2500 4000 6300 10000 16000 24000</code>.
  22893. </p>
  22894. </dd>
  22895. <dt><samp class="option">taps, t</samp></dt>
  22896. <dd><p>Set number of filter coefficients in output audio stream.
  22897. Default value is <code class="code">4096</code>.
  22898. </p>
  22899. </dd>
  22900. <dt><samp class="option">sample_rate, r</samp></dt>
  22901. <dd><p>Set sample rate of output audio stream, default is <code class="code">44100</code>.
  22902. </p>
  22903. </dd>
  22904. <dt><samp class="option">nb_samples, n</samp></dt>
  22905. <dd><p>Set number of samples per each frame in output audio stream. Default is <code class="code">1024</code>.
  22906. </p>
  22907. </dd>
  22908. <dt><samp class="option">interp, i</samp></dt>
  22909. <dd><p>Set interpolation method for FIR equalizer coefficients. Can be <code class="code">linear</code> or <code class="code">cubic</code>.
  22910. </p>
  22911. </dd>
  22912. <dt><samp class="option">phase, h</samp></dt>
  22913. <dd><p>Set phase type of FIR filter. Can be <code class="code">linear</code> or <code class="code">min</code>: minimum-phase.
  22914. Default is minimum-phase filter.
  22915. </p></dd>
  22916. </dl>
  22917. </div>
  22918. <div class="section-level-extent" id="afirsrc">
  22919. <h3 class="section"><span>28.5 afirsrc<a class="copiable-link" href="#afirsrc"> &para;</a></span></h3>
  22920. <p>Generate a FIR coefficients using frequency sampling method.
  22921. </p>
  22922. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  22923. </p>
  22924. <p>The filter accepts the following options:
  22925. </p>
  22926. <dl class="table">
  22927. <dt><samp class="option">taps, t</samp></dt>
  22928. <dd><p>Set number of filter coefficients in output audio stream.
  22929. Default value is 1025.
  22930. </p>
  22931. </dd>
  22932. <dt><samp class="option">frequency, f</samp></dt>
  22933. <dd><p>Set frequency points from where magnitude and phase are set.
  22934. This must be in non decreasing order, and first element must be 0, while last element
  22935. must be 1. Elements are separated by white spaces.
  22936. </p>
  22937. </dd>
  22938. <dt><samp class="option">magnitude, m</samp></dt>
  22939. <dd><p>Set magnitude value for every frequency point set by <samp class="option">frequency</samp>.
  22940. Number of values must be same as number of frequency points.
  22941. Values are separated by white spaces.
  22942. </p>
  22943. </dd>
  22944. <dt><samp class="option">phase, p</samp></dt>
  22945. <dd><p>Set phase value for every frequency point set by <samp class="option">frequency</samp>.
  22946. Number of values must be same as number of frequency points.
  22947. Values are separated by white spaces.
  22948. </p>
  22949. </dd>
  22950. <dt><samp class="option">sample_rate, r</samp></dt>
  22951. <dd><p>Set sample rate, default is 44100.
  22952. </p>
  22953. </dd>
  22954. <dt><samp class="option">nb_samples, n</samp></dt>
  22955. <dd><p>Set number of samples per each frame. Default is 1024.
  22956. </p>
  22957. </dd>
  22958. <dt><samp class="option">win_func, w</samp></dt>
  22959. <dd><p>Set window function. Default is blackman.
  22960. </p></dd>
  22961. </dl>
  22962. </div>
  22963. <div class="section-level-extent" id="anullsrc">
  22964. <h3 class="section"><span>28.6 anullsrc<a class="copiable-link" href="#anullsrc"> &para;</a></span></h3>
  22965. <p>The null audio source, return unprocessed audio frames. It is mainly useful
  22966. as a template and to be employed in analysis / debugging tools, or as
  22967. the source for filters which ignore the input data (for example the sox
  22968. synth filter).
  22969. </p>
  22970. <p>This source accepts the following options:
  22971. </p>
  22972. <dl class="table">
  22973. <dt><samp class="option">channel_layout, cl</samp></dt>
  22974. <dd>
  22975. <p>Specifies the channel layout, and can be either an integer or a string
  22976. representing a channel layout. The default value of <var class="var">channel_layout</var>
  22977. is &quot;stereo&quot;.
  22978. </p>
  22979. <p>Check the channel_layout_map definition in
  22980. <samp class="file">libavutil/channel_layout.c</samp> for the mapping between strings and
  22981. channel layout values.
  22982. </p>
  22983. </dd>
  22984. <dt><samp class="option">sample_rate, r</samp></dt>
  22985. <dd><p>Specifies the sample rate, and defaults to 44100.
  22986. </p>
  22987. </dd>
  22988. <dt><samp class="option">nb_samples, n</samp></dt>
  22989. <dd><p>Set the number of samples per requested frames.
  22990. </p>
  22991. </dd>
  22992. <dt><samp class="option">duration, d</samp></dt>
  22993. <dd><p>Set the duration of the sourced audio. See
  22994. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  22995. for the accepted syntax.
  22996. </p>
  22997. <p>If not specified, or the expressed duration is negative, the audio is
  22998. supposed to be generated forever.
  22999. </p></dd>
  23000. </dl>
  23001. <ul class="mini-toc">
  23002. <li><a href="#Examples-56" accesskey="1">Examples</a></li>
  23003. </ul>
  23004. <div class="subsection-level-extent" id="Examples-56">
  23005. <h4 class="subsection"><span>28.6.1 Examples<a class="copiable-link" href="#Examples-56"> &para;</a></span></h4>
  23006. <ul class="itemize mark-bullet">
  23007. <li>Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
  23008. <div class="example">
  23009. <pre class="example-preformatted">anullsrc=r=48000:cl=4
  23010. </pre></div>
  23011. </li><li>Do the same operation with a more obvious syntax:
  23012. <div class="example">
  23013. <pre class="example-preformatted">anullsrc=r=48000:cl=mono
  23014. </pre></div>
  23015. </li></ul>
  23016. <p>All the parameters need to be explicitly defined.
  23017. </p>
  23018. </div>
  23019. </div>
  23020. <div class="section-level-extent" id="flite">
  23021. <h3 class="section"><span>28.7 flite<a class="copiable-link" href="#flite"> &para;</a></span></h3>
  23022. <p>Synthesize a voice utterance using the libflite library.
  23023. </p>
  23024. <p>To enable compilation of this filter you need to configure FFmpeg with
  23025. <code class="code">--enable-libflite</code>.
  23026. </p>
  23027. <p>Note that versions of the flite library prior to 2.0 are not thread-safe.
  23028. </p>
  23029. <p>The filter accepts the following options:
  23030. </p>
  23031. <dl class="table">
  23032. <dt><samp class="option">list_voices</samp></dt>
  23033. <dd><p>If set to 1, list the names of the available voices and exit
  23034. immediately. Default value is 0.
  23035. </p>
  23036. </dd>
  23037. <dt><samp class="option">nb_samples, n</samp></dt>
  23038. <dd><p>Set the maximum number of samples per frame. Default value is 512.
  23039. </p>
  23040. </dd>
  23041. <dt><samp class="option">textfile</samp></dt>
  23042. <dd><p>Set the filename containing the text to speak.
  23043. </p>
  23044. </dd>
  23045. <dt><samp class="option">text</samp></dt>
  23046. <dd><p>Set the text to speak.
  23047. </p>
  23048. </dd>
  23049. <dt><samp class="option">voice, v</samp></dt>
  23050. <dd><p>Set the voice to use for the speech synthesis. Default value is
  23051. <code class="code">kal</code>. See also the <var class="var">list_voices</var> option.
  23052. </p></dd>
  23053. </dl>
  23054. <ul class="mini-toc">
  23055. <li><a href="#Examples-57" accesskey="1">Examples</a></li>
  23056. </ul>
  23057. <div class="subsection-level-extent" id="Examples-57">
  23058. <h4 class="subsection"><span>28.7.1 Examples<a class="copiable-link" href="#Examples-57"> &para;</a></span></h4>
  23059. <ul class="itemize mark-bullet">
  23060. <li>Read from file <samp class="file">speech.txt</samp>, and synthesize the text using the
  23061. standard flite voice:
  23062. <div class="example">
  23063. <pre class="example-preformatted">flite=textfile=speech.txt
  23064. </pre></div>
  23065. </li><li>Read the specified text selecting the <code class="code">slt</code> voice:
  23066. <div class="example">
  23067. <pre class="example-preformatted">flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  23068. </pre></div>
  23069. </li><li>Input text to ffmpeg:
  23070. <div class="example">
  23071. <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
  23072. </pre></div>
  23073. </li><li>Make <samp class="file">ffplay</samp> speak the specified text, using <code class="code">flite</code> and
  23074. the <code class="code">lavfi</code> device:
  23075. <div class="example">
  23076. <pre class="example-preformatted">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
  23077. </pre></div>
  23078. </li></ul>
  23079. <p>For more information about libflite, check:
  23080. <a class="url" href="http://www.festvox.org/flite/">http://www.festvox.org/flite/</a>
  23081. </p>
  23082. </div>
  23083. </div>
  23084. <div class="section-level-extent" id="anoisesrc">
  23085. <h3 class="section"><span>28.8 anoisesrc<a class="copiable-link" href="#anoisesrc"> &para;</a></span></h3>
  23086. <p>Generate a noise audio signal.
  23087. </p>
  23088. <p>The filter accepts the following options:
  23089. </p>
  23090. <dl class="table">
  23091. <dt><samp class="option">sample_rate, r</samp></dt>
  23092. <dd><p>Specify the sample rate. Default value is 48000 Hz.
  23093. </p>
  23094. </dd>
  23095. <dt><samp class="option">amplitude, a</samp></dt>
  23096. <dd><p>Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value
  23097. is 1.0.
  23098. </p>
  23099. </dd>
  23100. <dt><samp class="option">duration, d</samp></dt>
  23101. <dd><p>Specify the duration of the generated audio stream. Not specifying this option
  23102. results in noise with an infinite length.
  23103. </p>
  23104. </dd>
  23105. <dt><samp class="option">color, colour, c</samp></dt>
  23106. <dd><p>Specify the color of noise. Available noise colors are white, pink, brown,
  23107. blue, violet and velvet. Default color is white.
  23108. </p>
  23109. </dd>
  23110. <dt><samp class="option">seed, s</samp></dt>
  23111. <dd><p>Specify a value used to seed the PRNG.
  23112. </p>
  23113. </dd>
  23114. <dt><samp class="option">nb_samples, n</samp></dt>
  23115. <dd><p>Set the number of samples per each output frame, default is 1024.
  23116. </p>
  23117. </dd>
  23118. <dt><samp class="option">density</samp></dt>
  23119. <dd><p>Set the density (0.0 - 1.0) for the velvet noise generator, default is 0.05.
  23120. </p></dd>
  23121. </dl>
  23122. <ul class="mini-toc">
  23123. <li><a href="#Examples-58" accesskey="1">Examples</a></li>
  23124. </ul>
  23125. <div class="subsection-level-extent" id="Examples-58">
  23126. <h4 class="subsection"><span>28.8.1 Examples<a class="copiable-link" href="#Examples-58"> &para;</a></span></h4>
  23127. <ul class="itemize mark-bullet">
  23128. <li>Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5:
  23129. <div class="example">
  23130. <pre class="example-preformatted">anoisesrc=d=60:c=pink:r=44100:a=0.5
  23131. </pre></div>
  23132. </li></ul>
  23133. </div>
  23134. </div>
  23135. <div class="section-level-extent" id="hilbert">
  23136. <h3 class="section"><span>28.9 hilbert<a class="copiable-link" href="#hilbert"> &para;</a></span></h3>
  23137. <p>Generate odd-tap Hilbert transform FIR coefficients.
  23138. </p>
  23139. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for phase-shifting
  23140. the signal by 90 degrees.
  23141. </p>
  23142. <p>This is used in many matrix coding schemes and for analytic signal generation.
  23143. The process is often written as a multiplication by i (or j), the imaginary unit.
  23144. </p>
  23145. <p>The filter accepts the following options:
  23146. </p>
  23147. <dl class="table">
  23148. <dt><samp class="option">sample_rate, s</samp></dt>
  23149. <dd><p>Set sample rate, default is 44100.
  23150. </p>
  23151. </dd>
  23152. <dt><samp class="option">taps, t</samp></dt>
  23153. <dd><p>Set length of FIR filter, default is 22051.
  23154. </p>
  23155. </dd>
  23156. <dt><samp class="option">nb_samples, n</samp></dt>
  23157. <dd><p>Set number of samples per each frame.
  23158. </p>
  23159. </dd>
  23160. <dt><samp class="option">win_func, w</samp></dt>
  23161. <dd><p>Set window function to be used when generating FIR coefficients.
  23162. </p></dd>
  23163. </dl>
  23164. </div>
  23165. <div class="section-level-extent" id="sinc">
  23166. <h3 class="section"><span>28.10 sinc<a class="copiable-link" href="#sinc"> &para;</a></span></h3>
  23167. <p>Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients.
  23168. </p>
  23169. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  23170. </p>
  23171. <p>The filter accepts the following options:
  23172. </p>
  23173. <dl class="table">
  23174. <dt><samp class="option">sample_rate, r</samp></dt>
  23175. <dd><p>Set sample rate, default is 44100.
  23176. </p>
  23177. </dd>
  23178. <dt><samp class="option">nb_samples, n</samp></dt>
  23179. <dd><p>Set number of samples per each frame. Default is 1024.
  23180. </p>
  23181. </dd>
  23182. <dt><samp class="option">hp</samp></dt>
  23183. <dd><p>Set high-pass frequency. Default is 0.
  23184. </p>
  23185. </dd>
  23186. <dt><samp class="option">lp</samp></dt>
  23187. <dd><p>Set low-pass frequency. Default is 0.
  23188. If high-pass frequency is lower than low-pass frequency and low-pass frequency
  23189. is higher than 0 then filter will create band-pass filter coefficients,
  23190. otherwise band-reject filter coefficients.
  23191. </p>
  23192. </dd>
  23193. <dt><samp class="option">phase</samp></dt>
  23194. <dd><p>Set filter phase response. Default is 50. Allowed range is from 0 to 100.
  23195. </p>
  23196. </dd>
  23197. <dt><samp class="option">beta</samp></dt>
  23198. <dd><p>Set Kaiser window beta.
  23199. </p>
  23200. </dd>
  23201. <dt><samp class="option">att</samp></dt>
  23202. <dd><p>Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB.
  23203. </p>
  23204. </dd>
  23205. <dt><samp class="option">round</samp></dt>
  23206. <dd><p>Enable rounding, by default is disabled.
  23207. </p>
  23208. </dd>
  23209. <dt><samp class="option">hptaps</samp></dt>
  23210. <dd><p>Set number of taps for high-pass filter.
  23211. </p>
  23212. </dd>
  23213. <dt><samp class="option">lptaps</samp></dt>
  23214. <dd><p>Set number of taps for low-pass filter.
  23215. </p></dd>
  23216. </dl>
  23217. </div>
  23218. <div class="section-level-extent" id="sine">
  23219. <h3 class="section"><span>28.11 sine<a class="copiable-link" href="#sine"> &para;</a></span></h3>
  23220. <p>Generate an audio signal made of a sine wave with amplitude 1/8.
  23221. </p>
  23222. <p>The audio signal is bit-exact.
  23223. </p>
  23224. <p>The filter accepts the following options:
  23225. </p>
  23226. <dl class="table">
  23227. <dt><samp class="option">frequency, f</samp></dt>
  23228. <dd><p>Set the carrier frequency. Default is 440 Hz.
  23229. </p>
  23230. </dd>
  23231. <dt><samp class="option">beep_factor, b</samp></dt>
  23232. <dd><p>Enable a periodic beep every second with frequency <var class="var">beep_factor</var> times
  23233. the carrier frequency. Default is 0, meaning the beep is disabled.
  23234. </p>
  23235. </dd>
  23236. <dt><samp class="option">sample_rate, r</samp></dt>
  23237. <dd><p>Specify the sample rate, default is 44100.
  23238. </p>
  23239. </dd>
  23240. <dt><samp class="option">duration, d</samp></dt>
  23241. <dd><p>Specify the duration of the generated audio stream.
  23242. </p>
  23243. </dd>
  23244. <dt><samp class="option">samples_per_frame</samp></dt>
  23245. <dd><p>Set the number of samples per output frame.
  23246. </p>
  23247. <p>The expression can contain the following constants:
  23248. </p>
  23249. <dl class="table">
  23250. <dt><samp class="option">n</samp></dt>
  23251. <dd><p>The (sequential) number of the output audio frame, starting from 0.
  23252. </p>
  23253. </dd>
  23254. <dt><samp class="option">pts</samp></dt>
  23255. <dd><p>The PTS (Presentation TimeStamp) of the output audio frame,
  23256. expressed in <var class="var">TB</var> units.
  23257. </p>
  23258. </dd>
  23259. <dt><samp class="option">t</samp></dt>
  23260. <dd><p>The PTS of the output audio frame, expressed in seconds.
  23261. </p>
  23262. </dd>
  23263. <dt><samp class="option">TB</samp></dt>
  23264. <dd><p>The timebase of the output audio frames.
  23265. </p></dd>
  23266. </dl>
  23267. <p>Default is <code class="code">1024</code>.
  23268. </p></dd>
  23269. </dl>
  23270. <ul class="mini-toc">
  23271. <li><a href="#Examples-59" accesskey="1">Examples</a></li>
  23272. </ul>
  23273. <div class="subsection-level-extent" id="Examples-59">
  23274. <h4 class="subsection"><span>28.11.1 Examples<a class="copiable-link" href="#Examples-59"> &para;</a></span></h4>
  23275. <ul class="itemize mark-bullet">
  23276. <li>Generate a simple 440 Hz sine wave:
  23277. <div class="example">
  23278. <pre class="example-preformatted">sine
  23279. </pre></div>
  23280. </li><li>Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
  23281. <div class="example">
  23282. <pre class="example-preformatted">sine=220:4:d=5
  23283. sine=f=220:b=4:d=5
  23284. sine=frequency=220:beep_factor=4:duration=5
  23285. </pre></div>
  23286. </li><li>Generate a 1 kHz sine wave following <code class="code">1602,1601,1602,1601,1602</code> NTSC
  23287. pattern:
  23288. <div class="example">
  23289. <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)))'
  23290. </pre></div>
  23291. </li></ul>
  23292. </div>
  23293. </div>
  23294. </div>
  23295. <div class="chapter-level-extent" id="Audio-Sinks">
  23296. <h2 class="chapter"><span>29 Audio Sinks<a class="copiable-link" href="#Audio-Sinks"> &para;</a></span></h2>
  23297. <p>Below is a description of the currently available audio sinks.
  23298. </p>
  23299. <ul class="mini-toc">
  23300. <li><a href="#abuffersink" accesskey="1">abuffersink</a></li>
  23301. <li><a href="#anullsink" accesskey="2">anullsink</a></li>
  23302. </ul>
  23303. <div class="section-level-extent" id="abuffersink">
  23304. <h3 class="section"><span>29.1 abuffersink<a class="copiable-link" href="#abuffersink"> &para;</a></span></h3>
  23305. <p>Buffer audio frames, and make them available to the end of filter chain.
  23306. </p>
  23307. <p>This sink is mainly intended for programmatic use, in particular
  23308. through the interface defined in <samp class="file">libavfilter/buffersink.h</samp>
  23309. or the options system.
  23310. </p>
  23311. <p>It accepts a pointer to an AVABufferSinkContext structure, which
  23312. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  23313. parameter to <code class="code">avfilter_init_filter</code> for initialization.
  23314. </p></div>
  23315. <div class="section-level-extent" id="anullsink">
  23316. <h3 class="section"><span>29.2 anullsink<a class="copiable-link" href="#anullsink"> &para;</a></span></h3>
  23317. <p>Null audio sink; do absolutely nothing with the input audio. It is
  23318. mainly useful as a template and for use in analysis / debugging
  23319. tools.
  23320. </p>
  23321. </div>
  23322. </div>
  23323. <div class="chapter-level-extent" id="Video-Filters">
  23324. <h2 class="chapter"><span>30 Video Filters<a class="copiable-link" href="#Video-Filters"> &para;</a></span></h2>
  23325. <p>When you configure your FFmpeg build, you can disable any of the
  23326. existing filters using <code class="code">--disable-filters</code>.
  23327. The configure output will show the video filters included in your
  23328. build.
  23329. </p>
  23330. <p>Below is a description of the currently available video filters.
  23331. </p>
  23332. <ul class="mini-toc">
  23333. <li><a href="#addroi" accesskey="1">addroi</a></li>
  23334. <li><a href="#alphaextract" accesskey="2">alphaextract</a></li>
  23335. <li><a href="#alphamerge" accesskey="3">alphamerge</a></li>
  23336. <li><a href="#amplify" accesskey="4">amplify</a></li>
  23337. <li><a href="#ass" accesskey="5">ass</a></li>
  23338. <li><a href="#atadenoise" accesskey="6">atadenoise</a></li>
  23339. <li><a href="#avgblur" accesskey="7">avgblur</a></li>
  23340. <li><a href="#backgroundkey" accesskey="8">backgroundkey</a></li>
  23341. <li><a href="#bbox" accesskey="9">bbox</a></li>
  23342. <li><a href="#bilateral">bilateral</a></li>
  23343. <li><a href="#bilateral_005fcuda">bilateral_cuda</a></li>
  23344. <li><a href="#bitplanenoise">bitplanenoise</a></li>
  23345. <li><a href="#blackdetect">blackdetect</a></li>
  23346. <li><a href="#blackframe">blackframe</a></li>
  23347. <li><a href="#blend-1">blend</a></li>
  23348. <li><a href="#blockdetect-1">blockdetect</a></li>
  23349. <li><a href="#blurdetect-1">blurdetect</a></li>
  23350. <li><a href="#bm3d">bm3d</a></li>
  23351. <li><a href="#boxblur">boxblur</a></li>
  23352. <li><a href="#bwdif-1">bwdif</a></li>
  23353. <li><a href="#bwdif_005fcuda">bwdif_cuda</a></li>
  23354. <li><a href="#ccrepack">ccrepack</a></li>
  23355. <li><a href="#cas">cas</a></li>
  23356. <li><a href="#chromahold">chromahold</a></li>
  23357. <li><a href="#chromakey-1">chromakey</a></li>
  23358. <li><a href="#chromakey_005fcuda">chromakey_cuda</a></li>
  23359. <li><a href="#chromanr">chromanr</a></li>
  23360. <li><a href="#chromashift">chromashift</a></li>
  23361. <li><a href="#ciescope">ciescope</a></li>
  23362. <li><a href="#codecview">codecview</a></li>
  23363. <li><a href="#colorbalance">colorbalance</a></li>
  23364. <li><a href="#colorcontrast">colorcontrast</a></li>
  23365. <li><a href="#colorcorrect">colorcorrect</a></li>
  23366. <li><a href="#colorchannelmixer">colorchannelmixer</a></li>
  23367. <li><a href="#colorize">colorize</a></li>
  23368. <li><a href="#colorkey">colorkey</a></li>
  23369. <li><a href="#colorhold">colorhold</a></li>
  23370. <li><a href="#colorlevels">colorlevels</a></li>
  23371. <li><a href="#colormap">colormap</a></li>
  23372. <li><a href="#colormatrix">colormatrix</a></li>
  23373. <li><a href="#colorspace">colorspace</a></li>
  23374. <li><a href="#colorspace_005fcuda">colorspace_cuda</a></li>
  23375. <li><a href="#colortemperature">colortemperature</a></li>
  23376. <li><a href="#convolution">convolution</a></li>
  23377. <li><a href="#convolve">convolve</a></li>
  23378. <li><a href="#copy">copy</a></li>
  23379. <li><a href="#coreimage-1">coreimage</a></li>
  23380. <li><a href="#corr">corr</a></li>
  23381. <li><a href="#cover_005frect">cover_rect</a></li>
  23382. <li><a href="#crop">crop</a></li>
  23383. <li><a href="#cropdetect">cropdetect</a></li>
  23384. <li><a href="#cue-1">cue</a></li>
  23385. <li><a href="#curves-1">curves</a></li>
  23386. <li><a href="#datascope">datascope</a></li>
  23387. <li><a href="#dblur">dblur</a></li>
  23388. <li><a href="#dctdnoiz">dctdnoiz</a></li>
  23389. <li><a href="#deband">deband</a></li>
  23390. <li><a href="#deblock">deblock</a></li>
  23391. <li><a href="#decimate-1">decimate</a></li>
  23392. <li><a href="#deconvolve">deconvolve</a></li>
  23393. <li><a href="#dedot">dedot</a></li>
  23394. <li><a href="#deflate">deflate</a></li>
  23395. <li><a href="#deflicker">deflicker</a></li>
  23396. <li><a href="#dejudder">dejudder</a></li>
  23397. <li><a href="#delogo">delogo</a></li>
  23398. <li><a href="#derain-1">derain</a></li>
  23399. <li><a href="#deshake">deshake</a></li>
  23400. <li><a href="#despill">despill</a></li>
  23401. <li><a href="#detelecine">detelecine</a></li>
  23402. <li><a href="#dilation-1">dilation</a></li>
  23403. <li><a href="#displace">displace</a></li>
  23404. <li><a href="#dnn_005fclassify">dnn_classify</a></li>
  23405. <li><a href="#dnn_005fdetect">dnn_detect</a></li>
  23406. <li><a href="#dnn_005fprocessing-1">dnn_processing</a></li>
  23407. <li><a href="#drawbox">drawbox</a></li>
  23408. <li><a href="#drawgraph-1">drawgraph</a></li>
  23409. <li><a href="#drawgrid">drawgrid</a></li>
  23410. <li><a href="#drawtext-1">drawtext</a></li>
  23411. <li><a href="#edgedetect">edgedetect</a></li>
  23412. <li><a href="#elbg">elbg</a></li>
  23413. <li><a href="#entropy">entropy</a></li>
  23414. <li><a href="#epx">epx</a></li>
  23415. <li><a href="#eq">eq</a></li>
  23416. <li><a href="#erosion-1">erosion</a></li>
  23417. <li><a href="#estdif">estdif</a></li>
  23418. <li><a href="#exposure">exposure</a></li>
  23419. <li><a href="#extractplanes">extractplanes</a></li>
  23420. <li><a href="#fade">fade</a></li>
  23421. <li><a href="#feedback">feedback</a></li>
  23422. <li><a href="#fftdnoiz">fftdnoiz</a></li>
  23423. <li><a href="#fftfilt">fftfilt</a></li>
  23424. <li><a href="#field">field</a></li>
  23425. <li><a href="#fieldhint">fieldhint</a></li>
  23426. <li><a href="#fieldmatch">fieldmatch</a></li>
  23427. <li><a href="#fieldorder">fieldorder</a></li>
  23428. <li><a href="#fillborders">fillborders</a></li>
  23429. <li><a href="#find_005frect">find_rect</a></li>
  23430. <li><a href="#floodfill">floodfill</a></li>
  23431. <li><a href="#format-1">format</a></li>
  23432. <li><a href="#fps-1">fps</a></li>
  23433. <li><a href="#framepack">framepack</a></li>
  23434. <li><a href="#framerate">framerate</a></li>
  23435. <li><a href="#framestep">framestep</a></li>
  23436. <li><a href="#freezedetect">freezedetect</a></li>
  23437. <li><a href="#freezeframes">freezeframes</a></li>
  23438. <li><a href="#frei0r-1">frei0r</a></li>
  23439. <li><a href="#fspp">fspp</a></li>
  23440. <li><a href="#fsync-1">fsync</a></li>
  23441. <li><a href="#gblur">gblur</a></li>
  23442. <li><a href="#geq">geq</a></li>
  23443. <li><a href="#gradfun">gradfun</a></li>
  23444. <li><a href="#graphmonitor-1">graphmonitor</a></li>
  23445. <li><a href="#grayworld">grayworld</a></li>
  23446. <li><a href="#greyedge">greyedge</a></li>
  23447. <li><a href="#guided">guided</a></li>
  23448. <li><a href="#haldclut-1">haldclut</a></li>
  23449. <li><a href="#hflip">hflip</a></li>
  23450. <li><a href="#histeq">histeq</a></li>
  23451. <li><a href="#histogram-1">histogram</a></li>
  23452. <li><a href="#hqdn3d-1">hqdn3d</a></li>
  23453. <li><a href="#hwdownload-1">hwdownload</a></li>
  23454. <li><a href="#hwmap">hwmap</a></li>
  23455. <li><a href="#hwupload-1">hwupload</a></li>
  23456. <li><a href="#hwupload_005fcuda-1">hwupload_cuda</a></li>
  23457. <li><a href="#hqx">hqx</a></li>
  23458. <li><a href="#hstack-1">hstack</a></li>
  23459. <li><a href="#hsvhold">hsvhold</a></li>
  23460. <li><a href="#hsvkey">hsvkey</a></li>
  23461. <li><a href="#hue">hue</a></li>
  23462. <li><a href="#huesaturation">huesaturation</a></li>
  23463. <li><a href="#hysteresis">hysteresis</a></li>
  23464. <li><a href="#iccdetect">iccdetect</a></li>
  23465. <li><a href="#iccgen">iccgen</a></li>
  23466. <li><a href="#identity">identity</a></li>
  23467. <li><a href="#idet">idet</a></li>
  23468. <li><a href="#il">il</a></li>
  23469. <li><a href="#inflate">inflate</a></li>
  23470. <li><a href="#interlace">interlace</a></li>
  23471. <li><a href="#kerndeint">kerndeint</a></li>
  23472. <li><a href="#kirsch">kirsch</a></li>
  23473. <li><a href="#lagfun">lagfun</a></li>
  23474. <li><a href="#lenscorrection">lenscorrection</a></li>
  23475. <li><a href="#lensfun">lensfun</a></li>
  23476. <li><a href="#libplacebo">libplacebo</a></li>
  23477. <li><a href="#libvmaf-1">libvmaf</a></li>
  23478. <li><a href="#libvmaf_005fcuda">libvmaf_cuda</a></li>
  23479. <li><a href="#limitdiff">limitdiff</a></li>
  23480. <li><a href="#limiter">limiter</a></li>
  23481. <li><a href="#loop">loop</a></li>
  23482. <li><a href="#lut1d">lut1d</a></li>
  23483. <li><a href="#lut3d-1">lut3d</a></li>
  23484. <li><a href="#lumakey">lumakey</a></li>
  23485. <li><a href="#lut_002c-lutrgb_002c-lutyuv">lut, lutrgb, lutyuv</a></li>
  23486. <li><a href="#lut2_002c-tlut2">lut2, tlut2</a></li>
  23487. <li><a href="#maskedclamp">maskedclamp</a></li>
  23488. <li><a href="#maskedmax">maskedmax</a></li>
  23489. <li><a href="#maskedmerge">maskedmerge</a></li>
  23490. <li><a href="#maskedmin">maskedmin</a></li>
  23491. <li><a href="#maskedthreshold">maskedthreshold</a></li>
  23492. <li><a href="#maskfun">maskfun</a></li>
  23493. <li><a href="#mcdeint">mcdeint</a></li>
  23494. <li><a href="#median">median</a></li>
  23495. <li><a href="#mergeplanes">mergeplanes</a></li>
  23496. <li><a href="#mestimate">mestimate</a></li>
  23497. <li><a href="#midequalizer">midequalizer</a></li>
  23498. <li><a href="#minterpolate">minterpolate</a></li>
  23499. <li><a href="#mix">mix</a></li>
  23500. <li><a href="#monochrome">monochrome</a></li>
  23501. <li><a href="#morpho">morpho</a></li>
  23502. <li><a href="#mpdecimate">mpdecimate</a></li>
  23503. <li><a href="#msad">msad</a></li>
  23504. <li><a href="#multiply">multiply</a></li>
  23505. <li><a href="#negate">negate</a></li>
  23506. <li><a href="#nlmeans-1">nlmeans</a></li>
  23507. <li><a href="#nnedi">nnedi</a></li>
  23508. <li><a href="#noformat">noformat</a></li>
  23509. <li><a href="#noise-1">noise</a></li>
  23510. <li><a href="#normalize">normalize</a></li>
  23511. <li><a href="#null-1">null</a></li>
  23512. <li><a href="#ocr">ocr</a></li>
  23513. <li><a href="#ocv">ocv</a></li>
  23514. <li><a href="#oscilloscope">oscilloscope</a></li>
  23515. <li><a href="#overlay-1">overlay</a></li>
  23516. <li><a href="#overlay_005fcuda-1">overlay_cuda</a></li>
  23517. <li><a href="#owdenoise">owdenoise</a></li>
  23518. <li><a href="#pad-1">pad</a></li>
  23519. <li><a href="#palettegen-1">palettegen</a></li>
  23520. <li><a href="#paletteuse">paletteuse</a></li>
  23521. <li><a href="#perspective">perspective</a></li>
  23522. <li><a href="#phase">phase</a></li>
  23523. <li><a href="#photosensitivity">photosensitivity</a></li>
  23524. <li><a href="#pixdesctest">pixdesctest</a></li>
  23525. <li><a href="#pixelize">pixelize</a></li>
  23526. <li><a href="#pixscope">pixscope</a></li>
  23527. <li><a href="#pp">pp</a></li>
  23528. <li><a href="#pp7">pp7</a></li>
  23529. <li><a href="#premultiply">premultiply</a></li>
  23530. <li><a href="#prewitt">prewitt</a></li>
  23531. <li><a href="#pseudocolor">pseudocolor</a></li>
  23532. <li><a href="#psnr">psnr</a></li>
  23533. <li><a href="#pullup-1">pullup</a></li>
  23534. <li><a href="#qp">qp</a></li>
  23535. <li><a href="#qrencode">qrencode</a></li>
  23536. <li><a href="#quirc">quirc</a></li>
  23537. <li><a href="#random">random</a></li>
  23538. <li><a href="#readeia608">readeia608</a></li>
  23539. <li><a href="#readvitc">readvitc</a></li>
  23540. <li><a href="#remap">remap</a></li>
  23541. <li><a href="#removegrain">removegrain</a></li>
  23542. <li><a href="#removelogo">removelogo</a></li>
  23543. <li><a href="#repeatfields">repeatfields</a></li>
  23544. <li><a href="#reverse">reverse</a></li>
  23545. <li><a href="#rgbashift">rgbashift</a></li>
  23546. <li><a href="#roberts">roberts</a></li>
  23547. <li><a href="#rotate">rotate</a></li>
  23548. <li><a href="#sab">sab</a></li>
  23549. <li><a href="#scale-1">scale</a></li>
  23550. <li><a href="#scale_005fcuda-1">scale_cuda</a></li>
  23551. <li><a href="#scale_005fnpp-1">scale_npp</a></li>
  23552. <li><a href="#scale2ref">scale2ref</a></li>
  23553. <li><a href="#scale2ref_005fnpp">scale2ref_npp</a></li>
  23554. <li><a href="#scale_005fvt">scale_vt</a></li>
  23555. <li><a href="#scharr">scharr</a></li>
  23556. <li><a href="#scroll">scroll</a></li>
  23557. <li><a href="#scdet-1">scdet</a></li>
  23558. <li><a href="#selectivecolor-1">selectivecolor</a></li>
  23559. <li><a href="#separatefields-1">separatefields</a></li>
  23560. <li><a href="#setdar_002c-setsar">setdar, setsar</a></li>
  23561. <li><a href="#setfield-1">setfield</a></li>
  23562. <li><a href="#setparams-1">setparams</a></li>
  23563. <li><a href="#sharpen_005fnpp">sharpen_npp</a></li>
  23564. <li><a href="#shear">shear</a></li>
  23565. <li><a href="#showinfo-1">showinfo</a></li>
  23566. <li><a href="#showpalette">showpalette</a></li>
  23567. <li><a href="#shuffleframes">shuffleframes</a></li>
  23568. <li><a href="#shufflepixels">shufflepixels</a></li>
  23569. <li><a href="#shuffleplanes">shuffleplanes</a></li>
  23570. <li><a href="#signalstats-1">signalstats</a></li>
  23571. <li><a href="#signature-1">signature</a></li>
  23572. <li><a href="#siti-1">siti</a></li>
  23573. <li><a href="#smartblur-1">smartblur</a></li>
  23574. <li><a href="#sobel">sobel</a></li>
  23575. <li><a href="#spp-1">spp</a></li>
  23576. <li><a href="#sr-1">sr</a></li>
  23577. <li><a href="#ssim">ssim</a></li>
  23578. <li><a href="#stereo3d">stereo3d</a></li>
  23579. <li><a href="#streamselect_002c-astreamselect">streamselect, astreamselect</a></li>
  23580. <li><a href="#subtitles-1">subtitles</a></li>
  23581. <li><a href="#super2xsai">super2xsai</a></li>
  23582. <li><a href="#swaprect">swaprect</a></li>
  23583. <li><a href="#swapuv">swapuv</a></li>
  23584. <li><a href="#tblend">tblend</a></li>
  23585. <li><a href="#telecine">telecine</a></li>
  23586. <li><a href="#thistogram">thistogram</a></li>
  23587. <li><a href="#threshold">threshold</a></li>
  23588. <li><a href="#thumbnail">thumbnail</a></li>
  23589. <li><a href="#tile-1">tile</a></li>
  23590. <li><a href="#tiltandshift">tiltandshift</a></li>
  23591. <li><a href="#tinterlace">tinterlace</a></li>
  23592. <li><a href="#tmedian">tmedian</a></li>
  23593. <li><a href="#tmidequalizer">tmidequalizer</a></li>
  23594. <li><a href="#tmix">tmix</a></li>
  23595. <li><a href="#tonemap-1">tonemap</a></li>
  23596. <li><a href="#tpad">tpad</a></li>
  23597. <li><a href="#transpose-1">transpose</a></li>
  23598. <li><a href="#transpose_005fnpp">transpose_npp</a></li>
  23599. <li><a href="#trim">trim</a></li>
  23600. <li><a href="#unpremultiply">unpremultiply</a></li>
  23601. <li><a href="#unsharp-1">unsharp</a></li>
  23602. <li><a href="#untile-1">untile</a></li>
  23603. <li><a href="#uspp">uspp</a></li>
  23604. <li><a href="#v360">v360</a></li>
  23605. <li><a href="#vaguedenoiser">vaguedenoiser</a></li>
  23606. <li><a href="#varblur">varblur</a></li>
  23607. <li><a href="#vectorscope">vectorscope</a></li>
  23608. <li><a href="#vidstabdetect-1">vidstabdetect</a></li>
  23609. <li><a href="#vidstabtransform-1">vidstabtransform</a></li>
  23610. <li><a href="#vflip">vflip</a></li>
  23611. <li><a href="#vfrdet">vfrdet</a></li>
  23612. <li><a href="#vibrance">vibrance</a></li>
  23613. <li><a href="#vif">vif</a></li>
  23614. <li><a href="#vignette-1">vignette</a></li>
  23615. <li><a href="#vmafmotion">vmafmotion</a></li>
  23616. <li><a href="#vstack-1">vstack</a></li>
  23617. <li><a href="#w3fdif">w3fdif</a></li>
  23618. <li><a href="#waveform">waveform</a></li>
  23619. <li><a href="#weave_002c-doubleweave">weave, doubleweave</a></li>
  23620. <li><a href="#xbr">xbr</a></li>
  23621. <li><a href="#xcorrelate">xcorrelate</a></li>
  23622. <li><a href="#xfade">xfade</a></li>
  23623. <li><a href="#xmedian">xmedian</a></li>
  23624. <li><a href="#xstack-1">xstack</a></li>
  23625. <li><a href="#yadif-1">yadif</a></li>
  23626. <li><a href="#yadif_005fcuda">yadif_cuda</a></li>
  23627. <li><a href="#yaepblur">yaepblur</a></li>
  23628. <li><a href="#zoompan">zoompan</a></li>
  23629. <li><a href="#zscale-1">zscale</a></li>
  23630. </ul>
  23631. <div class="section-level-extent" id="addroi">
  23632. <h3 class="section"><span>30.1 addroi<a class="copiable-link" href="#addroi"> &para;</a></span></h3>
  23633. <p>Mark a region of interest in a video frame.
  23634. </p>
  23635. <p>The frame data is passed through unchanged, but metadata is attached
  23636. to the frame indicating regions of interest which can affect the
  23637. behaviour of later encoding. Multiple regions can be marked by
  23638. applying the filter multiple times.
  23639. </p>
  23640. <dl class="table">
  23641. <dt><samp class="option">x</samp></dt>
  23642. <dd><p>Region distance in pixels from the left edge of the frame.
  23643. </p></dd>
  23644. <dt><samp class="option">y</samp></dt>
  23645. <dd><p>Region distance in pixels from the top edge of the frame.
  23646. </p></dd>
  23647. <dt><samp class="option">w</samp></dt>
  23648. <dd><p>Region width in pixels.
  23649. </p></dd>
  23650. <dt><samp class="option">h</samp></dt>
  23651. <dd><p>Region height in pixels.
  23652. </p>
  23653. <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,
  23654. and may contain the following variables:
  23655. </p><dl class="table">
  23656. <dt><samp class="option">iw</samp></dt>
  23657. <dd><p>Width of the input frame.
  23658. </p></dd>
  23659. <dt><samp class="option">ih</samp></dt>
  23660. <dd><p>Height of the input frame.
  23661. </p></dd>
  23662. </dl>
  23663. </dd>
  23664. <dt><samp class="option">qoffset</samp></dt>
  23665. <dd><p>Quantisation offset to apply within the region.
  23666. </p>
  23667. <p>This must be a real value in the range -1 to +1. A value of zero
  23668. indicates no quality change. A negative value asks for better quality
  23669. (less quantisation), while a positive value asks for worse quality
  23670. (greater quantisation).
  23671. </p>
  23672. <p>The range is calibrated so that the extreme values indicate the
  23673. largest possible offset - if the rest of the frame is encoded with the
  23674. worst possible quality, an offset of -1 indicates that this region
  23675. should be encoded with the best possible quality anyway. Intermediate
  23676. values are then interpolated in some codec-dependent way.
  23677. </p>
  23678. <p>For example, in 10-bit H.264 the quantisation parameter varies between
  23679. -12 and 51. A typical qoffset value of -1/10 therefore indicates that
  23680. this region should be encoded with a QP around one-tenth of the full
  23681. range better than the rest of the frame. So, if most of the frame
  23682. were to be encoded with a QP of around 30, this region would get a QP
  23683. of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3).
  23684. An extreme value of -1 would indicate that this region should be
  23685. encoded with the best possible quality regardless of the treatment of
  23686. the rest of the frame - that is, should be encoded at a QP of -12.
  23687. </p></dd>
  23688. <dt><samp class="option">clear</samp></dt>
  23689. <dd><p>If set to true, remove any existing regions of interest marked on the
  23690. frame before adding the new one.
  23691. </p></dd>
  23692. </dl>
  23693. <ul class="mini-toc">
  23694. <li><a href="#Examples-60" accesskey="1">Examples</a></li>
  23695. </ul>
  23696. <div class="subsection-level-extent" id="Examples-60">
  23697. <h4 class="subsection"><span>30.1.1 Examples<a class="copiable-link" href="#Examples-60"> &para;</a></span></h4>
  23698. <ul class="itemize mark-bullet">
  23699. <li>Mark the centre quarter of the frame as interesting.
  23700. <div class="example">
  23701. <pre class="example-preformatted">addroi=iw/4:ih/4:iw/2:ih/2:-1/10
  23702. </pre></div>
  23703. </li><li>Mark the 100-pixel-wide region on the left edge of the frame as very
  23704. uninteresting (to be encoded at much lower quality than the rest of
  23705. the frame).
  23706. <div class="example">
  23707. <pre class="example-preformatted">addroi=0:0:100:ih:+1/5
  23708. </pre></div>
  23709. </li></ul>
  23710. </div>
  23711. </div>
  23712. <div class="section-level-extent" id="alphaextract">
  23713. <h3 class="section"><span>30.2 alphaextract<a class="copiable-link" href="#alphaextract"> &para;</a></span></h3>
  23714. <p>Extract the alpha component from the input as a grayscale video. This
  23715. is especially useful with the <var class="var">alphamerge</var> filter.
  23716. </p>
  23717. </div>
  23718. <div class="section-level-extent" id="alphamerge">
  23719. <h3 class="section"><span>30.3 alphamerge<a class="copiable-link" href="#alphamerge"> &para;</a></span></h3>
  23720. <p>Add or replace the alpha component of the primary input with the
  23721. grayscale value of a second input. This is intended for use with
  23722. <var class="var">alphaextract</var> to allow the transmission or storage of frame
  23723. sequences that have alpha in a format that doesn&rsquo;t support an alpha
  23724. channel.
  23725. </p>
  23726. <p>For example, to reconstruct full frames from a normal YUV-encoded video
  23727. and a separate video created with <var class="var">alphaextract</var>, you might use:
  23728. </p><div class="example">
  23729. <pre class="example-preformatted">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
  23730. </pre></div>
  23731. </div>
  23732. <div class="section-level-extent" id="amplify">
  23733. <h3 class="section"><span>30.4 amplify<a class="copiable-link" href="#amplify"> &para;</a></span></h3>
  23734. <p>Amplify differences between current pixel and pixels of adjacent frames in
  23735. same pixel location.
  23736. </p>
  23737. <p>This filter accepts the following options:
  23738. </p>
  23739. <dl class="table">
  23740. <dt><samp class="option">radius</samp></dt>
  23741. <dd><p>Set frame radius. Default is 2. Allowed range is from 1 to 63.
  23742. For example radius of 3 will instruct filter to calculate average of 7 frames.
  23743. </p>
  23744. </dd>
  23745. <dt><samp class="option">factor</samp></dt>
  23746. <dd><p>Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535.
  23747. </p>
  23748. </dd>
  23749. <dt><samp class="option">threshold</samp></dt>
  23750. <dd><p>Set threshold for difference amplification. Any difference greater or equal to
  23751. this value will not alter source pixel. Default is 10.
  23752. Allowed range is from 0 to 65535.
  23753. </p>
  23754. </dd>
  23755. <dt><samp class="option">tolerance</samp></dt>
  23756. <dd><p>Set tolerance for difference amplification. Any difference lower to
  23757. this value will not alter source pixel. Default is 0.
  23758. Allowed range is from 0 to 65535.
  23759. </p>
  23760. </dd>
  23761. <dt><samp class="option">low</samp></dt>
  23762. <dd><p>Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  23763. This option controls maximum possible value that will decrease source pixel value.
  23764. </p>
  23765. </dd>
  23766. <dt><samp class="option">high</samp></dt>
  23767. <dd><p>Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  23768. This option controls maximum possible value that will increase source pixel value.
  23769. </p>
  23770. </dd>
  23771. <dt><samp class="option">planes</samp></dt>
  23772. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  23773. </p></dd>
  23774. </dl>
  23775. <ul class="mini-toc">
  23776. <li><a href="#Commands-54" accesskey="1">Commands</a></li>
  23777. </ul>
  23778. <div class="subsection-level-extent" id="Commands-54">
  23779. <h4 class="subsection"><span>30.4.1 Commands<a class="copiable-link" href="#Commands-54"> &para;</a></span></h4>
  23780. <p>This filter supports the following <a class="ref" href="#commands">commands</a> that corresponds to option of same name:
  23781. </p><dl class="table">
  23782. <dt><samp class="option">factor</samp></dt>
  23783. <dt><samp class="option">threshold</samp></dt>
  23784. <dt><samp class="option">tolerance</samp></dt>
  23785. <dt><samp class="option">low</samp></dt>
  23786. <dt><samp class="option">high</samp></dt>
  23787. <dt><samp class="option">planes</samp></dt>
  23788. </dl>
  23789. </div>
  23790. </div>
  23791. <div class="section-level-extent" id="ass">
  23792. <h3 class="section"><span>30.5 ass<a class="copiable-link" href="#ass"> &para;</a></span></h3>
  23793. <p>Same as the <a class="ref" href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
  23794. and libavformat to work. On the other hand, it is limited to ASS (Advanced
  23795. Substation Alpha) subtitles files.
  23796. </p>
  23797. <p>This filter accepts the following option in addition to the common options from
  23798. the <a class="ref" href="#subtitles">subtitles</a> filter:
  23799. </p>
  23800. <dl class="table">
  23801. <dt><samp class="option">shaping</samp></dt>
  23802. <dd><p>Set the shaping engine
  23803. </p>
  23804. <p>Available values are:
  23805. </p><dl class="table">
  23806. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  23807. <dd><p>The default libass shaping engine, which is the best available.
  23808. </p></dd>
  23809. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  23810. <dd><p>Fast, font-agnostic shaper that can do only substitutions
  23811. </p></dd>
  23812. <dt>&lsquo;<samp class="samp">complex</samp>&rsquo;</dt>
  23813. <dd><p>Slower shaper using OpenType for substitutions and positioning
  23814. </p></dd>
  23815. </dl>
  23816. <p>The default is <code class="code">auto</code>.
  23817. </p></dd>
  23818. </dl>
  23819. </div>
  23820. <div class="section-level-extent" id="atadenoise">
  23821. <h3 class="section"><span>30.6 atadenoise<a class="copiable-link" href="#atadenoise"> &para;</a></span></h3>
  23822. <p>Apply an Adaptive Temporal Averaging Denoiser to the video input.
  23823. </p>
  23824. <p>The filter accepts the following options:
  23825. </p>
  23826. <dl class="table">
  23827. <dt><samp class="option">0a</samp></dt>
  23828. <dd><p>Set threshold A for 1st plane. Default is 0.02.
  23829. Valid range is 0 to 0.3.
  23830. </p>
  23831. </dd>
  23832. <dt><samp class="option">0b</samp></dt>
  23833. <dd><p>Set threshold B for 1st plane. Default is 0.04.
  23834. Valid range is 0 to 5.
  23835. </p>
  23836. </dd>
  23837. <dt><samp class="option">1a</samp></dt>
  23838. <dd><p>Set threshold A for 2nd plane. Default is 0.02.
  23839. Valid range is 0 to 0.3.
  23840. </p>
  23841. </dd>
  23842. <dt><samp class="option">1b</samp></dt>
  23843. <dd><p>Set threshold B for 2nd plane. Default is 0.04.
  23844. Valid range is 0 to 5.
  23845. </p>
  23846. </dd>
  23847. <dt><samp class="option">2a</samp></dt>
  23848. <dd><p>Set threshold A for 3rd plane. Default is 0.02.
  23849. Valid range is 0 to 0.3.
  23850. </p>
  23851. </dd>
  23852. <dt><samp class="option">2b</samp></dt>
  23853. <dd><p>Set threshold B for 3rd plane. Default is 0.04.
  23854. Valid range is 0 to 5.
  23855. </p>
  23856. <p>Threshold A is designed to react on abrupt changes in the input signal and
  23857. threshold B is designed to react on continuous changes in the input signal.
  23858. </p>
  23859. </dd>
  23860. <dt><samp class="option">s</samp></dt>
  23861. <dd><p>Set number of frames filter will use for averaging. Default is 9. Must be odd
  23862. number in range [5, 129].
  23863. </p>
  23864. </dd>
  23865. <dt><samp class="option">p</samp></dt>
  23866. <dd><p>Set what planes of frame filter will use for averaging. Default is all.
  23867. </p>
  23868. </dd>
  23869. <dt><samp class="option">a</samp></dt>
  23870. <dd><p>Set what variant of algorithm filter will use for averaging. Default is <code class="code">p</code> parallel.
  23871. Alternatively can be set to <code class="code">s</code> serial.
  23872. </p>
  23873. <p>Parallel can be faster then serial, while other way around is never true.
  23874. Parallel will abort early on first change being greater then thresholds, while serial
  23875. will continue processing other side of frames if they are equal or below thresholds.
  23876. </p>
  23877. </dd>
  23878. <dt><samp class="option">0s</samp></dt>
  23879. <dt><samp class="option">1s</samp></dt>
  23880. <dt><samp class="option">2s</samp></dt>
  23881. <dd><p>Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767.
  23882. Valid range is from 0 to 32767.
  23883. This options controls weight for each pixel in radius defined by size.
  23884. Default value means every pixel have same weight.
  23885. Setting this option to 0 effectively disables filtering.
  23886. </p></dd>
  23887. </dl>
  23888. <ul class="mini-toc">
  23889. <li><a href="#Commands-55" accesskey="1">Commands</a></li>
  23890. </ul>
  23891. <div class="subsection-level-extent" id="Commands-55">
  23892. <h4 class="subsection"><span>30.6.1 Commands<a class="copiable-link" href="#Commands-55"> &para;</a></span></h4>
  23893. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options except option <code class="code">s</code>.
  23894. The command accepts the same syntax of the corresponding option.
  23895. </p>
  23896. </div>
  23897. </div>
  23898. <div class="section-level-extent" id="avgblur">
  23899. <h3 class="section"><span>30.7 avgblur<a class="copiable-link" href="#avgblur"> &para;</a></span></h3>
  23900. <p>Apply average blur filter.
  23901. </p>
  23902. <p>The filter accepts the following options:
  23903. </p>
  23904. <dl class="table">
  23905. <dt><samp class="option">sizeX</samp></dt>
  23906. <dd><p>Set horizontal radius size.
  23907. </p>
  23908. </dd>
  23909. <dt><samp class="option">planes</samp></dt>
  23910. <dd><p>Set which planes to filter. By default all planes are filtered.
  23911. </p>
  23912. </dd>
  23913. <dt><samp class="option">sizeY</samp></dt>
  23914. <dd><p>Set vertical radius size, if zero it will be same as <code class="code">sizeX</code>.
  23915. Default is <code class="code">0</code>.
  23916. </p></dd>
  23917. </dl>
  23918. <ul class="mini-toc">
  23919. <li><a href="#Commands-56" accesskey="1">Commands</a></li>
  23920. </ul>
  23921. <div class="subsection-level-extent" id="Commands-56">
  23922. <h4 class="subsection"><span>30.7.1 Commands<a class="copiable-link" href="#Commands-56"> &para;</a></span></h4>
  23923. <p>This filter supports same commands as options.
  23924. The command accepts the same syntax of the corresponding option.
  23925. </p>
  23926. <p>If the specified expression is not valid, it is kept at its current
  23927. value.
  23928. </p>
  23929. </div>
  23930. </div>
  23931. <div class="section-level-extent" id="backgroundkey">
  23932. <h3 class="section"><span>30.8 backgroundkey<a class="copiable-link" href="#backgroundkey"> &para;</a></span></h3>
  23933. <p>Turns a static background into transparency.
  23934. </p>
  23935. <p>The filter accepts the following option:
  23936. </p>
  23937. <dl class="table">
  23938. <dt><samp class="option">threshold</samp></dt>
  23939. <dd><p>Threshold for scene change detection.
  23940. </p></dd>
  23941. <dt><samp class="option">similarity</samp></dt>
  23942. <dd><p>Similarity percentage with the background.
  23943. </p></dd>
  23944. <dt><samp class="option">blend</samp></dt>
  23945. <dd><p>Set the blend amount for pixels that are not similar.
  23946. </p></dd>
  23947. </dl>
  23948. <ul class="mini-toc">
  23949. <li><a href="#Commands-57" accesskey="1">Commands</a></li>
  23950. </ul>
  23951. <div class="subsection-level-extent" id="Commands-57">
  23952. <h4 class="subsection"><span>30.8.1 Commands<a class="copiable-link" href="#Commands-57"> &para;</a></span></h4>
  23953. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  23954. </p>
  23955. </div>
  23956. </div>
  23957. <div class="section-level-extent" id="bbox">
  23958. <h3 class="section"><span>30.9 bbox<a class="copiable-link" href="#bbox"> &para;</a></span></h3>
  23959. <p>Compute the bounding box for the non-black pixels in the input frame
  23960. luma plane.
  23961. </p>
  23962. <p>This filter computes the bounding box containing all the pixels with a
  23963. luma value greater than the minimum allowed value.
  23964. The parameters describing the bounding box are printed on the filter
  23965. log.
  23966. </p>
  23967. <p>The filter accepts the following option:
  23968. </p>
  23969. <dl class="table">
  23970. <dt><samp class="option">min_val</samp></dt>
  23971. <dd><p>Set the minimal luma value. Default is <code class="code">16</code>.
  23972. </p></dd>
  23973. </dl>
  23974. <ul class="mini-toc">
  23975. <li><a href="#Commands-58" accesskey="1">Commands</a></li>
  23976. </ul>
  23977. <div class="subsection-level-extent" id="Commands-58">
  23978. <h4 class="subsection"><span>30.9.1 Commands<a class="copiable-link" href="#Commands-58"> &para;</a></span></h4>
  23979. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  23980. </p>
  23981. </div>
  23982. </div>
  23983. <div class="section-level-extent" id="bilateral">
  23984. <h3 class="section"><span>30.10 bilateral<a class="copiable-link" href="#bilateral"> &para;</a></span></h3>
  23985. <p>Apply bilateral filter, spatial smoothing while preserving edges.
  23986. </p>
  23987. <p>The filter accepts the following options:
  23988. </p><dl class="table">
  23989. <dt><samp class="option">sigmaS</samp></dt>
  23990. <dd><p>Set sigma of gaussian function to calculate spatial weight.
  23991. Allowed range is 0 to 512. Default is 0.1.
  23992. </p>
  23993. </dd>
  23994. <dt><samp class="option">sigmaR</samp></dt>
  23995. <dd><p>Set sigma of gaussian function to calculate range weight.
  23996. Allowed range is 0 to 1. Default is 0.1.
  23997. </p>
  23998. </dd>
  23999. <dt><samp class="option">planes</samp></dt>
  24000. <dd><p>Set planes to filter. Default is first only.
  24001. </p></dd>
  24002. </dl>
  24003. <ul class="mini-toc">
  24004. <li><a href="#Commands-59" accesskey="1">Commands</a></li>
  24005. </ul>
  24006. <div class="subsection-level-extent" id="Commands-59">
  24007. <h4 class="subsection"><span>30.10.1 Commands<a class="copiable-link" href="#Commands-59"> &para;</a></span></h4>
  24008. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  24009. </p>
  24010. </div>
  24011. </div>
  24012. <div class="section-level-extent" id="bilateral_005fcuda">
  24013. <h3 class="section"><span>30.11 bilateral_cuda<a class="copiable-link" href="#bilateral_005fcuda"> &para;</a></span></h3>
  24014. <p>CUDA accelerated bilateral filter, an edge preserving filter.
  24015. This filter is mathematically accurate thanks to the use of GPU acceleration.
  24016. For best output quality, use one to one chroma subsampling, i.e. yuv444p format.
  24017. </p>
  24018. <p>The filter accepts the following options:
  24019. </p><dl class="table">
  24020. <dt><samp class="option">sigmaS</samp></dt>
  24021. <dd><p>Set sigma of gaussian function to calculate spatial weight, also called sigma space.
  24022. Allowed range is 0.1 to 512. Default is 0.1.
  24023. </p>
  24024. </dd>
  24025. <dt><samp class="option">sigmaR</samp></dt>
  24026. <dd><p>Set sigma of gaussian function to calculate color range weight, also called sigma color.
  24027. Allowed range is 0.1 to 512. Default is 0.1.
  24028. </p>
  24029. </dd>
  24030. <dt><samp class="option">window_size</samp></dt>
  24031. <dd><p>Set window size of the bilateral function to determine the number of neighbours to loop on.
  24032. If the number entered is even, one will be added automatically.
  24033. Allowed range is 1 to 255. Default is 1.
  24034. </p></dd>
  24035. </dl>
  24036. <ul class="mini-toc">
  24037. <li><a href="#Examples-61" accesskey="1">Examples</a></li>
  24038. </ul>
  24039. <div class="subsection-level-extent" id="Examples-61">
  24040. <h4 class="subsection"><span>30.11.1 Examples<a class="copiable-link" href="#Examples-61"> &para;</a></span></h4>
  24041. <ul class="itemize mark-bullet">
  24042. <li>Apply the bilateral filter on a video.
  24043. <div class="example">
  24044. <pre class="example-preformatted">./ffmpeg -v verbose \
  24045. -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 \
  24046. -init_hw_device cuda \
  24047. -filter_complex \
  24048. &quot; \
  24049. [0:v]scale_cuda=format=yuv444p[scaled_video];
  24050. [scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0&quot; \
  24051. -an -sn -c:v h264_nvenc -cq 20 out.mp4
  24052. </pre></div>
  24053. </li></ul>
  24054. </div>
  24055. </div>
  24056. <div class="section-level-extent" id="bitplanenoise">
  24057. <h3 class="section"><span>30.12 bitplanenoise<a class="copiable-link" href="#bitplanenoise"> &para;</a></span></h3>
  24058. <p>Show and measure bit plane noise.
  24059. </p>
  24060. <p>The filter accepts the following options:
  24061. </p>
  24062. <dl class="table">
  24063. <dt><samp class="option">bitplane</samp></dt>
  24064. <dd><p>Set which plane to analyze. Default is <code class="code">1</code>.
  24065. </p>
  24066. </dd>
  24067. <dt><samp class="option">filter</samp></dt>
  24068. <dd><p>Filter out noisy pixels from <code class="code">bitplane</code> set above.
  24069. Default is disabled.
  24070. </p></dd>
  24071. </dl>
  24072. </div>
  24073. <div class="section-level-extent" id="blackdetect">
  24074. <h3 class="section"><span>30.13 blackdetect<a class="copiable-link" href="#blackdetect"> &para;</a></span></h3>
  24075. <p>Detect video intervals that are (almost) completely black. Can be
  24076. useful to detect chapter transitions, commercials, or invalid
  24077. recordings.
  24078. </p>
  24079. <p>The filter outputs its detection analysis to both the log as well as
  24080. frame metadata. If a black segment of at least the specified minimum
  24081. duration is found, a line with the start and end timestamps as well
  24082. as duration is printed to the log with level <code class="code">info</code>. In addition,
  24083. a log line with level <code class="code">debug</code> is printed per frame showing the
  24084. black amount detected for that frame.
  24085. </p>
  24086. <p>The filter also attaches metadata to the first frame of a black
  24087. segment with key <code class="code">lavfi.black_start</code> and to the first frame
  24088. after the black segment ends with key <code class="code">lavfi.black_end</code>. The
  24089. value is the frame&rsquo;s timestamp. This metadata is added regardless
  24090. of the minimum duration specified.
  24091. </p>
  24092. <p>The filter accepts the following options:
  24093. </p>
  24094. <dl class="table">
  24095. <dt><samp class="option">black_min_duration, d</samp></dt>
  24096. <dd><p>Set the minimum detected black duration expressed in seconds. It must
  24097. be a non-negative floating point number.
  24098. </p>
  24099. <p>Default value is 2.0.
  24100. </p>
  24101. </dd>
  24102. <dt><samp class="option">picture_black_ratio_th, pic_th</samp></dt>
  24103. <dd><p>Set the threshold for considering a picture &quot;black&quot;.
  24104. Express the minimum value for the ratio:
  24105. </p><div class="example">
  24106. <pre class="example-preformatted"><var class="var">nb_black_pixels</var> / <var class="var">nb_pixels</var>
  24107. </pre></div>
  24108. <p>for which a picture is considered black.
  24109. Default value is 0.98.
  24110. </p>
  24111. </dd>
  24112. <dt><samp class="option">pixel_black_th, pix_th</samp></dt>
  24113. <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
  24114. </p>
  24115. <p>The threshold expresses the maximum pixel luma value for which a
  24116. pixel is considered &quot;black&quot;. The provided value is scaled according to
  24117. the following equation:
  24118. </p><div class="example">
  24119. <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>
  24120. </pre></div>
  24121. <p><var class="var">luma_range_size</var> and <var class="var">luma_minimum_value</var> depend on
  24122. the input video format, the range is [0-255] for YUV full-range
  24123. formats and [16-235] for YUV non full-range formats.
  24124. </p>
  24125. <p>Default value is 0.10.
  24126. </p></dd>
  24127. </dl>
  24128. <p>The following example sets the maximum pixel threshold to the minimum
  24129. value, and detects only black intervals of 2 or more seconds:
  24130. </p><div class="example">
  24131. <pre class="example-preformatted">blackdetect=d=2:pix_th=0.00
  24132. </pre></div>
  24133. </div>
  24134. <div class="section-level-extent" id="blackframe">
  24135. <h3 class="section"><span>30.14 blackframe<a class="copiable-link" href="#blackframe"> &para;</a></span></h3>
  24136. <p>Detect frames that are (almost) completely black. Can be useful to
  24137. detect chapter transitions or commercials. Output lines consist of
  24138. the frame number of the detected frame, the percentage of blackness,
  24139. the position in the file if known or -1 and the timestamp in seconds.
  24140. </p>
  24141. <p>In order to display the output lines, you need to set the loglevel at
  24142. least to the AV_LOG_INFO value.
  24143. </p>
  24144. <p>This filter exports frame metadata <code class="code">lavfi.blackframe.pblack</code>.
  24145. The value represents the percentage of pixels in the picture that
  24146. are below the threshold value.
  24147. </p>
  24148. <p>It accepts the following parameters:
  24149. </p>
  24150. <dl class="table">
  24151. <dt><samp class="option">amount</samp></dt>
  24152. <dd><p>The percentage of the pixels that have to be below the threshold; it defaults to
  24153. <code class="code">98</code>.
  24154. </p>
  24155. </dd>
  24156. <dt><samp class="option">threshold, thresh</samp></dt>
  24157. <dd><p>The threshold below which a pixel value is considered black; it defaults to
  24158. <code class="code">32</code>.
  24159. </p>
  24160. </dd>
  24161. </dl>
  24162. <a class="anchor" id="blend"></a></div>
  24163. <div class="section-level-extent" id="blend-1">
  24164. <h3 class="section"><span>30.15 blend<a class="copiable-link" href="#blend-1"> &para;</a></span></h3>
  24165. <p>Blend two video frames into each other.
  24166. </p>
  24167. <p>The <code class="code">blend</code> filter takes two input streams and outputs one
  24168. stream, the first input is the &quot;top&quot; layer and second input is
  24169. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  24170. </p>
  24171. <p>The <code class="code">tblend</code> (time blend) filter takes two consecutive frames
  24172. from one single stream, and outputs the result obtained by blending
  24173. the new frame on top of the old frame.
  24174. </p>
  24175. <p>A description of the accepted options follows.
  24176. </p>
  24177. <dl class="table">
  24178. <dt><samp class="option">c0_mode</samp></dt>
  24179. <dt><samp class="option">c1_mode</samp></dt>
  24180. <dt><samp class="option">c2_mode</samp></dt>
  24181. <dt><samp class="option">c3_mode</samp></dt>
  24182. <dt><samp class="option">all_mode</samp></dt>
  24183. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  24184. of <var class="var">all_mode</var>. Default value is <code class="code">normal</code>.
  24185. </p>
  24186. <p>Available values for component modes are:
  24187. </p><dl class="table">
  24188. <dt>&lsquo;<samp class="samp">addition</samp>&rsquo;</dt>
  24189. <dt>&lsquo;<samp class="samp">and</samp>&rsquo;</dt>
  24190. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  24191. <dt>&lsquo;<samp class="samp">bleach</samp>&rsquo;</dt>
  24192. <dt>&lsquo;<samp class="samp">burn</samp>&rsquo;</dt>
  24193. <dt>&lsquo;<samp class="samp">darken</samp>&rsquo;</dt>
  24194. <dt>&lsquo;<samp class="samp">difference</samp>&rsquo;</dt>
  24195. <dt>&lsquo;<samp class="samp">divide</samp>&rsquo;</dt>
  24196. <dt>&lsquo;<samp class="samp">dodge</samp>&rsquo;</dt>
  24197. <dt>&lsquo;<samp class="samp">exclusion</samp>&rsquo;</dt>
  24198. <dt>&lsquo;<samp class="samp">extremity</samp>&rsquo;</dt>
  24199. <dt>&lsquo;<samp class="samp">freeze</samp>&rsquo;</dt>
  24200. <dt>&lsquo;<samp class="samp">geometric</samp>&rsquo;</dt>
  24201. <dt>&lsquo;<samp class="samp">glow</samp>&rsquo;</dt>
  24202. <dt>&lsquo;<samp class="samp">grainextract</samp>&rsquo;</dt>
  24203. <dt>&lsquo;<samp class="samp">grainmerge</samp>&rsquo;</dt>
  24204. <dt>&lsquo;<samp class="samp">hardlight</samp>&rsquo;</dt>
  24205. <dt>&lsquo;<samp class="samp">hardmix</samp>&rsquo;</dt>
  24206. <dt>&lsquo;<samp class="samp">hardoverlay</samp>&rsquo;</dt>
  24207. <dt>&lsquo;<samp class="samp">harmonic</samp>&rsquo;</dt>
  24208. <dt>&lsquo;<samp class="samp">heat</samp>&rsquo;</dt>
  24209. <dt>&lsquo;<samp class="samp">interpolate</samp>&rsquo;</dt>
  24210. <dt>&lsquo;<samp class="samp">lighten</samp>&rsquo;</dt>
  24211. <dt>&lsquo;<samp class="samp">linearlight</samp>&rsquo;</dt>
  24212. <dt>&lsquo;<samp class="samp">multiply</samp>&rsquo;</dt>
  24213. <dt>&lsquo;<samp class="samp">multiply128</samp>&rsquo;</dt>
  24214. <dt>&lsquo;<samp class="samp">negation</samp>&rsquo;</dt>
  24215. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  24216. <dt>&lsquo;<samp class="samp">or</samp>&rsquo;</dt>
  24217. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  24218. <dt>&lsquo;<samp class="samp">phoenix</samp>&rsquo;</dt>
  24219. <dt>&lsquo;<samp class="samp">pinlight</samp>&rsquo;</dt>
  24220. <dt>&lsquo;<samp class="samp">reflect</samp>&rsquo;</dt>
  24221. <dt>&lsquo;<samp class="samp">screen</samp>&rsquo;</dt>
  24222. <dt>&lsquo;<samp class="samp">softdifference</samp>&rsquo;</dt>
  24223. <dt>&lsquo;<samp class="samp">softlight</samp>&rsquo;</dt>
  24224. <dt>&lsquo;<samp class="samp">stain</samp>&rsquo;</dt>
  24225. <dt>&lsquo;<samp class="samp">subtract</samp>&rsquo;</dt>
  24226. <dt>&lsquo;<samp class="samp">vividlight</samp>&rsquo;</dt>
  24227. <dt>&lsquo;<samp class="samp">xor</samp>&rsquo;</dt>
  24228. </dl>
  24229. </dd>
  24230. <dt><samp class="option">c0_opacity</samp></dt>
  24231. <dt><samp class="option">c1_opacity</samp></dt>
  24232. <dt><samp class="option">c2_opacity</samp></dt>
  24233. <dt><samp class="option">c3_opacity</samp></dt>
  24234. <dt><samp class="option">all_opacity</samp></dt>
  24235. <dd><p>Set blend opacity for specific pixel component or all pixel components in case
  24236. of <var class="var">all_opacity</var>. Only used in combination with pixel component blend modes.
  24237. </p>
  24238. </dd>
  24239. <dt><samp class="option">c0_expr</samp></dt>
  24240. <dt><samp class="option">c1_expr</samp></dt>
  24241. <dt><samp class="option">c2_expr</samp></dt>
  24242. <dt><samp class="option">c3_expr</samp></dt>
  24243. <dt><samp class="option">all_expr</samp></dt>
  24244. <dd><p>Set blend expression for specific pixel component or all pixel components in case
  24245. of <var class="var">all_expr</var>. Note that related mode options will be ignored if those are set.
  24246. </p>
  24247. <p>The expressions can use the following variables:
  24248. </p>
  24249. <dl class="table">
  24250. <dt><samp class="option">N</samp></dt>
  24251. <dd><p>The sequential number of the filtered frame, starting from <code class="code">0</code>.
  24252. </p>
  24253. </dd>
  24254. <dt><samp class="option">X</samp></dt>
  24255. <dt><samp class="option">Y</samp></dt>
  24256. <dd><p>the coordinates of the current sample
  24257. </p>
  24258. </dd>
  24259. <dt><samp class="option">W</samp></dt>
  24260. <dt><samp class="option">H</samp></dt>
  24261. <dd><p>the width and height of currently filtered plane
  24262. </p>
  24263. </dd>
  24264. <dt><samp class="option">SW</samp></dt>
  24265. <dt><samp class="option">SH</samp></dt>
  24266. <dd><p>Width and height scale for the plane being filtered. It is the
  24267. ratio between the dimensions of the current plane to the luma plane,
  24268. e.g. for a <code class="code">yuv420p</code> frame, the values are <code class="code">1,1</code> for
  24269. the luma plane and <code class="code">0.5,0.5</code> for the chroma planes.
  24270. </p>
  24271. </dd>
  24272. <dt><samp class="option">T</samp></dt>
  24273. <dd><p>Time of the current frame, expressed in seconds.
  24274. </p>
  24275. </dd>
  24276. <dt><samp class="option">TOP, A</samp></dt>
  24277. <dd><p>Value of pixel component at current location for first video frame (top layer).
  24278. </p>
  24279. </dd>
  24280. <dt><samp class="option">BOTTOM, B</samp></dt>
  24281. <dd><p>Value of pixel component at current location for second video frame (bottom layer).
  24282. </p></dd>
  24283. </dl>
  24284. </dd>
  24285. </dl>
  24286. <p>The <code class="code">blend</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  24287. </p>
  24288. <ul class="mini-toc">
  24289. <li><a href="#Examples-62" accesskey="1">Examples</a></li>
  24290. <li><a href="#Commands-60" accesskey="2">Commands</a></li>
  24291. </ul>
  24292. <div class="subsection-level-extent" id="Examples-62">
  24293. <h4 class="subsection"><span>30.15.1 Examples<a class="copiable-link" href="#Examples-62"> &para;</a></span></h4>
  24294. <ul class="itemize mark-bullet">
  24295. <li>Apply transition from bottom layer to top layer in first 10 seconds:
  24296. <div class="example">
  24297. <pre class="example-preformatted">blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
  24298. </pre></div>
  24299. </li><li>Apply linear horizontal transition from top layer to bottom layer:
  24300. <div class="example">
  24301. <pre class="example-preformatted">blend=all_expr='A*(X/W)+B*(1-X/W)'
  24302. </pre></div>
  24303. </li><li>Apply 1x1 checkerboard effect:
  24304. <div class="example">
  24305. <pre class="example-preformatted">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
  24306. </pre></div>
  24307. </li><li>Apply uncover left effect:
  24308. <div class="example">
  24309. <pre class="example-preformatted">blend=all_expr='if(gte(N*SW+X,W),A,B)'
  24310. </pre></div>
  24311. </li><li>Apply uncover down effect:
  24312. <div class="example">
  24313. <pre class="example-preformatted">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
  24314. </pre></div>
  24315. </li><li>Apply uncover up-left effect:
  24316. <div class="example">
  24317. <pre class="example-preformatted">blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
  24318. </pre></div>
  24319. </li><li>Split diagonally video and shows top and bottom layer on each side:
  24320. <div class="example">
  24321. <pre class="example-preformatted">blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
  24322. </pre></div>
  24323. </li><li>Display differences between the current and the previous frame:
  24324. <div class="example">
  24325. <pre class="example-preformatted">tblend=all_mode=grainextract
  24326. </pre></div>
  24327. </li></ul>
  24328. </div>
  24329. <div class="subsection-level-extent" id="Commands-60">
  24330. <h4 class="subsection"><span>30.15.2 Commands<a class="copiable-link" href="#Commands-60"> &para;</a></span></h4>
  24331. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  24332. </p>
  24333. <a class="anchor" id="blockdetect"></a></div>
  24334. </div>
  24335. <div class="section-level-extent" id="blockdetect-1">
  24336. <h3 class="section"><span>30.16 blockdetect<a class="copiable-link" href="#blockdetect-1"> &para;</a></span></h3>
  24337. <p>Determines blockiness of frames without altering the input frames.
  24338. </p>
  24339. <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.
  24340. </p>
  24341. <p>The filter accepts the following options:
  24342. </p>
  24343. <dl class="table">
  24344. <dt><samp class="option">period_min</samp></dt>
  24345. <dt><samp class="option">period_max</samp></dt>
  24346. <dd><p>Set minimum and maximum values for determining pixel grids (periods).
  24347. Default values are [3,24].
  24348. </p>
  24349. </dd>
  24350. <dt><samp class="option">planes</samp></dt>
  24351. <dd><p>Set planes to filter. Default is first only.
  24352. </p></dd>
  24353. </dl>
  24354. <ul class="mini-toc">
  24355. <li><a href="#Examples-63" accesskey="1">Examples</a></li>
  24356. </ul>
  24357. <div class="subsection-level-extent" id="Examples-63">
  24358. <h4 class="subsection"><span>30.16.1 Examples<a class="copiable-link" href="#Examples-63"> &para;</a></span></h4>
  24359. <ul class="itemize mark-bullet">
  24360. <li>Determine blockiness for the first plane and search for periods within [8,32]:
  24361. <div class="example">
  24362. <pre class="example-preformatted">blockdetect=period_min=8:period_max=32:planes=1
  24363. </pre></div>
  24364. </li></ul>
  24365. <a class="anchor" id="blurdetect"></a></div>
  24366. </div>
  24367. <div class="section-level-extent" id="blurdetect-1">
  24368. <h3 class="section"><span>30.17 blurdetect<a class="copiable-link" href="#blurdetect-1"> &para;</a></span></h3>
  24369. <p>Determines blurriness of frames without altering the input frames.
  24370. </p>
  24371. <p>Based on Marziliano, Pina, et al. &quot;A no-reference perceptual blur metric.&quot;
  24372. Allows for a block-based abbreviation.
  24373. </p>
  24374. <p>The filter accepts the following options:
  24375. </p>
  24376. <dl class="table">
  24377. <dt><samp class="option">low</samp></dt>
  24378. <dt><samp class="option">high</samp></dt>
  24379. <dd><p>Set low and high threshold values used by the Canny thresholding
  24380. algorithm.
  24381. </p>
  24382. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  24383. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  24384. by the low threshold.
  24385. </p>
  24386. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  24387. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  24388. </p>
  24389. <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>
  24390. is <code class="code">50/255</code>.
  24391. </p>
  24392. </dd>
  24393. <dt><samp class="option">radius</samp></dt>
  24394. <dd><p>Define the radius to search around an edge pixel for local maxima.
  24395. </p>
  24396. </dd>
  24397. <dt><samp class="option">block_pct</samp></dt>
  24398. <dd><p>Determine blurriness only for the most significant blocks, given in percentage.
  24399. </p>
  24400. </dd>
  24401. <dt><samp class="option">block_width</samp></dt>
  24402. <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>.
  24403. </p>
  24404. </dd>
  24405. <dt><samp class="option">block_height</samp></dt>
  24406. <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>.
  24407. </p>
  24408. </dd>
  24409. <dt><samp class="option">planes</samp></dt>
  24410. <dd><p>Set planes to filter. Default is first only.
  24411. </p></dd>
  24412. </dl>
  24413. <ul class="mini-toc">
  24414. <li><a href="#Examples-64" accesskey="1">Examples</a></li>
  24415. </ul>
  24416. <div class="subsection-level-extent" id="Examples-64">
  24417. <h4 class="subsection"><span>30.17.1 Examples<a class="copiable-link" href="#Examples-64"> &para;</a></span></h4>
  24418. <ul class="itemize mark-bullet">
  24419. <li>Determine blur for 80% of most significant 32x32 blocks:
  24420. <div class="example">
  24421. <pre class="example-preformatted">blurdetect=block_width=32:block_height=32:block_pct=80
  24422. </pre></div>
  24423. </li></ul>
  24424. </div>
  24425. </div>
  24426. <div class="section-level-extent" id="bm3d">
  24427. <h3 class="section"><span>30.18 bm3d<a class="copiable-link" href="#bm3d"> &para;</a></span></h3>
  24428. <p>Denoise frames using Block-Matching 3D algorithm.
  24429. </p>
  24430. <p>The filter accepts the following options.
  24431. </p>
  24432. <dl class="table">
  24433. <dt><samp class="option">sigma</samp></dt>
  24434. <dd><p>Set denoising strength. Default value is 1.
  24435. Allowed range is from 0 to 999.9.
  24436. The denoising algorithm is very sensitive to sigma, so adjust it
  24437. according to the source.
  24438. </p>
  24439. </dd>
  24440. <dt><samp class="option">block</samp></dt>
  24441. <dd><p>Set local patch size. This sets dimensions in 2D.
  24442. </p>
  24443. </dd>
  24444. <dt><samp class="option">bstep</samp></dt>
  24445. <dd><p>Set sliding step for processing blocks. Default value is 4.
  24446. Allowed range is from 1 to 64.
  24447. Smaller values allows processing more reference blocks and is slower.
  24448. </p>
  24449. </dd>
  24450. <dt><samp class="option">group</samp></dt>
  24451. <dd><p>Set maximal number of similar blocks for 3rd dimension. Default value is 1.
  24452. When set to 1, no block matching is done. Larger values allows more blocks
  24453. in single group.
  24454. Allowed range is from 1 to 256.
  24455. </p>
  24456. </dd>
  24457. <dt><samp class="option">range</samp></dt>
  24458. <dd><p>Set radius for search block matching. Default is 9.
  24459. Allowed range is from 1 to INT32_MAX.
  24460. </p>
  24461. </dd>
  24462. <dt><samp class="option">mstep</samp></dt>
  24463. <dd><p>Set step between two search locations for block matching. Default is 1.
  24464. Allowed range is from 1 to 64. Smaller is slower.
  24465. </p>
  24466. </dd>
  24467. <dt><samp class="option">thmse</samp></dt>
  24468. <dd><p>Set threshold of mean square error for block matching. Valid range is 0 to
  24469. INT32_MAX.
  24470. </p>
  24471. </dd>
  24472. <dt><samp class="option">hdthr</samp></dt>
  24473. <dd><p>Set thresholding parameter for hard thresholding in 3D transformed domain.
  24474. Larger values results in stronger hard-thresholding filtering in frequency
  24475. domain.
  24476. </p>
  24477. </dd>
  24478. <dt><samp class="option">estim</samp></dt>
  24479. <dd><p>Set filtering estimation mode. Can be <code class="code">basic</code> or <code class="code">final</code>.
  24480. Default is <code class="code">basic</code>.
  24481. </p>
  24482. </dd>
  24483. <dt><samp class="option">ref</samp></dt>
  24484. <dd><p>If enabled, filter will use 2nd stream for block matching.
  24485. Default is disabled for <code class="code">basic</code> value of <var class="var">estim</var> option,
  24486. and always enabled if value of <var class="var">estim</var> is <code class="code">final</code>.
  24487. </p>
  24488. </dd>
  24489. <dt><samp class="option">planes</samp></dt>
  24490. <dd><p>Set planes to filter. Default is all available except alpha.
  24491. </p></dd>
  24492. </dl>
  24493. <ul class="mini-toc">
  24494. <li><a href="#Examples-65" accesskey="1">Examples</a></li>
  24495. </ul>
  24496. <div class="subsection-level-extent" id="Examples-65">
  24497. <h4 class="subsection"><span>30.18.1 Examples<a class="copiable-link" href="#Examples-65"> &para;</a></span></h4>
  24498. <ul class="itemize mark-bullet">
  24499. <li>Basic filtering with bm3d:
  24500. <div class="example">
  24501. <pre class="example-preformatted">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
  24502. </pre></div>
  24503. </li><li>Same as above, but filtering only luma:
  24504. <div class="example">
  24505. <pre class="example-preformatted">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
  24506. </pre></div>
  24507. </li><li>Same as above, but with both estimation modes:
  24508. <div class="example">
  24509. <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
  24510. </pre></div>
  24511. </li><li>Same as above, but prefilter with <a class="ref" href="#nlmeans">nlmeans</a> filter instead:
  24512. <div class="example">
  24513. <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
  24514. </pre></div>
  24515. </li></ul>
  24516. </div>
  24517. </div>
  24518. <div class="section-level-extent" id="boxblur">
  24519. <h3 class="section"><span>30.19 boxblur<a class="copiable-link" href="#boxblur"> &para;</a></span></h3>
  24520. <p>Apply a boxblur algorithm to the input video.
  24521. </p>
  24522. <p>It accepts the following parameters:
  24523. </p>
  24524. <dl class="table">
  24525. <dt><samp class="option">luma_radius, lr</samp></dt>
  24526. <dt><samp class="option">luma_power, lp</samp></dt>
  24527. <dt><samp class="option">chroma_radius, cr</samp></dt>
  24528. <dt><samp class="option">chroma_power, cp</samp></dt>
  24529. <dt><samp class="option">alpha_radius, ar</samp></dt>
  24530. <dt><samp class="option">alpha_power, ap</samp></dt>
  24531. </dl>
  24532. <p>A description of the accepted options follows.
  24533. </p>
  24534. <dl class="table">
  24535. <dt><samp class="option">luma_radius, lr</samp></dt>
  24536. <dt><samp class="option">chroma_radius, cr</samp></dt>
  24537. <dt><samp class="option">alpha_radius, ar</samp></dt>
  24538. <dd><p>Set an expression for the box radius in pixels used for blurring the
  24539. corresponding input plane.
  24540. </p>
  24541. <p>The radius value must be a non-negative number, and must not be
  24542. greater than the value of the expression <code class="code">min(w,h)/2</code> for the
  24543. luma and alpha planes, and of <code class="code">min(cw,ch)/2</code> for the chroma
  24544. planes.
  24545. </p>
  24546. <p>Default value for <samp class="option">luma_radius</samp> is &quot;2&quot;. If not specified,
  24547. <samp class="option">chroma_radius</samp> and <samp class="option">alpha_radius</samp> default to the
  24548. corresponding value set for <samp class="option">luma_radius</samp>.
  24549. </p>
  24550. <p>The expressions can contain the following constants:
  24551. </p><dl class="table">
  24552. <dt><samp class="option">w</samp></dt>
  24553. <dt><samp class="option">h</samp></dt>
  24554. <dd><p>The input width and height in pixels.
  24555. </p>
  24556. </dd>
  24557. <dt><samp class="option">cw</samp></dt>
  24558. <dt><samp class="option">ch</samp></dt>
  24559. <dd><p>The input chroma image width and height in pixels.
  24560. </p>
  24561. </dd>
  24562. <dt><samp class="option">hsub</samp></dt>
  24563. <dt><samp class="option">vsub</samp></dt>
  24564. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  24565. pixel format &quot;yuv422p&quot;, <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  24566. </p></dd>
  24567. </dl>
  24568. </dd>
  24569. <dt><samp class="option">luma_power, lp</samp></dt>
  24570. <dt><samp class="option">chroma_power, cp</samp></dt>
  24571. <dt><samp class="option">alpha_power, ap</samp></dt>
  24572. <dd><p>Specify how many times the boxblur filter is applied to the
  24573. corresponding plane.
  24574. </p>
  24575. <p>Default value for <samp class="option">luma_power</samp> is 2. If not specified,
  24576. <samp class="option">chroma_power</samp> and <samp class="option">alpha_power</samp> default to the
  24577. corresponding value set for <samp class="option">luma_power</samp>.
  24578. </p>
  24579. <p>A value of 0 will disable the effect.
  24580. </p></dd>
  24581. </dl>
  24582. <ul class="mini-toc">
  24583. <li><a href="#Examples-66" accesskey="1">Examples</a></li>
  24584. </ul>
  24585. <div class="subsection-level-extent" id="Examples-66">
  24586. <h4 class="subsection"><span>30.19.1 Examples<a class="copiable-link" href="#Examples-66"> &para;</a></span></h4>
  24587. <ul class="itemize mark-bullet">
  24588. <li>Apply a boxblur filter with the luma, chroma, and alpha radii
  24589. set to 2:
  24590. <div class="example">
  24591. <pre class="example-preformatted">boxblur=luma_radius=2:luma_power=1
  24592. boxblur=2:1
  24593. </pre></div>
  24594. </li><li>Set the luma radius to 2, and alpha and chroma radius to 0:
  24595. <div class="example">
  24596. <pre class="example-preformatted">boxblur=2:1:cr=0:ar=0
  24597. </pre></div>
  24598. </li><li>Set the luma and chroma radii to a fraction of the video dimension:
  24599. <div class="example">
  24600. <pre class="example-preformatted">boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
  24601. </pre></div>
  24602. </li></ul>
  24603. <a class="anchor" id="bwdif"></a></div>
  24604. </div>
  24605. <div class="section-level-extent" id="bwdif-1">
  24606. <h3 class="section"><span>30.20 bwdif<a class="copiable-link" href="#bwdif-1"> &para;</a></span></h3>
  24607. <p>Deinterlace the input video (&quot;bwdif&quot; stands for &quot;Bob Weaver
  24608. Deinterlacing Filter&quot;).
  24609. </p>
  24610. <p>Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic
  24611. interpolation algorithms.
  24612. It accepts the following parameters:
  24613. </p>
  24614. <dl class="table">
  24615. <dt><samp class="option">mode</samp></dt>
  24616. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  24617. </p>
  24618. <dl class="table">
  24619. <dt><samp class="option">0, send_frame</samp></dt>
  24620. <dd><p>Output one frame for each frame.
  24621. </p></dd>
  24622. <dt><samp class="option">1, send_field</samp></dt>
  24623. <dd><p>Output one frame for each field.
  24624. </p></dd>
  24625. </dl>
  24626. <p>The default value is <code class="code">send_field</code>.
  24627. </p>
  24628. </dd>
  24629. <dt><samp class="option">parity</samp></dt>
  24630. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  24631. of the following values:
  24632. </p>
  24633. <dl class="table">
  24634. <dt><samp class="option">0, tff</samp></dt>
  24635. <dd><p>Assume the top field is first.
  24636. </p></dd>
  24637. <dt><samp class="option">1, bff</samp></dt>
  24638. <dd><p>Assume the bottom field is first.
  24639. </p></dd>
  24640. <dt><samp class="option">-1, auto</samp></dt>
  24641. <dd><p>Enable automatic detection of field parity.
  24642. </p></dd>
  24643. </dl>
  24644. <p>The default value is <code class="code">auto</code>.
  24645. If the interlacing is unknown or the decoder does not export this information,
  24646. top field first will be assumed.
  24647. </p>
  24648. </dd>
  24649. <dt><samp class="option">deint</samp></dt>
  24650. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  24651. values:
  24652. </p>
  24653. <dl class="table">
  24654. <dt><samp class="option">0, all</samp></dt>
  24655. <dd><p>Deinterlace all frames.
  24656. </p></dd>
  24657. <dt><samp class="option">1, interlaced</samp></dt>
  24658. <dd><p>Only deinterlace frames marked as interlaced.
  24659. </p></dd>
  24660. </dl>
  24661. <p>The default value is <code class="code">all</code>.
  24662. </p></dd>
  24663. </dl>
  24664. </div>
  24665. <div class="section-level-extent" id="bwdif_005fcuda">
  24666. <h3 class="section"><span>30.21 bwdif_cuda<a class="copiable-link" href="#bwdif_005fcuda"> &para;</a></span></h3>
  24667. <p>Deinterlace the input video using the <a class="ref" href="#bwdif">bwdif</a> algorithm, but implemented
  24668. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  24669. and/or nvenc.
  24670. </p>
  24671. <p>It accepts the following parameters:
  24672. </p>
  24673. <dl class="table">
  24674. <dt><samp class="option">mode</samp></dt>
  24675. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  24676. </p>
  24677. <dl class="table">
  24678. <dt><samp class="option">0, send_frame</samp></dt>
  24679. <dd><p>Output one frame for each frame.
  24680. </p></dd>
  24681. <dt><samp class="option">1, send_field</samp></dt>
  24682. <dd><p>Output one frame for each field.
  24683. </p></dd>
  24684. </dl>
  24685. <p>The default value is <code class="code">send_field</code>.
  24686. </p>
  24687. </dd>
  24688. <dt><samp class="option">parity</samp></dt>
  24689. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  24690. of the following values:
  24691. </p>
  24692. <dl class="table">
  24693. <dt><samp class="option">0, tff</samp></dt>
  24694. <dd><p>Assume the top field is first.
  24695. </p></dd>
  24696. <dt><samp class="option">1, bff</samp></dt>
  24697. <dd><p>Assume the bottom field is first.
  24698. </p></dd>
  24699. <dt><samp class="option">-1, auto</samp></dt>
  24700. <dd><p>Enable automatic detection of field parity.
  24701. </p></dd>
  24702. </dl>
  24703. <p>The default value is <code class="code">auto</code>.
  24704. If the interlacing is unknown or the decoder does not export this information,
  24705. top field first will be assumed.
  24706. </p>
  24707. </dd>
  24708. <dt><samp class="option">deint</samp></dt>
  24709. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  24710. values:
  24711. </p>
  24712. <dl class="table">
  24713. <dt><samp class="option">0, all</samp></dt>
  24714. <dd><p>Deinterlace all frames.
  24715. </p></dd>
  24716. <dt><samp class="option">1, interlaced</samp></dt>
  24717. <dd><p>Only deinterlace frames marked as interlaced.
  24718. </p></dd>
  24719. </dl>
  24720. <p>The default value is <code class="code">all</code>.
  24721. </p></dd>
  24722. </dl>
  24723. </div>
  24724. <div class="section-level-extent" id="ccrepack">
  24725. <h3 class="section"><span>30.22 ccrepack<a class="copiable-link" href="#ccrepack"> &para;</a></span></h3>
  24726. <p>Repack CEA-708 closed captioning side data
  24727. </p>
  24728. <p>This filter fixes various issues seen with commerical encoders
  24729. related to upstream malformed CEA-708 payloads, specifically
  24730. incorrect number of tuples (wrong cc_count for the target FPS),
  24731. and incorrect ordering of tuples (i.e. the CEA-608 tuples are not at
  24732. the first entries in the payload).
  24733. </p>
  24734. </div>
  24735. <div class="section-level-extent" id="cas">
  24736. <h3 class="section"><span>30.23 cas<a class="copiable-link" href="#cas"> &para;</a></span></h3>
  24737. <p>Apply Contrast Adaptive Sharpen filter to video stream.
  24738. </p>
  24739. <p>The filter accepts the following options:
  24740. </p>
  24741. <dl class="table">
  24742. <dt><samp class="option">strength</samp></dt>
  24743. <dd><p>Set the sharpening strength. Default value is 0.
  24744. </p>
  24745. </dd>
  24746. <dt><samp class="option">planes</samp></dt>
  24747. <dd><p>Set planes to filter. Default value is to filter all
  24748. planes except alpha plane.
  24749. </p></dd>
  24750. </dl>
  24751. <ul class="mini-toc">
  24752. <li><a href="#Commands-61" accesskey="1">Commands</a></li>
  24753. </ul>
  24754. <div class="subsection-level-extent" id="Commands-61">
  24755. <h4 class="subsection"><span>30.23.1 Commands<a class="copiable-link" href="#Commands-61"> &para;</a></span></h4>
  24756. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  24757. </p>
  24758. </div>
  24759. </div>
  24760. <div class="section-level-extent" id="chromahold">
  24761. <h3 class="section"><span>30.24 chromahold<a class="copiable-link" href="#chromahold"> &para;</a></span></h3>
  24762. <p>Remove all color information for all colors except for certain one.
  24763. </p>
  24764. <p>The filter accepts the following options:
  24765. </p>
  24766. <dl class="table">
  24767. <dt><samp class="option">color</samp></dt>
  24768. <dd><p>The color which will not be replaced with neutral chroma.
  24769. </p>
  24770. </dd>
  24771. <dt><samp class="option">similarity</samp></dt>
  24772. <dd><p>Similarity percentage with the above color.
  24773. 0.01 matches only the exact key color, while 1.0 matches everything.
  24774. </p>
  24775. </dd>
  24776. <dt><samp class="option">blend</samp></dt>
  24777. <dd><p>Blend percentage.
  24778. 0.0 makes pixels either fully gray, or not gray at all.
  24779. Higher values result in more preserved color.
  24780. </p>
  24781. </dd>
  24782. <dt><samp class="option">yuv</samp></dt>
  24783. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  24784. </p>
  24785. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  24786. This can be used to pass exact YUV values as hexadecimal numbers.
  24787. </p></dd>
  24788. </dl>
  24789. <ul class="mini-toc">
  24790. <li><a href="#Commands-62" accesskey="1">Commands</a></li>
  24791. </ul>
  24792. <div class="subsection-level-extent" id="Commands-62">
  24793. <h4 class="subsection"><span>30.24.1 Commands<a class="copiable-link" href="#Commands-62"> &para;</a></span></h4>
  24794. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  24795. The command accepts the same syntax of the corresponding option.
  24796. </p>
  24797. <p>If the specified expression is not valid, it is kept at its current
  24798. value.
  24799. </p>
  24800. <a class="anchor" id="chromakey"></a></div>
  24801. </div>
  24802. <div class="section-level-extent" id="chromakey-1">
  24803. <h3 class="section"><span>30.25 chromakey<a class="copiable-link" href="#chromakey-1"> &para;</a></span></h3>
  24804. <p>YUV colorspace color/chroma keying.
  24805. </p>
  24806. <p>The filter accepts the following options:
  24807. </p>
  24808. <dl class="table">
  24809. <dt><samp class="option">color</samp></dt>
  24810. <dd><p>The color which will be replaced with transparency.
  24811. </p>
  24812. </dd>
  24813. <dt><samp class="option">similarity</samp></dt>
  24814. <dd><p>Similarity percentage with the key color.
  24815. </p>
  24816. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  24817. </p>
  24818. </dd>
  24819. <dt><samp class="option">blend</samp></dt>
  24820. <dd><p>Blend percentage.
  24821. </p>
  24822. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  24823. </p>
  24824. <p>Higher values result in semi-transparent pixels, with a higher transparency
  24825. the more similar the pixels color is to the key color.
  24826. </p>
  24827. </dd>
  24828. <dt><samp class="option">yuv</samp></dt>
  24829. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  24830. </p>
  24831. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  24832. This can be used to pass exact YUV values as hexadecimal numbers.
  24833. </p></dd>
  24834. </dl>
  24835. <ul class="mini-toc">
  24836. <li><a href="#Commands-63" accesskey="1">Commands</a></li>
  24837. <li><a href="#Examples-67" accesskey="2">Examples</a></li>
  24838. </ul>
  24839. <div class="subsection-level-extent" id="Commands-63">
  24840. <h4 class="subsection"><span>30.25.1 Commands<a class="copiable-link" href="#Commands-63"> &para;</a></span></h4>
  24841. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  24842. The command accepts the same syntax of the corresponding option.
  24843. </p>
  24844. <p>If the specified expression is not valid, it is kept at its current
  24845. value.
  24846. </p>
  24847. </div>
  24848. <div class="subsection-level-extent" id="Examples-67">
  24849. <h4 class="subsection"><span>30.25.2 Examples<a class="copiable-link" href="#Examples-67"> &para;</a></span></h4>
  24850. <ul class="itemize mark-bullet">
  24851. <li>Make every green pixel in the input image transparent:
  24852. <div class="example">
  24853. <pre class="example-preformatted">ffmpeg -i input.png -vf chromakey=green out.png
  24854. </pre></div>
  24855. </li><li>Overlay a greenscreen-video on top of a static black background.
  24856. <div class="example">
  24857. <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
  24858. </pre></div>
  24859. </li></ul>
  24860. </div>
  24861. </div>
  24862. <div class="section-level-extent" id="chromakey_005fcuda">
  24863. <h3 class="section"><span>30.26 chromakey_cuda<a class="copiable-link" href="#chromakey_005fcuda"> &para;</a></span></h3>
  24864. <p>CUDA accelerated YUV colorspace color/chroma keying.
  24865. </p>
  24866. <p>This filter works like normal chromakey filter but operates on CUDA frames.
  24867. for more details and parameters see <a class="ref" href="#chromakey">chromakey</a>.
  24868. </p>
  24869. <ul class="mini-toc">
  24870. <li><a href="#Examples-68" accesskey="1">Examples</a></li>
  24871. </ul>
  24872. <div class="subsection-level-extent" id="Examples-68">
  24873. <h4 class="subsection"><span>30.26.1 Examples<a class="copiable-link" href="#Examples-68"> &para;</a></span></h4>
  24874. <ul class="itemize mark-bullet">
  24875. <li>Make all the green pixels in the input video transparent and use it as an overlay for another video:
  24876. <div class="example">
  24877. <pre class="example-preformatted">./ffmpeg \
  24878. -hwaccel cuda -hwaccel_output_format cuda -i input_green.mp4 \
  24879. -hwaccel cuda -hwaccel_output_format cuda -i base_video.mp4 \
  24880. -init_hw_device cuda \
  24881. -filter_complex \
  24882. &quot; \
  24883. [0:v]chromakey_cuda=0x25302D:0.1:0.12:1[overlay_video]; \
  24884. [1:v]scale_cuda=format=yuv420p[base]; \
  24885. [base][overlay_video]overlay_cuda&quot; \
  24886. -an -sn -c:v h264_nvenc -cq 20 output.mp4
  24887. </pre></div>
  24888. </li><li>Process two software sources, explicitly uploading the frames:
  24889. <div class="example">
  24890. <pre class="example-preformatted">./ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda \
  24891. -f lavfi -i color=size=800x600:color=white,format=yuv420p \
  24892. -f lavfi -i yuvtestsrc=size=200x200,format=yuv420p \
  24893. -filter_complex \
  24894. &quot; \
  24895. [0]hwupload[under]; \
  24896. [1]hwupload,chromakey_cuda=green:0.1:0.12[over]; \
  24897. [under][over]overlay_cuda&quot; \
  24898. -c:v hevc_nvenc -cq 18 -preset slow output.mp4
  24899. </pre></div>
  24900. </li></ul>
  24901. </div>
  24902. </div>
  24903. <div class="section-level-extent" id="chromanr">
  24904. <h3 class="section"><span>30.27 chromanr<a class="copiable-link" href="#chromanr"> &para;</a></span></h3>
  24905. <p>Reduce chrominance noise.
  24906. </p>
  24907. <p>The filter accepts the following options:
  24908. </p>
  24909. <dl class="table">
  24910. <dt><samp class="option">thres</samp></dt>
  24911. <dd><p>Set threshold for averaging chrominance values.
  24912. Sum of absolute difference of Y, U and V pixel components of current
  24913. pixel and neighbour pixels lower than this threshold will be used in
  24914. averaging. Luma component is left unchanged and is copied to output.
  24915. Default value is 30. Allowed range is from 1 to 200.
  24916. </p>
  24917. </dd>
  24918. <dt><samp class="option">sizew</samp></dt>
  24919. <dd><p>Set horizontal radius of rectangle used for averaging.
  24920. Allowed range is from 1 to 100. Default value is 5.
  24921. </p>
  24922. </dd>
  24923. <dt><samp class="option">sizeh</samp></dt>
  24924. <dd><p>Set vertical radius of rectangle used for averaging.
  24925. Allowed range is from 1 to 100. Default value is 5.
  24926. </p>
  24927. </dd>
  24928. <dt><samp class="option">stepw</samp></dt>
  24929. <dd><p>Set horizontal step when averaging. Default value is 1.
  24930. Allowed range is from 1 to 50.
  24931. Mostly useful to speed-up filtering.
  24932. </p>
  24933. </dd>
  24934. <dt><samp class="option">steph</samp></dt>
  24935. <dd><p>Set vertical step when averaging. Default value is 1.
  24936. Allowed range is from 1 to 50.
  24937. Mostly useful to speed-up filtering.
  24938. </p>
  24939. </dd>
  24940. <dt><samp class="option">threy</samp></dt>
  24941. <dd><p>Set Y threshold for averaging chrominance values.
  24942. Set finer control for max allowed difference between Y components
  24943. of current pixel and neigbour pixels.
  24944. Default value is 200. Allowed range is from 1 to 200.
  24945. </p>
  24946. </dd>
  24947. <dt><samp class="option">threu</samp></dt>
  24948. <dd><p>Set U threshold for averaging chrominance values.
  24949. Set finer control for max allowed difference between U components
  24950. of current pixel and neigbour pixels.
  24951. Default value is 200. Allowed range is from 1 to 200.
  24952. </p>
  24953. </dd>
  24954. <dt><samp class="option">threv</samp></dt>
  24955. <dd><p>Set V threshold for averaging chrominance values.
  24956. Set finer control for max allowed difference between V components
  24957. of current pixel and neigbour pixels.
  24958. Default value is 200. Allowed range is from 1 to 200.
  24959. </p>
  24960. </dd>
  24961. <dt><samp class="option">distance</samp></dt>
  24962. <dd><p>Set distance type used in calculations.
  24963. </p>
  24964. <dl class="table">
  24965. <dt>&lsquo;<samp class="samp">manhattan</samp>&rsquo;</dt>
  24966. <dd><p>Absolute difference.
  24967. </p></dd>
  24968. <dt>&lsquo;<samp class="samp">euclidean</samp>&rsquo;</dt>
  24969. <dd><p>Difference squared.
  24970. </p></dd>
  24971. </dl>
  24972. <p>Default distance type is manhattan.
  24973. </p></dd>
  24974. </dl>
  24975. <ul class="mini-toc">
  24976. <li><a href="#Commands-64" accesskey="1">Commands</a></li>
  24977. </ul>
  24978. <div class="subsection-level-extent" id="Commands-64">
  24979. <h4 class="subsection"><span>30.27.1 Commands<a class="copiable-link" href="#Commands-64"> &para;</a></span></h4>
  24980. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  24981. The command accepts the same syntax of the corresponding option.
  24982. </p>
  24983. </div>
  24984. </div>
  24985. <div class="section-level-extent" id="chromashift">
  24986. <h3 class="section"><span>30.28 chromashift<a class="copiable-link" href="#chromashift"> &para;</a></span></h3>
  24987. <p>Shift chroma pixels horizontally and/or vertically.
  24988. </p>
  24989. <p>The filter accepts the following options:
  24990. </p><dl class="table">
  24991. <dt><samp class="option">cbh</samp></dt>
  24992. <dd><p>Set amount to shift chroma-blue horizontally.
  24993. </p></dd>
  24994. <dt><samp class="option">cbv</samp></dt>
  24995. <dd><p>Set amount to shift chroma-blue vertically.
  24996. </p></dd>
  24997. <dt><samp class="option">crh</samp></dt>
  24998. <dd><p>Set amount to shift chroma-red horizontally.
  24999. </p></dd>
  25000. <dt><samp class="option">crv</samp></dt>
  25001. <dd><p>Set amount to shift chroma-red vertically.
  25002. </p></dd>
  25003. <dt><samp class="option">edge</samp></dt>
  25004. <dd><p>Set edge mode, can be <var class="var">smear</var>, default, or <var class="var">warp</var>.
  25005. </p></dd>
  25006. </dl>
  25007. <ul class="mini-toc">
  25008. <li><a href="#Commands-65" accesskey="1">Commands</a></li>
  25009. </ul>
  25010. <div class="subsection-level-extent" id="Commands-65">
  25011. <h4 class="subsection"><span>30.28.1 Commands<a class="copiable-link" href="#Commands-65"> &para;</a></span></h4>
  25012. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  25013. </p>
  25014. </div>
  25015. </div>
  25016. <div class="section-level-extent" id="ciescope">
  25017. <h3 class="section"><span>30.29 ciescope<a class="copiable-link" href="#ciescope"> &para;</a></span></h3>
  25018. <p>Display CIE color diagram with pixels overlaid onto it.
  25019. </p>
  25020. <p>The filter accepts the following options:
  25021. </p>
  25022. <dl class="table">
  25023. <dt><samp class="option">system</samp></dt>
  25024. <dd><p>Set color system.
  25025. </p>
  25026. <dl class="table">
  25027. <dt>&lsquo;<samp class="samp">ntsc, 470m</samp>&rsquo;</dt>
  25028. <dt>&lsquo;<samp class="samp">ebu, 470bg</samp>&rsquo;</dt>
  25029. <dt>&lsquo;<samp class="samp">smpte</samp>&rsquo;</dt>
  25030. <dt>&lsquo;<samp class="samp">240m</samp>&rsquo;</dt>
  25031. <dt>&lsquo;<samp class="samp">apple</samp>&rsquo;</dt>
  25032. <dt>&lsquo;<samp class="samp">widergb</samp>&rsquo;</dt>
  25033. <dt>&lsquo;<samp class="samp">cie1931</samp>&rsquo;</dt>
  25034. <dt>&lsquo;<samp class="samp">rec709, hdtv</samp>&rsquo;</dt>
  25035. <dt>&lsquo;<samp class="samp">uhdtv, rec2020</samp>&rsquo;</dt>
  25036. <dt>&lsquo;<samp class="samp">dcip3</samp>&rsquo;</dt>
  25037. </dl>
  25038. </dd>
  25039. <dt><samp class="option">cie</samp></dt>
  25040. <dd><p>Set CIE system.
  25041. </p>
  25042. <dl class="table">
  25043. <dt>&lsquo;<samp class="samp">xyy</samp>&rsquo;</dt>
  25044. <dt>&lsquo;<samp class="samp">ucs</samp>&rsquo;</dt>
  25045. <dt>&lsquo;<samp class="samp">luv</samp>&rsquo;</dt>
  25046. </dl>
  25047. </dd>
  25048. <dt><samp class="option">gamuts</samp></dt>
  25049. <dd><p>Set what gamuts to draw.
  25050. </p>
  25051. <p>See <code class="code">system</code> option for available values.
  25052. </p>
  25053. </dd>
  25054. <dt><samp class="option">size, s</samp></dt>
  25055. <dd><p>Set ciescope size, by default set to 512.
  25056. </p>
  25057. </dd>
  25058. <dt><samp class="option">intensity, i</samp></dt>
  25059. <dd><p>Set intensity used to map input pixel values to CIE diagram.
  25060. </p>
  25061. </dd>
  25062. <dt><samp class="option">contrast</samp></dt>
  25063. <dd><p>Set contrast used to draw tongue colors that are out of active color system gamut.
  25064. </p>
  25065. </dd>
  25066. <dt><samp class="option">corrgamma</samp></dt>
  25067. <dd><p>Correct gamma displayed on scope, by default enabled.
  25068. </p>
  25069. </dd>
  25070. <dt><samp class="option">showwhite</samp></dt>
  25071. <dd><p>Show white point on CIE diagram, by default disabled.
  25072. </p>
  25073. </dd>
  25074. <dt><samp class="option">gamma</samp></dt>
  25075. <dd><p>Set input gamma. Used only with XYZ input color space.
  25076. </p>
  25077. </dd>
  25078. <dt><samp class="option">fill</samp></dt>
  25079. <dd><p>Fill with CIE colors. By default is enabled.
  25080. </p></dd>
  25081. </dl>
  25082. </div>
  25083. <div class="section-level-extent" id="codecview">
  25084. <h3 class="section"><span>30.30 codecview<a class="copiable-link" href="#codecview"> &para;</a></span></h3>
  25085. <p>Visualize information exported by some codecs.
  25086. </p>
  25087. <p>Some codecs can export information through frames using side-data or other
  25088. means. For example, some MPEG based codecs export motion vectors through the
  25089. <var class="var">export_mvs</var> flag in the codec <samp class="option">flags2</samp> option.
  25090. </p>
  25091. <p>The filter accepts the following option:
  25092. </p>
  25093. <dl class="table">
  25094. <dt><samp class="option">block</samp></dt>
  25095. <dd><p>Display block partition structure using the luma plane.
  25096. </p>
  25097. </dd>
  25098. <dt><samp class="option">mv</samp></dt>
  25099. <dd><p>Set motion vectors to visualize.
  25100. </p>
  25101. <p>Available flags for <var class="var">mv</var> are:
  25102. </p>
  25103. <dl class="table">
  25104. <dt>&lsquo;<samp class="samp">pf</samp>&rsquo;</dt>
  25105. <dd><p>forward predicted MVs of P-frames
  25106. </p></dd>
  25107. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  25108. <dd><p>forward predicted MVs of B-frames
  25109. </p></dd>
  25110. <dt>&lsquo;<samp class="samp">bb</samp>&rsquo;</dt>
  25111. <dd><p>backward predicted MVs of B-frames
  25112. </p></dd>
  25113. </dl>
  25114. </dd>
  25115. <dt><samp class="option">qp</samp></dt>
  25116. <dd><p>Display quantization parameters using the chroma planes.
  25117. </p>
  25118. </dd>
  25119. <dt><samp class="option">mv_type, mvt</samp></dt>
  25120. <dd><p>Set motion vectors type to visualize. Includes MVs from all frames unless specified by <var class="var">frame_type</var> option.
  25121. </p>
  25122. <p>Available flags for <var class="var">mv_type</var> are:
  25123. </p>
  25124. <dl class="table">
  25125. <dt>&lsquo;<samp class="samp">fp</samp>&rsquo;</dt>
  25126. <dd><p>forward predicted MVs
  25127. </p></dd>
  25128. <dt>&lsquo;<samp class="samp">bp</samp>&rsquo;</dt>
  25129. <dd><p>backward predicted MVs
  25130. </p></dd>
  25131. </dl>
  25132. </dd>
  25133. <dt><samp class="option">frame_type, ft</samp></dt>
  25134. <dd><p>Set frame type to visualize motion vectors of.
  25135. </p>
  25136. <p>Available flags for <var class="var">frame_type</var> are:
  25137. </p>
  25138. <dl class="table">
  25139. <dt>&lsquo;<samp class="samp">if</samp>&rsquo;</dt>
  25140. <dd><p>intra-coded frames (I-frames)
  25141. </p></dd>
  25142. <dt>&lsquo;<samp class="samp">pf</samp>&rsquo;</dt>
  25143. <dd><p>predicted frames (P-frames)
  25144. </p></dd>
  25145. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  25146. <dd><p>bi-directionally predicted frames (B-frames)
  25147. </p></dd>
  25148. </dl>
  25149. </dd>
  25150. </dl>
  25151. <ul class="mini-toc">
  25152. <li><a href="#Examples-69" accesskey="1">Examples</a></li>
  25153. </ul>
  25154. <div class="subsection-level-extent" id="Examples-69">
  25155. <h4 class="subsection"><span>30.30.1 Examples<a class="copiable-link" href="#Examples-69"> &para;</a></span></h4>
  25156. <ul class="itemize mark-bullet">
  25157. <li>Visualize forward predicted MVs of all frames using <code class="command">ffplay</code>:
  25158. <div class="example">
  25159. <pre class="example-preformatted">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
  25160. </pre></div>
  25161. </li><li>Visualize multi-directionals MVs of P and B-Frames using <code class="command">ffplay</code>:
  25162. <div class="example">
  25163. <pre class="example-preformatted">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
  25164. </pre></div>
  25165. </li></ul>
  25166. </div>
  25167. </div>
  25168. <div class="section-level-extent" id="colorbalance">
  25169. <h3 class="section"><span>30.31 colorbalance<a class="copiable-link" href="#colorbalance"> &para;</a></span></h3>
  25170. <p>Modify intensity of primary colors (red, green and blue) of input frames.
  25171. </p>
  25172. <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
  25173. regions for the red-cyan, green-magenta or blue-yellow balance.
  25174. </p>
  25175. <p>A positive adjustment value shifts the balance towards the primary color, a negative
  25176. value towards the complementary color.
  25177. </p>
  25178. <p>The filter accepts the following options:
  25179. </p>
  25180. <dl class="table">
  25181. <dt><samp class="option">rs</samp></dt>
  25182. <dt><samp class="option">gs</samp></dt>
  25183. <dt><samp class="option">bs</samp></dt>
  25184. <dd><p>Adjust red, green and blue shadows (darkest pixels).
  25185. </p>
  25186. </dd>
  25187. <dt><samp class="option">rm</samp></dt>
  25188. <dt><samp class="option">gm</samp></dt>
  25189. <dt><samp class="option">bm</samp></dt>
  25190. <dd><p>Adjust red, green and blue midtones (medium pixels).
  25191. </p>
  25192. </dd>
  25193. <dt><samp class="option">rh</samp></dt>
  25194. <dt><samp class="option">gh</samp></dt>
  25195. <dt><samp class="option">bh</samp></dt>
  25196. <dd><p>Adjust red, green and blue highlights (brightest pixels).
  25197. </p>
  25198. <p>Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">0</code>.
  25199. </p>
  25200. </dd>
  25201. <dt><samp class="option">pl</samp></dt>
  25202. <dd><p>Preserve lightness when changing color balance. Default is disabled.
  25203. </p></dd>
  25204. </dl>
  25205. <ul class="mini-toc">
  25206. <li><a href="#Examples-70" accesskey="1">Examples</a></li>
  25207. <li><a href="#Commands-66" accesskey="2">Commands</a></li>
  25208. </ul>
  25209. <div class="subsection-level-extent" id="Examples-70">
  25210. <h4 class="subsection"><span>30.31.1 Examples<a class="copiable-link" href="#Examples-70"> &para;</a></span></h4>
  25211. <ul class="itemize mark-bullet">
  25212. <li>Add red color cast to shadows:
  25213. <div class="example">
  25214. <pre class="example-preformatted">colorbalance=rs=.3
  25215. </pre></div>
  25216. </li></ul>
  25217. </div>
  25218. <div class="subsection-level-extent" id="Commands-66">
  25219. <h4 class="subsection"><span>30.31.2 Commands<a class="copiable-link" href="#Commands-66"> &para;</a></span></h4>
  25220. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  25221. </p>
  25222. </div>
  25223. </div>
  25224. <div class="section-level-extent" id="colorcontrast">
  25225. <h3 class="section"><span>30.32 colorcontrast<a class="copiable-link" href="#colorcontrast"> &para;</a></span></h3>
  25226. <p>Adjust color contrast between RGB components.
  25227. </p>
  25228. <p>The filter accepts the following options:
  25229. </p>
  25230. <dl class="table">
  25231. <dt><samp class="option">rc</samp></dt>
  25232. <dd><p>Set the red-cyan contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  25233. </p>
  25234. </dd>
  25235. <dt><samp class="option">gm</samp></dt>
  25236. <dd><p>Set the green-magenta contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  25237. </p>
  25238. </dd>
  25239. <dt><samp class="option">by</samp></dt>
  25240. <dd><p>Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  25241. </p>
  25242. </dd>
  25243. <dt><samp class="option">rcw</samp></dt>
  25244. <dt><samp class="option">gmw</samp></dt>
  25245. <dt><samp class="option">byw</samp></dt>
  25246. <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.
  25247. Allowed range is from 0.0 to 1.0. If all weights are 0.0 filtering is disabled.
  25248. </p>
  25249. </dd>
  25250. <dt><samp class="option">pl</samp></dt>
  25251. <dd><p>Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  25252. </p></dd>
  25253. </dl>
  25254. <ul class="mini-toc">
  25255. <li><a href="#Commands-67" accesskey="1">Commands</a></li>
  25256. </ul>
  25257. <div class="subsection-level-extent" id="Commands-67">
  25258. <h4 class="subsection"><span>30.32.1 Commands<a class="copiable-link" href="#Commands-67"> &para;</a></span></h4>
  25259. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  25260. </p>
  25261. </div>
  25262. </div>
  25263. <div class="section-level-extent" id="colorcorrect">
  25264. <h3 class="section"><span>30.33 colorcorrect<a class="copiable-link" href="#colorcorrect"> &para;</a></span></h3>
  25265. <p>Adjust color white balance selectively for blacks and whites.
  25266. This filter operates in YUV colorspace.
  25267. </p>
  25268. <p>The filter accepts the following options:
  25269. </p>
  25270. <dl class="table">
  25271. <dt><samp class="option">rl</samp></dt>
  25272. <dd><p>Set the red shadow spot. Allowed range is from -1.0 to 1.0.
  25273. Default value is 0.
  25274. </p>
  25275. </dd>
  25276. <dt><samp class="option">bl</samp></dt>
  25277. <dd><p>Set the blue shadow spot. Allowed range is from -1.0 to 1.0.
  25278. Default value is 0.
  25279. </p>
  25280. </dd>
  25281. <dt><samp class="option">rh</samp></dt>
  25282. <dd><p>Set the red highlight spot. Allowed range is from -1.0 to 1.0.
  25283. Default value is 0.
  25284. </p>
  25285. </dd>
  25286. <dt><samp class="option">bh</samp></dt>
  25287. <dd><p>Set the blue highlight spot. Allowed range is from -1.0 to 1.0.
  25288. Default value is 0.
  25289. </p>
  25290. </dd>
  25291. <dt><samp class="option">saturation</samp></dt>
  25292. <dd><p>Set the amount of saturation. Allowed range is from -3.0 to 3.0.
  25293. Default value is 1.
  25294. </p>
  25295. </dd>
  25296. <dt><samp class="option">analyze</samp></dt>
  25297. <dd><p>If set to anything other than <code class="code">manual</code> it will analyze every frame and use derived
  25298. parameters for filtering output frame.
  25299. </p>
  25300. <p>Possible values are:
  25301. </p><dl class="table">
  25302. <dt>&lsquo;<samp class="samp">manual</samp>&rsquo;</dt>
  25303. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  25304. <dt>&lsquo;<samp class="samp">minmax</samp>&rsquo;</dt>
  25305. <dt>&lsquo;<samp class="samp">median</samp>&rsquo;</dt>
  25306. </dl>
  25307. <p>Default value is <code class="code">manual</code>.
  25308. </p></dd>
  25309. </dl>
  25310. <ul class="mini-toc">
  25311. <li><a href="#Commands-68" accesskey="1">Commands</a></li>
  25312. </ul>
  25313. <div class="subsection-level-extent" id="Commands-68">
  25314. <h4 class="subsection"><span>30.33.1 Commands<a class="copiable-link" href="#Commands-68"> &para;</a></span></h4>
  25315. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  25316. </p>
  25317. </div>
  25318. </div>
  25319. <div class="section-level-extent" id="colorchannelmixer">
  25320. <h3 class="section"><span>30.34 colorchannelmixer<a class="copiable-link" href="#colorchannelmixer"> &para;</a></span></h3>
  25321. <p>Adjust video input frames by re-mixing color channels.
  25322. </p>
  25323. <p>This filter modifies a color channel by adding the values associated to
  25324. the other channels of the same pixels. For example if the value to
  25325. modify is red, the output value will be:
  25326. </p><div class="example">
  25327. <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>
  25328. </pre></div>
  25329. <p>The filter accepts the following options:
  25330. </p>
  25331. <dl class="table">
  25332. <dt><samp class="option">rr</samp></dt>
  25333. <dt><samp class="option">rg</samp></dt>
  25334. <dt><samp class="option">rb</samp></dt>
  25335. <dt><samp class="option">ra</samp></dt>
  25336. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
  25337. 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>.
  25338. </p>
  25339. </dd>
  25340. <dt><samp class="option">gr</samp></dt>
  25341. <dt><samp class="option">gg</samp></dt>
  25342. <dt><samp class="option">gb</samp></dt>
  25343. <dt><samp class="option">ga</samp></dt>
  25344. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
  25345. 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>.
  25346. </p>
  25347. </dd>
  25348. <dt><samp class="option">br</samp></dt>
  25349. <dt><samp class="option">bg</samp></dt>
  25350. <dt><samp class="option">bb</samp></dt>
  25351. <dt><samp class="option">ba</samp></dt>
  25352. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
  25353. 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>.
  25354. </p>
  25355. </dd>
  25356. <dt><samp class="option">ar</samp></dt>
  25357. <dt><samp class="option">ag</samp></dt>
  25358. <dt><samp class="option">ab</samp></dt>
  25359. <dt><samp class="option">aa</samp></dt>
  25360. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
  25361. 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>.
  25362. </p>
  25363. <p>Allowed ranges for options are <code class="code">[-2.0, 2.0]</code>.
  25364. </p>
  25365. </dd>
  25366. <dt><samp class="option">pc</samp></dt>
  25367. <dd><p>Set preserve color mode. The accepted values are:
  25368. </p><dl class="table">
  25369. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  25370. <dd><p>Disable color preserving, this is default.
  25371. </p></dd>
  25372. <dt>&lsquo;<samp class="samp">lum</samp>&rsquo;</dt>
  25373. <dd><p>Preserve luminance.
  25374. </p></dd>
  25375. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  25376. <dd><p>Preserve max value of RGB triplet.
  25377. </p></dd>
  25378. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  25379. <dd><p>Preserve average value of RGB triplet.
  25380. </p></dd>
  25381. <dt>&lsquo;<samp class="samp">sum</samp>&rsquo;</dt>
  25382. <dd><p>Preserve sum value of RGB triplet.
  25383. </p></dd>
  25384. <dt>&lsquo;<samp class="samp">nrm</samp>&rsquo;</dt>
  25385. <dd><p>Preserve normalized value of RGB triplet.
  25386. </p></dd>
  25387. <dt>&lsquo;<samp class="samp">pwr</samp>&rsquo;</dt>
  25388. <dd><p>Preserve power value of RGB triplet.
  25389. </p></dd>
  25390. </dl>
  25391. </dd>
  25392. <dt><samp class="option">pa</samp></dt>
  25393. <dd><p>Set the preserve color amount when changing colors. Allowed range is from <code class="code">[0.0, 1.0]</code>.
  25394. Default is <code class="code">0.0</code>, thus disabled.
  25395. </p></dd>
  25396. </dl>
  25397. <ul class="mini-toc">
  25398. <li><a href="#Examples-71" accesskey="1">Examples</a></li>
  25399. <li><a href="#Commands-69" accesskey="2">Commands</a></li>
  25400. </ul>
  25401. <div class="subsection-level-extent" id="Examples-71">
  25402. <h4 class="subsection"><span>30.34.1 Examples<a class="copiable-link" href="#Examples-71"> &para;</a></span></h4>
  25403. <ul class="itemize mark-bullet">
  25404. <li>Convert source to grayscale:
  25405. <div class="example">
  25406. <pre class="example-preformatted">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
  25407. </pre></div>
  25408. </li><li>Simulate sepia tones:
  25409. <div class="example">
  25410. <pre class="example-preformatted">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
  25411. </pre></div>
  25412. </li></ul>
  25413. </div>
  25414. <div class="subsection-level-extent" id="Commands-69">
  25415. <h4 class="subsection"><span>30.34.2 Commands<a class="copiable-link" href="#Commands-69"> &para;</a></span></h4>
  25416. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  25417. </p>
  25418. </div>
  25419. </div>
  25420. <div class="section-level-extent" id="colorize">
  25421. <h3 class="section"><span>30.35 colorize<a class="copiable-link" href="#colorize"> &para;</a></span></h3>
  25422. <p>Overlay a solid color on the video stream.
  25423. </p>
  25424. <p>The filter accepts the following options:
  25425. </p>
  25426. <dl class="table">
  25427. <dt><samp class="option">hue</samp></dt>
  25428. <dd><p>Set the color hue. Allowed range is from 0 to 360.
  25429. Default value is 0.
  25430. </p>
  25431. </dd>
  25432. <dt><samp class="option">saturation</samp></dt>
  25433. <dd><p>Set the color saturation. Allowed range is from 0 to 1.
  25434. Default value is 0.5.
  25435. </p>
  25436. </dd>
  25437. <dt><samp class="option">lightness</samp></dt>
  25438. <dd><p>Set the color lightness. Allowed range is from 0 to 1.
  25439. Default value is 0.5.
  25440. </p>
  25441. </dd>
  25442. <dt><samp class="option">mix</samp></dt>
  25443. <dd><p>Set the mix of source lightness. By default is set to 1.0.
  25444. Allowed range is from 0.0 to 1.0.
  25445. </p></dd>
  25446. </dl>
  25447. <ul class="mini-toc">
  25448. <li><a href="#Commands-70" accesskey="1">Commands</a></li>
  25449. </ul>
  25450. <div class="subsection-level-extent" id="Commands-70">
  25451. <h4 class="subsection"><span>30.35.1 Commands<a class="copiable-link" href="#Commands-70"> &para;</a></span></h4>
  25452. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  25453. </p>
  25454. </div>
  25455. </div>
  25456. <div class="section-level-extent" id="colorkey">
  25457. <h3 class="section"><span>30.36 colorkey<a class="copiable-link" href="#colorkey"> &para;</a></span></h3>
  25458. <p>RGB colorspace color keying.
  25459. This filter operates on 8-bit RGB format frames by setting the alpha component of each pixel
  25460. which falls within the similarity radius of the key color to 0. The alpha value for pixels outside
  25461. the similarity radius depends on the value of the blend option.
  25462. </p>
  25463. <p>The filter accepts the following options:
  25464. </p>
  25465. <dl class="table">
  25466. <dt><samp class="option">color</samp></dt>
  25467. <dd><p>Set the color for which alpha will be set to 0 (full transparency).
  25468. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  25469. Default is <code class="code">black</code>.
  25470. </p>
  25471. </dd>
  25472. <dt><samp class="option">similarity</samp></dt>
  25473. <dd><p>Set the radius from the key color within which other colors also have full transparency.
  25474. The computed distance is related to the unit fractional distance in 3D space between the RGB values
  25475. 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
  25476. around the exact key color, while 1.0 matches everything.
  25477. Default is <code class="code">0.01</code>.
  25478. </p>
  25479. </dd>
  25480. <dt><samp class="option">blend</samp></dt>
  25481. <dd><p>Set how the alpha value for pixels that fall outside the similarity radius is computed.
  25482. 0.0 makes pixels either fully transparent or fully opaque.
  25483. Higher values result in semi-transparent pixels, with greater transparency
  25484. the more similar the pixel color is to the key color.
  25485. Range is 0.0 to 1.0. Default is <code class="code">0.0</code>.
  25486. </p></dd>
  25487. </dl>
  25488. <ul class="mini-toc">
  25489. <li><a href="#Examples-72" accesskey="1">Examples</a></li>
  25490. <li><a href="#Commands-71" accesskey="2">Commands</a></li>
  25491. </ul>
  25492. <div class="subsection-level-extent" id="Examples-72">
  25493. <h4 class="subsection"><span>30.36.1 Examples<a class="copiable-link" href="#Examples-72"> &para;</a></span></h4>
  25494. <ul class="itemize mark-bullet">
  25495. <li>Make every green pixel in the input image transparent:
  25496. <div class="example">
  25497. <pre class="example-preformatted">ffmpeg -i input.png -vf colorkey=green out.png
  25498. </pre></div>
  25499. </li><li>Overlay a greenscreen-video on top of a static background image.
  25500. <div class="example">
  25501. <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
  25502. </pre></div>
  25503. </li></ul>
  25504. </div>
  25505. <div class="subsection-level-extent" id="Commands-71">
  25506. <h4 class="subsection"><span>30.36.2 Commands<a class="copiable-link" href="#Commands-71"> &para;</a></span></h4>
  25507. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  25508. The command accepts the same syntax of the corresponding option.
  25509. </p>
  25510. <p>If the specified expression is not valid, it is kept at its current
  25511. value.
  25512. </p>
  25513. </div>
  25514. </div>
  25515. <div class="section-level-extent" id="colorhold">
  25516. <h3 class="section"><span>30.37 colorhold<a class="copiable-link" href="#colorhold"> &para;</a></span></h3>
  25517. <p>Remove all color information for all RGB colors except for certain one.
  25518. </p>
  25519. <p>The filter accepts the following options:
  25520. </p>
  25521. <dl class="table">
  25522. <dt><samp class="option">color</samp></dt>
  25523. <dd><p>The color which will not be replaced with neutral gray.
  25524. </p>
  25525. </dd>
  25526. <dt><samp class="option">similarity</samp></dt>
  25527. <dd><p>Similarity percentage with the above color.
  25528. 0.01 matches only the exact key color, while 1.0 matches everything.
  25529. </p>
  25530. </dd>
  25531. <dt><samp class="option">blend</samp></dt>
  25532. <dd><p>Blend percentage. 0.0 makes pixels fully gray.
  25533. Higher values result in more preserved color.
  25534. </p></dd>
  25535. </dl>
  25536. <ul class="mini-toc">
  25537. <li><a href="#Commands-72" accesskey="1">Commands</a></li>
  25538. </ul>
  25539. <div class="subsection-level-extent" id="Commands-72">
  25540. <h4 class="subsection"><span>30.37.1 Commands<a class="copiable-link" href="#Commands-72"> &para;</a></span></h4>
  25541. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  25542. The command accepts the same syntax of the corresponding option.
  25543. </p>
  25544. <p>If the specified expression is not valid, it is kept at its current
  25545. value.
  25546. </p>
  25547. </div>
  25548. </div>
  25549. <div class="section-level-extent" id="colorlevels">
  25550. <h3 class="section"><span>30.38 colorlevels<a class="copiable-link" href="#colorlevels"> &para;</a></span></h3>
  25551. <p>Adjust video input frames using levels.
  25552. </p>
  25553. <p>The filter accepts the following options:
  25554. </p>
  25555. <dl class="table">
  25556. <dt><samp class="option">rimin</samp></dt>
  25557. <dt><samp class="option">gimin</samp></dt>
  25558. <dt><samp class="option">bimin</samp></dt>
  25559. <dt><samp class="option">aimin</samp></dt>
  25560. <dd><p>Adjust red, green, blue and alpha input black point.
  25561. Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">0</code>.
  25562. </p>
  25563. </dd>
  25564. <dt><samp class="option">rimax</samp></dt>
  25565. <dt><samp class="option">gimax</samp></dt>
  25566. <dt><samp class="option">bimax</samp></dt>
  25567. <dt><samp class="option">aimax</samp></dt>
  25568. <dd><p>Adjust red, green, blue and alpha input white point.
  25569. Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">1</code>.
  25570. </p>
  25571. <p>Input levels are used to lighten highlights (bright tones), darken shadows
  25572. (dark tones), change the balance of bright and dark tones.
  25573. </p>
  25574. </dd>
  25575. <dt><samp class="option">romin</samp></dt>
  25576. <dt><samp class="option">gomin</samp></dt>
  25577. <dt><samp class="option">bomin</samp></dt>
  25578. <dt><samp class="option">aomin</samp></dt>
  25579. <dd><p>Adjust red, green, blue and alpha output black point.
  25580. Allowed ranges for options are <code class="code">[0, 1.0]</code>. Defaults are <code class="code">0</code>.
  25581. </p>
  25582. </dd>
  25583. <dt><samp class="option">romax</samp></dt>
  25584. <dt><samp class="option">gomax</samp></dt>
  25585. <dt><samp class="option">bomax</samp></dt>
  25586. <dt><samp class="option">aomax</samp></dt>
  25587. <dd><p>Adjust red, green, blue and alpha output white point.
  25588. Allowed ranges for options are <code class="code">[0, 1.0]</code>. Defaults are <code class="code">1</code>.
  25589. </p>
  25590. <p>Output levels allows manual selection of a constrained output level range.
  25591. </p>
  25592. </dd>
  25593. <dt><samp class="option">preserve</samp></dt>
  25594. <dd><p>Set preserve color mode. The accepted values are:
  25595. </p><dl class="table">
  25596. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  25597. <dd><p>Disable color preserving, this is default.
  25598. </p></dd>
  25599. <dt>&lsquo;<samp class="samp">lum</samp>&rsquo;</dt>
  25600. <dd><p>Preserve luminance.
  25601. </p></dd>
  25602. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  25603. <dd><p>Preserve max value of RGB triplet.
  25604. </p></dd>
  25605. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  25606. <dd><p>Preserve average value of RGB triplet.
  25607. </p></dd>
  25608. <dt>&lsquo;<samp class="samp">sum</samp>&rsquo;</dt>
  25609. <dd><p>Preserve sum value of RGB triplet.
  25610. </p></dd>
  25611. <dt>&lsquo;<samp class="samp">nrm</samp>&rsquo;</dt>
  25612. <dd><p>Preserve normalized value of RGB triplet.
  25613. </p></dd>
  25614. <dt>&lsquo;<samp class="samp">pwr</samp>&rsquo;</dt>
  25615. <dd><p>Preserve power value of RGB triplet.
  25616. </p></dd>
  25617. </dl>
  25618. </dd>
  25619. </dl>
  25620. <ul class="mini-toc">
  25621. <li><a href="#Examples-73" accesskey="1">Examples</a></li>
  25622. <li><a href="#Commands-73" accesskey="2">Commands</a></li>
  25623. </ul>
  25624. <div class="subsection-level-extent" id="Examples-73">
  25625. <h4 class="subsection"><span>30.38.1 Examples<a class="copiable-link" href="#Examples-73"> &para;</a></span></h4>
  25626. <ul class="itemize mark-bullet">
  25627. <li>Make video output darker:
  25628. <div class="example">
  25629. <pre class="example-preformatted">colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
  25630. </pre></div>
  25631. </li><li>Increase contrast:
  25632. <div class="example">
  25633. <pre class="example-preformatted">colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
  25634. </pre></div>
  25635. </li><li>Make video output lighter:
  25636. <div class="example">
  25637. <pre class="example-preformatted">colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
  25638. </pre></div>
  25639. </li><li>Increase brightness:
  25640. <div class="example">
  25641. <pre class="example-preformatted">colorlevels=romin=0.5:gomin=0.5:bomin=0.5
  25642. </pre></div>
  25643. </li></ul>
  25644. </div>
  25645. <div class="subsection-level-extent" id="Commands-73">
  25646. <h4 class="subsection"><span>30.38.2 Commands<a class="copiable-link" href="#Commands-73"> &para;</a></span></h4>
  25647. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  25648. </p>
  25649. </div>
  25650. </div>
  25651. <div class="section-level-extent" id="colormap">
  25652. <h3 class="section"><span>30.39 colormap<a class="copiable-link" href="#colormap"> &para;</a></span></h3>
  25653. <p>Apply custom color maps to video stream.
  25654. </p>
  25655. <p>This filter needs three input video streams.
  25656. First stream is video stream that is going to be filtered out.
  25657. Second and third video stream specify color patches for source
  25658. color to target color mapping.
  25659. </p>
  25660. <p>The filter accepts the following options:
  25661. </p>
  25662. <dl class="table">
  25663. <dt><samp class="option">patch_size</samp></dt>
  25664. <dd><p>Set the source and target video stream patch size in pixels.
  25665. </p>
  25666. </dd>
  25667. <dt><samp class="option">nb_patches</samp></dt>
  25668. <dd><p>Set the max number of used patches from source and target video stream.
  25669. Default value is number of patches available in additional video streams.
  25670. Max allowed number of patches is <code class="code">64</code>.
  25671. </p>
  25672. </dd>
  25673. <dt><samp class="option">type</samp></dt>
  25674. <dd><p>Set the adjustments used for target colors. Can be <code class="code">relative</code> or <code class="code">absolute</code>.
  25675. Defaults is <code class="code">absolute</code>.
  25676. </p>
  25677. </dd>
  25678. <dt><samp class="option">kernel</samp></dt>
  25679. <dd><p>Set the kernel used to measure color differences between mapped colors.
  25680. </p>
  25681. <p>The accepted values are:
  25682. </p><dl class="table">
  25683. <dt>&lsquo;<samp class="samp">euclidean</samp>&rsquo;</dt>
  25684. <dt>&lsquo;<samp class="samp">weuclidean</samp>&rsquo;</dt>
  25685. </dl>
  25686. <p>Default is <code class="code">euclidean</code>.
  25687. </p></dd>
  25688. </dl>
  25689. </div>
  25690. <div class="section-level-extent" id="colormatrix">
  25691. <h3 class="section"><span>30.40 colormatrix<a class="copiable-link" href="#colormatrix"> &para;</a></span></h3>
  25692. <p>Convert color matrix.
  25693. </p>
  25694. <p>The filter accepts the following options:
  25695. </p>
  25696. <dl class="table">
  25697. <dt><samp class="option">src</samp></dt>
  25698. <dt><samp class="option">dst</samp></dt>
  25699. <dd><p>Specify the source and destination color matrix. Both values must be
  25700. specified.
  25701. </p>
  25702. <p>The accepted values are:
  25703. </p><dl class="table">
  25704. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  25705. <dd><p>BT.709
  25706. </p>
  25707. </dd>
  25708. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  25709. <dd><p>FCC
  25710. </p>
  25711. </dd>
  25712. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  25713. <dd><p>BT.601
  25714. </p>
  25715. </dd>
  25716. <dt>&lsquo;<samp class="samp">bt470</samp>&rsquo;</dt>
  25717. <dd><p>BT.470
  25718. </p>
  25719. </dd>
  25720. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  25721. <dd><p>BT.470BG
  25722. </p>
  25723. </dd>
  25724. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  25725. <dd><p>SMPTE-170M
  25726. </p>
  25727. </dd>
  25728. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  25729. <dd><p>SMPTE-240M
  25730. </p>
  25731. </dd>
  25732. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  25733. <dd><p>BT.2020
  25734. </p></dd>
  25735. </dl>
  25736. </dd>
  25737. </dl>
  25738. <p>For example to convert from BT.601 to SMPTE-240M, use the command:
  25739. </p><div class="example">
  25740. <pre class="example-preformatted">colormatrix=bt601:smpte240m
  25741. </pre></div>
  25742. </div>
  25743. <div class="section-level-extent" id="colorspace">
  25744. <h3 class="section"><span>30.41 colorspace<a class="copiable-link" href="#colorspace"> &para;</a></span></h3>
  25745. <p>Convert colorspace, transfer characteristics or color primaries.
  25746. Input video needs to have an even size.
  25747. </p>
  25748. <p>The filter accepts the following options:
  25749. </p>
  25750. <dl class="table">
  25751. <dd><a class="anchor" id="all"></a></dd>
  25752. <dt><samp class="option">all</samp></dt>
  25753. <dd><p>Specify all color properties at once.
  25754. </p>
  25755. <p>The accepted values are:
  25756. </p><dl class="table">
  25757. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  25758. <dd><p>BT.470M
  25759. </p>
  25760. </dd>
  25761. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  25762. <dd><p>BT.470BG
  25763. </p>
  25764. </dd>
  25765. <dt>&lsquo;<samp class="samp">bt601-6-525</samp>&rsquo;</dt>
  25766. <dd><p>BT.601-6 525
  25767. </p>
  25768. </dd>
  25769. <dt>&lsquo;<samp class="samp">bt601-6-625</samp>&rsquo;</dt>
  25770. <dd><p>BT.601-6 625
  25771. </p>
  25772. </dd>
  25773. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  25774. <dd><p>BT.709
  25775. </p>
  25776. </dd>
  25777. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  25778. <dd><p>SMPTE-170M
  25779. </p>
  25780. </dd>
  25781. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  25782. <dd><p>SMPTE-240M
  25783. </p>
  25784. </dd>
  25785. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  25786. <dd><p>BT.2020
  25787. </p>
  25788. </dd>
  25789. </dl>
  25790. <a class="anchor" id="space"></a></dd>
  25791. <dt><samp class="option">space</samp></dt>
  25792. <dd><p>Specify output colorspace.
  25793. </p>
  25794. <p>The accepted values are:
  25795. </p><dl class="table">
  25796. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  25797. <dd><p>BT.709
  25798. </p>
  25799. </dd>
  25800. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  25801. <dd><p>FCC
  25802. </p>
  25803. </dd>
  25804. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  25805. <dd><p>BT.470BG or BT.601-6 625
  25806. </p>
  25807. </dd>
  25808. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  25809. <dd><p>SMPTE-170M or BT.601-6 525
  25810. </p>
  25811. </dd>
  25812. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  25813. <dd><p>SMPTE-240M
  25814. </p>
  25815. </dd>
  25816. <dt>&lsquo;<samp class="samp">ycgco</samp>&rsquo;</dt>
  25817. <dd><p>YCgCo
  25818. </p>
  25819. </dd>
  25820. <dt>&lsquo;<samp class="samp">bt2020ncl</samp>&rsquo;</dt>
  25821. <dd><p>BT.2020 with non-constant luminance
  25822. </p>
  25823. </dd>
  25824. </dl>
  25825. <a class="anchor" id="trc"></a></dd>
  25826. <dt><samp class="option">trc</samp></dt>
  25827. <dd><p>Specify output transfer characteristics.
  25828. </p>
  25829. <p>The accepted values are:
  25830. </p><dl class="table">
  25831. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  25832. <dd><p>BT.709
  25833. </p>
  25834. </dd>
  25835. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  25836. <dd><p>BT.470M
  25837. </p>
  25838. </dd>
  25839. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  25840. <dd><p>BT.470BG
  25841. </p>
  25842. </dd>
  25843. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  25844. <dd><p>Constant gamma of 2.2
  25845. </p>
  25846. </dd>
  25847. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  25848. <dd><p>Constant gamma of 2.8
  25849. </p>
  25850. </dd>
  25851. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  25852. <dd><p>SMPTE-170M, BT.601-6 625 or BT.601-6 525
  25853. </p>
  25854. </dd>
  25855. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  25856. <dd><p>SMPTE-240M
  25857. </p>
  25858. </dd>
  25859. <dt>&lsquo;<samp class="samp">srgb</samp>&rsquo;</dt>
  25860. <dd><p>SRGB
  25861. </p>
  25862. </dd>
  25863. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  25864. <dd><p>iec61966-2-1
  25865. </p>
  25866. </dd>
  25867. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  25868. <dd><p>iec61966-2-4
  25869. </p>
  25870. </dd>
  25871. <dt>&lsquo;<samp class="samp">xvycc</samp>&rsquo;</dt>
  25872. <dd><p>xvycc
  25873. </p>
  25874. </dd>
  25875. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  25876. <dd><p>BT.2020 for 10-bits content
  25877. </p>
  25878. </dd>
  25879. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  25880. <dd><p>BT.2020 for 12-bits content
  25881. </p>
  25882. </dd>
  25883. </dl>
  25884. <a class="anchor" id="primaries"></a></dd>
  25885. <dt><samp class="option">primaries</samp></dt>
  25886. <dd><p>Specify output color primaries.
  25887. </p>
  25888. <p>The accepted values are:
  25889. </p><dl class="table">
  25890. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  25891. <dd><p>BT.709
  25892. </p>
  25893. </dd>
  25894. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  25895. <dd><p>BT.470M
  25896. </p>
  25897. </dd>
  25898. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  25899. <dd><p>BT.470BG or BT.601-6 625
  25900. </p>
  25901. </dd>
  25902. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  25903. <dd><p>SMPTE-170M or BT.601-6 525
  25904. </p>
  25905. </dd>
  25906. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  25907. <dd><p>SMPTE-240M
  25908. </p>
  25909. </dd>
  25910. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  25911. <dd><p>film
  25912. </p>
  25913. </dd>
  25914. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  25915. <dd><p>SMPTE-431
  25916. </p>
  25917. </dd>
  25918. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  25919. <dd><p>SMPTE-432
  25920. </p>
  25921. </dd>
  25922. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  25923. <dd><p>BT.2020
  25924. </p>
  25925. </dd>
  25926. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  25927. <dd><p>JEDEC P22 phosphors
  25928. </p>
  25929. </dd>
  25930. </dl>
  25931. <a class="anchor" id="range"></a></dd>
  25932. <dt><samp class="option">range</samp></dt>
  25933. <dd><p>Specify output color range.
  25934. </p>
  25935. <p>The accepted values are:
  25936. </p><dl class="table">
  25937. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  25938. <dd><p>TV (restricted) range
  25939. </p>
  25940. </dd>
  25941. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  25942. <dd><p>MPEG (restricted) range
  25943. </p>
  25944. </dd>
  25945. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  25946. <dd><p>PC (full) range
  25947. </p>
  25948. </dd>
  25949. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  25950. <dd><p>JPEG (full) range
  25951. </p>
  25952. </dd>
  25953. </dl>
  25954. </dd>
  25955. <dt><samp class="option">format</samp></dt>
  25956. <dd><p>Specify output color format.
  25957. </p>
  25958. <p>The accepted values are:
  25959. </p><dl class="table">
  25960. <dt>&lsquo;<samp class="samp">yuv420p</samp>&rsquo;</dt>
  25961. <dd><p>YUV 4:2:0 planar 8-bits
  25962. </p>
  25963. </dd>
  25964. <dt>&lsquo;<samp class="samp">yuv420p10</samp>&rsquo;</dt>
  25965. <dd><p>YUV 4:2:0 planar 10-bits
  25966. </p>
  25967. </dd>
  25968. <dt>&lsquo;<samp class="samp">yuv420p12</samp>&rsquo;</dt>
  25969. <dd><p>YUV 4:2:0 planar 12-bits
  25970. </p>
  25971. </dd>
  25972. <dt>&lsquo;<samp class="samp">yuv422p</samp>&rsquo;</dt>
  25973. <dd><p>YUV 4:2:2 planar 8-bits
  25974. </p>
  25975. </dd>
  25976. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  25977. <dd><p>YUV 4:2:2 planar 10-bits
  25978. </p>
  25979. </dd>
  25980. <dt>&lsquo;<samp class="samp">yuv422p12</samp>&rsquo;</dt>
  25981. <dd><p>YUV 4:2:2 planar 12-bits
  25982. </p>
  25983. </dd>
  25984. <dt>&lsquo;<samp class="samp">yuv444p</samp>&rsquo;</dt>
  25985. <dd><p>YUV 4:4:4 planar 8-bits
  25986. </p>
  25987. </dd>
  25988. <dt>&lsquo;<samp class="samp">yuv444p10</samp>&rsquo;</dt>
  25989. <dd><p>YUV 4:4:4 planar 10-bits
  25990. </p>
  25991. </dd>
  25992. <dt>&lsquo;<samp class="samp">yuv444p12</samp>&rsquo;</dt>
  25993. <dd><p>YUV 4:4:4 planar 12-bits
  25994. </p>
  25995. </dd>
  25996. </dl>
  25997. </dd>
  25998. <dt><samp class="option">fast</samp></dt>
  25999. <dd><p>Do a fast conversion, which skips gamma/primary correction. This will take
  26000. significantly less CPU, but will be mathematically incorrect. To get output
  26001. compatible with that produced by the colormatrix filter, use fast=1.
  26002. </p>
  26003. </dd>
  26004. <dt><samp class="option">dither</samp></dt>
  26005. <dd><p>Specify dithering mode.
  26006. </p>
  26007. <p>The accepted values are:
  26008. </p><dl class="table">
  26009. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  26010. <dd><p>No dithering
  26011. </p>
  26012. </dd>
  26013. <dt>&lsquo;<samp class="samp">fsb</samp>&rsquo;</dt>
  26014. <dd><p>Floyd-Steinberg dithering
  26015. </p></dd>
  26016. </dl>
  26017. </dd>
  26018. <dt><samp class="option">wpadapt</samp></dt>
  26019. <dd><p>Whitepoint adaptation mode.
  26020. </p>
  26021. <p>The accepted values are:
  26022. </p><dl class="table">
  26023. <dt>&lsquo;<samp class="samp">bradford</samp>&rsquo;</dt>
  26024. <dd><p>Bradford whitepoint adaptation
  26025. </p>
  26026. </dd>
  26027. <dt>&lsquo;<samp class="samp">vonkries</samp>&rsquo;</dt>
  26028. <dd><p>von Kries whitepoint adaptation
  26029. </p>
  26030. </dd>
  26031. <dt>&lsquo;<samp class="samp">identity</samp>&rsquo;</dt>
  26032. <dd><p>identity whitepoint adaptation (i.e. no whitepoint adaptation)
  26033. </p></dd>
  26034. </dl>
  26035. </dd>
  26036. <dt><samp class="option">iall</samp></dt>
  26037. <dd><p>Override all input properties at once. Same accepted values as <a class="ref" href="#all">all</a>.
  26038. </p>
  26039. </dd>
  26040. <dt><samp class="option">ispace</samp></dt>
  26041. <dd><p>Override input colorspace. Same accepted values as <a class="ref" href="#space">space</a>.
  26042. </p>
  26043. </dd>
  26044. <dt><samp class="option">iprimaries</samp></dt>
  26045. <dd><p>Override input color primaries. Same accepted values as <a class="ref" href="#primaries">primaries</a>.
  26046. </p>
  26047. </dd>
  26048. <dt><samp class="option">itrc</samp></dt>
  26049. <dd><p>Override input transfer characteristics. Same accepted values as <a class="ref" href="#trc">trc</a>.
  26050. </p>
  26051. </dd>
  26052. <dt><samp class="option">irange</samp></dt>
  26053. <dd><p>Override input color range. Same accepted values as <a class="ref" href="#range">range</a>.
  26054. </p>
  26055. </dd>
  26056. </dl>
  26057. <p>The filter converts the transfer characteristics, color space and color
  26058. primaries to the specified user values. The output value, if not specified,
  26059. is set to a default value based on the &quot;all&quot; property. If that property is
  26060. also not specified, the filter will log an error. The output color range and
  26061. format default to the same value as the input color range and format. The
  26062. input transfer characteristics, color space, color primaries and color range
  26063. should be set on the input data. If any of these are missing, the filter will
  26064. log an error and no conversion will take place.
  26065. </p>
  26066. <p>For example to convert the input to SMPTE-240M, use the command:
  26067. </p><div class="example">
  26068. <pre class="example-preformatted">colorspace=smpte240m
  26069. </pre></div>
  26070. </div>
  26071. <div class="section-level-extent" id="colorspace_005fcuda">
  26072. <h3 class="section"><span>30.42 colorspace_cuda<a class="copiable-link" href="#colorspace_005fcuda"> &para;</a></span></h3>
  26073. <p>CUDA accelerated implementation of the colorspace filter.
  26074. </p>
  26075. <p>It is by no means feature complete compared to the software colorspace filter,
  26076. and at the current time only supports color range conversion between jpeg/full
  26077. and mpeg/limited range.
  26078. </p>
  26079. <p>The filter accepts the following options:
  26080. </p>
  26081. <dl class="table">
  26082. <dt><samp class="option">range</samp></dt>
  26083. <dd><p>Specify output color range.
  26084. </p>
  26085. <p>The accepted values are:
  26086. </p><dl class="table">
  26087. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  26088. <dd><p>TV (restricted) range
  26089. </p>
  26090. </dd>
  26091. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  26092. <dd><p>MPEG (restricted) range
  26093. </p>
  26094. </dd>
  26095. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  26096. <dd><p>PC (full) range
  26097. </p>
  26098. </dd>
  26099. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  26100. <dd><p>JPEG (full) range
  26101. </p>
  26102. </dd>
  26103. </dl>
  26104. </dd>
  26105. </dl>
  26106. </div>
  26107. <div class="section-level-extent" id="colortemperature">
  26108. <h3 class="section"><span>30.43 colortemperature<a class="copiable-link" href="#colortemperature"> &para;</a></span></h3>
  26109. <p>Adjust color temperature in video to simulate variations in ambient color temperature.
  26110. </p>
  26111. <p>The filter accepts the following options:
  26112. </p>
  26113. <dl class="table">
  26114. <dt><samp class="option">temperature</samp></dt>
  26115. <dd><p>Set the temperature in Kelvin. Allowed range is from 1000 to 40000.
  26116. Default value is 6500 K.
  26117. </p>
  26118. </dd>
  26119. <dt><samp class="option">mix</samp></dt>
  26120. <dd><p>Set mixing with filtered output. Allowed range is from 0 to 1.
  26121. Default value is 1.
  26122. </p>
  26123. </dd>
  26124. <dt><samp class="option">pl</samp></dt>
  26125. <dd><p>Set the amount of preserving lightness. Allowed range is from 0 to 1.
  26126. Default value is 0.
  26127. </p></dd>
  26128. </dl>
  26129. <ul class="mini-toc">
  26130. <li><a href="#Commands-74" accesskey="1">Commands</a></li>
  26131. </ul>
  26132. <div class="subsection-level-extent" id="Commands-74">
  26133. <h4 class="subsection"><span>30.43.1 Commands<a class="copiable-link" href="#Commands-74"> &para;</a></span></h4>
  26134. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  26135. </p>
  26136. </div>
  26137. </div>
  26138. <div class="section-level-extent" id="convolution">
  26139. <h3 class="section"><span>30.44 convolution<a class="copiable-link" href="#convolution"> &para;</a></span></h3>
  26140. <p>Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements.
  26141. </p>
  26142. <p>The filter accepts the following options:
  26143. </p>
  26144. <dl class="table">
  26145. <dt><samp class="option">0m</samp></dt>
  26146. <dt><samp class="option">1m</samp></dt>
  26147. <dt><samp class="option">2m</samp></dt>
  26148. <dt><samp class="option">3m</samp></dt>
  26149. <dd><p>Set matrix for each plane.
  26150. Matrix is sequence of 9, 25 or 49 signed integers in <var class="var">square</var> mode,
  26151. and from 1 to 49 odd number of signed integers in <var class="var">row</var> mode.
  26152. </p>
  26153. </dd>
  26154. <dt><samp class="option">0rdiv</samp></dt>
  26155. <dt><samp class="option">1rdiv</samp></dt>
  26156. <dt><samp class="option">2rdiv</samp></dt>
  26157. <dt><samp class="option">3rdiv</samp></dt>
  26158. <dd><p>Set multiplier for calculated value for each plane.
  26159. If unset or 0, it will be 1/sum of all matrix elements.
  26160. </p>
  26161. </dd>
  26162. <dt><samp class="option">0bias</samp></dt>
  26163. <dt><samp class="option">1bias</samp></dt>
  26164. <dt><samp class="option">2bias</samp></dt>
  26165. <dt><samp class="option">3bias</samp></dt>
  26166. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  26167. Useful for making the overall image brighter or darker. Default is 0.0.
  26168. </p>
  26169. </dd>
  26170. <dt><samp class="option">0mode</samp></dt>
  26171. <dt><samp class="option">1mode</samp></dt>
  26172. <dt><samp class="option">2mode</samp></dt>
  26173. <dt><samp class="option">3mode</samp></dt>
  26174. <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>.
  26175. Default is <var class="var">square</var>.
  26176. </p></dd>
  26177. </dl>
  26178. <ul class="mini-toc">
  26179. <li><a href="#Commands-75" accesskey="1">Commands</a></li>
  26180. <li><a href="#Examples-74" accesskey="2">Examples</a></li>
  26181. </ul>
  26182. <div class="subsection-level-extent" id="Commands-75">
  26183. <h4 class="subsection"><span>30.44.1 Commands<a class="copiable-link" href="#Commands-75"> &para;</a></span></h4>
  26184. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  26185. </p>
  26186. </div>
  26187. <div class="subsection-level-extent" id="Examples-74">
  26188. <h4 class="subsection"><span>30.44.2 Examples<a class="copiable-link" href="#Examples-74"> &para;</a></span></h4>
  26189. <ul class="itemize mark-bullet">
  26190. <li>Apply sharpen:
  26191. <div class="example">
  26192. <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;
  26193. </pre></div>
  26194. </li><li>Apply blur:
  26195. <div class="example">
  26196. <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;
  26197. </pre></div>
  26198. </li><li>Apply edge enhance:
  26199. <div class="example">
  26200. <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;
  26201. </pre></div>
  26202. </li><li>Apply edge detect:
  26203. <div class="example">
  26204. <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;
  26205. </pre></div>
  26206. </li><li>Apply laplacian edge detector which includes diagonals:
  26207. <div class="example">
  26208. <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;
  26209. </pre></div>
  26210. </li><li>Apply emboss:
  26211. <div class="example">
  26212. <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;
  26213. </pre></div>
  26214. </li></ul>
  26215. </div>
  26216. </div>
  26217. <div class="section-level-extent" id="convolve">
  26218. <h3 class="section"><span>30.45 convolve<a class="copiable-link" href="#convolve"> &para;</a></span></h3>
  26219. <p>Apply 2D convolution of video stream in frequency domain using second stream
  26220. as impulse.
  26221. </p>
  26222. <p>The filter accepts the following options:
  26223. </p>
  26224. <dl class="table">
  26225. <dt><samp class="option">planes</samp></dt>
  26226. <dd><p>Set which planes to process.
  26227. </p>
  26228. </dd>
  26229. <dt><samp class="option">impulse</samp></dt>
  26230. <dd><p>Set which impulse video frames will be processed, can be <var class="var">first</var>
  26231. or <var class="var">all</var>. Default is <var class="var">all</var>.
  26232. </p></dd>
  26233. </dl>
  26234. <p>The <code class="code">convolve</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  26235. </p>
  26236. </div>
  26237. <div class="section-level-extent" id="copy">
  26238. <h3 class="section"><span>30.46 copy<a class="copiable-link" href="#copy"> &para;</a></span></h3>
  26239. <p>Copy the input video source unchanged to the output. This is mainly useful for
  26240. testing purposes.
  26241. </p>
  26242. <a class="anchor" id="coreimage"></a></div>
  26243. <div class="section-level-extent" id="coreimage-1">
  26244. <h3 class="section"><span>30.47 coreimage<a class="copiable-link" href="#coreimage-1"> &para;</a></span></h3>
  26245. <p>Video filtering on GPU using Apple&rsquo;s CoreImage API on OSX.
  26246. </p>
  26247. <p>Hardware acceleration is based on an OpenGL context. Usually, this means it is
  26248. processed by video hardware. However, software-based OpenGL implementations
  26249. exist which means there is no guarantee for hardware processing. It depends on
  26250. the respective OSX.
  26251. </p>
  26252. <p>There are many filters and image generators provided by Apple that come with a
  26253. large variety of options. The filter has to be referenced by its name along
  26254. with its options.
  26255. </p>
  26256. <p>The coreimage filter accepts the following options:
  26257. </p><dl class="table">
  26258. <dt><samp class="option">list_filters</samp></dt>
  26259. <dd><p>List all available filters and generators along with all their respective
  26260. options as well as possible minimum and maximum values along with the default
  26261. values.
  26262. </p><div class="example">
  26263. <pre class="example-preformatted">list_filters=true
  26264. </pre></div>
  26265. </dd>
  26266. <dt><samp class="option">filter</samp></dt>
  26267. <dd><p>Specify all filters by their respective name and options.
  26268. Use <var class="var">list_filters</var> to determine all valid filter names and options.
  26269. Numerical options are specified by a float value and are automatically clamped
  26270. to their respective value range. Vector and color options have to be specified
  26271. by a list of space separated float values. Character escaping has to be done.
  26272. A special option name <code class="code">default</code> is available to use default options for a
  26273. filter.
  26274. </p>
  26275. <p>It is required to specify either <code class="code">default</code> or at least one of the filter options.
  26276. All omitted options are used with their default values.
  26277. The syntax of the filter string is as follows:
  26278. </p><div class="example">
  26279. <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;][@...]][#...]
  26280. </pre></div>
  26281. </dd>
  26282. <dt><samp class="option">output_rect</samp></dt>
  26283. <dd><p>Specify a rectangle where the output of the filter chain is copied into the
  26284. input image. It is given by a list of space separated float values:
  26285. </p><div class="example">
  26286. <pre class="example-preformatted">output_rect=x\ y\ width\ height
  26287. </pre></div>
  26288. <p>If not given, the output rectangle equals the dimensions of the input image.
  26289. The output rectangle is automatically cropped at the borders of the input
  26290. image. Negative values are valid for each component.
  26291. </p><div class="example">
  26292. <pre class="example-preformatted">output_rect=25\ 25\ 100\ 100
  26293. </pre></div>
  26294. </dd>
  26295. </dl>
  26296. <p>Several filters can be chained for successive processing without GPU-HOST
  26297. transfers allowing for fast processing of complex filter chains.
  26298. Currently, only filters with zero (generators) or exactly one (filters) input
  26299. image and one output image are supported. Also, transition filters are not yet
  26300. usable as intended.
  26301. </p>
  26302. <p>Some filters generate output images with additional padding depending on the
  26303. respective filter kernel. The padding is automatically removed to ensure the
  26304. filter output has the same size as the input image.
  26305. </p>
  26306. <p>For image generators, the size of the output image is determined by the
  26307. previous output image of the filter chain or the input image of the whole
  26308. filterchain, respectively. The generators do not use the pixel information of
  26309. this image to generate their output. However, the generated output is
  26310. blended onto this image, resulting in partial or complete coverage of the
  26311. output image.
  26312. </p>
  26313. <p>The <a class="ref" href="#coreimagesrc">coreimagesrc</a> video source can be used for generating input images
  26314. which are directly fed into the filter chain. By using it, providing input
  26315. images by another video source or an input video is not required.
  26316. </p>
  26317. <ul class="mini-toc">
  26318. <li><a href="#Examples-75" accesskey="1">Examples</a></li>
  26319. </ul>
  26320. <div class="subsection-level-extent" id="Examples-75">
  26321. <h4 class="subsection"><span>30.47.1 Examples<a class="copiable-link" href="#Examples-75"> &para;</a></span></h4>
  26322. <ul class="itemize mark-bullet">
  26323. <li>List all filters available:
  26324. <div class="example">
  26325. <pre class="example-preformatted">coreimage=list_filters=true
  26326. </pre></div>
  26327. </li><li>Use the CIBoxBlur filter with default options to blur an image:
  26328. <div class="example">
  26329. <pre class="example-preformatted">coreimage=filter=CIBoxBlur@default
  26330. </pre></div>
  26331. </li><li>Use a filter chain with CISepiaTone at default values and CIVignetteEffect with
  26332. its center at 100x100 and a radius of 50 pixels:
  26333. <div class="example">
  26334. <pre class="example-preformatted">coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
  26335. </pre></div>
  26336. </li><li>Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  26337. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  26338. <div class="example">
  26339. <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
  26340. </pre></div>
  26341. </li></ul>
  26342. </div>
  26343. </div>
  26344. <div class="section-level-extent" id="corr">
  26345. <h3 class="section"><span>30.48 corr<a class="copiable-link" href="#corr"> &para;</a></span></h3>
  26346. <p>Obtain the correlation between two input videos.
  26347. </p>
  26348. <p>This filter takes two input videos.
  26349. </p>
  26350. <p>Both input videos must have the same resolution and pixel format for
  26351. this filter to work correctly. Also it assumes that both inputs
  26352. have the same number of frames, which are compared one by one.
  26353. </p>
  26354. <p>The obtained per component, average, min and max correlation is printed through
  26355. the logging system.
  26356. </p>
  26357. <p>The filter stores the calculated correlation of each frame in frame metadata.
  26358. </p>
  26359. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  26360. </p>
  26361. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  26362. with the reference file <samp class="file">ref.mpg</samp>.
  26363. </p>
  26364. <div class="example">
  26365. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi corr -f null -
  26366. </pre></div>
  26367. </div>
  26368. <div class="section-level-extent" id="cover_005frect">
  26369. <h3 class="section"><span>30.49 cover_rect<a class="copiable-link" href="#cover_005frect"> &para;</a></span></h3>
  26370. <p>Cover a rectangular object
  26371. </p>
  26372. <p>It accepts the following options:
  26373. </p>
  26374. <dl class="table">
  26375. <dt><samp class="option">cover</samp></dt>
  26376. <dd><p>Filepath of the optional cover image, needs to be in yuv420.
  26377. </p>
  26378. </dd>
  26379. <dt><samp class="option">mode</samp></dt>
  26380. <dd><p>Set covering mode.
  26381. </p>
  26382. <p>It accepts the following values:
  26383. </p><dl class="table">
  26384. <dt>&lsquo;<samp class="samp">cover</samp>&rsquo;</dt>
  26385. <dd><p>cover it by the supplied image
  26386. </p></dd>
  26387. <dt>&lsquo;<samp class="samp">blur</samp>&rsquo;</dt>
  26388. <dd><p>cover it by interpolating the surrounding pixels
  26389. </p></dd>
  26390. </dl>
  26391. <p>Default value is <var class="var">blur</var>.
  26392. </p></dd>
  26393. </dl>
  26394. <ul class="mini-toc">
  26395. <li><a href="#Examples-76" accesskey="1">Examples</a></li>
  26396. </ul>
  26397. <div class="subsection-level-extent" id="Examples-76">
  26398. <h4 class="subsection"><span>30.49.1 Examples<a class="copiable-link" href="#Examples-76"> &para;</a></span></h4>
  26399. <ul class="itemize mark-bullet">
  26400. <li>Cover a rectangular object by the supplied image of a given video using <code class="command">ffmpeg</code>:
  26401. <div class="example">
  26402. <pre class="example-preformatted">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  26403. </pre></div>
  26404. </li></ul>
  26405. </div>
  26406. </div>
  26407. <div class="section-level-extent" id="crop">
  26408. <h3 class="section"><span>30.50 crop<a class="copiable-link" href="#crop"> &para;</a></span></h3>
  26409. <p>Crop the input video to given dimensions.
  26410. </p>
  26411. <p>It accepts the following parameters:
  26412. </p>
  26413. <dl class="table">
  26414. <dt><samp class="option">w, out_w</samp></dt>
  26415. <dd><p>The width of the output video. It defaults to <code class="code">iw</code>.
  26416. This expression is evaluated only once during the filter
  26417. configuration, or when the &lsquo;<samp class="samp">w</samp>&rsquo; or &lsquo;<samp class="samp">out_w</samp>&rsquo; command is sent.
  26418. </p>
  26419. </dd>
  26420. <dt><samp class="option">h, out_h</samp></dt>
  26421. <dd><p>The height of the output video. It defaults to <code class="code">ih</code>.
  26422. This expression is evaluated only once during the filter
  26423. configuration, or when the &lsquo;<samp class="samp">h</samp>&rsquo; or &lsquo;<samp class="samp">out_h</samp>&rsquo; command is sent.
  26424. </p>
  26425. </dd>
  26426. <dt><samp class="option">x</samp></dt>
  26427. <dd><p>The horizontal position, in the input video, of the left edge of the output
  26428. video. It defaults to <code class="code">(in_w-out_w)/2</code>.
  26429. This expression is evaluated per-frame.
  26430. </p>
  26431. </dd>
  26432. <dt><samp class="option">y</samp></dt>
  26433. <dd><p>The vertical position, in the input video, of the top edge of the output video.
  26434. It defaults to <code class="code">(in_h-out_h)/2</code>.
  26435. This expression is evaluated per-frame.
  26436. </p>
  26437. </dd>
  26438. <dt><samp class="option">keep_aspect</samp></dt>
  26439. <dd><p>If set to 1 will force the output display aspect ratio
  26440. to be the same of the input, by changing the output sample aspect
  26441. ratio. It defaults to 0.
  26442. </p>
  26443. </dd>
  26444. <dt><samp class="option">exact</samp></dt>
  26445. <dd><p>Enable exact cropping. If enabled, subsampled videos will be cropped at exact
  26446. width/height/x/y as specified and will not be rounded to nearest smaller value.
  26447. It defaults to 0.
  26448. </p></dd>
  26449. </dl>
  26450. <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
  26451. expressions containing the following constants:
  26452. </p>
  26453. <dl class="table">
  26454. <dt><samp class="option">x</samp></dt>
  26455. <dt><samp class="option">y</samp></dt>
  26456. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  26457. each new frame.
  26458. </p>
  26459. </dd>
  26460. <dt><samp class="option">in_w</samp></dt>
  26461. <dt><samp class="option">in_h</samp></dt>
  26462. <dd><p>The input width and height.
  26463. </p>
  26464. </dd>
  26465. <dt><samp class="option">iw</samp></dt>
  26466. <dt><samp class="option">ih</samp></dt>
  26467. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  26468. </p>
  26469. </dd>
  26470. <dt><samp class="option">out_w</samp></dt>
  26471. <dt><samp class="option">out_h</samp></dt>
  26472. <dd><p>The output (cropped) width and height.
  26473. </p>
  26474. </dd>
  26475. <dt><samp class="option">ow</samp></dt>
  26476. <dt><samp class="option">oh</samp></dt>
  26477. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  26478. </p>
  26479. </dd>
  26480. <dt><samp class="option">a</samp></dt>
  26481. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  26482. </p>
  26483. </dd>
  26484. <dt><samp class="option">sar</samp></dt>
  26485. <dd><p>input sample aspect ratio
  26486. </p>
  26487. </dd>
  26488. <dt><samp class="option">dar</samp></dt>
  26489. <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>
  26490. </p>
  26491. </dd>
  26492. <dt><samp class="option">hsub</samp></dt>
  26493. <dt><samp class="option">vsub</samp></dt>
  26494. <dd><p>horizontal and vertical chroma subsample values. For example for the
  26495. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  26496. </p>
  26497. </dd>
  26498. <dt><samp class="option">n</samp></dt>
  26499. <dd><p>The number of the input frame, starting from 0.
  26500. </p>
  26501. </dd>
  26502. <dt><samp class="option">pos</samp></dt>
  26503. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  26504. do not use
  26505. </p>
  26506. </dd>
  26507. <dt><samp class="option">t</samp></dt>
  26508. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  26509. </p>
  26510. </dd>
  26511. </dl>
  26512. <p>The expression for <var class="var">out_w</var> may depend on the value of <var class="var">out_h</var>,
  26513. and the expression for <var class="var">out_h</var> may depend on <var class="var">out_w</var>, but they
  26514. 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
  26515. evaluated after <var class="var">out_w</var> and <var class="var">out_h</var>.
  26516. </p>
  26517. <p>The <var class="var">x</var> and <var class="var">y</var> parameters specify the expressions for the
  26518. position of the top-left corner of the output (non-cropped) area. They
  26519. are evaluated for each frame. If the evaluated value is not valid, it
  26520. is approximated to the nearest valid value.
  26521. </p>
  26522. <p>The expression for <var class="var">x</var> may depend on <var class="var">y</var>, and the expression
  26523. for <var class="var">y</var> may depend on <var class="var">x</var>.
  26524. </p>
  26525. <ul class="mini-toc">
  26526. <li><a href="#Examples-77" accesskey="1">Examples</a></li>
  26527. <li><a href="#Commands-76" accesskey="2">Commands</a></li>
  26528. </ul>
  26529. <div class="subsection-level-extent" id="Examples-77">
  26530. <h4 class="subsection"><span>30.50.1 Examples<a class="copiable-link" href="#Examples-77"> &para;</a></span></h4>
  26531. <ul class="itemize mark-bullet">
  26532. <li>Crop area with size 100x100 at position (12,34).
  26533. <div class="example">
  26534. <pre class="example-preformatted">crop=100:100:12:34
  26535. </pre></div>
  26536. <p>Using named options, the example above becomes:
  26537. </p><div class="example">
  26538. <pre class="example-preformatted">crop=w=100:h=100:x=12:y=34
  26539. </pre></div>
  26540. </li><li>Crop the central input area with size 100x100:
  26541. <div class="example">
  26542. <pre class="example-preformatted">crop=100:100
  26543. </pre></div>
  26544. </li><li>Crop the central input area with size 2/3 of the input video:
  26545. <div class="example">
  26546. <pre class="example-preformatted">crop=2/3*in_w:2/3*in_h
  26547. </pre></div>
  26548. </li><li>Crop the input video central square:
  26549. <div class="example">
  26550. <pre class="example-preformatted">crop=out_w=in_h
  26551. crop=in_h
  26552. </pre></div>
  26553. </li><li>Delimit the rectangle with the top-left corner placed at position
  26554. 100:100 and the right-bottom corner corresponding to the right-bottom
  26555. corner of the input image.
  26556. <div class="example">
  26557. <pre class="example-preformatted">crop=in_w-100:in_h-100:100:100
  26558. </pre></div>
  26559. </li><li>Crop 10 pixels from the left and right borders, and 20 pixels from
  26560. the top and bottom borders
  26561. <div class="example">
  26562. <pre class="example-preformatted">crop=in_w-2*10:in_h-2*20
  26563. </pre></div>
  26564. </li><li>Keep only the bottom right quarter of the input image:
  26565. <div class="example">
  26566. <pre class="example-preformatted">crop=in_w/2:in_h/2:in_w/2:in_h/2
  26567. </pre></div>
  26568. </li><li>Crop height for getting Greek harmony:
  26569. <div class="example">
  26570. <pre class="example-preformatted">crop=in_w:1/PHI*in_w
  26571. </pre></div>
  26572. </li><li>Apply trembling effect:
  26573. <div class="example">
  26574. <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)
  26575. </pre></div>
  26576. </li><li>Apply erratic camera effect depending on timestamp:
  26577. <div class="example">
  26578. <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)
  26579. </pre></div>
  26580. </li><li>Set x depending on the value of y:
  26581. <div class="example">
  26582. <pre class="example-preformatted">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
  26583. </pre></div>
  26584. </li></ul>
  26585. </div>
  26586. <div class="subsection-level-extent" id="Commands-76">
  26587. <h4 class="subsection"><span>30.50.2 Commands<a class="copiable-link" href="#Commands-76"> &para;</a></span></h4>
  26588. <p>This filter supports the following commands:
  26589. </p><dl class="table">
  26590. <dt><samp class="option">w, out_w</samp></dt>
  26591. <dt><samp class="option">h, out_h</samp></dt>
  26592. <dt><samp class="option">x</samp></dt>
  26593. <dt><samp class="option">y</samp></dt>
  26594. <dd><p>Set width/height of the output video and the horizontal/vertical position
  26595. in the input video.
  26596. The command accepts the same syntax of the corresponding option.
  26597. </p>
  26598. <p>If the specified expression is not valid, it is kept at its current
  26599. value.
  26600. </p></dd>
  26601. </dl>
  26602. </div>
  26603. </div>
  26604. <div class="section-level-extent" id="cropdetect">
  26605. <h3 class="section"><span>30.51 cropdetect<a class="copiable-link" href="#cropdetect"> &para;</a></span></h3>
  26606. <p>Auto-detect the crop size.
  26607. </p>
  26608. <p>It calculates the necessary cropping parameters and prints the
  26609. recommended parameters via the logging system. The detected dimensions
  26610. correspond to the non-black or video area of the input video according to <var class="var">mode</var>.
  26611. </p>
  26612. <p>It accepts the following parameters:
  26613. </p>
  26614. <dl class="table">
  26615. <dt><samp class="option">mode</samp></dt>
  26616. <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.
  26617. </p>
  26618. <dl class="table">
  26619. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  26620. <dd><p>Detect black pixels surrounding the playing video. For fine control use option <var class="var">limit</var>.
  26621. </p>
  26622. </dd>
  26623. <dt>&lsquo;<samp class="samp">mvedges</samp>&rsquo;</dt>
  26624. <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.
  26625. </p></dd>
  26626. </dl>
  26627. </dd>
  26628. <dt><samp class="option">limit</samp></dt>
  26629. <dd><p>Set higher black value threshold, which can be optionally specified
  26630. from nothing (0) to everything (255 for 8-bit based formats). An intensity
  26631. value greater to the set value is considered non-black. It defaults to 24.
  26632. You can also specify a value between 0.0 and 1.0 which will be scaled depending
  26633. on the bitdepth of the pixel format.
  26634. </p>
  26635. </dd>
  26636. <dt><samp class="option">round</samp></dt>
  26637. <dd><p>The value which the width/height should be divisible by. It defaults to
  26638. 16. The offset is automatically adjusted to center the video. Use 2 to
  26639. get only even dimensions (needed for 4:2:2 video). 16 is best when
  26640. encoding to most video codecs.
  26641. </p>
  26642. </dd>
  26643. <dt><samp class="option">skip</samp></dt>
  26644. <dd><p>Set the number of initial frames for which evaluation is skipped.
  26645. Default is 2. Range is 0 to INT_MAX.
  26646. </p>
  26647. </dd>
  26648. <dt><samp class="option">reset_count, reset</samp></dt>
  26649. <dd><p>Set the counter that determines after how many frames cropdetect will
  26650. reset the previously detected largest video area and start over to
  26651. detect the current optimal crop area. Default value is 0.
  26652. </p>
  26653. <p>This can be useful when channel logos distort the video area. 0
  26654. indicates &rsquo;never reset&rsquo;, and returns the largest area encountered during
  26655. playback.
  26656. </p>
  26657. </dd>
  26658. <dt><samp class="option">mv_threshold</samp></dt>
  26659. <dd><p>Set motion in pixel units as threshold for motion detection. It defaults to 8.
  26660. </p>
  26661. </dd>
  26662. <dt><samp class="option">low</samp></dt>
  26663. <dt><samp class="option">high</samp></dt>
  26664. <dd><p>Set low and high threshold values used by the Canny thresholding
  26665. algorithm.
  26666. </p>
  26667. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  26668. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  26669. by the low threshold.
  26670. </p>
  26671. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  26672. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  26673. </p>
  26674. <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>
  26675. is <code class="code">15/255</code>.
  26676. </p></dd>
  26677. </dl>
  26678. <ul class="mini-toc">
  26679. <li><a href="#Examples-78" accesskey="1">Examples</a></li>
  26680. <li><a href="#Commands-77" accesskey="2">Commands</a></li>
  26681. </ul>
  26682. <div class="subsection-level-extent" id="Examples-78">
  26683. <h4 class="subsection"><span>30.51.1 Examples<a class="copiable-link" href="#Examples-78"> &para;</a></span></h4>
  26684. <ul class="itemize mark-bullet">
  26685. <li>Find video area surrounded by black borders:
  26686. <div class="example">
  26687. <pre class="example-preformatted">ffmpeg -i file.mp4 -vf cropdetect,metadata=mode=print -f null -
  26688. </pre></div>
  26689. </li><li>Find an embedded video area, generate motion vectors beforehand:
  26690. <div class="example">
  26691. <pre class="example-preformatted">ffmpeg -i file.mp4 -vf mestimate,cropdetect=mode=mvedges,metadata=mode=print -f null -
  26692. </pre></div>
  26693. </li><li>Find an embedded video area, use motion vectors from decoder:
  26694. <div class="example">
  26695. <pre class="example-preformatted">ffmpeg -flags2 +export_mvs -i file.mp4 -vf cropdetect=mode=mvedges,metadata=mode=print -f null -
  26696. </pre></div>
  26697. </li></ul>
  26698. </div>
  26699. <div class="subsection-level-extent" id="Commands-77">
  26700. <h4 class="subsection"><span>30.51.2 Commands<a class="copiable-link" href="#Commands-77"> &para;</a></span></h4>
  26701. <p>This filter supports the following commands:
  26702. </p>
  26703. <dl class="table">
  26704. <dt><samp class="option">limit</samp></dt>
  26705. <dd><p>The command accepts the same syntax of the corresponding option.
  26706. If the specified expression is not valid, it is kept at its current value.
  26707. </p></dd>
  26708. </dl>
  26709. <a class="anchor" id="cue"></a></div>
  26710. </div>
  26711. <div class="section-level-extent" id="cue-1">
  26712. <h3 class="section"><span>30.52 cue<a class="copiable-link" href="#cue-1"> &para;</a></span></h3>
  26713. <p>Delay video filtering until a given wallclock timestamp. The filter first
  26714. passes on <samp class="option">preroll</samp> amount of frames, then it buffers at most
  26715. <samp class="option">buffer</samp> amount of frames and waits for the cue. After reaching the cue
  26716. it forwards the buffered frames and also any subsequent frames coming in its
  26717. input.
  26718. </p>
  26719. <p>The filter can be used synchronize the output of multiple ffmpeg processes for
  26720. realtime output devices like decklink. By putting the delay in the filtering
  26721. chain and pre-buffering frames the process can pass on data to output almost
  26722. immediately after the target wallclock timestamp is reached.
  26723. </p>
  26724. <p>Perfect frame accuracy cannot be guaranteed, but the result is good enough for
  26725. some use cases.
  26726. </p>
  26727. <dl class="table">
  26728. <dt><samp class="option">cue</samp></dt>
  26729. <dd><p>The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0.
  26730. </p>
  26731. </dd>
  26732. <dt><samp class="option">preroll</samp></dt>
  26733. <dd><p>The duration of content to pass on as preroll expressed in seconds. Default is 0.
  26734. </p>
  26735. </dd>
  26736. <dt><samp class="option">buffer</samp></dt>
  26737. <dd><p>The maximum duration of content to buffer before waiting for the cue expressed
  26738. in seconds. Default is 0.
  26739. </p>
  26740. </dd>
  26741. </dl>
  26742. <a class="anchor" id="curves"></a></div>
  26743. <div class="section-level-extent" id="curves-1">
  26744. <h3 class="section"><span>30.53 curves<a class="copiable-link" href="#curves-1"> &para;</a></span></h3>
  26745. <p>Apply color adjustments using curves.
  26746. </p>
  26747. <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
  26748. component (red, green and blue) has its values defined by <var class="var">N</var> key points
  26749. tied from each other using a smooth curve. The x-axis represents the pixel
  26750. values from the input frame, and the y-axis the new pixel values to be set for
  26751. the output frame.
  26752. </p>
  26753. <p>By default, a component curve is defined by the two points <var class="var">(0;0)</var> and
  26754. <var class="var">(1;1)</var>. This creates a straight line where each original pixel value is
  26755. &quot;adjusted&quot; to its own value, which means no change to the image.
  26756. </p>
  26757. <p>The filter allows you to redefine these two points and add some more. A new
  26758. curve will be define to pass smoothly through all these new coordinates. The
  26759. new defined points needs to be strictly increasing over the x-axis, and their
  26760. <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
  26761. formed by using a natural or monotonic cubic spline interpolation, depending
  26762. on the <var class="var">interp</var> option (default: <code class="code">natural</code>). The <code class="code">natural</code>
  26763. spline produces a smoother curve in general while the monotonic (<code class="code">pchip</code>)
  26764. spline guarantees the transitions between the specified points to be
  26765. monotonic. If the computed curves happened to go outside the vector spaces,
  26766. the values will be clipped accordingly.
  26767. </p>
  26768. <p>The filter accepts the following options:
  26769. </p>
  26770. <dl class="table">
  26771. <dt><samp class="option">preset</samp></dt>
  26772. <dd><p>Select one of the available color presets. This option can be used in addition
  26773. to the <samp class="option">r</samp>, <samp class="option">g</samp>, <samp class="option">b</samp> parameters; in this case, the later
  26774. options takes priority on the preset values.
  26775. Available presets are:
  26776. </p><dl class="table">
  26777. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  26778. <dt>&lsquo;<samp class="samp">color_negative</samp>&rsquo;</dt>
  26779. <dt>&lsquo;<samp class="samp">cross_process</samp>&rsquo;</dt>
  26780. <dt>&lsquo;<samp class="samp">darker</samp>&rsquo;</dt>
  26781. <dt>&lsquo;<samp class="samp">increase_contrast</samp>&rsquo;</dt>
  26782. <dt>&lsquo;<samp class="samp">lighter</samp>&rsquo;</dt>
  26783. <dt>&lsquo;<samp class="samp">linear_contrast</samp>&rsquo;</dt>
  26784. <dt>&lsquo;<samp class="samp">medium_contrast</samp>&rsquo;</dt>
  26785. <dt>&lsquo;<samp class="samp">negative</samp>&rsquo;</dt>
  26786. <dt>&lsquo;<samp class="samp">strong_contrast</samp>&rsquo;</dt>
  26787. <dt>&lsquo;<samp class="samp">vintage</samp>&rsquo;</dt>
  26788. </dl>
  26789. <p>Default is <code class="code">none</code>.
  26790. </p></dd>
  26791. <dt><samp class="option">master, m</samp></dt>
  26792. <dd><p>Set the master key points. These points will define a second pass mapping. It
  26793. is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
  26794. <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
  26795. post-processing LUT.
  26796. </p></dd>
  26797. <dt><samp class="option">red, r</samp></dt>
  26798. <dd><p>Set the key points for the red component.
  26799. </p></dd>
  26800. <dt><samp class="option">green, g</samp></dt>
  26801. <dd><p>Set the key points for the green component.
  26802. </p></dd>
  26803. <dt><samp class="option">blue, b</samp></dt>
  26804. <dd><p>Set the key points for the blue component.
  26805. </p></dd>
  26806. <dt><samp class="option">all</samp></dt>
  26807. <dd><p>Set the key points for all components (not including master).
  26808. Can be used in addition to the other key points component
  26809. options. In this case, the unset component(s) will fallback on this
  26810. <samp class="option">all</samp> setting.
  26811. </p></dd>
  26812. <dt><samp class="option">psfile</samp></dt>
  26813. <dd><p>Specify a Photoshop curves file (<code class="code">.acv</code>) to import the settings from.
  26814. </p></dd>
  26815. <dt><samp class="option">plot</samp></dt>
  26816. <dd><p>Save Gnuplot script of the curves in specified file.
  26817. </p></dd>
  26818. <dt><samp class="option">interp</samp></dt>
  26819. <dd><p>Specify the kind of interpolation. Available algorithms are:
  26820. </p><dl class="table">
  26821. <dt>&lsquo;<samp class="samp">natural</samp>&rsquo;</dt>
  26822. <dd><p>Natural cubic spline using a piece-wise cubic polynomial that is twice continuously differentiable.
  26823. </p></dd>
  26824. <dt>&lsquo;<samp class="samp">pchip</samp>&rsquo;</dt>
  26825. <dd><p>Monotonic cubic spline using a piecewise cubic Hermite interpolating polynomial (PCHIP).
  26826. </p></dd>
  26827. </dl>
  26828. </dd>
  26829. </dl>
  26830. <p>To avoid some filtergraph syntax conflicts, each key points list need to be
  26831. defined using the following syntax: <code class="code">x0/y0 x1/y1 x2/y2 ...</code>.
  26832. </p>
  26833. <ul class="mini-toc">
  26834. <li><a href="#Commands-78" accesskey="1">Commands</a></li>
  26835. <li><a href="#Examples-79" accesskey="2">Examples</a></li>
  26836. </ul>
  26837. <div class="subsection-level-extent" id="Commands-78">
  26838. <h4 class="subsection"><span>30.53.1 Commands<a class="copiable-link" href="#Commands-78"> &para;</a></span></h4>
  26839. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  26840. </p>
  26841. </div>
  26842. <div class="subsection-level-extent" id="Examples-79">
  26843. <h4 class="subsection"><span>30.53.2 Examples<a class="copiable-link" href="#Examples-79"> &para;</a></span></h4>
  26844. <ul class="itemize mark-bullet">
  26845. <li>Increase slightly the middle level of blue:
  26846. <div class="example">
  26847. <pre class="example-preformatted">curves=blue='0/0 0.5/0.58 1/1'
  26848. </pre></div>
  26849. </li><li>Vintage effect:
  26850. <div class="example">
  26851. <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'
  26852. </pre></div>
  26853. <p>Here we obtain the following coordinates for each components:
  26854. </p><dl class="table">
  26855. <dt><var class="var">red</var></dt>
  26856. <dd><p><code class="code">(0;0.11) (0.42;0.51) (1;0.95)</code>
  26857. </p></dd>
  26858. <dt><var class="var">green</var></dt>
  26859. <dd><p><code class="code">(0;0) (0.50;0.48) (1;1)</code>
  26860. </p></dd>
  26861. <dt><var class="var">blue</var></dt>
  26862. <dd><p><code class="code">(0;0.22) (0.49;0.44) (1;0.80)</code>
  26863. </p></dd>
  26864. </dl>
  26865. </li><li>The previous example can also be achieved with the associated built-in preset:
  26866. <div class="example">
  26867. <pre class="example-preformatted">curves=preset=vintage
  26868. </pre></div>
  26869. </li><li>Or simply:
  26870. <div class="example">
  26871. <pre class="example-preformatted">curves=vintage
  26872. </pre></div>
  26873. </li><li>Use a Photoshop preset and redefine the points of the green component:
  26874. <div class="example">
  26875. <pre class="example-preformatted">curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
  26876. </pre></div>
  26877. </li><li>Check out the curves of the <code class="code">cross_process</code> profile using <code class="command">ffmpeg</code>
  26878. and <code class="command">gnuplot</code>:
  26879. <div class="example">
  26880. <pre class="example-preformatted">ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
  26881. gnuplot -p /tmp/curves.plt
  26882. </pre></div>
  26883. </li></ul>
  26884. </div>
  26885. </div>
  26886. <div class="section-level-extent" id="datascope">
  26887. <h3 class="section"><span>30.54 datascope<a class="copiable-link" href="#datascope"> &para;</a></span></h3>
  26888. <p>Video data analysis filter.
  26889. </p>
  26890. <p>This filter shows hexadecimal pixel values of part of video.
  26891. </p>
  26892. <p>The filter accepts the following options:
  26893. </p>
  26894. <dl class="table">
  26895. <dt><samp class="option">size, s</samp></dt>
  26896. <dd><p>Set output video size.
  26897. </p>
  26898. </dd>
  26899. <dt><samp class="option">x</samp></dt>
  26900. <dd><p>Set x offset from where to pick pixels.
  26901. </p>
  26902. </dd>
  26903. <dt><samp class="option">y</samp></dt>
  26904. <dd><p>Set y offset from where to pick pixels.
  26905. </p>
  26906. </dd>
  26907. <dt><samp class="option">mode</samp></dt>
  26908. <dd><p>Set scope mode, can be one of the following:
  26909. </p><dl class="table">
  26910. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  26911. <dd><p>Draw hexadecimal pixel values with white color on black background.
  26912. </p>
  26913. </dd>
  26914. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  26915. <dd><p>Draw hexadecimal pixel values with input video pixel color on black
  26916. background.
  26917. </p>
  26918. </dd>
  26919. <dt>&lsquo;<samp class="samp">color2</samp>&rsquo;</dt>
  26920. <dd><p>Draw hexadecimal pixel values on color background picked from input video,
  26921. the text color is picked in such way so its always visible.
  26922. </p></dd>
  26923. </dl>
  26924. </dd>
  26925. <dt><samp class="option">axis</samp></dt>
  26926. <dd><p>Draw rows and columns numbers on left and top of video.
  26927. </p>
  26928. </dd>
  26929. <dt><samp class="option">opacity</samp></dt>
  26930. <dd><p>Set background opacity.
  26931. </p>
  26932. </dd>
  26933. <dt><samp class="option">format</samp></dt>
  26934. <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>.
  26935. </p>
  26936. </dd>
  26937. <dt><samp class="option">components</samp></dt>
  26938. <dd><p>Set pixel components to display. By default all pixel components are displayed.
  26939. </p></dd>
  26940. </dl>
  26941. <ul class="mini-toc">
  26942. <li><a href="#Commands-79" accesskey="1">Commands</a></li>
  26943. </ul>
  26944. <div class="subsection-level-extent" id="Commands-79">
  26945. <h4 class="subsection"><span>30.54.1 Commands<a class="copiable-link" href="#Commands-79"> &para;</a></span></h4>
  26946. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options excluding <code class="code">size</code> option.
  26947. </p>
  26948. </div>
  26949. </div>
  26950. <div class="section-level-extent" id="dblur">
  26951. <h3 class="section"><span>30.55 dblur<a class="copiable-link" href="#dblur"> &para;</a></span></h3>
  26952. <p>Apply Directional blur filter.
  26953. </p>
  26954. <p>The filter accepts the following options:
  26955. </p>
  26956. <dl class="table">
  26957. <dt><samp class="option">angle</samp></dt>
  26958. <dd><p>Set angle of directional blur. Default is <code class="code">45</code>.
  26959. </p>
  26960. </dd>
  26961. <dt><samp class="option">radius</samp></dt>
  26962. <dd><p>Set radius of directional blur. Default is <code class="code">5</code>.
  26963. </p>
  26964. </dd>
  26965. <dt><samp class="option">planes</samp></dt>
  26966. <dd><p>Set which planes to filter. By default all planes are filtered.
  26967. </p></dd>
  26968. </dl>
  26969. <ul class="mini-toc">
  26970. <li><a href="#Commands-80" accesskey="1">Commands</a></li>
  26971. </ul>
  26972. <div class="subsection-level-extent" id="Commands-80">
  26973. <h4 class="subsection"><span>30.55.1 Commands<a class="copiable-link" href="#Commands-80"> &para;</a></span></h4>
  26974. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  26975. The command accepts the same syntax of the corresponding option.
  26976. </p>
  26977. <p>If the specified expression is not valid, it is kept at its current
  26978. value.
  26979. </p>
  26980. </div>
  26981. </div>
  26982. <div class="section-level-extent" id="dctdnoiz">
  26983. <h3 class="section"><span>30.56 dctdnoiz<a class="copiable-link" href="#dctdnoiz"> &para;</a></span></h3>
  26984. <p>Denoise frames using 2D DCT (frequency domain filtering).
  26985. </p>
  26986. <p>This filter is not designed for real time.
  26987. </p>
  26988. <p>The filter accepts the following options:
  26989. </p>
  26990. <dl class="table">
  26991. <dt><samp class="option">sigma, s</samp></dt>
  26992. <dd><p>Set the noise sigma constant.
  26993. </p>
  26994. <p>This <var class="var">sigma</var> defines a hard threshold of <code class="code">3 * sigma</code>; every DCT
  26995. coefficient (absolute value) below this threshold with be dropped.
  26996. </p>
  26997. <p>If you need a more advanced filtering, see <samp class="option">expr</samp>.
  26998. </p>
  26999. <p>Default is <code class="code">0</code>.
  27000. </p>
  27001. </dd>
  27002. <dt><samp class="option">overlap</samp></dt>
  27003. <dd><p>Set number overlapping pixels for each block. Since the filter can be slow, you
  27004. may want to reduce this value, at the cost of a less effective filter and the
  27005. risk of various artefacts.
  27006. </p>
  27007. <p>If the overlapping value doesn&rsquo;t permit processing the whole input width or
  27008. height, a warning will be displayed and according borders won&rsquo;t be denoised.
  27009. </p>
  27010. <p>Default value is <var class="var">blocksize</var>-1, which is the best possible setting.
  27011. </p>
  27012. </dd>
  27013. <dt><samp class="option">expr, e</samp></dt>
  27014. <dd><p>Set the coefficient factor expression.
  27015. </p>
  27016. <p>For each coefficient of a DCT block, this expression will be evaluated as a
  27017. multiplier value for the coefficient.
  27018. </p>
  27019. <p>If this is option is set, the <samp class="option">sigma</samp> option will be ignored.
  27020. </p>
  27021. <p>The absolute value of the coefficient can be accessed through the <var class="var">c</var>
  27022. variable.
  27023. </p>
  27024. </dd>
  27025. <dt><samp class="option">n</samp></dt>
  27026. <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
  27027. <var class="var">blocksize</var>, which is the width and height of the processed blocks.
  27028. </p>
  27029. <p>The default value is <var class="var">3</var> (8x8) and can be raised to <var class="var">4</var> for a
  27030. <var class="var">blocksize</var> of 16x16. Note that changing this setting has huge consequences
  27031. on the speed processing. Also, a larger block size does not necessarily means a
  27032. better de-noising.
  27033. </p></dd>
  27034. </dl>
  27035. <ul class="mini-toc">
  27036. <li><a href="#Examples-80" accesskey="1">Examples</a></li>
  27037. </ul>
  27038. <div class="subsection-level-extent" id="Examples-80">
  27039. <h4 class="subsection"><span>30.56.1 Examples<a class="copiable-link" href="#Examples-80"> &para;</a></span></h4>
  27040. <p>Apply a denoise with a <samp class="option">sigma</samp> of <code class="code">4.5</code>:
  27041. </p><div class="example">
  27042. <pre class="example-preformatted">dctdnoiz=4.5
  27043. </pre></div>
  27044. <p>The same operation can be achieved using the expression system:
  27045. </p><div class="example">
  27046. <pre class="example-preformatted">dctdnoiz=e='gte(c, 4.5*3)'
  27047. </pre></div>
  27048. <p>Violent denoise using a block size of <code class="code">16x16</code>:
  27049. </p><div class="example">
  27050. <pre class="example-preformatted">dctdnoiz=15:n=4
  27051. </pre></div>
  27052. </div>
  27053. </div>
  27054. <div class="section-level-extent" id="deband">
  27055. <h3 class="section"><span>30.57 deband<a class="copiable-link" href="#deband"> &para;</a></span></h3>
  27056. <p>Remove banding artifacts from input video.
  27057. It works by replacing banded pixels with average value of referenced pixels.
  27058. </p>
  27059. <p>The filter accepts the following options:
  27060. </p>
  27061. <dl class="table">
  27062. <dt><samp class="option">1thr</samp></dt>
  27063. <dt><samp class="option">2thr</samp></dt>
  27064. <dt><samp class="option">3thr</samp></dt>
  27065. <dt><samp class="option">4thr</samp></dt>
  27066. <dd><p>Set banding detection threshold for each plane. Default is 0.02.
  27067. Valid range is 0.00003 to 0.5.
  27068. If difference between current pixel and reference pixel is less than threshold,
  27069. it will be considered as banded.
  27070. </p>
  27071. </dd>
  27072. <dt><samp class="option">range, r</samp></dt>
  27073. <dd><p>Banding detection range in pixels. Default is 16. If positive, random number
  27074. in range 0 to set value will be used. If negative, exact absolute value
  27075. will be used.
  27076. The range defines square of four pixels around current pixel.
  27077. </p>
  27078. </dd>
  27079. <dt><samp class="option">direction, d</samp></dt>
  27080. <dd><p>Set direction in radians from which four pixel will be compared. If positive,
  27081. random direction from 0 to set direction will be picked. If negative, exact of
  27082. absolute value will be picked. For example direction 0, -PI or -2*PI radians
  27083. will pick only pixels on same row and -PI/2 will pick only pixels on same
  27084. column.
  27085. </p>
  27086. </dd>
  27087. <dt><samp class="option">blur, b</samp></dt>
  27088. <dd><p>If enabled, current pixel is compared with average value of all four
  27089. surrounding pixels. The default is enabled. If disabled current pixel is
  27090. compared with all four surrounding pixels. The pixel is considered banded
  27091. if only all four differences with surrounding pixels are less than threshold.
  27092. </p>
  27093. </dd>
  27094. <dt><samp class="option">coupling, c</samp></dt>
  27095. <dd><p>If enabled, current pixel is changed if and only if all pixel components are banded,
  27096. e.g. banding detection threshold is triggered for all color components.
  27097. The default is disabled.
  27098. </p></dd>
  27099. </dl>
  27100. <ul class="mini-toc">
  27101. <li><a href="#Commands-81" accesskey="1">Commands</a></li>
  27102. </ul>
  27103. <div class="subsection-level-extent" id="Commands-81">
  27104. <h4 class="subsection"><span>30.57.1 Commands<a class="copiable-link" href="#Commands-81"> &para;</a></span></h4>
  27105. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  27106. </p>
  27107. </div>
  27108. </div>
  27109. <div class="section-level-extent" id="deblock">
  27110. <h3 class="section"><span>30.58 deblock<a class="copiable-link" href="#deblock"> &para;</a></span></h3>
  27111. <p>Remove blocking artifacts from input video.
  27112. </p>
  27113. <p>The filter accepts the following options:
  27114. </p>
  27115. <dl class="table">
  27116. <dt><samp class="option">filter</samp></dt>
  27117. <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>.
  27118. This controls what kind of deblocking is applied.
  27119. </p>
  27120. </dd>
  27121. <dt><samp class="option">block</samp></dt>
  27122. <dd><p>Set size of block, allowed range is from 4 to 512. Default is <var class="var">8</var>.
  27123. </p>
  27124. </dd>
  27125. <dt><samp class="option">alpha</samp></dt>
  27126. <dt><samp class="option">beta</samp></dt>
  27127. <dt><samp class="option">gamma</samp></dt>
  27128. <dt><samp class="option">delta</samp></dt>
  27129. <dd><p>Set blocking detection thresholds. Allowed range is 0 to 1.
  27130. Defaults are: <var class="var">0.098</var> for <var class="var">alpha</var> and <var class="var">0.05</var> for the rest.
  27131. Using higher threshold gives more deblocking strength.
  27132. Setting <var class="var">alpha</var> controls threshold detection at exact edge of block.
  27133. Remaining options controls threshold detection near the edge. Each one for
  27134. below/above or left/right. Setting any of those to <var class="var">0</var> disables
  27135. deblocking.
  27136. </p>
  27137. </dd>
  27138. <dt><samp class="option">planes</samp></dt>
  27139. <dd><p>Set planes to filter. Default is to filter all available planes.
  27140. </p></dd>
  27141. </dl>
  27142. <ul class="mini-toc">
  27143. <li><a href="#Examples-81" accesskey="1">Examples</a></li>
  27144. <li><a href="#Commands-82" accesskey="2">Commands</a></li>
  27145. </ul>
  27146. <div class="subsection-level-extent" id="Examples-81">
  27147. <h4 class="subsection"><span>30.58.1 Examples<a class="copiable-link" href="#Examples-81"> &para;</a></span></h4>
  27148. <ul class="itemize mark-bullet">
  27149. <li>Deblock using weak filter and block size of 4 pixels.
  27150. <div class="example">
  27151. <pre class="example-preformatted">deblock=filter=weak:block=4
  27152. </pre></div>
  27153. </li><li>Deblock using strong filter, block size of 4 pixels and custom thresholds for
  27154. deblocking more edges.
  27155. <div class="example">
  27156. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
  27157. </pre></div>
  27158. </li><li>Similar as above, but filter only first plane.
  27159. <div class="example">
  27160. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
  27161. </pre></div>
  27162. </li><li>Similar as above, but filter only second and third plane.
  27163. <div class="example">
  27164. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
  27165. </pre></div>
  27166. </li></ul>
  27167. </div>
  27168. <div class="subsection-level-extent" id="Commands-82">
  27169. <h4 class="subsection"><span>30.58.2 Commands<a class="copiable-link" href="#Commands-82"> &para;</a></span></h4>
  27170. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  27171. </p>
  27172. <a class="anchor" id="decimate"></a></div>
  27173. </div>
  27174. <div class="section-level-extent" id="decimate-1">
  27175. <h3 class="section"><span>30.59 decimate<a class="copiable-link" href="#decimate-1"> &para;</a></span></h3>
  27176. <p>Drop duplicated frames at regular intervals.
  27177. </p>
  27178. <p>The filter accepts the following options:
  27179. </p>
  27180. <dl class="table">
  27181. <dt><samp class="option">cycle</samp></dt>
  27182. <dd><p>Set the number of frames from which one will be dropped. Setting this to
  27183. <var class="var">N</var> means one frame in every batch of <var class="var">N</var> frames will be dropped.
  27184. Default is <code class="code">5</code>.
  27185. </p>
  27186. </dd>
  27187. <dt><samp class="option">dupthresh</samp></dt>
  27188. <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
  27189. is less than or equal to this value, then it is declared as duplicate. Default
  27190. is <code class="code">1.1</code>
  27191. </p>
  27192. </dd>
  27193. <dt><samp class="option">scthresh</samp></dt>
  27194. <dd><p>Set scene change threshold. Default is <code class="code">15</code>.
  27195. </p>
  27196. </dd>
  27197. <dt><samp class="option">blockx</samp></dt>
  27198. <dt><samp class="option">blocky</samp></dt>
  27199. <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
  27200. Larger blocks give better noise suppression, but also give worse detection of
  27201. small movements. Must be a power of two. Default is <code class="code">32</code>.
  27202. </p>
  27203. </dd>
  27204. <dt><samp class="option">ppsrc</samp></dt>
  27205. <dd><p>Mark main input as a pre-processed input and activate clean source input
  27206. stream. This allows the input to be pre-processed with various filters to help
  27207. the metrics calculation while keeping the frame selection lossless. When set to
  27208. <code class="code">1</code>, the first stream is for the pre-processed input, and the second
  27209. stream is the clean source from where the kept frames are chosen. Default is
  27210. <code class="code">0</code>.
  27211. </p>
  27212. </dd>
  27213. <dt><samp class="option">chroma</samp></dt>
  27214. <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
  27215. <code class="code">1</code>.
  27216. </p>
  27217. </dd>
  27218. <dt><samp class="option">mixed</samp></dt>
  27219. <dd><p>Set whether or not the input only partially contains content to be decimated.
  27220. Default is <code class="code">false</code>.
  27221. If enabled video output stream will be in variable frame rate.
  27222. </p></dd>
  27223. </dl>
  27224. </div>
  27225. <div class="section-level-extent" id="deconvolve">
  27226. <h3 class="section"><span>30.60 deconvolve<a class="copiable-link" href="#deconvolve"> &para;</a></span></h3>
  27227. <p>Apply 2D deconvolution of video stream in frequency domain using second stream
  27228. as impulse.
  27229. </p>
  27230. <p>The filter accepts the following options:
  27231. </p>
  27232. <dl class="table">
  27233. <dt><samp class="option">planes</samp></dt>
  27234. <dd><p>Set which planes to process.
  27235. </p>
  27236. </dd>
  27237. <dt><samp class="option">impulse</samp></dt>
  27238. <dd><p>Set which impulse video frames will be processed, can be <var class="var">first</var>
  27239. or <var class="var">all</var>. Default is <var class="var">all</var>.
  27240. </p>
  27241. </dd>
  27242. <dt><samp class="option">noise</samp></dt>
  27243. <dd><p>Set noise when doing divisions. Default is <var class="var">0.0000001</var>. Useful when width
  27244. and height are not same and not power of 2 or if stream prior to convolving
  27245. had noise.
  27246. </p></dd>
  27247. </dl>
  27248. <p>The <code class="code">deconvolve</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  27249. </p>
  27250. </div>
  27251. <div class="section-level-extent" id="dedot">
  27252. <h3 class="section"><span>30.61 dedot<a class="copiable-link" href="#dedot"> &para;</a></span></h3>
  27253. <p>Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video.
  27254. </p>
  27255. <p>It accepts the following options:
  27256. </p>
  27257. <dl class="table">
  27258. <dt><samp class="option">m</samp></dt>
  27259. <dd><p>Set mode of operation. Can be combination of <var class="var">dotcrawl</var> for cross-luminance reduction and/or
  27260. <var class="var">rainbows</var> for cross-color reduction.
  27261. </p>
  27262. </dd>
  27263. <dt><samp class="option">lt</samp></dt>
  27264. <dd><p>Set spatial luma threshold. Lower values increases reduction of cross-luminance.
  27265. </p>
  27266. </dd>
  27267. <dt><samp class="option">tl</samp></dt>
  27268. <dd><p>Set tolerance for temporal luma. Higher values increases reduction of cross-luminance.
  27269. </p>
  27270. </dd>
  27271. <dt><samp class="option">tc</samp></dt>
  27272. <dd><p>Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color.
  27273. </p>
  27274. </dd>
  27275. <dt><samp class="option">ct</samp></dt>
  27276. <dd><p>Set temporal chroma threshold. Lower values increases reduction of cross-color.
  27277. </p></dd>
  27278. </dl>
  27279. </div>
  27280. <div class="section-level-extent" id="deflate">
  27281. <h3 class="section"><span>30.62 deflate<a class="copiable-link" href="#deflate"> &para;</a></span></h3>
  27282. <p>Apply deflate effect to the video.
  27283. </p>
  27284. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  27285. only values lower than the pixel.
  27286. </p>
  27287. <p>It accepts the following options:
  27288. </p>
  27289. <dl class="table">
  27290. <dt><samp class="option">threshold0</samp></dt>
  27291. <dt><samp class="option">threshold1</samp></dt>
  27292. <dt><samp class="option">threshold2</samp></dt>
  27293. <dt><samp class="option">threshold3</samp></dt>
  27294. <dd><p>Limit the maximum change for each plane, default is 65535.
  27295. If 0, plane will remain unchanged.
  27296. </p></dd>
  27297. </dl>
  27298. <ul class="mini-toc">
  27299. <li><a href="#Commands-83" accesskey="1">Commands</a></li>
  27300. </ul>
  27301. <div class="subsection-level-extent" id="Commands-83">
  27302. <h4 class="subsection"><span>30.62.1 Commands<a class="copiable-link" href="#Commands-83"> &para;</a></span></h4>
  27303. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  27304. </p>
  27305. </div>
  27306. </div>
  27307. <div class="section-level-extent" id="deflicker">
  27308. <h3 class="section"><span>30.63 deflicker<a class="copiable-link" href="#deflicker"> &para;</a></span></h3>
  27309. <p>Remove temporal frame luminance variations.
  27310. </p>
  27311. <p>It accepts the following options:
  27312. </p>
  27313. <dl class="table">
  27314. <dt><samp class="option">size, s</samp></dt>
  27315. <dd><p>Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129.
  27316. </p>
  27317. </dd>
  27318. <dt><samp class="option">mode, m</samp></dt>
  27319. <dd><p>Set averaging mode to smooth temporal luminance variations.
  27320. </p>
  27321. <p>Available values are:
  27322. </p><dl class="table">
  27323. <dt>&lsquo;<samp class="samp">am</samp>&rsquo;</dt>
  27324. <dd><p>Arithmetic mean
  27325. </p>
  27326. </dd>
  27327. <dt>&lsquo;<samp class="samp">gm</samp>&rsquo;</dt>
  27328. <dd><p>Geometric mean
  27329. </p>
  27330. </dd>
  27331. <dt>&lsquo;<samp class="samp">hm</samp>&rsquo;</dt>
  27332. <dd><p>Harmonic mean
  27333. </p>
  27334. </dd>
  27335. <dt>&lsquo;<samp class="samp">qm</samp>&rsquo;</dt>
  27336. <dd><p>Quadratic mean
  27337. </p>
  27338. </dd>
  27339. <dt>&lsquo;<samp class="samp">cm</samp>&rsquo;</dt>
  27340. <dd><p>Cubic mean
  27341. </p>
  27342. </dd>
  27343. <dt>&lsquo;<samp class="samp">pm</samp>&rsquo;</dt>
  27344. <dd><p>Power mean
  27345. </p>
  27346. </dd>
  27347. <dt>&lsquo;<samp class="samp">median</samp>&rsquo;</dt>
  27348. <dd><p>Median
  27349. </p></dd>
  27350. </dl>
  27351. </dd>
  27352. <dt><samp class="option">bypass</samp></dt>
  27353. <dd><p>Do not actually modify frame. Useful when one only wants metadata.
  27354. </p></dd>
  27355. </dl>
  27356. </div>
  27357. <div class="section-level-extent" id="dejudder">
  27358. <h3 class="section"><span>30.64 dejudder<a class="copiable-link" href="#dejudder"> &para;</a></span></h3>
  27359. <p>Remove judder produced by partially interlaced telecined content.
  27360. </p>
  27361. <p>Judder can be introduced, for instance, by <a class="ref" href="#pullup">pullup</a> filter. If the original
  27362. source was partially telecined content then the output of <code class="code">pullup,dejudder</code>
  27363. will have a variable frame rate. May change the recorded frame rate of the
  27364. container. Aside from that change, this filter will not affect constant frame
  27365. rate video.
  27366. </p>
  27367. <p>The option available in this filter is:
  27368. </p><dl class="table">
  27369. <dt><samp class="option">cycle</samp></dt>
  27370. <dd><p>Specify the length of the window over which the judder repeats.
  27371. </p>
  27372. <p>Accepts any integer greater than 1. Useful values are:
  27373. </p><dl class="table">
  27374. <dt>&lsquo;<samp class="samp">4</samp>&rsquo;</dt>
  27375. <dd><p>If the original was telecined from 24 to 30 fps (Film to NTSC).
  27376. </p>
  27377. </dd>
  27378. <dt>&lsquo;<samp class="samp">5</samp>&rsquo;</dt>
  27379. <dd><p>If the original was telecined from 25 to 30 fps (PAL to NTSC).
  27380. </p>
  27381. </dd>
  27382. <dt>&lsquo;<samp class="samp">20</samp>&rsquo;</dt>
  27383. <dd><p>If a mixture of the two.
  27384. </p></dd>
  27385. </dl>
  27386. <p>The default is &lsquo;<samp class="samp">4</samp>&rsquo;.
  27387. </p></dd>
  27388. </dl>
  27389. </div>
  27390. <div class="section-level-extent" id="delogo">
  27391. <h3 class="section"><span>30.65 delogo<a class="copiable-link" href="#delogo"> &para;</a></span></h3>
  27392. <p>Suppress a TV station logo by a simple interpolation of the surrounding
  27393. pixels. Just set a rectangle covering the logo and watch it disappear
  27394. (and sometimes something even uglier appear - your mileage may vary).
  27395. </p>
  27396. <p>It accepts the following parameters:
  27397. </p><dl class="table">
  27398. <dt><samp class="option">x</samp></dt>
  27399. <dt><samp class="option">y</samp></dt>
  27400. <dd><p>Specify the top left corner coordinates of the logo. They must be
  27401. specified.
  27402. </p>
  27403. </dd>
  27404. <dt><samp class="option">w</samp></dt>
  27405. <dt><samp class="option">h</samp></dt>
  27406. <dd><p>Specify the width and height of the logo to clear. They must be
  27407. specified.
  27408. </p>
  27409. </dd>
  27410. <dt><samp class="option">show</samp></dt>
  27411. <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
  27412. 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.
  27413. The default value is 0.
  27414. </p>
  27415. <p>The rectangle is drawn on the outermost pixels which will be (partly)
  27416. replaced with interpolated values. The values of the next pixels
  27417. immediately outside this rectangle in each direction will be used to
  27418. compute the interpolated pixel values inside the rectangle.
  27419. </p>
  27420. </dd>
  27421. </dl>
  27422. <ul class="mini-toc">
  27423. <li><a href="#Examples-82" accesskey="1">Examples</a></li>
  27424. </ul>
  27425. <div class="subsection-level-extent" id="Examples-82">
  27426. <h4 class="subsection"><span>30.65.1 Examples<a class="copiable-link" href="#Examples-82"> &para;</a></span></h4>
  27427. <ul class="itemize mark-bullet">
  27428. <li>Set a rectangle covering the area with top left corner coordinates 0,0
  27429. and size 100x77:
  27430. <div class="example">
  27431. <pre class="example-preformatted">delogo=x=0:y=0:w=100:h=77
  27432. </pre></div>
  27433. </li></ul>
  27434. <a class="anchor" id="derain"></a></div>
  27435. </div>
  27436. <div class="section-level-extent" id="derain-1">
  27437. <h3 class="section"><span>30.66 derain<a class="copiable-link" href="#derain-1"> &para;</a></span></h3>
  27438. <p>Remove the rain in the input image/video by applying the derain methods based on
  27439. convolutional neural networks. Supported models:
  27440. </p>
  27441. <ul class="itemize mark-bullet">
  27442. <li>Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN).
  27443. 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>.
  27444. </li></ul>
  27445. <p>Training as well as model generation scripts are provided in
  27446. the repository at <a class="url" href="https://github.com/XueweiMeng/derain_filter.git">https://github.com/XueweiMeng/derain_filter.git</a>.
  27447. </p>
  27448. <p>The filter accepts the following options:
  27449. </p>
  27450. <dl class="table">
  27451. <dt><samp class="option">filter_type</samp></dt>
  27452. <dd><p>Specify which filter to use. This option accepts the following values:
  27453. </p>
  27454. <dl class="table">
  27455. <dt>&lsquo;<samp class="samp">derain</samp>&rsquo;</dt>
  27456. <dd><p>Derain filter. To conduct derain filter, you need to use a derain model.
  27457. </p>
  27458. </dd>
  27459. <dt>&lsquo;<samp class="samp">dehaze</samp>&rsquo;</dt>
  27460. <dd><p>Dehaze filter. To conduct dehaze filter, you need to use a dehaze model.
  27461. </p></dd>
  27462. </dl>
  27463. <p>Default value is &lsquo;<samp class="samp">derain</samp>&rsquo;.
  27464. </p>
  27465. </dd>
  27466. <dt><samp class="option">dnn_backend</samp></dt>
  27467. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  27468. the following values:
  27469. </p>
  27470. <dl class="table">
  27471. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  27472. <dd><p>TensorFlow backend. To enable this backend you
  27473. need to install the TensorFlow for C library (see
  27474. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  27475. <code class="code">--enable-libtensorflow</code>
  27476. </p></dd>
  27477. </dl>
  27478. </dd>
  27479. <dt><samp class="option">model</samp></dt>
  27480. <dd><p>Set path to model file specifying network architecture and its parameters.
  27481. Note that different backends use different file formats. TensorFlow can load files for only its format.
  27482. </p></dd>
  27483. </dl>
  27484. <p>To get full functionality (such as async execution), please use the <a class="ref" href="#dnn_005fprocessing">dnn_processing</a> filter.
  27485. </p>
  27486. </div>
  27487. <div class="section-level-extent" id="deshake">
  27488. <h3 class="section"><span>30.67 deshake<a class="copiable-link" href="#deshake"> &para;</a></span></h3>
  27489. <p>Attempt to fix small changes in horizontal and/or vertical shift. This
  27490. filter helps remove camera shake from hand-holding a camera, bumping a
  27491. tripod, moving on a vehicle, etc.
  27492. </p>
  27493. <p>The filter accepts the following options:
  27494. </p>
  27495. <dl class="table">
  27496. <dt><samp class="option">x</samp></dt>
  27497. <dt><samp class="option">y</samp></dt>
  27498. <dt><samp class="option">w</samp></dt>
  27499. <dt><samp class="option">h</samp></dt>
  27500. <dd><p>Specify a rectangular area where to limit the search for motion
  27501. vectors.
  27502. If desired the search for motion vectors can be limited to a
  27503. rectangular area of the frame defined by its top left corner, width
  27504. and height. These parameters have the same meaning as the drawbox
  27505. filter which can be used to visualise the position of the bounding
  27506. box.
  27507. </p>
  27508. <p>This is useful when simultaneous movement of subjects within the frame
  27509. might be confused for camera motion by the motion vector search.
  27510. </p>
  27511. <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
  27512. then the full frame is used. This allows later options to be set
  27513. without specifying the bounding box for the motion vector search.
  27514. </p>
  27515. <p>Default - search the whole frame.
  27516. </p>
  27517. </dd>
  27518. <dt><samp class="option">rx</samp></dt>
  27519. <dt><samp class="option">ry</samp></dt>
  27520. <dd><p>Specify the maximum extent of movement in x and y directions in the
  27521. range 0-64 pixels. Default 16.
  27522. </p>
  27523. </dd>
  27524. <dt><samp class="option">edge</samp></dt>
  27525. <dd><p>Specify how to generate pixels to fill blanks at the edge of the
  27526. frame. Available values are:
  27527. </p><dl class="table">
  27528. <dt>&lsquo;<samp class="samp">blank, 0</samp>&rsquo;</dt>
  27529. <dd><p>Fill zeroes at blank locations
  27530. </p></dd>
  27531. <dt>&lsquo;<samp class="samp">original, 1</samp>&rsquo;</dt>
  27532. <dd><p>Original image at blank locations
  27533. </p></dd>
  27534. <dt>&lsquo;<samp class="samp">clamp, 2</samp>&rsquo;</dt>
  27535. <dd><p>Extruded edge value at blank locations
  27536. </p></dd>
  27537. <dt>&lsquo;<samp class="samp">mirror, 3</samp>&rsquo;</dt>
  27538. <dd><p>Mirrored edge at blank locations
  27539. </p></dd>
  27540. </dl>
  27541. <p>Default value is &lsquo;<samp class="samp">mirror</samp>&rsquo;.
  27542. </p>
  27543. </dd>
  27544. <dt><samp class="option">blocksize</samp></dt>
  27545. <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
  27546. default 8.
  27547. </p>
  27548. </dd>
  27549. <dt><samp class="option">contrast</samp></dt>
  27550. <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
  27551. the specified contrast (difference between darkest and lightest
  27552. pixels) will be considered. Range 1-255, default 125.
  27553. </p>
  27554. </dd>
  27555. <dt><samp class="option">search</samp></dt>
  27556. <dd><p>Specify the search strategy. Available values are:
  27557. </p><dl class="table">
  27558. <dt>&lsquo;<samp class="samp">exhaustive, 0</samp>&rsquo;</dt>
  27559. <dd><p>Set exhaustive search
  27560. </p></dd>
  27561. <dt>&lsquo;<samp class="samp">less, 1</samp>&rsquo;</dt>
  27562. <dd><p>Set less exhaustive search.
  27563. </p></dd>
  27564. </dl>
  27565. <p>Default value is &lsquo;<samp class="samp">exhaustive</samp>&rsquo;.
  27566. </p>
  27567. </dd>
  27568. <dt><samp class="option">filename</samp></dt>
  27569. <dd><p>If set then a detailed log of the motion search is written to the
  27570. specified file.
  27571. </p>
  27572. </dd>
  27573. </dl>
  27574. </div>
  27575. <div class="section-level-extent" id="despill">
  27576. <h3 class="section"><span>30.68 despill<a class="copiable-link" href="#despill"> &para;</a></span></h3>
  27577. <p>Remove unwanted contamination of foreground colors, caused by reflected color of
  27578. greenscreen or bluescreen.
  27579. </p>
  27580. <p>This filter accepts the following options:
  27581. </p>
  27582. <dl class="table">
  27583. <dt><samp class="option">type</samp></dt>
  27584. <dd><p>Set what type of despill to use.
  27585. </p>
  27586. </dd>
  27587. <dt><samp class="option">mix</samp></dt>
  27588. <dd><p>Set how spillmap will be generated.
  27589. </p>
  27590. </dd>
  27591. <dt><samp class="option">expand</samp></dt>
  27592. <dd><p>Set how much to get rid of still remaining spill.
  27593. </p>
  27594. </dd>
  27595. <dt><samp class="option">red</samp></dt>
  27596. <dd><p>Controls amount of red in spill area.
  27597. </p>
  27598. </dd>
  27599. <dt><samp class="option">green</samp></dt>
  27600. <dd><p>Controls amount of green in spill area.
  27601. Should be -1 for greenscreen.
  27602. </p>
  27603. </dd>
  27604. <dt><samp class="option">blue</samp></dt>
  27605. <dd><p>Controls amount of blue in spill area.
  27606. Should be -1 for bluescreen.
  27607. </p>
  27608. </dd>
  27609. <dt><samp class="option">brightness</samp></dt>
  27610. <dd><p>Controls brightness of spill area, preserving colors.
  27611. </p>
  27612. </dd>
  27613. <dt><samp class="option">alpha</samp></dt>
  27614. <dd><p>Modify alpha from generated spillmap.
  27615. </p></dd>
  27616. </dl>
  27617. <ul class="mini-toc">
  27618. <li><a href="#Commands-84" accesskey="1">Commands</a></li>
  27619. </ul>
  27620. <div class="subsection-level-extent" id="Commands-84">
  27621. <h4 class="subsection"><span>30.68.1 Commands<a class="copiable-link" href="#Commands-84"> &para;</a></span></h4>
  27622. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  27623. </p>
  27624. </div>
  27625. </div>
  27626. <div class="section-level-extent" id="detelecine">
  27627. <h3 class="section"><span>30.69 detelecine<a class="copiable-link" href="#detelecine"> &para;</a></span></h3>
  27628. <p>Apply an exact inverse of the telecine operation. It requires a predefined
  27629. pattern specified using the pattern option which must be the same as that passed
  27630. to the telecine filter.
  27631. </p>
  27632. <p>This filter accepts the following options:
  27633. </p>
  27634. <dl class="table">
  27635. <dt><samp class="option">first_field</samp></dt>
  27636. <dd><dl class="table">
  27637. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  27638. <dd><p>top field first
  27639. </p></dd>
  27640. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  27641. <dd><p>bottom field first
  27642. The default value is <code class="code">top</code>.
  27643. </p></dd>
  27644. </dl>
  27645. </dd>
  27646. <dt><samp class="option">pattern</samp></dt>
  27647. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  27648. The default value is <code class="code">23</code>.
  27649. </p>
  27650. </dd>
  27651. <dt><samp class="option">start_frame</samp></dt>
  27652. <dd><p>A number representing position of the first frame with respect to the telecine
  27653. pattern. This is to be used if the stream is cut. The default value is <code class="code">0</code>.
  27654. </p></dd>
  27655. </dl>
  27656. <a class="anchor" id="dilation"></a></div>
  27657. <div class="section-level-extent" id="dilation-1">
  27658. <h3 class="section"><span>30.70 dilation<a class="copiable-link" href="#dilation-1"> &para;</a></span></h3>
  27659. <p>Apply dilation effect to the video.
  27660. </p>
  27661. <p>This filter replaces the pixel by the local(3x3) maximum.
  27662. </p>
  27663. <p>It accepts the following options:
  27664. </p>
  27665. <dl class="table">
  27666. <dt><samp class="option">threshold0</samp></dt>
  27667. <dt><samp class="option">threshold1</samp></dt>
  27668. <dt><samp class="option">threshold2</samp></dt>
  27669. <dt><samp class="option">threshold3</samp></dt>
  27670. <dd><p>Limit the maximum change for each plane, default is 65535.
  27671. If 0, plane will remain unchanged.
  27672. </p>
  27673. </dd>
  27674. <dt><samp class="option">coordinates</samp></dt>
  27675. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  27676. pixels are used.
  27677. </p>
  27678. <p>Flags to local 3x3 coordinates maps like this:
  27679. </p>
  27680. <p>1 2 3
  27681. 4 5
  27682. 6 7 8
  27683. </p></dd>
  27684. </dl>
  27685. <ul class="mini-toc">
  27686. <li><a href="#Commands-85" accesskey="1">Commands</a></li>
  27687. </ul>
  27688. <div class="subsection-level-extent" id="Commands-85">
  27689. <h4 class="subsection"><span>30.70.1 Commands<a class="copiable-link" href="#Commands-85"> &para;</a></span></h4>
  27690. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  27691. </p>
  27692. </div>
  27693. </div>
  27694. <div class="section-level-extent" id="displace">
  27695. <h3 class="section"><span>30.71 displace<a class="copiable-link" href="#displace"> &para;</a></span></h3>
  27696. <p>Displace pixels as indicated by second and third input stream.
  27697. </p>
  27698. <p>It takes three input streams and outputs one stream, the first input is the
  27699. source, and second and third input are displacement maps.
  27700. </p>
  27701. <p>The second input specifies how much to displace pixels along the
  27702. x-axis, while the third input specifies how much to displace pixels
  27703. along the y-axis.
  27704. If one of displacement map streams terminates, last frame from that
  27705. displacement map will be used.
  27706. </p>
  27707. <p>Note that once generated, displacements maps can be reused over and over again.
  27708. </p>
  27709. <p>A description of the accepted options follows.
  27710. </p>
  27711. <dl class="table">
  27712. <dt><samp class="option">edge</samp></dt>
  27713. <dd><p>Set displace behavior for pixels that are out of range.
  27714. </p>
  27715. <p>Available values are:
  27716. </p><dl class="table">
  27717. <dt>&lsquo;<samp class="samp">blank</samp>&rsquo;</dt>
  27718. <dd><p>Missing pixels are replaced by black pixels.
  27719. </p>
  27720. </dd>
  27721. <dt>&lsquo;<samp class="samp">smear</samp>&rsquo;</dt>
  27722. <dd><p>Adjacent pixels will spread out to replace missing pixels.
  27723. </p>
  27724. </dd>
  27725. <dt>&lsquo;<samp class="samp">wrap</samp>&rsquo;</dt>
  27726. <dd><p>Out of range pixels are wrapped so they point to pixels of other side.
  27727. </p>
  27728. </dd>
  27729. <dt>&lsquo;<samp class="samp">mirror</samp>&rsquo;</dt>
  27730. <dd><p>Out of range pixels will be replaced with mirrored pixels.
  27731. </p></dd>
  27732. </dl>
  27733. <p>Default is &lsquo;<samp class="samp">smear</samp>&rsquo;.
  27734. </p>
  27735. </dd>
  27736. </dl>
  27737. <ul class="mini-toc">
  27738. <li><a href="#Examples-83" accesskey="1">Examples</a></li>
  27739. </ul>
  27740. <div class="subsection-level-extent" id="Examples-83">
  27741. <h4 class="subsection"><span>30.71.1 Examples<a class="copiable-link" href="#Examples-83"> &para;</a></span></h4>
  27742. <ul class="itemize mark-bullet">
  27743. <li>Add ripple effect to rgb input of video size hd720:
  27744. <div class="example">
  27745. <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
  27746. </pre></div>
  27747. </li><li>Add wave effect to rgb input of video size hd720:
  27748. <div class="example">
  27749. <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
  27750. </pre></div>
  27751. </li></ul>
  27752. </div>
  27753. </div>
  27754. <div class="section-level-extent" id="dnn_005fclassify">
  27755. <h3 class="section"><span>30.72 dnn_classify<a class="copiable-link" href="#dnn_005fclassify"> &para;</a></span></h3>
  27756. <p>Do classification with deep neural networks based on bounding boxes.
  27757. </p>
  27758. <p>The filter accepts the following options:
  27759. </p>
  27760. <dl class="table">
  27761. <dt><samp class="option">dnn_backend</samp></dt>
  27762. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  27763. only openvino now, tensorflow backends will be added.
  27764. </p>
  27765. </dd>
  27766. <dt><samp class="option">model</samp></dt>
  27767. <dd><p>Set path to model file specifying network architecture and its parameters.
  27768. Note that different backends use different file formats.
  27769. </p>
  27770. </dd>
  27771. <dt><samp class="option">input</samp></dt>
  27772. <dd><p>Set the input name of the dnn network.
  27773. </p>
  27774. </dd>
  27775. <dt><samp class="option">output</samp></dt>
  27776. <dd><p>Set the output name of the dnn network.
  27777. </p>
  27778. </dd>
  27779. <dt><samp class="option">confidence</samp></dt>
  27780. <dd><p>Set the confidence threshold (default: 0.5).
  27781. </p>
  27782. </dd>
  27783. <dt><samp class="option">labels</samp></dt>
  27784. <dd><p>Set path to label file specifying the mapping between label id and name.
  27785. Each label name is written in one line, tailing spaces and empty lines are skipped.
  27786. The first line is the name of label id 0,
  27787. and the second line is the name of label id 1, etc.
  27788. The label id is considered as name if the label file is not provided.
  27789. </p>
  27790. </dd>
  27791. <dt><samp class="option">backend_configs</samp></dt>
  27792. <dd><p>Set the configs to be passed into backend
  27793. </p>
  27794. <p>For tensorflow backend, you can set its configs with <samp class="option">sess_config</samp> options,
  27795. please use tools/python/tf_sess_config.py to get the configs for your system.
  27796. </p>
  27797. </dd>
  27798. </dl>
  27799. </div>
  27800. <div class="section-level-extent" id="dnn_005fdetect">
  27801. <h3 class="section"><span>30.73 dnn_detect<a class="copiable-link" href="#dnn_005fdetect"> &para;</a></span></h3>
  27802. <p>Do object detection with deep neural networks.
  27803. </p>
  27804. <p>The filter accepts the following options:
  27805. </p>
  27806. <dl class="table">
  27807. <dt><samp class="option">dnn_backend</samp></dt>
  27808. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  27809. only openvino now, tensorflow backends will be added.
  27810. </p>
  27811. </dd>
  27812. <dt><samp class="option">model</samp></dt>
  27813. <dd><p>Set path to model file specifying network architecture and its parameters.
  27814. Note that different backends use different file formats.
  27815. </p>
  27816. </dd>
  27817. <dt><samp class="option">input</samp></dt>
  27818. <dd><p>Set the input name of the dnn network.
  27819. </p>
  27820. </dd>
  27821. <dt><samp class="option">output</samp></dt>
  27822. <dd><p>Set the output name of the dnn network.
  27823. </p>
  27824. </dd>
  27825. <dt><samp class="option">confidence</samp></dt>
  27826. <dd><p>Set the confidence threshold (default: 0.5).
  27827. </p>
  27828. </dd>
  27829. <dt><samp class="option">labels</samp></dt>
  27830. <dd><p>Set path to label file specifying the mapping between label id and name.
  27831. Each label name is written in one line, tailing spaces and empty lines are skipped.
  27832. The first line is the name of label id 0 (usually it is &rsquo;background&rsquo;),
  27833. and the second line is the name of label id 1, etc.
  27834. The label id is considered as name if the label file is not provided.
  27835. </p>
  27836. </dd>
  27837. <dt><samp class="option">backend_configs</samp></dt>
  27838. <dd><p>Set the configs to be passed into backend. To use async execution, set async (default: set).
  27839. Roll back to sync execution if the backend does not support async.
  27840. </p>
  27841. </dd>
  27842. </dl>
  27843. <a class="anchor" id="dnn_005fprocessing"></a></div>
  27844. <div class="section-level-extent" id="dnn_005fprocessing-1">
  27845. <h3 class="section"><span>30.74 dnn_processing<a class="copiable-link" href="#dnn_005fprocessing-1"> &para;</a></span></h3>
  27846. <p>Do image processing with deep neural networks. It works together with another filter
  27847. which converts the pixel format of the Frame to what the dnn network requires.
  27848. </p>
  27849. <p>The filter accepts the following options:
  27850. </p>
  27851. <dl class="table">
  27852. <dt><samp class="option">dnn_backend</samp></dt>
  27853. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  27854. the following values:
  27855. </p>
  27856. <dl class="table">
  27857. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  27858. <dd><p>TensorFlow backend. To enable this backend you
  27859. need to install the TensorFlow for C library (see
  27860. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  27861. <code class="code">--enable-libtensorflow</code>
  27862. </p>
  27863. </dd>
  27864. <dt>&lsquo;<samp class="samp">openvino</samp>&rsquo;</dt>
  27865. <dd><p>OpenVINO backend. To enable this backend you
  27866. need to build and install the OpenVINO for C library (see
  27867. <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
  27868. <code class="code">--enable-libopenvino</code> (&ndash;extra-cflags=-I... &ndash;extra-ldflags=-L... might
  27869. be needed if the header files and libraries are not installed into system path)
  27870. </p>
  27871. </dd>
  27872. <dt>&lsquo;<samp class="samp">torch</samp>&rsquo;</dt>
  27873. <dd><p>Libtorch backend. To enable this backend you need to build and install Libtroch
  27874. for C++ library. Please download cxx11 ABI version (see
  27875. <a class="url" href="https://pytorch.org/get-started/locally">https://pytorch.org/get-started/locally</a>)
  27876. and configure FFmpeg with <code class="code">--enable-libtorch
  27877. --extra-cflags=-I/libtorch_root/libtorch/include
  27878. --extra-cflags=-I/libtorch_root/libtorch/include/torch/csrc/api/include
  27879. --extra-ldflags=-L/libtorch_root/libtorch/lib/</code>
  27880. </p>
  27881. </dd>
  27882. </dl>
  27883. </dd>
  27884. <dt><samp class="option">model</samp></dt>
  27885. <dd><p>Set path to model file specifying network architecture and its parameters.
  27886. Note that different backends use different file formats. TensorFlow, OpenVINO
  27887. and Libtorch backend can load files for only its format.
  27888. </p>
  27889. </dd>
  27890. <dt><samp class="option">input</samp></dt>
  27891. <dd><p>Set the input name of the dnn network.
  27892. </p>
  27893. </dd>
  27894. <dt><samp class="option">output</samp></dt>
  27895. <dd><p>Set the output name of the dnn network.
  27896. </p>
  27897. </dd>
  27898. <dt><samp class="option">backend_configs</samp></dt>
  27899. <dd><p>Set the configs to be passed into backend. To use async execution, set async (default: set).
  27900. Roll back to sync execution if the backend does not support async.
  27901. </p>
  27902. <p>For tensorflow backend, you can set its configs with <samp class="option">sess_config</samp> options,
  27903. please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system.
  27904. </p>
  27905. </dd>
  27906. </dl>
  27907. <ul class="mini-toc">
  27908. <li><a href="#Examples-84" accesskey="1">Examples</a></li>
  27909. </ul>
  27910. <div class="subsection-level-extent" id="Examples-84">
  27911. <h4 class="subsection"><span>30.74.1 Examples<a class="copiable-link" href="#Examples-84"> &para;</a></span></h4>
  27912. <ul class="itemize mark-bullet">
  27913. <li>Remove rain in rgb24 frame with can.pb (see <a class="ref" href="#derain">derain</a> filter):
  27914. <div class="example">
  27915. <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
  27916. </pre></div>
  27917. </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):
  27918. <div class="example">
  27919. <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
  27920. </pre></div>
  27921. </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),
  27922. please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system.
  27923. <div class="example">
  27924. <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
  27925. </pre></div>
  27926. </li></ul>
  27927. </div>
  27928. </div>
  27929. <div class="section-level-extent" id="drawbox">
  27930. <h3 class="section"><span>30.75 drawbox<a class="copiable-link" href="#drawbox"> &para;</a></span></h3>
  27931. <p>Draw a colored box on the input image.
  27932. </p>
  27933. <p>It accepts the following parameters:
  27934. </p>
  27935. <dl class="table">
  27936. <dt><samp class="option">x</samp></dt>
  27937. <dt><samp class="option">y</samp></dt>
  27938. <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
  27939. </p>
  27940. </dd>
  27941. <dt><samp class="option">width, w</samp></dt>
  27942. <dt><samp class="option">height, h</samp></dt>
  27943. <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
  27944. the input width and height. It defaults to 0.
  27945. </p>
  27946. </dd>
  27947. <dt><samp class="option">color, c</samp></dt>
  27948. <dd><p>Specify the color of the box to write. For the general syntax of this option,
  27949. 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
  27950. value <code class="code">invert</code> is used, the box edge color is the same as the
  27951. video with inverted luma.
  27952. </p>
  27953. </dd>
  27954. <dt><samp class="option">thickness, t</samp></dt>
  27955. <dd><p>The expression which sets the thickness of the box edge.
  27956. A value of <code class="code">fill</code> will create a filled box. Default value is <code class="code">3</code>.
  27957. </p>
  27958. <p>See below for the list of accepted constants.
  27959. </p>
  27960. </dd>
  27961. <dt><samp class="option">replace</samp></dt>
  27962. <dd><p>Applicable if the input has alpha. With value <code class="code">1</code>, the pixels of the painted box
  27963. will overwrite the video&rsquo;s color and alpha pixels.
  27964. Default is <code class="code">0</code>, which composites the box onto the input, leaving the video&rsquo;s alpha intact.
  27965. </p></dd>
  27966. </dl>
  27967. <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
  27968. following constants:
  27969. </p>
  27970. <dl class="table">
  27971. <dt><samp class="option">dar</samp></dt>
  27972. <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>.
  27973. </p>
  27974. </dd>
  27975. <dt><samp class="option">hsub</samp></dt>
  27976. <dt><samp class="option">vsub</samp></dt>
  27977. <dd><p>horizontal and vertical chroma subsample values. For example for the
  27978. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  27979. </p>
  27980. </dd>
  27981. <dt><samp class="option">in_h, ih</samp></dt>
  27982. <dt><samp class="option">in_w, iw</samp></dt>
  27983. <dd><p>The input width and height.
  27984. </p>
  27985. </dd>
  27986. <dt><samp class="option">sar</samp></dt>
  27987. <dd><p>The input sample aspect ratio.
  27988. </p>
  27989. </dd>
  27990. <dt><samp class="option">x</samp></dt>
  27991. <dt><samp class="option">y</samp></dt>
  27992. <dd><p>The x and y offset coordinates where the box is drawn.
  27993. </p>
  27994. </dd>
  27995. <dt><samp class="option">w</samp></dt>
  27996. <dt><samp class="option">h</samp></dt>
  27997. <dd><p>The width and height of the drawn box.
  27998. </p>
  27999. </dd>
  28000. <dt><samp class="option">box_source</samp></dt>
  28001. <dd><p>Box source can be set as side_data_detection_bboxes if you want to use box data in
  28002. detection bboxes of side data.
  28003. </p>
  28004. <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
  28005. still use box data in detection bboxes of side data. So please do not use this parameter if you were
  28006. not sure about the box source.
  28007. </p>
  28008. </dd>
  28009. <dt><samp class="option">t</samp></dt>
  28010. <dd><p>The thickness of the drawn box.
  28011. </p>
  28012. <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
  28013. each other, so you may for example specify <code class="code">y=x/dar</code> or <code class="code">h=w/dar</code>.
  28014. </p>
  28015. </dd>
  28016. </dl>
  28017. <ul class="mini-toc">
  28018. <li><a href="#Examples-85" accesskey="1">Examples</a></li>
  28019. <li><a href="#Commands-86" accesskey="2">Commands</a></li>
  28020. </ul>
  28021. <div class="subsection-level-extent" id="Examples-85">
  28022. <h4 class="subsection"><span>30.75.1 Examples<a class="copiable-link" href="#Examples-85"> &para;</a></span></h4>
  28023. <ul class="itemize mark-bullet">
  28024. <li>Draw a black box around the edge of the input image:
  28025. <div class="example">
  28026. <pre class="example-preformatted">drawbox
  28027. </pre></div>
  28028. </li><li>Draw a box with color red and an opacity of 50%:
  28029. <div class="example">
  28030. <pre class="example-preformatted">drawbox=10:20:200:60:red@0.5
  28031. </pre></div>
  28032. <p>The previous example can be specified as:
  28033. </p><div class="example">
  28034. <pre class="example-preformatted">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
  28035. </pre></div>
  28036. </li><li>Fill the box with pink color:
  28037. <div class="example">
  28038. <pre class="example-preformatted">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
  28039. </pre></div>
  28040. </li><li>Draw a 2-pixel red 2.40:1 mask:
  28041. <div class="example">
  28042. <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
  28043. </pre></div>
  28044. </li></ul>
  28045. </div>
  28046. <div class="subsection-level-extent" id="Commands-86">
  28047. <h4 class="subsection"><span>30.75.2 Commands<a class="copiable-link" href="#Commands-86"> &para;</a></span></h4>
  28048. <p>This filter supports same commands as options.
  28049. The command accepts the same syntax of the corresponding option.
  28050. </p>
  28051. <p>If the specified expression is not valid, it is kept at its current
  28052. value.
  28053. </p>
  28054. <a class="anchor" id="drawgraph"></a></div>
  28055. </div>
  28056. <div class="section-level-extent" id="drawgraph-1">
  28057. <h3 class="section"><span>30.76 drawgraph<a class="copiable-link" href="#drawgraph-1"> &para;</a></span></h3>
  28058. <p>Draw a graph using input video metadata.
  28059. </p>
  28060. <p>It accepts the following parameters:
  28061. </p>
  28062. <dl class="table">
  28063. <dt><samp class="option">m1</samp></dt>
  28064. <dd><p>Set 1st frame metadata key from which metadata values will be used to draw a graph.
  28065. </p>
  28066. </dd>
  28067. <dt><samp class="option">fg1</samp></dt>
  28068. <dd><p>Set 1st foreground color expression.
  28069. </p>
  28070. </dd>
  28071. <dt><samp class="option">m2</samp></dt>
  28072. <dd><p>Set 2nd frame metadata key from which metadata values will be used to draw a graph.
  28073. </p>
  28074. </dd>
  28075. <dt><samp class="option">fg2</samp></dt>
  28076. <dd><p>Set 2nd foreground color expression.
  28077. </p>
  28078. </dd>
  28079. <dt><samp class="option">m3</samp></dt>
  28080. <dd><p>Set 3rd frame metadata key from which metadata values will be used to draw a graph.
  28081. </p>
  28082. </dd>
  28083. <dt><samp class="option">fg3</samp></dt>
  28084. <dd><p>Set 3rd foreground color expression.
  28085. </p>
  28086. </dd>
  28087. <dt><samp class="option">m4</samp></dt>
  28088. <dd><p>Set 4th frame metadata key from which metadata values will be used to draw a graph.
  28089. </p>
  28090. </dd>
  28091. <dt><samp class="option">fg4</samp></dt>
  28092. <dd><p>Set 4th foreground color expression.
  28093. </p>
  28094. </dd>
  28095. <dt><samp class="option">min</samp></dt>
  28096. <dd><p>Set minimal value of metadata value.
  28097. </p>
  28098. </dd>
  28099. <dt><samp class="option">max</samp></dt>
  28100. <dd><p>Set maximal value of metadata value.
  28101. </p>
  28102. </dd>
  28103. <dt><samp class="option">bg</samp></dt>
  28104. <dd><p>Set graph background color. Default is white.
  28105. </p>
  28106. </dd>
  28107. <dt><samp class="option">mode</samp></dt>
  28108. <dd><p>Set graph mode.
  28109. </p>
  28110. <p>Available values for mode is:
  28111. </p><dl class="table">
  28112. <dt>&lsquo;<samp class="samp">bar</samp>&rsquo;</dt>
  28113. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  28114. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  28115. </dl>
  28116. <p>Default is <code class="code">line</code>.
  28117. </p>
  28118. </dd>
  28119. <dt><samp class="option">slide</samp></dt>
  28120. <dd><p>Set slide mode.
  28121. </p>
  28122. <p>Available values for slide is:
  28123. </p><dl class="table">
  28124. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  28125. <dd><p>Draw new frame when right border is reached.
  28126. </p>
  28127. </dd>
  28128. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  28129. <dd><p>Replace old columns with new ones.
  28130. </p>
  28131. </dd>
  28132. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  28133. <dd><p>Scroll from right to left.
  28134. </p>
  28135. </dd>
  28136. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  28137. <dd><p>Scroll from left to right.
  28138. </p>
  28139. </dd>
  28140. <dt>&lsquo;<samp class="samp">picture</samp>&rsquo;</dt>
  28141. <dd><p>Draw single picture.
  28142. </p></dd>
  28143. </dl>
  28144. <p>Default is <code class="code">frame</code>.
  28145. </p>
  28146. </dd>
  28147. <dt><samp class="option">size</samp></dt>
  28148. <dd><p>Set size of graph video. For the syntax of this option, check the
  28149. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  28150. The default value is <code class="code">900x256</code>.
  28151. </p>
  28152. </dd>
  28153. <dt><samp class="option">rate, r</samp></dt>
  28154. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  28155. </p>
  28156. <p>The foreground color expressions can use the following variables:
  28157. </p><dl class="table">
  28158. <dt><samp class="option">MIN</samp></dt>
  28159. <dd><p>Minimal value of metadata value.
  28160. </p>
  28161. </dd>
  28162. <dt><samp class="option">MAX</samp></dt>
  28163. <dd><p>Maximal value of metadata value.
  28164. </p>
  28165. </dd>
  28166. <dt><samp class="option">VAL</samp></dt>
  28167. <dd><p>Current metadata key value.
  28168. </p></dd>
  28169. </dl>
  28170. <p>The color is defined as 0xAABBGGRR.
  28171. </p></dd>
  28172. </dl>
  28173. <p>Example using metadata from <a class="ref" href="#signalstats">signalstats</a> filter:
  28174. </p><div class="example">
  28175. <pre class="example-preformatted">signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
  28176. </pre></div>
  28177. <p>Example using metadata from <a class="ref" href="#ebur128">ebur128</a> filter:
  28178. </p><div class="example">
  28179. <pre class="example-preformatted">ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
  28180. </pre></div>
  28181. </div>
  28182. <div class="section-level-extent" id="drawgrid">
  28183. <h3 class="section"><span>30.77 drawgrid<a class="copiable-link" href="#drawgrid"> &para;</a></span></h3>
  28184. <p>Draw a grid on the input image.
  28185. </p>
  28186. <p>It accepts the following parameters:
  28187. </p>
  28188. <dl class="table">
  28189. <dt><samp class="option">x</samp></dt>
  28190. <dt><samp class="option">y</samp></dt>
  28191. <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
  28192. </p>
  28193. </dd>
  28194. <dt><samp class="option">width, w</samp></dt>
  28195. <dt><samp class="option">height, h</samp></dt>
  28196. <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
  28197. input width and height, respectively, minus <code class="code">thickness</code>, so image gets
  28198. framed. Default to 0.
  28199. </p>
  28200. </dd>
  28201. <dt><samp class="option">color, c</samp></dt>
  28202. <dd><p>Specify the color of the grid. For the general syntax of this option,
  28203. 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
  28204. value <code class="code">invert</code> is used, the grid color is the same as the
  28205. video with inverted luma.
  28206. </p>
  28207. </dd>
  28208. <dt><samp class="option">thickness, t</samp></dt>
  28209. <dd><p>The expression which sets the thickness of the grid line. Default value is <code class="code">1</code>.
  28210. </p>
  28211. <p>See below for the list of accepted constants.
  28212. </p>
  28213. </dd>
  28214. <dt><samp class="option">replace</samp></dt>
  28215. <dd><p>Applicable if the input has alpha. With <code class="code">1</code> the pixels of the painted grid
  28216. will overwrite the video&rsquo;s color and alpha pixels.
  28217. Default is <code class="code">0</code>, which composites the grid onto the input, leaving the video&rsquo;s alpha intact.
  28218. </p></dd>
  28219. </dl>
  28220. <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
  28221. following constants:
  28222. </p>
  28223. <dl class="table">
  28224. <dt><samp class="option">dar</samp></dt>
  28225. <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>.
  28226. </p>
  28227. </dd>
  28228. <dt><samp class="option">hsub</samp></dt>
  28229. <dt><samp class="option">vsub</samp></dt>
  28230. <dd><p>horizontal and vertical chroma subsample values. For example for the
  28231. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  28232. </p>
  28233. </dd>
  28234. <dt><samp class="option">in_h, ih</samp></dt>
  28235. <dt><samp class="option">in_w, iw</samp></dt>
  28236. <dd><p>The input grid cell width and height.
  28237. </p>
  28238. </dd>
  28239. <dt><samp class="option">sar</samp></dt>
  28240. <dd><p>The input sample aspect ratio.
  28241. </p>
  28242. </dd>
  28243. <dt><samp class="option">x</samp></dt>
  28244. <dt><samp class="option">y</samp></dt>
  28245. <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
  28246. </p>
  28247. </dd>
  28248. <dt><samp class="option">w</samp></dt>
  28249. <dt><samp class="option">h</samp></dt>
  28250. <dd><p>The width and height of the drawn cell.
  28251. </p>
  28252. </dd>
  28253. <dt><samp class="option">t</samp></dt>
  28254. <dd><p>The thickness of the drawn cell.
  28255. </p>
  28256. <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
  28257. each other, so you may for example specify <code class="code">y=x/dar</code> or <code class="code">h=w/dar</code>.
  28258. </p>
  28259. </dd>
  28260. </dl>
  28261. <ul class="mini-toc">
  28262. <li><a href="#Examples-86" accesskey="1">Examples</a></li>
  28263. <li><a href="#Commands-87" accesskey="2">Commands</a></li>
  28264. </ul>
  28265. <div class="subsection-level-extent" id="Examples-86">
  28266. <h4 class="subsection"><span>30.77.1 Examples<a class="copiable-link" href="#Examples-86"> &para;</a></span></h4>
  28267. <ul class="itemize mark-bullet">
  28268. <li>Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
  28269. <div class="example">
  28270. <pre class="example-preformatted">drawgrid=width=100:height=100:thickness=2:color=red@0.5
  28271. </pre></div>
  28272. </li><li>Draw a white 3x3 grid with an opacity of 50%:
  28273. <div class="example">
  28274. <pre class="example-preformatted">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
  28275. </pre></div>
  28276. </li></ul>
  28277. </div>
  28278. <div class="subsection-level-extent" id="Commands-87">
  28279. <h4 class="subsection"><span>30.77.2 Commands<a class="copiable-link" href="#Commands-87"> &para;</a></span></h4>
  28280. <p>This filter supports same commands as options.
  28281. The command accepts the same syntax of the corresponding option.
  28282. </p>
  28283. <p>If the specified expression is not valid, it is kept at its current
  28284. value.
  28285. </p>
  28286. <a class="anchor" id="drawtext"></a></div>
  28287. </div>
  28288. <div class="section-level-extent" id="drawtext-1">
  28289. <h3 class="section"><span>30.78 drawtext<a class="copiable-link" href="#drawtext-1"> &para;</a></span></h3>
  28290. <p>Draw a text string or text from a specified file on top of a video, using the
  28291. libfreetype library.
  28292. </p>
  28293. <p>To enable compilation of this filter, you need to configure FFmpeg with
  28294. <code class="code">--enable-libfreetype</code> and <code class="code">--enable-libharfbuzz</code>.
  28295. To enable default font fallback and the <var class="var">font</var> option you need to
  28296. configure FFmpeg with <code class="code">--enable-libfontconfig</code>.
  28297. To enable the <var class="var">text_shaping</var> option, you need to configure FFmpeg with
  28298. <code class="code">--enable-libfribidi</code>.
  28299. </p>
  28300. <ul class="mini-toc">
  28301. <li><a href="#Syntax-2" accesskey="1">Syntax</a></li>
  28302. <li><a href="#Text-expansion" accesskey="2">Text expansion</a></li>
  28303. <li><a href="#Commands-88" accesskey="3">Commands</a></li>
  28304. <li><a href="#Examples-87" accesskey="4">Examples</a></li>
  28305. </ul>
  28306. <div class="subsection-level-extent" id="Syntax-2">
  28307. <h4 class="subsection"><span>30.78.1 Syntax<a class="copiable-link" href="#Syntax-2"> &para;</a></span></h4>
  28308. <p>It accepts the following parameters:
  28309. </p>
  28310. <dl class="table">
  28311. <dt><samp class="option">box</samp></dt>
  28312. <dd><p>Used to draw a box around text using the background color.
  28313. The value must be either 1 (enable) or 0 (disable).
  28314. The default value of <var class="var">box</var> is 0.
  28315. </p>
  28316. </dd>
  28317. <dt><samp class="option">boxborderw</samp></dt>
  28318. <dd><p>Set the width of the border to be drawn around the box using <var class="var">boxcolor</var>.
  28319. The value must be specified using one of the following formats:
  28320. </p><ul class="itemize mark-bullet">
  28321. <li><code class="code">boxborderw=10</code> set the width of all the borders to 10
  28322. </li><li><code class="code">boxborderw=10|20</code> set the width of the top and bottom borders to 10
  28323. and the width of the left and right borders to 20
  28324. </li><li><code class="code">boxborderw=10|20|30</code> set the width of the top border to 10, the width
  28325. of the bottom border to 30 and the width of the left and right borders to 20
  28326. </li><li><code class="code">boxborderw=10|20|30|40</code> set the borders width to 10 (top), 20 (right),
  28327. 30 (bottom), 40 (left)
  28328. </li></ul>
  28329. <p>The default value of <var class="var">boxborderw</var> is &quot;0&quot;.
  28330. </p>
  28331. </dd>
  28332. <dt><samp class="option">boxcolor</samp></dt>
  28333. <dd><p>The color to be used for drawing box around text. For the syntax of this
  28334. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  28335. </p>
  28336. <p>The default value of <var class="var">boxcolor</var> is &quot;white&quot;.
  28337. </p>
  28338. </dd>
  28339. <dt><samp class="option">line_spacing</samp></dt>
  28340. <dd><p>Set the line spacing in pixels. The default value of <var class="var">line_spacing</var> is 0.
  28341. </p>
  28342. </dd>
  28343. <dt><samp class="option">text_align</samp></dt>
  28344. <dd><p>Set the vertical and horizontal alignment of the text with respect to the box boundaries.
  28345. The value is combination of flags, one for the vertical alignment (T=top,
  28346. M=middle, B=bottom) and one for the horizontal alignment (L=left, C=center, R=right).
  28347. Please note that tab characters are only supported with the left horizontal alignment.
  28348. </p>
  28349. </dd>
  28350. <dt><samp class="option">y_align</samp></dt>
  28351. <dd><p>Specify what the <var class="var">y</var> value is referred to. Possible values are:
  28352. </p><ul class="itemize mark-bullet">
  28353. <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>
  28354. </li><li><code class="code">baseline</code> the baseline of the first text line is placed at <var class="var">y</var>
  28355. </li><li><code class="code">font</code> the baseline of the first text line is placed at <var class="var">y</var> plus the
  28356. ascent (in pixels) defined in the font metrics
  28357. </li></ul>
  28358. <p>The default value of <var class="var">y_align</var> is &quot;text&quot; for backward compatibility.
  28359. </p>
  28360. </dd>
  28361. <dt><samp class="option">borderw</samp></dt>
  28362. <dd><p>Set the width of the border to be drawn around the text using <var class="var">bordercolor</var>.
  28363. The default value of <var class="var">borderw</var> is 0.
  28364. </p>
  28365. </dd>
  28366. <dt><samp class="option">bordercolor</samp></dt>
  28367. <dd><p>Set the color to be used for drawing border around text. For the syntax of this
  28368. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  28369. </p>
  28370. <p>The default value of <var class="var">bordercolor</var> is &quot;black&quot;.
  28371. </p>
  28372. </dd>
  28373. <dt><samp class="option">expansion</samp></dt>
  28374. <dd><p>Select how the <var class="var">text</var> is expanded. Can be either <code class="code">none</code>,
  28375. <code class="code">strftime</code> (deprecated) or <code class="code">normal</code> (default). See the
  28376. <a class="ref" href="#drawtext_005fexpansion">Text expansion</a> section below for details.
  28377. </p>
  28378. </dd>
  28379. <dt><samp class="option">basetime</samp></dt>
  28380. <dd><p>Set a start time for the count. Value is in microseconds. Only applied
  28381. in the deprecated <code class="code">strftime</code> expansion mode. To emulate in normal expansion
  28382. mode use the <code class="code">pts</code> function, supplying the start time (in seconds)
  28383. as the second argument.
  28384. </p>
  28385. </dd>
  28386. <dt><samp class="option">fix_bounds</samp></dt>
  28387. <dd><p>If true, check and fix text coords to avoid clipping.
  28388. </p>
  28389. </dd>
  28390. <dt><samp class="option">fontcolor</samp></dt>
  28391. <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
  28392. the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  28393. </p>
  28394. <p>The default value of <var class="var">fontcolor</var> is &quot;black&quot;.
  28395. </p>
  28396. </dd>
  28397. <dt><samp class="option">fontcolor_expr</samp></dt>
  28398. <dd><p>String which is expanded the same way as <var class="var">text</var> to obtain dynamic
  28399. <var class="var">fontcolor</var> value. By default this option has empty value and is not
  28400. processed. When this option is set, it overrides <var class="var">fontcolor</var> option.
  28401. </p>
  28402. </dd>
  28403. <dt><samp class="option">font</samp></dt>
  28404. <dd><p>The font family to be used for drawing text. By default Sans.
  28405. </p>
  28406. </dd>
  28407. <dt><samp class="option">fontfile</samp></dt>
  28408. <dd><p>The font file to be used for drawing text. The path must be included.
  28409. This parameter is mandatory if the fontconfig support is disabled.
  28410. </p>
  28411. </dd>
  28412. <dt><samp class="option">alpha</samp></dt>
  28413. <dd><p>Draw the text applying alpha blending. The value can
  28414. be a number between 0.0 and 1.0.
  28415. The expression accepts the same variables <var class="var">x, y</var> as well.
  28416. The default value is 1.
  28417. Please see <var class="var">fontcolor_expr</var>.
  28418. </p>
  28419. </dd>
  28420. <dt><samp class="option">fontsize</samp></dt>
  28421. <dd><p>The font size to be used for drawing text.
  28422. The default value of <var class="var">fontsize</var> is 16.
  28423. </p>
  28424. </dd>
  28425. <dt><samp class="option">text_shaping</samp></dt>
  28426. <dd><p>If set to 1, attempt to shape the text (for example, reverse the order of
  28427. right-to-left text and join Arabic characters) before drawing it.
  28428. Otherwise, just draw the text exactly as given.
  28429. By default 1 (if supported).
  28430. </p>
  28431. </dd>
  28432. <dt><samp class="option">ft_load_flags</samp></dt>
  28433. <dd><p>The flags to be used for loading the fonts.
  28434. </p>
  28435. <p>The flags map the corresponding flags supported by libfreetype, and are
  28436. a combination of the following values:
  28437. </p><dl class="table">
  28438. <dt><var class="var">default</var></dt>
  28439. <dt><var class="var">no_scale</var></dt>
  28440. <dt><var class="var">no_hinting</var></dt>
  28441. <dt><var class="var">render</var></dt>
  28442. <dt><var class="var">no_bitmap</var></dt>
  28443. <dt><var class="var">vertical_layout</var></dt>
  28444. <dt><var class="var">force_autohint</var></dt>
  28445. <dt><var class="var">crop_bitmap</var></dt>
  28446. <dt><var class="var">pedantic</var></dt>
  28447. <dt><var class="var">ignore_global_advance_width</var></dt>
  28448. <dt><var class="var">no_recurse</var></dt>
  28449. <dt><var class="var">ignore_transform</var></dt>
  28450. <dt><var class="var">monochrome</var></dt>
  28451. <dt><var class="var">linear_design</var></dt>
  28452. <dt><var class="var">no_autohint</var></dt>
  28453. </dl>
  28454. <p>Default value is &quot;default&quot;.
  28455. </p>
  28456. <p>For more information consult the documentation for the FT_LOAD_*
  28457. libfreetype flags.
  28458. </p>
  28459. </dd>
  28460. <dt><samp class="option">shadowcolor</samp></dt>
  28461. <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
  28462. syntax of this option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the
  28463. ffmpeg-utils manual</a>.
  28464. </p>
  28465. <p>The default value of <var class="var">shadowcolor</var> is &quot;black&quot;.
  28466. </p>
  28467. </dd>
  28468. <dt><samp class="option">boxw</samp></dt>
  28469. <dd><p>Set the width of the box to be drawn around text.
  28470. The default value of <var class="var">boxw</var> is computed automatically to match the text width
  28471. </p>
  28472. </dd>
  28473. <dt><samp class="option">boxh</samp></dt>
  28474. <dd><p>Set the height of the box to be drawn around text.
  28475. The default value of <var class="var">boxh</var> is computed automatically to match the text height
  28476. </p>
  28477. </dd>
  28478. <dt><samp class="option">shadowx</samp></dt>
  28479. <dt><samp class="option">shadowy</samp></dt>
  28480. <dd><p>The x and y offsets for the text shadow position with respect to the
  28481. position of the text. They can be either positive or negative
  28482. values. The default value for both is &quot;0&quot;.
  28483. </p>
  28484. </dd>
  28485. <dt><samp class="option">start_number</samp></dt>
  28486. <dd><p>The starting frame number for the n/frame_num variable. The default value
  28487. is &quot;0&quot;.
  28488. </p>
  28489. </dd>
  28490. <dt><samp class="option">tabsize</samp></dt>
  28491. <dd><p>The size in number of spaces to use for rendering the tab.
  28492. Default value is 4.
  28493. </p>
  28494. </dd>
  28495. <dt><samp class="option">timecode</samp></dt>
  28496. <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
  28497. format. It can be used with or without text parameter. <var class="var">timecode_rate</var>
  28498. option must be specified.
  28499. </p>
  28500. </dd>
  28501. <dt><samp class="option">timecode_rate, rate, r</samp></dt>
  28502. <dd><p>Set the timecode frame rate (timecode only). Value will be rounded to nearest
  28503. integer. Minimum value is &quot;1&quot;.
  28504. Drop-frame timecode is supported for frame rates 30 &amp; 60.
  28505. </p>
  28506. </dd>
  28507. <dt><samp class="option">tc24hmax</samp></dt>
  28508. <dd><p>If set to 1, the output of the timecode option will wrap around at 24 hours.
  28509. Default is 0 (disabled).
  28510. </p>
  28511. </dd>
  28512. <dt><samp class="option">text</samp></dt>
  28513. <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
  28514. encoded characters.
  28515. This parameter is mandatory if no file is specified with the parameter
  28516. <var class="var">textfile</var>.
  28517. </p>
  28518. </dd>
  28519. <dt><samp class="option">textfile</samp></dt>
  28520. <dd><p>A text file containing text to be drawn. The text must be a sequence
  28521. of UTF-8 encoded characters.
  28522. </p>
  28523. <p>This parameter is mandatory if no text string is specified with the
  28524. parameter <var class="var">text</var>.
  28525. </p>
  28526. <p>If both <var class="var">text</var> and <var class="var">textfile</var> are specified, an error is thrown.
  28527. </p>
  28528. </dd>
  28529. <dt><samp class="option">text_source</samp></dt>
  28530. <dd><p>Text source should be set as side_data_detection_bboxes if you want to use text data in
  28531. detection bboxes of side data.
  28532. </p>
  28533. <p>If text source is set, <var class="var">text</var> and <var class="var">textfile</var> will be ignored and still use
  28534. text data in detection bboxes of side data. So please do not use this parameter
  28535. if you are not sure about the text source.
  28536. </p>
  28537. </dd>
  28538. <dt><samp class="option">reload</samp></dt>
  28539. <dd><p>The <var class="var">textfile</var> will be reloaded at specified frame interval.
  28540. Be sure to update <var class="var">textfile</var> atomically, or it may be read partially,
  28541. or even fail.
  28542. Range is 0 to INT_MAX. Default is 0.
  28543. </p>
  28544. </dd>
  28545. <dt><samp class="option">x</samp></dt>
  28546. <dt><samp class="option">y</samp></dt>
  28547. <dd><p>The expressions which specify the offsets where text will be drawn
  28548. within the video frame. They are relative to the top/left border of the
  28549. output image.
  28550. </p>
  28551. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is &quot;0&quot;.
  28552. </p>
  28553. <p>See below for the list of accepted constants and functions.
  28554. </p></dd>
  28555. </dl>
  28556. <p>The parameters for <var class="var">x</var> and <var class="var">y</var> are expressions containing the
  28557. following constants and functions:
  28558. </p>
  28559. <dl class="table">
  28560. <dt><samp class="option">dar</samp></dt>
  28561. <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>
  28562. </p>
  28563. </dd>
  28564. <dt><samp class="option">hsub</samp></dt>
  28565. <dt><samp class="option">vsub</samp></dt>
  28566. <dd><p>horizontal and vertical chroma subsample values. For example for the
  28567. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  28568. </p>
  28569. </dd>
  28570. <dt><samp class="option">line_h, lh</samp></dt>
  28571. <dd><p>the height of each text line
  28572. </p>
  28573. </dd>
  28574. <dt><samp class="option">main_h, h, H</samp></dt>
  28575. <dd><p>the input height
  28576. </p>
  28577. </dd>
  28578. <dt><samp class="option">main_w, w, W</samp></dt>
  28579. <dd><p>the input width
  28580. </p>
  28581. </dd>
  28582. <dt><samp class="option">max_glyph_a, ascent</samp></dt>
  28583. <dd><p>the maximum distance from the baseline to the highest/upper grid
  28584. coordinate used to place a glyph outline point, for all the rendered
  28585. glyphs.
  28586. It is a positive value, due to the grid&rsquo;s orientation with the Y axis
  28587. upwards.
  28588. </p>
  28589. </dd>
  28590. <dt><samp class="option">max_glyph_d, descent</samp></dt>
  28591. <dd><p>the maximum distance from the baseline to the lowest grid coordinate
  28592. used to place a glyph outline point, for all the rendered glyphs.
  28593. This is a negative value, due to the grid&rsquo;s orientation, with the Y axis
  28594. upwards.
  28595. </p>
  28596. </dd>
  28597. <dt><samp class="option">max_glyph_h</samp></dt>
  28598. <dd><p>maximum glyph height, that is the maximum height for all the glyphs
  28599. contained in the rendered text, it is equivalent to <var class="var">ascent</var> -
  28600. <var class="var">descent</var>.
  28601. </p>
  28602. </dd>
  28603. <dt><samp class="option">max_glyph_w</samp></dt>
  28604. <dd><p>maximum glyph width, that is the maximum width for all the glyphs
  28605. contained in the rendered text
  28606. </p>
  28607. </dd>
  28608. <dt><samp class="option">font_a</samp></dt>
  28609. <dd><p>the ascent size defined in the font metrics
  28610. </p>
  28611. </dd>
  28612. <dt><samp class="option">font_d</samp></dt>
  28613. <dd><p>the descent size defined in the font metrics
  28614. </p>
  28615. </dd>
  28616. <dt><samp class="option">top_a</samp></dt>
  28617. <dd><p>the maximum ascender of the glyphs of the first text line
  28618. </p>
  28619. </dd>
  28620. <dt><samp class="option">bottom_d</samp></dt>
  28621. <dd><p>the maximum descender of the glyphs of the last text line
  28622. </p>
  28623. </dd>
  28624. <dt><samp class="option">n</samp></dt>
  28625. <dd><p>the number of input frame, starting from 0
  28626. </p>
  28627. </dd>
  28628. <dt><samp class="option">rand(min, max)</samp></dt>
  28629. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  28630. </p>
  28631. </dd>
  28632. <dt><samp class="option">sar</samp></dt>
  28633. <dd><p>The input sample aspect ratio.
  28634. </p>
  28635. </dd>
  28636. <dt><samp class="option">t</samp></dt>
  28637. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  28638. </p>
  28639. </dd>
  28640. <dt><samp class="option">text_h, th</samp></dt>
  28641. <dd><p>the height of the rendered text
  28642. </p>
  28643. </dd>
  28644. <dt><samp class="option">text_w, tw</samp></dt>
  28645. <dd><p>the width of the rendered text
  28646. </p>
  28647. </dd>
  28648. <dt><samp class="option">x</samp></dt>
  28649. <dt><samp class="option">y</samp></dt>
  28650. <dd><p>the x and y offset coordinates where the text is drawn.
  28651. </p>
  28652. <p>These parameters allow the <var class="var">x</var> and <var class="var">y</var> expressions to refer
  28653. to each other, so you can for example specify <code class="code">y=x/dar</code>.
  28654. </p>
  28655. </dd>
  28656. <dt><samp class="option">pict_type</samp></dt>
  28657. <dd><p>A one character description of the current frame&rsquo;s picture type.
  28658. </p>
  28659. </dd>
  28660. <dt><samp class="option">pkt_pos</samp></dt>
  28661. <dd><p>The current packet&rsquo;s position in the input file or stream
  28662. (in bytes, from the start of the input). A value of -1 indicates
  28663. this info is not available.
  28664. </p>
  28665. </dd>
  28666. <dt><samp class="option">duration</samp></dt>
  28667. <dd><p>The current packet&rsquo;s duration, in seconds.
  28668. </p>
  28669. </dd>
  28670. <dt><samp class="option">pkt_size</samp></dt>
  28671. <dd><p>The current packet&rsquo;s size (in bytes).
  28672. </p></dd>
  28673. </dl>
  28674. <a class="anchor" id="drawtext_005fexpansion"></a></div>
  28675. <div class="subsection-level-extent" id="Text-expansion">
  28676. <h4 class="subsection"><span>30.78.2 Text expansion<a class="copiable-link" href="#Text-expansion"> &para;</a></span></h4>
  28677. <p>If <samp class="option">expansion</samp> is set to <code class="code">strftime</code>, the filter recognizes
  28678. sequences accepted by the <code class="code">strftime</code> C function in the provided
  28679. text and expands them accordingly. Check the documentation of
  28680. <code class="code">strftime</code>. This feature is deprecated in favor of <code class="code">normal</code>
  28681. expansion with the <code class="code">gmtime</code> or <code class="code">localtime</code> expansion
  28682. functions.
  28683. </p>
  28684. <p>If <samp class="option">expansion</samp> is set to <code class="code">none</code>, the text is printed verbatim.
  28685. </p>
  28686. <p>If <samp class="option">expansion</samp> is set to <code class="code">normal</code> (which is the default),
  28687. the following expansion mechanism is used.
  28688. </p>
  28689. <p>The backslash character &lsquo;<samp class="samp">\</samp>&rsquo;, followed by any character, always expands to
  28690. the second character.
  28691. </p>
  28692. <p>Sequences of the form <code class="code">%{...}</code> are expanded. The text between the
  28693. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  28694. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  28695. they should be escaped.
  28696. </p>
  28697. <p>Note that they probably must also be escaped as the value for the <samp class="option">text</samp>
  28698. option in the filter argument string and as the filter argument in the
  28699. filtergraph description, and possibly also for the shell, that makes up to four
  28700. levels of escaping; using a text file with the <samp class="option">textfile</samp> option avoids
  28701. these problems.
  28702. </p>
  28703. <p>The following functions are available:
  28704. </p>
  28705. <dl class="table">
  28706. <dt><code class="command">expr, e</code></dt>
  28707. <dd><p>The expression evaluation result.
  28708. </p>
  28709. <p>It must take one argument specifying the expression to be evaluated,
  28710. which accepts the same constants and functions as the <var class="var">x</var> and
  28711. <var class="var">y</var> values. Note that not all constants should be used, for
  28712. example the text size is not known when evaluating the expression, so
  28713. the constants <var class="var">text_w</var> and <var class="var">text_h</var> will have an undefined
  28714. value.
  28715. </p>
  28716. </dd>
  28717. <dt><code class="command">expr_int_format, eif</code></dt>
  28718. <dd><p>Evaluate the expression&rsquo;s value and output as formatted integer.
  28719. </p>
  28720. <p>The first argument is the expression to be evaluated, just as for the <var class="var">expr</var> function.
  28721. The second argument specifies the output format. Allowed values are &lsquo;<samp class="samp">x</samp>&rsquo;,
  28722. &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
  28723. <code class="code">printf</code> function.
  28724. The third parameter is optional and sets the number of positions taken by the output.
  28725. It can be used to add padding with zeros from the left.
  28726. </p>
  28727. </dd>
  28728. <dt><code class="command">gmtime</code></dt>
  28729. <dd><p>The time at which the filter is running, expressed in UTC.
  28730. It can accept an argument: a <code class="code">strftime</code> C function format string.
  28731. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  28732. which prints fractions of the second with optionally specified number of digits.
  28733. </p>
  28734. </dd>
  28735. <dt><code class="command">localtime</code></dt>
  28736. <dd><p>The time at which the filter is running, expressed in the local time zone.
  28737. It can accept an argument: a <code class="code">strftime</code> C function format string.
  28738. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  28739. which prints fractions of the second with optionally specified number of digits.
  28740. </p>
  28741. </dd>
  28742. <dt><code class="command">metadata</code></dt>
  28743. <dd><p>Frame metadata. Takes one or two arguments.
  28744. </p>
  28745. <p>The first argument is mandatory and specifies the metadata key.
  28746. </p>
  28747. <p>The second argument is optional and specifies a default value, used when the
  28748. metadata key is not found or empty.
  28749. </p>
  28750. <p>Available metadata can be identified by inspecting entries
  28751. starting with TAG included within each frame section
  28752. printed by running <code class="code">ffprobe -show_frames</code>.
  28753. </p>
  28754. <p>String metadata generated in filters leading to
  28755. the drawtext filter are also available.
  28756. </p>
  28757. </dd>
  28758. <dt><code class="command">n, frame_num</code></dt>
  28759. <dd><p>The frame number, starting from 0.
  28760. </p>
  28761. </dd>
  28762. <dt><code class="command">pict_type</code></dt>
  28763. <dd><p>A one character description of the current picture type.
  28764. </p>
  28765. </dd>
  28766. <dt><code class="command">pts</code></dt>
  28767. <dd><p>The timestamp of the current frame.
  28768. It can take up to three arguments.
  28769. </p>
  28770. <p>The first argument is the format of the timestamp; it defaults to <code class="code">flt</code>
  28771. for seconds as a decimal number with microsecond accuracy; <code class="code">hms</code> stands
  28772. for a formatted <var class="var">[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  28773. <code class="code">gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  28774. <code class="code">localtime</code> stands for the timestamp of the frame formatted as
  28775. local time zone time.
  28776. </p>
  28777. <p>The second argument is an offset added to the timestamp.
  28778. </p>
  28779. <p>If the format is set to <code class="code">hms</code>, a third argument <code class="code">24HH</code> may be
  28780. supplied to present the hour part of the formatted timestamp in 24h format
  28781. (00-23).
  28782. </p>
  28783. <p>If the format is set to <code class="code">localtime</code> or <code class="code">gmtime</code>, a third
  28784. argument may be supplied: a <code class="code">strftime</code> C function format string.
  28785. By default, <var class="var">YYYY-MM-DD HH:MM:SS</var> format will be used.
  28786. </p></dd>
  28787. </dl>
  28788. </div>
  28789. <div class="subsection-level-extent" id="Commands-88">
  28790. <h4 class="subsection"><span>30.78.3 Commands<a class="copiable-link" href="#Commands-88"> &para;</a></span></h4>
  28791. <p>This filter supports altering parameters via commands:
  28792. </p><dl class="table">
  28793. <dt><samp class="option">reinit</samp></dt>
  28794. <dd><p>Alter existing filter parameters.
  28795. </p>
  28796. <p>Syntax for the argument is the same as for filter invocation, e.g.
  28797. </p>
  28798. <div class="example">
  28799. <pre class="example-preformatted">fontsize=56:fontcolor=green:text='Hello World'
  28800. </pre></div>
  28801. <p>Full filter invocation with sendcmd would look like this:
  28802. </p>
  28803. <div class="example">
  28804. <pre class="example-preformatted">sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
  28805. </pre></div>
  28806. <p>If the entire argument can&rsquo;t be parsed or applied as valid values then the filter will
  28807. continue with its existing parameters.
  28808. </p>
  28809. </dd>
  28810. </dl>
  28811. <p>The following options are also supported as <a class="ref" href="#commands">commands</a>:
  28812. </p>
  28813. <ul class="itemize mark-bullet">
  28814. <li>x
  28815. </li><li>y
  28816. </li><li>alpha
  28817. </li><li>fontsize
  28818. </li><li>fontcolor
  28819. </li><li>boxcolor
  28820. </li><li>bordercolor
  28821. </li><li>shadowcolor
  28822. </li><li>box
  28823. </li><li>boxw
  28824. </li><li>boxh
  28825. </li><li>boxborderw
  28826. </li><li>line_spacing
  28827. </li><li>text_align
  28828. </li><li>shadowx
  28829. </li><li>shadowy
  28830. </li><li>borderw
  28831. </li></ul>
  28832. </div>
  28833. <div class="subsection-level-extent" id="Examples-87">
  28834. <h4 class="subsection"><span>30.78.4 Examples<a class="copiable-link" href="#Examples-87"> &para;</a></span></h4>
  28835. <ul class="itemize mark-bullet">
  28836. <li>Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
  28837. optional parameters.
  28838. <div class="example">
  28839. <pre class="example-preformatted">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
  28840. </pre></div>
  28841. </li><li>Draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
  28842. and y=50 (counting from the top-left corner of the screen), text is
  28843. yellow with a red box around it. Both the text and the box have an
  28844. opacity of 20%.
  28845. <div class="example">
  28846. <pre class="example-preformatted">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
  28847. x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
  28848. </pre></div>
  28849. <p>Note that the double quotes are not necessary if spaces are not used
  28850. within the parameter list.
  28851. </p>
  28852. </li><li>Show the text at the center of the video frame:
  28853. <div class="example">
  28854. <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;
  28855. </pre></div>
  28856. </li><li>Show the text at a random position, switching to a new position every 30 seconds:
  28857. <div class="example">
  28858. <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;
  28859. </pre></div>
  28860. </li><li>Show a text line sliding from right to left in the last row of the video
  28861. frame. The file <samp class="file">LONG_LINE</samp> is assumed to contain a single line
  28862. with no newlines.
  28863. <div class="example">
  28864. <pre class="example-preformatted">drawtext=&quot;fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t&quot;
  28865. </pre></div>
  28866. </li><li>Show the content of file <samp class="file">CREDITS</samp> off the bottom of the frame and scroll up.
  28867. <div class="example">
  28868. <pre class="example-preformatted">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
  28869. </pre></div>
  28870. </li><li>Draw a single green letter &quot;g&quot;, at the center of the input video.
  28871. The glyph baseline is placed at half screen height.
  28872. <div class="example">
  28873. <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;
  28874. </pre></div>
  28875. </li><li>Show text for 1 second every 3 seconds:
  28876. <div class="example">
  28877. <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;
  28878. </pre></div>
  28879. </li><li>Use fontconfig to set the font. Note that the colons need to be escaped.
  28880. <div class="example">
  28881. <pre class="example-preformatted">drawtext='fontfile=Linux Libertine O-40\\:style=Semibold:text=FFmpeg'
  28882. </pre></div>
  28883. </li><li>Draw &quot;Test Text&quot; with font size dependent on height of the video.
  28884. <div class="example">
  28885. <pre class="example-preformatted">drawtext=&quot;text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)&quot;
  28886. </pre></div>
  28887. </li><li>Print the date of a real-time encoding (see documentation for the
  28888. <code class="code">strftime</code> C function):
  28889. <div class="example">
  28890. <pre class="example-preformatted">drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
  28891. </pre></div>
  28892. </li><li>Show text fading in and out (appearing/disappearing):
  28893. <div class="example">
  28894. <pre class="example-preformatted">#!/bin/sh
  28895. DS=1.0 # display start
  28896. DE=10.0 # display end
  28897. FID=1.5 # fade in duration
  28898. FOD=5 # fade out duration
  28899. 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;
  28900. </pre></div>
  28901. </li><li>Horizontally align multiple separate texts. Note that <samp class="option">max_glyph_a</samp>
  28902. and the <samp class="option">fontsize</samp> value are included in the <samp class="option">y</samp> offset.
  28903. <div class="example">
  28904. <pre class="example-preformatted">drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
  28905. drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
  28906. </pre></div>
  28907. </li><li>Plot special <var class="var">lavf.image2dec.source_basename</var> metadata onto each frame if
  28908. such metadata exists. Otherwise, plot the string &quot;NA&quot;. Note that image2 demuxer
  28909. must have option <samp class="option">-export_path_metadata 1</samp> for the special metadata fields
  28910. to be available for filters.
  28911. <div class="example">
  28912. <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;
  28913. </pre></div>
  28914. </li></ul>
  28915. <p>For more information about libfreetype, check:
  28916. <a class="url" href="http://www.freetype.org/">http://www.freetype.org/</a>.
  28917. </p>
  28918. <p>For more information about fontconfig, check:
  28919. <a class="url" href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
  28920. </p>
  28921. <p>For more information about libfribidi, check:
  28922. <a class="url" href="http://fribidi.org/">http://fribidi.org/</a>.
  28923. </p>
  28924. <p>For more information about libharfbuzz, check:
  28925. <a class="url" href="https://github.com/harfbuzz/harfbuzz">https://github.com/harfbuzz/harfbuzz</a>.
  28926. </p>
  28927. </div>
  28928. </div>
  28929. <div class="section-level-extent" id="edgedetect">
  28930. <h3 class="section"><span>30.79 edgedetect<a class="copiable-link" href="#edgedetect"> &para;</a></span></h3>
  28931. <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
  28932. </p>
  28933. <p>The filter accepts the following options:
  28934. </p>
  28935. <dl class="table">
  28936. <dt><samp class="option">low</samp></dt>
  28937. <dt><samp class="option">high</samp></dt>
  28938. <dd><p>Set low and high threshold values used by the Canny thresholding
  28939. algorithm.
  28940. </p>
  28941. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  28942. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  28943. by the low threshold.
  28944. </p>
  28945. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  28946. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  28947. </p>
  28948. <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>
  28949. is <code class="code">50/255</code>.
  28950. </p>
  28951. </dd>
  28952. <dt><samp class="option">mode</samp></dt>
  28953. <dd><p>Define the drawing mode.
  28954. </p>
  28955. <dl class="table">
  28956. <dt>&lsquo;<samp class="samp">wires</samp>&rsquo;</dt>
  28957. <dd><p>Draw white/gray wires on black background.
  28958. </p>
  28959. </dd>
  28960. <dt>&lsquo;<samp class="samp">colormix</samp>&rsquo;</dt>
  28961. <dd><p>Mix the colors to create a paint/cartoon effect.
  28962. </p>
  28963. </dd>
  28964. <dt>&lsquo;<samp class="samp">canny</samp>&rsquo;</dt>
  28965. <dd><p>Apply Canny edge detector on all selected planes.
  28966. </p></dd>
  28967. </dl>
  28968. <p>Default value is <var class="var">wires</var>.
  28969. </p>
  28970. </dd>
  28971. <dt><samp class="option">planes</samp></dt>
  28972. <dd><p>Select planes for filtering. By default all available planes are filtered.
  28973. </p></dd>
  28974. </dl>
  28975. <ul class="mini-toc">
  28976. <li><a href="#Examples-88" accesskey="1">Examples</a></li>
  28977. </ul>
  28978. <div class="subsection-level-extent" id="Examples-88">
  28979. <h4 class="subsection"><span>30.79.1 Examples<a class="copiable-link" href="#Examples-88"> &para;</a></span></h4>
  28980. <ul class="itemize mark-bullet">
  28981. <li>Standard edge detection with custom values for the hysteresis thresholding:
  28982. <div class="example">
  28983. <pre class="example-preformatted">edgedetect=low=0.1:high=0.4
  28984. </pre></div>
  28985. </li><li>Painting effect without thresholding:
  28986. <div class="example">
  28987. <pre class="example-preformatted">edgedetect=mode=colormix:high=0
  28988. </pre></div>
  28989. </li></ul>
  28990. </div>
  28991. </div>
  28992. <div class="section-level-extent" id="elbg">
  28993. <h3 class="section"><span>30.80 elbg<a class="copiable-link" href="#elbg"> &para;</a></span></h3>
  28994. <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
  28995. </p>
  28996. <p>For each input image, the filter will compute the optimal mapping from
  28997. the input to the output given the codebook length, that is the number
  28998. of distinct output colors.
  28999. </p>
  29000. <p>This filter accepts the following options.
  29001. </p>
  29002. <dl class="table">
  29003. <dt><samp class="option">codebook_length, l</samp></dt>
  29004. <dd><p>Set codebook length. The value must be a positive integer, and
  29005. represents the number of distinct output colors. Default value is 256.
  29006. </p>
  29007. </dd>
  29008. <dt><samp class="option">nb_steps, n</samp></dt>
  29009. <dd><p>Set the maximum number of iterations to apply for computing the optimal
  29010. mapping. The higher the value the better the result and the higher the
  29011. computation time. Default value is 1.
  29012. </p>
  29013. </dd>
  29014. <dt><samp class="option">seed, s</samp></dt>
  29015. <dd><p>Set a random seed, must be an integer included between 0 and
  29016. UINT32_MAX. If not specified, or if explicitly set to -1, the filter
  29017. will try to use a good random seed on a best effort basis.
  29018. </p>
  29019. </dd>
  29020. <dt><samp class="option">pal8</samp></dt>
  29021. <dd><p>Set pal8 output pixel format. This option does not work with codebook
  29022. length greater than 256. Default is disabled.
  29023. </p>
  29024. </dd>
  29025. <dt><samp class="option">use_alpha</samp></dt>
  29026. <dd><p>Include alpha values in the quantization calculation. Allows creating
  29027. palettized output images (e.g. PNG8) with multiple alpha smooth blending.
  29028. </p></dd>
  29029. </dl>
  29030. </div>
  29031. <div class="section-level-extent" id="entropy">
  29032. <h3 class="section"><span>30.81 entropy<a class="copiable-link" href="#entropy"> &para;</a></span></h3>
  29033. <p>Measure graylevel entropy in histogram of color channels of video frames.
  29034. </p>
  29035. <p>It accepts the following parameters:
  29036. </p>
  29037. <dl class="table">
  29038. <dt><samp class="option">mode</samp></dt>
  29039. <dd><p>Can be either <var class="var">normal</var> or <var class="var">diff</var>. Default is <var class="var">normal</var>.
  29040. </p>
  29041. <p><var class="var">diff</var> mode measures entropy of histogram delta values, absolute differences
  29042. between neighbour histogram values.
  29043. </p></dd>
  29044. </dl>
  29045. </div>
  29046. <div class="section-level-extent" id="epx">
  29047. <h3 class="section"><span>30.82 epx<a class="copiable-link" href="#epx"> &para;</a></span></h3>
  29048. <p>Apply the EPX magnification filter which is designed for pixel art.
  29049. </p>
  29050. <p>It accepts the following option:
  29051. </p>
  29052. <dl class="table">
  29053. <dt><samp class="option">n</samp></dt>
  29054. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">2xEPX</code>, <code class="code">3</code> for
  29055. <code class="code">3xEPX</code>.
  29056. Default is <code class="code">3</code>.
  29057. </p></dd>
  29058. </dl>
  29059. </div>
  29060. <div class="section-level-extent" id="eq">
  29061. <h3 class="section"><span>30.83 eq<a class="copiable-link" href="#eq"> &para;</a></span></h3>
  29062. <p>Set brightness, contrast, saturation and approximate gamma adjustment.
  29063. </p>
  29064. <p>The filter accepts the following options:
  29065. </p>
  29066. <dl class="table">
  29067. <dt><samp class="option">contrast</samp></dt>
  29068. <dd><p>Set the contrast expression. The value must be a float value in range
  29069. <code class="code">-1000.0</code> to <code class="code">1000.0</code>. The default value is &quot;1&quot;.
  29070. </p>
  29071. </dd>
  29072. <dt><samp class="option">brightness</samp></dt>
  29073. <dd><p>Set the brightness expression. The value must be a float value in
  29074. range <code class="code">-1.0</code> to <code class="code">1.0</code>. The default value is &quot;0&quot;.
  29075. </p>
  29076. </dd>
  29077. <dt><samp class="option">saturation</samp></dt>
  29078. <dd><p>Set the saturation expression. The value must be a float in
  29079. range <code class="code">0.0</code> to <code class="code">3.0</code>. The default value is &quot;1&quot;.
  29080. </p>
  29081. </dd>
  29082. <dt><samp class="option">gamma</samp></dt>
  29083. <dd><p>Set the gamma expression. The value must be a float in range
  29084. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  29085. </p>
  29086. </dd>
  29087. <dt><samp class="option">gamma_r</samp></dt>
  29088. <dd><p>Set the gamma expression for red. The value must be a float in
  29089. range <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  29090. </p>
  29091. </dd>
  29092. <dt><samp class="option">gamma_g</samp></dt>
  29093. <dd><p>Set the gamma expression for green. The value must be a float in range
  29094. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  29095. </p>
  29096. </dd>
  29097. <dt><samp class="option">gamma_b</samp></dt>
  29098. <dd><p>Set the gamma expression for blue. The value must be a float in range
  29099. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  29100. </p>
  29101. </dd>
  29102. <dt><samp class="option">gamma_weight</samp></dt>
  29103. <dd><p>Set the gamma weight expression. It can be used to reduce the effect
  29104. of a high gamma value on bright image areas, e.g. keep them from
  29105. getting overamplified and just plain white. The value must be a float
  29106. 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
  29107. gamma correction all the way down while <code class="code">1.0</code> leaves it at its
  29108. full strength. Default is &quot;1&quot;.
  29109. </p>
  29110. </dd>
  29111. <dt><samp class="option">eval</samp></dt>
  29112. <dd><p>Set when the expressions for brightness, contrast, saturation and
  29113. gamma expressions are evaluated.
  29114. </p>
  29115. <p>It accepts the following values:
  29116. </p><dl class="table">
  29117. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  29118. <dd><p>only evaluate expressions once during the filter initialization or
  29119. when a command is processed
  29120. </p>
  29121. </dd>
  29122. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  29123. <dd><p>evaluate expressions for each incoming frame
  29124. </p></dd>
  29125. </dl>
  29126. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  29127. </p></dd>
  29128. </dl>
  29129. <p>The expressions accept the following parameters:
  29130. </p><dl class="table">
  29131. <dt><samp class="option">n</samp></dt>
  29132. <dd><p>frame count of the input frame starting from 0
  29133. </p>
  29134. </dd>
  29135. <dt><samp class="option">pos</samp></dt>
  29136. <dd><p>byte position of the corresponding packet in the input file, NAN if
  29137. unspecified; deprecated, do not use
  29138. </p>
  29139. </dd>
  29140. <dt><samp class="option">r</samp></dt>
  29141. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  29142. </p>
  29143. </dd>
  29144. <dt><samp class="option">t</samp></dt>
  29145. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  29146. </p></dd>
  29147. </dl>
  29148. <ul class="mini-toc">
  29149. <li><a href="#Commands-89" accesskey="1">Commands</a></li>
  29150. </ul>
  29151. <div class="subsection-level-extent" id="Commands-89">
  29152. <h4 class="subsection"><span>30.83.1 Commands<a class="copiable-link" href="#Commands-89"> &para;</a></span></h4>
  29153. <p>The filter supports the following commands:
  29154. </p>
  29155. <dl class="table">
  29156. <dt><samp class="option">contrast</samp></dt>
  29157. <dd><p>Set the contrast expression.
  29158. </p>
  29159. </dd>
  29160. <dt><samp class="option">brightness</samp></dt>
  29161. <dd><p>Set the brightness expression.
  29162. </p>
  29163. </dd>
  29164. <dt><samp class="option">saturation</samp></dt>
  29165. <dd><p>Set the saturation expression.
  29166. </p>
  29167. </dd>
  29168. <dt><samp class="option">gamma</samp></dt>
  29169. <dd><p>Set the gamma expression.
  29170. </p>
  29171. </dd>
  29172. <dt><samp class="option">gamma_r</samp></dt>
  29173. <dd><p>Set the gamma_r expression.
  29174. </p>
  29175. </dd>
  29176. <dt><samp class="option">gamma_g</samp></dt>
  29177. <dd><p>Set gamma_g expression.
  29178. </p>
  29179. </dd>
  29180. <dt><samp class="option">gamma_b</samp></dt>
  29181. <dd><p>Set gamma_b expression.
  29182. </p>
  29183. </dd>
  29184. <dt><samp class="option">gamma_weight</samp></dt>
  29185. <dd><p>Set gamma_weight expression.
  29186. </p>
  29187. <p>The command accepts the same syntax of the corresponding option.
  29188. </p>
  29189. <p>If the specified expression is not valid, it is kept at its current
  29190. value.
  29191. </p>
  29192. </dd>
  29193. </dl>
  29194. <a class="anchor" id="erosion"></a></div>
  29195. </div>
  29196. <div class="section-level-extent" id="erosion-1">
  29197. <h3 class="section"><span>30.84 erosion<a class="copiable-link" href="#erosion-1"> &para;</a></span></h3>
  29198. <p>Apply erosion effect to the video.
  29199. </p>
  29200. <p>This filter replaces the pixel by the local(3x3) minimum.
  29201. </p>
  29202. <p>It accepts the following options:
  29203. </p>
  29204. <dl class="table">
  29205. <dt><samp class="option">threshold0</samp></dt>
  29206. <dt><samp class="option">threshold1</samp></dt>
  29207. <dt><samp class="option">threshold2</samp></dt>
  29208. <dt><samp class="option">threshold3</samp></dt>
  29209. <dd><p>Limit the maximum change for each plane, default is 65535.
  29210. If 0, plane will remain unchanged.
  29211. </p>
  29212. </dd>
  29213. <dt><samp class="option">coordinates</samp></dt>
  29214. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  29215. pixels are used.
  29216. </p>
  29217. <p>Flags to local 3x3 coordinates maps like this:
  29218. </p>
  29219. <p>1 2 3
  29220. 4 5
  29221. 6 7 8
  29222. </p></dd>
  29223. </dl>
  29224. <ul class="mini-toc">
  29225. <li><a href="#Commands-90" accesskey="1">Commands</a></li>
  29226. </ul>
  29227. <div class="subsection-level-extent" id="Commands-90">
  29228. <h4 class="subsection"><span>30.84.1 Commands<a class="copiable-link" href="#Commands-90"> &para;</a></span></h4>
  29229. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  29230. </p>
  29231. </div>
  29232. </div>
  29233. <div class="section-level-extent" id="estdif">
  29234. <h3 class="section"><span>30.85 estdif<a class="copiable-link" href="#estdif"> &para;</a></span></h3>
  29235. <p>Deinterlace the input video (&quot;estdif&quot; stands for &quot;Edge Slope
  29236. Tracing Deinterlacing Filter&quot;).
  29237. </p>
  29238. <p>Spatial only filter that uses edge slope tracing algorithm
  29239. to interpolate missing lines.
  29240. It accepts the following parameters:
  29241. </p>
  29242. <dl class="table">
  29243. <dt><samp class="option">mode</samp></dt>
  29244. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  29245. </p>
  29246. <dl class="table">
  29247. <dt><samp class="option">frame</samp></dt>
  29248. <dd><p>Output one frame for each frame.
  29249. </p></dd>
  29250. <dt><samp class="option">field</samp></dt>
  29251. <dd><p>Output one frame for each field.
  29252. </p></dd>
  29253. </dl>
  29254. <p>The default value is <code class="code">field</code>.
  29255. </p>
  29256. </dd>
  29257. <dt><samp class="option">parity</samp></dt>
  29258. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  29259. of the following values:
  29260. </p>
  29261. <dl class="table">
  29262. <dt><samp class="option">tff</samp></dt>
  29263. <dd><p>Assume the top field is first.
  29264. </p></dd>
  29265. <dt><samp class="option">bff</samp></dt>
  29266. <dd><p>Assume the bottom field is first.
  29267. </p></dd>
  29268. <dt><samp class="option">auto</samp></dt>
  29269. <dd><p>Enable automatic detection of field parity.
  29270. </p></dd>
  29271. </dl>
  29272. <p>The default value is <code class="code">auto</code>.
  29273. If the interlacing is unknown or the decoder does not export this information,
  29274. top field first will be assumed.
  29275. </p>
  29276. </dd>
  29277. <dt><samp class="option">deint</samp></dt>
  29278. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  29279. values:
  29280. </p>
  29281. <dl class="table">
  29282. <dt><samp class="option">all</samp></dt>
  29283. <dd><p>Deinterlace all frames.
  29284. </p></dd>
  29285. <dt><samp class="option">interlaced</samp></dt>
  29286. <dd><p>Only deinterlace frames marked as interlaced.
  29287. </p></dd>
  29288. </dl>
  29289. <p>The default value is <code class="code">all</code>.
  29290. </p>
  29291. </dd>
  29292. <dt><samp class="option">rslope</samp></dt>
  29293. <dd><p>Specify the search radius for edge slope tracing. Default value is 1.
  29294. Allowed range is from 1 to 15.
  29295. </p>
  29296. </dd>
  29297. <dt><samp class="option">redge</samp></dt>
  29298. <dd><p>Specify the search radius for best edge matching. Default value is 2.
  29299. Allowed range is from 0 to 15.
  29300. </p>
  29301. </dd>
  29302. <dt><samp class="option">ecost</samp></dt>
  29303. <dd><p>Specify the edge cost for edge matching. Default value is 2.
  29304. Allowed range is from 0 to 50.
  29305. </p>
  29306. </dd>
  29307. <dt><samp class="option">mcost</samp></dt>
  29308. <dd><p>Specify the middle cost for edge matching. Default value is 1.
  29309. Allowed range is from 0 to 50.
  29310. </p>
  29311. </dd>
  29312. <dt><samp class="option">dcost</samp></dt>
  29313. <dd><p>Specify the distance cost for edge matching. Default value is 1.
  29314. Allowed range is from 0 to 50.
  29315. </p>
  29316. </dd>
  29317. <dt><samp class="option">interp</samp></dt>
  29318. <dd><p>Specify the interpolation used. Default is 4-point interpolation. It accepts one
  29319. of the following values:
  29320. </p>
  29321. <dl class="table">
  29322. <dt><samp class="option">2p</samp></dt>
  29323. <dd><p>Two-point interpolation.
  29324. </p></dd>
  29325. <dt><samp class="option">4p</samp></dt>
  29326. <dd><p>Four-point interpolation.
  29327. </p></dd>
  29328. <dt><samp class="option">6p</samp></dt>
  29329. <dd><p>Six-point interpolation.
  29330. </p></dd>
  29331. </dl>
  29332. </dd>
  29333. </dl>
  29334. <ul class="mini-toc">
  29335. <li><a href="#Commands-91" accesskey="1">Commands</a></li>
  29336. </ul>
  29337. <div class="subsection-level-extent" id="Commands-91">
  29338. <h4 class="subsection"><span>30.85.1 Commands<a class="copiable-link" href="#Commands-91"> &para;</a></span></h4>
  29339. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  29340. </p>
  29341. </div>
  29342. </div>
  29343. <div class="section-level-extent" id="exposure">
  29344. <h3 class="section"><span>30.86 exposure<a class="copiable-link" href="#exposure"> &para;</a></span></h3>
  29345. <p>Adjust exposure of the video stream.
  29346. </p>
  29347. <p>The filter accepts the following options:
  29348. </p>
  29349. <dl class="table">
  29350. <dt><samp class="option">exposure</samp></dt>
  29351. <dd><p>Set the exposure correction in EV. Allowed range is from -3.0 to 3.0 EV
  29352. Default value is 0 EV.
  29353. </p>
  29354. </dd>
  29355. <dt><samp class="option">black</samp></dt>
  29356. <dd><p>Set the black level correction. Allowed range is from -1.0 to 1.0.
  29357. Default value is 0.
  29358. </p></dd>
  29359. </dl>
  29360. <ul class="mini-toc">
  29361. <li><a href="#Commands-92" accesskey="1">Commands</a></li>
  29362. </ul>
  29363. <div class="subsection-level-extent" id="Commands-92">
  29364. <h4 class="subsection"><span>30.86.1 Commands<a class="copiable-link" href="#Commands-92"> &para;</a></span></h4>
  29365. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  29366. </p>
  29367. </div>
  29368. </div>
  29369. <div class="section-level-extent" id="extractplanes">
  29370. <h3 class="section"><span>30.87 extractplanes<a class="copiable-link" href="#extractplanes"> &para;</a></span></h3>
  29371. <p>Extract color channel components from input video stream into
  29372. separate grayscale video streams.
  29373. </p>
  29374. <p>The filter accepts the following option:
  29375. </p>
  29376. <dl class="table">
  29377. <dt><samp class="option">planes</samp></dt>
  29378. <dd><p>Set plane(s) to extract.
  29379. </p>
  29380. <p>Available values for planes are:
  29381. </p><dl class="table">
  29382. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  29383. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  29384. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  29385. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  29386. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  29387. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  29388. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  29389. </dl>
  29390. <p>Choosing planes not available in the input will result in an error.
  29391. That means you cannot select <code class="code">r</code>, <code class="code">g</code>, <code class="code">b</code> planes
  29392. with <code class="code">y</code>, <code class="code">u</code>, <code class="code">v</code> planes at same time.
  29393. </p></dd>
  29394. </dl>
  29395. <ul class="mini-toc">
  29396. <li><a href="#Examples-89" accesskey="1">Examples</a></li>
  29397. </ul>
  29398. <div class="subsection-level-extent" id="Examples-89">
  29399. <h4 class="subsection"><span>30.87.1 Examples<a class="copiable-link" href="#Examples-89"> &para;</a></span></h4>
  29400. <ul class="itemize mark-bullet">
  29401. <li>Extract luma, u and v color channel component from input video frame
  29402. into 3 grayscale outputs:
  29403. <div class="example">
  29404. <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
  29405. </pre></div>
  29406. </li></ul>
  29407. </div>
  29408. </div>
  29409. <div class="section-level-extent" id="fade">
  29410. <h3 class="section"><span>30.88 fade<a class="copiable-link" href="#fade"> &para;</a></span></h3>
  29411. <p>Apply a fade-in/out effect to the input video.
  29412. </p>
  29413. <p>It accepts the following parameters:
  29414. </p>
  29415. <dl class="table">
  29416. <dt><samp class="option">type, t</samp></dt>
  29417. <dd><p>The effect type can be either &quot;in&quot; for a fade-in, or &quot;out&quot; for a fade-out
  29418. effect.
  29419. Default is <code class="code">in</code>.
  29420. </p>
  29421. </dd>
  29422. <dt><samp class="option">start_frame, s</samp></dt>
  29423. <dd><p>Specify the number of the frame to start applying the fade
  29424. effect at. Default is 0.
  29425. </p>
  29426. </dd>
  29427. <dt><samp class="option">nb_frames, n</samp></dt>
  29428. <dd><p>The number of frames that the fade effect lasts. At the end of the
  29429. fade-in effect, the output video will have the same intensity as the input video.
  29430. At the end of the fade-out transition, the output video will be filled with the
  29431. selected <samp class="option">color</samp>.
  29432. Default is 25.
  29433. </p>
  29434. </dd>
  29435. <dt><samp class="option">alpha</samp></dt>
  29436. <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
  29437. Default value is 0.
  29438. </p>
  29439. </dd>
  29440. <dt><samp class="option">start_time, st</samp></dt>
  29441. <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
  29442. effect. If both start_frame and start_time are specified, the fade will start at
  29443. whichever comes last. Default is 0.
  29444. </p>
  29445. </dd>
  29446. <dt><samp class="option">duration, d</samp></dt>
  29447. <dd><p>The number of seconds for which the fade effect has to last. At the end of the
  29448. fade-in effect the output video will have the same intensity as the input video,
  29449. at the end of the fade-out transition the output video will be filled with the
  29450. selected <samp class="option">color</samp>.
  29451. If both duration and nb_frames are specified, duration is used. Default is 0
  29452. (nb_frames is used by default).
  29453. </p>
  29454. </dd>
  29455. <dt><samp class="option">color, c</samp></dt>
  29456. <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
  29457. </p></dd>
  29458. </dl>
  29459. <ul class="mini-toc">
  29460. <li><a href="#Examples-90" accesskey="1">Examples</a></li>
  29461. </ul>
  29462. <div class="subsection-level-extent" id="Examples-90">
  29463. <h4 class="subsection"><span>30.88.1 Examples<a class="copiable-link" href="#Examples-90"> &para;</a></span></h4>
  29464. <ul class="itemize mark-bullet">
  29465. <li>Fade in the first 30 frames of video:
  29466. <div class="example">
  29467. <pre class="example-preformatted">fade=in:0:30
  29468. </pre></div>
  29469. <p>The command above is equivalent to:
  29470. </p><div class="example">
  29471. <pre class="example-preformatted">fade=t=in:s=0:n=30
  29472. </pre></div>
  29473. </li><li>Fade out the last 45 frames of a 200-frame video:
  29474. <div class="example">
  29475. <pre class="example-preformatted">fade=out:155:45
  29476. fade=type=out:start_frame=155:nb_frames=45
  29477. </pre></div>
  29478. </li><li>Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video:
  29479. <div class="example">
  29480. <pre class="example-preformatted">fade=in:0:25, fade=out:975:25
  29481. </pre></div>
  29482. </li><li>Make the first 5 frames yellow, then fade in from frame 5-24:
  29483. <div class="example">
  29484. <pre class="example-preformatted">fade=in:5:20:color=yellow
  29485. </pre></div>
  29486. </li><li>Fade in alpha over first 25 frames of video:
  29487. <div class="example">
  29488. <pre class="example-preformatted">fade=in:0:25:alpha=1
  29489. </pre></div>
  29490. </li><li>Make the first 5.5 seconds black, then fade in for 0.5 seconds:
  29491. <div class="example">
  29492. <pre class="example-preformatted">fade=t=in:st=5.5:d=0.5
  29493. </pre></div>
  29494. </li></ul>
  29495. </div>
  29496. </div>
  29497. <div class="section-level-extent" id="feedback">
  29498. <h3 class="section"><span>30.89 feedback<a class="copiable-link" href="#feedback"> &para;</a></span></h3>
  29499. <p>Apply feedback video filter.
  29500. </p>
  29501. <p>This filter pass cropped input frames to 2nd output.
  29502. From there it can be filtered with other video filters.
  29503. After filter receives frame from 2nd input, that frame
  29504. is combined on top of original frame from 1st input and passed
  29505. to 1st output.
  29506. </p>
  29507. <p>The typical usage is filter only part of frame.
  29508. </p>
  29509. <p>The filter accepts the following options:
  29510. </p><dl class="table">
  29511. <dt><samp class="option">x</samp></dt>
  29512. <dt><samp class="option">y</samp></dt>
  29513. <dd><p>Set the top left crop position.
  29514. </p>
  29515. </dd>
  29516. <dt><samp class="option">w</samp></dt>
  29517. <dt><samp class="option">h</samp></dt>
  29518. <dd><p>Set the crop size.
  29519. </p></dd>
  29520. </dl>
  29521. <ul class="mini-toc">
  29522. <li><a href="#Examples-91" accesskey="1">Examples</a></li>
  29523. </ul>
  29524. <div class="subsection-level-extent" id="Examples-91">
  29525. <h4 class="subsection"><span>30.89.1 Examples<a class="copiable-link" href="#Examples-91"> &para;</a></span></h4>
  29526. <ul class="itemize mark-bullet">
  29527. <li>Blur only top left rectangular part of video frame size 100x100 with gblur filter.
  29528. <div class="example">
  29529. <pre class="example-preformatted">[in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]gblur=8[blurin]
  29530. </pre></div>
  29531. </li><li>Draw black box on top left part of video frame of size 100x100 with drawbox filter.
  29532. <div class="example">
  29533. <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]
  29534. </pre></div>
  29535. </li><li>Pixelize rectangular part of video frame of size 100x100 with pixelize filter.
  29536. <div class="example">
  29537. <pre class="example-preformatted">[in][blurin]feedback=x=320:y=240:w=100:h=100[out][blurout];[blurout]pixelize[blurin]
  29538. </pre></div>
  29539. </li></ul>
  29540. </div>
  29541. </div>
  29542. <div class="section-level-extent" id="fftdnoiz">
  29543. <h3 class="section"><span>30.90 fftdnoiz<a class="copiable-link" href="#fftdnoiz"> &para;</a></span></h3>
  29544. <p>Denoise frames using 3D FFT (frequency domain filtering).
  29545. </p>
  29546. <p>The filter accepts the following options:
  29547. </p>
  29548. <dl class="table">
  29549. <dt><samp class="option">sigma</samp></dt>
  29550. <dd><p>Set the noise sigma constant. This sets denoising strength.
  29551. Default value is 1. Allowed range is from 0 to 30.
  29552. Using very high sigma with low overlap may give blocking artifacts.
  29553. </p>
  29554. </dd>
  29555. <dt><samp class="option">amount</samp></dt>
  29556. <dd><p>Set amount of denoising. By default all detected noise is reduced.
  29557. Default value is 1. Allowed range is from 0 to 1.
  29558. </p>
  29559. </dd>
  29560. <dt><samp class="option">block</samp></dt>
  29561. <dd><p>Set size of block in pixels, Default is 32, can be 8 to 256.
  29562. </p>
  29563. </dd>
  29564. <dt><samp class="option">overlap</samp></dt>
  29565. <dd><p>Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8.
  29566. </p>
  29567. </dd>
  29568. <dt><samp class="option">method</samp></dt>
  29569. <dd><p>Set denoising method. Default is <code class="code">wiener</code>, can also be <code class="code">hard</code>.
  29570. </p>
  29571. </dd>
  29572. <dt><samp class="option">prev</samp></dt>
  29573. <dd><p>Set number of previous frames to use for denoising. By default is set to 0.
  29574. </p>
  29575. </dd>
  29576. <dt><samp class="option">next</samp></dt>
  29577. <dd><p>Set number of next frames to to use for denoising. By default is set to 0.
  29578. </p>
  29579. </dd>
  29580. <dt><samp class="option">planes</samp></dt>
  29581. <dd><p>Set planes which will be filtered, by default are all available filtered
  29582. except alpha.
  29583. </p></dd>
  29584. </dl>
  29585. </div>
  29586. <div class="section-level-extent" id="fftfilt">
  29587. <h3 class="section"><span>30.91 fftfilt<a class="copiable-link" href="#fftfilt"> &para;</a></span></h3>
  29588. <p>Apply arbitrary expressions to samples in frequency domain
  29589. </p>
  29590. <dl class="table">
  29591. <dt><samp class="option">dc_Y</samp></dt>
  29592. <dd><p>Adjust the dc value (gain) of the luma plane of the image. The filter
  29593. accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The default
  29594. value is set to <code class="code">0</code>.
  29595. </p>
  29596. </dd>
  29597. <dt><samp class="option">dc_U</samp></dt>
  29598. <dd><p>Adjust the dc value (gain) of the 1st chroma plane of the image. The
  29599. filter accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The
  29600. default value is set to <code class="code">0</code>.
  29601. </p>
  29602. </dd>
  29603. <dt><samp class="option">dc_V</samp></dt>
  29604. <dd><p>Adjust the dc value (gain) of the 2nd chroma plane of the image. The
  29605. filter accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The
  29606. default value is set to <code class="code">0</code>.
  29607. </p>
  29608. </dd>
  29609. <dt><samp class="option">weight_Y</samp></dt>
  29610. <dd><p>Set the frequency domain weight expression for the luma plane.
  29611. </p>
  29612. </dd>
  29613. <dt><samp class="option">weight_U</samp></dt>
  29614. <dd><p>Set the frequency domain weight expression for the 1st chroma plane.
  29615. </p>
  29616. </dd>
  29617. <dt><samp class="option">weight_V</samp></dt>
  29618. <dd><p>Set the frequency domain weight expression for the 2nd chroma plane.
  29619. </p>
  29620. </dd>
  29621. <dt><samp class="option">eval</samp></dt>
  29622. <dd><p>Set when the expressions are evaluated.
  29623. </p>
  29624. <p>It accepts the following values:
  29625. </p><dl class="table">
  29626. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  29627. <dd><p>Only evaluate expressions once during the filter initialization.
  29628. </p>
  29629. </dd>
  29630. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  29631. <dd><p>Evaluate expressions for each incoming frame.
  29632. </p></dd>
  29633. </dl>
  29634. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  29635. </p>
  29636. <p>The filter accepts the following variables:
  29637. </p></dd>
  29638. <dt><samp class="option">X</samp></dt>
  29639. <dt><samp class="option">Y</samp></dt>
  29640. <dd><p>The coordinates of the current sample.
  29641. </p>
  29642. </dd>
  29643. <dt><samp class="option">W</samp></dt>
  29644. <dt><samp class="option">H</samp></dt>
  29645. <dd><p>The width and height of the image.
  29646. </p>
  29647. </dd>
  29648. <dt><samp class="option">N</samp></dt>
  29649. <dd><p>The number of input frame, starting from 0.
  29650. </p>
  29651. </dd>
  29652. <dt><samp class="option">WS</samp></dt>
  29653. <dt><samp class="option">HS</samp></dt>
  29654. <dd><p>The size of FFT array for horizontal and vertical processing.
  29655. </p></dd>
  29656. </dl>
  29657. <ul class="mini-toc">
  29658. <li><a href="#Examples-92" accesskey="1">Examples</a></li>
  29659. </ul>
  29660. <div class="subsection-level-extent" id="Examples-92">
  29661. <h4 class="subsection"><span>30.91.1 Examples<a class="copiable-link" href="#Examples-92"> &para;</a></span></h4>
  29662. <ul class="itemize mark-bullet">
  29663. <li>High-pass:
  29664. <div class="example">
  29665. <pre class="example-preformatted">fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
  29666. </pre></div>
  29667. </li><li>Low-pass:
  29668. <div class="example">
  29669. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
  29670. </pre></div>
  29671. </li><li>Sharpen:
  29672. <div class="example">
  29673. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
  29674. </pre></div>
  29675. </li><li>Blur:
  29676. <div class="example">
  29677. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
  29678. </pre></div>
  29679. </li></ul>
  29680. </div>
  29681. </div>
  29682. <div class="section-level-extent" id="field">
  29683. <h3 class="section"><span>30.92 field<a class="copiable-link" href="#field"> &para;</a></span></h3>
  29684. <p>Extract a single field from an interlaced image using stride
  29685. arithmetic to avoid wasting CPU time. The output frames are marked as
  29686. non-interlaced.
  29687. </p>
  29688. <p>The filter accepts the following options:
  29689. </p>
  29690. <dl class="table">
  29691. <dt><samp class="option">type</samp></dt>
  29692. <dd><p>Specify whether to extract the top (if the value is <code class="code">0</code> or
  29693. <code class="code">top</code>) or the bottom field (if the value is <code class="code">1</code> or
  29694. <code class="code">bottom</code>).
  29695. </p></dd>
  29696. </dl>
  29697. </div>
  29698. <div class="section-level-extent" id="fieldhint">
  29699. <h3 class="section"><span>30.93 fieldhint<a class="copiable-link" href="#fieldhint"> &para;</a></span></h3>
  29700. <p>Create new frames by copying the top and bottom fields from surrounding frames
  29701. supplied as numbers by the hint file.
  29702. </p>
  29703. <dl class="table">
  29704. <dt><samp class="option">hint</samp></dt>
  29705. <dd><p>Set file containing hints: absolute/relative frame numbers.
  29706. </p>
  29707. <p>There must be one line for each frame in a clip. Each line must contain two
  29708. numbers separated by the comma, optionally followed by <code class="code">-</code> or <code class="code">+</code>.
  29709. Numbers supplied on each line of file can not be out of [N-1,N+1] where N
  29710. is current frame number for <code class="code">absolute</code> mode or out of [-1, 1] range
  29711. for <code class="code">relative</code> mode. First number tells from which frame to pick up top
  29712. field and second number tells from which frame to pick up bottom field.
  29713. </p>
  29714. <p>If optionally followed by <code class="code">+</code> output frame will be marked as interlaced,
  29715. else if followed by <code class="code">-</code> output frame will be marked as progressive, else
  29716. it will be marked same as input frame.
  29717. If optionally followed by <code class="code">t</code> output frame will use only top field, or in
  29718. case of <code class="code">b</code> it will use only bottom field.
  29719. If line starts with <code class="code">#</code> or <code class="code">;</code> that line is skipped.
  29720. </p>
  29721. </dd>
  29722. <dt><samp class="option">mode</samp></dt>
  29723. <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>.
  29724. The <code class="code">pattern</code> mode is same as <code class="code">relative</code> mode, except at last entry of file if there
  29725. are more frames to process than <code class="code">hint</code> file is seek back to start.
  29726. </p></dd>
  29727. </dl>
  29728. <p>Example of first several lines of <code class="code">hint</code> file for <code class="code">relative</code> mode:
  29729. </p><div class="example">
  29730. <pre class="example-preformatted">0,0 - # first frame
  29731. 1,0 - # second frame, use third's frame top field and second's frame bottom field
  29732. 1,0 - # third frame, use fourth's frame top field and third's frame bottom field
  29733. 1,0 -
  29734. 0,0 -
  29735. 0,0 -
  29736. 1,0 -
  29737. 1,0 -
  29738. 1,0 -
  29739. 0,0 -
  29740. 0,0 -
  29741. 1,0 -
  29742. 1,0 -
  29743. 1,0 -
  29744. 0,0 -
  29745. </pre></div>
  29746. </div>
  29747. <div class="section-level-extent" id="fieldmatch">
  29748. <h3 class="section"><span>30.94 fieldmatch<a class="copiable-link" href="#fieldmatch"> &para;</a></span></h3>
  29749. <p>Field matching filter for inverse telecine. It is meant to reconstruct the
  29750. progressive frames from a telecined stream. The filter does not drop duplicated
  29751. frames, so to achieve a complete inverse telecine <code class="code">fieldmatch</code> needs to be
  29752. followed by a decimation filter such as <a class="ref" href="#decimate">decimate</a> in the filtergraph.
  29753. </p>
  29754. <p>The separation of the field matching and the decimation is notably motivated by
  29755. the possibility of inserting a de-interlacing filter fallback between the two.
  29756. If the source has mixed telecined and real interlaced content,
  29757. <code class="code">fieldmatch</code> will not be able to match fields for the interlaced parts.
  29758. But these remaining combed frames will be marked as interlaced, and thus can be
  29759. de-interlaced by a later filter such as <a class="ref" href="#yadif">yadif</a> before decimation.
  29760. </p>
  29761. <p>In addition to the various configuration options, <code class="code">fieldmatch</code> can take an
  29762. optional second stream, activated through the <samp class="option">ppsrc</samp> option. If
  29763. enabled, the frames reconstruction will be based on the fields and frames from
  29764. this second stream. This allows the first input to be pre-processed in order to
  29765. help the various algorithms of the filter, while keeping the output lossless
  29766. (assuming the fields are matched properly). Typically, a field-aware denoiser,
  29767. or brightness/contrast adjustments can help.
  29768. </p>
  29769. <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
  29770. and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
  29771. which <code class="code">fieldmatch</code> is based on. While the semantic and usage are very
  29772. close, some behaviour and options names can differ.
  29773. </p>
  29774. <p>The <a class="ref" href="#decimate">decimate</a> filter currently only works for constant frame rate input.
  29775. If your input has mixed telecined (30fps) and progressive content with a lower
  29776. framerate like 24fps use the following filterchain to produce the necessary cfr
  29777. stream: <code class="code">dejudder,fps=30000/1001,fieldmatch,decimate</code>.
  29778. </p>
  29779. <p>The filter accepts the following options:
  29780. </p>
  29781. <dl class="table">
  29782. <dt><samp class="option">order</samp></dt>
  29783. <dd><p>Specify the assumed field order of the input stream. Available values are:
  29784. </p>
  29785. <dl class="table">
  29786. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  29787. <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
  29788. </p></dd>
  29789. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  29790. <dd><p>Assume bottom field first.
  29791. </p></dd>
  29792. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  29793. <dd><p>Assume top field first.
  29794. </p></dd>
  29795. </dl>
  29796. <p>Note that it is sometimes recommended not to trust the parity announced by the
  29797. stream.
  29798. </p>
  29799. <p>Default value is <var class="var">auto</var>.
  29800. </p>
  29801. </dd>
  29802. <dt><samp class="option">mode</samp></dt>
  29803. <dd><p>Set the matching mode or strategy to use. <samp class="option">pc</samp> mode is the safest in the
  29804. sense that it won&rsquo;t risk creating jerkiness due to duplicate frames when
  29805. possible, but if there are bad edits or blended fields it will end up
  29806. outputting combed frames when a good match might actually exist. On the other
  29807. hand, <samp class="option">pcn_ub</samp> mode is the most risky in terms of creating jerkiness,
  29808. but will almost always find a good frame if there is one. The other values are
  29809. all somewhere in between <samp class="option">pc</samp> and <samp class="option">pcn_ub</samp> in terms of risking
  29810. jerkiness and creating duplicate frames versus finding good matches in sections
  29811. with bad edits, orphaned fields, blended fields, etc.
  29812. </p>
  29813. <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.
  29814. </p>
  29815. <p>Available values are:
  29816. </p>
  29817. <dl class="table">
  29818. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  29819. <dd><p>2-way matching (p/c)
  29820. </p></dd>
  29821. <dt>&lsquo;<samp class="samp">pc_n</samp>&rsquo;</dt>
  29822. <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
  29823. </p></dd>
  29824. <dt>&lsquo;<samp class="samp">pc_u</samp>&rsquo;</dt>
  29825. <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
  29826. </p></dd>
  29827. <dt>&lsquo;<samp class="samp">pc_n_ub</samp>&rsquo;</dt>
  29828. <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
  29829. still combed (p/c + n + u/b)
  29830. </p></dd>
  29831. <dt>&lsquo;<samp class="samp">pcn</samp>&rsquo;</dt>
  29832. <dd><p>3-way matching (p/c/n)
  29833. </p></dd>
  29834. <dt>&lsquo;<samp class="samp">pcn_ub</samp>&rsquo;</dt>
  29835. <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
  29836. detected as combed (p/c/n + u/b)
  29837. </p></dd>
  29838. </dl>
  29839. <p>The parenthesis at the end indicate the matches that would be used for that
  29840. 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
  29841. <var class="var">top</var>).
  29842. </p>
  29843. <p>In terms of speed <samp class="option">pc</samp> mode is by far the fastest and <samp class="option">pcn_ub</samp> is
  29844. the slowest.
  29845. </p>
  29846. <p>Default value is <var class="var">pc_n</var>.
  29847. </p>
  29848. </dd>
  29849. <dt><samp class="option">ppsrc</samp></dt>
  29850. <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
  29851. input stream as the clean source to pick the fields from. See the filter
  29852. introduction for more details. It is similar to the <samp class="option">clip2</samp> feature from
  29853. VFM/TFM.
  29854. </p>
  29855. <p>Default value is <code class="code">0</code> (disabled).
  29856. </p>
  29857. </dd>
  29858. <dt><samp class="option">field</samp></dt>
  29859. <dd><p>Set the field to match from. It is recommended to set this to the same value as
  29860. <samp class="option">order</samp> unless you experience matching failures with that setting. In
  29861. certain circumstances changing the field that is used to match from can have a
  29862. large impact on matching performance. Available values are:
  29863. </p>
  29864. <dl class="table">
  29865. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  29866. <dd><p>Automatic (same value as <samp class="option">order</samp>).
  29867. </p></dd>
  29868. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  29869. <dd><p>Match from the bottom field.
  29870. </p></dd>
  29871. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  29872. <dd><p>Match from the top field.
  29873. </p></dd>
  29874. </dl>
  29875. <p>Default value is <var class="var">auto</var>.
  29876. </p>
  29877. </dd>
  29878. <dt><samp class="option">mchroma</samp></dt>
  29879. <dd><p>Set whether or not chroma is included during the match comparisons. In most
  29880. cases it is recommended to leave this enabled. You should set this to <code class="code">0</code>
  29881. only if your clip has bad chroma problems such as heavy rainbowing or other
  29882. artifacts. Setting this to <code class="code">0</code> could also be used to speed things up at
  29883. the cost of some accuracy.
  29884. </p>
  29885. <p>Default value is <code class="code">1</code>.
  29886. </p>
  29887. </dd>
  29888. <dt><samp class="option">y0</samp></dt>
  29889. <dt><samp class="option">y1</samp></dt>
  29890. <dd><p>These define an exclusion band which excludes the lines between <samp class="option">y0</samp> and
  29891. <samp class="option">y1</samp> from being included in the field matching decision. An exclusion
  29892. band can be used to ignore subtitles, a logo, or other things that may
  29893. interfere with the matching. <samp class="option">y0</samp> sets the starting scan line and
  29894. <samp class="option">y1</samp> sets the ending line; all lines in between <samp class="option">y0</samp> and
  29895. <samp class="option">y1</samp> (including <samp class="option">y0</samp> and <samp class="option">y1</samp>) will be ignored. Setting
  29896. <samp class="option">y0</samp> and <samp class="option">y1</samp> to the same value will disable the feature.
  29897. <samp class="option">y0</samp> and <samp class="option">y1</samp> defaults to <code class="code">0</code>.
  29898. </p>
  29899. </dd>
  29900. <dt><samp class="option">scthresh</samp></dt>
  29901. <dd><p>Set the scene change detection threshold as a percentage of maximum change on
  29902. the luma plane. Good values are in the <code class="code">[8.0, 14.0]</code> range. Scene change
  29903. detection is only relevant in case <samp class="option">combmatch</samp>=<var class="var">sc</var>. The range for
  29904. <samp class="option">scthresh</samp> is <code class="code">[0.0, 100.0]</code>.
  29905. </p>
  29906. <p>Default value is <code class="code">12.0</code>.
  29907. </p>
  29908. </dd>
  29909. <dt><samp class="option">combmatch</samp></dt>
  29910. <dd><p>When <samp class="option">combatch</samp> is not <var class="var">none</var>, <code class="code">fieldmatch</code> will take into
  29911. account the combed scores of matches when deciding what match to use as the
  29912. final match. Available values are:
  29913. </p>
  29914. <dl class="table">
  29915. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  29916. <dd><p>No final matching based on combed scores.
  29917. </p></dd>
  29918. <dt>&lsquo;<samp class="samp">sc</samp>&rsquo;</dt>
  29919. <dd><p>Combed scores are only used when a scene change is detected.
  29920. </p></dd>
  29921. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  29922. <dd><p>Use combed scores all the time.
  29923. </p></dd>
  29924. </dl>
  29925. <p>Default is <var class="var">sc</var>.
  29926. </p>
  29927. </dd>
  29928. <dt><samp class="option">combdbg</samp></dt>
  29929. <dd><p>Force <code class="code">fieldmatch</code> to calculate the combed metrics for certain matches and
  29930. print them. This setting is known as <samp class="option">micout</samp> in TFM/VFM vocabulary.
  29931. Available values are:
  29932. </p>
  29933. <dl class="table">
  29934. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  29935. <dd><p>No forced calculation.
  29936. </p></dd>
  29937. <dt>&lsquo;<samp class="samp">pcn</samp>&rsquo;</dt>
  29938. <dd><p>Force p/c/n calculations.
  29939. </p></dd>
  29940. <dt>&lsquo;<samp class="samp">pcnub</samp>&rsquo;</dt>
  29941. <dd><p>Force p/c/n/u/b calculations.
  29942. </p></dd>
  29943. </dl>
  29944. <p>Default value is <var class="var">none</var>.
  29945. </p>
  29946. </dd>
  29947. <dt><samp class="option">cthresh</samp></dt>
  29948. <dd><p>This is the area combing threshold used for combed frame detection. This
  29949. essentially controls how &quot;strong&quot; or &quot;visible&quot; combing must be to be detected.
  29950. Larger values mean combing must be more visible and smaller values mean combing
  29951. can be less visible or strong and still be detected. Valid settings are from
  29952. <code class="code">-1</code> (every pixel will be detected as combed) to <code class="code">255</code> (no pixel will
  29953. be detected as combed). This is basically a pixel difference value. A good
  29954. range is <code class="code">[8, 12]</code>.
  29955. </p>
  29956. <p>Default value is <code class="code">9</code>.
  29957. </p>
  29958. </dd>
  29959. <dt><samp class="option">chroma</samp></dt>
  29960. <dd><p>Sets whether or not chroma is considered in the combed frame decision. Only
  29961. disable this if your source has chroma problems (rainbowing, etc.) that are
  29962. causing problems for the combed frame detection with chroma enabled. Actually,
  29963. using <samp class="option">chroma</samp>=<var class="var">0</var> is usually more reliable, except for the case
  29964. where there is chroma only combing in the source.
  29965. </p>
  29966. <p>Default value is <code class="code">0</code>.
  29967. </p>
  29968. </dd>
  29969. <dt><samp class="option">blockx</samp></dt>
  29970. <dt><samp class="option">blocky</samp></dt>
  29971. <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
  29972. frame detection. This has to do with the size of the area in which
  29973. <samp class="option">combpel</samp> pixels are required to be detected as combed for a frame to be
  29974. declared combed. See the <samp class="option">combpel</samp> parameter description for more info.
  29975. Possible values are any number that is a power of 2 starting at 4 and going up
  29976. to 512.
  29977. </p>
  29978. <p>Default value is <code class="code">16</code>.
  29979. </p>
  29980. </dd>
  29981. <dt><samp class="option">combpel</samp></dt>
  29982. <dd><p>The number of combed pixels inside any of the <samp class="option">blocky</samp> by
  29983. <samp class="option">blockx</samp> size blocks on the frame for the frame to be detected as
  29984. combed. While <samp class="option">cthresh</samp> controls how &quot;visible&quot; the combing must be, this
  29985. setting controls &quot;how much&quot; combing there must be in any localized area (a
  29986. window defined by the <samp class="option">blockx</samp> and <samp class="option">blocky</samp> settings) on the
  29987. frame. Minimum value is <code class="code">0</code> and maximum is <code class="code">blocky x blockx</code> (at
  29988. which point no frames will ever be detected as combed). This setting is known
  29989. as <samp class="option">MI</samp> in TFM/VFM vocabulary.
  29990. </p>
  29991. <p>Default value is <code class="code">80</code>.
  29992. </p></dd>
  29993. </dl>
  29994. <a class="anchor" id="p_002fc_002fn_002fu_002fb-meaning"></a><ul class="mini-toc">
  29995. <li><a href="#p_002fc_002fn_002fu_002fb-meaning-1" accesskey="1">p/c/n/u/b meaning</a></li>
  29996. <li><a href="#Examples-93" accesskey="2">Examples</a></li>
  29997. </ul>
  29998. <div class="subsection-level-extent" id="p_002fc_002fn_002fu_002fb-meaning-1">
  29999. <h4 class="subsection"><span>30.94.1 p/c/n/u/b meaning<a class="copiable-link" href="#p_002fc_002fn_002fu_002fb-meaning-1"> &para;</a></span></h4>
  30000. <ul class="mini-toc">
  30001. <li><a href="#p_002fc_002fn" accesskey="1">p/c/n</a></li>
  30002. <li><a href="#u_002fb" accesskey="2">u/b</a></li>
  30003. </ul>
  30004. <div class="subsubsection-level-extent" id="p_002fc_002fn">
  30005. <h4 class="subsubsection"><span>30.94.1.1 p/c/n<a class="copiable-link" href="#p_002fc_002fn"> &para;</a></span></h4>
  30006. <p>We assume the following telecined stream:
  30007. </p>
  30008. <div class="example">
  30009. <pre class="example-preformatted">Top fields: 1 2 2 3 4
  30010. Bottom fields: 1 2 3 4 4
  30011. </pre></div>
  30012. <p>The numbers correspond to the progressive frame the fields relate to. Here, the
  30013. first two frames are progressive, the 3rd and 4th are combed, and so on.
  30014. </p>
  30015. <p>When <code class="code">fieldmatch</code> is configured to run a matching from bottom
  30016. (<samp class="option">field</samp>=<var class="var">bottom</var>) this is how this input stream get transformed:
  30017. </p>
  30018. <div class="example">
  30019. <pre class="example-preformatted">Input stream:
  30020. T 1 2 2 3 4
  30021. B 1 2 3 4 4 &lt;-- matching reference
  30022. Matches: c c n n c
  30023. Output stream:
  30024. T 1 2 3 4 4
  30025. B 1 2 3 4 4
  30026. </pre></div>
  30027. <p>As a result of the field matching, we can see that some frames get duplicated.
  30028. To perform a complete inverse telecine, you need to rely on a decimation filter
  30029. after this operation. See for instance the <a class="ref" href="#decimate">decimate</a> filter.
  30030. </p>
  30031. <p>The same operation now matching from top fields (<samp class="option">field</samp>=<var class="var">top</var>)
  30032. looks like this:
  30033. </p>
  30034. <div class="example">
  30035. <pre class="example-preformatted">Input stream:
  30036. T 1 2 2 3 4 &lt;-- matching reference
  30037. B 1 2 3 4 4
  30038. Matches: c c p p c
  30039. Output stream:
  30040. T 1 2 2 3 4
  30041. B 1 2 2 3 4
  30042. </pre></div>
  30043. <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;
  30044. basically, they refer to the frame and field of the opposite parity:
  30045. </p>
  30046. <ul class="itemize mark-bullet">
  30047. <li><var class="var">p</var> matches the field of the opposite parity in the previous frame
  30048. </li><li><var class="var">c</var> matches the field of the opposite parity in the current frame
  30049. </li><li><var class="var">n</var> matches the field of the opposite parity in the next frame
  30050. </li></ul>
  30051. </div>
  30052. <div class="subsubsection-level-extent" id="u_002fb">
  30053. <h4 class="subsubsection"><span>30.94.1.2 u/b<a class="copiable-link" href="#u_002fb"> &para;</a></span></h4>
  30054. <p>The <var class="var">u</var> and <var class="var">b</var> matching are a bit special in the sense that they match
  30055. from the opposite parity flag. In the following examples, we assume that we are
  30056. currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
  30057. &rsquo;x&rsquo; is placed above and below each matched fields.
  30058. </p>
  30059. <p>With bottom matching (<samp class="option">field</samp>=<var class="var">bottom</var>):
  30060. </p><div class="example">
  30061. <pre class="example-preformatted">Match: c p n b u
  30062. x x x x x
  30063. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  30064. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  30065. x x x x x
  30066. Output frames:
  30067. 2 1 2 2 2
  30068. 2 2 2 1 3
  30069. </pre></div>
  30070. <p>With top matching (<samp class="option">field</samp>=<var class="var">top</var>):
  30071. </p><div class="example">
  30072. <pre class="example-preformatted">Match: c p n b u
  30073. x x x x x
  30074. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  30075. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  30076. x x x x x
  30077. Output frames:
  30078. 2 2 2 1 2
  30079. 2 1 3 2 2
  30080. </pre></div>
  30081. </div>
  30082. </div>
  30083. <div class="subsection-level-extent" id="Examples-93">
  30084. <h4 class="subsection"><span>30.94.2 Examples<a class="copiable-link" href="#Examples-93"> &para;</a></span></h4>
  30085. <p>Simple IVTC of a top field first telecined stream:
  30086. </p><div class="example">
  30087. <pre class="example-preformatted">fieldmatch=order=tff:combmatch=none, decimate
  30088. </pre></div>
  30089. <p>Advanced IVTC, with fallback on <a class="ref" href="#yadif">yadif</a> for still combed frames:
  30090. </p><div class="example">
  30091. <pre class="example-preformatted">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
  30092. </pre></div>
  30093. </div>
  30094. </div>
  30095. <div class="section-level-extent" id="fieldorder">
  30096. <h3 class="section"><span>30.95 fieldorder<a class="copiable-link" href="#fieldorder"> &para;</a></span></h3>
  30097. <p>Transform the field order of the input video.
  30098. </p>
  30099. <p>It accepts the following parameters:
  30100. </p>
  30101. <dl class="table">
  30102. <dt><samp class="option">order</samp></dt>
  30103. <dd><p>The output field order. Valid values are <var class="var">tff</var> for top field first or <var class="var">bff</var>
  30104. for bottom field first.
  30105. </p></dd>
  30106. </dl>
  30107. <p>The default value is &lsquo;<samp class="samp">tff</samp>&rsquo;.
  30108. </p>
  30109. <p>The transformation is done by shifting the picture content up or down
  30110. by one line, and filling the remaining line with appropriate picture content.
  30111. This method is consistent with most broadcast field order converters.
  30112. </p>
  30113. <p>If the input video is not flagged as being interlaced, or it is already
  30114. flagged as being of the required output field order, then this filter does
  30115. not alter the incoming video.
  30116. </p>
  30117. <p>It is very useful when converting to or from PAL DV material,
  30118. which is bottom field first.
  30119. </p>
  30120. <p>For example:
  30121. </p><div class="example">
  30122. <pre class="example-preformatted">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
  30123. </pre></div>
  30124. </div>
  30125. <div class="section-level-extent" id="fillborders">
  30126. <h3 class="section"><span>30.96 fillborders<a class="copiable-link" href="#fillborders"> &para;</a></span></h3>
  30127. <p>Fill borders of the input video, without changing video stream dimensions.
  30128. Sometimes video can have garbage at the four edges and you may not want to
  30129. crop video input to keep size multiple of some number.
  30130. </p>
  30131. <p>This filter accepts the following options:
  30132. </p>
  30133. <dl class="table">
  30134. <dt><samp class="option">left</samp></dt>
  30135. <dd><p>Number of pixels to fill from left border.
  30136. </p>
  30137. </dd>
  30138. <dt><samp class="option">right</samp></dt>
  30139. <dd><p>Number of pixels to fill from right border.
  30140. </p>
  30141. </dd>
  30142. <dt><samp class="option">top</samp></dt>
  30143. <dd><p>Number of pixels to fill from top border.
  30144. </p>
  30145. </dd>
  30146. <dt><samp class="option">bottom</samp></dt>
  30147. <dd><p>Number of pixels to fill from bottom border.
  30148. </p>
  30149. </dd>
  30150. <dt><samp class="option">mode</samp></dt>
  30151. <dd><p>Set fill mode.
  30152. </p>
  30153. <p>It accepts the following values:
  30154. </p><dl class="table">
  30155. <dt>&lsquo;<samp class="samp">smear</samp>&rsquo;</dt>
  30156. <dd><p>fill pixels using outermost pixels
  30157. </p>
  30158. </dd>
  30159. <dt>&lsquo;<samp class="samp">mirror</samp>&rsquo;</dt>
  30160. <dd><p>fill pixels using mirroring (half sample symmetric)
  30161. </p>
  30162. </dd>
  30163. <dt>&lsquo;<samp class="samp">fixed</samp>&rsquo;</dt>
  30164. <dd><p>fill pixels with constant value
  30165. </p>
  30166. </dd>
  30167. <dt>&lsquo;<samp class="samp">reflect</samp>&rsquo;</dt>
  30168. <dd><p>fill pixels using reflecting (whole sample symmetric)
  30169. </p>
  30170. </dd>
  30171. <dt>&lsquo;<samp class="samp">wrap</samp>&rsquo;</dt>
  30172. <dd><p>fill pixels using wrapping
  30173. </p>
  30174. </dd>
  30175. <dt>&lsquo;<samp class="samp">fade</samp>&rsquo;</dt>
  30176. <dd><p>fade pixels to constant value
  30177. </p>
  30178. </dd>
  30179. <dt>&lsquo;<samp class="samp">margins</samp>&rsquo;</dt>
  30180. <dd><p>fill pixels at top and bottom with weighted averages pixels near borders
  30181. </p></dd>
  30182. </dl>
  30183. <p>Default is <var class="var">smear</var>.
  30184. </p>
  30185. </dd>
  30186. <dt><samp class="option">color</samp></dt>
  30187. <dd><p>Set color for pixels in fixed or fade mode. Default is <var class="var">black</var>.
  30188. </p></dd>
  30189. </dl>
  30190. <ul class="mini-toc">
  30191. <li><a href="#Commands-93" accesskey="1">Commands</a></li>
  30192. </ul>
  30193. <div class="subsection-level-extent" id="Commands-93">
  30194. <h4 class="subsection"><span>30.96.1 Commands<a class="copiable-link" href="#Commands-93"> &para;</a></span></h4>
  30195. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  30196. The command accepts the same syntax of the corresponding option.
  30197. </p>
  30198. <p>If the specified expression is not valid, it is kept at its current
  30199. value.
  30200. </p>
  30201. </div>
  30202. </div>
  30203. <div class="section-level-extent" id="find_005frect">
  30204. <h3 class="section"><span>30.97 find_rect<a class="copiable-link" href="#find_005frect"> &para;</a></span></h3>
  30205. <p>Find a rectangular object in the input video.
  30206. </p>
  30207. <p>The object to search for must be specified as a gray8 image specified with the
  30208. <samp class="option">object</samp> option.
  30209. </p>
  30210. <p>For each possible match, a score is computed. If the score reaches the specified
  30211. threshold, the object is considered found.
  30212. </p>
  30213. <p>If the input video contains multiple instances of the object, the filter will
  30214. find only one of them.
  30215. </p>
  30216. <p>When an object is found, the following metadata entries are set in the matching
  30217. frame:
  30218. </p><dl class="table">
  30219. <dt><samp class="option">lavfi.rect.w</samp></dt>
  30220. <dd><p>width of object
  30221. </p>
  30222. </dd>
  30223. <dt><samp class="option">lavfi.rect.h</samp></dt>
  30224. <dd><p>height of object
  30225. </p>
  30226. </dd>
  30227. <dt><samp class="option">lavfi.rect.x</samp></dt>
  30228. <dd><p>x position of object
  30229. </p>
  30230. </dd>
  30231. <dt><samp class="option">lavfi.rect.y</samp></dt>
  30232. <dd><p>y position of object
  30233. </p>
  30234. </dd>
  30235. <dt><samp class="option">lavfi.rect.score</samp></dt>
  30236. <dd><p>match score of the found object
  30237. </p></dd>
  30238. </dl>
  30239. <p>It accepts the following options:
  30240. </p>
  30241. <dl class="table">
  30242. <dt><samp class="option">object</samp></dt>
  30243. <dd><p>Filepath of the object image, needs to be in gray8.
  30244. </p>
  30245. </dd>
  30246. <dt><samp class="option">threshold</samp></dt>
  30247. <dd><p>Detection threshold, expressed as a decimal number in the range 0-1.
  30248. </p>
  30249. <p>A threshold value of 0.01 means only exact matches, a threshold of 0.99 means
  30250. almost everything matches.
  30251. </p>
  30252. <p>Default value is 0.5.
  30253. </p>
  30254. </dd>
  30255. <dt><samp class="option">mipmaps</samp></dt>
  30256. <dd><p>Number of mipmaps, default is 3.
  30257. </p>
  30258. </dd>
  30259. <dt><samp class="option">xmin, ymin, xmax, ymax</samp></dt>
  30260. <dd><p>Specifies the rectangle in which to search.
  30261. </p>
  30262. </dd>
  30263. <dt><samp class="option">discard</samp></dt>
  30264. <dd><p>Discard frames where object is not detected. Default is disabled.
  30265. </p></dd>
  30266. </dl>
  30267. <ul class="mini-toc">
  30268. <li><a href="#Examples-94" accesskey="1">Examples</a></li>
  30269. </ul>
  30270. <div class="subsection-level-extent" id="Examples-94">
  30271. <h4 class="subsection"><span>30.97.1 Examples<a class="copiable-link" href="#Examples-94"> &para;</a></span></h4>
  30272. <ul class="itemize mark-bullet">
  30273. <li>Cover a rectangular object by the supplied image of a given video using <code class="command">ffmpeg</code>:
  30274. <div class="example">
  30275. <pre class="example-preformatted">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  30276. </pre></div>
  30277. </li><li>Find the position of an object in each frame using <code class="command">ffprobe</code> and write
  30278. it to a log file:
  30279. <div class="example">
  30280. <pre class="example-preformatted">ffprobe -f lavfi movie=test.mp4,find_rect=object=object.pgm:threshold=0.3 \
  30281. -show_entries frame=pkt_pts_time:frame_tags=lavfi.rect.x,lavfi.rect.y \
  30282. -of csv -o find_rect.csv
  30283. </pre></div>
  30284. </li></ul>
  30285. </div>
  30286. </div>
  30287. <div class="section-level-extent" id="floodfill">
  30288. <h3 class="section"><span>30.98 floodfill<a class="copiable-link" href="#floodfill"> &para;</a></span></h3>
  30289. <p>Flood area with values of same pixel components with another values.
  30290. </p>
  30291. <p>It accepts the following options:
  30292. </p><dl class="table">
  30293. <dt><samp class="option">x</samp></dt>
  30294. <dd><p>Set pixel x coordinate.
  30295. </p>
  30296. </dd>
  30297. <dt><samp class="option">y</samp></dt>
  30298. <dd><p>Set pixel y coordinate.
  30299. </p>
  30300. </dd>
  30301. <dt><samp class="option">s0</samp></dt>
  30302. <dd><p>Set source #0 component value.
  30303. </p>
  30304. </dd>
  30305. <dt><samp class="option">s1</samp></dt>
  30306. <dd><p>Set source #1 component value.
  30307. </p>
  30308. </dd>
  30309. <dt><samp class="option">s2</samp></dt>
  30310. <dd><p>Set source #2 component value.
  30311. </p>
  30312. </dd>
  30313. <dt><samp class="option">s3</samp></dt>
  30314. <dd><p>Set source #3 component value.
  30315. </p>
  30316. </dd>
  30317. <dt><samp class="option">d0</samp></dt>
  30318. <dd><p>Set destination #0 component value.
  30319. </p>
  30320. </dd>
  30321. <dt><samp class="option">d1</samp></dt>
  30322. <dd><p>Set destination #1 component value.
  30323. </p>
  30324. </dd>
  30325. <dt><samp class="option">d2</samp></dt>
  30326. <dd><p>Set destination #2 component value.
  30327. </p>
  30328. </dd>
  30329. <dt><samp class="option">d3</samp></dt>
  30330. <dd><p>Set destination #3 component value.
  30331. </p></dd>
  30332. </dl>
  30333. <a class="anchor" id="format"></a></div>
  30334. <div class="section-level-extent" id="format-1">
  30335. <h3 class="section"><span>30.99 format<a class="copiable-link" href="#format-1"> &para;</a></span></h3>
  30336. <p>Convert the input video to one of the specified pixel formats.
  30337. Libavfilter will try to pick one that is suitable as input to
  30338. the next filter.
  30339. </p>
  30340. <p>It accepts the following parameters:
  30341. </p><dl class="table">
  30342. <dt><samp class="option">pix_fmts</samp></dt>
  30343. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  30344. &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
  30345. </p>
  30346. </dd>
  30347. <dt><samp class="option">color_spaces</samp></dt>
  30348. <dd><p>A &rsquo;|&rsquo;-separated list of color space names, such as
  30349. &quot;color_spaces=bt709|bt470bg|bt2020nc&quot;.
  30350. </p>
  30351. </dd>
  30352. <dt><samp class="option">color_ranges</samp></dt>
  30353. <dd><p>A &rsquo;|&rsquo;-separated list of color range names, such as
  30354. &quot;color_spaces=tv|pc&quot;.
  30355. </p>
  30356. </dd>
  30357. </dl>
  30358. <ul class="mini-toc">
  30359. <li><a href="#Examples-95" accesskey="1">Examples</a></li>
  30360. </ul>
  30361. <div class="subsection-level-extent" id="Examples-95">
  30362. <h4 class="subsection"><span>30.99.1 Examples<a class="copiable-link" href="#Examples-95"> &para;</a></span></h4>
  30363. <ul class="itemize mark-bullet">
  30364. <li>Convert the input video to the <var class="var">yuv420p</var> format
  30365. <div class="example">
  30366. <pre class="example-preformatted">format=pix_fmts=yuv420p
  30367. </pre></div>
  30368. <p>Convert the input video to any of the formats in the list
  30369. </p><div class="example">
  30370. <pre class="example-preformatted">format=pix_fmts=yuv420p|yuv444p|yuv410p
  30371. </pre></div>
  30372. </li></ul>
  30373. <a class="anchor" id="fps"></a></div>
  30374. </div>
  30375. <div class="section-level-extent" id="fps-1">
  30376. <h3 class="section"><span>30.100 fps<a class="copiable-link" href="#fps-1"> &para;</a></span></h3>
  30377. <p>Convert the video to specified constant frame rate by duplicating or dropping
  30378. frames as necessary.
  30379. </p>
  30380. <p>It accepts the following parameters:
  30381. </p><dl class="table">
  30382. <dt><samp class="option">fps</samp></dt>
  30383. <dd><p>The desired output frame rate. It accepts expressions containing the following
  30384. constants:
  30385. </p>
  30386. <dl class="table">
  30387. <dt>&lsquo;<samp class="samp">source_fps</samp>&rsquo;</dt>
  30388. <dd><p>The input&rsquo;s frame rate
  30389. </p>
  30390. </dd>
  30391. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  30392. <dd><p>NTSC frame rate of <code class="code">30000/1001</code>
  30393. </p>
  30394. </dd>
  30395. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  30396. <dd><p>PAL frame rate of <code class="code">25.0</code>
  30397. </p>
  30398. </dd>
  30399. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  30400. <dd><p>Film frame rate of <code class="code">24.0</code>
  30401. </p>
  30402. </dd>
  30403. <dt>&lsquo;<samp class="samp">ntsc_film</samp>&rsquo;</dt>
  30404. <dd><p>NTSC-film frame rate of <code class="code">24000/1001</code>
  30405. </p></dd>
  30406. </dl>
  30407. <p>The default is <code class="code">25</code>.
  30408. </p>
  30409. </dd>
  30410. <dt><samp class="option">start_time</samp></dt>
  30411. <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
  30412. padding/trimming at the start of stream. By default, no assumption is made
  30413. about the first frame&rsquo;s expected PTS, so no padding or trimming is done.
  30414. For example, this could be set to 0 to pad the beginning with duplicates of
  30415. the first frame if a video stream starts after the audio stream or to trim any
  30416. frames with a negative PTS.
  30417. </p>
  30418. </dd>
  30419. <dt><samp class="option">round</samp></dt>
  30420. <dd><p>Timestamp (PTS) rounding method.
  30421. </p>
  30422. <p>Possible values are:
  30423. </p><dl class="table">
  30424. <dt><samp class="option">zero</samp></dt>
  30425. <dd><p>round towards 0
  30426. </p></dd>
  30427. <dt><samp class="option">inf</samp></dt>
  30428. <dd><p>round away from 0
  30429. </p></dd>
  30430. <dt><samp class="option">down</samp></dt>
  30431. <dd><p>round towards -infinity
  30432. </p></dd>
  30433. <dt><samp class="option">up</samp></dt>
  30434. <dd><p>round towards +infinity
  30435. </p></dd>
  30436. <dt><samp class="option">near</samp></dt>
  30437. <dd><p>round to nearest
  30438. </p></dd>
  30439. </dl>
  30440. <p>The default is <code class="code">near</code>.
  30441. </p>
  30442. </dd>
  30443. <dt><samp class="option">eof_action</samp></dt>
  30444. <dd><p>Action performed when reading the last frame.
  30445. </p>
  30446. <p>Possible values are:
  30447. </p><dl class="table">
  30448. <dt><samp class="option">round</samp></dt>
  30449. <dd><p>Use same timestamp rounding method as used for other frames.
  30450. </p></dd>
  30451. <dt><samp class="option">pass</samp></dt>
  30452. <dd><p>Pass through last frame if input duration has not been reached yet.
  30453. </p></dd>
  30454. </dl>
  30455. <p>The default is <code class="code">round</code>.
  30456. </p>
  30457. </dd>
  30458. </dl>
  30459. <p>Alternatively, the options can be specified as a flat string:
  30460. <var class="var">fps</var>[:<var class="var">start_time</var>[:<var class="var">round</var>]].
  30461. </p>
  30462. <p>See also the <a class="ref" href="#setpts">setpts</a> filter.
  30463. </p>
  30464. <ul class="mini-toc">
  30465. <li><a href="#Examples-96" accesskey="1">Examples</a></li>
  30466. </ul>
  30467. <div class="subsection-level-extent" id="Examples-96">
  30468. <h4 class="subsection"><span>30.100.1 Examples<a class="copiable-link" href="#Examples-96"> &para;</a></span></h4>
  30469. <ul class="itemize mark-bullet">
  30470. <li>A typical usage in order to set the fps to 25:
  30471. <div class="example">
  30472. <pre class="example-preformatted">fps=fps=25
  30473. </pre></div>
  30474. </li><li>Sets the fps to 24, using abbreviation and rounding method to round to nearest:
  30475. <div class="example">
  30476. <pre class="example-preformatted">fps=fps=film:round=near
  30477. </pre></div>
  30478. </li></ul>
  30479. </div>
  30480. </div>
  30481. <div class="section-level-extent" id="framepack">
  30482. <h3 class="section"><span>30.101 framepack<a class="copiable-link" href="#framepack"> &para;</a></span></h3>
  30483. <p>Pack two different video streams into a stereoscopic video, setting proper
  30484. metadata on supported codecs. The two views should have the same size and
  30485. framerate and processing will stop when the shorter video ends. Please note
  30486. that you may conveniently adjust view properties with the <a class="ref" href="#scale">scale</a> and
  30487. <a class="ref" href="#fps">fps</a> filters.
  30488. </p>
  30489. <p>It accepts the following parameters:
  30490. </p><dl class="table">
  30491. <dt><samp class="option">format</samp></dt>
  30492. <dd><p>The desired packing format. Supported values are:
  30493. </p>
  30494. <dl class="table">
  30495. <dt><samp class="option">sbs</samp></dt>
  30496. <dd><p>The views are next to each other (default).
  30497. </p>
  30498. </dd>
  30499. <dt><samp class="option">tab</samp></dt>
  30500. <dd><p>The views are on top of each other.
  30501. </p>
  30502. </dd>
  30503. <dt><samp class="option">lines</samp></dt>
  30504. <dd><p>The views are packed by line.
  30505. </p>
  30506. </dd>
  30507. <dt><samp class="option">columns</samp></dt>
  30508. <dd><p>The views are packed by column.
  30509. </p>
  30510. </dd>
  30511. <dt><samp class="option">frameseq</samp></dt>
  30512. <dd><p>The views are temporally interleaved.
  30513. </p>
  30514. </dd>
  30515. </dl>
  30516. </dd>
  30517. </dl>
  30518. <p>Some examples:
  30519. </p>
  30520. <div class="example">
  30521. <pre class="example-preformatted"># Convert left and right views into a frame-sequential video
  30522. ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
  30523. # Convert views into a side-by-side video with the same output resolution as the input
  30524. 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
  30525. </pre></div>
  30526. </div>
  30527. <div class="section-level-extent" id="framerate">
  30528. <h3 class="section"><span>30.102 framerate<a class="copiable-link" href="#framerate"> &para;</a></span></h3>
  30529. <p>Change the frame rate by interpolating new video output frames from the source
  30530. frames.
  30531. </p>
  30532. <p>This filter is not designed to function correctly with interlaced media. If
  30533. you wish to change the frame rate of interlaced media then you are required
  30534. to deinterlace before this filter and re-interlace after this filter.
  30535. </p>
  30536. <p>A description of the accepted options follows.
  30537. </p>
  30538. <dl class="table">
  30539. <dt><samp class="option">fps</samp></dt>
  30540. <dd><p>Specify the output frames per second. This option can also be specified
  30541. as a value alone. The default is <code class="code">50</code>.
  30542. </p>
  30543. </dd>
  30544. <dt><samp class="option">interp_start</samp></dt>
  30545. <dd><p>Specify the start of a range where the output frame will be created as a
  30546. linear interpolation of two frames. The range is [<code class="code">0</code>-<code class="code">255</code>],
  30547. the default is <code class="code">15</code>.
  30548. </p>
  30549. </dd>
  30550. <dt><samp class="option">interp_end</samp></dt>
  30551. <dd><p>Specify the end of a range where the output frame will be created as a
  30552. linear interpolation of two frames. The range is [<code class="code">0</code>-<code class="code">255</code>],
  30553. the default is <code class="code">240</code>.
  30554. </p>
  30555. </dd>
  30556. <dt><samp class="option">scene</samp></dt>
  30557. <dd><p>Specify the level at which a scene change is detected as a value between
  30558. 0 and 100 to indicate a new scene; a low value reflects a low
  30559. probability for the current frame to introduce a new scene, while a higher
  30560. value means the current frame is more likely to be one.
  30561. The default is <code class="code">8.2</code>.
  30562. </p>
  30563. </dd>
  30564. <dt><samp class="option">flags</samp></dt>
  30565. <dd><p>Specify flags influencing the filter process.
  30566. </p>
  30567. <p>Available value for <var class="var">flags</var> is:
  30568. </p>
  30569. <dl class="table">
  30570. <dt><samp class="option">scene_change_detect, scd</samp></dt>
  30571. <dd><p>Enable scene change detection using the value of the option <var class="var">scene</var>.
  30572. This flag is enabled by default.
  30573. </p></dd>
  30574. </dl>
  30575. </dd>
  30576. </dl>
  30577. </div>
  30578. <div class="section-level-extent" id="framestep">
  30579. <h3 class="section"><span>30.103 framestep<a class="copiable-link" href="#framestep"> &para;</a></span></h3>
  30580. <p>Select one frame every N-th frame.
  30581. </p>
  30582. <p>This filter accepts the following option:
  30583. </p><dl class="table">
  30584. <dt><samp class="option">step</samp></dt>
  30585. <dd><p>Select frame after every <code class="code">step</code> frames.
  30586. Allowed values are positive integers higher than 0. Default value is <code class="code">1</code>.
  30587. </p></dd>
  30588. </dl>
  30589. </div>
  30590. <div class="section-level-extent" id="freezedetect">
  30591. <h3 class="section"><span>30.104 freezedetect<a class="copiable-link" href="#freezedetect"> &para;</a></span></h3>
  30592. <p>Detect frozen video.
  30593. </p>
  30594. <p>This filter logs a message and sets frame metadata when it detects that the
  30595. input video has no significant change in content during a specified duration.
  30596. Video freeze detection calculates the mean average absolute difference of all
  30597. the components of video frames and compares it to a noise floor.
  30598. </p>
  30599. <p>The printed times and duration are expressed in seconds. The
  30600. <code class="code">lavfi.freezedetect.freeze_start</code> metadata key is set on the first frame
  30601. whose timestamp equals or exceeds the detection duration and it contains the
  30602. timestamp of the first frame of the freeze. The
  30603. <code class="code">lavfi.freezedetect.freeze_duration</code> and
  30604. <code class="code">lavfi.freezedetect.freeze_end</code> metadata keys are set on the first frame
  30605. after the freeze.
  30606. </p>
  30607. <p>The filter accepts the following options:
  30608. </p>
  30609. <dl class="table">
  30610. <dt><samp class="option">noise, n</samp></dt>
  30611. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  30612. specified value) or as a difference ratio between 0 and 1. Default is -60dB, or
  30613. 0.001.
  30614. </p>
  30615. </dd>
  30616. <dt><samp class="option">duration, d</samp></dt>
  30617. <dd><p>Set freeze duration until notification (default is 2 seconds).
  30618. </p></dd>
  30619. </dl>
  30620. </div>
  30621. <div class="section-level-extent" id="freezeframes">
  30622. <h3 class="section"><span>30.105 freezeframes<a class="copiable-link" href="#freezeframes"> &para;</a></span></h3>
  30623. <p>Freeze video frames.
  30624. </p>
  30625. <p>This filter freezes video frames using frame from 2nd input.
  30626. </p>
  30627. <p>The filter accepts the following options:
  30628. </p>
  30629. <dl class="table">
  30630. <dt><samp class="option">first</samp></dt>
  30631. <dd><p>Set number of first frame from which to start freeze.
  30632. </p>
  30633. </dd>
  30634. <dt><samp class="option">last</samp></dt>
  30635. <dd><p>Set number of last frame from which to end freeze.
  30636. </p>
  30637. </dd>
  30638. <dt><samp class="option">replace</samp></dt>
  30639. <dd><p>Set number of frame from 2nd input which will be used instead of replaced frames.
  30640. </p></dd>
  30641. </dl>
  30642. <a class="anchor" id="frei0r"></a></div>
  30643. <div class="section-level-extent" id="frei0r-1">
  30644. <h3 class="section"><span>30.106 frei0r<a class="copiable-link" href="#frei0r-1"> &para;</a></span></h3>
  30645. <p>Apply a frei0r effect to the input video.
  30646. </p>
  30647. <p>To enable the compilation of this filter, you need to install the frei0r
  30648. header and configure FFmpeg with <code class="code">--enable-frei0r</code>.
  30649. </p>
  30650. <p>It accepts the following parameters:
  30651. </p>
  30652. <dl class="table">
  30653. <dt><samp class="option">filter_name</samp></dt>
  30654. <dd><p>The name of the frei0r effect to load. If the environment variable
  30655. <code class="env">FREI0R_PATH</code> is defined, the frei0r effect is searched for in each of the
  30656. directories specified by the colon-separated list in <code class="env">FREI0R_PATH</code>.
  30657. Otherwise, the standard frei0r paths are searched, in this order:
  30658. <samp class="file">HOME/.frei0r-1/lib/</samp>, <samp class="file">/usr/local/lib/frei0r-1/</samp>,
  30659. <samp class="file">/usr/lib/frei0r-1/</samp>.
  30660. </p>
  30661. </dd>
  30662. <dt><samp class="option">filter_params</samp></dt>
  30663. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
  30664. </p>
  30665. </dd>
  30666. </dl>
  30667. <p>A frei0r effect parameter can be a boolean (its value is either
  30668. &quot;y&quot; or &quot;n&quot;), a double, a color (specified as
  30669. <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
  30670. numbers between 0.0 and 1.0, inclusive) or a color description as specified in the
  30671. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>,
  30672. a position (specified as <var class="var">X</var>/<var class="var">Y</var>, where
  30673. <var class="var">X</var> and <var class="var">Y</var> are floating point numbers) and/or a string.
  30674. </p>
  30675. <p>The number and types of parameters depend on the loaded effect. If an
  30676. effect parameter is not specified, the default value is set.
  30677. </p>
  30678. <ul class="mini-toc">
  30679. <li><a href="#Examples-97" accesskey="1">Examples</a></li>
  30680. <li><a href="#Commands-94" accesskey="2">Commands</a></li>
  30681. </ul>
  30682. <div class="subsection-level-extent" id="Examples-97">
  30683. <h4 class="subsection"><span>30.106.1 Examples<a class="copiable-link" href="#Examples-97"> &para;</a></span></h4>
  30684. <ul class="itemize mark-bullet">
  30685. <li>Apply the distort0r effect, setting the first two double parameters:
  30686. <div class="example">
  30687. <pre class="example-preformatted">frei0r=filter_name=distort0r:filter_params=0.5|0.01
  30688. </pre></div>
  30689. </li><li>Apply the colordistance effect, taking a color as the first parameter:
  30690. <div class="example">
  30691. <pre class="example-preformatted">frei0r=colordistance:0.2/0.3/0.4
  30692. frei0r=colordistance:violet
  30693. frei0r=colordistance:0x112233
  30694. </pre></div>
  30695. </li><li>Apply the perspective effect, specifying the top left and top right image
  30696. positions:
  30697. <div class="example">
  30698. <pre class="example-preformatted">frei0r=perspective:0.2/0.2|0.8/0.2
  30699. </pre></div>
  30700. </li></ul>
  30701. <p>For more information, see
  30702. <a class="url" href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
  30703. </p>
  30704. </div>
  30705. <div class="subsection-level-extent" id="Commands-94">
  30706. <h4 class="subsection"><span>30.106.2 Commands<a class="copiable-link" href="#Commands-94"> &para;</a></span></h4>
  30707. <p>This filter supports the <samp class="option">filter_params</samp> option as <a class="ref" href="#commands">commands</a>.
  30708. </p>
  30709. </div>
  30710. </div>
  30711. <div class="section-level-extent" id="fspp">
  30712. <h3 class="section"><span>30.107 fspp<a class="copiable-link" href="#fspp"> &para;</a></span></h3>
  30713. <p>Apply fast and simple postprocessing. It is a faster version of <a class="ref" href="#spp">spp</a>.
  30714. </p>
  30715. <p>It splits (I)DCT into horizontal/vertical passes. Unlike the simple post-
  30716. processing filter, one of them is performed once per block, not per pixel.
  30717. This allows for much higher speed.
  30718. </p>
  30719. <p>The filter accepts the following options:
  30720. </p>
  30721. <dl class="table">
  30722. <dt><samp class="option">quality</samp></dt>
  30723. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  30724. an integer in the range 4-5. Default value is <code class="code">4</code>.
  30725. </p>
  30726. </dd>
  30727. <dt><samp class="option">qp</samp></dt>
  30728. <dd><p>Force a constant quantization parameter. It accepts an integer in range 0-63.
  30729. If not set, the filter will use the QP from the video stream (if available).
  30730. </p>
  30731. </dd>
  30732. <dt><samp class="option">strength</samp></dt>
  30733. <dd><p>Set filter strength. It accepts an integer in range -15 to 32. Lower values mean
  30734. more details but also more artifacts, while higher values make the image smoother
  30735. but also blurrier. Default value is <code class="code">0</code> − PSNR optimal.
  30736. </p>
  30737. </dd>
  30738. <dt><samp class="option">use_bframe_qp</samp></dt>
  30739. <dd><p>Enable the use of the QP from the B-Frames if set to <code class="code">1</code>. Using this
  30740. option may cause flicker since the B-Frames have often larger QP. Default is
  30741. <code class="code">0</code> (not enabled).
  30742. </p>
  30743. </dd>
  30744. </dl>
  30745. <a class="anchor" id="fsync"></a></div>
  30746. <div class="section-level-extent" id="fsync-1">
  30747. <h3 class="section"><span>30.108 fsync<a class="copiable-link" href="#fsync-1"> &para;</a></span></h3>
  30748. <p>Synchronize video frames with an external mapping from a file.
  30749. </p>
  30750. <p>For each input PTS given in the map file it either drops or creates as many
  30751. frames as necessary to recreate the sequence of output frames given in the
  30752. map file.
  30753. </p>
  30754. <p>This filter is useful to recreate the output frames of a framerate conversion
  30755. by the <a class="ref" href="#fps">fps</a> filter, recorded into a map file using the ffmpeg option
  30756. <code class="code">-stats_mux_pre</code>, and do further processing to the corresponding frames
  30757. e.g. quality comparison.
  30758. </p>
  30759. <p>Each line of the map file must contain three items per input frame, the input
  30760. PTS (decimal), the output PTS (decimal) and the
  30761. output TIMEBASE (decimal/decimal), seperated by a space.
  30762. This file format corresponds to the output
  30763. of <code class="code">-stats_mux_pre_fmt=&quot;{ptsi} {pts} {tb}&quot;</code>.
  30764. </p>
  30765. <p>The filter assumes the map file is sorted by increasing input PTS.
  30766. </p>
  30767. <p>The filter accepts the following options:
  30768. </p><dl class="table">
  30769. <dt><samp class="option">file, f</samp></dt>
  30770. <dd><p>The filename of the map file to be used.
  30771. </p></dd>
  30772. </dl>
  30773. <p>Example:
  30774. </p><div class="example">
  30775. <pre class="example-preformatted"># Convert a video to 25 fps and record a MAP_FILE file with the default format of this filter
  30776. ffmpeg -i INPUT -vf fps=fps=25 -stats_mux_pre MAP_FILE -stats_mux_pre_fmt &quot;{ptsi} {pts} {tb}&quot; OUTPUT
  30777. # Sort MAP_FILE by increasing input PTS
  30778. sort -n MAP_FILE
  30779. # Use INPUT, OUTPUT and the MAP_FILE from above to compare the corresponding frames in INPUT and OUTPUT via SSIM
  30780. ffmpeg -i INPUT -i OUTPUT -filter_complex '[0:v]fsync=file=MAP_FILE[ref];[1:v][ref]ssim' -f null -
  30781. </pre></div>
  30782. </div>
  30783. <div class="section-level-extent" id="gblur">
  30784. <h3 class="section"><span>30.109 gblur<a class="copiable-link" href="#gblur"> &para;</a></span></h3>
  30785. <p>Apply Gaussian blur filter.
  30786. </p>
  30787. <p>The filter accepts the following options:
  30788. </p>
  30789. <dl class="table">
  30790. <dt><samp class="option">sigma</samp></dt>
  30791. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code class="code">0.5</code>.
  30792. </p>
  30793. </dd>
  30794. <dt><samp class="option">steps</samp></dt>
  30795. <dd><p>Set number of steps for Gaussian approximation. Default is <code class="code">1</code>.
  30796. </p>
  30797. </dd>
  30798. <dt><samp class="option">planes</samp></dt>
  30799. <dd><p>Set which planes to filter. By default all planes are filtered.
  30800. </p>
  30801. </dd>
  30802. <dt><samp class="option">sigmaV</samp></dt>
  30803. <dd><p>Set vertical sigma, if negative it will be same as <code class="code">sigma</code>.
  30804. Default is <code class="code">-1</code>.
  30805. </p></dd>
  30806. </dl>
  30807. <ul class="mini-toc">
  30808. <li><a href="#Commands-95" accesskey="1">Commands</a></li>
  30809. </ul>
  30810. <div class="subsection-level-extent" id="Commands-95">
  30811. <h4 class="subsection"><span>30.109.1 Commands<a class="copiable-link" href="#Commands-95"> &para;</a></span></h4>
  30812. <p>This filter supports same commands as options.
  30813. The command accepts the same syntax of the corresponding option.
  30814. </p>
  30815. <p>If the specified expression is not valid, it is kept at its current
  30816. value.
  30817. </p>
  30818. </div>
  30819. </div>
  30820. <div class="section-level-extent" id="geq">
  30821. <h3 class="section"><span>30.110 geq<a class="copiable-link" href="#geq"> &para;</a></span></h3>
  30822. <p>Apply generic equation to each pixel.
  30823. </p>
  30824. <p>The filter accepts the following options:
  30825. </p>
  30826. <dl class="table">
  30827. <dt><samp class="option">lum_expr, lum</samp></dt>
  30828. <dd><p>Set the luma expression.
  30829. </p></dd>
  30830. <dt><samp class="option">cb_expr, cb</samp></dt>
  30831. <dd><p>Set the chrominance blue expression.
  30832. </p></dd>
  30833. <dt><samp class="option">cr_expr, cr</samp></dt>
  30834. <dd><p>Set the chrominance red expression.
  30835. </p></dd>
  30836. <dt><samp class="option">alpha_expr, a</samp></dt>
  30837. <dd><p>Set the alpha expression.
  30838. </p></dd>
  30839. <dt><samp class="option">red_expr, r</samp></dt>
  30840. <dd><p>Set the red expression.
  30841. </p></dd>
  30842. <dt><samp class="option">green_expr, g</samp></dt>
  30843. <dd><p>Set the green expression.
  30844. </p></dd>
  30845. <dt><samp class="option">blue_expr, b</samp></dt>
  30846. <dd><p>Set the blue expression.
  30847. </p></dd>
  30848. </dl>
  30849. <p>The colorspace is selected according to the specified options. If one
  30850. of the <samp class="option">lum_expr</samp>, <samp class="option">cb_expr</samp>, or <samp class="option">cr_expr</samp>
  30851. options is specified, the filter will automatically select a YCbCr
  30852. colorspace. If one of the <samp class="option">red_expr</samp>, <samp class="option">green_expr</samp>, or
  30853. <samp class="option">blue_expr</samp> options is specified, it will select an RGB
  30854. colorspace.
  30855. </p>
  30856. <p>If one of the chrominance expression is not defined, it falls back on the other
  30857. one. If no alpha expression is specified it will evaluate to opaque value.
  30858. If none of chrominance expressions are specified, they will evaluate
  30859. to the luma expression.
  30860. </p>
  30861. <p>The expressions can use the following variables and functions:
  30862. </p>
  30863. <dl class="table">
  30864. <dt><samp class="option">N</samp></dt>
  30865. <dd><p>The sequential number of the filtered frame, starting from <code class="code">0</code>.
  30866. </p>
  30867. </dd>
  30868. <dt><samp class="option">X</samp></dt>
  30869. <dt><samp class="option">Y</samp></dt>
  30870. <dd><p>The coordinates of the current sample.
  30871. </p>
  30872. </dd>
  30873. <dt><samp class="option">W</samp></dt>
  30874. <dt><samp class="option">H</samp></dt>
  30875. <dd><p>The width and height of the image.
  30876. </p>
  30877. </dd>
  30878. <dt><samp class="option">SW</samp></dt>
  30879. <dt><samp class="option">SH</samp></dt>
  30880. <dd><p>Width and height scale depending on the currently filtered plane. It is the
  30881. ratio between the corresponding luma plane number of pixels and the current
  30882. plane ones. E.g. for YUV4:2:0 the values are <code class="code">1,1</code> for the luma plane, and
  30883. <code class="code">0.5,0.5</code> for chroma planes.
  30884. </p>
  30885. </dd>
  30886. <dt><samp class="option">T</samp></dt>
  30887. <dd><p>Time of the current frame, expressed in seconds.
  30888. </p>
  30889. </dd>
  30890. <dt><samp class="option">p(x, y)</samp></dt>
  30891. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the current
  30892. plane.
  30893. </p>
  30894. </dd>
  30895. <dt><samp class="option">lum(x, y)</samp></dt>
  30896. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the luma
  30897. plane.
  30898. </p>
  30899. </dd>
  30900. <dt><samp class="option">cb(x, y)</samp></dt>
  30901. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  30902. blue-difference chroma plane. Return 0 if there is no such plane.
  30903. </p>
  30904. </dd>
  30905. <dt><samp class="option">cr(x, y)</samp></dt>
  30906. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  30907. red-difference chroma plane. Return 0 if there is no such plane.
  30908. </p>
  30909. </dd>
  30910. <dt><samp class="option">r(x, y)</samp></dt>
  30911. <dt><samp class="option">g(x, y)</samp></dt>
  30912. <dt><samp class="option">b(x, y)</samp></dt>
  30913. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  30914. red/green/blue component. Return 0 if there is no such component.
  30915. </p>
  30916. </dd>
  30917. <dt><samp class="option">alpha(x, y)</samp></dt>
  30918. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the alpha
  30919. plane. Return 0 if there is no such plane.
  30920. </p>
  30921. </dd>
  30922. <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>
  30923. <dd><p>Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining
  30924. sums of samples within a rectangle. See the functions without the sum postfix.
  30925. </p>
  30926. </dd>
  30927. <dt><samp class="option">interpolation</samp></dt>
  30928. <dd><p>Set one of interpolation methods:
  30929. </p><dl class="table">
  30930. <dt><samp class="option">nearest, n</samp></dt>
  30931. <dt><samp class="option">bilinear, b</samp></dt>
  30932. </dl>
  30933. <p>Default is bilinear.
  30934. </p></dd>
  30935. </dl>
  30936. <p>For functions, if <var class="var">x</var> and <var class="var">y</var> are outside the area, the value will be
  30937. automatically clipped to the closer edge.
  30938. </p>
  30939. <p>Please note that this filter can use multiple threads in which case each slice
  30940. will have its own expression state. If you want to use only a single expression
  30941. state because your expressions depend on previous state then you should limit
  30942. the number of filter threads to 1.
  30943. </p>
  30944. <ul class="mini-toc">
  30945. <li><a href="#Examples-98" accesskey="1">Examples</a></li>
  30946. </ul>
  30947. <div class="subsection-level-extent" id="Examples-98">
  30948. <h4 class="subsection"><span>30.110.1 Examples<a class="copiable-link" href="#Examples-98"> &para;</a></span></h4>
  30949. <ul class="itemize mark-bullet">
  30950. <li>Flip the image horizontally:
  30951. <div class="example">
  30952. <pre class="example-preformatted">geq=p(W-X\,Y)
  30953. </pre></div>
  30954. </li><li>Generate a bidimensional sine wave, with angle <code class="code">PI/3</code> and a
  30955. wavelength of 100 pixels:
  30956. <div class="example">
  30957. <pre class="example-preformatted">geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
  30958. </pre></div>
  30959. </li><li>Generate a fancy enigmatic moving light:
  30960. <div class="example">
  30961. <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
  30962. </pre></div>
  30963. </li><li>Generate a quick emboss effect:
  30964. <div class="example">
  30965. <pre class="example-preformatted">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
  30966. </pre></div>
  30967. </li><li>Modify RGB components depending on pixel position:
  30968. <div class="example">
  30969. <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)'
  30970. </pre></div>
  30971. </li><li>Create a radial gradient that is the same size as the input (also see
  30972. the <a class="ref" href="#vignette">vignette</a> filter):
  30973. <div class="example">
  30974. <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
  30975. </pre></div>
  30976. </li></ul>
  30977. </div>
  30978. </div>
  30979. <div class="section-level-extent" id="gradfun">
  30980. <h3 class="section"><span>30.111 gradfun<a class="copiable-link" href="#gradfun"> &para;</a></span></h3>
  30981. <p>Fix the banding artifacts that are sometimes introduced into nearly flat
  30982. regions by truncation to 8-bit color depth.
  30983. Interpolate the gradients that should go where the bands are, and
  30984. dither them.
  30985. </p>
  30986. <p>It is designed for playback only. Do not use it prior to
  30987. lossy compression, because compression tends to lose the dither and
  30988. bring back the bands.
  30989. </p>
  30990. <p>It accepts the following parameters:
  30991. </p>
  30992. <dl class="table">
  30993. <dt><samp class="option">strength</samp></dt>
  30994. <dd><p>The maximum amount by which the filter will change any one pixel. This is also
  30995. the threshold for detecting nearly flat regions. Acceptable values range from
  30996. .51 to 64; the default value is 1.2. Out-of-range values will be clipped to the
  30997. valid range.
  30998. </p>
  30999. </dd>
  31000. <dt><samp class="option">radius</samp></dt>
  31001. <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
  31002. gradients, but also prevents the filter from modifying the pixels near detailed
  31003. regions. Acceptable values are 8-32; the default value is 16. Out-of-range
  31004. values will be clipped to the valid range.
  31005. </p>
  31006. </dd>
  31007. </dl>
  31008. <p>Alternatively, the options can be specified as a flat string:
  31009. <var class="var">strength</var>[:<var class="var">radius</var>]
  31010. </p>
  31011. <ul class="mini-toc">
  31012. <li><a href="#Examples-99" accesskey="1">Examples</a></li>
  31013. </ul>
  31014. <div class="subsection-level-extent" id="Examples-99">
  31015. <h4 class="subsection"><span>30.111.1 Examples<a class="copiable-link" href="#Examples-99"> &para;</a></span></h4>
  31016. <ul class="itemize mark-bullet">
  31017. <li>Apply the filter with a <code class="code">3.5</code> strength and radius of <code class="code">8</code>:
  31018. <div class="example">
  31019. <pre class="example-preformatted">gradfun=3.5:8
  31020. </pre></div>
  31021. </li><li>Specify radius, omitting the strength (which will fall-back to the default
  31022. value):
  31023. <div class="example">
  31024. <pre class="example-preformatted">gradfun=radius=8
  31025. </pre></div>
  31026. </li></ul>
  31027. <a class="anchor" id="graphmonitor"></a></div>
  31028. </div>
  31029. <div class="section-level-extent" id="graphmonitor-1">
  31030. <h3 class="section"><span>30.112 graphmonitor<a class="copiable-link" href="#graphmonitor-1"> &para;</a></span></h3>
  31031. <p>Show various filtergraph stats.
  31032. </p>
  31033. <p>With this filter one can debug complete filtergraph.
  31034. Especially issues with links filling with queued frames.
  31035. </p>
  31036. <p>The filter accepts the following options:
  31037. </p>
  31038. <dl class="table">
  31039. <dt><samp class="option">size, s</samp></dt>
  31040. <dd><p>Set video output size. Default is <var class="var">hd720</var>.
  31041. </p>
  31042. </dd>
  31043. <dt><samp class="option">opacity, o</samp></dt>
  31044. <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>.
  31045. </p>
  31046. </dd>
  31047. <dt><samp class="option">mode, m</samp></dt>
  31048. <dd><p>Set output mode flags.
  31049. </p>
  31050. <p>Available values for flags are:
  31051. </p><dl class="table">
  31052. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  31053. <dd><p>No any filtering. Default.
  31054. </p></dd>
  31055. <dt>&lsquo;<samp class="samp">compact</samp>&rsquo;</dt>
  31056. <dd><p>Show only filters with queued frames.
  31057. </p></dd>
  31058. <dt>&lsquo;<samp class="samp">nozero</samp>&rsquo;</dt>
  31059. <dd><p>Show only filters with non-zero stats.
  31060. </p></dd>
  31061. <dt>&lsquo;<samp class="samp">noeof</samp>&rsquo;</dt>
  31062. <dd><p>Show only filters with non-eof stat.
  31063. </p></dd>
  31064. <dt>&lsquo;<samp class="samp">nodisabled</samp>&rsquo;</dt>
  31065. <dd><p>Show only filters that are enabled in timeline.
  31066. </p></dd>
  31067. </dl>
  31068. </dd>
  31069. <dt><samp class="option">flags, f</samp></dt>
  31070. <dd><p>Set flags which enable which stats are shown in video.
  31071. </p>
  31072. <p>Available values for flags are:
  31073. </p><dl class="table">
  31074. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  31075. <dd><p>All flags turned off.
  31076. </p>
  31077. </dd>
  31078. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  31079. <dd><p>All flags turned on.
  31080. </p>
  31081. </dd>
  31082. <dt>&lsquo;<samp class="samp">queue</samp>&rsquo;</dt>
  31083. <dd><p>Display number of queued frames in each link.
  31084. </p>
  31085. </dd>
  31086. <dt>&lsquo;<samp class="samp">frame_count_in</samp>&rsquo;</dt>
  31087. <dd><p>Display number of frames taken from filter.
  31088. </p>
  31089. </dd>
  31090. <dt>&lsquo;<samp class="samp">frame_count_out</samp>&rsquo;</dt>
  31091. <dd><p>Display number of frames given out from filter.
  31092. </p>
  31093. </dd>
  31094. <dt>&lsquo;<samp class="samp">frame_count_delta</samp>&rsquo;</dt>
  31095. <dd><p>Display delta number of frames between above two values.
  31096. </p>
  31097. </dd>
  31098. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  31099. <dd><p>Display current filtered frame pts.
  31100. </p>
  31101. </dd>
  31102. <dt>&lsquo;<samp class="samp">pts_delta</samp>&rsquo;</dt>
  31103. <dd><p>Display pts delta between current and previous frame.
  31104. </p>
  31105. </dd>
  31106. <dt>&lsquo;<samp class="samp">time</samp>&rsquo;</dt>
  31107. <dd><p>Display current filtered frame time.
  31108. </p>
  31109. </dd>
  31110. <dt>&lsquo;<samp class="samp">time_delta</samp>&rsquo;</dt>
  31111. <dd><p>Display time delta between current and previous frame.
  31112. </p>
  31113. </dd>
  31114. <dt>&lsquo;<samp class="samp">timebase</samp>&rsquo;</dt>
  31115. <dd><p>Display time base for filter link.
  31116. </p>
  31117. </dd>
  31118. <dt>&lsquo;<samp class="samp">format</samp>&rsquo;</dt>
  31119. <dd><p>Display used format for filter link.
  31120. </p>
  31121. </dd>
  31122. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  31123. <dd><p>Display video size or number of audio channels in case of audio used by filter link.
  31124. </p>
  31125. </dd>
  31126. <dt>&lsquo;<samp class="samp">rate</samp>&rsquo;</dt>
  31127. <dd><p>Display video frame rate or sample rate in case of audio used by filter link.
  31128. </p>
  31129. </dd>
  31130. <dt>&lsquo;<samp class="samp">eof</samp>&rsquo;</dt>
  31131. <dd><p>Display link output status.
  31132. </p>
  31133. </dd>
  31134. <dt>&lsquo;<samp class="samp">sample_count_in</samp>&rsquo;</dt>
  31135. <dd><p>Display number of samples taken from filter.
  31136. </p>
  31137. </dd>
  31138. <dt>&lsquo;<samp class="samp">sample_count_out</samp>&rsquo;</dt>
  31139. <dd><p>Display number of samples given out from filter.
  31140. </p>
  31141. </dd>
  31142. <dt>&lsquo;<samp class="samp">sample_count_delta</samp>&rsquo;</dt>
  31143. <dd><p>Display delta number of samples between above two values.
  31144. </p>
  31145. </dd>
  31146. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  31147. <dd><p>Show the timeline filter status.
  31148. </p></dd>
  31149. </dl>
  31150. </dd>
  31151. <dt><samp class="option">rate, r</samp></dt>
  31152. <dd><p>Set upper limit for video rate of output stream, Default value is <var class="var">25</var>.
  31153. This guarantee that output video frame rate will not be higher than this value.
  31154. </p></dd>
  31155. </dl>
  31156. </div>
  31157. <div class="section-level-extent" id="grayworld">
  31158. <h3 class="section"><span>30.113 grayworld<a class="copiable-link" href="#grayworld"> &para;</a></span></h3>
  31159. <p>A color constancy filter that applies color correction based on the grayworld assumption
  31160. </p>
  31161. <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>
  31162. </p>
  31163. <p>The algorithm uses linear light, so input
  31164. data should be linearized beforehand (and possibly correctly tagged).
  31165. </p>
  31166. <div class="example">
  31167. <pre class="example-preformatted">ffmpeg -i INPUT -vf zscale=transfer=linear,grayworld,zscale=transfer=bt709,format=yuv420p OUTPUT
  31168. </pre></div>
  31169. </div>
  31170. <div class="section-level-extent" id="greyedge">
  31171. <h3 class="section"><span>30.114 greyedge<a class="copiable-link" href="#greyedge"> &para;</a></span></h3>
  31172. <p>A color constancy variation filter which estimates scene illumination via grey edge algorithm
  31173. and corrects the scene colors accordingly.
  31174. </p>
  31175. <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>
  31176. </p>
  31177. <p>The filter accepts the following options:
  31178. </p>
  31179. <dl class="table">
  31180. <dt><samp class="option">difford</samp></dt>
  31181. <dd><p>The order of differentiation to be applied on the scene. Must be chosen in the range
  31182. [0,2] and default value is 1.
  31183. </p>
  31184. </dd>
  31185. <dt><samp class="option">minknorm</samp></dt>
  31186. <dd><p>The Minkowski parameter to be used for calculating the Minkowski distance. Must
  31187. be chosen in the range [0,20] and default value is 1. Set to 0 for getting
  31188. max value instead of calculating Minkowski distance.
  31189. </p>
  31190. </dd>
  31191. <dt><samp class="option">sigma</samp></dt>
  31192. <dd><p>The standard deviation of Gaussian blur to be applied on the scene. Must be
  31193. chosen in the range [0,1024.0] and default value = 1. floor( <var class="var">sigma</var> * break_off_sigma(3) )
  31194. can&rsquo;t be equal to 0 if <var class="var">difford</var> is greater than 0.
  31195. </p></dd>
  31196. </dl>
  31197. <ul class="mini-toc">
  31198. <li><a href="#Examples-100" accesskey="1">Examples</a></li>
  31199. </ul>
  31200. <div class="subsection-level-extent" id="Examples-100">
  31201. <h4 class="subsection"><span>30.114.1 Examples<a class="copiable-link" href="#Examples-100"> &para;</a></span></h4>
  31202. <ul class="itemize mark-bullet">
  31203. <li>Grey Edge:
  31204. <div class="example">
  31205. <pre class="example-preformatted">greyedge=difford=1:minknorm=5:sigma=2
  31206. </pre></div>
  31207. </li><li>Max Edge:
  31208. <div class="example">
  31209. <pre class="example-preformatted">greyedge=difford=1:minknorm=0:sigma=2
  31210. </pre></div>
  31211. </li></ul>
  31212. </div>
  31213. </div>
  31214. <div class="section-level-extent" id="guided">
  31215. <h3 class="section"><span>30.115 guided<a class="copiable-link" href="#guided"> &para;</a></span></h3>
  31216. <p>Apply guided filter for edge-preserving smoothing, dehazing and so on.
  31217. </p>
  31218. <p>The filter accepts the following options:
  31219. </p><dl class="table">
  31220. <dt><samp class="option">radius</samp></dt>
  31221. <dd><p>Set the box radius in pixels.
  31222. Allowed range is 1 to 20. Default is 3.
  31223. </p>
  31224. </dd>
  31225. <dt><samp class="option">eps</samp></dt>
  31226. <dd><p>Set regularization parameter (with square).
  31227. Allowed range is 0 to 1. Default is 0.01.
  31228. </p>
  31229. </dd>
  31230. <dt><samp class="option">mode</samp></dt>
  31231. <dd><p>Set filter mode. Can be <code class="code">basic</code> or <code class="code">fast</code>.
  31232. Default is <code class="code">basic</code>.
  31233. </p>
  31234. </dd>
  31235. <dt><samp class="option">sub</samp></dt>
  31236. <dd><p>Set subsampling ratio for <code class="code">fast</code> mode.
  31237. Range is 2 to 64. Default is 4.
  31238. No subsampling occurs in <code class="code">basic</code> mode.
  31239. </p>
  31240. </dd>
  31241. <dt><samp class="option">guidance</samp></dt>
  31242. <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>.
  31243. If <code class="code">off</code>, single input is required.
  31244. If <code class="code">on</code>, two inputs of the same resolution and pixel format are required.
  31245. The second input serves as the guidance.
  31246. </p>
  31247. </dd>
  31248. <dt><samp class="option">planes</samp></dt>
  31249. <dd><p>Set planes to filter. Default is first only.
  31250. </p></dd>
  31251. </dl>
  31252. <ul class="mini-toc">
  31253. <li><a href="#Commands-96" accesskey="1">Commands</a></li>
  31254. <li><a href="#Examples-101" accesskey="2">Examples</a></li>
  31255. </ul>
  31256. <div class="subsection-level-extent" id="Commands-96">
  31257. <h4 class="subsection"><span>30.115.1 Commands<a class="copiable-link" href="#Commands-96"> &para;</a></span></h4>
  31258. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31259. </p>
  31260. </div>
  31261. <div class="subsection-level-extent" id="Examples-101">
  31262. <h4 class="subsection"><span>30.115.2 Examples<a class="copiable-link" href="#Examples-101"> &para;</a></span></h4>
  31263. <ul class="itemize mark-bullet">
  31264. <li>Edge-preserving smoothing with guided filter:
  31265. <div class="example">
  31266. <pre class="example-preformatted">ffmpeg -i in.png -vf guided out.png
  31267. </pre></div>
  31268. </li><li>Dehazing, structure-transferring filtering, detail enhancement with guided filter.
  31269. For the generation of guidance image, refer to paper &quot;Guided Image Filtering&quot;.
  31270. See: <a class="url" href="http://kaiminghe.com/publications/pami12guidedfilter.pdf">http://kaiminghe.com/publications/pami12guidedfilter.pdf</a>.
  31271. <div class="example">
  31272. <pre class="example-preformatted">ffmpeg -i in.png -i guidance.png -filter_complex guided=guidance=on out.png
  31273. </pre></div>
  31274. </li></ul>
  31275. <a class="anchor" id="haldclut"></a></div>
  31276. </div>
  31277. <div class="section-level-extent" id="haldclut-1">
  31278. <h3 class="section"><span>30.116 haldclut<a class="copiable-link" href="#haldclut-1"> &para;</a></span></h3>
  31279. <p>Apply a Hald CLUT to a video stream.
  31280. </p>
  31281. <p>First input is the video stream to process, and second one is the Hald CLUT.
  31282. The Hald CLUT input can be a simple picture or a complete video stream.
  31283. </p>
  31284. <p>The filter accepts the following options:
  31285. </p>
  31286. <dl class="table">
  31287. <dt><samp class="option">clut</samp></dt>
  31288. <dd><p>Set which CLUT video frames will be processed from second input stream,
  31289. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  31290. </p>
  31291. </dd>
  31292. <dt><samp class="option">shortest</samp></dt>
  31293. <dd><p>Force termination when the shortest input terminates. Default is <code class="code">0</code>.
  31294. </p></dd>
  31295. <dt><samp class="option">repeatlast</samp></dt>
  31296. <dd><p>Continue applying the last CLUT after the end of the stream. A value of
  31297. <code class="code">0</code> disable the filter after the last frame of the CLUT is reached.
  31298. Default is <code class="code">1</code>.
  31299. </p></dd>
  31300. </dl>
  31301. <p><code class="code">haldclut</code> also has the same interpolation options as <a class="ref" href="#lut3d">lut3d</a> (both
  31302. filters share the same internals).
  31303. </p>
  31304. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  31305. </p>
  31306. <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
  31307. (Hald CLUT author) at <a class="url" href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
  31308. </p>
  31309. <ul class="mini-toc">
  31310. <li><a href="#Commands-97" accesskey="1">Commands</a></li>
  31311. <li><a href="#Workflow-examples" accesskey="2">Workflow examples</a></li>
  31312. </ul>
  31313. <div class="subsection-level-extent" id="Commands-97">
  31314. <h4 class="subsection"><span>30.116.1 Commands<a class="copiable-link" href="#Commands-97"> &para;</a></span></h4>
  31315. <p>This filter supports the <code class="code">interp</code> option as <a class="ref" href="#commands">commands</a>.
  31316. </p>
  31317. </div>
  31318. <div class="subsection-level-extent" id="Workflow-examples">
  31319. <h4 class="subsection"><span>30.116.2 Workflow examples<a class="copiable-link" href="#Workflow-examples"> &para;</a></span></h4>
  31320. <ul class="mini-toc">
  31321. <li><a href="#Hald-CLUT-video-stream" accesskey="1">Hald CLUT video stream</a></li>
  31322. <li><a href="#Hald-CLUT-with-preview" accesskey="2">Hald CLUT with preview</a></li>
  31323. </ul>
  31324. <div class="subsubsection-level-extent" id="Hald-CLUT-video-stream">
  31325. <h4 class="subsubsection"><span>30.116.2.1 Hald CLUT video stream<a class="copiable-link" href="#Hald-CLUT-video-stream"> &para;</a></span></h4>
  31326. <p>Generate an identity Hald CLUT stream altered with various effects:
  31327. </p><div class="example">
  31328. <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
  31329. </pre></div>
  31330. <p>Note: make sure you use a lossless codec.
  31331. </p>
  31332. <p>Then use it with <code class="code">haldclut</code> to apply it on some random stream:
  31333. </p><div class="example">
  31334. <pre class="example-preformatted">ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
  31335. </pre></div>
  31336. <p>The Hald CLUT will be applied to the 10 first seconds (duration of
  31337. <samp class="file">clut.nut</samp>), then the latest picture of that CLUT stream will be applied
  31338. to the remaining frames of the <code class="code">mandelbrot</code> stream.
  31339. </p>
  31340. </div>
  31341. <div class="subsubsection-level-extent" id="Hald-CLUT-with-preview">
  31342. <h4 class="subsubsection"><span>30.116.2.2 Hald CLUT with preview<a class="copiable-link" href="#Hald-CLUT-with-preview"> &para;</a></span></h4>
  31343. <p>A Hald CLUT is supposed to be a squared image of <code class="code">Level*Level*Level</code> by
  31344. <code class="code">Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
  31345. biggest possible square starting at the top left of the picture. The remaining
  31346. padding pixels (bottom or right) will be ignored. This area can be used to add
  31347. a preview of the Hald CLUT.
  31348. </p>
  31349. <p>Typically, the following generated Hald CLUT will be supported by the
  31350. <code class="code">haldclut</code> filter:
  31351. </p>
  31352. <div class="example">
  31353. <pre class="example-preformatted">ffmpeg -f lavfi -i <a class="ref" href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
  31354. pad=iw+320 [padded_clut];
  31355. smptebars=s=320x256, split [a][b];
  31356. [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
  31357. [main][b] overlay=W-320&quot; -frames:v 1 clut.png
  31358. </pre></div>
  31359. <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
  31360. bars are displayed on the right-top, and below the same color bars processed by
  31361. the color changes.
  31362. </p>
  31363. <p>Then, the effect of this Hald CLUT can be visualized with:
  31364. </p><div class="example">
  31365. <pre class="example-preformatted">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
  31366. </pre></div>
  31367. </div>
  31368. </div>
  31369. </div>
  31370. <div class="section-level-extent" id="hflip">
  31371. <h3 class="section"><span>30.117 hflip<a class="copiable-link" href="#hflip"> &para;</a></span></h3>
  31372. <p>Flip the input video horizontally.
  31373. </p>
  31374. <p>For example, to horizontally flip the input video with <code class="command">ffmpeg</code>:
  31375. </p><div class="example">
  31376. <pre class="example-preformatted">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
  31377. </pre></div>
  31378. </div>
  31379. <div class="section-level-extent" id="histeq">
  31380. <h3 class="section"><span>30.118 histeq<a class="copiable-link" href="#histeq"> &para;</a></span></h3>
  31381. <p>This filter applies a global color histogram equalization on a
  31382. per-frame basis.
  31383. </p>
  31384. <p>It can be used to correct video that has a compressed range of pixel
  31385. intensities. The filter redistributes the pixel intensities to
  31386. equalize their distribution across the intensity range. It may be
  31387. viewed as an &quot;automatically adjusting contrast filter&quot;. This filter is
  31388. useful only for correcting degraded or poorly captured source
  31389. video.
  31390. </p>
  31391. <p>The filter accepts the following options:
  31392. </p>
  31393. <dl class="table">
  31394. <dt><samp class="option">strength</samp></dt>
  31395. <dd><p>Determine the amount of equalization to be applied. As the strength
  31396. is reduced, the distribution of pixel intensities more-and-more
  31397. approaches that of the input frame. The value must be a float number
  31398. in the range [0,1] and defaults to 0.200.
  31399. </p>
  31400. </dd>
  31401. <dt><samp class="option">intensity</samp></dt>
  31402. <dd><p>Set the maximum intensity that can generated and scale the output
  31403. values appropriately. The strength should be set as desired and then
  31404. the intensity can be limited if needed to avoid washing-out. The value
  31405. must be a float number in the range [0,1] and defaults to 0.210.
  31406. </p>
  31407. </dd>
  31408. <dt><samp class="option">antibanding</samp></dt>
  31409. <dd><p>Set the antibanding level. If enabled the filter will randomly vary
  31410. the luminance of output pixels by a small amount to avoid banding of
  31411. the histogram. Possible values are <code class="code">none</code>, <code class="code">weak</code> or
  31412. <code class="code">strong</code>. It defaults to <code class="code">none</code>.
  31413. </p></dd>
  31414. </dl>
  31415. <a class="anchor" id="histogram"></a></div>
  31416. <div class="section-level-extent" id="histogram-1">
  31417. <h3 class="section"><span>30.119 histogram<a class="copiable-link" href="#histogram-1"> &para;</a></span></h3>
  31418. <p>Compute and draw a color distribution histogram for the input video.
  31419. </p>
  31420. <p>The computed histogram is a representation of the color component
  31421. distribution in an image.
  31422. </p>
  31423. <p>Standard histogram displays the color components distribution in an image.
  31424. Displays color graph for each color component. Shows distribution of
  31425. the Y, U, V, A or R, G, B components, depending on input format, in the
  31426. current frame. Below each graph a color component scale meter is shown.
  31427. </p>
  31428. <p>The filter accepts the following options:
  31429. </p>
  31430. <dl class="table">
  31431. <dt><samp class="option">level_height</samp></dt>
  31432. <dd><p>Set height of level. Default value is <code class="code">200</code>.
  31433. Allowed range is [50, 2048].
  31434. </p>
  31435. </dd>
  31436. <dt><samp class="option">scale_height</samp></dt>
  31437. <dd><p>Set height of color scale. Default value is <code class="code">12</code>.
  31438. Allowed range is [0, 40].
  31439. </p>
  31440. </dd>
  31441. <dt><samp class="option">display_mode</samp></dt>
  31442. <dd><p>Set display mode.
  31443. It accepts the following values:
  31444. </p><dl class="table">
  31445. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  31446. <dd><p>Per color component graphs are placed below each other.
  31447. </p>
  31448. </dd>
  31449. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  31450. <dd><p>Per color component graphs are placed side by side.
  31451. </p>
  31452. </dd>
  31453. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  31454. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  31455. that the graphs representing color components are superimposed directly
  31456. over one another.
  31457. </p></dd>
  31458. </dl>
  31459. <p>Default is <code class="code">stack</code>.
  31460. </p>
  31461. </dd>
  31462. <dt><samp class="option">levels_mode</samp></dt>
  31463. <dd><p>Set mode. Can be either <code class="code">linear</code>, or <code class="code">logarithmic</code>.
  31464. Default is <code class="code">linear</code>.
  31465. </p>
  31466. </dd>
  31467. <dt><samp class="option">components</samp></dt>
  31468. <dd><p>Set what color components to display.
  31469. Default is <code class="code">7</code>.
  31470. </p>
  31471. </dd>
  31472. <dt><samp class="option">fgopacity</samp></dt>
  31473. <dd><p>Set foreground opacity. Default is <code class="code">0.7</code>.
  31474. </p>
  31475. </dd>
  31476. <dt><samp class="option">bgopacity</samp></dt>
  31477. <dd><p>Set background opacity. Default is <code class="code">0.5</code>.
  31478. </p>
  31479. </dd>
  31480. <dt><samp class="option">colors_mode</samp></dt>
  31481. <dd><p>Set colors mode.
  31482. It accepts the following values:
  31483. </p><dl class="table">
  31484. <dt>&lsquo;<samp class="samp">whiteonblack</samp>&rsquo;</dt>
  31485. <dt>&lsquo;<samp class="samp">blackonwhite</samp>&rsquo;</dt>
  31486. <dt>&lsquo;<samp class="samp">whiteongray</samp>&rsquo;</dt>
  31487. <dt>&lsquo;<samp class="samp">blackongray</samp>&rsquo;</dt>
  31488. <dt>&lsquo;<samp class="samp">coloronblack</samp>&rsquo;</dt>
  31489. <dt>&lsquo;<samp class="samp">coloronwhite</samp>&rsquo;</dt>
  31490. <dt>&lsquo;<samp class="samp">colorongray</samp>&rsquo;</dt>
  31491. <dt>&lsquo;<samp class="samp">blackoncolor</samp>&rsquo;</dt>
  31492. <dt>&lsquo;<samp class="samp">whiteoncolor</samp>&rsquo;</dt>
  31493. <dt>&lsquo;<samp class="samp">grayoncolor</samp>&rsquo;</dt>
  31494. </dl>
  31495. <p>Default is <code class="code">whiteonblack</code>.
  31496. </p></dd>
  31497. </dl>
  31498. <ul class="mini-toc">
  31499. <li><a href="#Examples-102" accesskey="1">Examples</a></li>
  31500. </ul>
  31501. <div class="subsection-level-extent" id="Examples-102">
  31502. <h4 class="subsection"><span>30.119.1 Examples<a class="copiable-link" href="#Examples-102"> &para;</a></span></h4>
  31503. <ul class="itemize mark-bullet">
  31504. <li>Calculate and draw histogram:
  31505. <div class="example">
  31506. <pre class="example-preformatted">ffplay -i input -vf histogram
  31507. </pre></div>
  31508. </li></ul>
  31509. <a class="anchor" id="hqdn3d"></a></div>
  31510. </div>
  31511. <div class="section-level-extent" id="hqdn3d-1">
  31512. <h3 class="section"><span>30.120 hqdn3d<a class="copiable-link" href="#hqdn3d-1"> &para;</a></span></h3>
  31513. <p>This is a high precision/quality 3d denoise filter. It aims to reduce
  31514. image noise, producing smooth images and making still images really
  31515. still. It should enhance compressibility.
  31516. </p>
  31517. <p>It accepts the following optional parameters:
  31518. </p>
  31519. <dl class="table">
  31520. <dt><samp class="option">luma_spatial</samp></dt>
  31521. <dd><p>A non-negative floating point number which specifies spatial luma strength.
  31522. It defaults to 4.0.
  31523. </p>
  31524. </dd>
  31525. <dt><samp class="option">chroma_spatial</samp></dt>
  31526. <dd><p>A non-negative floating point number which specifies spatial chroma strength.
  31527. It defaults to 3.0*<var class="var">luma_spatial</var>/4.0.
  31528. </p>
  31529. </dd>
  31530. <dt><samp class="option">luma_tmp</samp></dt>
  31531. <dd><p>A floating point number which specifies luma temporal strength. It defaults to
  31532. 6.0*<var class="var">luma_spatial</var>/4.0.
  31533. </p>
  31534. </dd>
  31535. <dt><samp class="option">chroma_tmp</samp></dt>
  31536. <dd><p>A floating point number which specifies chroma temporal strength. It defaults to
  31537. <var class="var">luma_tmp</var>*<var class="var">chroma_spatial</var>/<var class="var">luma_spatial</var>.
  31538. </p></dd>
  31539. </dl>
  31540. <ul class="mini-toc">
  31541. <li><a href="#Commands-98" accesskey="1">Commands</a></li>
  31542. </ul>
  31543. <div class="subsection-level-extent" id="Commands-98">
  31544. <h4 class="subsection"><span>30.120.1 Commands<a class="copiable-link" href="#Commands-98"> &para;</a></span></h4>
  31545. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  31546. The command accepts the same syntax of the corresponding option.
  31547. </p>
  31548. <p>If the specified expression is not valid, it is kept at its current
  31549. value.
  31550. </p>
  31551. <a class="anchor" id="hwdownload"></a></div>
  31552. </div>
  31553. <div class="section-level-extent" id="hwdownload-1">
  31554. <h3 class="section"><span>30.121 hwdownload<a class="copiable-link" href="#hwdownload-1"> &para;</a></span></h3>
  31555. <p>Download hardware frames to system memory.
  31556. </p>
  31557. <p>The input must be in hardware frames, and the output a non-hardware format.
  31558. Not all formats will be supported on the output - it may be necessary to insert
  31559. an additional <samp class="option">format</samp> filter immediately following in the graph to get
  31560. the output in a supported format.
  31561. </p>
  31562. </div>
  31563. <div class="section-level-extent" id="hwmap">
  31564. <h3 class="section"><span>30.122 hwmap<a class="copiable-link" href="#hwmap"> &para;</a></span></h3>
  31565. <p>Map hardware frames to system memory or to another device.
  31566. </p>
  31567. <p>This filter has several different modes of operation; which one is used depends
  31568. on the input and output formats:
  31569. </p><ul class="itemize mark-bullet">
  31570. <li>Hardware frame input, normal frame output
  31571. <p>Map the input frames to system memory and pass them to the output. If the
  31572. original hardware frame is later required (for example, after overlaying
  31573. something else on part of it), the <samp class="option">hwmap</samp> filter can be used again
  31574. in the next mode to retrieve it.
  31575. </p></li><li>Normal frame input, hardware frame output
  31576. <p>If the input is actually a software-mapped hardware frame, then unmap it -
  31577. that is, return the original hardware frame.
  31578. </p>
  31579. <p>Otherwise, a device must be provided. Create new hardware surfaces on that
  31580. device for the output, then map them back to the software format at the input
  31581. and give those frames to the preceding filter. This will then act like the
  31582. <samp class="option">hwupload</samp> filter, but may be able to avoid an additional copy when
  31583. the input is already in a compatible format.
  31584. </p></li><li>Hardware frame input and output
  31585. <p>A device must be supplied for the output, either directly or with the
  31586. <samp class="option">derive_device</samp> option. The input and output devices must be of
  31587. different types and compatible - the exact meaning of this is
  31588. system-dependent, but typically it means that they must refer to the same
  31589. underlying hardware context (for example, refer to the same graphics card).
  31590. </p>
  31591. <p>If the input frames were originally created on the output device, then unmap
  31592. to retrieve the original frames.
  31593. </p>
  31594. <p>Otherwise, map the frames to the output device - create new hardware frames
  31595. on the output corresponding to the frames on the input.
  31596. </p></li></ul>
  31597. <p>The following additional parameters are accepted:
  31598. </p>
  31599. <dl class="table">
  31600. <dt><samp class="option">mode</samp></dt>
  31601. <dd><p>Set the frame mapping mode. Some combination of:
  31602. </p><dl class="table">
  31603. <dt><var class="var">read</var></dt>
  31604. <dd><p>The mapped frame should be readable.
  31605. </p></dd>
  31606. <dt><var class="var">write</var></dt>
  31607. <dd><p>The mapped frame should be writeable.
  31608. </p></dd>
  31609. <dt><var class="var">overwrite</var></dt>
  31610. <dd><p>The mapping will always overwrite the entire frame.
  31611. </p>
  31612. <p>This may improve performance in some cases, as the original contents of the
  31613. frame need not be loaded.
  31614. </p></dd>
  31615. <dt><var class="var">direct</var></dt>
  31616. <dd><p>The mapping must not involve any copying.
  31617. </p>
  31618. <p>Indirect mappings to copies of frames are created in some cases where either
  31619. direct mapping is not possible or it would have unexpected properties.
  31620. Setting this flag ensures that the mapping is direct and will fail if that is
  31621. not possible.
  31622. </p></dd>
  31623. </dl>
  31624. <p>Defaults to <var class="var">read+write</var> if not specified.
  31625. </p>
  31626. </dd>
  31627. <dt><samp class="option">derive_device <var class="var">type</var></samp></dt>
  31628. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  31629. device of type <var class="var">type</var> from the device the input frames exist on.
  31630. </p>
  31631. </dd>
  31632. <dt><samp class="option">reverse</samp></dt>
  31633. <dd><p>In a hardware to hardware mapping, map in reverse - create frames in the sink
  31634. and map them back to the source. This may be necessary in some cases where
  31635. a mapping in one direction is required but only the opposite direction is
  31636. supported by the devices being used.
  31637. </p>
  31638. <p>This option is dangerous - it may break the preceding filter in undefined
  31639. ways if there are any additional constraints on that filter&rsquo;s output.
  31640. Do not use it without fully understanding the implications of its use.
  31641. </p></dd>
  31642. </dl>
  31643. <a class="anchor" id="hwupload"></a></div>
  31644. <div class="section-level-extent" id="hwupload-1">
  31645. <h3 class="section"><span>30.123 hwupload<a class="copiable-link" href="#hwupload-1"> &para;</a></span></h3>
  31646. <p>Upload system memory frames to hardware surfaces.
  31647. </p>
  31648. <p>The device to upload to must be supplied when the filter is initialised. If
  31649. using ffmpeg, select the appropriate device with the <samp class="option">-filter_hw_device</samp>
  31650. option or with the <samp class="option">derive_device</samp> option. The input and output devices
  31651. must be of different types and compatible - the exact meaning of this is
  31652. system-dependent, but typically it means that they must refer to the same
  31653. underlying hardware context (for example, refer to the same graphics card).
  31654. </p>
  31655. <p>The following additional parameters are accepted:
  31656. </p>
  31657. <dl class="table">
  31658. <dt><samp class="option">derive_device <var class="var">type</var></samp></dt>
  31659. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  31660. device of type <var class="var">type</var> from the device the input frames exist on.
  31661. </p></dd>
  31662. </dl>
  31663. <a class="anchor" id="hwupload_005fcuda"></a></div>
  31664. <div class="section-level-extent" id="hwupload_005fcuda-1">
  31665. <h3 class="section"><span>30.124 hwupload_cuda<a class="copiable-link" href="#hwupload_005fcuda-1"> &para;</a></span></h3>
  31666. <p>Upload system memory frames to a CUDA device.
  31667. </p>
  31668. <p>It accepts the following optional parameters:
  31669. </p>
  31670. <dl class="table">
  31671. <dt><samp class="option">device</samp></dt>
  31672. <dd><p>The number of the CUDA device to use
  31673. </p></dd>
  31674. </dl>
  31675. </div>
  31676. <div class="section-level-extent" id="hqx">
  31677. <h3 class="section"><span>30.125 hqx<a class="copiable-link" href="#hqx"> &para;</a></span></h3>
  31678. <p>Apply a high-quality magnification filter designed for pixel art. This filter
  31679. was originally created by Maxim Stepin.
  31680. </p>
  31681. <p>It accepts the following option:
  31682. </p>
  31683. <dl class="table">
  31684. <dt><samp class="option">n</samp></dt>
  31685. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">hq2x</code>, <code class="code">3</code> for
  31686. <code class="code">hq3x</code> and <code class="code">4</code> for <code class="code">hq4x</code>.
  31687. Default is <code class="code">3</code>.
  31688. </p></dd>
  31689. </dl>
  31690. <a class="anchor" id="hstack"></a></div>
  31691. <div class="section-level-extent" id="hstack-1">
  31692. <h3 class="section"><span>30.126 hstack<a class="copiable-link" href="#hstack-1"> &para;</a></span></h3>
  31693. <p>Stack input videos horizontally.
  31694. </p>
  31695. <p>All streams must be of same pixel format and of same height.
  31696. </p>
  31697. <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
  31698. to create same output.
  31699. </p>
  31700. <p>The filter accepts the following option:
  31701. </p>
  31702. <dl class="table">
  31703. <dt><samp class="option">inputs</samp></dt>
  31704. <dd><p>Set number of input streams. Default is 2.
  31705. </p>
  31706. </dd>
  31707. <dt><samp class="option">shortest</samp></dt>
  31708. <dd><p>If set to 1, force the output to terminate when the shortest input
  31709. terminates. Default value is 0.
  31710. </p></dd>
  31711. </dl>
  31712. </div>
  31713. <div class="section-level-extent" id="hsvhold">
  31714. <h3 class="section"><span>30.127 hsvhold<a class="copiable-link" href="#hsvhold"> &para;</a></span></h3>
  31715. <p>Turns a certain HSV range into gray values.
  31716. </p>
  31717. <p>This filter measures color difference between set HSV color in options
  31718. and ones measured in video stream. Depending on options, output
  31719. colors can be changed to be gray or not.
  31720. </p>
  31721. <p>The filter accepts the following options:
  31722. </p>
  31723. <dl class="table">
  31724. <dt><samp class="option">hue</samp></dt>
  31725. <dd><p>Set the hue value which will be used in color difference calculation.
  31726. Allowed range is from -360 to 360. Default value is 0.
  31727. </p>
  31728. </dd>
  31729. <dt><samp class="option">sat</samp></dt>
  31730. <dd><p>Set the saturation value which will be used in color difference calculation.
  31731. Allowed range is from -1 to 1. Default value is 0.
  31732. </p>
  31733. </dd>
  31734. <dt><samp class="option">val</samp></dt>
  31735. <dd><p>Set the value which will be used in color difference calculation.
  31736. Allowed range is from -1 to 1. Default value is 0.
  31737. </p>
  31738. </dd>
  31739. <dt><samp class="option">similarity</samp></dt>
  31740. <dd><p>Set similarity percentage with the key color.
  31741. Allowed range is from 0 to 1. Default value is 0.01.
  31742. </p>
  31743. <p>0.00001 matches only the exact key color, while 1.0 matches everything.
  31744. </p>
  31745. </dd>
  31746. <dt><samp class="option">blend</samp></dt>
  31747. <dd><p>Blend percentage.
  31748. Allowed range is from 0 to 1. Default value is 0.
  31749. </p>
  31750. <p>0.0 makes pixels either fully gray, or not gray at all.
  31751. </p>
  31752. <p>Higher values result in more gray pixels, with a higher gray pixel
  31753. the more similar the pixels color is to the key color.
  31754. </p></dd>
  31755. </dl>
  31756. </div>
  31757. <div class="section-level-extent" id="hsvkey">
  31758. <h3 class="section"><span>30.128 hsvkey<a class="copiable-link" href="#hsvkey"> &para;</a></span></h3>
  31759. <p>Turns a certain HSV range into transparency.
  31760. </p>
  31761. <p>This filter measures color difference between set HSV color in options
  31762. and ones measured in video stream. Depending on options, output
  31763. colors can be changed to transparent by adding alpha channel.
  31764. </p>
  31765. <p>The filter accepts the following options:
  31766. </p>
  31767. <dl class="table">
  31768. <dt><samp class="option">hue</samp></dt>
  31769. <dd><p>Set the hue value which will be used in color difference calculation.
  31770. Allowed range is from -360 to 360. Default value is 0.
  31771. </p>
  31772. </dd>
  31773. <dt><samp class="option">sat</samp></dt>
  31774. <dd><p>Set the saturation value which will be used in color difference calculation.
  31775. Allowed range is from -1 to 1. Default value is 0.
  31776. </p>
  31777. </dd>
  31778. <dt><samp class="option">val</samp></dt>
  31779. <dd><p>Set the value which will be used in color difference calculation.
  31780. Allowed range is from -1 to 1. Default value is 0.
  31781. </p>
  31782. </dd>
  31783. <dt><samp class="option">similarity</samp></dt>
  31784. <dd><p>Set similarity percentage with the key color.
  31785. Allowed range is from 0 to 1. Default value is 0.01.
  31786. </p>
  31787. <p>0.00001 matches only the exact key color, while 1.0 matches everything.
  31788. </p>
  31789. </dd>
  31790. <dt><samp class="option">blend</samp></dt>
  31791. <dd><p>Blend percentage.
  31792. Allowed range is from 0 to 1. Default value is 0.
  31793. </p>
  31794. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  31795. </p>
  31796. <p>Higher values result in semi-transparent pixels, with a higher transparency
  31797. the more similar the pixels color is to the key color.
  31798. </p></dd>
  31799. </dl>
  31800. </div>
  31801. <div class="section-level-extent" id="hue">
  31802. <h3 class="section"><span>30.129 hue<a class="copiable-link" href="#hue"> &para;</a></span></h3>
  31803. <p>Modify the hue and/or the saturation of the input.
  31804. </p>
  31805. <p>It accepts the following parameters:
  31806. </p>
  31807. <dl class="table">
  31808. <dt><samp class="option">h</samp></dt>
  31809. <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
  31810. and defaults to &quot;0&quot;.
  31811. </p>
  31812. </dd>
  31813. <dt><samp class="option">s</samp></dt>
  31814. <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
  31815. defaults to &quot;1&quot;.
  31816. </p>
  31817. </dd>
  31818. <dt><samp class="option">H</samp></dt>
  31819. <dd><p>Specify the hue angle as a number of radians. It accepts an
  31820. expression, and defaults to &quot;0&quot;.
  31821. </p>
  31822. </dd>
  31823. <dt><samp class="option">b</samp></dt>
  31824. <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
  31825. defaults to &quot;0&quot;.
  31826. </p></dd>
  31827. </dl>
  31828. <p><samp class="option">h</samp> and <samp class="option">H</samp> are mutually exclusive, and can&rsquo;t be
  31829. specified at the same time.
  31830. </p>
  31831. <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
  31832. expressions containing the following constants:
  31833. </p>
  31834. <dl class="table">
  31835. <dt><samp class="option">n</samp></dt>
  31836. <dd><p>frame count of the input frame starting from 0
  31837. </p>
  31838. </dd>
  31839. <dt><samp class="option">pts</samp></dt>
  31840. <dd><p>presentation timestamp of the input frame expressed in time base units
  31841. </p>
  31842. </dd>
  31843. <dt><samp class="option">r</samp></dt>
  31844. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  31845. </p>
  31846. </dd>
  31847. <dt><samp class="option">t</samp></dt>
  31848. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  31849. </p>
  31850. </dd>
  31851. <dt><samp class="option">tb</samp></dt>
  31852. <dd><p>time base of the input video
  31853. </p></dd>
  31854. </dl>
  31855. <ul class="mini-toc">
  31856. <li><a href="#Examples-103" accesskey="1">Examples</a></li>
  31857. <li><a href="#Commands-99" accesskey="2">Commands</a></li>
  31858. </ul>
  31859. <div class="subsection-level-extent" id="Examples-103">
  31860. <h4 class="subsection"><span>30.129.1 Examples<a class="copiable-link" href="#Examples-103"> &para;</a></span></h4>
  31861. <ul class="itemize mark-bullet">
  31862. <li>Set the hue to 90 degrees and the saturation to 1.0:
  31863. <div class="example">
  31864. <pre class="example-preformatted">hue=h=90:s=1
  31865. </pre></div>
  31866. </li><li>Same command but expressing the hue in radians:
  31867. <div class="example">
  31868. <pre class="example-preformatted">hue=H=PI/2:s=1
  31869. </pre></div>
  31870. </li><li>Rotate hue and make the saturation swing between 0
  31871. and 2 over a period of 1 second:
  31872. <div class="example">
  31873. <pre class="example-preformatted">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
  31874. </pre></div>
  31875. </li><li>Apply a 3 seconds saturation fade-in effect starting at 0:
  31876. <div class="example">
  31877. <pre class="example-preformatted">hue=&quot;s=min(t/3\,1)&quot;
  31878. </pre></div>
  31879. <p>The general fade-in expression can be written as:
  31880. </p><div class="example">
  31881. <pre class="example-preformatted">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
  31882. </pre></div>
  31883. </li><li>Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
  31884. <div class="example">
  31885. <pre class="example-preformatted">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
  31886. </pre></div>
  31887. <p>The general fade-out expression can be written as:
  31888. </p><div class="example">
  31889. <pre class="example-preformatted">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
  31890. </pre></div>
  31891. </li></ul>
  31892. </div>
  31893. <div class="subsection-level-extent" id="Commands-99">
  31894. <h4 class="subsection"><span>30.129.2 Commands<a class="copiable-link" href="#Commands-99"> &para;</a></span></h4>
  31895. <p>This filter supports the following commands:
  31896. </p><dl class="table">
  31897. <dt><samp class="option">b</samp></dt>
  31898. <dt><samp class="option">s</samp></dt>
  31899. <dt><samp class="option">h</samp></dt>
  31900. <dt><samp class="option">H</samp></dt>
  31901. <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
  31902. The command accepts the same syntax of the corresponding option.
  31903. </p>
  31904. <p>If the specified expression is not valid, it is kept at its current
  31905. value.
  31906. </p></dd>
  31907. </dl>
  31908. </div>
  31909. </div>
  31910. <div class="section-level-extent" id="huesaturation">
  31911. <h3 class="section"><span>30.130 huesaturation<a class="copiable-link" href="#huesaturation"> &para;</a></span></h3>
  31912. <p>Apply hue-saturation-intensity adjustments to input video stream.
  31913. </p>
  31914. <p>This filter operates in RGB colorspace.
  31915. </p>
  31916. <p>This filter accepts the following options:
  31917. </p>
  31918. <dl class="table">
  31919. <dt><samp class="option">hue</samp></dt>
  31920. <dd><p>Set the hue shift in degrees to apply. Default is 0.
  31921. Allowed range is from -180 to 180.
  31922. </p>
  31923. </dd>
  31924. <dt><samp class="option">saturation</samp></dt>
  31925. <dd><p>Set the saturation shift. Default is 0.
  31926. Allowed range is from -1 to 1.
  31927. </p>
  31928. </dd>
  31929. <dt><samp class="option">intensity</samp></dt>
  31930. <dd><p>Set the intensity shift. Default is 0.
  31931. Allowed range is from -1 to 1.
  31932. </p>
  31933. </dd>
  31934. <dt><samp class="option">colors</samp></dt>
  31935. <dd><p>Set which primary and complementary colors are going to be adjusted.
  31936. This options is set by providing one or multiple values.
  31937. This can select multiple colors at once. By default all colors are selected.
  31938. </p><dl class="table">
  31939. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  31940. <dd><p>Adjust reds.
  31941. </p></dd>
  31942. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  31943. <dd><p>Adjust yellows.
  31944. </p></dd>
  31945. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  31946. <dd><p>Adjust greens.
  31947. </p></dd>
  31948. <dt>&lsquo;<samp class="samp">c</samp>&rsquo;</dt>
  31949. <dd><p>Adjust cyans.
  31950. </p></dd>
  31951. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  31952. <dd><p>Adjust blues.
  31953. </p></dd>
  31954. <dt>&lsquo;<samp class="samp">m</samp>&rsquo;</dt>
  31955. <dd><p>Adjust magentas.
  31956. </p></dd>
  31957. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  31958. <dd><p>Adjust all colors.
  31959. </p></dd>
  31960. </dl>
  31961. </dd>
  31962. <dt><samp class="option">strength</samp></dt>
  31963. <dd><p>Set strength of filtering. Allowed range is from 0 to 100.
  31964. Default value is 1.
  31965. </p>
  31966. </dd>
  31967. <dt><samp class="option">rw, gw, bw</samp></dt>
  31968. <dd><p>Set weight for each RGB component. Allowed range is from 0 to 1.
  31969. By default is set to 0.333, 0.334, 0.333.
  31970. Those options are used in saturation and lightess processing.
  31971. </p>
  31972. </dd>
  31973. <dt><samp class="option">lightness</samp></dt>
  31974. <dd><p>Set preserving lightness, by default is disabled.
  31975. Adjusting hues can change lightness from original RGB triplet,
  31976. with this option enabled lightness is kept at same value.
  31977. </p></dd>
  31978. </dl>
  31979. </div>
  31980. <div class="section-level-extent" id="hysteresis">
  31981. <h3 class="section"><span>30.131 hysteresis<a class="copiable-link" href="#hysteresis"> &para;</a></span></h3>
  31982. <p>Grow first stream into second stream by connecting components.
  31983. This makes it possible to build more robust edge masks.
  31984. </p>
  31985. <p>This filter accepts the following options:
  31986. </p>
  31987. <dl class="table">
  31988. <dt><samp class="option">planes</samp></dt>
  31989. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  31990. copied from first stream.
  31991. By default value 0xf, all planes will be processed.
  31992. </p>
  31993. </dd>
  31994. <dt><samp class="option">threshold</samp></dt>
  31995. <dd><p>Set threshold which is used in filtering. If pixel component value is higher than
  31996. this value filter algorithm for connecting components is activated.
  31997. By default value is 0.
  31998. </p></dd>
  31999. </dl>
  32000. <p>The <code class="code">hysteresis</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  32001. </p>
  32002. </div>
  32003. <div class="section-level-extent" id="iccdetect">
  32004. <h3 class="section"><span>30.132 iccdetect<a class="copiable-link" href="#iccdetect"> &para;</a></span></h3>
  32005. <p>Detect the colorspace from an embedded ICC profile (if present), and update
  32006. the frame&rsquo;s tags accordingly.
  32007. </p>
  32008. <p>This filter accepts the following options:
  32009. </p>
  32010. <dl class="table">
  32011. <dt><samp class="option">force</samp></dt>
  32012. <dd><p>If true, the frame&rsquo;s existing colorspace tags will always be overridden by
  32013. values detected from an ICC profile. Otherwise, they will only be assigned if
  32014. they contain <code class="code">unknown</code>. Enabled by default.
  32015. </p></dd>
  32016. </dl>
  32017. </div>
  32018. <div class="section-level-extent" id="iccgen">
  32019. <h3 class="section"><span>30.133 iccgen<a class="copiable-link" href="#iccgen"> &para;</a></span></h3>
  32020. <p>Generate ICC profiles and attach them to frames.
  32021. </p>
  32022. <p>This filter accepts the following options:
  32023. </p>
  32024. <dl class="table">
  32025. <dt><samp class="option">color_primaries</samp></dt>
  32026. <dt><samp class="option">color_trc</samp></dt>
  32027. <dd><p>Configure the colorspace that the ICC profile will be generated for. The
  32028. default value of <code class="code">auto</code> infers the value from the input frame&rsquo;s metadata,
  32029. defaulting to BT.709/sRGB as appropriate.
  32030. </p>
  32031. <p>See the <a class="ref" href="#setparams">setparams</a> filter for a list of possible values, but note that
  32032. <code class="code">unknown</code> are not valid values for this filter.
  32033. </p>
  32034. </dd>
  32035. <dt><samp class="option">force</samp></dt>
  32036. <dd><p>If true, an ICC profile will be generated even if it would overwrite an
  32037. already existing ICC profile. Disabled by default.
  32038. </p></dd>
  32039. </dl>
  32040. </div>
  32041. <div class="section-level-extent" id="identity">
  32042. <h3 class="section"><span>30.134 identity<a class="copiable-link" href="#identity"> &para;</a></span></h3>
  32043. <p>Obtain the identity score between two input videos.
  32044. </p>
  32045. <p>This filter takes two input videos.
  32046. </p>
  32047. <p>Both input videos must have the same resolution and pixel format for
  32048. this filter to work correctly. Also it assumes that both inputs
  32049. have the same number of frames, which are compared one by one.
  32050. </p>
  32051. <p>The obtained per component, average, min and max identity score is printed through
  32052. the logging system.
  32053. </p>
  32054. <p>The filter stores the calculated identity scores of each frame in frame metadata.
  32055. </p>
  32056. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  32057. </p>
  32058. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  32059. with the reference file <samp class="file">ref.mpg</samp>.
  32060. </p>
  32061. <div class="example">
  32062. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi identity -f null -
  32063. </pre></div>
  32064. </div>
  32065. <div class="section-level-extent" id="idet">
  32066. <h3 class="section"><span>30.135 idet<a class="copiable-link" href="#idet"> &para;</a></span></h3>
  32067. <p>Detect video interlacing type.
  32068. </p>
  32069. <p>This filter tries to detect if the input frames are interlaced, progressive,
  32070. top or bottom field first. It will also try to detect fields that are
  32071. repeated between adjacent frames (a sign of telecine).
  32072. </p>
  32073. <p>Single frame detection considers only immediately adjacent frames when classifying each frame.
  32074. Multiple frame detection incorporates the classification history of previous frames.
  32075. </p>
  32076. <p>The filter will log these metadata values:
  32077. </p>
  32078. <dl class="table">
  32079. <dt><samp class="option">single.current_frame</samp></dt>
  32080. <dd><p>Detected type of current frame using single-frame detection. One of:
  32081. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  32082. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  32083. </p>
  32084. </dd>
  32085. <dt><samp class="option">single.tff</samp></dt>
  32086. <dd><p>Cumulative number of frames detected as top field first using single-frame detection.
  32087. </p>
  32088. </dd>
  32089. <dt><samp class="option">multiple.tff</samp></dt>
  32090. <dd><p>Cumulative number of frames detected as top field first using multiple-frame detection.
  32091. </p>
  32092. </dd>
  32093. <dt><samp class="option">single.bff</samp></dt>
  32094. <dd><p>Cumulative number of frames detected as bottom field first using single-frame detection.
  32095. </p>
  32096. </dd>
  32097. <dt><samp class="option">multiple.current_frame</samp></dt>
  32098. <dd><p>Detected type of current frame using multiple-frame detection. One of:
  32099. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  32100. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  32101. </p>
  32102. </dd>
  32103. <dt><samp class="option">multiple.bff</samp></dt>
  32104. <dd><p>Cumulative number of frames detected as bottom field first using multiple-frame detection.
  32105. </p>
  32106. </dd>
  32107. <dt><samp class="option">single.progressive</samp></dt>
  32108. <dd><p>Cumulative number of frames detected as progressive using single-frame detection.
  32109. </p>
  32110. </dd>
  32111. <dt><samp class="option">multiple.progressive</samp></dt>
  32112. <dd><p>Cumulative number of frames detected as progressive using multiple-frame detection.
  32113. </p>
  32114. </dd>
  32115. <dt><samp class="option">single.undetermined</samp></dt>
  32116. <dd><p>Cumulative number of frames that could not be classified using single-frame detection.
  32117. </p>
  32118. </dd>
  32119. <dt><samp class="option">multiple.undetermined</samp></dt>
  32120. <dd><p>Cumulative number of frames that could not be classified using multiple-frame detection.
  32121. </p>
  32122. </dd>
  32123. <dt><samp class="option">repeated.current_frame</samp></dt>
  32124. <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;.
  32125. </p>
  32126. </dd>
  32127. <dt><samp class="option">repeated.neither</samp></dt>
  32128. <dd><p>Cumulative number of frames with no repeated field.
  32129. </p>
  32130. </dd>
  32131. <dt><samp class="option">repeated.top</samp></dt>
  32132. <dd><p>Cumulative number of frames with the top field repeated from the previous frame&rsquo;s top field.
  32133. </p>
  32134. </dd>
  32135. <dt><samp class="option">repeated.bottom</samp></dt>
  32136. <dd><p>Cumulative number of frames with the bottom field repeated from the previous frame&rsquo;s bottom field.
  32137. </p></dd>
  32138. </dl>
  32139. <p>The filter accepts the following options:
  32140. </p>
  32141. <dl class="table">
  32142. <dt><samp class="option">intl_thres</samp></dt>
  32143. <dd><p>Set interlacing threshold.
  32144. </p></dd>
  32145. <dt><samp class="option">prog_thres</samp></dt>
  32146. <dd><p>Set progressive threshold.
  32147. </p></dd>
  32148. <dt><samp class="option">rep_thres</samp></dt>
  32149. <dd><p>Threshold for repeated field detection.
  32150. </p></dd>
  32151. <dt><samp class="option">half_life</samp></dt>
  32152. <dd><p>Number of frames after which a given frame&rsquo;s contribution to the
  32153. statistics is halved (i.e., it contributes only 0.5 to its
  32154. classification). The default of 0 means that all frames seen are given
  32155. full weight of 1.0 forever.
  32156. </p></dd>
  32157. <dt><samp class="option">analyze_interlaced_flag</samp></dt>
  32158. <dd><p>When this is not 0 then idet will use the specified number of frames to determine
  32159. if the interlaced flag is accurate, it will not count undetermined frames.
  32160. If the flag is found to be accurate it will be used without any further
  32161. computations, if it is found to be inaccurate it will be cleared without any
  32162. further computations. This allows inserting the idet filter as a low computational
  32163. method to clean up the interlaced flag
  32164. </p></dd>
  32165. </dl>
  32166. <ul class="mini-toc">
  32167. <li><a href="#Examples-104" accesskey="1">Examples</a></li>
  32168. </ul>
  32169. <div class="subsection-level-extent" id="Examples-104">
  32170. <h4 class="subsection"><span>30.135.1 Examples<a class="copiable-link" href="#Examples-104"> &para;</a></span></h4>
  32171. <p>Inspect the field order of the first 360 frames in a video, in verbose detail:
  32172. </p><div class="example">
  32173. <pre class="example-preformatted">ffmpeg -i INPUT -filter:v idet,metadata=mode=print -frames:v 360 -an -f null -
  32174. </pre></div>
  32175. <p>The idet filter will add analysis metadata to each frame, which will then be
  32176. discarded. At the end, the filter will also print a final report with statistics.
  32177. </p>
  32178. </div>
  32179. </div>
  32180. <div class="section-level-extent" id="il">
  32181. <h3 class="section"><span>30.136 il<a class="copiable-link" href="#il"> &para;</a></span></h3>
  32182. <p>Deinterleave or interleave fields.
  32183. </p>
  32184. <p>This filter allows one to process interlaced images fields without
  32185. deinterlacing them. Deinterleaving splits the input frame into 2
  32186. fields (so called half pictures). Odd lines are moved to the top
  32187. half of the output image, even lines to the bottom half.
  32188. You can process (filter) them independently and then re-interleave them.
  32189. </p>
  32190. <p>The filter accepts the following options:
  32191. </p>
  32192. <dl class="table">
  32193. <dt><samp class="option">luma_mode, l</samp></dt>
  32194. <dt><samp class="option">chroma_mode, c</samp></dt>
  32195. <dt><samp class="option">alpha_mode, a</samp></dt>
  32196. <dd><p>Available values for <var class="var">luma_mode</var>, <var class="var">chroma_mode</var> and
  32197. <var class="var">alpha_mode</var> are:
  32198. </p>
  32199. <dl class="table">
  32200. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  32201. <dd><p>Do nothing.
  32202. </p>
  32203. </dd>
  32204. <dt>&lsquo;<samp class="samp">deinterleave, d</samp>&rsquo;</dt>
  32205. <dd><p>Deinterleave fields, placing one above the other.
  32206. </p>
  32207. </dd>
  32208. <dt>&lsquo;<samp class="samp">interleave, i</samp>&rsquo;</dt>
  32209. <dd><p>Interleave fields. Reverse the effect of deinterleaving.
  32210. </p></dd>
  32211. </dl>
  32212. <p>Default value is <code class="code">none</code>.
  32213. </p>
  32214. </dd>
  32215. <dt><samp class="option">luma_swap, ls</samp></dt>
  32216. <dt><samp class="option">chroma_swap, cs</samp></dt>
  32217. <dt><samp class="option">alpha_swap, as</samp></dt>
  32218. <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code class="code">0</code>.
  32219. </p></dd>
  32220. </dl>
  32221. <ul class="mini-toc">
  32222. <li><a href="#Commands-100" accesskey="1">Commands</a></li>
  32223. </ul>
  32224. <div class="subsection-level-extent" id="Commands-100">
  32225. <h4 class="subsection"><span>30.136.1 Commands<a class="copiable-link" href="#Commands-100"> &para;</a></span></h4>
  32226. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32227. </p>
  32228. </div>
  32229. </div>
  32230. <div class="section-level-extent" id="inflate">
  32231. <h3 class="section"><span>30.137 inflate<a class="copiable-link" href="#inflate"> &para;</a></span></h3>
  32232. <p>Apply inflate effect to the video.
  32233. </p>
  32234. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  32235. only values higher than the pixel.
  32236. </p>
  32237. <p>It accepts the following options:
  32238. </p>
  32239. <dl class="table">
  32240. <dt><samp class="option">threshold0</samp></dt>
  32241. <dt><samp class="option">threshold1</samp></dt>
  32242. <dt><samp class="option">threshold2</samp></dt>
  32243. <dt><samp class="option">threshold3</samp></dt>
  32244. <dd><p>Limit the maximum change for each plane, default is 65535.
  32245. If 0, plane will remain unchanged.
  32246. </p></dd>
  32247. </dl>
  32248. <ul class="mini-toc">
  32249. <li><a href="#Commands-101" accesskey="1">Commands</a></li>
  32250. </ul>
  32251. <div class="subsection-level-extent" id="Commands-101">
  32252. <h4 class="subsection"><span>30.137.1 Commands<a class="copiable-link" href="#Commands-101"> &para;</a></span></h4>
  32253. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32254. </p>
  32255. </div>
  32256. </div>
  32257. <div class="section-level-extent" id="interlace">
  32258. <h3 class="section"><span>30.138 interlace<a class="copiable-link" href="#interlace"> &para;</a></span></h3>
  32259. <p>Simple interlacing filter from progressive contents. This interleaves upper (or
  32260. lower) lines from odd frames with lower (or upper) lines from even frames,
  32261. halving the frame rate and preserving image height.
  32262. </p>
  32263. <div class="example">
  32264. <pre class="example-preformatted"> Original Original New Frame
  32265. Frame 'j' Frame 'j+1' (tff)
  32266. ========== =========== ==================
  32267. Line 0 --------------------&gt; Frame 'j' Line 0
  32268. Line 1 Line 1 ----&gt; Frame 'j+1' Line 1
  32269. Line 2 ---------------------&gt; Frame 'j' Line 2
  32270. Line 3 Line 3 ----&gt; Frame 'j+1' Line 3
  32271. ... ... ...
  32272. New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
  32273. </pre></div>
  32274. <p>It accepts the following optional parameters:
  32275. </p>
  32276. <dl class="table">
  32277. <dt><samp class="option">scan</samp></dt>
  32278. <dd><p>This determines whether the interlaced frame is taken from the even
  32279. (tff - default) or odd (bff) lines of the progressive frame.
  32280. </p>
  32281. </dd>
  32282. <dt><samp class="option">lowpass</samp></dt>
  32283. <dd><p>Vertical lowpass filter to avoid twitter interlacing and
  32284. reduce moire patterns.
  32285. </p>
  32286. <dl class="table">
  32287. <dt>&lsquo;<samp class="samp">0, off</samp>&rsquo;</dt>
  32288. <dd><p>Disable vertical lowpass filter
  32289. </p>
  32290. </dd>
  32291. <dt>&lsquo;<samp class="samp">1, linear</samp>&rsquo;</dt>
  32292. <dd><p>Enable linear filter (default)
  32293. </p>
  32294. </dd>
  32295. <dt>&lsquo;<samp class="samp">2, complex</samp>&rsquo;</dt>
  32296. <dd><p>Enable complex filter. This will slightly less reduce twitter and moire
  32297. but better retain detail and subjective sharpness impression.
  32298. </p>
  32299. </dd>
  32300. </dl>
  32301. </dd>
  32302. </dl>
  32303. </div>
  32304. <div class="section-level-extent" id="kerndeint">
  32305. <h3 class="section"><span>30.139 kerndeint<a class="copiable-link" href="#kerndeint"> &para;</a></span></h3>
  32306. <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
  32307. deinterling. Work on interlaced parts of a video to produce
  32308. progressive frames.
  32309. </p>
  32310. <p>The description of the accepted parameters follows.
  32311. </p>
  32312. <dl class="table">
  32313. <dt><samp class="option">thresh</samp></dt>
  32314. <dd><p>Set the threshold which affects the filter&rsquo;s tolerance when
  32315. determining if a pixel line must be processed. It must be an integer
  32316. in the range [0,255] and defaults to 10. A value of 0 will result in
  32317. applying the process on every pixels.
  32318. </p>
  32319. </dd>
  32320. <dt><samp class="option">map</samp></dt>
  32321. <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
  32322. Default is 0.
  32323. </p>
  32324. </dd>
  32325. <dt><samp class="option">order</samp></dt>
  32326. <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
  32327. 0. Default is 0.
  32328. </p>
  32329. </dd>
  32330. <dt><samp class="option">sharp</samp></dt>
  32331. <dd><p>Enable additional sharpening if set to 1. Default is 0.
  32332. </p>
  32333. </dd>
  32334. <dt><samp class="option">twoway</samp></dt>
  32335. <dd><p>Enable twoway sharpening if set to 1. Default is 0.
  32336. </p></dd>
  32337. </dl>
  32338. <ul class="mini-toc">
  32339. <li><a href="#Examples-105" accesskey="1">Examples</a></li>
  32340. </ul>
  32341. <div class="subsection-level-extent" id="Examples-105">
  32342. <h4 class="subsection"><span>30.139.1 Examples<a class="copiable-link" href="#Examples-105"> &para;</a></span></h4>
  32343. <ul class="itemize mark-bullet">
  32344. <li>Apply default values:
  32345. <div class="example">
  32346. <pre class="example-preformatted">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
  32347. </pre></div>
  32348. </li><li>Enable additional sharpening:
  32349. <div class="example">
  32350. <pre class="example-preformatted">kerndeint=sharp=1
  32351. </pre></div>
  32352. </li><li>Paint processed pixels in white:
  32353. <div class="example">
  32354. <pre class="example-preformatted">kerndeint=map=1
  32355. </pre></div>
  32356. </li></ul>
  32357. </div>
  32358. </div>
  32359. <div class="section-level-extent" id="kirsch">
  32360. <h3 class="section"><span>30.140 kirsch<a class="copiable-link" href="#kirsch"> &para;</a></span></h3>
  32361. <p>Apply kirsch operator to input video stream.
  32362. </p>
  32363. <p>The filter accepts the following option:
  32364. </p>
  32365. <dl class="table">
  32366. <dt><samp class="option">planes</samp></dt>
  32367. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  32368. By default value 0xf, all planes will be processed.
  32369. </p>
  32370. </dd>
  32371. <dt><samp class="option">scale</samp></dt>
  32372. <dd><p>Set value which will be multiplied with filtered result.
  32373. </p>
  32374. </dd>
  32375. <dt><samp class="option">delta</samp></dt>
  32376. <dd><p>Set value which will be added to filtered result.
  32377. </p></dd>
  32378. </dl>
  32379. <ul class="mini-toc">
  32380. <li><a href="#Commands-102" accesskey="1">Commands</a></li>
  32381. </ul>
  32382. <div class="subsection-level-extent" id="Commands-102">
  32383. <h4 class="subsection"><span>30.140.1 Commands<a class="copiable-link" href="#Commands-102"> &para;</a></span></h4>
  32384. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32385. </p>
  32386. </div>
  32387. </div>
  32388. <div class="section-level-extent" id="lagfun">
  32389. <h3 class="section"><span>30.141 lagfun<a class="copiable-link" href="#lagfun"> &para;</a></span></h3>
  32390. <p>Slowly update darker pixels.
  32391. </p>
  32392. <p>This filter makes short flashes of light appear longer.
  32393. This filter accepts the following options:
  32394. </p>
  32395. <dl class="table">
  32396. <dt><samp class="option">decay</samp></dt>
  32397. <dd><p>Set factor for decaying. Default is .95. Allowed range is from 0 to 1.
  32398. </p>
  32399. </dd>
  32400. <dt><samp class="option">planes</samp></dt>
  32401. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  32402. </p></dd>
  32403. </dl>
  32404. <ul class="mini-toc">
  32405. <li><a href="#Commands-103" accesskey="1">Commands</a></li>
  32406. </ul>
  32407. <div class="subsection-level-extent" id="Commands-103">
  32408. <h4 class="subsection"><span>30.141.1 Commands<a class="copiable-link" href="#Commands-103"> &para;</a></span></h4>
  32409. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32410. </p>
  32411. </div>
  32412. </div>
  32413. <div class="section-level-extent" id="lenscorrection">
  32414. <h3 class="section"><span>30.142 lenscorrection<a class="copiable-link" href="#lenscorrection"> &para;</a></span></h3>
  32415. <p>Correct radial lens distortion
  32416. </p>
  32417. <p>This filter can be used to correct for radial distortion as can result from the use
  32418. of wide angle lenses, and thereby re-rectify the image. To find the right parameters
  32419. one can use tools available for example as part of opencv or simply trial-and-error.
  32420. To use opencv use the calibration sample (under samples/cpp) from the opencv sources
  32421. and extract the k1 and k2 coefficients from the resulting matrix.
  32422. </p>
  32423. <p>Note that effectively the same filter is available in the open-source tools Krita and
  32424. Digikam from the KDE project.
  32425. </p>
  32426. <p>In contrast to the <a class="ref" href="#vignette">vignette</a> filter, which can also be used to compensate lens errors,
  32427. this filter corrects the distortion of the image, whereas <a class="ref" href="#vignette">vignette</a> corrects the
  32428. brightness distribution, so you may want to use both filters together in certain
  32429. cases, though you will have to take care of ordering, i.e. whether vignetting should
  32430. be applied before or after lens correction.
  32431. </p>
  32432. <ul class="mini-toc">
  32433. <li><a href="#Options-37" accesskey="1">Options</a></li>
  32434. <li><a href="#Commands-104" accesskey="2">Commands</a></li>
  32435. </ul>
  32436. <div class="subsection-level-extent" id="Options-37">
  32437. <h4 class="subsection"><span>30.142.1 Options<a class="copiable-link" href="#Options-37"> &para;</a></span></h4>
  32438. <p>The filter accepts the following options:
  32439. </p>
  32440. <dl class="table">
  32441. <dt><samp class="option">cx</samp></dt>
  32442. <dd><p>Relative x-coordinate of the focal point of the image, and thereby the center of the
  32443. distortion. This value has a range [0,1] and is expressed as fractions of the image
  32444. width. Default is 0.5.
  32445. </p></dd>
  32446. <dt><samp class="option">cy</samp></dt>
  32447. <dd><p>Relative y-coordinate of the focal point of the image, and thereby the center of the
  32448. distortion. This value has a range [0,1] and is expressed as fractions of the image
  32449. height. Default is 0.5.
  32450. </p></dd>
  32451. <dt><samp class="option">k1</samp></dt>
  32452. <dd><p>Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means
  32453. no correction. Default is 0.
  32454. </p></dd>
  32455. <dt><samp class="option">k2</samp></dt>
  32456. <dd><p>Coefficient of the double quadratic correction term. This value has a range [-1,1].
  32457. 0 means no correction. Default is 0.
  32458. </p></dd>
  32459. <dt><samp class="option">i</samp></dt>
  32460. <dd><p>Set interpolation type. Can be <code class="code">nearest</code> or <code class="code">bilinear</code>.
  32461. Default is <code class="code">nearest</code>.
  32462. </p></dd>
  32463. <dt><samp class="option">fc</samp></dt>
  32464. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  32465. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  32466. manual</a>. Default color is <code class="code">black@0</code>.
  32467. </p></dd>
  32468. </dl>
  32469. <p>The formula that generates the correction is:
  32470. </p>
  32471. <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)
  32472. </p>
  32473. <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
  32474. distances from the focal point in the source and target images, respectively.
  32475. </p>
  32476. </div>
  32477. <div class="subsection-level-extent" id="Commands-104">
  32478. <h4 class="subsection"><span>30.142.2 Commands<a class="copiable-link" href="#Commands-104"> &para;</a></span></h4>
  32479. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32480. </p>
  32481. </div>
  32482. </div>
  32483. <div class="section-level-extent" id="lensfun">
  32484. <h3 class="section"><span>30.143 lensfun<a class="copiable-link" href="#lensfun"> &para;</a></span></h3>
  32485. <p>Apply lens correction via the lensfun library (<a class="url" href="http://lensfun.sourceforge.net/">http://lensfun.sourceforge.net/</a>).
  32486. </p>
  32487. <p>The <code class="code">lensfun</code> filter requires the camera make, camera model, and lens model
  32488. to apply the lens correction. The filter will load the lensfun database and
  32489. query it to find the corresponding camera and lens entries in the database. As
  32490. long as these entries can be found with the given options, the filter can
  32491. perform corrections on frames. Note that incomplete strings will result in the
  32492. filter choosing the best match with the given options, and the filter will
  32493. output the chosen camera and lens models (logged with level &quot;info&quot;). You must
  32494. provide the make, camera model, and lens model as they are required.
  32495. </p>
  32496. <p>To obtain a list of available makes and models, leave out one or both of <code class="code">make</code> and
  32497. <code class="code">model</code> options. The filter will send the full list to the log with level <code class="code">INFO</code>.
  32498. The first column is the make and the second column is the model.
  32499. To obtain a list of available lenses, set any values for make and model and leave out the
  32500. <code class="code">lens_model</code> option. The filter will send the full list of lenses in the log with level
  32501. <code class="code">INFO</code>. The ffmpeg tool will exit after the list is printed.
  32502. </p>
  32503. <p>The filter accepts the following options:
  32504. </p>
  32505. <dl class="table">
  32506. <dt><samp class="option">make</samp></dt>
  32507. <dd><p>The make of the camera (for example, &quot;Canon&quot;). This option is required.
  32508. </p>
  32509. </dd>
  32510. <dt><samp class="option">model</samp></dt>
  32511. <dd><p>The model of the camera (for example, &quot;Canon EOS 100D&quot;). This option is
  32512. required.
  32513. </p>
  32514. </dd>
  32515. <dt><samp class="option">lens_model</samp></dt>
  32516. <dd><p>The model of the lens (for example, &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;). This
  32517. option is required.
  32518. </p>
  32519. </dd>
  32520. <dt><samp class="option">db_path</samp></dt>
  32521. <dd><p>The full path to the lens database folder. If not set, the filter will attempt to
  32522. load the database from the install path when the library was built. Default is unset.
  32523. </p>
  32524. </dd>
  32525. <dt><samp class="option">mode</samp></dt>
  32526. <dd><p>The type of correction to apply. The following values are valid options:
  32527. </p>
  32528. <dl class="table">
  32529. <dt>&lsquo;<samp class="samp">vignetting</samp>&rsquo;</dt>
  32530. <dd><p>Enables fixing lens vignetting.
  32531. </p>
  32532. </dd>
  32533. <dt>&lsquo;<samp class="samp">geometry</samp>&rsquo;</dt>
  32534. <dd><p>Enables fixing lens geometry. This is the default.
  32535. </p>
  32536. </dd>
  32537. <dt>&lsquo;<samp class="samp">subpixel</samp>&rsquo;</dt>
  32538. <dd><p>Enables fixing chromatic aberrations.
  32539. </p>
  32540. </dd>
  32541. <dt>&lsquo;<samp class="samp">vig_geo</samp>&rsquo;</dt>
  32542. <dd><p>Enables fixing lens vignetting and lens geometry.
  32543. </p>
  32544. </dd>
  32545. <dt>&lsquo;<samp class="samp">vig_subpixel</samp>&rsquo;</dt>
  32546. <dd><p>Enables fixing lens vignetting and chromatic aberrations.
  32547. </p>
  32548. </dd>
  32549. <dt>&lsquo;<samp class="samp">distortion</samp>&rsquo;</dt>
  32550. <dd><p>Enables fixing both lens geometry and chromatic aberrations.
  32551. </p>
  32552. </dd>
  32553. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  32554. <dd><p>Enables all possible corrections.
  32555. </p>
  32556. </dd>
  32557. </dl>
  32558. </dd>
  32559. <dt><samp class="option">focal_length</samp></dt>
  32560. <dd><p>The focal length of the image/video (zoom; expected constant for video). For
  32561. example, a 18&ndash;55mm lens has focal length range of [18&ndash;55], so a value in that
  32562. range should be chosen when using that lens. Default 18.
  32563. </p>
  32564. </dd>
  32565. <dt><samp class="option">aperture</samp></dt>
  32566. <dd><p>The aperture of the image/video (expected constant for video). Note that
  32567. aperture is only used for vignetting correction. Default 3.5.
  32568. </p>
  32569. </dd>
  32570. <dt><samp class="option">focus_distance</samp></dt>
  32571. <dd><p>The focus distance of the image/video (expected constant for video). Note that
  32572. focus distance is only used for vignetting and only slightly affects the
  32573. vignetting correction process. If unknown, leave it at the default value (which
  32574. is 1000).
  32575. </p>
  32576. </dd>
  32577. <dt><samp class="option">scale</samp></dt>
  32578. <dd><p>The scale factor which is applied after transformation. After correction the
  32579. video is no longer necessarily rectangular. This parameter controls how much of
  32580. the resulting image is visible. The value 0 means that a value will be chosen
  32581. automatically such that there is little or no unmapped area in the output
  32582. image. 1.0 means that no additional scaling is done. Lower values may result
  32583. in more of the corrected image being visible, while higher values may avoid
  32584. unmapped areas in the output.
  32585. </p>
  32586. </dd>
  32587. <dt><samp class="option">target_geometry</samp></dt>
  32588. <dd><p>The target geometry of the output image/video. The following values are valid
  32589. options:
  32590. </p>
  32591. <dl class="table">
  32592. <dt>&lsquo;<samp class="samp">rectilinear (default)</samp>&rsquo;</dt>
  32593. <dt>&lsquo;<samp class="samp">fisheye</samp>&rsquo;</dt>
  32594. <dt>&lsquo;<samp class="samp">panoramic</samp>&rsquo;</dt>
  32595. <dt>&lsquo;<samp class="samp">equirectangular</samp>&rsquo;</dt>
  32596. <dt>&lsquo;<samp class="samp">fisheye_orthographic</samp>&rsquo;</dt>
  32597. <dt>&lsquo;<samp class="samp">fisheye_stereographic</samp>&rsquo;</dt>
  32598. <dt>&lsquo;<samp class="samp">fisheye_equisolid</samp>&rsquo;</dt>
  32599. <dt>&lsquo;<samp class="samp">fisheye_thoby</samp>&rsquo;</dt>
  32600. </dl>
  32601. </dd>
  32602. <dt><samp class="option">reverse</samp></dt>
  32603. <dd><p>Apply the reverse of image correction (instead of correcting distortion, apply
  32604. it).
  32605. </p>
  32606. </dd>
  32607. <dt><samp class="option">interpolation</samp></dt>
  32608. <dd><p>The type of interpolation used when correcting distortion. The following values
  32609. are valid options:
  32610. </p>
  32611. <dl class="table">
  32612. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  32613. <dt>&lsquo;<samp class="samp">linear (default)</samp>&rsquo;</dt>
  32614. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  32615. </dl>
  32616. </dd>
  32617. </dl>
  32618. <ul class="mini-toc">
  32619. <li><a href="#Examples-106" accesskey="1">Examples</a></li>
  32620. </ul>
  32621. <div class="subsection-level-extent" id="Examples-106">
  32622. <h4 class="subsection"><span>30.143.1 Examples<a class="copiable-link" href="#Examples-106"> &para;</a></span></h4>
  32623. <ul class="itemize mark-bullet">
  32624. <li>Apply lens correction with make &quot;Canon&quot;, camera model &quot;Canon EOS 100D&quot;, and lens
  32625. model &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot; with focal length of &quot;18&quot; and
  32626. aperture of &quot;8.0&quot;.
  32627. <div class="example">
  32628. <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
  32629. </pre></div>
  32630. </li><li>Apply the same as before, but only for the first 5 seconds of video.
  32631. <div class="example">
  32632. <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
  32633. </pre></div>
  32634. </li></ul>
  32635. </div>
  32636. </div>
  32637. <div class="section-level-extent" id="libplacebo">
  32638. <h3 class="section"><span>30.144 libplacebo<a class="copiable-link" href="#libplacebo"> &para;</a></span></h3>
  32639. <p>Flexible GPU-accelerated processing filter based on libplacebo
  32640. (<a class="url" href="https://code.videolan.org/videolan/libplacebo">https://code.videolan.org/videolan/libplacebo</a>).
  32641. </p>
  32642. <ul class="mini-toc">
  32643. <li><a href="#Options-38" accesskey="1">Options</a></li>
  32644. <li><a href="#Commands-105" accesskey="2">Commands</a></li>
  32645. <li><a href="#Examples-107" accesskey="3">Examples</a></li>
  32646. </ul>
  32647. <div class="subsection-level-extent" id="Options-38">
  32648. <h4 class="subsection"><span>30.144.1 Options<a class="copiable-link" href="#Options-38"> &para;</a></span></h4>
  32649. <p>The options for this filter are divided into the following sections:
  32650. </p>
  32651. <ul class="mini-toc">
  32652. <li><a href="#Output-mode" accesskey="1">Output mode</a></li>
  32653. <li><a href="#Scaling" accesskey="2">Scaling</a></li>
  32654. <li><a href="#Debanding" accesskey="3">Debanding</a></li>
  32655. <li><a href="#Color-adjustment" accesskey="4">Color adjustment</a></li>
  32656. <li><a href="#Peak-detection" accesskey="5">Peak detection</a></li>
  32657. <li><a href="#Tone-mapping" accesskey="6">Tone mapping</a></li>
  32658. <li><a href="#Dithering" accesskey="7">Dithering</a></li>
  32659. <li><a href="#Custom-shaders" accesskey="8">Custom shaders</a></li>
  32660. <li><a href="#Debugging-_002f-performance" accesskey="9">Debugging / performance</a></li>
  32661. </ul>
  32662. <div class="subsubsection-level-extent" id="Output-mode">
  32663. <h4 class="subsubsection"><span>30.144.1.1 Output mode<a class="copiable-link" href="#Output-mode"> &para;</a></span></h4>
  32664. <p>These options control the overall output mode. By default, libplacebo will try
  32665. to preserve the source colorimetry and size as best as it can, but it will
  32666. apply any embedded film grain, dolby vision metadata or anamorphic SAR present
  32667. in source frames.
  32668. </p><dl class="table">
  32669. <dt><samp class="option">inputs</samp></dt>
  32670. <dd><p>Set the number of inputs. This can be used, alongside the <code class="code">idx</code> variable,
  32671. to allow placing/blending multiple inputs inside the output frame. This
  32672. effectively enables functionality similar to <a class="ref" href="#hstack">hstack</a>, <a class="ref" href="#overlay">overlay</a>, etc.
  32673. </p>
  32674. </dd>
  32675. <dt><samp class="option">w</samp></dt>
  32676. <dt><samp class="option">h</samp></dt>
  32677. <dd><p>Set the output video dimension expression. Default values are <code class="code">iw</code> and
  32678. <code class="code">ih</code>.
  32679. </p>
  32680. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  32681. </p>
  32682. </dd>
  32683. <dt><samp class="option">crop_x</samp></dt>
  32684. <dt><samp class="option">crop_y</samp></dt>
  32685. <dd><p>Set the input crop x/y expressions, default values are <code class="code">(iw-cw)/2</code> and
  32686. <code class="code">(ih-ch)/2</code>.
  32687. </p>
  32688. </dd>
  32689. <dt><samp class="option">crop_w</samp></dt>
  32690. <dt><samp class="option">crop_h</samp></dt>
  32691. <dd><p>Set the input crop width/height expressions, default values are <code class="code">iw</code> and
  32692. <code class="code">ih</code>.
  32693. </p>
  32694. </dd>
  32695. <dt><samp class="option">pos_x</samp></dt>
  32696. <dt><samp class="option">pos_y</samp></dt>
  32697. <dd><p>Set the output placement x/y expressions, default values are <code class="code">(ow-pw)/2</code>
  32698. and <code class="code">(oh-ph)/2</code>.
  32699. </p>
  32700. </dd>
  32701. <dt><samp class="option">pos_w</samp></dt>
  32702. <dt><samp class="option">pos_h</samp></dt>
  32703. <dd><p>Set the output placement width/height expressions, default values are <code class="code">ow</code>
  32704. and <code class="code">oh</code>.
  32705. </p>
  32706. </dd>
  32707. <dt><samp class="option">fps</samp></dt>
  32708. <dd><p>Set the output frame rate. This can be rational, e.g. <code class="code">60000/1001</code>. If
  32709. set to the special string <code class="code">none</code> (the default), input timestamps will
  32710. instead be passed through to the output unmodified. Otherwise, the input video
  32711. frames will be interpolated as necessary to rescale the video to the specified
  32712. target framerate, in a manner as determined by the <samp class="option">frame_mixer</samp> option.
  32713. </p>
  32714. </dd>
  32715. <dt><samp class="option">format</samp></dt>
  32716. <dd><p>Set the output format override. If unset (the default), frames will be output
  32717. in the same format as the respective input frames. Otherwise, format conversion
  32718. will be performed.
  32719. </p>
  32720. </dd>
  32721. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  32722. <dt><samp class="option">force_divisible_by</samp></dt>
  32723. <dd><p>Work the same as the identical <a class="ref" href="#scale">scale</a> filter options.
  32724. </p>
  32725. </dd>
  32726. <dt><samp class="option">normalize_sar</samp></dt>
  32727. <dd><p>If enabled, output frames will always have a pixel aspect ratio of 1:1. This
  32728. will introduce additional padding/cropping as necessary. If disabled (the
  32729. default), any aspect ratio mismatches, including those from e.g. anamorphic
  32730. video sources, are forwarded to the output pixel aspect ratio.
  32731. </p>
  32732. </dd>
  32733. <dt><samp class="option">pad_crop_ratio</samp></dt>
  32734. <dd><p>Specifies a ratio (between <code class="code">0.0</code> and <code class="code">1.0</code>) between padding and
  32735. cropping when the input aspect ratio does not match the output aspect ratio and
  32736. <samp class="option">normalize_sar</samp> is in effect. The default of <code class="code">0.0</code> always pads the
  32737. content with black borders, while a value of <code class="code">1.0</code> always crops off parts
  32738. of the content. Intermediate values are possible, leading to a mix of the two
  32739. approaches.
  32740. </p>
  32741. </dd>
  32742. <dt><samp class="option">fillcolor</samp></dt>
  32743. <dd><p>Set the color used to fill the output area not covered by the output image, for
  32744. example as a result of <samp class="option">normalize_sar</samp>. For the general syntax of this
  32745. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  32746. manual</a>. Defaults to <code class="code">black</code>.
  32747. </p>
  32748. </dd>
  32749. <dt><samp class="option">corner_rounding</samp></dt>
  32750. <dd><p>Render frames with rounded corners. The value, given as a float ranging from
  32751. <code class="code">0.0</code> to <code class="code">1.0</code>, indicates the relative degree of rounding, from fully
  32752. square to fully circular. In other words, it gives the radius divided by half
  32753. the smaller side length. Defaults to <code class="code">0.0</code>.
  32754. </p>
  32755. </dd>
  32756. <dt><samp class="option">extra_opts</samp></dt>
  32757. <dd><p>Pass extra libplacebo internal configuration options. These can be specified
  32758. as a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;. The following example
  32759. shows how to configure a custom filter kernel (&quot;EWA LanczosSharp&quot;) and use it
  32760. to double the input image resolution:
  32761. </p>
  32762. <div class="example">
  32763. <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;
  32764. </pre></div>
  32765. </dd>
  32766. <dt><samp class="option">colorspace</samp></dt>
  32767. <dt><samp class="option">color_primaries</samp></dt>
  32768. <dt><samp class="option">color_trc</samp></dt>
  32769. <dt><samp class="option">range</samp></dt>
  32770. <dd><p>Configure the colorspace that output frames will be delivered in. The default
  32771. value of <code class="code">auto</code> outputs frames in the same format as the input frames,
  32772. leading to no change. For any other value, conversion will be performed.
  32773. </p>
  32774. <p>See the <a class="ref" href="#setparams">setparams</a> filter for a list of possible values.
  32775. </p>
  32776. </dd>
  32777. <dt><samp class="option">apply_filmgrain</samp></dt>
  32778. <dd><p>Apply film grain (e.g. AV1 or H.274) if present in source frames, and strip
  32779. it from the output. Enabled by default.
  32780. </p>
  32781. </dd>
  32782. <dt><samp class="option">apply_dolbyvision</samp></dt>
  32783. <dd><p>Apply Dolby Vision RPU metadata if present in source frames, and strip it from
  32784. the output. Enabled by default. Note that Dolby Vision will always output
  32785. BT.2020+PQ, overriding the usual input frame metadata. These will also be
  32786. picked as the values of <code class="code">auto</code> for the respective frame output options.
  32787. </p></dd>
  32788. </dl>
  32789. <p>In addition to the expression constants documented for the <a class="ref" href="#scale">scale</a> filter,
  32790. 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>,
  32791. <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
  32792. also contain the following constants:
  32793. </p>
  32794. <dl class="table">
  32795. <dt><samp class="option">in_idx, idx</samp></dt>
  32796. <dd><p>The (0-based) numeric index of the currently active input stream.
  32797. </p></dd>
  32798. <dt><samp class="option">crop_w, cw</samp></dt>
  32799. <dt><samp class="option">crop_h, ch</samp></dt>
  32800. <dd><p>The computed values of <samp class="option">crop_w</samp> and <samp class="option">crop_h</samp>.
  32801. </p>
  32802. </dd>
  32803. <dt><samp class="option">pos_w, pw</samp></dt>
  32804. <dt><samp class="option">pos_h, ph</samp></dt>
  32805. <dd><p>The computed values of <samp class="option">pos_w</samp> and <samp class="option">pos_h</samp>.
  32806. </p>
  32807. </dd>
  32808. <dt><samp class="option">in_t, t</samp></dt>
  32809. <dd><p>The input frame timestamp, in seconds. NAN if input timestamp is unknown.
  32810. </p>
  32811. </dd>
  32812. <dt><samp class="option">out_t, ot</samp></dt>
  32813. <dd><p>The input frame timestamp, in seconds. NAN if input timestamp is unknown.
  32814. </p>
  32815. </dd>
  32816. <dt><samp class="option">n</samp></dt>
  32817. <dd><p>The input frame number, starting with 0.
  32818. </p></dd>
  32819. </dl>
  32820. </div>
  32821. <div class="subsubsection-level-extent" id="Scaling">
  32822. <h4 class="subsubsection"><span>30.144.1.2 Scaling<a class="copiable-link" href="#Scaling"> &para;</a></span></h4>
  32823. <p>The options in this section control how libplacebo performs upscaling and (if
  32824. necessary) downscaling. Note that libplacebo will always internally operate on
  32825. 4:4:4 content, so any sub-sampled chroma formats such as <code class="code">yuv420p</code> will
  32826. necessarily be upsampled and downsampled as part of the rendering process. That
  32827. means scaling might be in effect even if the source and destination resolution
  32828. are the same.
  32829. </p><dl class="table">
  32830. <dt><samp class="option">upscaler</samp></dt>
  32831. <dt><samp class="option">downscaler</samp></dt>
  32832. <dd><p>Configure the filter kernel used for upscaling and downscaling. The respective
  32833. defaults are <code class="code">spline36</code> and <code class="code">mitchell</code>. For a full list of possible
  32834. values, pass <code class="code">help</code> to these options. The most important values are:
  32835. </p><dl class="table">
  32836. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  32837. <dd><p>Forces the use of built-in GPU texture sampling (typically bilinear). Extremely
  32838. fast but poor quality, especially when downscaling.
  32839. </p>
  32840. </dd>
  32841. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  32842. <dd><p>Bilinear interpolation. Can generally be done for free on GPUs, except when
  32843. doing so would lead to aliasing. Fast and low quality.
  32844. </p>
  32845. </dd>
  32846. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  32847. <dd><p>Nearest-neighbour interpolation. Sharp but highly aliasing.
  32848. </p>
  32849. </dd>
  32850. <dt>&lsquo;<samp class="samp">oversample</samp>&rsquo;</dt>
  32851. <dd><p>Algorithm that looks visually similar to nearest-neighbour interpolation but
  32852. tries to preserve pixel aspect ratio. Good for pixel art, since it results in
  32853. minimal distortion of the artistic appearance.
  32854. </p>
  32855. </dd>
  32856. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  32857. <dd><p>Standard sinc-sinc interpolation kernel.
  32858. </p>
  32859. </dd>
  32860. <dt>&lsquo;<samp class="samp">spline36</samp>&rsquo;</dt>
  32861. <dd><p>Cubic spline approximation of lanczos. No difference in performance, but has
  32862. very slightly less ringing.
  32863. </p>
  32864. </dd>
  32865. <dt>&lsquo;<samp class="samp">ewa_lanczos</samp>&rsquo;</dt>
  32866. <dd><p>Elliptically weighted average version of lanczos, based on a jinc-sinc kernel.
  32867. This is also popularly referred to as just &quot;Jinc scaling&quot;. Slow but very high
  32868. quality.
  32869. </p>
  32870. </dd>
  32871. <dt>&lsquo;<samp class="samp">gaussian</samp>&rsquo;</dt>
  32872. <dd><p>Gaussian kernel. Has certain ideal mathematical properties, but subjectively
  32873. very blurry.
  32874. </p>
  32875. </dd>
  32876. <dt>&lsquo;<samp class="samp">mitchell</samp>&rsquo;</dt>
  32877. <dd><p>Cubic BC spline with parameters recommended by Mitchell and Netravali. Very
  32878. little ringing.
  32879. </p></dd>
  32880. </dl>
  32881. </dd>
  32882. <dt><samp class="option">frame_mixer</samp></dt>
  32883. <dd><p>Controls the kernel used for mixing frames temporally. The default value is
  32884. <code class="code">none</code>, which disables frame mixing. For a full list of possible values,
  32885. pass <code class="code">help</code> to this option. The most important values are:
  32886. </p><dl class="table">
  32887. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  32888. <dd><p>Disables frame mixing, giving a result equivalent to &quot;nearest neighbour&quot;
  32889. semantics.
  32890. </p>
  32891. </dd>
  32892. <dt>&lsquo;<samp class="samp">oversample</samp>&rsquo;</dt>
  32893. <dd><p>Oversamples the input video to create a &quot;Smooth Motion&quot;-type effect: if an
  32894. output frame would exactly fall on the transition between two video frames, it
  32895. is blended according to the relative overlap. This is the recommended option
  32896. whenever preserving the original subjective appearance is desired.
  32897. </p>
  32898. </dd>
  32899. <dt>&lsquo;<samp class="samp">mitchell_clamp</samp>&rsquo;</dt>
  32900. <dd><p>Larger filter kernel that smoothly interpolates multiple frames in a manner
  32901. designed to eliminate ringing and other artefacts as much as possible. This is
  32902. the recommended option wherever maximum visual smoothness is desired.
  32903. </p>
  32904. </dd>
  32905. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  32906. <dd><p>Linear blend/fade between frames. Especially useful for constructing e.g.
  32907. slideshows.
  32908. </p></dd>
  32909. </dl>
  32910. </dd>
  32911. <dt><samp class="option">lut_entries</samp></dt>
  32912. <dd><p>Configures the size of scaler LUTs, ranging from <code class="code">1</code> to <code class="code">256</code>. The
  32913. default of <code class="code">0</code> will pick libplacebo&rsquo;s internal default, typically
  32914. <code class="code">64</code>.
  32915. </p>
  32916. </dd>
  32917. <dt><samp class="option">antiringing</samp></dt>
  32918. <dd><p>Enables anti-ringing (for non-EWA filters). The value (between <code class="code">0.0</code> and
  32919. <code class="code">1.0</code>) configures the strength of the anti-ringing algorithm. May increase
  32920. aliasing if set too high. Disabled by default.
  32921. </p>
  32922. </dd>
  32923. <dt><samp class="option">sigmoid</samp></dt>
  32924. <dd><p>Enable sigmoidal compression during upscaling. Reduces ringing slightly.
  32925. Enabled by default.
  32926. </p></dd>
  32927. </dl>
  32928. </div>
  32929. <div class="subsubsection-level-extent" id="Debanding">
  32930. <h4 class="subsubsection"><span>30.144.1.3 Debanding<a class="copiable-link" href="#Debanding"> &para;</a></span></h4>
  32931. <p>Libplacebo comes with a built-in debanding filter that is good at counteracting
  32932. many common sources of banding and blocking. Turning this on is highly
  32933. recommended whenever quality is desired.
  32934. </p><dl class="table">
  32935. <dt><samp class="option">deband</samp></dt>
  32936. <dd><p>Enable (fast) debanding algorithm. Disabled by default.
  32937. </p>
  32938. </dd>
  32939. <dt><samp class="option">deband_iterations</samp></dt>
  32940. <dd><p>Number of deband iterations of the debanding algorithm. Each iteration is
  32941. performed with progressively increased radius (and diminished threshold).
  32942. Recommended values are in the range <code class="code">1</code> to <code class="code">4</code>. Defaults to <code class="code">1</code>.
  32943. </p>
  32944. </dd>
  32945. <dt><samp class="option">deband_threshold</samp></dt>
  32946. <dd><p>Debanding filter strength. Higher numbers lead to more aggressive debanding.
  32947. Defaults to <code class="code">4.0</code>.
  32948. </p>
  32949. </dd>
  32950. <dt><samp class="option">deband_radius</samp></dt>
  32951. <dd><p>Debanding filter radius. A higher radius is better for slow gradients, while
  32952. a lower radius is better for steep gradients. Defaults to <code class="code">16.0</code>.
  32953. </p>
  32954. </dd>
  32955. <dt><samp class="option">deband_grain</samp></dt>
  32956. <dd><p>Amount of extra output grain to add. Helps hide imperfections. Defaults to
  32957. <code class="code">6.0</code>.
  32958. </p></dd>
  32959. </dl>
  32960. </div>
  32961. <div class="subsubsection-level-extent" id="Color-adjustment">
  32962. <h4 class="subsubsection"><span>30.144.1.4 Color adjustment<a class="copiable-link" href="#Color-adjustment"> &para;</a></span></h4>
  32963. <p>A collection of subjective color controls. Not very rigorous, so the exact
  32964. effect will vary somewhat depending on the input primaries and colorspace.
  32965. </p><dl class="table">
  32966. <dt><samp class="option">brightness</samp></dt>
  32967. <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>.
  32968. </p>
  32969. </dd>
  32970. <dt><samp class="option">contrast</samp></dt>
  32971. <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>.
  32972. </p>
  32973. </dd>
  32974. <dt><samp class="option">saturation</samp></dt>
  32975. <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>.
  32976. </p>
  32977. </dd>
  32978. <dt><samp class="option">hue</samp></dt>
  32979. <dd><p>Hue shift in radians, between <code class="code">-3.14</code> and <code class="code">3.14</code>. Defaults to
  32980. <code class="code">0.0</code>. This will rotate the UV subvector, defaulting to BT.709
  32981. coefficients for RGB inputs.
  32982. </p>
  32983. </dd>
  32984. <dt><samp class="option">gamma</samp></dt>
  32985. <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>.
  32986. </p>
  32987. </dd>
  32988. <dt><samp class="option">cones</samp></dt>
  32989. <dd><p>Cone model to use for color blindness simulation. Accepts any combination of
  32990. <code class="code">l</code>, <code class="code">m</code> and <code class="code">s</code>. Here are some examples:
  32991. </p><dl class="table">
  32992. <dt>&lsquo;<samp class="samp">m</samp>&rsquo;</dt>
  32993. <dd><p>Deuteranomaly / deuteranopia (affecting 3%-4% of the population)
  32994. </p></dd>
  32995. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  32996. <dd><p>Protanomaly / protanopia (affecting 1%-2% of the population)
  32997. </p></dd>
  32998. <dt>&lsquo;<samp class="samp">l+m</samp>&rsquo;</dt>
  32999. <dd><p>Monochromacy (very rare)
  33000. </p></dd>
  33001. <dt>&lsquo;<samp class="samp">l+m+s</samp>&rsquo;</dt>
  33002. <dd><p>Achromatopsy (complete loss of daytime vision, extremely rare)
  33003. </p></dd>
  33004. </dl>
  33005. </dd>
  33006. <dt><samp class="option">cone-strength</samp></dt>
  33007. <dd><p>Gain factor for the cones specified by <code class="code">cones</code>, between <code class="code">0.0</code> and
  33008. <code class="code">10.0</code>. A value of <code class="code">1.0</code> results in no change to color vision. A
  33009. value of <code class="code">0.0</code> (the default) simulates complete loss of those cones. Values
  33010. above <code class="code">1.0</code> result in exaggerating the differences between cones, which
  33011. may help compensate for reduced color vision.
  33012. </p></dd>
  33013. </dl>
  33014. </div>
  33015. <div class="subsubsection-level-extent" id="Peak-detection">
  33016. <h4 class="subsubsection"><span>30.144.1.5 Peak detection<a class="copiable-link" href="#Peak-detection"> &para;</a></span></h4>
  33017. <p>To help deal with sources that only have static HDR10 metadata (or no tagging
  33018. whatsoever), libplacebo uses its own internal frame analysis compute shader to
  33019. analyze source frames and adapt the tone mapping function in realtime. If this
  33020. is too slow, or if exactly reproducible frame-perfect results are needed, it&rsquo;s
  33021. recommended to turn this feature off.
  33022. </p><dl class="table">
  33023. <dt><samp class="option">peak_detect</samp></dt>
  33024. <dd><p>Enable HDR peak detection. Ignores static MaxCLL/MaxFALL values in favor of
  33025. dynamic detection from the input. Note that the detected values do not get
  33026. written back to the output frames, they merely guide the internal tone mapping
  33027. process. Enabled by default.
  33028. </p>
  33029. </dd>
  33030. <dt><samp class="option">smoothing_period</samp></dt>
  33031. <dd><p>Peak detection smoothing period, between <code class="code">0.0</code> and <code class="code">1000.0</code>. Higher
  33032. values result in peak detection becoming less responsive to changes in the
  33033. input. Defaults to <code class="code">100.0</code>.
  33034. </p>
  33035. </dd>
  33036. <dt><samp class="option">minimum_peak</samp></dt>
  33037. <dd><p>Lower bound on the detected peak (relative to SDR white), between <code class="code">0.0</code>
  33038. and <code class="code">100.0</code>. Defaults to <code class="code">1.0</code>.
  33039. </p>
  33040. </dd>
  33041. <dt><samp class="option">scene_threshold_low</samp></dt>
  33042. <dt><samp class="option">scene_threshold_high</samp></dt>
  33043. <dd><p>Lower and upper thresholds for scene change detection. Expressed in a
  33044. logarithmic scale between <code class="code">0.0</code> and <code class="code">100.0</code>. Default to <code class="code">5.5</code>
  33045. and <code class="code">10.0</code>, respectively. Setting either to a negative value disables
  33046. this functionality.
  33047. </p>
  33048. </dd>
  33049. <dt><samp class="option">percentile</samp></dt>
  33050. <dd><p>Which percentile of the frame brightness histogram to use as the source peak
  33051. for tone-mapping. Defaults to <code class="code">99.995</code>, a fairly conservative value.
  33052. Setting this to <code class="code">100.0</code> disables frame histogram measurement and instead
  33053. uses the true peak brightness for tone-mapping.
  33054. </p></dd>
  33055. </dl>
  33056. </div>
  33057. <div class="subsubsection-level-extent" id="Tone-mapping">
  33058. <h4 class="subsubsection"><span>30.144.1.6 Tone mapping<a class="copiable-link" href="#Tone-mapping"> &para;</a></span></h4>
  33059. <p>The options in this section control how libplacebo performs tone-mapping and
  33060. gamut-mapping when dealing with mismatches between wide-gamut or HDR content.
  33061. In general, libplacebo relies on accurate source tagging and mastering display
  33062. gamut information to produce the best results.
  33063. </p><dl class="table">
  33064. <dt><samp class="option">gamut_mode</samp></dt>
  33065. <dd><p>How to handle out-of-gamut colors that can occur as a result of colorimetric
  33066. gamut mapping.
  33067. </p><dl class="table">
  33068. <dt>&lsquo;<samp class="samp">clip</samp>&rsquo;</dt>
  33069. <dd><p>Do nothing, simply clip out-of-range colors to the RGB volume. Low quality but
  33070. extremely fast.
  33071. </p></dd>
  33072. <dt>&lsquo;<samp class="samp">perceptual</samp>&rsquo;</dt>
  33073. <dd><p>Perceptually soft-clip colors to the gamut volume. This is the default.
  33074. </p></dd>
  33075. <dt>&lsquo;<samp class="samp">relative</samp>&rsquo;</dt>
  33076. <dd><p>Relative colorimetric hard-clip. Similar to <code class="code">perceptual</code> but without
  33077. the soft knee.
  33078. </p></dd>
  33079. <dt>&lsquo;<samp class="samp">saturation</samp>&rsquo;</dt>
  33080. <dd><p>Saturation mapping, maps primaries directly to primaries in RGB space.
  33081. Not recommended except for artificial computer graphics for which a bright,
  33082. saturated display is desired.
  33083. </p></dd>
  33084. <dt>&lsquo;<samp class="samp">absolute</samp>&rsquo;</dt>
  33085. <dd><p>Absolute colorimetric hard-clip. Performs no adjustment of the white point.
  33086. </p></dd>
  33087. <dt>&lsquo;<samp class="samp">desaturate</samp>&rsquo;</dt>
  33088. <dd><p>Hard-desaturates out-of-gamut colors towards white, while preserving the
  33089. luminance. Has a tendency to distort the visual appearance of bright objects.
  33090. </p></dd>
  33091. <dt>&lsquo;<samp class="samp">darken</samp>&rsquo;</dt>
  33092. <dd><p>Linearly reduces content brightness to preserves saturated details, followed by
  33093. clipping the remaining out-of-gamut colors.
  33094. </p></dd>
  33095. <dt>&lsquo;<samp class="samp">warn</samp>&rsquo;</dt>
  33096. <dd><p>Highlight out-of-gamut pixels (by inverting/marking them).
  33097. </p></dd>
  33098. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  33099. <dd><p>Linearly reduces chromaticity of the entire image to make it fit within the
  33100. target color volume. Be careful when using this on BT.2020 sources without
  33101. proper mastering metadata, as doing so will lead to excessive desaturation.
  33102. </p></dd>
  33103. </dl>
  33104. </dd>
  33105. <dt><samp class="option">tonemapping</samp></dt>
  33106. <dd><p>Tone-mapping algorithm to use. Available values are:
  33107. </p><dl class="table">
  33108. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  33109. <dd><p>Automatic selection based on internal heuristics. This is the default.
  33110. </p></dd>
  33111. <dt>&lsquo;<samp class="samp">clip</samp>&rsquo;</dt>
  33112. <dd><p>Performs no tone-mapping, just clips out-of-range colors. Retains perfect color
  33113. accuracy for in-range colors but completely destroys out-of-range information.
  33114. Does not perform any black point adaptation. Not configurable.
  33115. </p></dd>
  33116. <dt>&lsquo;<samp class="samp">st2094-40</samp>&rsquo;</dt>
  33117. <dd><p>EETF from SMPTE ST 2094-40 Annex B, which applies the Bezier curves from HDR10+
  33118. dynamic metadata based on Bezier curves to perform tone-mapping. The OOTF used
  33119. is adjusted based on the ratio between the targeted and actual display peak
  33120. luminances.
  33121. </p></dd>
  33122. <dt>&lsquo;<samp class="samp">st2094-10</samp>&rsquo;</dt>
  33123. <dd><p>EETF from SMPTE ST 2094-10 Annex B.2, which takes into account the input signal
  33124. average luminance in addition to the maximum/minimum. The configurable contrast
  33125. parameter influences the slope of the linear output segment, defaulting to
  33126. <code class="code">1.0</code> for no increase/decrease in contrast. Note that this does not
  33127. currently include the subjective gain/offset/gamma controls defined in Annex
  33128. B.3.
  33129. </p></dd>
  33130. <dt>&lsquo;<samp class="samp">bt.2390</samp>&rsquo;</dt>
  33131. <dd><p>EETF from the ITU-R Report BT.2390, a hermite spline roll-off with linear
  33132. segment. The knee point offset is configurable. Note that this parameter
  33133. defaults to <code class="code">1.0</code>, rather than the value of <code class="code">0.5</code> from the ITU-R
  33134. spec.
  33135. </p></dd>
  33136. <dt>&lsquo;<samp class="samp">bt.2446a</samp>&rsquo;</dt>
  33137. <dd><p>EETF from ITU-R Report BT.2446, method A. Designed for well-mastered HDR
  33138. sources. Can be used for both forward and inverse tone mapping. Not
  33139. configurable.
  33140. </p></dd>
  33141. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  33142. <dd><p>Simple spline consisting of two polynomials, joined by a single pivot point.
  33143. The parameter gives the pivot point (in PQ space), defaulting to <code class="code">0.30</code>.
  33144. Can be used for both forward and inverse tone mapping.
  33145. </p></dd>
  33146. <dt>&lsquo;<samp class="samp">reinhard</samp>&rsquo;</dt>
  33147. <dd><p>Simple non-linear, global tone mapping algorithm. The parameter specifies the
  33148. local contrast coefficient at the display peak. Essentially, a parameter of
  33149. <code class="code">0.5</code> implies that the reference white will be about half as bright as
  33150. when clipping. Defaults to <code class="code">0.5</code>, which results in the simplest
  33151. formulation of this function.
  33152. </p></dd>
  33153. <dt>&lsquo;<samp class="samp">mobius</samp>&rsquo;</dt>
  33154. <dd><p>Generalization of the reinhard tone mapping algorithm to support an additional
  33155. linear slope near black. The tone mapping parameter indicates the trade-off
  33156. between the linear section and the non-linear section. Essentially, for a given
  33157. parameter <var class="var">x</var>, every color value below <var class="var">x</var> will be mapped linearly,
  33158. while higher values get non-linearly tone-mapped. Values near <code class="code">1.0</code> make
  33159. this curve behave like <code class="code">clip</code>, while values near <code class="code">0.0</code> make this
  33160. curve behave like <code class="code">reinhard</code>. The default value is <code class="code">0.3</code>, which
  33161. provides a good balance between colorimetric accuracy and preserving
  33162. out-of-gamut details.
  33163. </p></dd>
  33164. <dt>&lsquo;<samp class="samp">hable</samp>&rsquo;</dt>
  33165. <dd><p>Piece-wise, filmic tone-mapping algorithm developed by John Hable for use in
  33166. Uncharted 2, inspired by a similar tone-mapping algorithm used by Kodak.
  33167. Popularized by its use in video games with HDR rendering. Preserves both dark
  33168. and bright details very well, but comes with the drawback of changing the
  33169. average brightness quite significantly. This is sort of similar to
  33170. <code class="code">reinhard</code> with parameter <code class="code">0.24</code>.
  33171. </p></dd>
  33172. <dt>&lsquo;<samp class="samp">gamma</samp>&rsquo;</dt>
  33173. <dd><p>Fits a gamma (power) function to transfer between the source and target color
  33174. spaces, effectively resulting in a perceptual hard-knee joining two roughly
  33175. linear sections. This preserves details at all scales fairly accurately, but
  33176. can result in an image with a muted or dull appearance. The parameter is used
  33177. as the cutoff point, defaulting to <code class="code">0.5</code>.
  33178. </p></dd>
  33179. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  33180. <dd><p>Linearly stretches the input range to the output range, in PQ space. This will
  33181. preserve all details accurately, but results in a significantly different
  33182. average brightness. Can be used for inverse tone-mapping in addition to regular
  33183. tone-mapping. The parameter can be used as an additional linear gain
  33184. coefficient (defaulting to <code class="code">1.0</code>).
  33185. </p></dd>
  33186. </dl>
  33187. </dd>
  33188. <dt><samp class="option">tonemapping_param</samp></dt>
  33189. <dd><p>For tunable tone mapping functions, this parameter can be used to fine-tune the
  33190. curve behavior. Refer to the documentation of <code class="code">tonemapping</code>. The default
  33191. value of <code class="code">0.0</code> is replaced by the curve&rsquo;s preferred default setting.
  33192. </p>
  33193. </dd>
  33194. <dt><samp class="option">inverse_tonemapping</samp></dt>
  33195. <dd><p>If enabled, this filter will also attempt stretching SDR signals to fill HDR
  33196. output color volumes. Disabled by default.
  33197. </p>
  33198. </dd>
  33199. <dt><samp class="option">tonemapping_lut_size</samp></dt>
  33200. <dd><p>Size of the tone-mapping LUT, between <code class="code">2</code> and <code class="code">1024</code>. Defaults to
  33201. <code class="code">256</code>. Note that this figure is squared when combined with
  33202. <code class="code">peak_detect</code>.
  33203. </p>
  33204. </dd>
  33205. <dt><samp class="option">contrast_recovery</samp></dt>
  33206. <dd><p>Contrast recovery strength. If set to a value above <code class="code">0.0</code>, the source
  33207. image will be divided into high-frequency and low-frequency components, and a
  33208. portion of the high-frequency image is added back onto the tone-mapped output.
  33209. May cause excessive ringing artifacts for some HDR sources, but can improve the
  33210. subjective sharpness and detail left over in the image after tone-mapping.
  33211. Defaults to <code class="code">0.30</code>.
  33212. </p>
  33213. </dd>
  33214. <dt><samp class="option">contrast_smoothness</samp></dt>
  33215. <dd><p>Contrast recovery lowpass kernel size. Defaults to <code class="code">3.5</code>. Increasing or
  33216. decreasing this will affect the visual appearance substantially. Has no effect
  33217. when <code class="code">contrast_recovery</code> is disabled.
  33218. </p></dd>
  33219. </dl>
  33220. </div>
  33221. <div class="subsubsection-level-extent" id="Dithering">
  33222. <h4 class="subsubsection"><span>30.144.1.7 Dithering<a class="copiable-link" href="#Dithering"> &para;</a></span></h4>
  33223. <p>By default, libplacebo will dither whenever necessary, which includes rendering
  33224. to any integer format below 16-bit precision. It&rsquo;s recommended to always leave
  33225. this on, since not doing so may result in visible banding in the output, even
  33226. if the <code class="code">debanding</code> filter is enabled. If maximum performance is needed,
  33227. use <code class="code">ordered_fixed</code> instead of disabling dithering.
  33228. </p><dl class="table">
  33229. <dt><samp class="option">dithering</samp></dt>
  33230. <dd><p>Dithering method to use. Accepts the following values:
  33231. </p><dl class="table">
  33232. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  33233. <dd><p>Disables dithering completely. May result in visible banding.
  33234. </p></dd>
  33235. <dt>&lsquo;<samp class="samp">blue</samp>&rsquo;</dt>
  33236. <dd><p>Dither with pseudo-blue noise. This is the default.
  33237. </p></dd>
  33238. <dt>&lsquo;<samp class="samp">ordered</samp>&rsquo;</dt>
  33239. <dd><p>Tunable ordered dither pattern.
  33240. </p></dd>
  33241. <dt>&lsquo;<samp class="samp">ordered_fixed</samp>&rsquo;</dt>
  33242. <dd><p>Faster ordered dither with a fixed size of <code class="code">6</code>. Texture-less.
  33243. </p></dd>
  33244. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  33245. <dd><p>Dither with white noise. Texture-less.
  33246. </p></dd>
  33247. </dl>
  33248. </dd>
  33249. <dt><samp class="option">dither_lut_size</samp></dt>
  33250. <dd><p>Dither LUT size, as log base2 between <code class="code">1</code> and <code class="code">8</code>. Defaults to
  33251. <code class="code">6</code>, corresponding to a LUT size of <code class="code">64x64</code>.
  33252. </p>
  33253. </dd>
  33254. <dt><samp class="option">dither_temporal</samp></dt>
  33255. <dd><p>Enables temporal dithering. Disabled by default.
  33256. </p></dd>
  33257. </dl>
  33258. </div>
  33259. <div class="subsubsection-level-extent" id="Custom-shaders">
  33260. <h4 class="subsubsection"><span>30.144.1.8 Custom shaders<a class="copiable-link" href="#Custom-shaders"> &para;</a></span></h4>
  33261. <p>libplacebo supports a number of custom shaders based on the mpv .hook GLSL
  33262. syntax. A collection of such shaders can be found here:
  33263. <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>
  33264. </p>
  33265. <p>A full description of the mpv shader format is beyond the scope of this
  33266. section, but a summary can be found here:
  33267. <a class="url" href="https://mpv.io/manual/master/#options-glsl-shader">https://mpv.io/manual/master/#options-glsl-shader</a>
  33268. </p><dl class="table">
  33269. <dt><samp class="option">custom_shader_path</samp></dt>
  33270. <dd><p>Specifies a path to a custom shader file to load at runtime.
  33271. </p>
  33272. </dd>
  33273. <dt><samp class="option">custom_shader_bin</samp></dt>
  33274. <dd><p>Specifies a complete custom shader as a raw string.
  33275. </p></dd>
  33276. </dl>
  33277. </div>
  33278. <div class="subsubsection-level-extent" id="Debugging-_002f-performance">
  33279. <h4 class="subsubsection"><span>30.144.1.9 Debugging / performance<a class="copiable-link" href="#Debugging-_002f-performance"> &para;</a></span></h4>
  33280. <p>All of the options in this section default off. They may be of assistance when
  33281. attempting to squeeze the maximum performance at the cost of quality.
  33282. </p><dl class="table">
  33283. <dt><samp class="option">skip_aa</samp></dt>
  33284. <dd><p>Disable anti-aliasing when downscaling.
  33285. </p>
  33286. </dd>
  33287. <dt><samp class="option">polar_cutoff</samp></dt>
  33288. <dd><p>Truncate polar (EWA) scaler kernels below this absolute magnitude, between
  33289. <code class="code">0.0</code> and <code class="code">1.0</code>.
  33290. </p>
  33291. </dd>
  33292. <dt><samp class="option">disable_linear</samp></dt>
  33293. <dd><p>Disable linear light scaling.
  33294. </p>
  33295. </dd>
  33296. <dt><samp class="option">disable_builtin</samp></dt>
  33297. <dd><p>Disable built-in GPU sampling (forces LUT).
  33298. </p>
  33299. </dd>
  33300. <dt><samp class="option">disable_fbos</samp></dt>
  33301. <dd><p>Forcibly disable FBOs, resulting in loss of almost all functionality, but
  33302. offering the maximum possible speed.
  33303. </p></dd>
  33304. </dl>
  33305. </div>
  33306. </div>
  33307. <div class="subsection-level-extent" id="Commands-105">
  33308. <h4 class="subsection"><span>30.144.2 Commands<a class="copiable-link" href="#Commands-105"> &para;</a></span></h4>
  33309. <p>This filter supports almost all of the above options as <a class="ref" href="#commands">commands</a>.
  33310. </p>
  33311. </div>
  33312. <div class="subsection-level-extent" id="Examples-107">
  33313. <h4 class="subsection"><span>30.144.3 Examples<a class="copiable-link" href="#Examples-107"> &para;</a></span></h4>
  33314. <ul class="itemize mark-bullet">
  33315. <li>Tone-map input to standard gamut BT.709 output:
  33316. <div class="example">
  33317. <pre class="example-preformatted">libplacebo=colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv
  33318. </pre></div>
  33319. </li><li>Rescale input to fit into standard 1080p, with high quality scaling:
  33320. <div class="example">
  33321. <pre class="example-preformatted">libplacebo=w=1920:h=1080:force_original_aspect_ratio=decrease:normalize_sar=true:upscaler=ewa_lanczos:downscaler=ewa_lanczos
  33322. </pre></div>
  33323. </li><li>Interpolate low FPS / VFR input to smoothed constant 60 fps output:
  33324. <div class="example">
  33325. <pre class="example-preformatted">libplacebo=fps=60:frame_mixer=mitchell_clamp
  33326. </pre></div>
  33327. </li><li>Convert input to standard sRGB JPEG:
  33328. <div class="example">
  33329. <pre class="example-preformatted">libplacebo=format=yuv420p:colorspace=bt470bg:color_primaries=bt709:color_trc=iec61966-2-1:range=pc
  33330. </pre></div>
  33331. </li><li>Use higher quality debanding settings:
  33332. <div class="example">
  33333. <pre class="example-preformatted">libplacebo=deband=true:deband_iterations=3:deband_radius=8:deband_threshold=6
  33334. </pre></div>
  33335. </li><li>Run this filter on the CPU, on systems with Mesa installed (and with the most
  33336. expensive options disabled):
  33337. <div class="example">
  33338. <pre class="example-preformatted">ffmpeg ... -init_hw_device vulkan:llvmpipe ... -vf libplacebo=upscaler=none:downscaler=none:peak_detect=false
  33339. </pre></div>
  33340. </li><li>Suppress CPU-based AV1/H.274 film grain application in the decoder, in favor of
  33341. doing it with this filter. Note that this is only a gain if the frames are
  33342. either already on the GPU, or if you&rsquo;re using libplacebo for other purposes,
  33343. since otherwise the VRAM roundtrip will more than offset any expected speedup.
  33344. <div class="example">
  33345. <pre class="example-preformatted">ffmpeg -export_side_data +film_grain ... -vf libplacebo=apply_filmgrain=true
  33346. </pre></div>
  33347. </li><li>Interop with VAAPI hwdec to avoid round-tripping through RAM:
  33348. <div class="example">
  33349. <pre class="example-preformatted">ffmpeg -init_hw_device vulkan -hwaccel vaapi -hwaccel_output_format vaapi ... -vf libplacebo
  33350. </pre></div>
  33351. </li></ul>
  33352. <a class="anchor" id="libvmaf"></a></div>
  33353. </div>
  33354. <div class="section-level-extent" id="libvmaf-1">
  33355. <h3 class="section"><span>30.145 libvmaf<a class="copiable-link" href="#libvmaf-1"> &para;</a></span></h3>
  33356. <p>Calculate the VMAF (Video Multi-Method Assessment Fusion) score for a
  33357. reference/distorted pair of input videos.
  33358. </p>
  33359. <p>The first input is the distorted video, and the second input is the reference video.
  33360. </p>
  33361. <p>The obtained VMAF score is printed through the logging system.
  33362. </p>
  33363. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  33364. After installing the library it can be enabled using:
  33365. <code class="code">./configure --enable-libvmaf</code>.
  33366. </p>
  33367. <p>The filter has following options:
  33368. </p>
  33369. <dl class="table">
  33370. <dt><samp class="option">model</samp></dt>
  33371. <dd><p>A &lsquo;|&lsquo; delimited list of vmaf models. Each model can be configured with a number of parameters.
  33372. Default value: <code class="code">&quot;version=vmaf_v0.6.1&quot;</code>
  33373. </p>
  33374. </dd>
  33375. <dt><samp class="option">feature</samp></dt>
  33376. <dd><p>A &lsquo;|&lsquo; delimited list of features. Each feature can be configured with a number of parameters.
  33377. </p>
  33378. </dd>
  33379. <dt><samp class="option">log_path</samp></dt>
  33380. <dd><p>Set the file path to be used to store log files.
  33381. </p>
  33382. </dd>
  33383. <dt><samp class="option">log_fmt</samp></dt>
  33384. <dd><p>Set the format of the log file (xml, json, csv, or sub).
  33385. </p>
  33386. </dd>
  33387. <dt><samp class="option">pool</samp></dt>
  33388. <dd><p>Set the pool method to be used for computing vmaf.
  33389. Options are <code class="code">min</code>, <code class="code">harmonic_mean</code> or <code class="code">mean</code> (default).
  33390. </p>
  33391. </dd>
  33392. <dt><samp class="option">n_threads</samp></dt>
  33393. <dd><p>Set number of threads to be used when initializing libvmaf.
  33394. Default value: <code class="code">0</code>, no threads.
  33395. </p>
  33396. </dd>
  33397. <dt><samp class="option">n_subsample</samp></dt>
  33398. <dd><p>Set frame subsampling interval to be used.
  33399. </p></dd>
  33400. </dl>
  33401. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  33402. </p>
  33403. <ul class="mini-toc">
  33404. <li><a href="#Examples-108" accesskey="1">Examples</a></li>
  33405. </ul>
  33406. <div class="subsection-level-extent" id="Examples-108">
  33407. <h4 class="subsection"><span>30.145.1 Examples<a class="copiable-link" href="#Examples-108"> &para;</a></span></h4>
  33408. <ul class="itemize mark-bullet">
  33409. <li>In the examples below, a distorted video <samp class="file">distorted.mpg</samp> is
  33410. compared with a reference file <samp class="file">reference.mpg</samp>.
  33411. </li><li>Basic usage:
  33412. <div class="example">
  33413. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf=log_path=output.xml -f null -
  33414. </pre></div>
  33415. </li><li>Example with multiple models:
  33416. <div class="example">
  33417. <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 -
  33418. </pre></div>
  33419. </li><li>Example with multiple additional features:
  33420. <div class="example">
  33421. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='feature=name=psnr|name=ciede' -f null -
  33422. </pre></div>
  33423. </li><li>Example with options and different containers:
  33424. <div class="example">
  33425. <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 -
  33426. </pre></div>
  33427. </li></ul>
  33428. </div>
  33429. </div>
  33430. <div class="section-level-extent" id="libvmaf_005fcuda">
  33431. <h3 class="section"><span>30.146 libvmaf_cuda<a class="copiable-link" href="#libvmaf_005fcuda"> &para;</a></span></h3>
  33432. <p>This is the CUDA variant of the <a class="ref" href="#libvmaf">libvmaf</a> filter. It only accepts CUDA frames.
  33433. </p>
  33434. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  33435. After installing the library it can be enabled using:
  33436. <code class="code">./configure --enable-nonfree --enable-ffnvcodec --enable-libvmaf</code>.
  33437. </p>
  33438. <ul class="mini-toc">
  33439. <li><a href="#Examples-109" accesskey="1">Examples</a></li>
  33440. </ul>
  33441. <div class="subsection-level-extent" id="Examples-109">
  33442. <h4 class="subsection"><span>30.146.1 Examples<a class="copiable-link" href="#Examples-109"> &para;</a></span></h4>
  33443. <ul class="itemize mark-bullet">
  33444. <li>Basic usage showing CUVID hardware decoding and CUDA scaling with <a class="ref" href="#scale_005fcuda">scale_cuda</a>:
  33445. <div class="example">
  33446. <pre class="example-preformatted">ffmpeg \
  33447. -hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i dis.obu \
  33448. -hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i ref.obu \
  33449. -filter_complex &quot;
  33450. [0:v]scale_cuda=format=yuv420p[ref]; \
  33451. [1:v]scale_cuda=format=yuv420p[dis]; \
  33452. [dis][ref]libvmaf_cuda=log_fmt=json:log_path=output.json
  33453. &quot; \
  33454. -f null -
  33455. </pre></div>
  33456. </li></ul>
  33457. </div>
  33458. </div>
  33459. <div class="section-level-extent" id="limitdiff">
  33460. <h3 class="section"><span>30.147 limitdiff<a class="copiable-link" href="#limitdiff"> &para;</a></span></h3>
  33461. <p>Apply limited difference filter using second and optionally third video stream.
  33462. </p>
  33463. <p>The filter accepts the following options:
  33464. </p>
  33465. <dl class="table">
  33466. <dt><samp class="option">threshold</samp></dt>
  33467. <dd><p>Set the threshold to use when allowing certain differences between video streams.
  33468. Any absolute difference value lower or exact than this threshold will pick pixel components from
  33469. first video stream.
  33470. </p>
  33471. </dd>
  33472. <dt><samp class="option">elasticity</samp></dt>
  33473. <dd><p>Set the elasticity of soft thresholding when processing video streams.
  33474. This value multiplied with first one sets second threshold.
  33475. Any absolute difference value greater or exact than second threshold will pick pixel components
  33476. from second video stream. For values between those two threshold
  33477. linear interpolation between first and second video stream will be used.
  33478. </p>
  33479. </dd>
  33480. <dt><samp class="option">reference</samp></dt>
  33481. <dd><p>Enable the reference (third) video stream processing. By default is disabled.
  33482. If set, this video stream will be used for calculating absolute difference with first video
  33483. stream.
  33484. </p>
  33485. </dd>
  33486. <dt><samp class="option">planes</samp></dt>
  33487. <dd><p>Specify which planes will be processed. Defaults to all available.
  33488. </p></dd>
  33489. </dl>
  33490. <ul class="mini-toc">
  33491. <li><a href="#Commands-106" accesskey="1">Commands</a></li>
  33492. </ul>
  33493. <div class="subsection-level-extent" id="Commands-106">
  33494. <h4 class="subsection"><span>30.147.1 Commands<a class="copiable-link" href="#Commands-106"> &para;</a></span></h4>
  33495. <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;.
  33496. </p>
  33497. </div>
  33498. </div>
  33499. <div class="section-level-extent" id="limiter">
  33500. <h3 class="section"><span>30.148 limiter<a class="copiable-link" href="#limiter"> &para;</a></span></h3>
  33501. <p>Limits the pixel components values to the specified range [min, max].
  33502. </p>
  33503. <p>The filter accepts the following options:
  33504. </p>
  33505. <dl class="table">
  33506. <dt><samp class="option">min</samp></dt>
  33507. <dd><p>Lower bound. Defaults to the lowest allowed value for the input.
  33508. </p>
  33509. </dd>
  33510. <dt><samp class="option">max</samp></dt>
  33511. <dd><p>Upper bound. Defaults to the highest allowed value for the input.
  33512. </p>
  33513. </dd>
  33514. <dt><samp class="option">planes</samp></dt>
  33515. <dd><p>Specify which planes will be processed. Defaults to all available.
  33516. </p></dd>
  33517. </dl>
  33518. <ul class="mini-toc">
  33519. <li><a href="#Commands-107" accesskey="1">Commands</a></li>
  33520. </ul>
  33521. <div class="subsection-level-extent" id="Commands-107">
  33522. <h4 class="subsection"><span>30.148.1 Commands<a class="copiable-link" href="#Commands-107"> &para;</a></span></h4>
  33523. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  33524. </p>
  33525. </div>
  33526. </div>
  33527. <div class="section-level-extent" id="loop">
  33528. <h3 class="section"><span>30.149 loop<a class="copiable-link" href="#loop"> &para;</a></span></h3>
  33529. <p>Loop video frames.
  33530. </p>
  33531. <p>The filter accepts the following options:
  33532. </p>
  33533. <dl class="table">
  33534. <dt><samp class="option">loop</samp></dt>
  33535. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  33536. Default is 0.
  33537. </p>
  33538. </dd>
  33539. <dt><samp class="option">size</samp></dt>
  33540. <dd><p>Set maximal size in number of frames. Default is 0.
  33541. </p>
  33542. </dd>
  33543. <dt><samp class="option">start</samp></dt>
  33544. <dd><p>Set first frame of loop. Default is 0.
  33545. </p>
  33546. </dd>
  33547. <dt><samp class="option">time</samp></dt>
  33548. <dd><p>Set the time of loop start in seconds.
  33549. Only used if option named <var class="var">start</var> is set to <code class="code">-1</code>.
  33550. </p></dd>
  33551. </dl>
  33552. <ul class="mini-toc">
  33553. <li><a href="#Examples-110" accesskey="1">Examples</a></li>
  33554. </ul>
  33555. <div class="subsection-level-extent" id="Examples-110">
  33556. <h4 class="subsection"><span>30.149.1 Examples<a class="copiable-link" href="#Examples-110"> &para;</a></span></h4>
  33557. <ul class="itemize mark-bullet">
  33558. <li>Loop single first frame infinitely:
  33559. <div class="example">
  33560. <pre class="example-preformatted">loop=loop=-1:size=1:start=0
  33561. </pre></div>
  33562. </li><li>Loop single first frame 10 times:
  33563. <div class="example">
  33564. <pre class="example-preformatted">loop=loop=10:size=1:start=0
  33565. </pre></div>
  33566. </li><li>Loop 10 first frames 5 times:
  33567. <div class="example">
  33568. <pre class="example-preformatted">loop=loop=5:size=10:start=0
  33569. </pre></div>
  33570. </li></ul>
  33571. </div>
  33572. </div>
  33573. <div class="section-level-extent" id="lut1d">
  33574. <h3 class="section"><span>30.150 lut1d<a class="copiable-link" href="#lut1d"> &para;</a></span></h3>
  33575. <p>Apply a 1D LUT to an input video.
  33576. </p>
  33577. <p>The filter accepts the following options:
  33578. </p>
  33579. <dl class="table">
  33580. <dt><samp class="option">file</samp></dt>
  33581. <dd><p>Set the 1D LUT file name.
  33582. </p>
  33583. <p>Currently supported formats:
  33584. </p><dl class="table">
  33585. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  33586. <dd><p>Iridas
  33587. </p></dd>
  33588. <dt>&lsquo;<samp class="samp">csp</samp>&rsquo;</dt>
  33589. <dd><p>cineSpace
  33590. </p></dd>
  33591. </dl>
  33592. </dd>
  33593. <dt><samp class="option">interp</samp></dt>
  33594. <dd><p>Select interpolation mode.
  33595. </p>
  33596. <p>Available values are:
  33597. </p>
  33598. <dl class="table">
  33599. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  33600. <dd><p>Use values from the nearest defined point.
  33601. </p></dd>
  33602. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  33603. <dd><p>Interpolate values using the linear interpolation.
  33604. </p></dd>
  33605. <dt>&lsquo;<samp class="samp">cosine</samp>&rsquo;</dt>
  33606. <dd><p>Interpolate values using the cosine interpolation.
  33607. </p></dd>
  33608. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  33609. <dd><p>Interpolate values using the cubic interpolation.
  33610. </p></dd>
  33611. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  33612. <dd><p>Interpolate values using the spline interpolation.
  33613. </p></dd>
  33614. </dl>
  33615. </dd>
  33616. </dl>
  33617. <ul class="mini-toc">
  33618. <li><a href="#Commands-108" accesskey="1">Commands</a></li>
  33619. </ul>
  33620. <div class="subsection-level-extent" id="Commands-108">
  33621. <h4 class="subsection"><span>30.150.1 Commands<a class="copiable-link" href="#Commands-108"> &para;</a></span></h4>
  33622. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  33623. </p>
  33624. <a class="anchor" id="lut3d"></a></div>
  33625. </div>
  33626. <div class="section-level-extent" id="lut3d-1">
  33627. <h3 class="section"><span>30.151 lut3d<a class="copiable-link" href="#lut3d-1"> &para;</a></span></h3>
  33628. <p>Apply a 3D LUT to an input video.
  33629. </p>
  33630. <p>The filter accepts the following options:
  33631. </p>
  33632. <dl class="table">
  33633. <dt><samp class="option">file</samp></dt>
  33634. <dd><p>Set the 3D LUT file name.
  33635. </p>
  33636. <p>Currently supported formats:
  33637. </p><dl class="table">
  33638. <dt>&lsquo;<samp class="samp">3dl</samp>&rsquo;</dt>
  33639. <dd><p>AfterEffects
  33640. </p></dd>
  33641. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  33642. <dd><p>Iridas
  33643. </p></dd>
  33644. <dt>&lsquo;<samp class="samp">dat</samp>&rsquo;</dt>
  33645. <dd><p>DaVinci
  33646. </p></dd>
  33647. <dt>&lsquo;<samp class="samp">m3d</samp>&rsquo;</dt>
  33648. <dd><p>Pandora
  33649. </p></dd>
  33650. <dt>&lsquo;<samp class="samp">csp</samp>&rsquo;</dt>
  33651. <dd><p>cineSpace
  33652. </p></dd>
  33653. </dl>
  33654. </dd>
  33655. <dt><samp class="option">interp</samp></dt>
  33656. <dd><p>Select interpolation mode.
  33657. </p>
  33658. <p>Available values are:
  33659. </p>
  33660. <dl class="table">
  33661. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  33662. <dd><p>Use values from the nearest defined point.
  33663. </p></dd>
  33664. <dt>&lsquo;<samp class="samp">trilinear</samp>&rsquo;</dt>
  33665. <dd><p>Interpolate values using the 8 points defining a cube.
  33666. </p></dd>
  33667. <dt>&lsquo;<samp class="samp">tetrahedral</samp>&rsquo;</dt>
  33668. <dd><p>Interpolate values using a tetrahedron.
  33669. </p></dd>
  33670. <dt>&lsquo;<samp class="samp">pyramid</samp>&rsquo;</dt>
  33671. <dd><p>Interpolate values using a pyramid.
  33672. </p></dd>
  33673. <dt>&lsquo;<samp class="samp">prism</samp>&rsquo;</dt>
  33674. <dd><p>Interpolate values using a prism.
  33675. </p></dd>
  33676. </dl>
  33677. </dd>
  33678. </dl>
  33679. <ul class="mini-toc">
  33680. <li><a href="#Commands-109" accesskey="1">Commands</a></li>
  33681. </ul>
  33682. <div class="subsection-level-extent" id="Commands-109">
  33683. <h4 class="subsection"><span>30.151.1 Commands<a class="copiable-link" href="#Commands-109"> &para;</a></span></h4>
  33684. <p>This filter supports the <code class="code">interp</code> option as <a class="ref" href="#commands">commands</a>.
  33685. </p>
  33686. </div>
  33687. </div>
  33688. <div class="section-level-extent" id="lumakey">
  33689. <h3 class="section"><span>30.152 lumakey<a class="copiable-link" href="#lumakey"> &para;</a></span></h3>
  33690. <p>Turn certain luma values into transparency.
  33691. </p>
  33692. <p>The filter accepts the following options:
  33693. </p>
  33694. <dl class="table">
  33695. <dt><samp class="option">threshold</samp></dt>
  33696. <dd><p>Set the luma which will be used as base for transparency.
  33697. Default value is <code class="code">0</code>.
  33698. </p>
  33699. </dd>
  33700. <dt><samp class="option">tolerance</samp></dt>
  33701. <dd><p>Set the range of luma values to be keyed out.
  33702. Default value is <code class="code">0.01</code>.
  33703. </p>
  33704. </dd>
  33705. <dt><samp class="option">softness</samp></dt>
  33706. <dd><p>Set the range of softness. Default value is <code class="code">0</code>.
  33707. Use this to control gradual transition from zero to full transparency.
  33708. </p></dd>
  33709. </dl>
  33710. <ul class="mini-toc">
  33711. <li><a href="#Commands-110" accesskey="1">Commands</a></li>
  33712. </ul>
  33713. <div class="subsection-level-extent" id="Commands-110">
  33714. <h4 class="subsection"><span>30.152.1 Commands<a class="copiable-link" href="#Commands-110"> &para;</a></span></h4>
  33715. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  33716. The command accepts the same syntax of the corresponding option.
  33717. </p>
  33718. <p>If the specified expression is not valid, it is kept at its current
  33719. value.
  33720. </p>
  33721. </div>
  33722. </div>
  33723. <div class="section-level-extent" id="lut_002c-lutrgb_002c-lutyuv">
  33724. <h3 class="section"><span>30.153 lut, lutrgb, lutyuv<a class="copiable-link" href="#lut_002c-lutrgb_002c-lutyuv"> &para;</a></span></h3>
  33725. <p>Compute a look-up table for binding each pixel component input value
  33726. to an output value, and apply it to the input video.
  33727. </p>
  33728. <p><var class="var">lutyuv</var> applies a lookup table to a YUV input video, <var class="var">lutrgb</var>
  33729. to an RGB input video.
  33730. </p>
  33731. <p>These filters accept the following parameters:
  33732. </p><dl class="table">
  33733. <dt><samp class="option">c0</samp></dt>
  33734. <dd><p>set first pixel component expression
  33735. </p></dd>
  33736. <dt><samp class="option">c1</samp></dt>
  33737. <dd><p>set second pixel component expression
  33738. </p></dd>
  33739. <dt><samp class="option">c2</samp></dt>
  33740. <dd><p>set third pixel component expression
  33741. </p></dd>
  33742. <dt><samp class="option">c3</samp></dt>
  33743. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  33744. </p>
  33745. </dd>
  33746. <dt><samp class="option">r</samp></dt>
  33747. <dd><p>set red component expression
  33748. </p></dd>
  33749. <dt><samp class="option">g</samp></dt>
  33750. <dd><p>set green component expression
  33751. </p></dd>
  33752. <dt><samp class="option">b</samp></dt>
  33753. <dd><p>set blue component expression
  33754. </p></dd>
  33755. <dt><samp class="option">a</samp></dt>
  33756. <dd><p>alpha component expression
  33757. </p>
  33758. </dd>
  33759. <dt><samp class="option">y</samp></dt>
  33760. <dd><p>set Y/luma component expression
  33761. </p></dd>
  33762. <dt><samp class="option">u</samp></dt>
  33763. <dd><p>set U/Cb component expression
  33764. </p></dd>
  33765. <dt><samp class="option">v</samp></dt>
  33766. <dd><p>set V/Cr component expression
  33767. </p></dd>
  33768. </dl>
  33769. <p>Each of them specifies the expression to use for computing the lookup table for
  33770. the corresponding pixel component values.
  33771. </p>
  33772. <p>The exact component associated to each of the <var class="var">c*</var> options depends on the
  33773. format in input.
  33774. </p>
  33775. <p>The <var class="var">lut</var> filter requires either YUV or RGB pixel formats in input,
  33776. <var class="var">lutrgb</var> requires RGB pixel formats in input, and <var class="var">lutyuv</var> requires YUV.
  33777. </p>
  33778. <p>The expressions can contain the following constants and functions:
  33779. </p>
  33780. <dl class="table">
  33781. <dt><samp class="option">w</samp></dt>
  33782. <dt><samp class="option">h</samp></dt>
  33783. <dd><p>The input width and height.
  33784. </p>
  33785. </dd>
  33786. <dt><samp class="option">val</samp></dt>
  33787. <dd><p>The input value for the pixel component.
  33788. </p>
  33789. </dd>
  33790. <dt><samp class="option">clipval</samp></dt>
  33791. <dd><p>The input value, clipped to the <var class="var">minval</var>-<var class="var">maxval</var> range.
  33792. </p>
  33793. </dd>
  33794. <dt><samp class="option">maxval</samp></dt>
  33795. <dd><p>The maximum value for the pixel component.
  33796. </p>
  33797. </dd>
  33798. <dt><samp class="option">minval</samp></dt>
  33799. <dd><p>The minimum value for the pixel component.
  33800. </p>
  33801. </dd>
  33802. <dt><samp class="option">negval</samp></dt>
  33803. <dd><p>The negated value for the pixel component value, clipped to the
  33804. <var class="var">minval</var>-<var class="var">maxval</var> range; it corresponds to the expression
  33805. &quot;maxval-clipval+minval&quot;.
  33806. </p>
  33807. </dd>
  33808. <dt><samp class="option">clip(val)</samp></dt>
  33809. <dd><p>The computed value in <var class="var">val</var>, clipped to the
  33810. <var class="var">minval</var>-<var class="var">maxval</var> range.
  33811. </p>
  33812. </dd>
  33813. <dt><samp class="option">gammaval(gamma)</samp></dt>
  33814. <dd><p>The computed gamma correction value of the pixel component value,
  33815. clipped to the <var class="var">minval</var>-<var class="var">maxval</var> range. It corresponds to the
  33816. expression
  33817. &quot;pow((clipval-minval)/(maxval-minval)\,<var class="var">gamma</var>)*(maxval-minval)+minval&quot;
  33818. </p>
  33819. </dd>
  33820. </dl>
  33821. <p>All expressions default to &quot;clipval&quot;.
  33822. </p>
  33823. <ul class="mini-toc">
  33824. <li><a href="#Commands-111" accesskey="1">Commands</a></li>
  33825. <li><a href="#Examples-111" accesskey="2">Examples</a></li>
  33826. </ul>
  33827. <div class="subsection-level-extent" id="Commands-111">
  33828. <h4 class="subsection"><span>30.153.1 Commands<a class="copiable-link" href="#Commands-111"> &para;</a></span></h4>
  33829. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  33830. </p>
  33831. </div>
  33832. <div class="subsection-level-extent" id="Examples-111">
  33833. <h4 class="subsection"><span>30.153.2 Examples<a class="copiable-link" href="#Examples-111"> &para;</a></span></h4>
  33834. <ul class="itemize mark-bullet">
  33835. <li>Negate input video:
  33836. <div class="example">
  33837. <pre class="example-preformatted">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
  33838. lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
  33839. </pre></div>
  33840. <p>The above is the same as:
  33841. </p><div class="example">
  33842. <pre class="example-preformatted">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
  33843. lutyuv=&quot;y=negval:u=negval:v=negval&quot;
  33844. </pre></div>
  33845. </li><li>Negate luma:
  33846. <div class="example">
  33847. <pre class="example-preformatted">lutyuv=y=negval
  33848. </pre></div>
  33849. </li><li>Remove chroma components, turning the video into a graytone image:
  33850. <div class="example">
  33851. <pre class="example-preformatted">lutyuv=&quot;u=128:v=128&quot;
  33852. </pre></div>
  33853. </li><li>Apply a luma burning effect:
  33854. <div class="example">
  33855. <pre class="example-preformatted">lutyuv=&quot;y=2*val&quot;
  33856. </pre></div>
  33857. </li><li>Remove green and blue components:
  33858. <div class="example">
  33859. <pre class="example-preformatted">lutrgb=&quot;g=0:b=0&quot;
  33860. </pre></div>
  33861. </li><li>Set a constant alpha channel value on input:
  33862. <div class="example">
  33863. <pre class="example-preformatted">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
  33864. </pre></div>
  33865. </li><li>Correct luma gamma by a factor of 0.5:
  33866. <div class="example">
  33867. <pre class="example-preformatted">lutyuv=y=gammaval(0.5)
  33868. </pre></div>
  33869. </li><li>Discard least significant bits of luma:
  33870. <div class="example">
  33871. <pre class="example-preformatted">lutyuv=y='bitand(val, 128+64+32)'
  33872. </pre></div>
  33873. </li><li>Technicolor like effect:
  33874. <div class="example">
  33875. <pre class="example-preformatted">lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
  33876. </pre></div>
  33877. </li></ul>
  33878. </div>
  33879. </div>
  33880. <div class="section-level-extent" id="lut2_002c-tlut2">
  33881. <h3 class="section"><span>30.154 lut2, tlut2<a class="copiable-link" href="#lut2_002c-tlut2"> &para;</a></span></h3>
  33882. <p>The <code class="code">lut2</code> filter takes two input streams and outputs one
  33883. stream.
  33884. </p>
  33885. <p>The <code class="code">tlut2</code> (time lut2) filter takes two consecutive frames
  33886. from one single stream.
  33887. </p>
  33888. <p>This filter accepts the following parameters:
  33889. </p><dl class="table">
  33890. <dt><samp class="option">c0</samp></dt>
  33891. <dd><p>set first pixel component expression
  33892. </p></dd>
  33893. <dt><samp class="option">c1</samp></dt>
  33894. <dd><p>set second pixel component expression
  33895. </p></dd>
  33896. <dt><samp class="option">c2</samp></dt>
  33897. <dd><p>set third pixel component expression
  33898. </p></dd>
  33899. <dt><samp class="option">c3</samp></dt>
  33900. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  33901. </p>
  33902. </dd>
  33903. <dt><samp class="option">d</samp></dt>
  33904. <dd><p>set output bit depth, only available for <code class="code">lut2</code> filter. By default is 0,
  33905. which means bit depth is automatically picked from first input format.
  33906. </p></dd>
  33907. </dl>
  33908. <p>The <code class="code">lut2</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  33909. </p>
  33910. <p>Each of them specifies the expression to use for computing the lookup table for
  33911. the corresponding pixel component values.
  33912. </p>
  33913. <p>The exact component associated to each of the <var class="var">c*</var> options depends on the
  33914. format in inputs.
  33915. </p>
  33916. <p>The expressions can contain the following constants:
  33917. </p>
  33918. <dl class="table">
  33919. <dt><samp class="option">w</samp></dt>
  33920. <dt><samp class="option">h</samp></dt>
  33921. <dd><p>The input width and height.
  33922. </p>
  33923. </dd>
  33924. <dt><samp class="option">x</samp></dt>
  33925. <dd><p>The first input value for the pixel component.
  33926. </p>
  33927. </dd>
  33928. <dt><samp class="option">y</samp></dt>
  33929. <dd><p>The second input value for the pixel component.
  33930. </p>
  33931. </dd>
  33932. <dt><samp class="option">bdx</samp></dt>
  33933. <dd><p>The first input video bit depth.
  33934. </p>
  33935. </dd>
  33936. <dt><samp class="option">bdy</samp></dt>
  33937. <dd><p>The second input video bit depth.
  33938. </p></dd>
  33939. </dl>
  33940. <p>All expressions default to &quot;x&quot;.
  33941. </p>
  33942. <ul class="mini-toc">
  33943. <li><a href="#Commands-112" accesskey="1">Commands</a></li>
  33944. <li><a href="#Examples-112" accesskey="2">Examples</a></li>
  33945. </ul>
  33946. <div class="subsection-level-extent" id="Commands-112">
  33947. <h4 class="subsection"><span>30.154.1 Commands<a class="copiable-link" href="#Commands-112"> &para;</a></span></h4>
  33948. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a> except option <code class="code">d</code>.
  33949. </p>
  33950. </div>
  33951. <div class="subsection-level-extent" id="Examples-112">
  33952. <h4 class="subsection"><span>30.154.2 Examples<a class="copiable-link" href="#Examples-112"> &para;</a></span></h4>
  33953. <ul class="itemize mark-bullet">
  33954. <li>Highlight differences between two RGB video streams:
  33955. <div class="example">
  33956. <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)'
  33957. </pre></div>
  33958. </li><li>Highlight differences between two YUV video streams:
  33959. <div class="example">
  33960. <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)'
  33961. </pre></div>
  33962. </li><li>Show max difference between two video streams:
  33963. <div class="example">
  33964. <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)))'
  33965. </pre></div>
  33966. </li></ul>
  33967. </div>
  33968. </div>
  33969. <div class="section-level-extent" id="maskedclamp">
  33970. <h3 class="section"><span>30.155 maskedclamp<a class="copiable-link" href="#maskedclamp"> &para;</a></span></h3>
  33971. <p>Clamp the first input stream with the second input and third input stream.
  33972. </p>
  33973. <p>Returns the value of first stream to be between second input
  33974. stream - <code class="code">undershoot</code> and third input stream + <code class="code">overshoot</code>.
  33975. </p>
  33976. <p>This filter accepts the following options:
  33977. </p><dl class="table">
  33978. <dt><samp class="option">undershoot</samp></dt>
  33979. <dd><p>Default value is <code class="code">0</code>.
  33980. </p>
  33981. </dd>
  33982. <dt><samp class="option">overshoot</samp></dt>
  33983. <dd><p>Default value is <code class="code">0</code>.
  33984. </p>
  33985. </dd>
  33986. <dt><samp class="option">planes</samp></dt>
  33987. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  33988. copied from first stream.
  33989. By default value 0xf, all planes will be processed.
  33990. </p></dd>
  33991. </dl>
  33992. <ul class="mini-toc">
  33993. <li><a href="#Commands-113" accesskey="1">Commands</a></li>
  33994. </ul>
  33995. <div class="subsection-level-extent" id="Commands-113">
  33996. <h4 class="subsection"><span>30.155.1 Commands<a class="copiable-link" href="#Commands-113"> &para;</a></span></h4>
  33997. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  33998. </p>
  33999. </div>
  34000. </div>
  34001. <div class="section-level-extent" id="maskedmax">
  34002. <h3 class="section"><span>30.156 maskedmax<a class="copiable-link" href="#maskedmax"> &para;</a></span></h3>
  34003. <p>Merge the second and third input stream into output stream using absolute differences
  34004. between second input stream and first input stream and absolute difference between
  34005. third input stream and first input stream. The picked value will be from second input
  34006. stream if second absolute difference is greater than first one or from third input stream
  34007. otherwise.
  34008. </p>
  34009. <p>This filter accepts the following options:
  34010. </p><dl class="table">
  34011. <dt><samp class="option">planes</samp></dt>
  34012. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  34013. copied from first stream.
  34014. By default value 0xf, all planes will be processed.
  34015. </p></dd>
  34016. </dl>
  34017. <ul class="mini-toc">
  34018. <li><a href="#Commands-114" accesskey="1">Commands</a></li>
  34019. </ul>
  34020. <div class="subsection-level-extent" id="Commands-114">
  34021. <h4 class="subsection"><span>30.156.1 Commands<a class="copiable-link" href="#Commands-114"> &para;</a></span></h4>
  34022. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34023. </p>
  34024. </div>
  34025. </div>
  34026. <div class="section-level-extent" id="maskedmerge">
  34027. <h3 class="section"><span>30.157 maskedmerge<a class="copiable-link" href="#maskedmerge"> &para;</a></span></h3>
  34028. <p>Merge the first input stream with the second input stream using per pixel
  34029. weights in the third input stream.
  34030. </p>
  34031. <p>A value of 0 in the third stream pixel component means that pixel component
  34032. from first stream is returned unchanged, while maximum value (eg. 255 for
  34033. 8-bit videos) means that pixel component from second stream is returned
  34034. unchanged. Intermediate values define the amount of merging between both
  34035. input stream&rsquo;s pixel components.
  34036. </p>
  34037. <p>This filter accepts the following options:
  34038. </p><dl class="table">
  34039. <dt><samp class="option">planes</samp></dt>
  34040. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  34041. copied from first stream.
  34042. By default value 0xf, all planes will be processed.
  34043. </p></dd>
  34044. </dl>
  34045. <ul class="mini-toc">
  34046. <li><a href="#Commands-115" accesskey="1">Commands</a></li>
  34047. </ul>
  34048. <div class="subsection-level-extent" id="Commands-115">
  34049. <h4 class="subsection"><span>30.157.1 Commands<a class="copiable-link" href="#Commands-115"> &para;</a></span></h4>
  34050. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34051. </p>
  34052. </div>
  34053. </div>
  34054. <div class="section-level-extent" id="maskedmin">
  34055. <h3 class="section"><span>30.158 maskedmin<a class="copiable-link" href="#maskedmin"> &para;</a></span></h3>
  34056. <p>Merge the second and third input stream into output stream using absolute differences
  34057. between second input stream and first input stream and absolute difference between
  34058. third input stream and first input stream. The picked value will be from second input
  34059. stream if second absolute difference is less than first one or from third input stream
  34060. otherwise.
  34061. </p>
  34062. <p>This filter accepts the following options:
  34063. </p><dl class="table">
  34064. <dt><samp class="option">planes</samp></dt>
  34065. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  34066. copied from first stream.
  34067. By default value 0xf, all planes will be processed.
  34068. </p></dd>
  34069. </dl>
  34070. <ul class="mini-toc">
  34071. <li><a href="#Commands-116" accesskey="1">Commands</a></li>
  34072. </ul>
  34073. <div class="subsection-level-extent" id="Commands-116">
  34074. <h4 class="subsection"><span>30.158.1 Commands<a class="copiable-link" href="#Commands-116"> &para;</a></span></h4>
  34075. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34076. </p>
  34077. </div>
  34078. </div>
  34079. <div class="section-level-extent" id="maskedthreshold">
  34080. <h3 class="section"><span>30.159 maskedthreshold<a class="copiable-link" href="#maskedthreshold"> &para;</a></span></h3>
  34081. <p>Pick pixels comparing absolute difference of two video streams with fixed
  34082. threshold.
  34083. </p>
  34084. <p>If absolute difference between pixel component of first and second video
  34085. stream is equal or lower than user supplied threshold than pixel component
  34086. from first video stream is picked, otherwise pixel component from second
  34087. video stream is picked.
  34088. </p>
  34089. <p>This filter accepts the following options:
  34090. </p><dl class="table">
  34091. <dt><samp class="option">threshold</samp></dt>
  34092. <dd><p>Set threshold used when picking pixels from absolute difference from two input
  34093. video streams.
  34094. </p>
  34095. </dd>
  34096. <dt><samp class="option">planes</samp></dt>
  34097. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  34098. copied from second stream.
  34099. By default value 0xf, all planes will be processed.
  34100. </p>
  34101. </dd>
  34102. <dt><samp class="option">mode</samp></dt>
  34103. <dd><p>Set mode of filter operation. Can be <code class="code">abs</code> or <code class="code">diff</code>.
  34104. Default is <code class="code">abs</code>.
  34105. </p></dd>
  34106. </dl>
  34107. <ul class="mini-toc">
  34108. <li><a href="#Commands-117" accesskey="1">Commands</a></li>
  34109. </ul>
  34110. <div class="subsection-level-extent" id="Commands-117">
  34111. <h4 class="subsection"><span>30.159.1 Commands<a class="copiable-link" href="#Commands-117"> &para;</a></span></h4>
  34112. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34113. </p>
  34114. </div>
  34115. </div>
  34116. <div class="section-level-extent" id="maskfun">
  34117. <h3 class="section"><span>30.160 maskfun<a class="copiable-link" href="#maskfun"> &para;</a></span></h3>
  34118. <p>Create mask from input video.
  34119. </p>
  34120. <p>For example it is useful to create motion masks after <code class="code">tblend</code> filter.
  34121. </p>
  34122. <p>This filter accepts the following options:
  34123. </p>
  34124. <dl class="table">
  34125. <dt><samp class="option">low</samp></dt>
  34126. <dd><p>Set low threshold. Any pixel component lower or exact than this value will be set to 0.
  34127. </p>
  34128. </dd>
  34129. <dt><samp class="option">high</samp></dt>
  34130. <dd><p>Set high threshold. Any pixel component higher than this value will be set to max value
  34131. allowed for current pixel format.
  34132. </p>
  34133. </dd>
  34134. <dt><samp class="option">planes</samp></dt>
  34135. <dd><p>Set planes to filter, by default all available planes are filtered.
  34136. </p>
  34137. </dd>
  34138. <dt><samp class="option">fill</samp></dt>
  34139. <dd><p>Fill all frame pixels with this value.
  34140. </p>
  34141. </dd>
  34142. <dt><samp class="option">sum</samp></dt>
  34143. <dd><p>Set max average pixel value for frame. If sum of all pixel components is higher that this
  34144. average, output frame will be completely filled with value set by <var class="var">fill</var> option.
  34145. Typically useful for scene changes when used in combination with <code class="code">tblend</code> filter.
  34146. </p></dd>
  34147. </dl>
  34148. <ul class="mini-toc">
  34149. <li><a href="#Commands-118" accesskey="1">Commands</a></li>
  34150. </ul>
  34151. <div class="subsection-level-extent" id="Commands-118">
  34152. <h4 class="subsection"><span>30.160.1 Commands<a class="copiable-link" href="#Commands-118"> &para;</a></span></h4>
  34153. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34154. </p>
  34155. </div>
  34156. </div>
  34157. <div class="section-level-extent" id="mcdeint">
  34158. <h3 class="section"><span>30.161 mcdeint<a class="copiable-link" href="#mcdeint"> &para;</a></span></h3>
  34159. <p>Apply motion-compensation deinterlacing.
  34160. </p>
  34161. <p>It needs one field per frame as input and must thus be used together
  34162. with yadif=1/3 or equivalent.
  34163. </p>
  34164. <p>This filter accepts the following options:
  34165. </p><dl class="table">
  34166. <dt><samp class="option">mode</samp></dt>
  34167. <dd><p>Set the deinterlacing mode.
  34168. </p>
  34169. <p>It accepts one of the following values:
  34170. </p><dl class="table">
  34171. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  34172. <dt>&lsquo;<samp class="samp">medium</samp>&rsquo;</dt>
  34173. <dt>&lsquo;<samp class="samp">slow</samp>&rsquo;</dt>
  34174. <dd><p>use iterative motion estimation
  34175. </p></dd>
  34176. <dt>&lsquo;<samp class="samp">extra_slow</samp>&rsquo;</dt>
  34177. <dd><p>like &lsquo;<samp class="samp">slow</samp>&rsquo;, but use multiple reference frames.
  34178. </p></dd>
  34179. </dl>
  34180. <p>Default value is &lsquo;<samp class="samp">fast</samp>&rsquo;.
  34181. </p>
  34182. </dd>
  34183. <dt><samp class="option">parity</samp></dt>
  34184. <dd><p>Set the picture field parity assumed for the input video. It must be
  34185. one of the following values:
  34186. </p>
  34187. <dl class="table">
  34188. <dt>&lsquo;<samp class="samp">0, tff</samp>&rsquo;</dt>
  34189. <dd><p>assume top field first
  34190. </p></dd>
  34191. <dt>&lsquo;<samp class="samp">1, bff</samp>&rsquo;</dt>
  34192. <dd><p>assume bottom field first
  34193. </p></dd>
  34194. </dl>
  34195. <p>Default value is &lsquo;<samp class="samp">bff</samp>&rsquo;.
  34196. </p>
  34197. </dd>
  34198. <dt><samp class="option">qp</samp></dt>
  34199. <dd><p>Set per-block quantization parameter (QP) used by the internal
  34200. encoder.
  34201. </p>
  34202. <p>Higher values should result in a smoother motion vector field but less
  34203. optimal individual vectors. Default value is 1.
  34204. </p></dd>
  34205. </dl>
  34206. </div>
  34207. <div class="section-level-extent" id="median">
  34208. <h3 class="section"><span>30.162 median<a class="copiable-link" href="#median"> &para;</a></span></h3>
  34209. <p>Pick median pixel from certain rectangle defined by radius.
  34210. </p>
  34211. <p>This filter accepts the following options:
  34212. </p>
  34213. <dl class="table">
  34214. <dt><samp class="option">radius</samp></dt>
  34215. <dd><p>Set horizontal radius size. Default value is <code class="code">1</code>.
  34216. Allowed range is integer from 1 to 127.
  34217. </p>
  34218. </dd>
  34219. <dt><samp class="option">planes</samp></dt>
  34220. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  34221. </p>
  34222. </dd>
  34223. <dt><samp class="option">radiusV</samp></dt>
  34224. <dd><p>Set vertical radius size. Default value is <code class="code">0</code>.
  34225. Allowed range is integer from 0 to 127.
  34226. If it is 0, value will be picked from horizontal <code class="code">radius</code> option.
  34227. </p>
  34228. </dd>
  34229. <dt><samp class="option">percentile</samp></dt>
  34230. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  34231. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  34232. minimum values, and <code class="code">1</code> maximum values.
  34233. </p></dd>
  34234. </dl>
  34235. <ul class="mini-toc">
  34236. <li><a href="#Commands-119" accesskey="1">Commands</a></li>
  34237. </ul>
  34238. <div class="subsection-level-extent" id="Commands-119">
  34239. <h4 class="subsection"><span>30.162.1 Commands<a class="copiable-link" href="#Commands-119"> &para;</a></span></h4>
  34240. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  34241. The command accepts the same syntax of the corresponding option.
  34242. </p>
  34243. <p>If the specified expression is not valid, it is kept at its current
  34244. value.
  34245. </p>
  34246. </div>
  34247. </div>
  34248. <div class="section-level-extent" id="mergeplanes">
  34249. <h3 class="section"><span>30.163 mergeplanes<a class="copiable-link" href="#mergeplanes"> &para;</a></span></h3>
  34250. <p>Merge color channel components from several video streams.
  34251. </p>
  34252. <p>The filter accepts up to 4 input streams, and merge selected input
  34253. planes to the output video.
  34254. </p>
  34255. <p>This filter accepts the following options:
  34256. </p><dl class="table">
  34257. <dt><samp class="option">mapping</samp></dt>
  34258. <dd><p>Set input to output plane mapping. Default is <code class="code">0</code>.
  34259. </p>
  34260. <p>The mappings is specified as a bitmap. It should be specified as a
  34261. hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. &rsquo;Aa&rsquo; describes the
  34262. mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
  34263. the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
  34264. corresponding input to use (from 0 to 3). The rest of the mappings is
  34265. similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
  34266. plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
  34267. &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
  34268. </p>
  34269. </dd>
  34270. <dt><samp class="option">format</samp></dt>
  34271. <dd><p>Set output pixel format. Default is <code class="code">yuva444p</code>.
  34272. </p>
  34273. </dd>
  34274. <dt><samp class="option">map0s</samp></dt>
  34275. <dt><samp class="option">map1s</samp></dt>
  34276. <dt><samp class="option">map2s</samp></dt>
  34277. <dt><samp class="option">map3s</samp></dt>
  34278. <dd><p>Set input to output stream mapping for output Nth plane. Default is <code class="code">0</code>.
  34279. </p>
  34280. </dd>
  34281. <dt><samp class="option">map0p</samp></dt>
  34282. <dt><samp class="option">map1p</samp></dt>
  34283. <dt><samp class="option">map2p</samp></dt>
  34284. <dt><samp class="option">map3p</samp></dt>
  34285. <dd><p>Set input to output plane mapping for output Nth plane. Default is <code class="code">0</code>.
  34286. </p></dd>
  34287. </dl>
  34288. <ul class="mini-toc">
  34289. <li><a href="#Examples-113" accesskey="1">Examples</a></li>
  34290. </ul>
  34291. <div class="subsection-level-extent" id="Examples-113">
  34292. <h4 class="subsection"><span>30.163.1 Examples<a class="copiable-link" href="#Examples-113"> &para;</a></span></h4>
  34293. <ul class="itemize mark-bullet">
  34294. <li>Merge three gray video streams of same width and height into single video stream:
  34295. <div class="example">
  34296. <pre class="example-preformatted">[a0][a1][a2]mergeplanes=0x001020:yuv444p
  34297. </pre></div>
  34298. </li><li>Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
  34299. <div class="example">
  34300. <pre class="example-preformatted">[a0][a1]mergeplanes=0x00010210:yuva444p
  34301. </pre></div>
  34302. </li><li>Swap Y and A plane in yuva444p stream:
  34303. <div class="example">
  34304. <pre class="example-preformatted">format=yuva444p,mergeplanes=0x03010200:yuva444p
  34305. </pre></div>
  34306. </li><li>Swap U and V plane in yuv420p stream:
  34307. <div class="example">
  34308. <pre class="example-preformatted">format=yuv420p,mergeplanes=0x000201:yuv420p
  34309. </pre></div>
  34310. </li><li>Cast a rgb24 clip to yuv444p:
  34311. <div class="example">
  34312. <pre class="example-preformatted">format=rgb24,mergeplanes=0x000102:yuv444p
  34313. </pre></div>
  34314. </li></ul>
  34315. </div>
  34316. </div>
  34317. <div class="section-level-extent" id="mestimate">
  34318. <h3 class="section"><span>30.164 mestimate<a class="copiable-link" href="#mestimate"> &para;</a></span></h3>
  34319. <p>Estimate and export motion vectors using block matching algorithms.
  34320. Motion vectors are stored in frame side data to be used by other filters.
  34321. </p>
  34322. <p>This filter accepts the following options:
  34323. </p><dl class="table">
  34324. <dt><samp class="option">method</samp></dt>
  34325. <dd><p>Specify the motion estimation method. Accepts one of the following values:
  34326. </p>
  34327. <dl class="table">
  34328. <dt>&lsquo;<samp class="samp">esa</samp>&rsquo;</dt>
  34329. <dd><p>Exhaustive search algorithm.
  34330. </p></dd>
  34331. <dt>&lsquo;<samp class="samp">tss</samp>&rsquo;</dt>
  34332. <dd><p>Three step search algorithm.
  34333. </p></dd>
  34334. <dt>&lsquo;<samp class="samp">tdls</samp>&rsquo;</dt>
  34335. <dd><p>Two dimensional logarithmic search algorithm.
  34336. </p></dd>
  34337. <dt>&lsquo;<samp class="samp">ntss</samp>&rsquo;</dt>
  34338. <dd><p>New three step search algorithm.
  34339. </p></dd>
  34340. <dt>&lsquo;<samp class="samp">fss</samp>&rsquo;</dt>
  34341. <dd><p>Four step search algorithm.
  34342. </p></dd>
  34343. <dt>&lsquo;<samp class="samp">ds</samp>&rsquo;</dt>
  34344. <dd><p>Diamond search algorithm.
  34345. </p></dd>
  34346. <dt>&lsquo;<samp class="samp">hexbs</samp>&rsquo;</dt>
  34347. <dd><p>Hexagon-based search algorithm.
  34348. </p></dd>
  34349. <dt>&lsquo;<samp class="samp">epzs</samp>&rsquo;</dt>
  34350. <dd><p>Enhanced predictive zonal search algorithm.
  34351. </p></dd>
  34352. <dt>&lsquo;<samp class="samp">umh</samp>&rsquo;</dt>
  34353. <dd><p>Uneven multi-hexagon search algorithm.
  34354. </p></dd>
  34355. </dl>
  34356. <p>Default value is &lsquo;<samp class="samp">esa</samp>&rsquo;.
  34357. </p>
  34358. </dd>
  34359. <dt><samp class="option">mb_size</samp></dt>
  34360. <dd><p>Macroblock size. Default <code class="code">16</code>.
  34361. </p>
  34362. </dd>
  34363. <dt><samp class="option">search_param</samp></dt>
  34364. <dd><p>Search parameter. Default <code class="code">7</code>.
  34365. </p></dd>
  34366. </dl>
  34367. </div>
  34368. <div class="section-level-extent" id="midequalizer">
  34369. <h3 class="section"><span>30.165 midequalizer<a class="copiable-link" href="#midequalizer"> &para;</a></span></h3>
  34370. <p>Apply Midway Image Equalization effect using two video streams.
  34371. </p>
  34372. <p>Midway Image Equalization adjusts a pair of images to have the same
  34373. histogram, while maintaining their dynamics as much as possible. It&rsquo;s
  34374. useful for e.g. matching exposures from a pair of stereo cameras.
  34375. </p>
  34376. <p>This filter has two inputs and one output, which must be of same pixel format, but
  34377. may be of different sizes. The output of filter is first input adjusted with
  34378. midway histogram of both inputs.
  34379. </p>
  34380. <p>This filter accepts the following option:
  34381. </p>
  34382. <dl class="table">
  34383. <dt><samp class="option">planes</samp></dt>
  34384. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  34385. </p></dd>
  34386. </dl>
  34387. </div>
  34388. <div class="section-level-extent" id="minterpolate">
  34389. <h3 class="section"><span>30.166 minterpolate<a class="copiable-link" href="#minterpolate"> &para;</a></span></h3>
  34390. <p>Convert the video to specified frame rate using motion interpolation.
  34391. </p>
  34392. <p>This filter accepts the following options:
  34393. </p><dl class="table">
  34394. <dt><samp class="option">fps</samp></dt>
  34395. <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>.
  34396. </p>
  34397. </dd>
  34398. <dt><samp class="option">mi_mode</samp></dt>
  34399. <dd><p>Motion interpolation mode. Following values are accepted:
  34400. </p><dl class="table">
  34401. <dt>&lsquo;<samp class="samp">dup</samp>&rsquo;</dt>
  34402. <dd><p>Duplicate previous or next frame for interpolating new ones.
  34403. </p></dd>
  34404. <dt>&lsquo;<samp class="samp">blend</samp>&rsquo;</dt>
  34405. <dd><p>Blend source frames. Interpolated frame is mean of previous and next frames.
  34406. </p></dd>
  34407. <dt>&lsquo;<samp class="samp">mci</samp>&rsquo;</dt>
  34408. <dd><p>Motion compensated interpolation. Following options are effective when this mode is selected:
  34409. </p>
  34410. <dl class="table">
  34411. <dt>&lsquo;<samp class="samp">mc_mode</samp>&rsquo;</dt>
  34412. <dd><p>Motion compensation mode. Following values are accepted:
  34413. </p><dl class="table">
  34414. <dt>&lsquo;<samp class="samp">obmc</samp>&rsquo;</dt>
  34415. <dd><p>Overlapped block motion compensation.
  34416. </p></dd>
  34417. <dt>&lsquo;<samp class="samp">aobmc</samp>&rsquo;</dt>
  34418. <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.
  34419. </p></dd>
  34420. </dl>
  34421. <p>Default mode is &lsquo;<samp class="samp">obmc</samp>&rsquo;.
  34422. </p>
  34423. </dd>
  34424. <dt>&lsquo;<samp class="samp">me_mode</samp>&rsquo;</dt>
  34425. <dd><p>Motion estimation mode. Following values are accepted:
  34426. </p><dl class="table">
  34427. <dt>&lsquo;<samp class="samp">bidir</samp>&rsquo;</dt>
  34428. <dd><p>Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions.
  34429. </p></dd>
  34430. <dt>&lsquo;<samp class="samp">bilat</samp>&rsquo;</dt>
  34431. <dd><p>Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame.
  34432. </p></dd>
  34433. </dl>
  34434. <p>Default mode is &lsquo;<samp class="samp">bilat</samp>&rsquo;.
  34435. </p>
  34436. </dd>
  34437. <dt>&lsquo;<samp class="samp">me</samp>&rsquo;</dt>
  34438. <dd><p>The algorithm to be used for motion estimation. Following values are accepted:
  34439. </p><dl class="table">
  34440. <dt>&lsquo;<samp class="samp">esa</samp>&rsquo;</dt>
  34441. <dd><p>Exhaustive search algorithm.
  34442. </p></dd>
  34443. <dt>&lsquo;<samp class="samp">tss</samp>&rsquo;</dt>
  34444. <dd><p>Three step search algorithm.
  34445. </p></dd>
  34446. <dt>&lsquo;<samp class="samp">tdls</samp>&rsquo;</dt>
  34447. <dd><p>Two dimensional logarithmic search algorithm.
  34448. </p></dd>
  34449. <dt>&lsquo;<samp class="samp">ntss</samp>&rsquo;</dt>
  34450. <dd><p>New three step search algorithm.
  34451. </p></dd>
  34452. <dt>&lsquo;<samp class="samp">fss</samp>&rsquo;</dt>
  34453. <dd><p>Four step search algorithm.
  34454. </p></dd>
  34455. <dt>&lsquo;<samp class="samp">ds</samp>&rsquo;</dt>
  34456. <dd><p>Diamond search algorithm.
  34457. </p></dd>
  34458. <dt>&lsquo;<samp class="samp">hexbs</samp>&rsquo;</dt>
  34459. <dd><p>Hexagon-based search algorithm.
  34460. </p></dd>
  34461. <dt>&lsquo;<samp class="samp">epzs</samp>&rsquo;</dt>
  34462. <dd><p>Enhanced predictive zonal search algorithm.
  34463. </p></dd>
  34464. <dt>&lsquo;<samp class="samp">umh</samp>&rsquo;</dt>
  34465. <dd><p>Uneven multi-hexagon search algorithm.
  34466. </p></dd>
  34467. </dl>
  34468. <p>Default algorithm is &lsquo;<samp class="samp">epzs</samp>&rsquo;.
  34469. </p>
  34470. </dd>
  34471. <dt>&lsquo;<samp class="samp">mb_size</samp>&rsquo;</dt>
  34472. <dd><p>Macroblock size. Default <code class="code">16</code>.
  34473. </p>
  34474. </dd>
  34475. <dt>&lsquo;<samp class="samp">search_param</samp>&rsquo;</dt>
  34476. <dd><p>Motion estimation search parameter. Default <code class="code">32</code>.
  34477. </p>
  34478. </dd>
  34479. <dt>&lsquo;<samp class="samp">vsbmc</samp>&rsquo;</dt>
  34480. <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).
  34481. </p></dd>
  34482. </dl>
  34483. </dd>
  34484. </dl>
  34485. </dd>
  34486. <dt><samp class="option">scd</samp></dt>
  34487. <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:
  34488. </p><dl class="table">
  34489. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  34490. <dd><p>Disable scene change detection.
  34491. </p></dd>
  34492. <dt>&lsquo;<samp class="samp">fdiff</samp>&rsquo;</dt>
  34493. <dd><p>Frame difference. Corresponding pixel values are compared and if it satisfies <var class="var">scd_threshold</var> scene change is detected.
  34494. </p></dd>
  34495. </dl>
  34496. <p>Default method is &lsquo;<samp class="samp">fdiff</samp>&rsquo;.
  34497. </p>
  34498. </dd>
  34499. <dt><samp class="option">scd_threshold</samp></dt>
  34500. <dd><p>Scene change detection threshold. Default is <code class="code">10.</code>.
  34501. </p></dd>
  34502. </dl>
  34503. </div>
  34504. <div class="section-level-extent" id="mix">
  34505. <h3 class="section"><span>30.167 mix<a class="copiable-link" href="#mix"> &para;</a></span></h3>
  34506. <p>Mix several video input streams into one video stream.
  34507. </p>
  34508. <p>A description of the accepted options follows.
  34509. </p>
  34510. <dl class="table">
  34511. <dt><samp class="option">inputs</samp></dt>
  34512. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  34513. </p>
  34514. </dd>
  34515. <dt><samp class="option">weights</samp></dt>
  34516. <dd><p>Specify weight of each input video stream as sequence.
  34517. Each weight is separated by space. If number of weights
  34518. is smaller than number of <var class="var">frames</var> last specified
  34519. weight will be used for all remaining unset weights.
  34520. </p>
  34521. </dd>
  34522. <dt><samp class="option">scale</samp></dt>
  34523. <dd><p>Specify scale, if it is set it will be multiplied with sum
  34524. of each weight multiplied with pixel values to give final destination
  34525. pixel value. By default <var class="var">scale</var> is auto scaled to sum of weights.
  34526. </p>
  34527. </dd>
  34528. <dt><samp class="option">planes</samp></dt>
  34529. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  34530. </p>
  34531. </dd>
  34532. <dt><samp class="option">duration</samp></dt>
  34533. <dd><p>Specify how end of stream is determined.
  34534. </p><dl class="table">
  34535. <dt>&lsquo;<samp class="samp">longest</samp>&rsquo;</dt>
  34536. <dd><p>The duration of the longest input. (default)
  34537. </p>
  34538. </dd>
  34539. <dt>&lsquo;<samp class="samp">shortest</samp>&rsquo;</dt>
  34540. <dd><p>The duration of the shortest input.
  34541. </p>
  34542. </dd>
  34543. <dt>&lsquo;<samp class="samp">first</samp>&rsquo;</dt>
  34544. <dd><p>The duration of the first input.
  34545. </p></dd>
  34546. </dl>
  34547. </dd>
  34548. </dl>
  34549. <ul class="mini-toc">
  34550. <li><a href="#Commands-120" accesskey="1">Commands</a></li>
  34551. </ul>
  34552. <div class="subsection-level-extent" id="Commands-120">
  34553. <h4 class="subsection"><span>30.167.1 Commands<a class="copiable-link" href="#Commands-120"> &para;</a></span></h4>
  34554. <p>This filter supports the following commands:
  34555. </p><dl class="table">
  34556. <dt><samp class="option">weights</samp></dt>
  34557. <dt><samp class="option">scale</samp></dt>
  34558. <dt><samp class="option">planes</samp></dt>
  34559. <dd><p>Syntax is same as option with same name.
  34560. </p></dd>
  34561. </dl>
  34562. </div>
  34563. </div>
  34564. <div class="section-level-extent" id="monochrome">
  34565. <h3 class="section"><span>30.168 monochrome<a class="copiable-link" href="#monochrome"> &para;</a></span></h3>
  34566. <p>Convert video to gray using custom color filter.
  34567. </p>
  34568. <p>A description of the accepted options follows.
  34569. </p>
  34570. <dl class="table">
  34571. <dt><samp class="option">cb</samp></dt>
  34572. <dd><p>Set the chroma blue spot. Allowed range is from -1 to 1.
  34573. Default value is 0.
  34574. </p>
  34575. </dd>
  34576. <dt><samp class="option">cr</samp></dt>
  34577. <dd><p>Set the chroma red spot. Allowed range is from -1 to 1.
  34578. Default value is 0.
  34579. </p>
  34580. </dd>
  34581. <dt><samp class="option">size</samp></dt>
  34582. <dd><p>Set the color filter size. Allowed range is from .1 to 10.
  34583. Default value is 1.
  34584. </p>
  34585. </dd>
  34586. <dt><samp class="option">high</samp></dt>
  34587. <dd><p>Set the highlights strength. Allowed range is from 0 to 1.
  34588. Default value is 0.
  34589. </p></dd>
  34590. </dl>
  34591. <ul class="mini-toc">
  34592. <li><a href="#Commands-121" accesskey="1">Commands</a></li>
  34593. </ul>
  34594. <div class="subsection-level-extent" id="Commands-121">
  34595. <h4 class="subsection"><span>30.168.1 Commands<a class="copiable-link" href="#Commands-121"> &para;</a></span></h4>
  34596. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34597. </p>
  34598. </div>
  34599. </div>
  34600. <div class="section-level-extent" id="morpho">
  34601. <h3 class="section"><span>30.169 morpho<a class="copiable-link" href="#morpho"> &para;</a></span></h3>
  34602. <p>This filter allows to apply main morphological grayscale transforms,
  34603. erode and dilate with arbitrary structures set in second input stream.
  34604. </p>
  34605. <p>Unlike naive implementation and much slower performance in <a class="ref" href="#erosion">erosion</a>
  34606. and <a class="ref" href="#dilation">dilation</a> filters, when speed is critical <code class="code">morpho</code> filter
  34607. should be used instead.
  34608. </p>
  34609. <p>A description of accepted options follows,
  34610. </p>
  34611. <dl class="table">
  34612. <dt><samp class="option">mode</samp></dt>
  34613. <dd><p>Set morphological transform to apply, can be:
  34614. </p>
  34615. <dl class="table">
  34616. <dt>&lsquo;<samp class="samp">erode</samp>&rsquo;</dt>
  34617. <dt>&lsquo;<samp class="samp">dilate</samp>&rsquo;</dt>
  34618. <dt>&lsquo;<samp class="samp">open</samp>&rsquo;</dt>
  34619. <dt>&lsquo;<samp class="samp">close</samp>&rsquo;</dt>
  34620. <dt>&lsquo;<samp class="samp">gradient</samp>&rsquo;</dt>
  34621. <dt>&lsquo;<samp class="samp">tophat</samp>&rsquo;</dt>
  34622. <dt>&lsquo;<samp class="samp">blackhat</samp>&rsquo;</dt>
  34623. </dl>
  34624. <p>Default is <code class="code">erode</code>.
  34625. </p>
  34626. </dd>
  34627. <dt><samp class="option">planes</samp></dt>
  34628. <dd><p>Set planes to filter, by default all planes except alpha are filtered.
  34629. </p>
  34630. </dd>
  34631. <dt><samp class="option">structure</samp></dt>
  34632. <dd><p>Set which structure video frames will be processed from second input stream,
  34633. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  34634. </p></dd>
  34635. </dl>
  34636. <p>The <code class="code">morpho</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  34637. </p>
  34638. <ul class="mini-toc">
  34639. <li><a href="#Commands-122" accesskey="1">Commands</a></li>
  34640. </ul>
  34641. <div class="subsection-level-extent" id="Commands-122">
  34642. <h4 class="subsection"><span>30.169.1 Commands<a class="copiable-link" href="#Commands-122"> &para;</a></span></h4>
  34643. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  34644. </p>
  34645. </div>
  34646. </div>
  34647. <div class="section-level-extent" id="mpdecimate">
  34648. <h3 class="section"><span>30.170 mpdecimate<a class="copiable-link" href="#mpdecimate"> &para;</a></span></h3>
  34649. <p>Drop frames that do not differ greatly from the previous frame in
  34650. order to reduce frame rate.
  34651. </p>
  34652. <p>The main use of this filter is for very-low-bitrate encoding
  34653. (e.g. streaming over dialup modem), but it could in theory be used for
  34654. fixing movies that were inverse-telecined incorrectly.
  34655. </p>
  34656. <p>A description of the accepted options follows.
  34657. </p>
  34658. <dl class="table">
  34659. <dt><samp class="option">max</samp></dt>
  34660. <dd><p>Set the maximum number of consecutive frames which can be dropped (if
  34661. positive), or the minimum interval between dropped frames (if
  34662. negative). If the value is 0, the frame is dropped disregarding the
  34663. number of previous sequentially dropped frames.
  34664. </p>
  34665. <p>Default value is 0.
  34666. </p>
  34667. </dd>
  34668. <dt><samp class="option">keep</samp></dt>
  34669. <dd><p>Set the maximum number of consecutive similar frames to ignore before to start dropping them.
  34670. If the value is 0, the frame is dropped disregarding the
  34671. number of previous sequentially similar frames.
  34672. </p>
  34673. <p>Default value is 0.
  34674. </p>
  34675. </dd>
  34676. <dt><samp class="option">hi</samp></dt>
  34677. <dt><samp class="option">lo</samp></dt>
  34678. <dt><samp class="option">frac</samp></dt>
  34679. <dd><p>Set the dropping threshold values.
  34680. </p>
  34681. <p>Values for <samp class="option">hi</samp> and <samp class="option">lo</samp> are for 8x8 pixel blocks and
  34682. represent actual pixel value differences, so a threshold of 64
  34683. corresponds to 1 unit of difference for each pixel, or the same spread
  34684. out differently over the block.
  34685. </p>
  34686. <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
  34687. than a threshold of <samp class="option">hi</samp>, and if no more than <samp class="option">frac</samp> blocks (1
  34688. meaning the whole image) differ by more than a threshold of <samp class="option">lo</samp>.
  34689. </p>
  34690. <p>Default value for <samp class="option">hi</samp> is 64*12, default value for <samp class="option">lo</samp> is
  34691. 64*5, and default value for <samp class="option">frac</samp> is 0.33.
  34692. </p></dd>
  34693. </dl>
  34694. </div>
  34695. <div class="section-level-extent" id="msad">
  34696. <h3 class="section"><span>30.171 msad<a class="copiable-link" href="#msad"> &para;</a></span></h3>
  34697. <p>Obtain the MSAD (Mean Sum of Absolute Differences) between two input videos.
  34698. </p>
  34699. <p>This filter takes two input videos.
  34700. </p>
  34701. <p>Both input videos must have the same resolution and pixel format for
  34702. this filter to work correctly. Also it assumes that both inputs
  34703. have the same number of frames, which are compared one by one.
  34704. </p>
  34705. <p>The obtained per component, average, min and max MSAD is printed through
  34706. the logging system.
  34707. </p>
  34708. <p>The filter stores the calculated MSAD of each frame in frame metadata.
  34709. </p>
  34710. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  34711. </p>
  34712. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  34713. with the reference file <samp class="file">ref.mpg</samp>.
  34714. </p>
  34715. <div class="example">
  34716. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi msad -f null -
  34717. </pre></div>
  34718. </div>
  34719. <div class="section-level-extent" id="multiply">
  34720. <h3 class="section"><span>30.172 multiply<a class="copiable-link" href="#multiply"> &para;</a></span></h3>
  34721. <p>Multiply first video stream pixels values with second video stream pixels values.
  34722. </p>
  34723. <p>The filter accepts the following options:
  34724. </p>
  34725. <dl class="table">
  34726. <dt><samp class="option">scale</samp></dt>
  34727. <dd><p>Set the scale applied to second video stream. By default is <code class="code">1</code>.
  34728. Allowed range is from <code class="code">0</code> to <code class="code">9</code>.
  34729. </p>
  34730. </dd>
  34731. <dt><samp class="option">offset</samp></dt>
  34732. <dd><p>Set the offset applied to second video stream. By default is <code class="code">0.5</code>.
  34733. Allowed range is from <code class="code">-1</code> to <code class="code">1</code>.
  34734. </p>
  34735. </dd>
  34736. <dt><samp class="option">planes</samp></dt>
  34737. <dd><p>Specify planes from input video stream that will be processed.
  34738. By default all planes are processed.
  34739. </p></dd>
  34740. </dl>
  34741. <ul class="mini-toc">
  34742. <li><a href="#Commands-123" accesskey="1">Commands</a></li>
  34743. </ul>
  34744. <div class="subsection-level-extent" id="Commands-123">
  34745. <h4 class="subsection"><span>30.172.1 Commands<a class="copiable-link" href="#Commands-123"> &para;</a></span></h4>
  34746. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  34747. </p>
  34748. </div>
  34749. </div>
  34750. <div class="section-level-extent" id="negate">
  34751. <h3 class="section"><span>30.173 negate<a class="copiable-link" href="#negate"> &para;</a></span></h3>
  34752. <p>Negate (invert) the input video.
  34753. </p>
  34754. <p>It accepts the following option:
  34755. </p>
  34756. <dl class="table">
  34757. <dt><samp class="option">components</samp></dt>
  34758. <dd><p>Set components to negate.
  34759. </p>
  34760. <p>Available values for components are:
  34761. </p><dl class="table">
  34762. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  34763. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  34764. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  34765. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  34766. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  34767. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  34768. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  34769. </dl>
  34770. </dd>
  34771. <dt><samp class="option">negate_alpha</samp></dt>
  34772. <dd><p>With value 1, it negates the alpha component, if present. Default value is 0.
  34773. </p></dd>
  34774. </dl>
  34775. <ul class="mini-toc">
  34776. <li><a href="#Commands-124" accesskey="1">Commands</a></li>
  34777. </ul>
  34778. <div class="subsection-level-extent" id="Commands-124">
  34779. <h4 class="subsection"><span>30.173.1 Commands<a class="copiable-link" href="#Commands-124"> &para;</a></span></h4>
  34780. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  34781. </p>
  34782. <a class="anchor" id="nlmeans"></a></div>
  34783. </div>
  34784. <div class="section-level-extent" id="nlmeans-1">
  34785. <h3 class="section"><span>30.174 nlmeans<a class="copiable-link" href="#nlmeans-1"> &para;</a></span></h3>
  34786. <p>Denoise frames using Non-Local Means algorithm.
  34787. </p>
  34788. <p>Each pixel is adjusted by looking for other pixels with similar contexts. This
  34789. context similarity is defined by comparing their surrounding patches of size
  34790. <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>
  34791. around the pixel.
  34792. </p>
  34793. <p>Note that the research area defines centers for patches, which means some
  34794. patches will be made of pixels outside that research area.
  34795. </p>
  34796. <p>The filter accepts the following options.
  34797. </p>
  34798. <dl class="table">
  34799. <dt><samp class="option">s</samp></dt>
  34800. <dd><p>Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0].
  34801. </p>
  34802. </dd>
  34803. <dt><samp class="option">p</samp></dt>
  34804. <dd><p>Set patch size. Default is 7. Must be odd number in range [0, 99].
  34805. </p>
  34806. </dd>
  34807. <dt><samp class="option">pc</samp></dt>
  34808. <dd><p>Same as <samp class="option">p</samp> but for chroma planes.
  34809. </p>
  34810. <p>The default value is <var class="var">0</var> and means automatic.
  34811. </p>
  34812. </dd>
  34813. <dt><samp class="option">r</samp></dt>
  34814. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  34815. </p>
  34816. </dd>
  34817. <dt><samp class="option">rc</samp></dt>
  34818. <dd><p>Same as <samp class="option">r</samp> but for chroma planes.
  34819. </p>
  34820. <p>The default value is <var class="var">0</var> and means automatic.
  34821. </p></dd>
  34822. </dl>
  34823. </div>
  34824. <div class="section-level-extent" id="nnedi">
  34825. <h3 class="section"><span>30.175 nnedi<a class="copiable-link" href="#nnedi"> &para;</a></span></h3>
  34826. <p>Deinterlace video using neural network edge directed interpolation.
  34827. </p>
  34828. <p>This filter accepts the following options:
  34829. </p>
  34830. <dl class="table">
  34831. <dt><samp class="option">weights</samp></dt>
  34832. <dd><p>Mandatory option, without binary file filter can not work.
  34833. Currently file can be found here:
  34834. https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin
  34835. </p>
  34836. </dd>
  34837. <dt><samp class="option">deint</samp></dt>
  34838. <dd><p>Set which frames to deinterlace, by default it is <code class="code">all</code>.
  34839. Can be <code class="code">all</code> or <code class="code">interlaced</code>.
  34840. </p>
  34841. </dd>
  34842. <dt><samp class="option">field</samp></dt>
  34843. <dd><p>Set mode of operation.
  34844. </p>
  34845. <p>Can be one of the following:
  34846. </p>
  34847. <dl class="table">
  34848. <dt>&lsquo;<samp class="samp">af</samp>&rsquo;</dt>
  34849. <dd><p>Use frame flags, both fields.
  34850. </p></dd>
  34851. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  34852. <dd><p>Use frame flags, single field.
  34853. </p></dd>
  34854. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  34855. <dd><p>Use top field only.
  34856. </p></dd>
  34857. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  34858. <dd><p>Use bottom field only.
  34859. </p></dd>
  34860. <dt>&lsquo;<samp class="samp">tf</samp>&rsquo;</dt>
  34861. <dd><p>Use both fields, top first.
  34862. </p></dd>
  34863. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  34864. <dd><p>Use both fields, bottom first.
  34865. </p></dd>
  34866. </dl>
  34867. </dd>
  34868. <dt><samp class="option">planes</samp></dt>
  34869. <dd><p>Set which planes to process, by default filter process all frames.
  34870. </p>
  34871. </dd>
  34872. <dt><samp class="option">nsize</samp></dt>
  34873. <dd><p>Set size of local neighborhood around each pixel, used by the predictor neural
  34874. network.
  34875. </p>
  34876. <p>Can be one of the following:
  34877. </p>
  34878. <dl class="table">
  34879. <dt>&lsquo;<samp class="samp">s8x6</samp>&rsquo;</dt>
  34880. <dt>&lsquo;<samp class="samp">s16x6</samp>&rsquo;</dt>
  34881. <dt>&lsquo;<samp class="samp">s32x6</samp>&rsquo;</dt>
  34882. <dt>&lsquo;<samp class="samp">s48x6</samp>&rsquo;</dt>
  34883. <dt>&lsquo;<samp class="samp">s8x4</samp>&rsquo;</dt>
  34884. <dt>&lsquo;<samp class="samp">s16x4</samp>&rsquo;</dt>
  34885. <dt>&lsquo;<samp class="samp">s32x4</samp>&rsquo;</dt>
  34886. </dl>
  34887. </dd>
  34888. <dt><samp class="option">nns</samp></dt>
  34889. <dd><p>Set the number of neurons in predictor neural network.
  34890. Can be one of the following:
  34891. </p>
  34892. <dl class="table">
  34893. <dt>&lsquo;<samp class="samp">n16</samp>&rsquo;</dt>
  34894. <dt>&lsquo;<samp class="samp">n32</samp>&rsquo;</dt>
  34895. <dt>&lsquo;<samp class="samp">n64</samp>&rsquo;</dt>
  34896. <dt>&lsquo;<samp class="samp">n128</samp>&rsquo;</dt>
  34897. <dt>&lsquo;<samp class="samp">n256</samp>&rsquo;</dt>
  34898. </dl>
  34899. </dd>
  34900. <dt><samp class="option">qual</samp></dt>
  34901. <dd><p>Controls the number of different neural network predictions that are blended
  34902. together to compute the final output value. Can be <code class="code">fast</code>, default or
  34903. <code class="code">slow</code>.
  34904. </p>
  34905. </dd>
  34906. <dt><samp class="option">etype</samp></dt>
  34907. <dd><p>Set which set of weights to use in the predictor.
  34908. Can be one of the following:
  34909. </p>
  34910. <dl class="table">
  34911. <dt>&lsquo;<samp class="samp">a, abs</samp>&rsquo;</dt>
  34912. <dd><p>weights trained to minimize absolute error
  34913. </p></dd>
  34914. <dt>&lsquo;<samp class="samp">s, mse</samp>&rsquo;</dt>
  34915. <dd><p>weights trained to minimize squared error
  34916. </p></dd>
  34917. </dl>
  34918. </dd>
  34919. <dt><samp class="option">pscrn</samp></dt>
  34920. <dd><p>Controls whether or not the prescreener neural network is used to decide
  34921. which pixels should be processed by the predictor neural network and which
  34922. can be handled by simple cubic interpolation.
  34923. The prescreener is trained to know whether cubic interpolation will be
  34924. sufficient for a pixel or whether it should be predicted by the predictor nn.
  34925. The computational complexity of the prescreener nn is much less than that of
  34926. the predictor nn. Since most pixels can be handled by cubic interpolation,
  34927. using the prescreener generally results in much faster processing.
  34928. The prescreener is pretty accurate, so the difference between using it and not
  34929. using it is almost always unnoticeable.
  34930. </p>
  34931. <p>Can be one of the following:
  34932. </p>
  34933. <dl class="table">
  34934. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  34935. <dt>&lsquo;<samp class="samp">original</samp>&rsquo;</dt>
  34936. <dt>&lsquo;<samp class="samp">new</samp>&rsquo;</dt>
  34937. <dt>&lsquo;<samp class="samp">new2</samp>&rsquo;</dt>
  34938. <dt>&lsquo;<samp class="samp">new3</samp>&rsquo;</dt>
  34939. </dl>
  34940. <p>Default is <code class="code">new</code>.
  34941. </p></dd>
  34942. </dl>
  34943. <ul class="mini-toc">
  34944. <li><a href="#Commands-125" accesskey="1">Commands</a></li>
  34945. </ul>
  34946. <div class="subsection-level-extent" id="Commands-125">
  34947. <h4 class="subsection"><span>30.175.1 Commands<a class="copiable-link" href="#Commands-125"> &para;</a></span></h4>
  34948. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options, excluding <var class="var">weights</var> option.
  34949. </p>
  34950. </div>
  34951. </div>
  34952. <div class="section-level-extent" id="noformat">
  34953. <h3 class="section"><span>30.176 noformat<a class="copiable-link" href="#noformat"> &para;</a></span></h3>
  34954. <p>Force libavfilter not to use any of the specified pixel formats for the
  34955. input to the next filter.
  34956. </p>
  34957. <p>It accepts the following parameters:
  34958. </p><dl class="table">
  34959. <dt><samp class="option">pix_fmts</samp></dt>
  34960. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  34961. pix_fmts=yuv420p|monow|rgb24&quot;.
  34962. </p>
  34963. </dd>
  34964. </dl>
  34965. <ul class="mini-toc">
  34966. <li><a href="#Examples-114" accesskey="1">Examples</a></li>
  34967. </ul>
  34968. <div class="subsection-level-extent" id="Examples-114">
  34969. <h4 class="subsection"><span>30.176.1 Examples<a class="copiable-link" href="#Examples-114"> &para;</a></span></h4>
  34970. <ul class="itemize mark-bullet">
  34971. <li>Force libavfilter to use a format different from <var class="var">yuv420p</var> for the
  34972. input to the vflip filter:
  34973. <div class="example">
  34974. <pre class="example-preformatted">noformat=pix_fmts=yuv420p,vflip
  34975. </pre></div>
  34976. </li><li>Convert the input video to any of the formats not contained in the list:
  34977. <div class="example">
  34978. <pre class="example-preformatted">noformat=yuv420p|yuv444p|yuv410p
  34979. </pre></div>
  34980. </li></ul>
  34981. </div>
  34982. </div>
  34983. <div class="section-level-extent" id="noise-1">
  34984. <h3 class="section"><span>30.177 noise<a class="copiable-link" href="#noise-1"> &para;</a></span></h3>
  34985. <p>Add noise on video input frame.
  34986. </p>
  34987. <p>The filter accepts the following options:
  34988. </p>
  34989. <dl class="table">
  34990. <dt><samp class="option">all_seed</samp></dt>
  34991. <dt><samp class="option">c0_seed</samp></dt>
  34992. <dt><samp class="option">c1_seed</samp></dt>
  34993. <dt><samp class="option">c2_seed</samp></dt>
  34994. <dt><samp class="option">c3_seed</samp></dt>
  34995. <dd><p>Set noise seed for specific pixel component or all pixel components in case
  34996. of <var class="var">all_seed</var>. Default value is <code class="code">123457</code>.
  34997. </p>
  34998. </dd>
  34999. <dt><samp class="option">all_strength, alls</samp></dt>
  35000. <dt><samp class="option">c0_strength, c0s</samp></dt>
  35001. <dt><samp class="option">c1_strength, c1s</samp></dt>
  35002. <dt><samp class="option">c2_strength, c2s</samp></dt>
  35003. <dt><samp class="option">c3_strength, c3s</samp></dt>
  35004. <dd><p>Set noise strength for specific pixel component or all pixel components in case
  35005. <var class="var">all_strength</var>. Default value is <code class="code">0</code>. Allowed range is [0, 100].
  35006. </p>
  35007. </dd>
  35008. <dt><samp class="option">all_flags, allf</samp></dt>
  35009. <dt><samp class="option">c0_flags, c0f</samp></dt>
  35010. <dt><samp class="option">c1_flags, c1f</samp></dt>
  35011. <dt><samp class="option">c2_flags, c2f</samp></dt>
  35012. <dt><samp class="option">c3_flags, c3f</samp></dt>
  35013. <dd><p>Set pixel component flags or set flags for all components if <var class="var">all_flags</var>.
  35014. Available values for component flags are:
  35015. </p><dl class="table">
  35016. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  35017. <dd><p>averaged temporal noise (smoother)
  35018. </p></dd>
  35019. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  35020. <dd><p>mix random noise with a (semi)regular pattern
  35021. </p></dd>
  35022. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  35023. <dd><p>temporal noise (noise pattern changes between frames)
  35024. </p></dd>
  35025. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  35026. <dd><p>uniform noise (gaussian otherwise)
  35027. </p></dd>
  35028. </dl>
  35029. </dd>
  35030. </dl>
  35031. <ul class="mini-toc">
  35032. <li><a href="#Examples-115" accesskey="1">Examples</a></li>
  35033. </ul>
  35034. <div class="subsection-level-extent" id="Examples-115">
  35035. <h4 class="subsection"><span>30.177.1 Examples<a class="copiable-link" href="#Examples-115"> &para;</a></span></h4>
  35036. <p>Add temporal and uniform noise to input video:
  35037. </p><div class="example">
  35038. <pre class="example-preformatted">noise=alls=20:allf=t+u
  35039. </pre></div>
  35040. </div>
  35041. </div>
  35042. <div class="section-level-extent" id="normalize">
  35043. <h3 class="section"><span>30.178 normalize<a class="copiable-link" href="#normalize"> &para;</a></span></h3>
  35044. <p>Normalize RGB video (aka histogram stretching, contrast stretching).
  35045. See: https://en.wikipedia.org/wiki/Normalization_(image_processing)
  35046. </p>
  35047. <p>For each channel of each frame, the filter computes the input range and maps
  35048. it linearly to the user-specified output range. The output range defaults
  35049. to the full dynamic range from pure black to pure white.
  35050. </p>
  35051. <p>Temporal smoothing can be used on the input range to reduce flickering (rapid
  35052. changes in brightness) caused when small dark or bright objects enter or leave
  35053. the scene. This is similar to the auto-exposure (automatic gain control) on a
  35054. video camera, and, like a video camera, it may cause a period of over- or
  35055. under-exposure of the video.
  35056. </p>
  35057. <p>The R,G,B channels can be normalized independently, which may cause some
  35058. color shifting, or linked together as a single channel, which prevents
  35059. color shifting. Linked normalization preserves hue. Independent normalization
  35060. does not, so it can be used to remove some color casts. Independent and linked
  35061. normalization can be combined in any ratio.
  35062. </p>
  35063. <p>The normalize filter accepts the following options:
  35064. </p>
  35065. <dl class="table">
  35066. <dt><samp class="option">blackpt</samp></dt>
  35067. <dt><samp class="option">whitept</samp></dt>
  35068. <dd><p>Colors which define the output range. The minimum input value is mapped to
  35069. the <var class="var">blackpt</var>. The maximum input value is mapped to the <var class="var">whitept</var>.
  35070. The defaults are black and white respectively. Specifying white for
  35071. <var class="var">blackpt</var> and black for <var class="var">whitept</var> will give color-inverted,
  35072. normalized video. Shades of grey can be used to reduce the dynamic range
  35073. (contrast). Specifying saturated colors here can create some interesting
  35074. effects.
  35075. </p>
  35076. </dd>
  35077. <dt><samp class="option">smoothing</samp></dt>
  35078. <dd><p>The number of previous frames to use for temporal smoothing. The input range
  35079. of each channel is smoothed using a rolling average over the current frame
  35080. and the <var class="var">smoothing</var> previous frames. The default is 0 (no temporal
  35081. smoothing).
  35082. </p>
  35083. </dd>
  35084. <dt><samp class="option">independence</samp></dt>
  35085. <dd><p>Controls the ratio of independent (color shifting) channel normalization to
  35086. linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully
  35087. independent. Defaults to 1.0 (fully independent).
  35088. </p>
  35089. </dd>
  35090. <dt><samp class="option">strength</samp></dt>
  35091. <dd><p>Overall strength of the filter. 1.0 is full strength. 0.0 is a rather
  35092. expensive no-op. Defaults to 1.0 (full strength).
  35093. </p>
  35094. </dd>
  35095. </dl>
  35096. <ul class="mini-toc">
  35097. <li><a href="#Commands-126" accesskey="1">Commands</a></li>
  35098. <li><a href="#Examples-116" accesskey="2">Examples</a></li>
  35099. </ul>
  35100. <div class="subsection-level-extent" id="Commands-126">
  35101. <h4 class="subsection"><span>30.178.1 Commands<a class="copiable-link" href="#Commands-126"> &para;</a></span></h4>
  35102. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options, excluding <var class="var">smoothing</var> option.
  35103. The command accepts the same syntax of the corresponding option.
  35104. </p>
  35105. <p>If the specified expression is not valid, it is kept at its current
  35106. value.
  35107. </p>
  35108. </div>
  35109. <div class="subsection-level-extent" id="Examples-116">
  35110. <h4 class="subsection"><span>30.178.2 Examples<a class="copiable-link" href="#Examples-116"> &para;</a></span></h4>
  35111. <p>Stretch video contrast to use the full dynamic range, with no temporal
  35112. smoothing; may flicker depending on the source content:
  35113. </p><div class="example">
  35114. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=0
  35115. </pre></div>
  35116. <p>As above, but with 50 frames of temporal smoothing; flicker should be
  35117. reduced, depending on the source content:
  35118. </p><div class="example">
  35119. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50
  35120. </pre></div>
  35121. <p>As above, but with hue-preserving linked channel normalization:
  35122. </p><div class="example">
  35123. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50:independence=0
  35124. </pre></div>
  35125. <p>As above, but with half strength:
  35126. </p><div class="example">
  35127. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
  35128. </pre></div>
  35129. <p>Map the darkest input color to red, the brightest input color to cyan:
  35130. </p><div class="example">
  35131. <pre class="example-preformatted">normalize=blackpt=red:whitept=cyan
  35132. </pre></div>
  35133. </div>
  35134. </div>
  35135. <div class="section-level-extent" id="null-1">
  35136. <h3 class="section"><span>30.179 null<a class="copiable-link" href="#null-1"> &para;</a></span></h3>
  35137. <p>Pass the video source unchanged to the output.
  35138. </p>
  35139. </div>
  35140. <div class="section-level-extent" id="ocr">
  35141. <h3 class="section"><span>30.180 ocr<a class="copiable-link" href="#ocr"> &para;</a></span></h3>
  35142. <p>Optical Character Recognition
  35143. </p>
  35144. <p>This filter uses Tesseract for optical character recognition. To enable
  35145. compilation of this filter, you need to configure FFmpeg with
  35146. <code class="code">--enable-libtesseract</code>.
  35147. </p>
  35148. <p>It accepts the following options:
  35149. </p>
  35150. <dl class="table">
  35151. <dt><samp class="option">datapath</samp></dt>
  35152. <dd><p>Set datapath to tesseract data. Default is to use whatever was
  35153. set at installation.
  35154. </p>
  35155. </dd>
  35156. <dt><samp class="option">language</samp></dt>
  35157. <dd><p>Set language, default is &quot;eng&quot;.
  35158. </p>
  35159. </dd>
  35160. <dt><samp class="option">whitelist</samp></dt>
  35161. <dd><p>Set character whitelist.
  35162. </p>
  35163. </dd>
  35164. <dt><samp class="option">blacklist</samp></dt>
  35165. <dd><p>Set character blacklist.
  35166. </p></dd>
  35167. </dl>
  35168. <p>The filter exports recognized text as the frame metadata <code class="code">lavfi.ocr.text</code>.
  35169. The filter exports confidence of recognized words as the frame metadata <code class="code">lavfi.ocr.confidence</code>.
  35170. </p>
  35171. </div>
  35172. <div class="section-level-extent" id="ocv">
  35173. <h3 class="section"><span>30.181 ocv<a class="copiable-link" href="#ocv"> &para;</a></span></h3>
  35174. <p>Apply a video transform using libopencv.
  35175. </p>
  35176. <p>To enable this filter, install the libopencv library and headers and
  35177. configure FFmpeg with <code class="code">--enable-libopencv</code>.
  35178. </p>
  35179. <p>It accepts the following parameters:
  35180. </p>
  35181. <dl class="table">
  35182. <dt><samp class="option">filter_name</samp></dt>
  35183. <dd><p>The name of the libopencv filter to apply.
  35184. </p>
  35185. </dd>
  35186. <dt><samp class="option">filter_params</samp></dt>
  35187. <dd><p>The parameters to pass to the libopencv filter. If not specified, the default
  35188. values are assumed.
  35189. </p>
  35190. </dd>
  35191. </dl>
  35192. <p>Refer to the official libopencv documentation for more precise
  35193. information:
  35194. <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>
  35195. </p>
  35196. <p>Several libopencv filters are supported; see the following subsections.
  35197. </p>
  35198. <a class="anchor" id="dilate"></a><ul class="mini-toc">
  35199. <li><a href="#dilate-1" accesskey="1">dilate</a></li>
  35200. <li><a href="#erode" accesskey="2">erode</a></li>
  35201. <li><a href="#smooth" accesskey="3">smooth</a></li>
  35202. </ul>
  35203. <div class="subsection-level-extent" id="dilate-1">
  35204. <h4 class="subsection"><span>30.181.1 dilate<a class="copiable-link" href="#dilate-1"> &para;</a></span></h4>
  35205. <p>Dilate an image by using a specific structuring element.
  35206. It corresponds to the libopencv function <code class="code">cvDilate</code>.
  35207. </p>
  35208. <p>It accepts the parameters: <var class="var">struct_el</var>|<var class="var">nb_iterations</var>.
  35209. </p>
  35210. <p><var class="var">struct_el</var> represents a structuring element, and has the syntax:
  35211. <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>
  35212. </p>
  35213. <p><var class="var">cols</var> and <var class="var">rows</var> represent the number of columns and rows of
  35214. the structuring element, <var class="var">anchor_x</var> and <var class="var">anchor_y</var> the anchor
  35215. point, and <var class="var">shape</var> the shape for the structuring element. <var class="var">shape</var>
  35216. must be &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, or &quot;custom&quot;.
  35217. </p>
  35218. <p>If the value for <var class="var">shape</var> is &quot;custom&quot;, it must be followed by a
  35219. string of the form &quot;=<var class="var">filename</var>&quot;. The file with name
  35220. <var class="var">filename</var> is assumed to represent a binary image, with each
  35221. printable character corresponding to a bright pixel. When a custom
  35222. <var class="var">shape</var> is used, <var class="var">cols</var> and <var class="var">rows</var> are ignored, the number
  35223. or columns and rows of the read file are assumed instead.
  35224. </p>
  35225. <p>The default value for <var class="var">struct_el</var> is &quot;3x3+0x0/rect&quot;.
  35226. </p>
  35227. <p><var class="var">nb_iterations</var> specifies the number of times the transform is
  35228. applied to the image, and defaults to 1.
  35229. </p>
  35230. <p>Some examples:
  35231. </p><div class="example">
  35232. <pre class="example-preformatted"># Use the default values
  35233. ocv=dilate
  35234. # Dilate using a structuring element with a 5x5 cross, iterating two times
  35235. ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
  35236. # Read the shape from the file diamond.shape, iterating two times.
  35237. # The file diamond.shape may contain a pattern of characters like this
  35238. # *
  35239. # ***
  35240. # *****
  35241. # ***
  35242. # *
  35243. # The specified columns and rows are ignored
  35244. # but the anchor point coordinates are not
  35245. ocv=dilate:0x0+2x2/custom=diamond.shape|2
  35246. </pre></div>
  35247. </div>
  35248. <div class="subsection-level-extent" id="erode">
  35249. <h4 class="subsection"><span>30.181.2 erode<a class="copiable-link" href="#erode"> &para;</a></span></h4>
  35250. <p>Erode an image by using a specific structuring element.
  35251. It corresponds to the libopencv function <code class="code">cvErode</code>.
  35252. </p>
  35253. <p>It accepts the parameters: <var class="var">struct_el</var>:<var class="var">nb_iterations</var>,
  35254. with the same syntax and semantics as the <a class="ref" href="#dilate">dilate</a> filter.
  35255. </p>
  35256. </div>
  35257. <div class="subsection-level-extent" id="smooth">
  35258. <h4 class="subsection"><span>30.181.3 smooth<a class="copiable-link" href="#smooth"> &para;</a></span></h4>
  35259. <p>Smooth the input video.
  35260. </p>
  35261. <p>The filter takes the following parameters:
  35262. <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>.
  35263. </p>
  35264. <p><var class="var">type</var> is the type of smooth filter to apply, and must be one of
  35265. the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
  35266. or &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
  35267. </p>
  35268. <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>
  35269. depends on the smooth type. <var class="var">param1</var> and
  35270. <var class="var">param2</var> accept integer positive values or 0. <var class="var">param3</var> and
  35271. <var class="var">param4</var> accept floating point values.
  35272. </p>
  35273. <p>The default value for <var class="var">param1</var> is 3. The default value for the
  35274. other parameters is 0.
  35275. </p>
  35276. <p>These parameters correspond to the parameters assigned to the
  35277. libopencv function <code class="code">cvSmooth</code>.
  35278. </p>
  35279. </div>
  35280. </div>
  35281. <div class="section-level-extent" id="oscilloscope">
  35282. <h3 class="section"><span>30.182 oscilloscope<a class="copiable-link" href="#oscilloscope"> &para;</a></span></h3>
  35283. <p>2D Video Oscilloscope.
  35284. </p>
  35285. <p>Useful to measure spatial impulse, step responses, chroma delays, etc.
  35286. </p>
  35287. <p>It accepts the following parameters:
  35288. </p>
  35289. <dl class="table">
  35290. <dt><samp class="option">x</samp></dt>
  35291. <dd><p>Set scope center x position.
  35292. </p>
  35293. </dd>
  35294. <dt><samp class="option">y</samp></dt>
  35295. <dd><p>Set scope center y position.
  35296. </p>
  35297. </dd>
  35298. <dt><samp class="option">s</samp></dt>
  35299. <dd><p>Set scope size, relative to frame diagonal.
  35300. </p>
  35301. </dd>
  35302. <dt><samp class="option">t</samp></dt>
  35303. <dd><p>Set scope tilt/rotation.
  35304. </p>
  35305. </dd>
  35306. <dt><samp class="option">o</samp></dt>
  35307. <dd><p>Set trace opacity.
  35308. </p>
  35309. </dd>
  35310. <dt><samp class="option">tx</samp></dt>
  35311. <dd><p>Set trace center x position.
  35312. </p>
  35313. </dd>
  35314. <dt><samp class="option">ty</samp></dt>
  35315. <dd><p>Set trace center y position.
  35316. </p>
  35317. </dd>
  35318. <dt><samp class="option">tw</samp></dt>
  35319. <dd><p>Set trace width, relative to width of frame.
  35320. </p>
  35321. </dd>
  35322. <dt><samp class="option">th</samp></dt>
  35323. <dd><p>Set trace height, relative to height of frame.
  35324. </p>
  35325. </dd>
  35326. <dt><samp class="option">c</samp></dt>
  35327. <dd><p>Set which components to trace. By default it traces first three components.
  35328. </p>
  35329. </dd>
  35330. <dt><samp class="option">g</samp></dt>
  35331. <dd><p>Draw trace grid. By default is enabled.
  35332. </p>
  35333. </dd>
  35334. <dt><samp class="option">st</samp></dt>
  35335. <dd><p>Draw some statistics. By default is enabled.
  35336. </p>
  35337. </dd>
  35338. <dt><samp class="option">sc</samp></dt>
  35339. <dd><p>Draw scope. By default is enabled.
  35340. </p></dd>
  35341. </dl>
  35342. <ul class="mini-toc">
  35343. <li><a href="#Commands-127" accesskey="1">Commands</a></li>
  35344. <li><a href="#Examples-117" accesskey="2">Examples</a></li>
  35345. </ul>
  35346. <div class="subsection-level-extent" id="Commands-127">
  35347. <h4 class="subsection"><span>30.182.1 Commands<a class="copiable-link" href="#Commands-127"> &para;</a></span></h4>
  35348. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  35349. The command accepts the same syntax of the corresponding option.
  35350. </p>
  35351. <p>If the specified expression is not valid, it is kept at its current
  35352. value.
  35353. </p>
  35354. </div>
  35355. <div class="subsection-level-extent" id="Examples-117">
  35356. <h4 class="subsection"><span>30.182.2 Examples<a class="copiable-link" href="#Examples-117"> &para;</a></span></h4>
  35357. <ul class="itemize mark-bullet">
  35358. <li>Inspect full first row of video frame.
  35359. <div class="example">
  35360. <pre class="example-preformatted">oscilloscope=x=0.5:y=0:s=1
  35361. </pre></div>
  35362. </li><li>Inspect full last row of video frame.
  35363. <div class="example">
  35364. <pre class="example-preformatted">oscilloscope=x=0.5:y=1:s=1
  35365. </pre></div>
  35366. </li><li>Inspect full 5th line of video frame of height 1080.
  35367. <div class="example">
  35368. <pre class="example-preformatted">oscilloscope=x=0.5:y=5/1080:s=1
  35369. </pre></div>
  35370. </li><li>Inspect full last column of video frame.
  35371. <div class="example">
  35372. <pre class="example-preformatted">oscilloscope=x=1:y=0.5:s=1:t=1
  35373. </pre></div>
  35374. </li></ul>
  35375. <a class="anchor" id="overlay"></a></div>
  35376. </div>
  35377. <div class="section-level-extent" id="overlay-1">
  35378. <h3 class="section"><span>30.183 overlay<a class="copiable-link" href="#overlay-1"> &para;</a></span></h3>
  35379. <p>Overlay one video on top of another.
  35380. </p>
  35381. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  35382. video on which the second input is overlaid.
  35383. </p>
  35384. <p>It accepts the following parameters:
  35385. </p>
  35386. <p>A description of the accepted options follows.
  35387. </p>
  35388. <dl class="table">
  35389. <dt><samp class="option">x</samp></dt>
  35390. <dt><samp class="option">y</samp></dt>
  35391. <dd><p>Set the expression for the x and y coordinates of the overlaid video
  35392. on the main video. Default value is &quot;0&quot; for both expressions. In case
  35393. the expression is invalid, it is set to a huge value (meaning that the
  35394. overlay will not be displayed within the output visible area).
  35395. </p>
  35396. </dd>
  35397. <dt><samp class="option">eof_action</samp></dt>
  35398. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  35399. </p>
  35400. </dd>
  35401. <dt><samp class="option">eval</samp></dt>
  35402. <dd><p>Set when the expressions for <samp class="option">x</samp>, and <samp class="option">y</samp> are evaluated.
  35403. </p>
  35404. <p>It accepts the following values:
  35405. </p><dl class="table">
  35406. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  35407. <dd><p>only evaluate expressions once during the filter initialization or
  35408. when a command is processed
  35409. </p>
  35410. </dd>
  35411. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  35412. <dd><p>evaluate expressions for each incoming frame
  35413. </p></dd>
  35414. </dl>
  35415. <p>Default value is &lsquo;<samp class="samp">frame</samp>&rsquo;.
  35416. </p>
  35417. </dd>
  35418. <dt><samp class="option">shortest</samp></dt>
  35419. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  35420. </p>
  35421. </dd>
  35422. <dt><samp class="option">format</samp></dt>
  35423. <dd><p>Set the format for the output video.
  35424. </p>
  35425. <p>It accepts the following values:
  35426. </p><dl class="table">
  35427. <dt>&lsquo;<samp class="samp">yuv420</samp>&rsquo;</dt>
  35428. <dd><p>force YUV 4:2:0 8-bit planar output
  35429. </p>
  35430. </dd>
  35431. <dt>&lsquo;<samp class="samp">yuv420p10</samp>&rsquo;</dt>
  35432. <dd><p>force YUV 4:2:0 10-bit planar output
  35433. </p>
  35434. </dd>
  35435. <dt>&lsquo;<samp class="samp">yuv422</samp>&rsquo;</dt>
  35436. <dd><p>force YUV 4:2:2 8-bit planar output
  35437. </p>
  35438. </dd>
  35439. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  35440. <dd><p>force YUV 4:2:2 10-bit planar output
  35441. </p>
  35442. </dd>
  35443. <dt>&lsquo;<samp class="samp">yuv444</samp>&rsquo;</dt>
  35444. <dd><p>force YUV 4:4:4 8-bit planar output
  35445. </p>
  35446. </dd>
  35447. <dt>&lsquo;<samp class="samp">yuv444p10</samp>&rsquo;</dt>
  35448. <dd><p>force YUV 4:4:4 10-bit planar output
  35449. </p>
  35450. </dd>
  35451. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  35452. <dd><p>force RGB 8-bit packed output
  35453. </p>
  35454. </dd>
  35455. <dt>&lsquo;<samp class="samp">gbrp</samp>&rsquo;</dt>
  35456. <dd><p>force RGB 8-bit planar output
  35457. </p>
  35458. </dd>
  35459. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  35460. <dd><p>automatically pick format
  35461. </p></dd>
  35462. </dl>
  35463. <p>Default value is &lsquo;<samp class="samp">yuv420</samp>&rsquo;.
  35464. </p>
  35465. </dd>
  35466. <dt><samp class="option">repeatlast</samp></dt>
  35467. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  35468. </p>
  35469. </dd>
  35470. <dt><samp class="option">alpha</samp></dt>
  35471. <dd><p>Set format of alpha of the overlaid video, it can be <var class="var">straight</var> or
  35472. <var class="var">premultiplied</var>. Default is <var class="var">straight</var>.
  35473. </p></dd>
  35474. </dl>
  35475. <p>The <samp class="option">x</samp>, and <samp class="option">y</samp> expressions can contain the following
  35476. parameters.
  35477. </p>
  35478. <dl class="table">
  35479. <dt><samp class="option">main_w, W</samp></dt>
  35480. <dt><samp class="option">main_h, H</samp></dt>
  35481. <dd><p>The main input width and height.
  35482. </p>
  35483. </dd>
  35484. <dt><samp class="option">overlay_w, w</samp></dt>
  35485. <dt><samp class="option">overlay_h, h</samp></dt>
  35486. <dd><p>The overlay input width and height.
  35487. </p>
  35488. </dd>
  35489. <dt><samp class="option">x</samp></dt>
  35490. <dt><samp class="option">y</samp></dt>
  35491. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  35492. each new frame.
  35493. </p>
  35494. </dd>
  35495. <dt><samp class="option">hsub</samp></dt>
  35496. <dt><samp class="option">vsub</samp></dt>
  35497. <dd><p>horizontal and vertical chroma subsample values of the output
  35498. format. For example for the pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and
  35499. <var class="var">vsub</var> is 1.
  35500. </p>
  35501. </dd>
  35502. <dt><samp class="option">n</samp></dt>
  35503. <dd><p>the number of input frame, starting from 0
  35504. </p>
  35505. </dd>
  35506. <dt><samp class="option">pos</samp></dt>
  35507. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  35508. do not use
  35509. </p>
  35510. </dd>
  35511. <dt><samp class="option">t</samp></dt>
  35512. <dd><p>The timestamp, expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  35513. </p>
  35514. </dd>
  35515. </dl>
  35516. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  35517. </p>
  35518. <p>Note that the <var class="var">n</var>, <var class="var">t</var> variables are available only
  35519. when evaluation is done <em class="emph">per frame</em>, and will evaluate to NAN
  35520. when <samp class="option">eval</samp> is set to &lsquo;<samp class="samp">init</samp>&rsquo;.
  35521. </p>
  35522. <p>Be aware that frames are taken from each input video in timestamp
  35523. order, hence, if their initial timestamps differ, it is a good idea
  35524. to pass the two inputs through a <var class="var">setpts=PTS-STARTPTS</var> filter to
  35525. have them begin in the same zero timestamp, as the example for
  35526. the <var class="var">movie</var> filter does.
  35527. </p>
  35528. <p>You can chain together more overlays but you should test the
  35529. efficiency of such approach.
  35530. </p>
  35531. <ul class="mini-toc">
  35532. <li><a href="#Commands-128" accesskey="1">Commands</a></li>
  35533. <li><a href="#Examples-118" accesskey="2">Examples</a></li>
  35534. </ul>
  35535. <div class="subsection-level-extent" id="Commands-128">
  35536. <h4 class="subsection"><span>30.183.1 Commands<a class="copiable-link" href="#Commands-128"> &para;</a></span></h4>
  35537. <p>This filter supports the following commands:
  35538. </p><dl class="table">
  35539. <dt><samp class="option">x</samp></dt>
  35540. <dt><samp class="option">y</samp></dt>
  35541. <dd><p>Modify the x and y of the overlay input.
  35542. The command accepts the same syntax of the corresponding option.
  35543. </p>
  35544. <p>If the specified expression is not valid, it is kept at its current
  35545. value.
  35546. </p></dd>
  35547. </dl>
  35548. </div>
  35549. <div class="subsection-level-extent" id="Examples-118">
  35550. <h4 class="subsection"><span>30.183.2 Examples<a class="copiable-link" href="#Examples-118"> &para;</a></span></h4>
  35551. <ul class="itemize mark-bullet">
  35552. <li>Draw the overlay at 10 pixels from the bottom right corner of the main
  35553. video:
  35554. <div class="example">
  35555. <pre class="example-preformatted">overlay=main_w-overlay_w-10:main_h-overlay_h-10
  35556. </pre></div>
  35557. <p>Using named options the example above becomes:
  35558. </p><div class="example">
  35559. <pre class="example-preformatted">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
  35560. </pre></div>
  35561. </li><li>Insert a transparent PNG logo in the bottom left corner of the input,
  35562. using the <code class="command">ffmpeg</code> tool with the <code class="code">-filter_complex</code> option:
  35563. <div class="example">
  35564. <pre class="example-preformatted">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
  35565. </pre></div>
  35566. </li><li>Insert 2 different transparent PNG logos (second logo on bottom
  35567. right corner) using the <code class="command">ffmpeg</code> tool:
  35568. <div class="example">
  35569. <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
  35570. </pre></div>
  35571. </li><li>Add a transparent color layer on top of the main video; <code class="code">WxH</code>
  35572. must specify the size of the main input to the overlay filter:
  35573. <div class="example">
  35574. <pre class="example-preformatted">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
  35575. </pre></div>
  35576. </li><li>Play an original video and a filtered version (here with the deshake
  35577. filter) side by side using the <code class="command">ffplay</code> tool:
  35578. <div class="example">
  35579. <pre class="example-preformatted">ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
  35580. </pre></div>
  35581. <p>The above command is the same as:
  35582. </p><div class="example">
  35583. <pre class="example-preformatted">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
  35584. </pre></div>
  35585. </li><li>Make a sliding overlay appearing from the left to the right top part of the
  35586. screen starting since time 2:
  35587. <div class="example">
  35588. <pre class="example-preformatted">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
  35589. </pre></div>
  35590. </li><li>Compose output by putting two input videos side to side:
  35591. <div class="example">
  35592. <pre class="example-preformatted">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
  35593. nullsrc=size=200x100 [background];
  35594. [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
  35595. [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
  35596. [background][left] overlay=shortest=1 [background+left];
  35597. [background+left][right] overlay=shortest=1:x=100 [left+right]
  35598. &quot;
  35599. </pre></div>
  35600. </li><li>Mask 10-20 seconds of a video by applying the delogo filter to a section
  35601. <div class="example">
  35602. <pre class="example-preformatted">ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
  35603. -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]'
  35604. masked.avi
  35605. </pre></div>
  35606. </li><li>Chain several overlays in cascade:
  35607. <div class="example">
  35608. <pre class="example-preformatted">nullsrc=s=200x200 [bg];
  35609. testsrc=s=100x100, split=4 [in0][in1][in2][in3];
  35610. [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
  35611. [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
  35612. [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
  35613. [in3] null, [mid2] overlay=100:100 [out0]
  35614. </pre></div>
  35615. </li></ul>
  35616. <a class="anchor" id="overlay_005fcuda"></a></div>
  35617. </div>
  35618. <div class="section-level-extent" id="overlay_005fcuda-1">
  35619. <h3 class="section"><span>30.184 overlay_cuda<a class="copiable-link" href="#overlay_005fcuda-1"> &para;</a></span></h3>
  35620. <p>Overlay one video on top of another.
  35621. </p>
  35622. <p>This is the CUDA variant of the <a class="ref" href="#overlay">overlay</a> filter.
  35623. It only accepts CUDA frames. The underlying input pixel formats have to match.
  35624. </p>
  35625. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  35626. video on which the second input is overlaid.
  35627. </p>
  35628. <p>It accepts the following parameters:
  35629. </p>
  35630. <dl class="table">
  35631. <dt><samp class="option">x</samp></dt>
  35632. <dt><samp class="option">y</samp></dt>
  35633. <dd><p>Set expressions for the x and y coordinates of the overlaid video
  35634. on the main video.
  35635. </p>
  35636. <p>They can contain the following parameters:
  35637. </p>
  35638. <dl class="table">
  35639. <dt><samp class="option">main_w, W</samp></dt>
  35640. <dt><samp class="option">main_h, H</samp></dt>
  35641. <dd><p>The main input width and height.
  35642. </p>
  35643. </dd>
  35644. <dt><samp class="option">overlay_w, w</samp></dt>
  35645. <dt><samp class="option">overlay_h, h</samp></dt>
  35646. <dd><p>The overlay input width and height.
  35647. </p>
  35648. </dd>
  35649. <dt><samp class="option">x</samp></dt>
  35650. <dt><samp class="option">y</samp></dt>
  35651. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  35652. each new frame.
  35653. </p>
  35654. </dd>
  35655. <dt><samp class="option">n</samp></dt>
  35656. <dd><p>The ordinal index of the main input frame, starting from 0.
  35657. </p>
  35658. </dd>
  35659. <dt><samp class="option">pos</samp></dt>
  35660. <dd><p>The byte offset position in the file of the main input frame, NAN if unknown.
  35661. Deprecated, do not use.
  35662. </p>
  35663. </dd>
  35664. <dt><samp class="option">t</samp></dt>
  35665. <dd><p>The timestamp of the main input frame, expressed in seconds, NAN if unknown.
  35666. </p>
  35667. </dd>
  35668. </dl>
  35669. <p>Default value is &quot;0&quot; for both expressions.
  35670. </p>
  35671. </dd>
  35672. <dt><samp class="option">eval</samp></dt>
  35673. <dd><p>Set when the expressions for <samp class="option">x</samp> and <samp class="option">y</samp> are evaluated.
  35674. </p>
  35675. <p>It accepts the following values:
  35676. </p><dl class="table">
  35677. <dt><samp class="option">init</samp></dt>
  35678. <dd><p>Evaluate expressions once during filter initialization or
  35679. when a command is processed.
  35680. </p>
  35681. </dd>
  35682. <dt><samp class="option">frame</samp></dt>
  35683. <dd><p>Evaluate expressions for each incoming frame
  35684. </p></dd>
  35685. </dl>
  35686. <p>Default value is <samp class="option">frame</samp>.
  35687. </p>
  35688. </dd>
  35689. <dt><samp class="option">eof_action</samp></dt>
  35690. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  35691. </p>
  35692. </dd>
  35693. <dt><samp class="option">shortest</samp></dt>
  35694. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  35695. </p>
  35696. </dd>
  35697. <dt><samp class="option">repeatlast</samp></dt>
  35698. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  35699. </p>
  35700. </dd>
  35701. </dl>
  35702. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  35703. </p>
  35704. </div>
  35705. <div class="section-level-extent" id="owdenoise">
  35706. <h3 class="section"><span>30.185 owdenoise<a class="copiable-link" href="#owdenoise"> &para;</a></span></h3>
  35707. <p>Apply Overcomplete Wavelet denoiser.
  35708. </p>
  35709. <p>The filter accepts the following options:
  35710. </p>
  35711. <dl class="table">
  35712. <dt><samp class="option">depth</samp></dt>
  35713. <dd><p>Set depth.
  35714. </p>
  35715. <p>Larger depth values will denoise lower frequency components more, but
  35716. slow down filtering.
  35717. </p>
  35718. <p>Must be an int in the range 8-16, default is <code class="code">8</code>.
  35719. </p>
  35720. </dd>
  35721. <dt><samp class="option">luma_strength, ls</samp></dt>
  35722. <dd><p>Set luma strength.
  35723. </p>
  35724. <p>Must be a double value in the range 0-1000, default is <code class="code">1.0</code>.
  35725. </p>
  35726. </dd>
  35727. <dt><samp class="option">chroma_strength, cs</samp></dt>
  35728. <dd><p>Set chroma strength.
  35729. </p>
  35730. <p>Must be a double value in the range 0-1000, default is <code class="code">1.0</code>.
  35731. </p></dd>
  35732. </dl>
  35733. <a class="anchor" id="pad"></a></div>
  35734. <div class="section-level-extent" id="pad-1">
  35735. <h3 class="section"><span>30.186 pad<a class="copiable-link" href="#pad-1"> &para;</a></span></h3>
  35736. <p>Add paddings to the input image, and place the original input at the
  35737. provided <var class="var">x</var>, <var class="var">y</var> coordinates.
  35738. </p>
  35739. <p>It accepts the following parameters:
  35740. </p>
  35741. <dl class="table">
  35742. <dt><samp class="option">width, w</samp></dt>
  35743. <dt><samp class="option">height, h</samp></dt>
  35744. <dd><p>Specify an expression for the size of the output image with the
  35745. paddings added. If the value for <var class="var">width</var> or <var class="var">height</var> is 0, the
  35746. corresponding input size is used for the output.
  35747. </p>
  35748. <p>The <var class="var">width</var> expression can reference the value set by the
  35749. <var class="var">height</var> expression, and vice versa.
  35750. </p>
  35751. <p>The default value of <var class="var">width</var> and <var class="var">height</var> is 0.
  35752. </p>
  35753. </dd>
  35754. <dt><samp class="option">x</samp></dt>
  35755. <dt><samp class="option">y</samp></dt>
  35756. <dd><p>Specify the offsets to place the input image at within the padded area,
  35757. with respect to the top/left border of the output image.
  35758. </p>
  35759. <p>The <var class="var">x</var> expression can reference the value set by the <var class="var">y</var>
  35760. expression, and vice versa.
  35761. </p>
  35762. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is 0.
  35763. </p>
  35764. <p>If <var class="var">x</var> or <var class="var">y</var> evaluate to a negative number, they&rsquo;ll be changed
  35765. so the input image is centered on the padded area.
  35766. </p>
  35767. </dd>
  35768. <dt><samp class="option">color</samp></dt>
  35769. <dd><p>Specify the color of the padded area. For the syntax of this option,
  35770. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  35771. manual</a>.
  35772. </p>
  35773. <p>The default value of <var class="var">color</var> is &quot;black&quot;.
  35774. </p>
  35775. </dd>
  35776. <dt><samp class="option">eval</samp></dt>
  35777. <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.
  35778. </p>
  35779. <p>It accepts the following values:
  35780. </p>
  35781. <dl class="table">
  35782. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  35783. <dd><p>Only evaluate expressions once during the filter initialization or when
  35784. a command is processed.
  35785. </p>
  35786. </dd>
  35787. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  35788. <dd><p>Evaluate expressions for each incoming frame.
  35789. </p>
  35790. </dd>
  35791. </dl>
  35792. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  35793. </p>
  35794. </dd>
  35795. <dt><samp class="option">aspect</samp></dt>
  35796. <dd><p>Pad to aspect instead to a resolution.
  35797. </p>
  35798. </dd>
  35799. </dl>
  35800. <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>
  35801. options are expressions containing the following constants:
  35802. </p>
  35803. <dl class="table">
  35804. <dt><samp class="option">in_w</samp></dt>
  35805. <dt><samp class="option">in_h</samp></dt>
  35806. <dd><p>The input video width and height.
  35807. </p>
  35808. </dd>
  35809. <dt><samp class="option">iw</samp></dt>
  35810. <dt><samp class="option">ih</samp></dt>
  35811. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  35812. </p>
  35813. </dd>
  35814. <dt><samp class="option">out_w</samp></dt>
  35815. <dt><samp class="option">out_h</samp></dt>
  35816. <dd><p>The output width and height (the size of the padded area), as
  35817. specified by the <var class="var">width</var> and <var class="var">height</var> expressions.
  35818. </p>
  35819. </dd>
  35820. <dt><samp class="option">ow</samp></dt>
  35821. <dt><samp class="option">oh</samp></dt>
  35822. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  35823. </p>
  35824. </dd>
  35825. <dt><samp class="option">x</samp></dt>
  35826. <dt><samp class="option">y</samp></dt>
  35827. <dd><p>The x and y offsets as specified by the <var class="var">x</var> and <var class="var">y</var>
  35828. expressions, or NAN if not yet specified.
  35829. </p>
  35830. </dd>
  35831. <dt><samp class="option">a</samp></dt>
  35832. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  35833. </p>
  35834. </dd>
  35835. <dt><samp class="option">sar</samp></dt>
  35836. <dd><p>input sample aspect ratio
  35837. </p>
  35838. </dd>
  35839. <dt><samp class="option">dar</samp></dt>
  35840. <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>
  35841. </p>
  35842. </dd>
  35843. <dt><samp class="option">hsub</samp></dt>
  35844. <dt><samp class="option">vsub</samp></dt>
  35845. <dd><p>The horizontal and vertical chroma subsample values. For example for the
  35846. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  35847. </p></dd>
  35848. </dl>
  35849. <ul class="mini-toc">
  35850. <li><a href="#Examples-119" accesskey="1">Examples</a></li>
  35851. </ul>
  35852. <div class="subsection-level-extent" id="Examples-119">
  35853. <h4 class="subsection"><span>30.186.1 Examples<a class="copiable-link" href="#Examples-119"> &para;</a></span></h4>
  35854. <ul class="itemize mark-bullet">
  35855. <li>Add paddings with the color &quot;violet&quot; to the input video. The output video
  35856. size is 640x480, and the top-left corner of the input video is placed at
  35857. column 0, row 40
  35858. <div class="example">
  35859. <pre class="example-preformatted">pad=640:480:0:40:violet
  35860. </pre></div>
  35861. <p>The example above is equivalent to the following command:
  35862. </p><div class="example">
  35863. <pre class="example-preformatted">pad=width=640:height=480:x=0:y=40:color=violet
  35864. </pre></div>
  35865. </li><li>Pad the input to get an output with dimensions increased by 3/2,
  35866. and put the input video at the center of the padded area:
  35867. <div class="example">
  35868. <pre class="example-preformatted">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
  35869. </pre></div>
  35870. </li><li>Pad the input to get a squared output with size equal to the maximum
  35871. value between the input width and height, and put the input video at
  35872. the center of the padded area:
  35873. <div class="example">
  35874. <pre class="example-preformatted">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
  35875. </pre></div>
  35876. </li><li>Pad the input to get a final w/h ratio of 16:9:
  35877. <div class="example">
  35878. <pre class="example-preformatted">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
  35879. </pre></div>
  35880. </li><li>In case of anamorphic video, in order to set the output display aspect
  35881. correctly, it is necessary to use <var class="var">sar</var> in the expression,
  35882. according to the relation:
  35883. <div class="example">
  35884. <pre class="example-preformatted">(ih * X / ih) * sar = output_dar
  35885. X = output_dar / sar
  35886. </pre></div>
  35887. <p>Thus the previous example needs to be modified to:
  35888. </p><div class="example">
  35889. <pre class="example-preformatted">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
  35890. </pre></div>
  35891. </li><li>Double the output size and put the input video in the bottom-right
  35892. corner of the output padded area:
  35893. <div class="example">
  35894. <pre class="example-preformatted">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
  35895. </pre></div>
  35896. </li></ul>
  35897. <a class="anchor" id="palettegen"></a></div>
  35898. </div>
  35899. <div class="section-level-extent" id="palettegen-1">
  35900. <h3 class="section"><span>30.187 palettegen<a class="copiable-link" href="#palettegen-1"> &para;</a></span></h3>
  35901. <p>Generate one palette for a whole video stream.
  35902. </p>
  35903. <p>It accepts the following options:
  35904. </p>
  35905. <dl class="table">
  35906. <dt><samp class="option">max_colors</samp></dt>
  35907. <dd><p>Set the maximum number of colors to quantize in the palette.
  35908. Note: the palette will still contain 256 colors; the unused palette entries
  35909. will be black.
  35910. </p>
  35911. </dd>
  35912. <dt><samp class="option">reserve_transparent</samp></dt>
  35913. <dd><p>Create a palette of 255 colors maximum and reserve the last one for
  35914. transparency. Reserving the transparency color is useful for GIF optimization.
  35915. If not set, the maximum of colors in the palette will be 256. You probably want
  35916. to disable this option for a standalone image.
  35917. Set by default.
  35918. </p>
  35919. </dd>
  35920. <dt><samp class="option">transparency_color</samp></dt>
  35921. <dd><p>Set the color that will be used as background for transparency.
  35922. </p>
  35923. </dd>
  35924. <dt><samp class="option">stats_mode</samp></dt>
  35925. <dd><p>Set statistics mode.
  35926. </p>
  35927. <p>It accepts the following values:
  35928. </p><dl class="table">
  35929. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  35930. <dd><p>Compute full frame histograms.
  35931. </p></dd>
  35932. <dt>&lsquo;<samp class="samp">diff</samp>&rsquo;</dt>
  35933. <dd><p>Compute histograms only for the part that differs from previous frame. This
  35934. might be relevant to give more importance to the moving part of your input if
  35935. the background is static.
  35936. </p></dd>
  35937. <dt>&lsquo;<samp class="samp">single</samp>&rsquo;</dt>
  35938. <dd><p>Compute new histogram for each frame.
  35939. </p></dd>
  35940. </dl>
  35941. <p>Default value is <var class="var">full</var>.
  35942. </p></dd>
  35943. </dl>
  35944. <p>The filter also exports the frame metadata <code class="code">lavfi.color_quant_ratio</code>
  35945. (<code class="code">nb_color_in / nb_color_out</code>) which you can use to evaluate the degree of
  35946. color quantization of the palette. This information is also visible at
  35947. <var class="var">info</var> logging level.
  35948. </p>
  35949. <ul class="mini-toc">
  35950. <li><a href="#Examples-120" accesskey="1">Examples</a></li>
  35951. </ul>
  35952. <div class="subsection-level-extent" id="Examples-120">
  35953. <h4 class="subsection"><span>30.187.1 Examples<a class="copiable-link" href="#Examples-120"> &para;</a></span></h4>
  35954. <ul class="itemize mark-bullet">
  35955. <li>Generate a representative palette of a given video using <code class="command">ffmpeg</code>:
  35956. <div class="example">
  35957. <pre class="example-preformatted">ffmpeg -i input.mkv -vf palettegen palette.png
  35958. </pre></div>
  35959. </li></ul>
  35960. </div>
  35961. </div>
  35962. <div class="section-level-extent" id="paletteuse">
  35963. <h3 class="section"><span>30.188 paletteuse<a class="copiable-link" href="#paletteuse"> &para;</a></span></h3>
  35964. <p>Use a palette to downsample an input video stream.
  35965. </p>
  35966. <p>The filter takes two inputs: one video stream and a palette. The palette must
  35967. be a 256 pixels image.
  35968. </p>
  35969. <p>It accepts the following options:
  35970. </p>
  35971. <dl class="table">
  35972. <dt><samp class="option">dither</samp></dt>
  35973. <dd><p>Select dithering mode. Available algorithms are:
  35974. </p><dl class="table">
  35975. <dt>&lsquo;<samp class="samp">bayer</samp>&rsquo;</dt>
  35976. <dd><p>Ordered 8x8 bayer dithering (deterministic)
  35977. </p></dd>
  35978. <dt>&lsquo;<samp class="samp">heckbert</samp>&rsquo;</dt>
  35979. <dd><p>Dithering as defined by Paul Heckbert in 1982 (simple error diffusion).
  35980. Note: this dithering is sometimes considered &quot;wrong&quot; and is included as a
  35981. reference.
  35982. </p></dd>
  35983. <dt>&lsquo;<samp class="samp">floyd_steinberg</samp>&rsquo;</dt>
  35984. <dd><p>Floyd and Steingberg dithering (error diffusion)
  35985. </p></dd>
  35986. <dt>&lsquo;<samp class="samp">sierra2</samp>&rsquo;</dt>
  35987. <dd><p>Frankie Sierra dithering v2 (error diffusion)
  35988. </p></dd>
  35989. <dt>&lsquo;<samp class="samp">sierra2_4a</samp>&rsquo;</dt>
  35990. <dd><p>Frankie Sierra dithering v2 &quot;Lite&quot; (error diffusion)
  35991. </p></dd>
  35992. <dt>&lsquo;<samp class="samp">sierra3</samp>&rsquo;</dt>
  35993. <dd><p>Frankie Sierra dithering v3 (error diffusion)
  35994. </p></dd>
  35995. <dt>&lsquo;<samp class="samp">burkes</samp>&rsquo;</dt>
  35996. <dd><p>Burkes dithering (error diffusion)
  35997. </p></dd>
  35998. <dt>&lsquo;<samp class="samp">atkinson</samp>&rsquo;</dt>
  35999. <dd><p>Atkinson dithering by Bill Atkinson at Apple Computer (error diffusion)
  36000. </p></dd>
  36001. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  36002. <dd><p>Disable dithering.
  36003. </p></dd>
  36004. </dl>
  36005. <p>Default is <var class="var">sierra2_4a</var>.
  36006. </p>
  36007. </dd>
  36008. <dt><samp class="option">bayer_scale</samp></dt>
  36009. <dd><p>When <var class="var">bayer</var> dithering is selected, this option defines the scale of the
  36010. pattern (how much the crosshatch pattern is visible). A low value means more
  36011. visible pattern for less banding, and higher value means less visible pattern
  36012. at the cost of more banding.
  36013. </p>
  36014. <p>The option must be an integer value in the range [0,5]. Default is <var class="var">2</var>.
  36015. </p>
  36016. </dd>
  36017. <dt><samp class="option">diff_mode</samp></dt>
  36018. <dd><p>If set, define the zone to process
  36019. </p>
  36020. <dl class="table">
  36021. <dt>&lsquo;<samp class="samp">rectangle</samp>&rsquo;</dt>
  36022. <dd><p>Only the changing rectangle will be reprocessed. This is similar to GIF
  36023. cropping/offsetting compression mechanism. This option can be useful for speed
  36024. if only a part of the image is changing, and has use cases such as limiting the
  36025. scope of the error diffusal <samp class="option">dither</samp> to the rectangle that bounds the
  36026. moving scene (it leads to more deterministic output if the scene doesn&rsquo;t change
  36027. much, and as a result less moving noise and better GIF compression).
  36028. </p></dd>
  36029. </dl>
  36030. <p>Default is <var class="var">none</var>.
  36031. </p>
  36032. </dd>
  36033. <dt><samp class="option">new</samp></dt>
  36034. <dd><p>Take new palette for each output frame.
  36035. </p>
  36036. </dd>
  36037. <dt><samp class="option">alpha_threshold</samp></dt>
  36038. <dd><p>Sets the alpha threshold for transparency. Alpha values above this threshold
  36039. will be treated as completely opaque, and values below this threshold will be
  36040. treated as completely transparent.
  36041. </p>
  36042. <p>The option must be an integer value in the range [0,255]. Default is <var class="var">128</var>.
  36043. </p></dd>
  36044. </dl>
  36045. <ul class="mini-toc">
  36046. <li><a href="#Examples-121" accesskey="1">Examples</a></li>
  36047. </ul>
  36048. <div class="subsection-level-extent" id="Examples-121">
  36049. <h4 class="subsection"><span>30.188.1 Examples<a class="copiable-link" href="#Examples-121"> &para;</a></span></h4>
  36050. <ul class="itemize mark-bullet">
  36051. <li>Use a palette (generated for example with <a class="ref" href="#palettegen">palettegen</a>) to encode a GIF
  36052. using <code class="command">ffmpeg</code>:
  36053. <div class="example">
  36054. <pre class="example-preformatted">ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
  36055. </pre></div>
  36056. </li></ul>
  36057. </div>
  36058. </div>
  36059. <div class="section-level-extent" id="perspective">
  36060. <h3 class="section"><span>30.189 perspective<a class="copiable-link" href="#perspective"> &para;</a></span></h3>
  36061. <p>Correct perspective of video not recorded perpendicular to the screen.
  36062. </p>
  36063. <p>A description of the accepted parameters follows.
  36064. </p>
  36065. <dl class="table">
  36066. <dt><samp class="option">x0</samp></dt>
  36067. <dt><samp class="option">y0</samp></dt>
  36068. <dt><samp class="option">x1</samp></dt>
  36069. <dt><samp class="option">y1</samp></dt>
  36070. <dt><samp class="option">x2</samp></dt>
  36071. <dt><samp class="option">y2</samp></dt>
  36072. <dt><samp class="option">x3</samp></dt>
  36073. <dt><samp class="option">y3</samp></dt>
  36074. <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
  36075. Default values are <code class="code">0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
  36076. If the <code class="code">sense</code> option is set to <code class="code">source</code>, then the specified points will be sent
  36077. to the corners of the destination. If the <code class="code">sense</code> option is set to <code class="code">destination</code>,
  36078. then the corners of the source will be sent to the specified coordinates.
  36079. </p>
  36080. <p>The expressions can use the following variables:
  36081. </p>
  36082. <dl class="table">
  36083. <dt><samp class="option">W</samp></dt>
  36084. <dt><samp class="option">H</samp></dt>
  36085. <dd><p>the width and height of video frame.
  36086. </p></dd>
  36087. <dt><samp class="option">in</samp></dt>
  36088. <dd><p>Input frame count.
  36089. </p></dd>
  36090. <dt><samp class="option">on</samp></dt>
  36091. <dd><p>Output frame count.
  36092. </p></dd>
  36093. </dl>
  36094. </dd>
  36095. <dt><samp class="option">interpolation</samp></dt>
  36096. <dd><p>Set interpolation for perspective correction.
  36097. </p>
  36098. <p>It accepts the following values:
  36099. </p><dl class="table">
  36100. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  36101. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  36102. </dl>
  36103. <p>Default value is &lsquo;<samp class="samp">linear</samp>&rsquo;.
  36104. </p>
  36105. </dd>
  36106. <dt><samp class="option">sense</samp></dt>
  36107. <dd><p>Set interpretation of coordinate options.
  36108. </p>
  36109. <p>It accepts the following values:
  36110. </p><dl class="table">
  36111. <dt>&lsquo;<samp class="samp">0, source</samp>&rsquo;</dt>
  36112. <dd>
  36113. <p>Send point in the source specified by the given coordinates to
  36114. the corners of the destination.
  36115. </p>
  36116. </dd>
  36117. <dt>&lsquo;<samp class="samp">1, destination</samp>&rsquo;</dt>
  36118. <dd>
  36119. <p>Send the corners of the source to the point in the destination specified
  36120. by the given coordinates.
  36121. </p>
  36122. <p>Default value is &lsquo;<samp class="samp">source</samp>&rsquo;.
  36123. </p></dd>
  36124. </dl>
  36125. </dd>
  36126. <dt><samp class="option">eval</samp></dt>
  36127. <dd><p>Set when the expressions for coordinates <samp class="option">x0,y0,...x3,y3</samp> are evaluated.
  36128. </p>
  36129. <p>It accepts the following values:
  36130. </p><dl class="table">
  36131. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  36132. <dd><p>only evaluate expressions once during the filter initialization or
  36133. when a command is processed
  36134. </p>
  36135. </dd>
  36136. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  36137. <dd><p>evaluate expressions for each incoming frame
  36138. </p></dd>
  36139. </dl>
  36140. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  36141. </p></dd>
  36142. </dl>
  36143. </div>
  36144. <div class="section-level-extent" id="phase">
  36145. <h3 class="section"><span>30.190 phase<a class="copiable-link" href="#phase"> &para;</a></span></h3>
  36146. <p>Delay interlaced video by one field time so that the field order changes.
  36147. </p>
  36148. <p>The intended use is to fix PAL movies that have been captured with the
  36149. opposite field order to the film-to-video transfer.
  36150. </p>
  36151. <p>A description of the accepted parameters follows.
  36152. </p>
  36153. <dl class="table">
  36154. <dt><samp class="option">mode</samp></dt>
  36155. <dd><p>Set phase mode.
  36156. </p>
  36157. <p>It accepts the following values:
  36158. </p><dl class="table">
  36159. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  36160. <dd><p>Capture field order top-first, transfer bottom-first.
  36161. Filter will delay the bottom field.
  36162. </p>
  36163. </dd>
  36164. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  36165. <dd><p>Capture field order bottom-first, transfer top-first.
  36166. Filter will delay the top field.
  36167. </p>
  36168. </dd>
  36169. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  36170. <dd><p>Capture and transfer with the same field order. This mode only exists
  36171. for the documentation of the other options to refer to, but if you
  36172. actually select it, the filter will faithfully do nothing.
  36173. </p>
  36174. </dd>
  36175. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  36176. <dd><p>Capture field order determined automatically by field flags, transfer
  36177. opposite.
  36178. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo; and &lsquo;<samp class="samp">b</samp>&rsquo; modes on a frame by frame
  36179. basis using field flags. If no field information is available,
  36180. then this works just like &lsquo;<samp class="samp">u</samp>&rsquo;.
  36181. </p>
  36182. </dd>
  36183. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  36184. <dd><p>Capture unknown or varying, transfer opposite.
  36185. 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
  36186. analyzing the images and selecting the alternative that produces best
  36187. match between the fields.
  36188. </p>
  36189. </dd>
  36190. <dt>&lsquo;<samp class="samp">T</samp>&rsquo;</dt>
  36191. <dd><p>Capture top-first, transfer unknown or varying.
  36192. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using image analysis.
  36193. </p>
  36194. </dd>
  36195. <dt>&lsquo;<samp class="samp">B</samp>&rsquo;</dt>
  36196. <dd><p>Capture bottom-first, transfer unknown or varying.
  36197. Filter selects among &lsquo;<samp class="samp">b</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using image analysis.
  36198. </p>
  36199. </dd>
  36200. <dt>&lsquo;<samp class="samp">A</samp>&rsquo;</dt>
  36201. <dd><p>Capture determined by field flags, transfer unknown or varying.
  36202. 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
  36203. image analysis. If no field information is available, then this works just
  36204. like &lsquo;<samp class="samp">U</samp>&rsquo;. This is the default mode.
  36205. </p>
  36206. </dd>
  36207. <dt>&lsquo;<samp class="samp">U</samp>&rsquo;</dt>
  36208. <dd><p>Both capture and transfer unknown or varying.
  36209. 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.
  36210. </p></dd>
  36211. </dl>
  36212. </dd>
  36213. </dl>
  36214. <ul class="mini-toc">
  36215. <li><a href="#Commands-129" accesskey="1">Commands</a></li>
  36216. </ul>
  36217. <div class="subsection-level-extent" id="Commands-129">
  36218. <h4 class="subsection"><span>30.190.1 Commands<a class="copiable-link" href="#Commands-129"> &para;</a></span></h4>
  36219. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  36220. </p>
  36221. </div>
  36222. </div>
  36223. <div class="section-level-extent" id="photosensitivity">
  36224. <h3 class="section"><span>30.191 photosensitivity<a class="copiable-link" href="#photosensitivity"> &para;</a></span></h3>
  36225. <p>Reduce various flashes in video, so to help users with epilepsy.
  36226. </p>
  36227. <p>It accepts the following options:
  36228. </p><dl class="table">
  36229. <dt><samp class="option">frames, f</samp></dt>
  36230. <dd><p>Set how many frames to use when filtering. Default is 30.
  36231. </p>
  36232. </dd>
  36233. <dt><samp class="option">threshold, t</samp></dt>
  36234. <dd><p>Set detection threshold factor. Default is 1.
  36235. Lower is stricter.
  36236. </p>
  36237. </dd>
  36238. <dt><samp class="option">skip</samp></dt>
  36239. <dd><p>Set how many pixels to skip when sampling frames. Default is 1.
  36240. Allowed range is from 1 to 1024.
  36241. </p>
  36242. </dd>
  36243. <dt><samp class="option">bypass</samp></dt>
  36244. <dd><p>Leave frames unchanged. Default is disabled.
  36245. </p></dd>
  36246. </dl>
  36247. </div>
  36248. <div class="section-level-extent" id="pixdesctest">
  36249. <h3 class="section"><span>30.192 pixdesctest<a class="copiable-link" href="#pixdesctest"> &para;</a></span></h3>
  36250. <p>Pixel format descriptor test filter, mainly useful for internal
  36251. testing. The output video should be equal to the input video.
  36252. </p>
  36253. <p>For example:
  36254. </p><div class="example">
  36255. <pre class="example-preformatted">format=monow, pixdesctest
  36256. </pre></div>
  36257. <p>can be used to test the monowhite pixel format descriptor definition.
  36258. </p>
  36259. </div>
  36260. <div class="section-level-extent" id="pixelize">
  36261. <h3 class="section"><span>30.193 pixelize<a class="copiable-link" href="#pixelize"> &para;</a></span></h3>
  36262. <p>Apply pixelization to video stream.
  36263. </p>
  36264. <p>The filter accepts the following options:
  36265. </p><dl class="table">
  36266. <dt><samp class="option">width, w</samp></dt>
  36267. <dt><samp class="option">height, h</samp></dt>
  36268. <dd><p>Set block dimensions that will be used for pixelization.
  36269. Default value is <code class="code">16</code>.
  36270. </p>
  36271. </dd>
  36272. <dt><samp class="option">mode, m</samp></dt>
  36273. <dd><p>Set the mode of pixelization used.
  36274. </p>
  36275. <p>Possible values are:
  36276. </p><dl class="table">
  36277. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  36278. <dt>&lsquo;<samp class="samp">min</samp>&rsquo;</dt>
  36279. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  36280. </dl>
  36281. <p>Default value is <code class="code">avg</code>.
  36282. </p>
  36283. </dd>
  36284. <dt><samp class="option">planes, p</samp></dt>
  36285. <dd><p>Set what planes to filter. Default is to filter all planes.
  36286. </p></dd>
  36287. </dl>
  36288. <ul class="mini-toc">
  36289. <li><a href="#Commands-130" accesskey="1">Commands</a></li>
  36290. </ul>
  36291. <div class="subsection-level-extent" id="Commands-130">
  36292. <h4 class="subsection"><span>30.193.1 Commands<a class="copiable-link" href="#Commands-130"> &para;</a></span></h4>
  36293. <p>This filter supports all options as <a class="ref" href="#commands">commands</a>.
  36294. </p>
  36295. </div>
  36296. </div>
  36297. <div class="section-level-extent" id="pixscope">
  36298. <h3 class="section"><span>30.194 pixscope<a class="copiable-link" href="#pixscope"> &para;</a></span></h3>
  36299. <p>Display sample values of color channels. Mainly useful for checking color
  36300. and levels. Minimum supported resolution is 640x480.
  36301. </p>
  36302. <p>The filters accept the following options:
  36303. </p>
  36304. <dl class="table">
  36305. <dt><samp class="option">x</samp></dt>
  36306. <dd><p>Set scope X position, relative offset on X axis.
  36307. </p>
  36308. </dd>
  36309. <dt><samp class="option">y</samp></dt>
  36310. <dd><p>Set scope Y position, relative offset on Y axis.
  36311. </p>
  36312. </dd>
  36313. <dt><samp class="option">w</samp></dt>
  36314. <dd><p>Set scope width.
  36315. </p>
  36316. </dd>
  36317. <dt><samp class="option">h</samp></dt>
  36318. <dd><p>Set scope height.
  36319. </p>
  36320. </dd>
  36321. <dt><samp class="option">o</samp></dt>
  36322. <dd><p>Set window opacity. This window also holds statistics about pixel area.
  36323. </p>
  36324. </dd>
  36325. <dt><samp class="option">wx</samp></dt>
  36326. <dd><p>Set window X position, relative offset on X axis.
  36327. </p>
  36328. </dd>
  36329. <dt><samp class="option">wy</samp></dt>
  36330. <dd><p>Set window Y position, relative offset on Y axis.
  36331. </p></dd>
  36332. </dl>
  36333. <ul class="mini-toc">
  36334. <li><a href="#Commands-131" accesskey="1">Commands</a></li>
  36335. </ul>
  36336. <div class="subsection-level-extent" id="Commands-131">
  36337. <h4 class="subsection"><span>30.194.1 Commands<a class="copiable-link" href="#Commands-131"> &para;</a></span></h4>
  36338. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  36339. </p>
  36340. </div>
  36341. </div>
  36342. <div class="section-level-extent" id="pp">
  36343. <h3 class="section"><span>30.195 pp<a class="copiable-link" href="#pp"> &para;</a></span></h3>
  36344. <p>Enable the specified chain of postprocessing subfilters using libpostproc. This
  36345. library should be automatically selected with a GPL build (<code class="code">--enable-gpl</code>).
  36346. Subfilters must be separated by &rsquo;/&rsquo; and can be disabled by prepending a &rsquo;-&rsquo;.
  36347. Each subfilter and some options have a short and a long name that can be used
  36348. interchangeably, i.e. dr/dering are the same.
  36349. </p>
  36350. <p>The filters accept the following options:
  36351. </p>
  36352. <dl class="table">
  36353. <dt><samp class="option">subfilters</samp></dt>
  36354. <dd><p>Set postprocessing subfilters string.
  36355. </p></dd>
  36356. </dl>
  36357. <p>All subfilters share common options to determine their scope:
  36358. </p>
  36359. <dl class="table">
  36360. <dt><samp class="option">a/autoq</samp></dt>
  36361. <dd><p>Honor the quality commands for this subfilter.
  36362. </p>
  36363. </dd>
  36364. <dt><samp class="option">c/chrom</samp></dt>
  36365. <dd><p>Do chrominance filtering, too (default).
  36366. </p>
  36367. </dd>
  36368. <dt><samp class="option">y/nochrom</samp></dt>
  36369. <dd><p>Do luma filtering only (no chrominance).
  36370. </p>
  36371. </dd>
  36372. <dt><samp class="option">n/noluma</samp></dt>
  36373. <dd><p>Do chrominance filtering only (no luma).
  36374. </p></dd>
  36375. </dl>
  36376. <p>These options can be appended after the subfilter name, separated by a &rsquo;|&rsquo;.
  36377. </p>
  36378. <p>Available subfilters are:
  36379. </p>
  36380. <dl class="table">
  36381. <dt><samp class="option">hb/hdeblock[|difference[|flatness]]</samp></dt>
  36382. <dd><p>Horizontal deblocking filter
  36383. </p><dl class="table">
  36384. <dt><samp class="option">difference</samp></dt>
  36385. <dd><p>Difference factor where higher values mean more deblocking (default: <code class="code">32</code>).
  36386. </p></dd>
  36387. <dt><samp class="option">flatness</samp></dt>
  36388. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code class="code">39</code>).
  36389. </p></dd>
  36390. </dl>
  36391. </dd>
  36392. <dt><samp class="option">vb/vdeblock[|difference[|flatness]]</samp></dt>
  36393. <dd><p>Vertical deblocking filter
  36394. </p><dl class="table">
  36395. <dt><samp class="option">difference</samp></dt>
  36396. <dd><p>Difference factor where higher values mean more deblocking (default: <code class="code">32</code>).
  36397. </p></dd>
  36398. <dt><samp class="option">flatness</samp></dt>
  36399. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code class="code">39</code>).
  36400. </p></dd>
  36401. </dl>
  36402. </dd>
  36403. <dt><samp class="option">ha/hadeblock[|difference[|flatness]]</samp></dt>
  36404. <dd><p>Accurate horizontal deblocking filter
  36405. </p><dl class="table">
  36406. <dt><samp class="option">difference</samp></dt>
  36407. <dd><p>Difference factor where higher values mean more deblocking (default: <code class="code">32</code>).
  36408. </p></dd>
  36409. <dt><samp class="option">flatness</samp></dt>
  36410. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code class="code">39</code>).
  36411. </p></dd>
  36412. </dl>
  36413. </dd>
  36414. <dt><samp class="option">va/vadeblock[|difference[|flatness]]</samp></dt>
  36415. <dd><p>Accurate vertical deblocking filter
  36416. </p><dl class="table">
  36417. <dt><samp class="option">difference</samp></dt>
  36418. <dd><p>Difference factor where higher values mean more deblocking (default: <code class="code">32</code>).
  36419. </p></dd>
  36420. <dt><samp class="option">flatness</samp></dt>
  36421. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code class="code">39</code>).
  36422. </p></dd>
  36423. </dl>
  36424. </dd>
  36425. </dl>
  36426. <p>The horizontal and vertical deblocking filters share the difference and
  36427. flatness values so you cannot set different horizontal and vertical
  36428. thresholds.
  36429. </p>
  36430. <dl class="table">
  36431. <dt><samp class="option">h1/x1hdeblock</samp></dt>
  36432. <dd><p>Experimental horizontal deblocking filter
  36433. </p>
  36434. </dd>
  36435. <dt><samp class="option">v1/x1vdeblock</samp></dt>
  36436. <dd><p>Experimental vertical deblocking filter
  36437. </p>
  36438. </dd>
  36439. <dt><samp class="option">dr/dering</samp></dt>
  36440. <dd><p>Deringing filter
  36441. </p>
  36442. </dd>
  36443. <dt><samp class="option">tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer</samp></dt>
  36444. <dd><dl class="table">
  36445. <dt><samp class="option">threshold1</samp></dt>
  36446. <dd><p>larger -&gt; stronger filtering
  36447. </p></dd>
  36448. <dt><samp class="option">threshold2</samp></dt>
  36449. <dd><p>larger -&gt; stronger filtering
  36450. </p></dd>
  36451. <dt><samp class="option">threshold3</samp></dt>
  36452. <dd><p>larger -&gt; stronger filtering
  36453. </p></dd>
  36454. </dl>
  36455. </dd>
  36456. <dt><samp class="option">al/autolevels[:f/fullyrange], automatic brightness / contrast correction</samp></dt>
  36457. <dd><dl class="table">
  36458. <dt><samp class="option">f/fullyrange</samp></dt>
  36459. <dd><p>Stretch luma to <code class="code">0-255</code>.
  36460. </p></dd>
  36461. </dl>
  36462. </dd>
  36463. <dt><samp class="option">lb/linblenddeint</samp></dt>
  36464. <dd><p>Linear blend deinterlacing filter that deinterlaces the given block by
  36465. filtering all lines with a <code class="code">(1 2 1)</code> filter.
  36466. </p>
  36467. </dd>
  36468. <dt><samp class="option">li/linipoldeint</samp></dt>
  36469. <dd><p>Linear interpolating deinterlacing filter that deinterlaces the given block by
  36470. linearly interpolating every second line.
  36471. </p>
  36472. </dd>
  36473. <dt><samp class="option">ci/cubicipoldeint</samp></dt>
  36474. <dd><p>Cubic interpolating deinterlacing filter deinterlaces the given block by
  36475. cubically interpolating every second line.
  36476. </p>
  36477. </dd>
  36478. <dt><samp class="option">md/mediandeint</samp></dt>
  36479. <dd><p>Median deinterlacing filter that deinterlaces the given block by applying a
  36480. median filter to every second line.
  36481. </p>
  36482. </dd>
  36483. <dt><samp class="option">fd/ffmpegdeint</samp></dt>
  36484. <dd><p>FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
  36485. second line with a <code class="code">(-1 4 2 4 -1)</code> filter.
  36486. </p>
  36487. </dd>
  36488. <dt><samp class="option">l5/lowpass5</samp></dt>
  36489. <dd><p>Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
  36490. block by filtering all lines with a <code class="code">(-1 2 6 2 -1)</code> filter.
  36491. </p>
  36492. </dd>
  36493. <dt><samp class="option">fq/forceQuant[|quantizer]</samp></dt>
  36494. <dd><p>Overrides the quantizer table from the input with the constant quantizer you
  36495. specify.
  36496. </p><dl class="table">
  36497. <dt><samp class="option">quantizer</samp></dt>
  36498. <dd><p>Quantizer to use
  36499. </p></dd>
  36500. </dl>
  36501. </dd>
  36502. <dt><samp class="option">de/default</samp></dt>
  36503. <dd><p>Default pp filter combination (<code class="code">hb|a,vb|a,dr|a</code>)
  36504. </p>
  36505. </dd>
  36506. <dt><samp class="option">fa/fast</samp></dt>
  36507. <dd><p>Fast pp filter combination (<code class="code">h1|a,v1|a,dr|a</code>)
  36508. </p>
  36509. </dd>
  36510. <dt><samp class="option">ac</samp></dt>
  36511. <dd><p>High quality pp filter combination (<code class="code">ha|a|128|7,va|a,dr|a</code>)
  36512. </p></dd>
  36513. </dl>
  36514. <ul class="mini-toc">
  36515. <li><a href="#Examples-122" accesskey="1">Examples</a></li>
  36516. </ul>
  36517. <div class="subsection-level-extent" id="Examples-122">
  36518. <h4 class="subsection"><span>30.195.1 Examples<a class="copiable-link" href="#Examples-122"> &para;</a></span></h4>
  36519. <ul class="itemize mark-bullet">
  36520. <li>Apply horizontal and vertical deblocking, deringing and automatic
  36521. brightness/contrast:
  36522. <div class="example">
  36523. <pre class="example-preformatted">pp=hb/vb/dr/al
  36524. </pre></div>
  36525. </li><li>Apply default filters without brightness/contrast correction:
  36526. <div class="example">
  36527. <pre class="example-preformatted">pp=de/-al
  36528. </pre></div>
  36529. </li><li>Apply default filters and temporal denoiser:
  36530. <div class="example">
  36531. <pre class="example-preformatted">pp=default/tmpnoise|1|2|3
  36532. </pre></div>
  36533. </li><li>Apply deblocking on luma only, and switch vertical deblocking on or off
  36534. automatically depending on available CPU time:
  36535. <div class="example">
  36536. <pre class="example-preformatted">pp=hb|y/vb|a
  36537. </pre></div>
  36538. </li></ul>
  36539. </div>
  36540. </div>
  36541. <div class="section-level-extent" id="pp7">
  36542. <h3 class="section"><span>30.196 pp7<a class="copiable-link" href="#pp7"> &para;</a></span></h3>
  36543. <p>Apply Postprocessing filter 7. It is variant of the <a class="ref" href="#spp">spp</a> filter,
  36544. similar to spp = 6 with 7 point DCT, where only the center sample is
  36545. used after IDCT.
  36546. </p>
  36547. <p>The filter accepts the following options:
  36548. </p>
  36549. <dl class="table">
  36550. <dt><samp class="option">qp</samp></dt>
  36551. <dd><p>Force a constant quantization parameter. It accepts an integer in range
  36552. 0 to 63. If not set, the filter will use the QP from the video stream
  36553. (if available).
  36554. </p>
  36555. </dd>
  36556. <dt><samp class="option">mode</samp></dt>
  36557. <dd><p>Set thresholding mode. Available modes are:
  36558. </p>
  36559. <dl class="table">
  36560. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  36561. <dd><p>Set hard thresholding.
  36562. </p></dd>
  36563. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  36564. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  36565. </p></dd>
  36566. <dt>&lsquo;<samp class="samp">medium</samp>&rsquo;</dt>
  36567. <dd><p>Set medium thresholding (good results, default).
  36568. </p></dd>
  36569. </dl>
  36570. </dd>
  36571. </dl>
  36572. </div>
  36573. <div class="section-level-extent" id="premultiply">
  36574. <h3 class="section"><span>30.197 premultiply<a class="copiable-link" href="#premultiply"> &para;</a></span></h3>
  36575. <p>Apply alpha premultiply effect to input video stream using first plane
  36576. of second stream as alpha.
  36577. </p>
  36578. <p>Both streams must have same dimensions and same pixel format.
  36579. </p>
  36580. <p>The filter accepts the following option:
  36581. </p>
  36582. <dl class="table">
  36583. <dt><samp class="option">planes</samp></dt>
  36584. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  36585. By default value 0xf, all planes will be processed.
  36586. </p>
  36587. </dd>
  36588. <dt><samp class="option">inplace</samp></dt>
  36589. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  36590. </p></dd>
  36591. </dl>
  36592. </div>
  36593. <div class="section-level-extent" id="prewitt">
  36594. <h3 class="section"><span>30.198 prewitt<a class="copiable-link" href="#prewitt"> &para;</a></span></h3>
  36595. <p>Apply prewitt operator to input video stream.
  36596. </p>
  36597. <p>The filter accepts the following option:
  36598. </p>
  36599. <dl class="table">
  36600. <dt><samp class="option">planes</samp></dt>
  36601. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  36602. By default value 0xf, all planes will be processed.
  36603. </p>
  36604. </dd>
  36605. <dt><samp class="option">scale</samp></dt>
  36606. <dd><p>Set value which will be multiplied with filtered result.
  36607. </p>
  36608. </dd>
  36609. <dt><samp class="option">delta</samp></dt>
  36610. <dd><p>Set value which will be added to filtered result.
  36611. </p></dd>
  36612. </dl>
  36613. <ul class="mini-toc">
  36614. <li><a href="#Commands-132" accesskey="1">Commands</a></li>
  36615. </ul>
  36616. <div class="subsection-level-extent" id="Commands-132">
  36617. <h4 class="subsection"><span>30.198.1 Commands<a class="copiable-link" href="#Commands-132"> &para;</a></span></h4>
  36618. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  36619. </p>
  36620. </div>
  36621. </div>
  36622. <div class="section-level-extent" id="pseudocolor">
  36623. <h3 class="section"><span>30.199 pseudocolor<a class="copiable-link" href="#pseudocolor"> &para;</a></span></h3>
  36624. <p>Alter frame colors in video with pseudocolors.
  36625. </p>
  36626. <p>This filter accepts the following options:
  36627. </p>
  36628. <dl class="table">
  36629. <dt><samp class="option">c0</samp></dt>
  36630. <dd><p>set pixel first component expression
  36631. </p>
  36632. </dd>
  36633. <dt><samp class="option">c1</samp></dt>
  36634. <dd><p>set pixel second component expression
  36635. </p>
  36636. </dd>
  36637. <dt><samp class="option">c2</samp></dt>
  36638. <dd><p>set pixel third component expression
  36639. </p>
  36640. </dd>
  36641. <dt><samp class="option">c3</samp></dt>
  36642. <dd><p>set pixel fourth component expression, corresponds to the alpha component
  36643. </p>
  36644. </dd>
  36645. <dt><samp class="option">index, i</samp></dt>
  36646. <dd><p>set component to use as base for altering colors
  36647. </p>
  36648. </dd>
  36649. <dt><samp class="option">preset, p</samp></dt>
  36650. <dd><p>Pick one of built-in LUTs. By default is set to none.
  36651. </p>
  36652. <p>Available LUTs:
  36653. </p><dl class="table">
  36654. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  36655. <dt>&lsquo;<samp class="samp">inferno</samp>&rsquo;</dt>
  36656. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  36657. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  36658. <dt>&lsquo;<samp class="samp">turbo</samp>&rsquo;</dt>
  36659. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  36660. <dt>&lsquo;<samp class="samp">range1</samp>&rsquo;</dt>
  36661. <dt>&lsquo;<samp class="samp">range2</samp>&rsquo;</dt>
  36662. <dt>&lsquo;<samp class="samp">shadows</samp>&rsquo;</dt>
  36663. <dt>&lsquo;<samp class="samp">highlights</samp>&rsquo;</dt>
  36664. <dt>&lsquo;<samp class="samp">solar</samp>&rsquo;</dt>
  36665. <dt>&lsquo;<samp class="samp">nominal</samp>&rsquo;</dt>
  36666. <dt>&lsquo;<samp class="samp">preferred</samp>&rsquo;</dt>
  36667. <dt>&lsquo;<samp class="samp">total</samp>&rsquo;</dt>
  36668. <dt>&lsquo;<samp class="samp">spectral</samp>&rsquo;</dt>
  36669. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  36670. <dt>&lsquo;<samp class="samp">heat</samp>&rsquo;</dt>
  36671. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  36672. <dt>&lsquo;<samp class="samp">blues</samp>&rsquo;</dt>
  36673. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  36674. <dt>&lsquo;<samp class="samp">helix</samp>&rsquo;</dt>
  36675. </dl>
  36676. </dd>
  36677. <dt><samp class="option">opacity</samp></dt>
  36678. <dd><p>Set opacity of output colors. Allowed range is from 0 to 1.
  36679. Default value is set to 1.
  36680. </p></dd>
  36681. </dl>
  36682. <p>Each of the expression options specifies the expression to use for computing
  36683. the lookup table for the corresponding pixel component values.
  36684. </p>
  36685. <p>The expressions can contain the following constants and functions:
  36686. </p>
  36687. <dl class="table">
  36688. <dt><samp class="option">w</samp></dt>
  36689. <dt><samp class="option">h</samp></dt>
  36690. <dd><p>The input width and height.
  36691. </p>
  36692. </dd>
  36693. <dt><samp class="option">val</samp></dt>
  36694. <dd><p>The input value for the pixel component.
  36695. </p>
  36696. </dd>
  36697. <dt><samp class="option">ymin, umin, vmin, amin</samp></dt>
  36698. <dd><p>The minimum allowed component value.
  36699. </p>
  36700. </dd>
  36701. <dt><samp class="option">ymax, umax, vmax, amax</samp></dt>
  36702. <dd><p>The maximum allowed component value.
  36703. </p></dd>
  36704. </dl>
  36705. <p>All expressions default to &quot;val&quot;.
  36706. </p>
  36707. <ul class="mini-toc">
  36708. <li><a href="#Commands-133" accesskey="1">Commands</a></li>
  36709. <li><a href="#Examples-123" accesskey="2">Examples</a></li>
  36710. </ul>
  36711. <div class="subsection-level-extent" id="Commands-133">
  36712. <h4 class="subsection"><span>30.199.1 Commands<a class="copiable-link" href="#Commands-133"> &para;</a></span></h4>
  36713. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  36714. </p>
  36715. </div>
  36716. <div class="subsection-level-extent" id="Examples-123">
  36717. <h4 class="subsection"><span>30.199.2 Examples<a class="copiable-link" href="#Examples-123"> &para;</a></span></h4>
  36718. <ul class="itemize mark-bullet">
  36719. <li>Change too high luma values to gradient:
  36720. <div class="example">
  36721. <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;
  36722. </pre></div>
  36723. </li></ul>
  36724. </div>
  36725. </div>
  36726. <div class="section-level-extent" id="psnr">
  36727. <h3 class="section"><span>30.200 psnr<a class="copiable-link" href="#psnr"> &para;</a></span></h3>
  36728. <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
  36729. Ratio) between two input videos.
  36730. </p>
  36731. <p>This filter takes in input two input videos, the first input is
  36732. considered the &quot;main&quot; source and is passed unchanged to the
  36733. output. The second input is used as a &quot;reference&quot; video for computing
  36734. the PSNR.
  36735. </p>
  36736. <p>Both video inputs must have the same resolution and pixel format for
  36737. this filter to work correctly. Also it assumes that both inputs
  36738. have the same number of frames, which are compared one by one.
  36739. </p>
  36740. <p>The obtained average PSNR is printed through the logging system.
  36741. </p>
  36742. <p>The filter stores the accumulated MSE (mean squared error) of each
  36743. frame, and at the end of the processing it is averaged across all frames
  36744. equally, and the following formula is applied to obtain the PSNR:
  36745. </p>
  36746. <div class="example">
  36747. <pre class="example-preformatted">PSNR = 10*log10(MAX^2/MSE)
  36748. </pre></div>
  36749. <p>Where MAX is the average of the maximum values of each component of the
  36750. image.
  36751. </p>
  36752. <p>The description of the accepted parameters follows.
  36753. </p>
  36754. <dl class="table">
  36755. <dt><samp class="option">stats_file, f</samp></dt>
  36756. <dd><p>If specified the filter will use the named file to save the PSNR of
  36757. each individual frame. When filename equals &quot;-&quot; the data is sent to
  36758. standard output.
  36759. </p>
  36760. </dd>
  36761. <dt><samp class="option">stats_version</samp></dt>
  36762. <dd><p>Specifies which version of the stats file format to use. Details of
  36763. each format are written below.
  36764. Default value is 1.
  36765. </p>
  36766. </dd>
  36767. <dt><samp class="option">stats_add_max</samp></dt>
  36768. <dd><p>Determines whether the max value is output to the stats log.
  36769. Default value is 0.
  36770. Requires stats_version &gt;= 2. If this is set and stats_version &lt; 2,
  36771. the filter will return an error.
  36772. </p></dd>
  36773. </dl>
  36774. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  36775. </p>
  36776. <p>The file printed if <var class="var">stats_file</var> is selected, contains a sequence of
  36777. key/value pairs of the form <var class="var">key</var>:<var class="var">value</var> for each compared
  36778. couple of frames.
  36779. </p>
  36780. <p>If a <var class="var">stats_version</var> greater than 1 is specified, a header line precedes
  36781. the list of per-frame-pair stats, with key value pairs following the frame
  36782. format with the following parameters:
  36783. </p>
  36784. <dl class="table">
  36785. <dt><samp class="option">psnr_log_version</samp></dt>
  36786. <dd><p>The version of the log file format. Will match <var class="var">stats_version</var>.
  36787. </p>
  36788. </dd>
  36789. <dt><samp class="option">fields</samp></dt>
  36790. <dd><p>A comma separated list of the per-frame-pair parameters included in
  36791. the log.
  36792. </p></dd>
  36793. </dl>
  36794. <p>A description of each shown per-frame-pair parameter follows:
  36795. </p>
  36796. <dl class="table">
  36797. <dt><samp class="option">n</samp></dt>
  36798. <dd><p>sequential number of the input frame, starting from 1
  36799. </p>
  36800. </dd>
  36801. <dt><samp class="option">mse_avg</samp></dt>
  36802. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  36803. frames, averaged over all the image components.
  36804. </p>
  36805. </dd>
  36806. <dt><samp class="option">mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a</samp></dt>
  36807. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  36808. frames for the component specified by the suffix.
  36809. </p>
  36810. </dd>
  36811. <dt><samp class="option">psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp></dt>
  36812. <dd><p>Peak Signal to Noise ratio of the compared frames for the component
  36813. specified by the suffix.
  36814. </p>
  36815. </dd>
  36816. <dt><samp class="option">max_avg, max_y, max_u, max_v</samp></dt>
  36817. <dd><p>Maximum allowed value for each channel, and average over all
  36818. channels.
  36819. </p></dd>
  36820. </dl>
  36821. <ul class="mini-toc">
  36822. <li><a href="#Examples-124" accesskey="1">Examples</a></li>
  36823. </ul>
  36824. <div class="subsection-level-extent" id="Examples-124">
  36825. <h4 class="subsection"><span>30.200.1 Examples<a class="copiable-link" href="#Examples-124"> &para;</a></span></h4>
  36826. <ul class="itemize mark-bullet">
  36827. <li>For example:
  36828. <div class="example">
  36829. <pre class="example-preformatted">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  36830. [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
  36831. </pre></div>
  36832. <p>On this example the input file being processed is compared with the
  36833. reference file <samp class="file">ref_movie.mpg</samp>. The PSNR of each individual frame
  36834. is stored in <samp class="file">stats.log</samp>.
  36835. </p>
  36836. </li><li>Another example with different containers:
  36837. <div class="example">
  36838. <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 -
  36839. </pre></div>
  36840. </li></ul>
  36841. <a class="anchor" id="pullup"></a></div>
  36842. </div>
  36843. <div class="section-level-extent" id="pullup-1">
  36844. <h3 class="section"><span>30.201 pullup<a class="copiable-link" href="#pullup-1"> &para;</a></span></h3>
  36845. <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
  36846. hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
  36847. content.
  36848. </p>
  36849. <p>The pullup filter is designed to take advantage of future context in making
  36850. its decisions. This filter is stateless in the sense that it does not lock
  36851. onto a pattern to follow, but it instead looks forward to the following
  36852. fields in order to identify matches and rebuild progressive frames.
  36853. </p>
  36854. <p>To produce content with an even framerate, insert the fps filter after
  36855. pullup, use <code class="code">fps=24000/1001</code> if the input frame rate is 29.97fps,
  36856. <code class="code">fps=24</code> for 30fps and the (rare) telecined 25fps input.
  36857. </p>
  36858. <p>The filter accepts the following options:
  36859. </p>
  36860. <dl class="table">
  36861. <dt><samp class="option">jl</samp></dt>
  36862. <dt><samp class="option">jr</samp></dt>
  36863. <dt><samp class="option">jt</samp></dt>
  36864. <dt><samp class="option">jb</samp></dt>
  36865. <dd><p>These options set the amount of &quot;junk&quot; to ignore at the left, right, top, and
  36866. bottom of the image, respectively. Left and right are in units of 8 pixels,
  36867. while top and bottom are in units of 2 lines.
  36868. The default is 8 pixels on each side.
  36869. </p>
  36870. </dd>
  36871. <dt><samp class="option">sb</samp></dt>
  36872. <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
  36873. filter generating an occasional mismatched frame, but it may also cause an
  36874. excessive number of frames to be dropped during high motion sequences.
  36875. Conversely, setting it to -1 will make filter match fields more easily.
  36876. This may help processing of video where there is slight blurring between
  36877. the fields, but may also cause there to be interlaced frames in the output.
  36878. Default value is <code class="code">0</code>.
  36879. </p>
  36880. </dd>
  36881. <dt><samp class="option">mp</samp></dt>
  36882. <dd><p>Set the metric plane to use. It accepts the following values:
  36883. </p><dl class="table">
  36884. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  36885. <dd><p>Use luma plane.
  36886. </p>
  36887. </dd>
  36888. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  36889. <dd><p>Use chroma blue plane.
  36890. </p>
  36891. </dd>
  36892. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  36893. <dd><p>Use chroma red plane.
  36894. </p></dd>
  36895. </dl>
  36896. <p>This option may be set to use chroma plane instead of the default luma plane
  36897. for doing filter&rsquo;s computations. This may improve accuracy on very clean
  36898. source material, but more likely will decrease accuracy, especially if there
  36899. is chroma noise (rainbow effect) or any grayscale video.
  36900. The main purpose of setting <samp class="option">mp</samp> to a chroma plane is to reduce CPU
  36901. load and make pullup usable in realtime on slow machines.
  36902. </p></dd>
  36903. </dl>
  36904. <p>For best results (without duplicated frames in the output file) it is
  36905. necessary to change the output frame rate. For example, to inverse
  36906. telecine NTSC input:
  36907. </p><div class="example">
  36908. <pre class="example-preformatted">ffmpeg -i input -vf pullup -r 24000/1001 ...
  36909. </pre></div>
  36910. </div>
  36911. <div class="section-level-extent" id="qp">
  36912. <h3 class="section"><span>30.202 qp<a class="copiable-link" href="#qp"> &para;</a></span></h3>
  36913. <p>Change video quantization parameters (QP).
  36914. </p>
  36915. <p>The filter accepts the following option:
  36916. </p>
  36917. <dl class="table">
  36918. <dt><samp class="option">qp</samp></dt>
  36919. <dd><p>Set expression for quantization parameter.
  36920. </p></dd>
  36921. </dl>
  36922. <p>The expression is evaluated through the eval API and can contain, among others,
  36923. the following constants:
  36924. </p>
  36925. <dl class="table">
  36926. <dt><var class="var">known</var></dt>
  36927. <dd><p>1 if index is not 129, 0 otherwise.
  36928. </p>
  36929. </dd>
  36930. <dt><var class="var">qp</var></dt>
  36931. <dd><p>Sequential index starting from -129 to 128.
  36932. </p></dd>
  36933. </dl>
  36934. <ul class="mini-toc">
  36935. <li><a href="#Examples-125" accesskey="1">Examples</a></li>
  36936. </ul>
  36937. <div class="subsection-level-extent" id="Examples-125">
  36938. <h4 class="subsection"><span>30.202.1 Examples<a class="copiable-link" href="#Examples-125"> &para;</a></span></h4>
  36939. <ul class="itemize mark-bullet">
  36940. <li>Some equation like:
  36941. <div class="example">
  36942. <pre class="example-preformatted">qp=2+2*sin(PI*qp)
  36943. </pre></div>
  36944. </li></ul>
  36945. </div>
  36946. </div>
  36947. <div class="section-level-extent" id="qrencode">
  36948. <h3 class="section"><span>30.203 qrencode<a class="copiable-link" href="#qrencode"> &para;</a></span></h3>
  36949. <p>Generate a QR code using the libqrencode library (see
  36950. <a class="url" href="https://fukuchi.org/works/qrencode/">https://fukuchi.org/works/qrencode/</a>), and overlay it on top of the current
  36951. frame.
  36952. </p>
  36953. <p>To enable the compilation of this filter, you need to configure FFmpeg with
  36954. <code class="code">--enable-libqrencode</code>.
  36955. </p>
  36956. <p>The QR code is generated from the provided text or text pattern. The
  36957. corresponding QR code is scaled and overlayed into the video output according to
  36958. the specified options.
  36959. </p>
  36960. <p>In case no text is specified, no QR code is overlaied.
  36961. </p>
  36962. <p>This filter accepts the following options:
  36963. </p>
  36964. <dl class="table">
  36965. <dt><samp class="option">qrcode_width, q</samp></dt>
  36966. <dt><samp class="option">padded_qrcode_width, Q</samp></dt>
  36967. <dd><p>Specify an expression for the width of the rendered QR code, with and without
  36968. padding. The <var class="var">qrcode_width</var> expression can reference the value set by the
  36969. <var class="var">padded_qrcode_width</var> expression, and vice versa.
  36970. By default <var class="var">padded_qrcode_width</var> is set to <var class="var">qrcode_width</var>, meaning that
  36971. there is no padding.
  36972. </p>
  36973. <p>These expressions are evaluated for each new frame.
  36974. </p>
  36975. <p>See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  36976. </p>
  36977. </dd>
  36978. <dt><samp class="option">x</samp></dt>
  36979. <dt><samp class="option">y</samp></dt>
  36980. <dd><p>Specify an expression for positioning the padded QR code top-left corner. The
  36981. <var class="var">x</var> expression can reference the value set by the <var class="var">y</var> expression, and
  36982. vice.
  36983. </p>
  36984. <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
  36985. is placed in the top left corner of the input.
  36986. </p>
  36987. <p>These expressions are evaluated for each new frame.
  36988. </p>
  36989. <p>See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  36990. </p>
  36991. </dd>
  36992. <dt><samp class="option">case_sensitive, cs</samp></dt>
  36993. <dd><p>Instruct libqrencode to use case sensitive encoding. This is enabled by
  36994. default. This can be disabled to reduce the QR encoding size.
  36995. </p>
  36996. </dd>
  36997. <dt><samp class="option">level, l</samp></dt>
  36998. <dd><p>Specify the QR encoding error correction level. With an higher correction level,
  36999. the encoding size will increase but the code will be more robust to corruption.
  37000. Lower level is <var class="var">L</var>.
  37001. </p>
  37002. <p>It accepts the following values:
  37003. </p><dl class="table">
  37004. <dt>&lsquo;<samp class="samp">L</samp>&rsquo;</dt>
  37005. <dt>&lsquo;<samp class="samp">M</samp>&rsquo;</dt>
  37006. <dt>&lsquo;<samp class="samp">Q</samp>&rsquo;</dt>
  37007. <dt>&lsquo;<samp class="samp">H</samp>&rsquo;</dt>
  37008. </dl>
  37009. </dd>
  37010. <dt><samp class="option">expansion</samp></dt>
  37011. <dd><p>Select how the input text is expanded. Can be either <code class="code">none</code>, or
  37012. <code class="code">normal</code> (default). See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode Text expansion</a>
  37013. section below for details.
  37014. </p>
  37015. </dd>
  37016. <dt><samp class="option">text</samp></dt>
  37017. <dt><samp class="option">textfile</samp></dt>
  37018. <dd><p>Define the text to be rendered. In case neither is specified, no QR is encoded
  37019. (just an empty colored frame).
  37020. </p>
  37021. <p>In case expansion is enabled, the text is treated as a text template, using the
  37022. qrencode expansion mechanism. See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode
  37023. Text expansion</a> section below for details.
  37024. </p>
  37025. </dd>
  37026. <dt><samp class="option">background_color, bc</samp></dt>
  37027. <dt><samp class="option">foreground_color, fc</samp></dt>
  37028. <dd><p>Set the QR code and background color. The default value of
  37029. <var class="var">foreground_color</var> is &quot;black&quot;, the default value of <var class="var">background_color</var>
  37030. is &quot;white&quot;.
  37031. </p>
  37032. <p>For the syntax of the color options, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot;
  37033. section in the ffmpeg-utils manual</a>.
  37034. </p></dd>
  37035. </dl>
  37036. <a class="anchor" id="qrencode_005fexpressions"></a><ul class="mini-toc">
  37037. <li><a href="#qrencode-Expressions" accesskey="1">qrencode Expressions</a></li>
  37038. <li><a href="#qrencode-Text-expansion" accesskey="2">qrencode Text expansion</a></li>
  37039. <li><a href="#Examples-126" accesskey="3">Examples</a></li>
  37040. </ul>
  37041. <div class="subsection-level-extent" id="qrencode-Expressions">
  37042. <h4 class="subsection"><span>30.203.1 qrencode Expressions<a class="copiable-link" href="#qrencode-Expressions"> &para;</a></span></h4>
  37043. <p>The expressions set by the options contain the following constants and functions.
  37044. </p>
  37045. <dl class="table">
  37046. <dt><samp class="option">dar</samp></dt>
  37047. <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>
  37048. </p>
  37049. </dd>
  37050. <dt><samp class="option">duration</samp></dt>
  37051. <dd><p>the current frame&rsquo;s duration, in seconds
  37052. </p>
  37053. </dd>
  37054. <dt><samp class="option">hsub</samp></dt>
  37055. <dt><samp class="option">vsub</samp></dt>
  37056. <dd><p>horizontal and vertical chroma subsample values. For example for the
  37057. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  37058. </p>
  37059. </dd>
  37060. <dt><samp class="option">main_h, H</samp></dt>
  37061. <dd><p>the input height
  37062. </p>
  37063. </dd>
  37064. <dt><samp class="option">main_w, W</samp></dt>
  37065. <dd><p>the input width
  37066. </p>
  37067. </dd>
  37068. <dt><samp class="option">n</samp></dt>
  37069. <dd><p>the number of input frame, starting from 0
  37070. </p>
  37071. </dd>
  37072. <dt><samp class="option">pict_type</samp></dt>
  37073. <dd><p>a number representing the picture type
  37074. </p>
  37075. </dd>
  37076. <dt><samp class="option">qr_w, w</samp></dt>
  37077. <dd><p>the width of the encoded QR code
  37078. </p>
  37079. </dd>
  37080. <dt><samp class="option">rendered_qr_w, q</samp></dt>
  37081. <dt><samp class="option">rendered_padded_qr_w, Q</samp></dt>
  37082. <dd><p>the width of the rendered QR code, without and without padding.
  37083. </p>
  37084. <p>These parameters allow the <var class="var">q</var> and <var class="var">Q</var> expressions to refer to each
  37085. other, so you can for example specify <code class="code">q=3/4*Q</code>.
  37086. </p>
  37087. </dd>
  37088. <dt><samp class="option">rand(min, max)</samp></dt>
  37089. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  37090. </p>
  37091. </dd>
  37092. <dt><samp class="option">sar</samp></dt>
  37093. <dd><p>the input sample aspect ratio
  37094. </p>
  37095. </dd>
  37096. <dt><samp class="option">t</samp></dt>
  37097. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  37098. </p>
  37099. </dd>
  37100. <dt><samp class="option">x</samp></dt>
  37101. <dt><samp class="option">y</samp></dt>
  37102. <dd><p>the x and y offset coordinates where the text is drawn.
  37103. </p>
  37104. <p>These parameters allow the <var class="var">x</var> and <var class="var">y</var> expressions to refer to each
  37105. other, so you can for example specify <code class="code">y=x/dar</code>.
  37106. </p></dd>
  37107. </dl>
  37108. <a class="anchor" id="qrencode_005ftext_005fexpansion"></a></div>
  37109. <div class="subsection-level-extent" id="qrencode-Text-expansion">
  37110. <h4 class="subsection"><span>30.203.2 qrencode Text expansion<a class="copiable-link" href="#qrencode-Text-expansion"> &para;</a></span></h4>
  37111. <p>If <samp class="option">expansion</samp> is set to <code class="code">none</code>, the text is printed verbatim.
  37112. </p>
  37113. <p>If <samp class="option">expansion</samp> is set to <code class="code">normal</code> (which is the default),
  37114. the following expansion mechanism is used.
  37115. </p>
  37116. <p>The backslash character &lsquo;<samp class="samp">\</samp>&rsquo;, followed by any character, always expands to
  37117. the second character.
  37118. </p>
  37119. <p>Sequences of the form <code class="code">%{...}</code> are expanded. The text between the
  37120. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  37121. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  37122. they should be escaped.
  37123. </p>
  37124. <p>Note that they probably must also be escaped as the value for the <samp class="option">text</samp>
  37125. option in the filter argument string and as the filter argument in the
  37126. filtergraph description, and possibly also for the shell, that makes up to four
  37127. levels of escaping; using a text file with the <samp class="option">textfile</samp> option avoids
  37128. these problems.
  37129. </p>
  37130. <p>The following functions are available:
  37131. </p>
  37132. <dl class="table">
  37133. <dt><code class="command">n, frame_num</code></dt>
  37134. <dd><p>return the frame number
  37135. </p>
  37136. </dd>
  37137. <dt><code class="command">pts</code></dt>
  37138. <dd><p>Return the presentation timestamp of the current frame.
  37139. </p>
  37140. <p>It can take up to two arguments.
  37141. </p>
  37142. <p>The first argument is the format of the timestamp; it defaults to <code class="code">flt</code> for
  37143. seconds as a decimal number with microsecond accuracy; <code class="code">hms</code> stands for a
  37144. formatted <var class="var">[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  37145. <code class="code">gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  37146. <code class="code">localtime</code> stands for the timestamp of the frame formatted as local time
  37147. zone time. If the format is set to <code class="code">hms24hh</code>, the time is formatted in 24h
  37148. format (00-23).
  37149. </p>
  37150. <p>The second argument is an offset added to the timestamp.
  37151. </p>
  37152. <p>If the format is set to <code class="code">localtime</code> or <code class="code">gmtime</code>, a third argument may
  37153. be supplied: a <code class="code">strftime</code> C function format string. By default,
  37154. <var class="var">YYYY-MM-DD HH:MM:SS</var> format will be used.
  37155. </p>
  37156. </dd>
  37157. <dt><code class="command">expr, e</code></dt>
  37158. <dd><p>Evaluate the expression&rsquo;s value and output as a double.
  37159. </p>
  37160. <p>It must take one argument specifying the expression to be evaluated, accepting
  37161. the constants and functions defined in <a class="ref" href="#qrencode_005fexpressions">qrencode_expressions</a>.
  37162. </p>
  37163. </dd>
  37164. <dt><code class="command">expr_formatted, ef</code></dt>
  37165. <dd><p>Evaluate the expression&rsquo;s value and output as a formatted string.
  37166. </p>
  37167. <p>The first argument is the expression to be evaluated, just as for the <var class="var">expr</var> function.
  37168. The second argument specifies the output format. Allowed values are &lsquo;<samp class="samp">x</samp>&rsquo;,
  37169. &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
  37170. <code class="code">printf</code> function.
  37171. The third parameter is optional and sets the number of positions taken by the output.
  37172. It can be used to add padding with zeros from the left.
  37173. </p>
  37174. </dd>
  37175. <dt><code class="command">gmtime</code></dt>
  37176. <dd><p>The time at which the filter is running, expressed in UTC.
  37177. It can accept an argument: a <code class="code">strftime</code> C function format string.
  37178. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  37179. which prints fractions of the second with optionally specified number of digits.
  37180. </p>
  37181. </dd>
  37182. <dt><code class="command">localtime</code></dt>
  37183. <dd><p>The time at which the filter is running, expressed in the local time zone.
  37184. It can accept an argument: a <code class="code">strftime</code> C function format string.
  37185. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  37186. which prints fractions of the second with optionally specified number of digits.
  37187. </p>
  37188. </dd>
  37189. <dt><code class="command">metadata</code></dt>
  37190. <dd><p>Frame metadata. Takes one or two arguments.
  37191. </p>
  37192. <p>The first argument is mandatory and specifies the metadata key.
  37193. </p>
  37194. <p>The second argument is optional and specifies a default value, used when the
  37195. metadata key is not found or empty.
  37196. </p>
  37197. <p>Available metadata can be identified by inspecting entries starting with TAG
  37198. included within each frame section printed by running <code class="code">ffprobe
  37199. -show_frames</code>.
  37200. </p>
  37201. <p>String metadata generated in filters leading to the qrencode filter are also
  37202. available.
  37203. </p>
  37204. </dd>
  37205. <dt><code class="command">rand(min, max)</code></dt>
  37206. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  37207. </p></dd>
  37208. </dl>
  37209. </div>
  37210. <div class="subsection-level-extent" id="Examples-126">
  37211. <h4 class="subsection"><span>30.203.3 Examples<a class="copiable-link" href="#Examples-126"> &para;</a></span></h4>
  37212. <ul class="itemize mark-bullet">
  37213. <li>Generate a QR code encoding the specified text with the default size, overalaid
  37214. in the top left corner of the input video, with the default size:
  37215. <div class="example">
  37216. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org
  37217. </pre></div>
  37218. </li><li>Same as below, but select blue on pink colors:
  37219. <div class="example">
  37220. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:bc=pink@0.5:fc=blue
  37221. </pre></div>
  37222. </li><li>Place the QR code in the bottom right corner of the input video:
  37223. <div class="example">
  37224. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:x=W-Q:y=H-Q
  37225. </pre></div>
  37226. </li><li>Generate a QR code with width of 200 pixels and padding, making the padded width
  37227. 4/3 of the QR code width:
  37228. <div class="example">
  37229. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:q=200:Q=4/3*q
  37230. </pre></div>
  37231. </li><li>Generate a QR code with padded width of 200 pixels and padding, making the QR
  37232. code width 3/4 of the padded width:
  37233. <div class="example">
  37234. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:Q=200:q=3/4*Q
  37235. </pre></div>
  37236. </li><li>Make the QR code a fraction of the input video width:
  37237. <div class="example">
  37238. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:q=W/5
  37239. </pre></div>
  37240. </li><li>Generate a QR code encoding the frame number:
  37241. <div class="example">
  37242. <pre class="example-preformatted">qrencode=text=%{n}
  37243. </pre></div>
  37244. </li><li>Generate a QR code encoding the GMT timestamp:
  37245. <div class="example">
  37246. <pre class="example-preformatted">qrencode=text=%{gmtime}
  37247. </pre></div>
  37248. </li><li>Generate a QR code encoding the timestamp expressed as a float:
  37249. <div class="example">
  37250. <pre class="example-preformatted">qrencode=text=%{pts}
  37251. </pre></div>
  37252. </li></ul>
  37253. </div>
  37254. </div>
  37255. <div class="section-level-extent" id="quirc">
  37256. <h3 class="section"><span>30.204 quirc<a class="copiable-link" href="#quirc"> &para;</a></span></h3>
  37257. <p>Identify and decode a QR code using the libquirc library (see
  37258. <a class="url" href="https://github.com/dlbeer/quirc/">https://github.com/dlbeer/quirc/</a>), and print the identified QR codes
  37259. positions and payload as metadata.
  37260. </p>
  37261. <p>To enable the compilation of this filter, you need to configure FFmpeg with
  37262. <code class="code">--enable-libquirc</code>.
  37263. </p>
  37264. <p>For each found QR code in the input video, some metadata entries are added with
  37265. the prefix <var class="var">lavfi.quirc.N</var>, where <var class="var">N</var> is the index, starting from 0,
  37266. associated to the QR code.
  37267. </p>
  37268. <p>A description of each metadata value follows:
  37269. </p>
  37270. <dl class="table">
  37271. <dt><samp class="option">lavfi.quirc.count</samp></dt>
  37272. <dd><p>the number of found QR codes, it is not set in case none was found
  37273. </p>
  37274. </dd>
  37275. <dt><samp class="option">lavfi.quirc.N.corner.M.x</samp></dt>
  37276. <dt><samp class="option">lavfi.quirc.N.coreer.M.y</samp></dt>
  37277. <dd><p>the x/y positions of the four corners of the square containing the QR code,
  37278. where <var class="var">M</var> is the index of the corner starting from 0
  37279. </p>
  37280. </dd>
  37281. <dt><samp class="option">lavfi.quirc.N.payload</samp></dt>
  37282. <dd><p>the payload of the QR code
  37283. </p></dd>
  37284. </dl>
  37285. </div>
  37286. <div class="section-level-extent" id="random">
  37287. <h3 class="section"><span>30.205 random<a class="copiable-link" href="#random"> &para;</a></span></h3>
  37288. <p>Flush video frames from internal cache of frames into a random order.
  37289. No frame is discarded.
  37290. Inspired by <a class="ref" href="#frei0r">frei0r</a> nervous filter.
  37291. </p>
  37292. <dl class="table">
  37293. <dt><samp class="option">frames</samp></dt>
  37294. <dd><p>Set size in number of frames of internal cache, in range from <code class="code">2</code> to
  37295. <code class="code">512</code>. Default is <code class="code">30</code>.
  37296. </p>
  37297. </dd>
  37298. <dt><samp class="option">seed</samp></dt>
  37299. <dd><p>Set seed for random number generator, must be an integer included between
  37300. <code class="code">0</code> and <code class="code">UINT32_MAX</code>. If not specified, or if explicitly set to
  37301. less than <code class="code">0</code>, the filter will try to use a good random seed on a
  37302. best effort basis.
  37303. </p></dd>
  37304. </dl>
  37305. </div>
  37306. <div class="section-level-extent" id="readeia608">
  37307. <h3 class="section"><span>30.206 readeia608<a class="copiable-link" href="#readeia608"> &para;</a></span></h3>
  37308. <p>Read closed captioning (EIA-608) information from the top lines of a video frame.
  37309. </p>
  37310. <p>This filter adds frame metadata for <code class="code">lavfi.readeia608.X.cc</code> and
  37311. <code class="code">lavfi.readeia608.X.line</code>, where <code class="code">X</code> is the number of the identified line
  37312. with EIA-608 data (starting from 0). A description of each metadata value follows:
  37313. </p>
  37314. <dl class="table">
  37315. <dt><samp class="option">lavfi.readeia608.X.cc</samp></dt>
  37316. <dd><p>The two bytes stored as EIA-608 data (printed in hexadecimal).
  37317. </p>
  37318. </dd>
  37319. <dt><samp class="option">lavfi.readeia608.X.line</samp></dt>
  37320. <dd><p>The number of the line on which the EIA-608 data was identified and read.
  37321. </p></dd>
  37322. </dl>
  37323. <p>This filter accepts the following options:
  37324. </p>
  37325. <dl class="table">
  37326. <dt><samp class="option">scan_min</samp></dt>
  37327. <dd><p>Set the line to start scanning for EIA-608 data. Default is <code class="code">0</code>.
  37328. </p>
  37329. </dd>
  37330. <dt><samp class="option">scan_max</samp></dt>
  37331. <dd><p>Set the line to end scanning for EIA-608 data. Default is <code class="code">29</code>.
  37332. </p>
  37333. </dd>
  37334. <dt><samp class="option">spw</samp></dt>
  37335. <dd><p>Set the ratio of width reserved for sync code detection.
  37336. Default is <code class="code">0.27</code>. Allowed range is <code class="code">[0.1 - 0.7]</code>.
  37337. </p>
  37338. </dd>
  37339. <dt><samp class="option">chp</samp></dt>
  37340. <dd><p>Enable checking the parity bit. In the event of a parity error, the filter will output
  37341. <code class="code">0x00</code> for that character. Default is false.
  37342. </p>
  37343. </dd>
  37344. <dt><samp class="option">lp</samp></dt>
  37345. <dd><p>Lowpass lines prior to further processing. Default is enabled.
  37346. </p></dd>
  37347. </dl>
  37348. <ul class="mini-toc">
  37349. <li><a href="#Commands-134" accesskey="1">Commands</a></li>
  37350. <li><a href="#Examples-127" accesskey="2">Examples</a></li>
  37351. </ul>
  37352. <div class="subsection-level-extent" id="Commands-134">
  37353. <h4 class="subsection"><span>30.206.1 Commands<a class="copiable-link" href="#Commands-134"> &para;</a></span></h4>
  37354. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37355. </p>
  37356. </div>
  37357. <div class="subsection-level-extent" id="Examples-127">
  37358. <h4 class="subsection"><span>30.206.2 Examples<a class="copiable-link" href="#Examples-127"> &para;</a></span></h4>
  37359. <ul class="itemize mark-bullet">
  37360. <li>Output a csv with presentation time and the first two lines of identified EIA-608 captioning data.
  37361. <div class="example">
  37362. <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
  37363. </pre></div>
  37364. </li></ul>
  37365. </div>
  37366. </div>
  37367. <div class="section-level-extent" id="readvitc">
  37368. <h3 class="section"><span>30.207 readvitc<a class="copiable-link" href="#readvitc"> &para;</a></span></h3>
  37369. <p>Read vertical interval timecode (VITC) information from the top lines of a
  37370. video frame.
  37371. </p>
  37372. <p>The filter adds frame metadata key <code class="code">lavfi.readvitc.tc_str</code> with the
  37373. timecode value, if a valid timecode has been detected. Further metadata key
  37374. <code class="code">lavfi.readvitc.found</code> is set to 0/1 depending on whether
  37375. timecode data has been found or not.
  37376. </p>
  37377. <p>This filter accepts the following options:
  37378. </p>
  37379. <dl class="table">
  37380. <dt><samp class="option">scan_max</samp></dt>
  37381. <dd><p>Set the maximum number of lines to scan for VITC data. If the value is set to
  37382. <code class="code">-1</code> the full video frame is scanned. Default is <code class="code">45</code>.
  37383. </p>
  37384. </dd>
  37385. <dt><samp class="option">thr_b</samp></dt>
  37386. <dd><p>Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0],
  37387. default value is <code class="code">0.2</code>. The value must be equal or less than <code class="code">thr_w</code>.
  37388. </p>
  37389. </dd>
  37390. <dt><samp class="option">thr_w</samp></dt>
  37391. <dd><p>Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0],
  37392. default value is <code class="code">0.6</code>. The value must be equal or greater than <code class="code">thr_b</code>.
  37393. </p></dd>
  37394. </dl>
  37395. <ul class="mini-toc">
  37396. <li><a href="#Examples-128" accesskey="1">Examples</a></li>
  37397. </ul>
  37398. <div class="subsection-level-extent" id="Examples-128">
  37399. <h4 class="subsection"><span>30.207.1 Examples<a class="copiable-link" href="#Examples-128"> &para;</a></span></h4>
  37400. <ul class="itemize mark-bullet">
  37401. <li>Detect and draw VITC data onto the video frame; if no valid VITC is detected,
  37402. draw <code class="code">--:--:--:--</code> as a placeholder:
  37403. <div class="example">
  37404. <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'
  37405. </pre></div>
  37406. </li></ul>
  37407. </div>
  37408. </div>
  37409. <div class="section-level-extent" id="remap">
  37410. <h3 class="section"><span>30.208 remap<a class="copiable-link" href="#remap"> &para;</a></span></h3>
  37411. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  37412. </p>
  37413. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  37414. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  37415. value for pixel will be used for destination pixel.
  37416. </p>
  37417. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  37418. will have Xmap/Ymap video stream dimensions.
  37419. Xmap and Ymap input video streams are 16bit depth, single channel.
  37420. </p>
  37421. <dl class="table">
  37422. <dt><samp class="option">format</samp></dt>
  37423. <dd><p>Specify pixel format of output from this filter. Can be <code class="code">color</code> or <code class="code">gray</code>.
  37424. Default is <code class="code">color</code>.
  37425. </p>
  37426. </dd>
  37427. <dt><samp class="option">fill</samp></dt>
  37428. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  37429. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  37430. manual</a>. Default color is <code class="code">black</code>.
  37431. </p></dd>
  37432. </dl>
  37433. </div>
  37434. <div class="section-level-extent" id="removegrain">
  37435. <h3 class="section"><span>30.209 removegrain<a class="copiable-link" href="#removegrain"> &para;</a></span></h3>
  37436. <p>The removegrain filter is a spatial denoiser for progressive video.
  37437. </p>
  37438. <dl class="table">
  37439. <dt><samp class="option">m0</samp></dt>
  37440. <dd><p>Set mode for the first plane.
  37441. </p>
  37442. </dd>
  37443. <dt><samp class="option">m1</samp></dt>
  37444. <dd><p>Set mode for the second plane.
  37445. </p>
  37446. </dd>
  37447. <dt><samp class="option">m2</samp></dt>
  37448. <dd><p>Set mode for the third plane.
  37449. </p>
  37450. </dd>
  37451. <dt><samp class="option">m3</samp></dt>
  37452. <dd><p>Set mode for the fourth plane.
  37453. </p></dd>
  37454. </dl>
  37455. <p>Range of mode is from 0 to 24. Description of each mode follows:
  37456. </p>
  37457. <dl class="table">
  37458. <dt><var class="var">0</var></dt>
  37459. <dd><p>Leave input plane unchanged. Default.
  37460. </p>
  37461. </dd>
  37462. <dt><var class="var">1</var></dt>
  37463. <dd><p>Clips the pixel with the minimum and maximum of the 8 neighbour pixels.
  37464. </p>
  37465. </dd>
  37466. <dt><var class="var">2</var></dt>
  37467. <dd><p>Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.
  37468. </p>
  37469. </dd>
  37470. <dt><var class="var">3</var></dt>
  37471. <dd><p>Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.
  37472. </p>
  37473. </dd>
  37474. <dt><var class="var">4</var></dt>
  37475. <dd><p>Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels.
  37476. This is equivalent to a median filter.
  37477. </p>
  37478. </dd>
  37479. <dt><var class="var">5</var></dt>
  37480. <dd><p>Line-sensitive clipping giving the minimal change.
  37481. </p>
  37482. </dd>
  37483. <dt><var class="var">6</var></dt>
  37484. <dd><p>Line-sensitive clipping, intermediate.
  37485. </p>
  37486. </dd>
  37487. <dt><var class="var">7</var></dt>
  37488. <dd><p>Line-sensitive clipping, intermediate.
  37489. </p>
  37490. </dd>
  37491. <dt><var class="var">8</var></dt>
  37492. <dd><p>Line-sensitive clipping, intermediate.
  37493. </p>
  37494. </dd>
  37495. <dt><var class="var">9</var></dt>
  37496. <dd><p>Line-sensitive clipping on a line where the neighbours pixels are the closest.
  37497. </p>
  37498. </dd>
  37499. <dt><var class="var">10</var></dt>
  37500. <dd><p>Replaces the target pixel with the closest neighbour.
  37501. </p>
  37502. </dd>
  37503. <dt><var class="var">11</var></dt>
  37504. <dd><p>[1 2 1] horizontal and vertical kernel blur.
  37505. </p>
  37506. </dd>
  37507. <dt><var class="var">12</var></dt>
  37508. <dd><p>Same as mode 11.
  37509. </p>
  37510. </dd>
  37511. <dt><var class="var">13</var></dt>
  37512. <dd><p>Bob mode, interpolates top field from the line where the neighbours
  37513. pixels are the closest.
  37514. </p>
  37515. </dd>
  37516. <dt><var class="var">14</var></dt>
  37517. <dd><p>Bob mode, interpolates bottom field from the line where the neighbours
  37518. pixels are the closest.
  37519. </p>
  37520. </dd>
  37521. <dt><var class="var">15</var></dt>
  37522. <dd><p>Bob mode, interpolates top field. Same as 13 but with a more complicated
  37523. interpolation formula.
  37524. </p>
  37525. </dd>
  37526. <dt><var class="var">16</var></dt>
  37527. <dd><p>Bob mode, interpolates bottom field. Same as 14 but with a more complicated
  37528. interpolation formula.
  37529. </p>
  37530. </dd>
  37531. <dt><var class="var">17</var></dt>
  37532. <dd><p>Clips the pixel with the minimum and maximum of respectively the maximum and
  37533. minimum of each pair of opposite neighbour pixels.
  37534. </p>
  37535. </dd>
  37536. <dt><var class="var">18</var></dt>
  37537. <dd><p>Line-sensitive clipping using opposite neighbours whose greatest distance from
  37538. the current pixel is minimal.
  37539. </p>
  37540. </dd>
  37541. <dt><var class="var">19</var></dt>
  37542. <dd><p>Replaces the pixel with the average of its 8 neighbours.
  37543. </p>
  37544. </dd>
  37545. <dt><var class="var">20</var></dt>
  37546. <dd><p>Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
  37547. </p>
  37548. </dd>
  37549. <dt><var class="var">21</var></dt>
  37550. <dd><p>Clips pixels using the averages of opposite neighbour.
  37551. </p>
  37552. </dd>
  37553. <dt><var class="var">22</var></dt>
  37554. <dd><p>Same as mode 21 but simpler and faster.
  37555. </p>
  37556. </dd>
  37557. <dt><var class="var">23</var></dt>
  37558. <dd><p>Small edge and halo removal, but reputed useless.
  37559. </p>
  37560. </dd>
  37561. <dt><var class="var">24</var></dt>
  37562. <dd><p>Similar as 23.
  37563. </p></dd>
  37564. </dl>
  37565. </div>
  37566. <div class="section-level-extent" id="removelogo">
  37567. <h3 class="section"><span>30.210 removelogo<a class="copiable-link" href="#removelogo"> &para;</a></span></h3>
  37568. <p>Suppress a TV station logo, using an image file to determine which
  37569. pixels comprise the logo. It works by filling in the pixels that
  37570. comprise the logo with neighboring pixels.
  37571. </p>
  37572. <p>The filter accepts the following options:
  37573. </p>
  37574. <dl class="table">
  37575. <dt><samp class="option">filename, f</samp></dt>
  37576. <dd><p>Set the filter bitmap file, which can be any image format supported by
  37577. libavformat. The width and height of the image file must match those of the
  37578. video stream being processed.
  37579. </p></dd>
  37580. </dl>
  37581. <p>Pixels in the provided bitmap image with a value of zero are not
  37582. considered part of the logo, non-zero pixels are considered part of
  37583. the logo. If you use white (255) for the logo and black (0) for the
  37584. rest, you will be safe. For making the filter bitmap, it is
  37585. recommended to take a screen capture of a black frame with the logo
  37586. visible, and then using a threshold filter followed by the erode
  37587. filter once or twice.
  37588. </p>
  37589. <p>If needed, little splotches can be fixed manually. Remember that if
  37590. logo pixels are not covered, the filter quality will be much
  37591. reduced. Marking too many pixels as part of the logo does not hurt as
  37592. much, but it will increase the amount of blurring needed to cover over
  37593. the image and will destroy more information than necessary, and extra
  37594. pixels will slow things down on a large logo.
  37595. </p>
  37596. </div>
  37597. <div class="section-level-extent" id="repeatfields">
  37598. <h3 class="section"><span>30.211 repeatfields<a class="copiable-link" href="#repeatfields"> &para;</a></span></h3>
  37599. <p>This filter uses the repeat_field flag from the Video ES headers and hard repeats
  37600. fields based on its value.
  37601. </p>
  37602. </div>
  37603. <div class="section-level-extent" id="reverse">
  37604. <h3 class="section"><span>30.212 reverse<a class="copiable-link" href="#reverse"> &para;</a></span></h3>
  37605. <p>Reverse a video clip.
  37606. </p>
  37607. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  37608. is suggested.
  37609. </p>
  37610. <ul class="mini-toc">
  37611. <li><a href="#Examples-129" accesskey="1">Examples</a></li>
  37612. </ul>
  37613. <div class="subsection-level-extent" id="Examples-129">
  37614. <h4 class="subsection"><span>30.212.1 Examples<a class="copiable-link" href="#Examples-129"> &para;</a></span></h4>
  37615. <ul class="itemize mark-bullet">
  37616. <li>Take the first 5 seconds of a clip, and reverse it.
  37617. <div class="example">
  37618. <pre class="example-preformatted">trim=end=5,reverse
  37619. </pre></div>
  37620. </li></ul>
  37621. </div>
  37622. </div>
  37623. <div class="section-level-extent" id="rgbashift">
  37624. <h3 class="section"><span>30.213 rgbashift<a class="copiable-link" href="#rgbashift"> &para;</a></span></h3>
  37625. <p>Shift R/G/B/A pixels horizontally and/or vertically.
  37626. </p>
  37627. <p>The filter accepts the following options:
  37628. </p><dl class="table">
  37629. <dt><samp class="option">rh</samp></dt>
  37630. <dd><p>Set amount to shift red horizontally.
  37631. </p></dd>
  37632. <dt><samp class="option">rv</samp></dt>
  37633. <dd><p>Set amount to shift red vertically.
  37634. </p></dd>
  37635. <dt><samp class="option">gh</samp></dt>
  37636. <dd><p>Set amount to shift green horizontally.
  37637. </p></dd>
  37638. <dt><samp class="option">gv</samp></dt>
  37639. <dd><p>Set amount to shift green vertically.
  37640. </p></dd>
  37641. <dt><samp class="option">bh</samp></dt>
  37642. <dd><p>Set amount to shift blue horizontally.
  37643. </p></dd>
  37644. <dt><samp class="option">bv</samp></dt>
  37645. <dd><p>Set amount to shift blue vertically.
  37646. </p></dd>
  37647. <dt><samp class="option">ah</samp></dt>
  37648. <dd><p>Set amount to shift alpha horizontally.
  37649. </p></dd>
  37650. <dt><samp class="option">av</samp></dt>
  37651. <dd><p>Set amount to shift alpha vertically.
  37652. </p></dd>
  37653. <dt><samp class="option">edge</samp></dt>
  37654. <dd><p>Set edge mode, can be <var class="var">smear</var>, default, or <var class="var">warp</var>.
  37655. </p></dd>
  37656. </dl>
  37657. <ul class="mini-toc">
  37658. <li><a href="#Commands-135" accesskey="1">Commands</a></li>
  37659. </ul>
  37660. <div class="subsection-level-extent" id="Commands-135">
  37661. <h4 class="subsection"><span>30.213.1 Commands<a class="copiable-link" href="#Commands-135"> &para;</a></span></h4>
  37662. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37663. </p>
  37664. </div>
  37665. </div>
  37666. <div class="section-level-extent" id="roberts">
  37667. <h3 class="section"><span>30.214 roberts<a class="copiable-link" href="#roberts"> &para;</a></span></h3>
  37668. <p>Apply roberts cross operator to input video stream.
  37669. </p>
  37670. <p>The filter accepts the following option:
  37671. </p>
  37672. <dl class="table">
  37673. <dt><samp class="option">planes</samp></dt>
  37674. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  37675. By default value 0xf, all planes will be processed.
  37676. </p>
  37677. </dd>
  37678. <dt><samp class="option">scale</samp></dt>
  37679. <dd><p>Set value which will be multiplied with filtered result.
  37680. </p>
  37681. </dd>
  37682. <dt><samp class="option">delta</samp></dt>
  37683. <dd><p>Set value which will be added to filtered result.
  37684. </p></dd>
  37685. </dl>
  37686. <ul class="mini-toc">
  37687. <li><a href="#Commands-136" accesskey="1">Commands</a></li>
  37688. </ul>
  37689. <div class="subsection-level-extent" id="Commands-136">
  37690. <h4 class="subsection"><span>30.214.1 Commands<a class="copiable-link" href="#Commands-136"> &para;</a></span></h4>
  37691. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37692. </p>
  37693. </div>
  37694. </div>
  37695. <div class="section-level-extent" id="rotate">
  37696. <h3 class="section"><span>30.215 rotate<a class="copiable-link" href="#rotate"> &para;</a></span></h3>
  37697. <p>Rotate video by an arbitrary angle expressed in radians.
  37698. </p>
  37699. <p>The filter accepts the following options:
  37700. </p>
  37701. <p>A description of the optional parameters follows.
  37702. </p><dl class="table">
  37703. <dt><samp class="option">angle, a</samp></dt>
  37704. <dd><p>Set an expression for the angle by which to rotate the input video
  37705. clockwise, expressed as a number of radians. A negative value will
  37706. result in a counter-clockwise rotation. By default it is set to &quot;0&quot;.
  37707. </p>
  37708. <p>This expression is evaluated for each frame.
  37709. </p>
  37710. </dd>
  37711. <dt><samp class="option">out_w, ow</samp></dt>
  37712. <dd><p>Set the output width expression, default value is &quot;iw&quot;.
  37713. This expression is evaluated just once during configuration.
  37714. </p>
  37715. </dd>
  37716. <dt><samp class="option">out_h, oh</samp></dt>
  37717. <dd><p>Set the output height expression, default value is &quot;ih&quot;.
  37718. This expression is evaluated just once during configuration.
  37719. </p>
  37720. </dd>
  37721. <dt><samp class="option">bilinear</samp></dt>
  37722. <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
  37723. it. Default value is 1.
  37724. </p>
  37725. </dd>
  37726. <dt><samp class="option">fillcolor, c</samp></dt>
  37727. <dd><p>Set the color used to fill the output area not covered by the rotated
  37728. image. For the general syntax of this option, check the
  37729. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  37730. If the special value &quot;none&quot; is selected then no
  37731. background is printed (useful for example if the background is never shown).
  37732. </p>
  37733. <p>Default value is &quot;black&quot;.
  37734. </p></dd>
  37735. </dl>
  37736. <p>The expressions for the angle and the output size can contain the
  37737. following constants and functions:
  37738. </p>
  37739. <dl class="table">
  37740. <dt><samp class="option">n</samp></dt>
  37741. <dd><p>sequential number of the input frame, starting from 0. It is always NAN
  37742. before the first frame is filtered.
  37743. </p>
  37744. </dd>
  37745. <dt><samp class="option">t</samp></dt>
  37746. <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
  37747. configured. It is always NAN before the first frame is filtered.
  37748. </p>
  37749. </dd>
  37750. <dt><samp class="option">hsub</samp></dt>
  37751. <dt><samp class="option">vsub</samp></dt>
  37752. <dd><p>horizontal and vertical chroma subsample values. For example for the
  37753. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  37754. </p>
  37755. </dd>
  37756. <dt><samp class="option">in_w, iw</samp></dt>
  37757. <dt><samp class="option">in_h, ih</samp></dt>
  37758. <dd><p>the input video width and height
  37759. </p>
  37760. </dd>
  37761. <dt><samp class="option">out_w, ow</samp></dt>
  37762. <dt><samp class="option">out_h, oh</samp></dt>
  37763. <dd><p>the output width and height, that is the size of the padded area as
  37764. specified by the <var class="var">width</var> and <var class="var">height</var> expressions
  37765. </p>
  37766. </dd>
  37767. <dt><samp class="option">rotw(a)</samp></dt>
  37768. <dt><samp class="option">roth(a)</samp></dt>
  37769. <dd><p>the minimal width/height required for completely containing the input
  37770. video rotated by <var class="var">a</var> radians.
  37771. </p>
  37772. <p>These are only available when computing the <samp class="option">out_w</samp> and
  37773. <samp class="option">out_h</samp> expressions.
  37774. </p></dd>
  37775. </dl>
  37776. <ul class="mini-toc">
  37777. <li><a href="#Examples-130" accesskey="1">Examples</a></li>
  37778. <li><a href="#Commands-137" accesskey="2">Commands</a></li>
  37779. </ul>
  37780. <div class="subsection-level-extent" id="Examples-130">
  37781. <h4 class="subsection"><span>30.215.1 Examples<a class="copiable-link" href="#Examples-130"> &para;</a></span></h4>
  37782. <ul class="itemize mark-bullet">
  37783. <li>Rotate the input by PI/6 radians clockwise:
  37784. <div class="example">
  37785. <pre class="example-preformatted">rotate=PI/6
  37786. </pre></div>
  37787. </li><li>Rotate the input by PI/6 radians counter-clockwise:
  37788. <div class="example">
  37789. <pre class="example-preformatted">rotate=-PI/6
  37790. </pre></div>
  37791. </li><li>Rotate the input by 45 degrees clockwise:
  37792. <div class="example">
  37793. <pre class="example-preformatted">rotate=45*PI/180
  37794. </pre></div>
  37795. </li><li>Apply a constant rotation with period T, starting from an angle of PI/3:
  37796. <div class="example">
  37797. <pre class="example-preformatted">rotate=PI/3+2*PI*t/T
  37798. </pre></div>
  37799. </li><li>Make the input video rotation oscillating with a period of T
  37800. seconds and an amplitude of A radians:
  37801. <div class="example">
  37802. <pre class="example-preformatted">rotate=A*sin(2*PI/T*t)
  37803. </pre></div>
  37804. </li><li>Rotate the video, output size is chosen so that the whole rotating
  37805. input video is always completely contained in the output:
  37806. <div class="example">
  37807. <pre class="example-preformatted">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
  37808. </pre></div>
  37809. </li><li>Rotate the video, reduce the output size so that no background is ever
  37810. shown:
  37811. <div class="example">
  37812. <pre class="example-preformatted">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
  37813. </pre></div>
  37814. </li></ul>
  37815. </div>
  37816. <div class="subsection-level-extent" id="Commands-137">
  37817. <h4 class="subsection"><span>30.215.2 Commands<a class="copiable-link" href="#Commands-137"> &para;</a></span></h4>
  37818. <p>The filter supports the following commands:
  37819. </p>
  37820. <dl class="table">
  37821. <dt><samp class="option">a, angle</samp></dt>
  37822. <dd><p>Set the angle expression.
  37823. The command accepts the same syntax of the corresponding option.
  37824. </p>
  37825. <p>If the specified expression is not valid, it is kept at its current
  37826. value.
  37827. </p></dd>
  37828. </dl>
  37829. </div>
  37830. </div>
  37831. <div class="section-level-extent" id="sab">
  37832. <h3 class="section"><span>30.216 sab<a class="copiable-link" href="#sab"> &para;</a></span></h3>
  37833. <p>Apply Shape Adaptive Blur.
  37834. </p>
  37835. <p>The filter accepts the following options:
  37836. </p>
  37837. <dl class="table">
  37838. <dt><samp class="option">luma_radius, lr</samp></dt>
  37839. <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
  37840. value is 1.0. A greater value will result in a more blurred image, and
  37841. in slower processing.
  37842. </p>
  37843. </dd>
  37844. <dt><samp class="option">luma_pre_filter_radius, lpfr</samp></dt>
  37845. <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
  37846. value is 1.0.
  37847. </p>
  37848. </dd>
  37849. <dt><samp class="option">luma_strength, ls</samp></dt>
  37850. <dd><p>Set luma maximum difference between pixels to still be considered, must
  37851. be a value in the 0.1-100.0 range, default value is 1.0.
  37852. </p>
  37853. </dd>
  37854. <dt><samp class="option">chroma_radius, cr</samp></dt>
  37855. <dd><p>Set chroma blur filter strength, must be a value in range -0.9-4.0. A
  37856. greater value will result in a more blurred image, and in slower
  37857. processing.
  37858. </p>
  37859. </dd>
  37860. <dt><samp class="option">chroma_pre_filter_radius, cpfr</samp></dt>
  37861. <dd><p>Set chroma pre-filter radius, must be a value in the -0.9-2.0 range.
  37862. </p>
  37863. </dd>
  37864. <dt><samp class="option">chroma_strength, cs</samp></dt>
  37865. <dd><p>Set chroma maximum difference between pixels to still be considered,
  37866. must be a value in the -0.9-100.0 range.
  37867. </p></dd>
  37868. </dl>
  37869. <p>Each chroma option value, if not explicitly specified, is set to the
  37870. corresponding luma option value.
  37871. </p>
  37872. <a class="anchor" id="scale"></a></div>
  37873. <div class="section-level-extent" id="scale-1">
  37874. <h3 class="section"><span>30.217 scale<a class="copiable-link" href="#scale-1"> &para;</a></span></h3>
  37875. <p>Scale (resize) the input video, using the libswscale library.
  37876. </p>
  37877. <p>The scale filter forces the output display aspect ratio to be the same
  37878. of the input, by changing the output sample aspect ratio.
  37879. </p>
  37880. <p>If the input image format is different from the format requested by
  37881. the next filter, the scale filter will convert the input to the
  37882. requested format.
  37883. </p>
  37884. <ul class="mini-toc">
  37885. <li><a href="#Options-39" accesskey="1">Options</a></li>
  37886. <li><a href="#Examples-131" accesskey="2">Examples</a></li>
  37887. <li><a href="#Commands-138" accesskey="3">Commands</a></li>
  37888. </ul>
  37889. <div class="subsection-level-extent" id="Options-39">
  37890. <h4 class="subsection"><span>30.217.1 Options<a class="copiable-link" href="#Options-39"> &para;</a></span></h4>
  37891. <p>The filter accepts the following options, or any of the options
  37892. supported by the libswscale scaler.
  37893. </p>
  37894. <p>See <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#scaler_005foptions">the ffmpeg-scaler manual</a> for
  37895. the complete list of scaler options.
  37896. </p>
  37897. <dl class="table">
  37898. <dt><samp class="option">width, w</samp></dt>
  37899. <dt><samp class="option">height, h</samp></dt>
  37900. <dd><p>Set the output video dimension expression. Default value is the input
  37901. dimension.
  37902. </p>
  37903. <p>If the <var class="var">width</var> or <var class="var">w</var> value is 0, the input width is used for
  37904. the output. If the <var class="var">height</var> or <var class="var">h</var> value is 0, the input height
  37905. is used for the output.
  37906. </p>
  37907. <p>If one and only one of the values is -n with n &gt;= 1, the scale filter
  37908. will use a value that maintains the aspect ratio of the input image,
  37909. calculated from the other specified dimension. After that it will,
  37910. however, make sure that the calculated dimension is divisible by n and
  37911. adjust the value if necessary.
  37912. </p>
  37913. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  37914. both values being set to 0 as previously detailed.
  37915. </p>
  37916. <p>See below for the list of accepted constants for use in the dimension
  37917. expression.
  37918. </p>
  37919. </dd>
  37920. <dt><samp class="option">eval</samp></dt>
  37921. <dd><p>Specify when to evaluate <var class="var">width</var> and <var class="var">height</var> expression. It accepts the following values:
  37922. </p>
  37923. <dl class="table">
  37924. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  37925. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  37926. </p>
  37927. </dd>
  37928. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  37929. <dd><p>Evaluate expressions for each incoming frame.
  37930. </p>
  37931. </dd>
  37932. </dl>
  37933. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  37934. </p>
  37935. </dd>
  37936. <dt><samp class="option">interl</samp></dt>
  37937. <dd><p>Set the interlacing mode. It accepts the following values:
  37938. </p>
  37939. <dl class="table">
  37940. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  37941. <dd><p>Force interlaced aware scaling.
  37942. </p>
  37943. </dd>
  37944. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  37945. <dd><p>Do not apply interlaced scaling.
  37946. </p>
  37947. </dd>
  37948. <dt>&lsquo;<samp class="samp">-1</samp>&rsquo;</dt>
  37949. <dd><p>Select interlaced aware scaling depending on whether the source frames
  37950. are flagged as interlaced or not.
  37951. </p></dd>
  37952. </dl>
  37953. <p>Default value is &lsquo;<samp class="samp">0</samp>&rsquo;.
  37954. </p>
  37955. </dd>
  37956. <dt><samp class="option">flags</samp></dt>
  37957. <dd><p>Set libswscale scaling flags. See
  37958. <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#sws_005fflags">the ffmpeg-scaler manual</a> for the
  37959. complete list of values. If not explicitly specified the filter applies
  37960. the default flags.
  37961. </p>
  37962. </dd>
  37963. <dt><samp class="option">param0, param1</samp></dt>
  37964. <dd><p>Set libswscale input parameters for scaling algorithms that need them. See
  37965. <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#sws_005fparams">the ffmpeg-scaler manual</a> for the
  37966. complete documentation. If not explicitly specified the filter applies
  37967. empty parameters.
  37968. </p>
  37969. </dd>
  37970. <dt><samp class="option">size, s</samp></dt>
  37971. <dd><p>Set the video size. For the syntax of this option, check the
  37972. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  37973. </p>
  37974. </dd>
  37975. <dt><samp class="option">in_color_matrix</samp></dt>
  37976. <dt><samp class="option">out_color_matrix</samp></dt>
  37977. <dd><p>Set in/output YCbCr color space type.
  37978. </p>
  37979. <p>This allows the autodetected value to be overridden as well as allows forcing
  37980. a specific value used for the output and encoder.
  37981. </p>
  37982. <p>If not specified, the color space type depends on the pixel format.
  37983. </p>
  37984. <p>Possible values:
  37985. </p>
  37986. <dl class="table">
  37987. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  37988. <dd><p>Choose automatically.
  37989. </p>
  37990. </dd>
  37991. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  37992. <dd><p>Format conforming to International Telecommunication Union (ITU)
  37993. Recommendation BT.709.
  37994. </p>
  37995. </dd>
  37996. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  37997. <dd><p>Set color space conforming to the United States Federal Communications
  37998. Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
  37999. </p>
  38000. </dd>
  38001. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  38002. <dt>&lsquo;<samp class="samp">bt470</samp>&rsquo;</dt>
  38003. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  38004. <dd><p>Set color space conforming to:
  38005. </p>
  38006. <ul class="itemize mark-bullet">
  38007. <li>ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
  38008. </li><li>ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
  38009. </li><li>Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
  38010. </li></ul>
  38011. </dd>
  38012. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  38013. <dd><p>Set color space conforming to SMPTE ST 240:1999.
  38014. </p>
  38015. </dd>
  38016. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  38017. <dd><p>Set color space conforming to ITU-R BT.2020 non-constant luminance system.
  38018. </p></dd>
  38019. </dl>
  38020. </dd>
  38021. <dt><samp class="option">in_range</samp></dt>
  38022. <dt><samp class="option">out_range</samp></dt>
  38023. <dd><p>Set in/output YCbCr sample range.
  38024. </p>
  38025. <p>This allows the autodetected value to be overridden as well as allows forcing
  38026. a specific value used for the output and encoder. If not specified, the
  38027. range depends on the pixel format. Possible values:
  38028. </p>
  38029. <dl class="table">
  38030. <dt>&lsquo;<samp class="samp">auto/unknown</samp>&rsquo;</dt>
  38031. <dd><p>Choose automatically.
  38032. </p>
  38033. </dd>
  38034. <dt>&lsquo;<samp class="samp">jpeg/full/pc</samp>&rsquo;</dt>
  38035. <dd><p>Set full range (0-255 in case of 8-bit luma).
  38036. </p>
  38037. </dd>
  38038. <dt>&lsquo;<samp class="samp">mpeg/limited/tv</samp>&rsquo;</dt>
  38039. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  38040. </p></dd>
  38041. </dl>
  38042. </dd>
  38043. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  38044. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  38045. keep the original aspect ratio. Possible values:
  38046. </p>
  38047. <dl class="table">
  38048. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  38049. <dd><p>Scale the video as specified and disable this feature.
  38050. </p>
  38051. </dd>
  38052. <dt>&lsquo;<samp class="samp">decrease</samp>&rsquo;</dt>
  38053. <dd><p>The output video dimensions will automatically be decreased if needed.
  38054. </p>
  38055. </dd>
  38056. <dt>&lsquo;<samp class="samp">increase</samp>&rsquo;</dt>
  38057. <dd><p>The output video dimensions will automatically be increased if needed.
  38058. </p>
  38059. </dd>
  38060. </dl>
  38061. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  38062. maximum allowed resolution, you can use this to limit the output video to
  38063. that, while retaining the aspect ratio. For example, device A allows
  38064. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  38065. decrease) and specifying 1280x720 to the command line makes the output
  38066. 1280x533.
  38067. </p>
  38068. <p>Please note that this is a different thing than specifying -1 for <samp class="option">w</samp>
  38069. or <samp class="option">h</samp>, you still need to specify the output resolution for this option
  38070. to work.
  38071. </p>
  38072. </dd>
  38073. <dt><samp class="option">force_divisible_by</samp></dt>
  38074. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  38075. given integer when used together with <samp class="option">force_original_aspect_ratio</samp>. This
  38076. works similar to using <code class="code">-n</code> in the <samp class="option">w</samp> and <samp class="option">h</samp> options.
  38077. </p>
  38078. <p>This option respects the value set for <samp class="option">force_original_aspect_ratio</samp>,
  38079. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  38080. may be slightly modified.
  38081. </p>
  38082. <p>This option can be handy if you need to have a video fit within or exceed
  38083. a defined resolution using <samp class="option">force_original_aspect_ratio</samp> but also have
  38084. encoder restrictions on width or height divisibility.
  38085. </p>
  38086. </dd>
  38087. </dl>
  38088. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  38089. containing the following constants:
  38090. </p>
  38091. <dl class="table">
  38092. <dt><var class="var">in_w</var></dt>
  38093. <dt><var class="var">in_h</var></dt>
  38094. <dd><p>The input width and height
  38095. </p>
  38096. </dd>
  38097. <dt><var class="var">iw</var></dt>
  38098. <dt><var class="var">ih</var></dt>
  38099. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  38100. </p>
  38101. </dd>
  38102. <dt><var class="var">out_w</var></dt>
  38103. <dt><var class="var">out_h</var></dt>
  38104. <dd><p>The output (scaled) width and height
  38105. </p>
  38106. </dd>
  38107. <dt><var class="var">ow</var></dt>
  38108. <dt><var class="var">oh</var></dt>
  38109. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  38110. </p>
  38111. </dd>
  38112. <dt><var class="var">a</var></dt>
  38113. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  38114. </p>
  38115. </dd>
  38116. <dt><var class="var">sar</var></dt>
  38117. <dd><p>input sample aspect ratio
  38118. </p>
  38119. </dd>
  38120. <dt><var class="var">dar</var></dt>
  38121. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  38122. </p>
  38123. </dd>
  38124. <dt><var class="var">hsub</var></dt>
  38125. <dt><var class="var">vsub</var></dt>
  38126. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  38127. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  38128. </p>
  38129. </dd>
  38130. <dt><var class="var">ohsub</var></dt>
  38131. <dt><var class="var">ovsub</var></dt>
  38132. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  38133. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  38134. </p>
  38135. </dd>
  38136. <dt><var class="var">n</var></dt>
  38137. <dd><p>The (sequential) number of the input frame, starting from 0.
  38138. Only available with <code class="code">eval=frame</code>.
  38139. </p>
  38140. </dd>
  38141. <dt><var class="var">t</var></dt>
  38142. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  38143. seconds. Only available with <code class="code">eval=frame</code>.
  38144. </p>
  38145. </dd>
  38146. <dt><var class="var">pos</var></dt>
  38147. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  38148. this information is unavailable and/or meaningless (for example in case of synthetic video).
  38149. Only available with <code class="code">eval=frame</code>.
  38150. Deprecated, do not use.
  38151. </p></dd>
  38152. </dl>
  38153. </div>
  38154. <div class="subsection-level-extent" id="Examples-131">
  38155. <h4 class="subsection"><span>30.217.2 Examples<a class="copiable-link" href="#Examples-131"> &para;</a></span></h4>
  38156. <ul class="itemize mark-bullet">
  38157. <li>Scale the input video to a size of 200x100
  38158. <div class="example">
  38159. <pre class="example-preformatted">scale=w=200:h=100
  38160. </pre></div>
  38161. <p>This is equivalent to:
  38162. </p><div class="example">
  38163. <pre class="example-preformatted">scale=200:100
  38164. </pre></div>
  38165. <p>or:
  38166. </p><div class="example">
  38167. <pre class="example-preformatted">scale=200x100
  38168. </pre></div>
  38169. </li><li>Specify a size abbreviation for the output size:
  38170. <div class="example">
  38171. <pre class="example-preformatted">scale=qcif
  38172. </pre></div>
  38173. <p>which can also be written as:
  38174. </p><div class="example">
  38175. <pre class="example-preformatted">scale=size=qcif
  38176. </pre></div>
  38177. </li><li>Scale the input to 2x:
  38178. <div class="example">
  38179. <pre class="example-preformatted">scale=w=2*iw:h=2*ih
  38180. </pre></div>
  38181. </li><li>The above is the same as:
  38182. <div class="example">
  38183. <pre class="example-preformatted">scale=2*in_w:2*in_h
  38184. </pre></div>
  38185. </li><li>Scale the input to 2x with forced interlaced scaling:
  38186. <div class="example">
  38187. <pre class="example-preformatted">scale=2*iw:2*ih:interl=1
  38188. </pre></div>
  38189. </li><li>Scale the input to half size:
  38190. <div class="example">
  38191. <pre class="example-preformatted">scale=w=iw/2:h=ih/2
  38192. </pre></div>
  38193. </li><li>Increase the width, and set the height to the same size:
  38194. <div class="example">
  38195. <pre class="example-preformatted">scale=3/2*iw:ow
  38196. </pre></div>
  38197. </li><li>Seek Greek harmony:
  38198. <div class="example">
  38199. <pre class="example-preformatted">scale=iw:1/PHI*iw
  38200. scale=ih*PHI:ih
  38201. </pre></div>
  38202. </li><li>Increase the height, and set the width to 3/2 of the height:
  38203. <div class="example">
  38204. <pre class="example-preformatted">scale=w=3/2*oh:h=3/5*ih
  38205. </pre></div>
  38206. </li><li>Increase the size, making the size a multiple of the chroma
  38207. subsample values:
  38208. <div class="example">
  38209. <pre class="example-preformatted">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
  38210. </pre></div>
  38211. </li><li>Increase the width to a maximum of 500 pixels,
  38212. keeping the same aspect ratio as the input:
  38213. <div class="example">
  38214. <pre class="example-preformatted">scale=w='min(500\, iw*3/2):h=-1'
  38215. </pre></div>
  38216. </li><li>Make pixels square by combining scale and setsar:
  38217. <div class="example">
  38218. <pre class="example-preformatted">scale='trunc(ih*dar):ih',setsar=1/1
  38219. </pre></div>
  38220. </li><li>Make pixels square by combining scale and setsar,
  38221. making sure the resulting resolution is even (required by some codecs):
  38222. <div class="example">
  38223. <pre class="example-preformatted">scale='trunc(ih*dar/2)*2:trunc(ih/2)*2',setsar=1/1
  38224. </pre></div>
  38225. </li></ul>
  38226. </div>
  38227. <div class="subsection-level-extent" id="Commands-138">
  38228. <h4 class="subsection"><span>30.217.3 Commands<a class="copiable-link" href="#Commands-138"> &para;</a></span></h4>
  38229. <p>This filter supports the following commands:
  38230. </p><dl class="table">
  38231. <dt><samp class="option">width, w</samp></dt>
  38232. <dt><samp class="option">height, h</samp></dt>
  38233. <dd><p>Set the output video dimension expression.
  38234. The command accepts the same syntax of the corresponding option.
  38235. </p>
  38236. <p>If the specified expression is not valid, it is kept at its current
  38237. value.
  38238. </p></dd>
  38239. </dl>
  38240. <a class="anchor" id="scale_005fcuda"></a></div>
  38241. </div>
  38242. <div class="section-level-extent" id="scale_005fcuda-1">
  38243. <h3 class="section"><span>30.218 scale_cuda<a class="copiable-link" href="#scale_005fcuda-1"> &para;</a></span></h3>
  38244. <p>Scale (resize) and convert (pixel format) the input video, using accelerated CUDA kernels.
  38245. Setting the output width and height works in the same way as for the <a class="ref" href="#scale">scale</a> filter.
  38246. </p>
  38247. <p>The filter accepts the following options:
  38248. </p><dl class="table">
  38249. <dt><samp class="option">w</samp></dt>
  38250. <dt><samp class="option">h</samp></dt>
  38251. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  38252. </p>
  38253. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  38254. </p>
  38255. </dd>
  38256. <dt><samp class="option">interp_algo</samp></dt>
  38257. <dd><p>Sets the algorithm used for scaling:
  38258. </p>
  38259. <dl class="table">
  38260. <dt><var class="var">nearest</var></dt>
  38261. <dd><p>Nearest neighbour
  38262. </p>
  38263. <p>Used by default if input parameters match the desired output.
  38264. </p>
  38265. </dd>
  38266. <dt><var class="var">bilinear</var></dt>
  38267. <dd><p>Bilinear
  38268. </p>
  38269. </dd>
  38270. <dt><var class="var">bicubic</var></dt>
  38271. <dd><p>Bicubic
  38272. </p>
  38273. <p>This is the default.
  38274. </p>
  38275. </dd>
  38276. <dt><var class="var">lanczos</var></dt>
  38277. <dd><p>Lanczos
  38278. </p>
  38279. </dd>
  38280. </dl>
  38281. </dd>
  38282. <dt><samp class="option">format</samp></dt>
  38283. <dd><p>Controls the output pixel format. By default, or if none is specified, the input
  38284. pixel format is used.
  38285. </p>
  38286. <p>The filter does not support converting between YUV and RGB pixel formats.
  38287. </p>
  38288. </dd>
  38289. <dt><samp class="option">passthrough</samp></dt>
  38290. <dd><p>If set to 0, every frame is processed, even if no conversion is necessary.
  38291. This mode can be useful to use the filter as a buffer for a downstream
  38292. frame-consumer that exhausts the limited decoder frame pool.
  38293. </p>
  38294. <p>If set to 1, frames are passed through as-is if they match the desired output
  38295. parameters. This is the default behaviour.
  38296. </p>
  38297. </dd>
  38298. <dt><samp class="option">param</samp></dt>
  38299. <dd><p>Algorithm-Specific parameter.
  38300. </p>
  38301. <p>Affects the curves of the bicubic algorithm.
  38302. </p>
  38303. </dd>
  38304. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  38305. <dt><samp class="option">force_divisible_by</samp></dt>
  38306. <dd><p>Work the same as the identical <a class="ref" href="#scale">scale</a> filter options.
  38307. </p>
  38308. </dd>
  38309. </dl>
  38310. <ul class="mini-toc">
  38311. <li><a href="#Examples-132" accesskey="1">Examples</a></li>
  38312. </ul>
  38313. <div class="subsection-level-extent" id="Examples-132">
  38314. <h4 class="subsection"><span>30.218.1 Examples<a class="copiable-link" href="#Examples-132"> &para;</a></span></h4>
  38315. <ul class="itemize mark-bullet">
  38316. <li>Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p.
  38317. <div class="example">
  38318. <pre class="example-preformatted">scale_cuda=-2:720:format=yuv420p
  38319. </pre></div>
  38320. </li><li>Upscale to 4K using nearest neighbour algorithm.
  38321. <div class="example">
  38322. <pre class="example-preformatted">scale_cuda=4096:2160:interp_algo=nearest
  38323. </pre></div>
  38324. </li><li>Don&rsquo;t do any conversion or scaling, but copy all input frames into newly allocated ones.
  38325. This can be useful to deal with a filter and encode chain that otherwise exhausts the
  38326. decoders frame pool.
  38327. <div class="example">
  38328. <pre class="example-preformatted">scale_cuda=passthrough=0
  38329. </pre></div>
  38330. </li></ul>
  38331. <a class="anchor" id="scale_005fnpp"></a></div>
  38332. </div>
  38333. <div class="section-level-extent" id="scale_005fnpp-1">
  38334. <h3 class="section"><span>30.219 scale_npp<a class="copiable-link" href="#scale_005fnpp-1"> &para;</a></span></h3>
  38335. <p>Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel
  38336. format conversion on CUDA video frames. Setting the output width and height
  38337. works in the same way as for the <var class="var">scale</var> filter.
  38338. </p>
  38339. <p>The following additional options are accepted:
  38340. </p><dl class="table">
  38341. <dt><samp class="option">format</samp></dt>
  38342. <dd><p>The pixel format of the output CUDA frames. If set to the string &quot;same&quot; (the
  38343. default), the input format will be kept. Note that automatic format negotiation
  38344. and conversion is not yet supported for hardware frames
  38345. </p>
  38346. </dd>
  38347. <dt><samp class="option">interp_algo</samp></dt>
  38348. <dd><p>The interpolation algorithm used for resizing. One of the following:
  38349. </p><dl class="table">
  38350. <dt><samp class="option">nn</samp></dt>
  38351. <dd><p>Nearest neighbour.
  38352. </p>
  38353. </dd>
  38354. <dt><samp class="option">linear</samp></dt>
  38355. <dt><samp class="option">cubic</samp></dt>
  38356. <dt><samp class="option">cubic2p_bspline</samp></dt>
  38357. <dd><p>2-parameter cubic (B=1, C=0)
  38358. </p>
  38359. </dd>
  38360. <dt><samp class="option">cubic2p_catmullrom</samp></dt>
  38361. <dd><p>2-parameter cubic (B=0, C=1/2)
  38362. </p>
  38363. </dd>
  38364. <dt><samp class="option">cubic2p_b05c03</samp></dt>
  38365. <dd><p>2-parameter cubic (B=1/2, C=3/10)
  38366. </p>
  38367. </dd>
  38368. <dt><samp class="option">super</samp></dt>
  38369. <dd><p>Supersampling
  38370. </p>
  38371. </dd>
  38372. <dt><samp class="option">lanczos</samp></dt>
  38373. </dl>
  38374. </dd>
  38375. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  38376. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  38377. keep the original aspect ratio. Possible values:
  38378. </p>
  38379. <dl class="table">
  38380. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  38381. <dd><p>Scale the video as specified and disable this feature.
  38382. </p>
  38383. </dd>
  38384. <dt>&lsquo;<samp class="samp">decrease</samp>&rsquo;</dt>
  38385. <dd><p>The output video dimensions will automatically be decreased if needed.
  38386. </p>
  38387. </dd>
  38388. <dt>&lsquo;<samp class="samp">increase</samp>&rsquo;</dt>
  38389. <dd><p>The output video dimensions will automatically be increased if needed.
  38390. </p>
  38391. </dd>
  38392. </dl>
  38393. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  38394. maximum allowed resolution, you can use this to limit the output video to
  38395. that, while retaining the aspect ratio. For example, device A allows
  38396. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  38397. decrease) and specifying 1280x720 to the command line makes the output
  38398. 1280x533.
  38399. </p>
  38400. <p>Please note that this is a different thing than specifying -1 for <samp class="option">w</samp>
  38401. or <samp class="option">h</samp>, you still need to specify the output resolution for this option
  38402. to work.
  38403. </p>
  38404. </dd>
  38405. <dt><samp class="option">force_divisible_by</samp></dt>
  38406. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  38407. given integer when used together with <samp class="option">force_original_aspect_ratio</samp>. This
  38408. works similar to using <code class="code">-n</code> in the <samp class="option">w</samp> and <samp class="option">h</samp> options.
  38409. </p>
  38410. <p>This option respects the value set for <samp class="option">force_original_aspect_ratio</samp>,
  38411. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  38412. may be slightly modified.
  38413. </p>
  38414. <p>This option can be handy if you need to have a video fit within or exceed
  38415. a defined resolution using <samp class="option">force_original_aspect_ratio</samp> but also have
  38416. encoder restrictions on width or height divisibility.
  38417. </p>
  38418. </dd>
  38419. <dt><samp class="option">eval</samp></dt>
  38420. <dd><p>Specify when to evaluate <var class="var">width</var> and <var class="var">height</var> expression. It accepts the following values:
  38421. </p>
  38422. <dl class="table">
  38423. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  38424. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  38425. </p>
  38426. </dd>
  38427. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  38428. <dd><p>Evaluate expressions for each incoming frame.
  38429. </p>
  38430. </dd>
  38431. </dl>
  38432. </dd>
  38433. </dl>
  38434. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  38435. containing the following constants:
  38436. </p>
  38437. <dl class="table">
  38438. <dt><var class="var">in_w</var></dt>
  38439. <dt><var class="var">in_h</var></dt>
  38440. <dd><p>The input width and height
  38441. </p>
  38442. </dd>
  38443. <dt><var class="var">iw</var></dt>
  38444. <dt><var class="var">ih</var></dt>
  38445. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  38446. </p>
  38447. </dd>
  38448. <dt><var class="var">out_w</var></dt>
  38449. <dt><var class="var">out_h</var></dt>
  38450. <dd><p>The output (scaled) width and height
  38451. </p>
  38452. </dd>
  38453. <dt><var class="var">ow</var></dt>
  38454. <dt><var class="var">oh</var></dt>
  38455. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  38456. </p>
  38457. </dd>
  38458. <dt><var class="var">a</var></dt>
  38459. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  38460. </p>
  38461. </dd>
  38462. <dt><var class="var">sar</var></dt>
  38463. <dd><p>input sample aspect ratio
  38464. </p>
  38465. </dd>
  38466. <dt><var class="var">dar</var></dt>
  38467. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  38468. </p>
  38469. </dd>
  38470. <dt><var class="var">n</var></dt>
  38471. <dd><p>The (sequential) number of the input frame, starting from 0.
  38472. Only available with <code class="code">eval=frame</code>.
  38473. </p>
  38474. </dd>
  38475. <dt><var class="var">t</var></dt>
  38476. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  38477. seconds. Only available with <code class="code">eval=frame</code>.
  38478. </p>
  38479. </dd>
  38480. <dt><var class="var">pos</var></dt>
  38481. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  38482. this information is unavailable and/or meaningless (for example in case of synthetic video).
  38483. Only available with <code class="code">eval=frame</code>.
  38484. Deprecated, do not use.
  38485. </p></dd>
  38486. </dl>
  38487. </div>
  38488. <div class="section-level-extent" id="scale2ref">
  38489. <h3 class="section"><span>30.220 scale2ref<a class="copiable-link" href="#scale2ref"> &para;</a></span></h3>
  38490. <p>Scale (resize) the input video, based on a reference video.
  38491. </p>
  38492. <p>See the scale filter for available options, scale2ref supports the same but
  38493. uses the reference video instead of the main input as basis. scale2ref also
  38494. supports the following additional constants for the <samp class="option">w</samp> and
  38495. <samp class="option">h</samp> options:
  38496. </p>
  38497. <dl class="table">
  38498. <dt><var class="var">main_w</var></dt>
  38499. <dt><var class="var">main_h</var></dt>
  38500. <dd><p>The main input video&rsquo;s width and height
  38501. </p>
  38502. </dd>
  38503. <dt><var class="var">main_a</var></dt>
  38504. <dd><p>The same as <var class="var">main_w</var> / <var class="var">main_h</var>
  38505. </p>
  38506. </dd>
  38507. <dt><var class="var">main_sar</var></dt>
  38508. <dd><p>The main input video&rsquo;s sample aspect ratio
  38509. </p>
  38510. </dd>
  38511. <dt><var class="var">main_dar, mdar</var></dt>
  38512. <dd><p>The main input video&rsquo;s display aspect ratio. Calculated from
  38513. <code class="code">(main_w / main_h) * main_sar</code>.
  38514. </p>
  38515. </dd>
  38516. <dt><var class="var">main_hsub</var></dt>
  38517. <dt><var class="var">main_vsub</var></dt>
  38518. <dd><p>The main input video&rsquo;s horizontal and vertical chroma subsample values.
  38519. For example for the pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var>
  38520. is 1.
  38521. </p>
  38522. </dd>
  38523. <dt><var class="var">main_n</var></dt>
  38524. <dd><p>The (sequential) number of the main input frame, starting from 0.
  38525. Only available with <code class="code">eval=frame</code>.
  38526. </p>
  38527. </dd>
  38528. <dt><var class="var">main_t</var></dt>
  38529. <dd><p>The presentation timestamp of the main input frame, expressed as a number of
  38530. seconds. Only available with <code class="code">eval=frame</code>.
  38531. </p>
  38532. </dd>
  38533. <dt><var class="var">main_pos</var></dt>
  38534. <dd><p>The position (byte offset) of the frame in the main input stream, or NaN if
  38535. this information is unavailable and/or meaningless (for example in case of synthetic video).
  38536. Only available with <code class="code">eval=frame</code>.
  38537. </p></dd>
  38538. </dl>
  38539. <ul class="mini-toc">
  38540. <li><a href="#Examples-133" accesskey="1">Examples</a></li>
  38541. <li><a href="#Commands-139" accesskey="2">Commands</a></li>
  38542. </ul>
  38543. <div class="subsection-level-extent" id="Examples-133">
  38544. <h4 class="subsection"><span>30.220.1 Examples<a class="copiable-link" href="#Examples-133"> &para;</a></span></h4>
  38545. <ul class="itemize mark-bullet">
  38546. <li>Scale a subtitle stream (b) to match the main video (a) in size before overlaying
  38547. <div class="example">
  38548. <pre class="example-preformatted">'scale2ref[b][a];[a][b]overlay'
  38549. </pre></div>
  38550. </li><li>Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
  38551. <div class="example">
  38552. <pre class="example-preformatted">[logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
  38553. </pre></div>
  38554. </li></ul>
  38555. </div>
  38556. <div class="subsection-level-extent" id="Commands-139">
  38557. <h4 class="subsection"><span>30.220.2 Commands<a class="copiable-link" href="#Commands-139"> &para;</a></span></h4>
  38558. <p>This filter supports the following commands:
  38559. </p><dl class="table">
  38560. <dt><samp class="option">width, w</samp></dt>
  38561. <dt><samp class="option">height, h</samp></dt>
  38562. <dd><p>Set the output video dimension expression.
  38563. The command accepts the same syntax of the corresponding option.
  38564. </p>
  38565. <p>If the specified expression is not valid, it is kept at its current
  38566. value.
  38567. </p></dd>
  38568. </dl>
  38569. </div>
  38570. </div>
  38571. <div class="section-level-extent" id="scale2ref_005fnpp">
  38572. <h3 class="section"><span>30.221 scale2ref_npp<a class="copiable-link" href="#scale2ref_005fnpp"> &para;</a></span></h3>
  38573. <p>Use the NVIDIA Performance Primitives (libnpp) to scale (resize) the input
  38574. video, based on a reference video.
  38575. </p>
  38576. <p>See the <a class="ref" href="#scale_005fnpp">scale_npp</a> filter for available options, scale2ref_npp supports the same
  38577. but uses the reference video instead of the main input as basis. scale2ref_npp
  38578. also supports the following additional constants for the <samp class="option">w</samp> and
  38579. <samp class="option">h</samp> options:
  38580. </p>
  38581. <dl class="table">
  38582. <dt><var class="var">main_w</var></dt>
  38583. <dt><var class="var">main_h</var></dt>
  38584. <dd><p>The main input video&rsquo;s width and height
  38585. </p>
  38586. </dd>
  38587. <dt><var class="var">main_a</var></dt>
  38588. <dd><p>The same as <var class="var">main_w</var> / <var class="var">main_h</var>
  38589. </p>
  38590. </dd>
  38591. <dt><var class="var">main_sar</var></dt>
  38592. <dd><p>The main input video&rsquo;s sample aspect ratio
  38593. </p>
  38594. </dd>
  38595. <dt><var class="var">main_dar, mdar</var></dt>
  38596. <dd><p>The main input video&rsquo;s display aspect ratio. Calculated from
  38597. <code class="code">(main_w / main_h) * main_sar</code>.
  38598. </p>
  38599. </dd>
  38600. <dt><var class="var">main_n</var></dt>
  38601. <dd><p>The (sequential) number of the main input frame, starting from 0.
  38602. Only available with <code class="code">eval=frame</code>.
  38603. </p>
  38604. </dd>
  38605. <dt><var class="var">main_t</var></dt>
  38606. <dd><p>The presentation timestamp of the main input frame, expressed as a number of
  38607. seconds. Only available with <code class="code">eval=frame</code>.
  38608. </p>
  38609. </dd>
  38610. <dt><var class="var">main_pos</var></dt>
  38611. <dd><p>The position (byte offset) of the frame in the main input stream, or NaN if
  38612. this information is unavailable and/or meaningless (for example in case of synthetic video).
  38613. Only available with <code class="code">eval=frame</code>.
  38614. </p></dd>
  38615. </dl>
  38616. <ul class="mini-toc">
  38617. <li><a href="#Examples-134" accesskey="1">Examples</a></li>
  38618. </ul>
  38619. <div class="subsection-level-extent" id="Examples-134">
  38620. <h4 class="subsection"><span>30.221.1 Examples<a class="copiable-link" href="#Examples-134"> &para;</a></span></h4>
  38621. <ul class="itemize mark-bullet">
  38622. <li>Scale a subtitle stream (b) to match the main video (a) in size before overlaying
  38623. <div class="example">
  38624. <pre class="example-preformatted">'scale2ref_npp[b][a];[a][b]overlay_cuda'
  38625. </pre></div>
  38626. </li><li>Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
  38627. <div class="example">
  38628. <pre class="example-preformatted">[logo-in][video-in]scale2ref_npp=w=oh*mdar:h=ih/10[logo-out][video-out]
  38629. </pre></div>
  38630. </li></ul>
  38631. </div>
  38632. </div>
  38633. <div class="section-level-extent" id="scale_005fvt">
  38634. <h3 class="section"><span>30.222 scale_vt<a class="copiable-link" href="#scale_005fvt"> &para;</a></span></h3>
  38635. <p>Scale and convert the color parameters using VTPixelTransferSession.
  38636. </p>
  38637. <p>The filter accepts the following options:
  38638. </p><dl class="table">
  38639. <dt><samp class="option">w</samp></dt>
  38640. <dt><samp class="option">h</samp></dt>
  38641. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  38642. </p>
  38643. </dd>
  38644. <dt><samp class="option">color_matrix</samp></dt>
  38645. <dd><p>Set the output colorspace matrix.
  38646. </p>
  38647. </dd>
  38648. <dt><samp class="option">color_primaries</samp></dt>
  38649. <dd><p>Set the output color primaries.
  38650. </p>
  38651. </dd>
  38652. <dt><samp class="option">color_transfer</samp></dt>
  38653. <dd><p>Set the output transfer characteristics.
  38654. </p>
  38655. </dd>
  38656. </dl>
  38657. </div>
  38658. <div class="section-level-extent" id="scharr">
  38659. <h3 class="section"><span>30.223 scharr<a class="copiable-link" href="#scharr"> &para;</a></span></h3>
  38660. <p>Apply scharr operator to input video stream.
  38661. </p>
  38662. <p>The filter accepts the following option:
  38663. </p>
  38664. <dl class="table">
  38665. <dt><samp class="option">planes</samp></dt>
  38666. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  38667. By default value 0xf, all planes will be processed.
  38668. </p>
  38669. </dd>
  38670. <dt><samp class="option">scale</samp></dt>
  38671. <dd><p>Set value which will be multiplied with filtered result.
  38672. </p>
  38673. </dd>
  38674. <dt><samp class="option">delta</samp></dt>
  38675. <dd><p>Set value which will be added to filtered result.
  38676. </p></dd>
  38677. </dl>
  38678. <ul class="mini-toc">
  38679. <li><a href="#Commands-140" accesskey="1">Commands</a></li>
  38680. </ul>
  38681. <div class="subsection-level-extent" id="Commands-140">
  38682. <h4 class="subsection"><span>30.223.1 Commands<a class="copiable-link" href="#Commands-140"> &para;</a></span></h4>
  38683. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  38684. </p>
  38685. </div>
  38686. </div>
  38687. <div class="section-level-extent" id="scroll">
  38688. <h3 class="section"><span>30.224 scroll<a class="copiable-link" href="#scroll"> &para;</a></span></h3>
  38689. <p>Scroll input video horizontally and/or vertically by constant speed.
  38690. </p>
  38691. <p>The filter accepts the following options:
  38692. </p><dl class="table">
  38693. <dt><samp class="option">horizontal, h</samp></dt>
  38694. <dd><p>Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1.
  38695. Negative values changes scrolling direction.
  38696. </p>
  38697. </dd>
  38698. <dt><samp class="option">vertical, v</samp></dt>
  38699. <dd><p>Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1.
  38700. Negative values changes scrolling direction.
  38701. </p>
  38702. </dd>
  38703. <dt><samp class="option">hpos</samp></dt>
  38704. <dd><p>Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1.
  38705. </p>
  38706. </dd>
  38707. <dt><samp class="option">vpos</samp></dt>
  38708. <dd><p>Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1.
  38709. </p></dd>
  38710. </dl>
  38711. <ul class="mini-toc">
  38712. <li><a href="#Commands-141" accesskey="1">Commands</a></li>
  38713. </ul>
  38714. <div class="subsection-level-extent" id="Commands-141">
  38715. <h4 class="subsection"><span>30.224.1 Commands<a class="copiable-link" href="#Commands-141"> &para;</a></span></h4>
  38716. <p>This filter supports the following <a class="ref" href="#commands">commands</a>:
  38717. </p><dl class="table">
  38718. <dt><samp class="option">horizontal, h</samp></dt>
  38719. <dd><p>Set the horizontal scrolling speed.
  38720. </p></dd>
  38721. <dt><samp class="option">vertical, v</samp></dt>
  38722. <dd><p>Set the vertical scrolling speed.
  38723. </p></dd>
  38724. </dl>
  38725. <a class="anchor" id="scdet"></a></div>
  38726. </div>
  38727. <div class="section-level-extent" id="scdet-1">
  38728. <h3 class="section"><span>30.225 scdet<a class="copiable-link" href="#scdet-1"> &para;</a></span></h3>
  38729. <p>Detect video scene change.
  38730. </p>
  38731. <p>This filter sets frame metadata with mafd between frame, the scene score, and
  38732. forward the frame to the next filter, so they can use these metadata to detect
  38733. scene change or others.
  38734. </p>
  38735. <p>In addition, this filter logs a message and sets frame metadata when it detects
  38736. a scene change by <samp class="option">threshold</samp>.
  38737. </p>
  38738. <p><code class="code">lavfi.scd.mafd</code> metadata keys are set with mafd for every frame.
  38739. </p>
  38740. <p><code class="code">lavfi.scd.score</code> metadata keys are set with scene change score for every frame
  38741. to detect scene change.
  38742. </p>
  38743. <p><code class="code">lavfi.scd.time</code> metadata keys are set with current filtered frame time which
  38744. detect scene change with <samp class="option">threshold</samp>.
  38745. </p>
  38746. <p>The filter accepts the following options:
  38747. </p>
  38748. <dl class="table">
  38749. <dt><samp class="option">threshold, t</samp></dt>
  38750. <dd><p>Set the scene change detection threshold as a percentage of maximum change. Good
  38751. values are in the <code class="code">[8.0, 14.0]</code> range. The range for <samp class="option">threshold</samp> is
  38752. <code class="code">[0., 100.]</code>.
  38753. </p>
  38754. <p>Default value is <code class="code">10.</code>.
  38755. </p>
  38756. </dd>
  38757. <dt><samp class="option">sc_pass, s</samp></dt>
  38758. <dd><p>Set the flag to pass scene change frames to the next filter. Default value is <code class="code">0</code>
  38759. You can enable it if you want to get snapshot of scene change frames only.
  38760. </p></dd>
  38761. </dl>
  38762. <a class="anchor" id="selectivecolor"></a></div>
  38763. <div class="section-level-extent" id="selectivecolor-1">
  38764. <h3 class="section"><span>30.226 selectivecolor<a class="copiable-link" href="#selectivecolor-1"> &para;</a></span></h3>
  38765. <p>Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such
  38766. as &quot;reds&quot;, &quot;yellows&quot;, &quot;greens&quot;, &quot;cyans&quot;, ...). The adjustment range is defined
  38767. by the &quot;purity&quot; of the color (that is, how saturated it already is).
  38768. </p>
  38769. <p>This filter is similar to the Adobe Photoshop Selective Color tool.
  38770. </p>
  38771. <p>The filter accepts the following options:
  38772. </p>
  38773. <dl class="table">
  38774. <dt><samp class="option">correction_method</samp></dt>
  38775. <dd><p>Select color correction method.
  38776. </p>
  38777. <p>Available values are:
  38778. </p><dl class="table">
  38779. <dt>&lsquo;<samp class="samp">absolute</samp>&rsquo;</dt>
  38780. <dd><p>Specified adjustments are applied &quot;as-is&quot; (added/subtracted to original pixel
  38781. component value).
  38782. </p></dd>
  38783. <dt>&lsquo;<samp class="samp">relative</samp>&rsquo;</dt>
  38784. <dd><p>Specified adjustments are relative to the original component value.
  38785. </p></dd>
  38786. </dl>
  38787. <p>Default is <code class="code">absolute</code>.
  38788. </p></dd>
  38789. <dt><samp class="option">reds</samp></dt>
  38790. <dd><p>Adjustments for red pixels (pixels where the red component is the maximum)
  38791. </p></dd>
  38792. <dt><samp class="option">yellows</samp></dt>
  38793. <dd><p>Adjustments for yellow pixels (pixels where the blue component is the minimum)
  38794. </p></dd>
  38795. <dt><samp class="option">greens</samp></dt>
  38796. <dd><p>Adjustments for green pixels (pixels where the green component is the maximum)
  38797. </p></dd>
  38798. <dt><samp class="option">cyans</samp></dt>
  38799. <dd><p>Adjustments for cyan pixels (pixels where the red component is the minimum)
  38800. </p></dd>
  38801. <dt><samp class="option">blues</samp></dt>
  38802. <dd><p>Adjustments for blue pixels (pixels where the blue component is the maximum)
  38803. </p></dd>
  38804. <dt><samp class="option">magentas</samp></dt>
  38805. <dd><p>Adjustments for magenta pixels (pixels where the green component is the minimum)
  38806. </p></dd>
  38807. <dt><samp class="option">whites</samp></dt>
  38808. <dd><p>Adjustments for white pixels (pixels where all components are greater than 128)
  38809. </p></dd>
  38810. <dt><samp class="option">neutrals</samp></dt>
  38811. <dd><p>Adjustments for all pixels except pure black and pure white
  38812. </p></dd>
  38813. <dt><samp class="option">blacks</samp></dt>
  38814. <dd><p>Adjustments for black pixels (pixels where all components are lesser than 128)
  38815. </p></dd>
  38816. <dt><samp class="option">psfile</samp></dt>
  38817. <dd><p>Specify a Photoshop selective color file (<code class="code">.asv</code>) to import the settings from.
  38818. </p></dd>
  38819. </dl>
  38820. <p>All the adjustment settings (<samp class="option">reds</samp>, <samp class="option">yellows</samp>, ...) accept up to
  38821. 4 space separated floating point adjustment values in the [-1,1] range,
  38822. respectively to adjust the amount of cyan, magenta, yellow and black for the
  38823. pixels of its range.
  38824. </p>
  38825. <ul class="mini-toc">
  38826. <li><a href="#Examples-135" accesskey="1">Examples</a></li>
  38827. </ul>
  38828. <div class="subsection-level-extent" id="Examples-135">
  38829. <h4 class="subsection"><span>30.226.1 Examples<a class="copiable-link" href="#Examples-135"> &para;</a></span></h4>
  38830. <ul class="itemize mark-bullet">
  38831. <li>Increase cyan by 50% and reduce yellow by 33% in every green areas, and
  38832. increase magenta by 27% in blue areas:
  38833. <div class="example">
  38834. <pre class="example-preformatted">selectivecolor=greens=.5 0 -.33 0:blues=0 .27
  38835. </pre></div>
  38836. </li><li>Use a Photoshop selective color preset:
  38837. <div class="example">
  38838. <pre class="example-preformatted">selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
  38839. </pre></div>
  38840. </li></ul>
  38841. <a class="anchor" id="separatefields"></a></div>
  38842. </div>
  38843. <div class="section-level-extent" id="separatefields-1">
  38844. <h3 class="section"><span>30.227 separatefields<a class="copiable-link" href="#separatefields-1"> &para;</a></span></h3>
  38845. <p>The <code class="code">separatefields</code> takes a frame-based video input and splits
  38846. each frame into its components fields, producing a new half height clip
  38847. with twice the frame rate and twice the frame count.
  38848. </p>
  38849. <p>This filter use field-dominance information in frame to decide which
  38850. of each pair of fields to place first in the output.
  38851. If it gets it wrong use <a class="ref" href="#setfield">setfield</a> filter before <code class="code">separatefields</code> filter.
  38852. </p>
  38853. </div>
  38854. <div class="section-level-extent" id="setdar_002c-setsar">
  38855. <h3 class="section"><span>30.228 setdar, setsar<a class="copiable-link" href="#setdar_002c-setsar"> &para;</a></span></h3>
  38856. <p>The <code class="code">setdar</code> filter sets the Display Aspect Ratio for the filter
  38857. output video.
  38858. </p>
  38859. <p>This is done by changing the specified Sample (aka Pixel) Aspect
  38860. Ratio, according to the following equation:
  38861. </p><div class="example">
  38862. <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>
  38863. </pre></div>
  38864. <p>Keep in mind that the <code class="code">setdar</code> filter does not modify the pixel
  38865. dimensions of the video frame. Also, the display aspect ratio set by
  38866. this filter may be changed by later filters in the filterchain,
  38867. e.g. in case of scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is
  38868. applied.
  38869. </p>
  38870. <p>The <code class="code">setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
  38871. the filter output video.
  38872. </p>
  38873. <p>Note that as a consequence of the application of this filter, the
  38874. output display aspect ratio will change according to the equation
  38875. above.
  38876. </p>
  38877. <p>Keep in mind that the sample aspect ratio set by the <code class="code">setsar</code>
  38878. filter may be changed by later filters in the filterchain, e.g. if
  38879. another &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
  38880. </p>
  38881. <p>It accepts the following parameters:
  38882. </p>
  38883. <dl class="table">
  38884. <dt><samp class="option">r, ratio, dar (<code class="code">setdar</code> only), sar (<code class="code">setsar</code> only)</samp></dt>
  38885. <dd><p>Set the aspect ratio used by the filter.
  38886. </p>
  38887. <p>The parameter can be a floating point number string, or an expression. If the
  38888. parameter is not specified, the value &quot;0&quot; is assumed, meaning that the same
  38889. input value is used.
  38890. </p>
  38891. </dd>
  38892. <dt><samp class="option">max</samp></dt>
  38893. <dd><p>Set the maximum integer value to use for expressing numerator and
  38894. denominator when reducing the expressed aspect ratio to a rational.
  38895. Default value is <code class="code">100</code>.
  38896. </p>
  38897. </dd>
  38898. </dl>
  38899. <p>The parameter <var class="var">sar</var> is an expression containing the following constants:
  38900. </p>
  38901. <dl class="table">
  38902. <dt><samp class="option">w, h</samp></dt>
  38903. <dd><p>The input width and height.
  38904. </p>
  38905. </dd>
  38906. <dt><samp class="option">a</samp></dt>
  38907. <dd><p>Same as <var class="var">w</var> / <var class="var">h</var>.
  38908. </p>
  38909. </dd>
  38910. <dt><samp class="option">sar</samp></dt>
  38911. <dd><p>The input sample aspect ratio.
  38912. </p>
  38913. </dd>
  38914. <dt><samp class="option">dar</samp></dt>
  38915. <dd><p>The input display aspect ratio. It is the same as
  38916. (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>.
  38917. </p>
  38918. </dd>
  38919. <dt><samp class="option">hsub, vsub</samp></dt>
  38920. <dd><p>Horizontal and vertical chroma subsample values. For example, for the
  38921. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  38922. </p></dd>
  38923. </dl>
  38924. <ul class="mini-toc">
  38925. <li><a href="#Examples-136" accesskey="1">Examples</a></li>
  38926. </ul>
  38927. <div class="subsection-level-extent" id="Examples-136">
  38928. <h4 class="subsection"><span>30.228.1 Examples<a class="copiable-link" href="#Examples-136"> &para;</a></span></h4>
  38929. <ul class="itemize mark-bullet">
  38930. <li>To change the display aspect ratio to 16:9, specify one of the following:
  38931. <div class="example">
  38932. <pre class="example-preformatted">setdar=dar=1.77777
  38933. setdar=dar=16/9
  38934. </pre></div>
  38935. </li><li>To change the sample aspect ratio to 10:11, specify:
  38936. <div class="example">
  38937. <pre class="example-preformatted">setsar=sar=10/11
  38938. </pre></div>
  38939. </li><li>To set a display aspect ratio of 16:9, and specify a maximum integer value of
  38940. 1000 in the aspect ratio reduction, use the command:
  38941. <div class="example">
  38942. <pre class="example-preformatted">setdar=ratio=16/9:max=1000
  38943. </pre></div>
  38944. </li></ul>
  38945. <a class="anchor" id="setfield"></a></div>
  38946. </div>
  38947. <div class="section-level-extent" id="setfield-1">
  38948. <h3 class="section"><span>30.229 setfield<a class="copiable-link" href="#setfield-1"> &para;</a></span></h3>
  38949. <p>Force field for the output video frame.
  38950. </p>
  38951. <p>The <code class="code">setfield</code> filter marks the interlace type field for the
  38952. output frames. It does not change the input frame, but only sets the
  38953. corresponding property, which affects how the frame is treated by
  38954. following filters (e.g. <code class="code">fieldorder</code> or <code class="code">yadif</code>).
  38955. </p>
  38956. <p>The filter accepts the following options:
  38957. </p>
  38958. <dl class="table">
  38959. <dt><samp class="option">mode</samp></dt>
  38960. <dd><p>Available values are:
  38961. </p>
  38962. <dl class="table">
  38963. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  38964. <dd><p>Keep the same field property.
  38965. </p>
  38966. </dd>
  38967. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  38968. <dd><p>Mark the frame as bottom-field-first.
  38969. </p>
  38970. </dd>
  38971. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  38972. <dd><p>Mark the frame as top-field-first.
  38973. </p>
  38974. </dd>
  38975. <dt>&lsquo;<samp class="samp">prog</samp>&rsquo;</dt>
  38976. <dd><p>Mark the frame as progressive.
  38977. </p></dd>
  38978. </dl>
  38979. </dd>
  38980. </dl>
  38981. <a class="anchor" id="setparams"></a></div>
  38982. <div class="section-level-extent" id="setparams-1">
  38983. <h3 class="section"><span>30.230 setparams<a class="copiable-link" href="#setparams-1"> &para;</a></span></h3>
  38984. <p>Force frame parameter for the output video frame.
  38985. </p>
  38986. <p>The <code class="code">setparams</code> filter marks interlace and color range for the
  38987. output frames. It does not change the input frame, but only sets the
  38988. corresponding property, which affects how the frame is treated by
  38989. filters/encoders.
  38990. </p>
  38991. <dl class="table">
  38992. <dt><samp class="option">field_mode</samp></dt>
  38993. <dd><p>Available values are:
  38994. </p>
  38995. <dl class="table">
  38996. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  38997. <dd><p>Keep the same field property (default).
  38998. </p>
  38999. </dd>
  39000. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  39001. <dd><p>Mark the frame as bottom-field-first.
  39002. </p>
  39003. </dd>
  39004. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  39005. <dd><p>Mark the frame as top-field-first.
  39006. </p>
  39007. </dd>
  39008. <dt>&lsquo;<samp class="samp">prog</samp>&rsquo;</dt>
  39009. <dd><p>Mark the frame as progressive.
  39010. </p></dd>
  39011. </dl>
  39012. </dd>
  39013. <dt><samp class="option">range</samp></dt>
  39014. <dd><p>Available values are:
  39015. </p>
  39016. <dl class="table">
  39017. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  39018. <dd><p>Keep the same color range property (default).
  39019. </p>
  39020. </dd>
  39021. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  39022. <dd><p>Mark the frame as unspecified color range.
  39023. </p>
  39024. </dd>
  39025. <dt>&lsquo;<samp class="samp">limited, tv, mpeg</samp>&rsquo;</dt>
  39026. <dd><p>Mark the frame as limited range.
  39027. </p>
  39028. </dd>
  39029. <dt>&lsquo;<samp class="samp">full, pc, jpeg</samp>&rsquo;</dt>
  39030. <dd><p>Mark the frame as full range.
  39031. </p></dd>
  39032. </dl>
  39033. </dd>
  39034. <dt><samp class="option">color_primaries</samp></dt>
  39035. <dd><p>Set the color primaries.
  39036. Available values are:
  39037. </p>
  39038. <dl class="table">
  39039. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  39040. <dd><p>Keep the same color primaries property (default).
  39041. </p>
  39042. </dd>
  39043. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  39044. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  39045. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  39046. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  39047. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  39048. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  39049. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  39050. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  39051. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  39052. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  39053. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  39054. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  39055. </dl>
  39056. </dd>
  39057. <dt><samp class="option">color_trc</samp></dt>
  39058. <dd><p>Set the color transfer.
  39059. Available values are:
  39060. </p>
  39061. <dl class="table">
  39062. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  39063. <dd><p>Keep the same color trc property (default).
  39064. </p>
  39065. </dd>
  39066. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  39067. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  39068. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  39069. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  39070. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  39071. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  39072. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  39073. <dt>&lsquo;<samp class="samp">log100</samp>&rsquo;</dt>
  39074. <dt>&lsquo;<samp class="samp">log316</samp>&rsquo;</dt>
  39075. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  39076. <dt>&lsquo;<samp class="samp">bt1361e</samp>&rsquo;</dt>
  39077. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  39078. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  39079. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  39080. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  39081. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  39082. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  39083. </dl>
  39084. </dd>
  39085. <dt><samp class="option">colorspace</samp></dt>
  39086. <dd><p>Set the colorspace.
  39087. Available values are:
  39088. </p>
  39089. <dl class="table">
  39090. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  39091. <dd><p>Keep the same colorspace property (default).
  39092. </p>
  39093. </dd>
  39094. <dt>&lsquo;<samp class="samp">gbr</samp>&rsquo;</dt>
  39095. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  39096. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  39097. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  39098. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  39099. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  39100. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  39101. <dt>&lsquo;<samp class="samp">ycgco</samp>&rsquo;</dt>
  39102. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  39103. <dt>&lsquo;<samp class="samp">bt2020c</samp>&rsquo;</dt>
  39104. <dt>&lsquo;<samp class="samp">smpte2085</samp>&rsquo;</dt>
  39105. <dt>&lsquo;<samp class="samp">chroma-derived-nc</samp>&rsquo;</dt>
  39106. <dt>&lsquo;<samp class="samp">chroma-derived-c</samp>&rsquo;</dt>
  39107. <dt>&lsquo;<samp class="samp">ictcp</samp>&rsquo;</dt>
  39108. </dl>
  39109. </dd>
  39110. </dl>
  39111. </div>
  39112. <div class="section-level-extent" id="sharpen_005fnpp">
  39113. <h3 class="section"><span>30.231 sharpen_npp<a class="copiable-link" href="#sharpen_005fnpp"> &para;</a></span></h3>
  39114. <p>Use the NVIDIA Performance Primitives (libnpp) to perform image sharpening with
  39115. border control.
  39116. </p>
  39117. <p>The following additional options are accepted:
  39118. </p><dl class="table">
  39119. <dt><samp class="option">border_type</samp></dt>
  39120. <dd><p>Type of sampling to be used ad frame borders. One of the following:
  39121. </p><dl class="table">
  39122. <dt><samp class="option">replicate</samp></dt>
  39123. <dd><p>Replicate pixel values.
  39124. </p>
  39125. </dd>
  39126. </dl>
  39127. </dd>
  39128. </dl>
  39129. </div>
  39130. <div class="section-level-extent" id="shear">
  39131. <h3 class="section"><span>30.232 shear<a class="copiable-link" href="#shear"> &para;</a></span></h3>
  39132. <p>Apply shear transform to input video.
  39133. </p>
  39134. <p>This filter supports the following options:
  39135. </p>
  39136. <dl class="table">
  39137. <dt><samp class="option">shx</samp></dt>
  39138. <dd><p>Shear factor in X-direction. Default value is 0.
  39139. Allowed range is from -2 to 2.
  39140. </p>
  39141. </dd>
  39142. <dt><samp class="option">shy</samp></dt>
  39143. <dd><p>Shear factor in Y-direction. Default value is 0.
  39144. Allowed range is from -2 to 2.
  39145. </p>
  39146. </dd>
  39147. <dt><samp class="option">fillcolor, c</samp></dt>
  39148. <dd><p>Set the color used to fill the output area not covered by the transformed
  39149. video. For the general syntax of this option, check the
  39150. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  39151. If the special value &quot;none&quot; is selected then no
  39152. background is printed (useful for example if the background is never shown).
  39153. </p>
  39154. <p>Default value is &quot;black&quot;.
  39155. </p>
  39156. </dd>
  39157. <dt><samp class="option">interp</samp></dt>
  39158. <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>.
  39159. </p></dd>
  39160. </dl>
  39161. <ul class="mini-toc">
  39162. <li><a href="#Commands-142" accesskey="1">Commands</a></li>
  39163. </ul>
  39164. <div class="subsection-level-extent" id="Commands-142">
  39165. <h4 class="subsection"><span>30.232.1 Commands<a class="copiable-link" href="#Commands-142"> &para;</a></span></h4>
  39166. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  39167. </p>
  39168. </div>
  39169. </div>
  39170. <div class="section-level-extent" id="showinfo-1">
  39171. <h3 class="section"><span>30.233 showinfo<a class="copiable-link" href="#showinfo-1"> &para;</a></span></h3>
  39172. <p>Show a line containing various information for each input video frame.
  39173. The input video is not modified.
  39174. </p>
  39175. <p>This filter supports the following options:
  39176. </p>
  39177. <dl class="table">
  39178. <dt><samp class="option">checksum</samp></dt>
  39179. <dd><p>Calculate checksums of each plane. By default enabled.
  39180. </p>
  39181. </dd>
  39182. <dt><samp class="option">udu_sei_as_ascii</samp></dt>
  39183. <dd><p>Try to print user data unregistered SEI as ascii character when possible,
  39184. in hex format otherwise.
  39185. </p></dd>
  39186. </dl>
  39187. <p>The shown line contains a sequence of key/value pairs of the form
  39188. <var class="var">key</var>:<var class="var">value</var>.
  39189. </p>
  39190. <p>The following values are shown in the output:
  39191. </p>
  39192. <dl class="table">
  39193. <dt><samp class="option">n</samp></dt>
  39194. <dd><p>The (sequential) number of the input frame, starting from 0.
  39195. </p>
  39196. </dd>
  39197. <dt><samp class="option">pts</samp></dt>
  39198. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  39199. time base units. The time base unit depends on the filter input pad.
  39200. </p>
  39201. </dd>
  39202. <dt><samp class="option">pts_time</samp></dt>
  39203. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  39204. seconds.
  39205. </p>
  39206. </dd>
  39207. <dt><samp class="option">fmt</samp></dt>
  39208. <dd><p>The pixel format name.
  39209. </p>
  39210. </dd>
  39211. <dt><samp class="option">sar</samp></dt>
  39212. <dd><p>The sample aspect ratio of the input frame, expressed in the form
  39213. <var class="var">num</var>/<var class="var">den</var>.
  39214. </p>
  39215. </dd>
  39216. <dt><samp class="option">s</samp></dt>
  39217. <dd><p>The size of the input frame. For the syntax of this option, check the
  39218. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  39219. </p>
  39220. </dd>
  39221. <dt><samp class="option">i</samp></dt>
  39222. <dd><p>The type of interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
  39223. for bottom field first).
  39224. </p>
  39225. </dd>
  39226. <dt><samp class="option">iskey</samp></dt>
  39227. <dd><p>This is 1 if the frame is a key frame, 0 otherwise.
  39228. </p>
  39229. </dd>
  39230. <dt><samp class="option">type</samp></dt>
  39231. <dd><p>The picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
  39232. P-frame, &quot;B&quot; for a B-frame, or &quot;?&quot; for an unknown type).
  39233. Also refer to the documentation of the <code class="code">AVPictureType</code> enum and of
  39234. the <code class="code">av_get_picture_type_char</code> function defined in
  39235. <samp class="file">libavutil/avutil.h</samp>.
  39236. </p>
  39237. </dd>
  39238. <dt><samp class="option">checksum</samp></dt>
  39239. <dd><p>The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame.
  39240. </p>
  39241. </dd>
  39242. <dt><samp class="option">plane_checksum</samp></dt>
  39243. <dd><p>The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
  39244. 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;.
  39245. </p>
  39246. </dd>
  39247. <dt><samp class="option">mean</samp></dt>
  39248. <dd><p>The mean value of pixels in each plane of the input frame, expressed in the form
  39249. &quot;[<var class="var">mean0</var> <var class="var">mean1</var> <var class="var">mean2</var> <var class="var">mean3</var>]&quot;.
  39250. </p>
  39251. </dd>
  39252. <dt><samp class="option">stdev</samp></dt>
  39253. <dd><p>The standard deviation of pixel values in each plane of the input frame, expressed
  39254. 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;.
  39255. </p>
  39256. </dd>
  39257. </dl>
  39258. </div>
  39259. <div class="section-level-extent" id="showpalette">
  39260. <h3 class="section"><span>30.234 showpalette<a class="copiable-link" href="#showpalette"> &para;</a></span></h3>
  39261. <p>Displays the 256 colors palette of each frame. This filter is only relevant for
  39262. <var class="var">pal8</var> pixel format frames.
  39263. </p>
  39264. <p>It accepts the following option:
  39265. </p>
  39266. <dl class="table">
  39267. <dt><samp class="option">s</samp></dt>
  39268. <dd><p>Set the size of the box used to represent one palette color entry. Default is
  39269. <code class="code">30</code> (for a <code class="code">30x30</code> pixel box).
  39270. </p></dd>
  39271. </dl>
  39272. </div>
  39273. <div class="section-level-extent" id="shuffleframes">
  39274. <h3 class="section"><span>30.235 shuffleframes<a class="copiable-link" href="#shuffleframes"> &para;</a></span></h3>
  39275. <p>Reorder and/or duplicate and/or drop video frames.
  39276. </p>
  39277. <p>It accepts the following parameters:
  39278. </p>
  39279. <dl class="table">
  39280. <dt><samp class="option">mapping</samp></dt>
  39281. <dd><p>Set the destination indexes of input frames.
  39282. This is space or &rsquo;|&rsquo; separated list of indexes that maps input frames to output
  39283. frames. Number of indexes also sets maximal value that each index may have.
  39284. &rsquo;-1&rsquo; index have special meaning and that is to drop frame.
  39285. </p></dd>
  39286. </dl>
  39287. <p>The first frame has the index 0. The default is to keep the input unchanged.
  39288. </p>
  39289. <ul class="mini-toc">
  39290. <li><a href="#Examples-137" accesskey="1">Examples</a></li>
  39291. </ul>
  39292. <div class="subsection-level-extent" id="Examples-137">
  39293. <h4 class="subsection"><span>30.235.1 Examples<a class="copiable-link" href="#Examples-137"> &para;</a></span></h4>
  39294. <ul class="itemize mark-bullet">
  39295. <li>Swap second and third frame of every three frames of the input:
  39296. <div class="example">
  39297. <pre class="example-preformatted">ffmpeg -i INPUT -vf &quot;shuffleframes=0 2 1&quot; OUTPUT
  39298. </pre></div>
  39299. </li><li>Swap 10th and 1st frame of every ten frames of the input:
  39300. <div class="example">
  39301. <pre class="example-preformatted">ffmpeg -i INPUT -vf &quot;shuffleframes=9 1 2 3 4 5 6 7 8 0&quot; OUTPUT
  39302. </pre></div>
  39303. </li></ul>
  39304. </div>
  39305. </div>
  39306. <div class="section-level-extent" id="shufflepixels">
  39307. <h3 class="section"><span>30.236 shufflepixels<a class="copiable-link" href="#shufflepixels"> &para;</a></span></h3>
  39308. <p>Reorder pixels in video frames.
  39309. </p>
  39310. <p>This filter accepts the following options:
  39311. </p>
  39312. <dl class="table">
  39313. <dt><samp class="option">direction, d</samp></dt>
  39314. <dd><p>Set shuffle direction. Can be forward or inverse direction.
  39315. Default direction is forward.
  39316. </p>
  39317. </dd>
  39318. <dt><samp class="option">mode, m</samp></dt>
  39319. <dd><p>Set shuffle mode. Can be horizontal, vertical or block mode.
  39320. </p>
  39321. </dd>
  39322. <dt><samp class="option">width, w</samp></dt>
  39323. <dt><samp class="option">height, h</samp></dt>
  39324. <dd><p>Set shuffle block_size. In case of horizontal shuffle mode only width
  39325. part of size is used, and in case of vertical shuffle mode only height
  39326. part of size is used.
  39327. </p>
  39328. </dd>
  39329. <dt><samp class="option">seed, s</samp></dt>
  39330. <dd><p>Set random seed used with shuffling pixels. Mainly useful to set to be able
  39331. to reverse filtering process to get original input.
  39332. For example, to reverse forward shuffle you need to use same parameters
  39333. and exact same seed and to set direction to inverse.
  39334. </p></dd>
  39335. </dl>
  39336. </div>
  39337. <div class="section-level-extent" id="shuffleplanes">
  39338. <h3 class="section"><span>30.237 shuffleplanes<a class="copiable-link" href="#shuffleplanes"> &para;</a></span></h3>
  39339. <p>Reorder and/or duplicate video planes.
  39340. </p>
  39341. <p>It accepts the following parameters:
  39342. </p>
  39343. <dl class="table">
  39344. <dt><samp class="option">map0</samp></dt>
  39345. <dd><p>The index of the input plane to be used as the first output plane.
  39346. </p>
  39347. </dd>
  39348. <dt><samp class="option">map1</samp></dt>
  39349. <dd><p>The index of the input plane to be used as the second output plane.
  39350. </p>
  39351. </dd>
  39352. <dt><samp class="option">map2</samp></dt>
  39353. <dd><p>The index of the input plane to be used as the third output plane.
  39354. </p>
  39355. </dd>
  39356. <dt><samp class="option">map3</samp></dt>
  39357. <dd><p>The index of the input plane to be used as the fourth output plane.
  39358. </p>
  39359. </dd>
  39360. </dl>
  39361. <p>The first plane has the index 0. The default is to keep the input unchanged.
  39362. </p>
  39363. <ul class="mini-toc">
  39364. <li><a href="#Examples-138" accesskey="1">Examples</a></li>
  39365. </ul>
  39366. <div class="subsection-level-extent" id="Examples-138">
  39367. <h4 class="subsection"><span>30.237.1 Examples<a class="copiable-link" href="#Examples-138"> &para;</a></span></h4>
  39368. <ul class="itemize mark-bullet">
  39369. <li>Swap the second and third planes of the input:
  39370. <div class="example">
  39371. <pre class="example-preformatted">ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
  39372. </pre></div>
  39373. </li></ul>
  39374. <a class="anchor" id="signalstats"></a></div>
  39375. </div>
  39376. <div class="section-level-extent" id="signalstats-1">
  39377. <h3 class="section"><span>30.238 signalstats<a class="copiable-link" href="#signalstats-1"> &para;</a></span></h3>
  39378. <p>Evaluate various visual metrics that assist in determining issues associated
  39379. with the digitization of analog video media.
  39380. </p>
  39381. <p>By default the filter will log these metadata values:
  39382. </p>
  39383. <dl class="table">
  39384. <dt><samp class="option">YMIN</samp></dt>
  39385. <dd><p>Display the minimal Y value contained within the input frame. Expressed in
  39386. range of [0-255].
  39387. </p>
  39388. </dd>
  39389. <dt><samp class="option">YLOW</samp></dt>
  39390. <dd><p>Display the Y value at the 10% percentile within the input frame. Expressed in
  39391. range of [0-255].
  39392. </p>
  39393. </dd>
  39394. <dt><samp class="option">YAVG</samp></dt>
  39395. <dd><p>Display the average Y value within the input frame. Expressed in range of
  39396. [0-255].
  39397. </p>
  39398. </dd>
  39399. <dt><samp class="option">YHIGH</samp></dt>
  39400. <dd><p>Display the Y value at the 90% percentile within the input frame. Expressed in
  39401. range of [0-255].
  39402. </p>
  39403. </dd>
  39404. <dt><samp class="option">YMAX</samp></dt>
  39405. <dd><p>Display the maximum Y value contained within the input frame. Expressed in
  39406. range of [0-255].
  39407. </p>
  39408. </dd>
  39409. <dt><samp class="option">UMIN</samp></dt>
  39410. <dd><p>Display the minimal U value contained within the input frame. Expressed in
  39411. range of [0-255].
  39412. </p>
  39413. </dd>
  39414. <dt><samp class="option">ULOW</samp></dt>
  39415. <dd><p>Display the U value at the 10% percentile within the input frame. Expressed in
  39416. range of [0-255].
  39417. </p>
  39418. </dd>
  39419. <dt><samp class="option">UAVG</samp></dt>
  39420. <dd><p>Display the average U value within the input frame. Expressed in range of
  39421. [0-255].
  39422. </p>
  39423. </dd>
  39424. <dt><samp class="option">UHIGH</samp></dt>
  39425. <dd><p>Display the U value at the 90% percentile within the input frame. Expressed in
  39426. range of [0-255].
  39427. </p>
  39428. </dd>
  39429. <dt><samp class="option">UMAX</samp></dt>
  39430. <dd><p>Display the maximum U value contained within the input frame. Expressed in
  39431. range of [0-255].
  39432. </p>
  39433. </dd>
  39434. <dt><samp class="option">VMIN</samp></dt>
  39435. <dd><p>Display the minimal V value contained within the input frame. Expressed in
  39436. range of [0-255].
  39437. </p>
  39438. </dd>
  39439. <dt><samp class="option">VLOW</samp></dt>
  39440. <dd><p>Display the V value at the 10% percentile within the input frame. Expressed in
  39441. range of [0-255].
  39442. </p>
  39443. </dd>
  39444. <dt><samp class="option">VAVG</samp></dt>
  39445. <dd><p>Display the average V value within the input frame. Expressed in range of
  39446. [0-255].
  39447. </p>
  39448. </dd>
  39449. <dt><samp class="option">VHIGH</samp></dt>
  39450. <dd><p>Display the V value at the 90% percentile within the input frame. Expressed in
  39451. range of [0-255].
  39452. </p>
  39453. </dd>
  39454. <dt><samp class="option">VMAX</samp></dt>
  39455. <dd><p>Display the maximum V value contained within the input frame. Expressed in
  39456. range of [0-255].
  39457. </p>
  39458. </dd>
  39459. <dt><samp class="option">SATMIN</samp></dt>
  39460. <dd><p>Display the minimal saturation value contained within the input frame.
  39461. Expressed in range of [0-~181.02].
  39462. </p>
  39463. </dd>
  39464. <dt><samp class="option">SATLOW</samp></dt>
  39465. <dd><p>Display the saturation value at the 10% percentile within the input frame.
  39466. Expressed in range of [0-~181.02].
  39467. </p>
  39468. </dd>
  39469. <dt><samp class="option">SATAVG</samp></dt>
  39470. <dd><p>Display the average saturation value within the input frame. Expressed in range
  39471. of [0-~181.02].
  39472. </p>
  39473. </dd>
  39474. <dt><samp class="option">SATHIGH</samp></dt>
  39475. <dd><p>Display the saturation value at the 90% percentile within the input frame.
  39476. Expressed in range of [0-~181.02].
  39477. </p>
  39478. </dd>
  39479. <dt><samp class="option">SATMAX</samp></dt>
  39480. <dd><p>Display the maximum saturation value contained within the input frame.
  39481. Expressed in range of [0-~181.02].
  39482. </p>
  39483. </dd>
  39484. <dt><samp class="option">HUEMED</samp></dt>
  39485. <dd><p>Display the median value for hue within the input frame. Expressed in range of
  39486. [0-360].
  39487. </p>
  39488. </dd>
  39489. <dt><samp class="option">HUEAVG</samp></dt>
  39490. <dd><p>Display the average value for hue within the input frame. Expressed in range of
  39491. [0-360].
  39492. </p>
  39493. </dd>
  39494. <dt><samp class="option">YDIF</samp></dt>
  39495. <dd><p>Display the average of sample value difference between all values of the Y
  39496. plane in the current frame and corresponding values of the previous input frame.
  39497. Expressed in range of [0-255].
  39498. </p>
  39499. </dd>
  39500. <dt><samp class="option">UDIF</samp></dt>
  39501. <dd><p>Display the average of sample value difference between all values of the U
  39502. plane in the current frame and corresponding values of the previous input frame.
  39503. Expressed in range of [0-255].
  39504. </p>
  39505. </dd>
  39506. <dt><samp class="option">VDIF</samp></dt>
  39507. <dd><p>Display the average of sample value difference between all values of the V
  39508. plane in the current frame and corresponding values of the previous input frame.
  39509. Expressed in range of [0-255].
  39510. </p>
  39511. </dd>
  39512. <dt><samp class="option">YBITDEPTH</samp></dt>
  39513. <dd><p>Display bit depth of Y plane in current frame.
  39514. Expressed in range of [0-16].
  39515. </p>
  39516. </dd>
  39517. <dt><samp class="option">UBITDEPTH</samp></dt>
  39518. <dd><p>Display bit depth of U plane in current frame.
  39519. Expressed in range of [0-16].
  39520. </p>
  39521. </dd>
  39522. <dt><samp class="option">VBITDEPTH</samp></dt>
  39523. <dd><p>Display bit depth of V plane in current frame.
  39524. Expressed in range of [0-16].
  39525. </p></dd>
  39526. </dl>
  39527. <p>The filter accepts the following options:
  39528. </p>
  39529. <dl class="table">
  39530. <dt><samp class="option">stat</samp></dt>
  39531. <dt><samp class="option">out</samp></dt>
  39532. <dd>
  39533. <p><samp class="option">stat</samp> specify an additional form of image analysis.
  39534. <samp class="option">out</samp> output video with the specified type of pixel highlighted.
  39535. </p>
  39536. <p>Both options accept the following values:
  39537. </p>
  39538. <dl class="table">
  39539. <dt>&lsquo;<samp class="samp">tout</samp>&rsquo;</dt>
  39540. <dd><p>Identify <var class="var">temporal outliers</var> pixels. A <var class="var">temporal outlier</var> is a pixel
  39541. unlike the neighboring pixels of the same field. Examples of temporal outliers
  39542. include the results of video dropouts, head clogs, or tape tracking issues.
  39543. </p>
  39544. </dd>
  39545. <dt>&lsquo;<samp class="samp">vrep</samp>&rsquo;</dt>
  39546. <dd><p>Identify <var class="var">vertical line repetition</var>. Vertical line repetition includes
  39547. similar rows of pixels within a frame. In born-digital video vertical line
  39548. repetition is common, but this pattern is uncommon in video digitized from an
  39549. analog source. When it occurs in video that results from the digitization of an
  39550. analog source it can indicate concealment from a dropout compensator.
  39551. </p>
  39552. </dd>
  39553. <dt>&lsquo;<samp class="samp">brng</samp>&rsquo;</dt>
  39554. <dd><p>Identify pixels that fall outside of legal broadcast range.
  39555. </p></dd>
  39556. </dl>
  39557. </dd>
  39558. <dt><samp class="option">color, c</samp></dt>
  39559. <dd><p>Set the highlight color for the <samp class="option">out</samp> option. The default color is
  39560. yellow.
  39561. </p></dd>
  39562. </dl>
  39563. <ul class="mini-toc">
  39564. <li><a href="#Examples-139" accesskey="1">Examples</a></li>
  39565. </ul>
  39566. <div class="subsection-level-extent" id="Examples-139">
  39567. <h4 class="subsection"><span>30.238.1 Examples<a class="copiable-link" href="#Examples-139"> &para;</a></span></h4>
  39568. <ul class="itemize mark-bullet">
  39569. <li>Output data of various video metrics:
  39570. <div class="example">
  39571. <pre class="example-preformatted">ffprobe -f lavfi movie=example.mov,signalstats=&quot;stat=tout+vrep+brng&quot; -show_frames
  39572. </pre></div>
  39573. </li><li>Output specific data about the minimum and maximum values of the Y plane per frame:
  39574. <div class="example">
  39575. <pre class="example-preformatted">ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
  39576. </pre></div>
  39577. </li><li>Playback video while highlighting pixels that are outside of broadcast range in red.
  39578. <div class="example">
  39579. <pre class="example-preformatted">ffplay example.mov -vf signalstats=&quot;out=brng:color=red&quot;
  39580. </pre></div>
  39581. </li><li>Playback video with signalstats metadata drawn over the frame.
  39582. <div class="example">
  39583. <pre class="example-preformatted">ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
  39584. </pre></div>
  39585. <p>The contents of signalstat_drawtext.txt used in the command are:
  39586. </p><div class="example">
  39587. <pre class="example-preformatted">time %{pts:hms}
  39588. Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
  39589. U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
  39590. V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
  39591. saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
  39592. </pre></div>
  39593. </li></ul>
  39594. <a class="anchor" id="signature"></a></div>
  39595. </div>
  39596. <div class="section-level-extent" id="signature-1">
  39597. <h3 class="section"><span>30.239 signature<a class="copiable-link" href="#signature-1"> &para;</a></span></h3>
  39598. <p>Calculates the MPEG-7 Video Signature. The filter can handle more than one
  39599. input. In this case the matching between the inputs can be calculated additionally.
  39600. The filter always passes through the first input. The signature of each stream can
  39601. be written into a file.
  39602. </p>
  39603. <p>It accepts the following options:
  39604. </p>
  39605. <dl class="table">
  39606. <dt><samp class="option">detectmode</samp></dt>
  39607. <dd><p>Enable or disable the matching process.
  39608. </p>
  39609. <p>Available values are:
  39610. </p>
  39611. <dl class="table">
  39612. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  39613. <dd><p>Disable the calculation of a matching (default).
  39614. </p></dd>
  39615. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  39616. <dd><p>Calculate the matching for the whole video and output whether the whole video
  39617. matches or only parts.
  39618. </p></dd>
  39619. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  39620. <dd><p>Calculate only until a matching is found or the video ends. Should be faster in
  39621. some cases.
  39622. </p></dd>
  39623. </dl>
  39624. </dd>
  39625. <dt><samp class="option">nb_inputs</samp></dt>
  39626. <dd><p>Set the number of inputs. The option value must be a non negative integer.
  39627. Default value is 1.
  39628. </p>
  39629. </dd>
  39630. <dt><samp class="option">filename</samp></dt>
  39631. <dd><p>Set the path to which the output is written. If there is more than one input,
  39632. the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive
  39633. integer), that will be replaced with the input number. If no filename is
  39634. specified, no output will be written. This is the default.
  39635. </p>
  39636. </dd>
  39637. <dt><samp class="option">format</samp></dt>
  39638. <dd><p>Choose the output format.
  39639. </p>
  39640. <p>Available values are:
  39641. </p>
  39642. <dl class="table">
  39643. <dt>&lsquo;<samp class="samp">binary</samp>&rsquo;</dt>
  39644. <dd><p>Use the specified binary representation (default).
  39645. </p></dd>
  39646. <dt>&lsquo;<samp class="samp">xml</samp>&rsquo;</dt>
  39647. <dd><p>Use the specified xml representation.
  39648. </p></dd>
  39649. </dl>
  39650. </dd>
  39651. <dt><samp class="option">th_d</samp></dt>
  39652. <dd><p>Set threshold to detect one word as similar. The option value must be an integer
  39653. greater than zero. The default value is 9000.
  39654. </p>
  39655. </dd>
  39656. <dt><samp class="option">th_dc</samp></dt>
  39657. <dd><p>Set threshold to detect all words as similar. The option value must be an integer
  39658. greater than zero. The default value is 60000.
  39659. </p>
  39660. </dd>
  39661. <dt><samp class="option">th_xh</samp></dt>
  39662. <dd><p>Set threshold to detect frames as similar. The option value must be an integer
  39663. greater than zero. The default value is 116.
  39664. </p>
  39665. </dd>
  39666. <dt><samp class="option">th_di</samp></dt>
  39667. <dd><p>Set the minimum length of a sequence in frames to recognize it as matching
  39668. sequence. The option value must be a non negative integer value.
  39669. The default value is 0.
  39670. </p>
  39671. </dd>
  39672. <dt><samp class="option">th_it</samp></dt>
  39673. <dd><p>Set the minimum relation, that matching frames to all frames must have.
  39674. The option value must be a double value between 0 and 1. The default value is 0.5.
  39675. </p></dd>
  39676. </dl>
  39677. <ul class="mini-toc">
  39678. <li><a href="#Examples-140" accesskey="1">Examples</a></li>
  39679. </ul>
  39680. <div class="subsection-level-extent" id="Examples-140">
  39681. <h4 class="subsection"><span>30.239.1 Examples<a class="copiable-link" href="#Examples-140"> &para;</a></span></h4>
  39682. <ul class="itemize mark-bullet">
  39683. <li>To calculate the signature of an input video and store it in signature.bin:
  39684. <div class="example">
  39685. <pre class="example-preformatted">ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
  39686. </pre></div>
  39687. </li><li>To detect whether two videos match and store the signatures in XML format in
  39688. signature0.xml and signature1.xml:
  39689. <div class="example">
  39690. <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 -
  39691. </pre></div>
  39692. </li></ul>
  39693. <a class="anchor" id="siti"></a></div>
  39694. </div>
  39695. <div class="section-level-extent" id="siti-1">
  39696. <h3 class="section"><span>30.240 siti<a class="copiable-link" href="#siti-1"> &para;</a></span></h3>
  39697. <p>Calculate Spatial Information (SI) and Temporal Information (TI) scores for a video,
  39698. as defined in ITU-T Rec. P.910 (11/21): Subjective video quality assessment methods
  39699. 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>.
  39700. Note that this is a legacy implementation that corresponds to a superseded recommendation.
  39701. 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>
  39702. </p>
  39703. <p>It accepts the following option:
  39704. </p>
  39705. <dl class="table">
  39706. <dt><samp class="option">print_summary</samp></dt>
  39707. <dd><p>If set to 1, Summary statistics will be printed to the console. Default 0.
  39708. </p></dd>
  39709. </dl>
  39710. <ul class="mini-toc">
  39711. <li><a href="#Examples-141" accesskey="1">Examples</a></li>
  39712. </ul>
  39713. <div class="subsection-level-extent" id="Examples-141">
  39714. <h4 class="subsection"><span>30.240.1 Examples<a class="copiable-link" href="#Examples-141"> &para;</a></span></h4>
  39715. <ul class="itemize mark-bullet">
  39716. <li>To calculate SI/TI metrics and print summary:
  39717. <div class="example">
  39718. <pre class="example-preformatted">ffmpeg -i input.mp4 -vf siti=print_summary=1 -f null -
  39719. </pre></div>
  39720. </li></ul>
  39721. <a class="anchor" id="smartblur"></a></div>
  39722. </div>
  39723. <div class="section-level-extent" id="smartblur-1">
  39724. <h3 class="section"><span>30.241 smartblur<a class="copiable-link" href="#smartblur-1"> &para;</a></span></h3>
  39725. <p>Blur the input video without impacting the outlines.
  39726. </p>
  39727. <p>It accepts the following options:
  39728. </p>
  39729. <dl class="table">
  39730. <dt><samp class="option">luma_radius, lr</samp></dt>
  39731. <dd><p>Set the luma radius. The option value must be a float number in
  39732. the range [0.1,5.0] that specifies the variance of the gaussian filter
  39733. used to blur the image (slower if larger). Default value is 1.0.
  39734. </p>
  39735. </dd>
  39736. <dt><samp class="option">luma_strength, ls</samp></dt>
  39737. <dd><p>Set the luma strength. The option value must be a float number
  39738. in the range [-1.0,1.0] that configures the blurring. A value included
  39739. in [0.0,1.0] will blur the image whereas a value included in
  39740. [-1.0,0.0] will sharpen the image. Default value is 1.0.
  39741. </p>
  39742. </dd>
  39743. <dt><samp class="option">luma_threshold, lt</samp></dt>
  39744. <dd><p>Set the luma threshold used as a coefficient to determine
  39745. whether a pixel should be blurred or not. The option value must be an
  39746. integer in the range [-30,30]. A value of 0 will filter all the image,
  39747. a value included in [0,30] will filter flat areas and a value included
  39748. in [-30,0] will filter edges. Default value is 0.
  39749. </p>
  39750. </dd>
  39751. <dt><samp class="option">chroma_radius, cr</samp></dt>
  39752. <dd><p>Set the chroma radius. The option value must be a float number in
  39753. the range [0.1,5.0] that specifies the variance of the gaussian filter
  39754. used to blur the image (slower if larger). Default value is <samp class="option">luma_radius</samp>.
  39755. </p>
  39756. </dd>
  39757. <dt><samp class="option">chroma_strength, cs</samp></dt>
  39758. <dd><p>Set the chroma strength. The option value must be a float number
  39759. in the range [-1.0,1.0] that configures the blurring. A value included
  39760. in [0.0,1.0] will blur the image whereas a value included in
  39761. [-1.0,0.0] will sharpen the image. Default value is <samp class="option">luma_strength</samp>.
  39762. </p>
  39763. </dd>
  39764. <dt><samp class="option">chroma_threshold, ct</samp></dt>
  39765. <dd><p>Set the chroma threshold used as a coefficient to determine
  39766. whether a pixel should be blurred or not. The option value must be an
  39767. integer in the range [-30,30]. A value of 0 will filter all the image,
  39768. a value included in [0,30] will filter flat areas and a value included
  39769. in [-30,0] will filter edges. Default value is <samp class="option">luma_threshold</samp>.
  39770. </p></dd>
  39771. </dl>
  39772. <p>If a chroma option is not explicitly set, the corresponding luma value
  39773. is set.
  39774. </p>
  39775. </div>
  39776. <div class="section-level-extent" id="sobel">
  39777. <h3 class="section"><span>30.242 sobel<a class="copiable-link" href="#sobel"> &para;</a></span></h3>
  39778. <p>Apply sobel operator to input video stream.
  39779. </p>
  39780. <p>The filter accepts the following option:
  39781. </p>
  39782. <dl class="table">
  39783. <dt><samp class="option">planes</samp></dt>
  39784. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  39785. By default value 0xf, all planes will be processed.
  39786. </p>
  39787. </dd>
  39788. <dt><samp class="option">scale</samp></dt>
  39789. <dd><p>Set value which will be multiplied with filtered result.
  39790. </p>
  39791. </dd>
  39792. <dt><samp class="option">delta</samp></dt>
  39793. <dd><p>Set value which will be added to filtered result.
  39794. </p></dd>
  39795. </dl>
  39796. <ul class="mini-toc">
  39797. <li><a href="#Commands-143" accesskey="1">Commands</a></li>
  39798. </ul>
  39799. <div class="subsection-level-extent" id="Commands-143">
  39800. <h4 class="subsection"><span>30.242.1 Commands<a class="copiable-link" href="#Commands-143"> &para;</a></span></h4>
  39801. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  39802. </p>
  39803. <a class="anchor" id="spp"></a></div>
  39804. </div>
  39805. <div class="section-level-extent" id="spp-1">
  39806. <h3 class="section"><span>30.243 spp<a class="copiable-link" href="#spp-1"> &para;</a></span></h3>
  39807. <p>Apply a simple postprocessing filter that compresses and decompresses the image
  39808. at several (or - in the case of <samp class="option">quality</samp> level <code class="code">6</code> - all) shifts
  39809. and average the results.
  39810. </p>
  39811. <p>The filter accepts the following options:
  39812. </p>
  39813. <dl class="table">
  39814. <dt><samp class="option">quality</samp></dt>
  39815. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  39816. an integer in the range 0-6. If set to <code class="code">0</code>, the filter will have no
  39817. effect. A value of <code class="code">6</code> means the higher quality. For each increment of
  39818. that value the speed drops by a factor of approximately 2. Default value is
  39819. <code class="code">3</code>.
  39820. </p>
  39821. </dd>
  39822. <dt><samp class="option">qp</samp></dt>
  39823. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  39824. from the video stream (if available).
  39825. </p>
  39826. </dd>
  39827. <dt><samp class="option">mode</samp></dt>
  39828. <dd><p>Set thresholding mode. Available modes are:
  39829. </p>
  39830. <dl class="table">
  39831. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  39832. <dd><p>Set hard thresholding (default).
  39833. </p></dd>
  39834. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  39835. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  39836. </p></dd>
  39837. </dl>
  39838. </dd>
  39839. <dt><samp class="option">use_bframe_qp</samp></dt>
  39840. <dd><p>Enable the use of the QP from the B-Frames if set to <code class="code">1</code>. Using this
  39841. option may cause flicker since the B-Frames have often larger QP. Default is
  39842. <code class="code">0</code> (not enabled).
  39843. </p></dd>
  39844. </dl>
  39845. <ul class="mini-toc">
  39846. <li><a href="#Commands-144" accesskey="1">Commands</a></li>
  39847. </ul>
  39848. <div class="subsection-level-extent" id="Commands-144">
  39849. <h4 class="subsection"><span>30.243.1 Commands<a class="copiable-link" href="#Commands-144"> &para;</a></span></h4>
  39850. <p>This filter supports the following commands:
  39851. </p><dl class="table">
  39852. <dt><samp class="option">quality, level</samp></dt>
  39853. <dd><p>Set quality level. The value <code class="code">max</code> can be used to set the maximum level,
  39854. currently <code class="code">6</code>.
  39855. </p></dd>
  39856. </dl>
  39857. <a class="anchor" id="sr"></a></div>
  39858. </div>
  39859. <div class="section-level-extent" id="sr-1">
  39860. <h3 class="section"><span>30.244 sr<a class="copiable-link" href="#sr-1"> &para;</a></span></h3>
  39861. <p>Scale the input by applying one of the super-resolution methods based on
  39862. convolutional neural networks. Supported models:
  39863. </p>
  39864. <ul class="itemize mark-bullet">
  39865. <li>Super-Resolution Convolutional Neural Network model (SRCNN).
  39866. See <a class="url" href="https://arxiv.org/abs/1501.00092">https://arxiv.org/abs/1501.00092</a>.
  39867. </li><li>Efficient Sub-Pixel Convolutional Neural Network model (ESPCN).
  39868. See <a class="url" href="https://arxiv.org/abs/1609.05158">https://arxiv.org/abs/1609.05158</a>.
  39869. </li></ul>
  39870. <p>Training scripts as well as scripts for model file (.pb) saving can be found at
  39871. <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
  39872. is at <a class="url" href="https://github.com/HighVoltageRocknRoll/sr.git">https://github.com/HighVoltageRocknRoll/sr.git</a>.
  39873. </p>
  39874. <p>The filter accepts the following options:
  39875. </p>
  39876. <dl class="table">
  39877. <dt><samp class="option">dnn_backend</samp></dt>
  39878. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  39879. the following values:
  39880. </p>
  39881. <dl class="table">
  39882. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  39883. <dd><p>TensorFlow backend. To enable this backend you
  39884. need to install the TensorFlow for C library (see
  39885. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  39886. <code class="code">--enable-libtensorflow</code>
  39887. </p></dd>
  39888. </dl>
  39889. </dd>
  39890. <dt><samp class="option">model</samp></dt>
  39891. <dd><p>Set path to model file specifying network architecture and its parameters.
  39892. Note that different backends use different file formats. TensorFlow, OpenVINO backend
  39893. can load files for only its format.
  39894. </p>
  39895. </dd>
  39896. <dt><samp class="option">scale_factor</samp></dt>
  39897. <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>.
  39898. Default value is <code class="code">2</code>. Scale factor is necessary for SRCNN model, because it accepts
  39899. input upscaled using bicubic upscaling with proper scale factor.
  39900. </p></dd>
  39901. </dl>
  39902. <p>To get full functionality (such as async execution), please use the <a class="ref" href="#dnn_005fprocessing">dnn_processing</a> filter.
  39903. </p>
  39904. </div>
  39905. <div class="section-level-extent" id="ssim">
  39906. <h3 class="section"><span>30.245 ssim<a class="copiable-link" href="#ssim"> &para;</a></span></h3>
  39907. <p>Obtain the SSIM (Structural SImilarity Metric) between two input videos.
  39908. </p>
  39909. <p>This filter takes in input two input videos, the first input is
  39910. considered the &quot;main&quot; source and is passed unchanged to the
  39911. output. The second input is used as a &quot;reference&quot; video for computing
  39912. the SSIM.
  39913. </p>
  39914. <p>Both video inputs must have the same resolution and pixel format for
  39915. this filter to work correctly. Also it assumes that both inputs
  39916. have the same number of frames, which are compared one by one.
  39917. </p>
  39918. <p>The filter stores the calculated SSIM of each frame.
  39919. </p>
  39920. <p>The description of the accepted parameters follows.
  39921. </p>
  39922. <dl class="table">
  39923. <dt><samp class="option">stats_file, f</samp></dt>
  39924. <dd><p>If specified the filter will use the named file to save the SSIM of
  39925. each individual frame. When filename equals &quot;-&quot; the data is sent to
  39926. standard output.
  39927. </p></dd>
  39928. </dl>
  39929. <p>The file printed if <var class="var">stats_file</var> is selected, contains a sequence of
  39930. key/value pairs of the form <var class="var">key</var>:<var class="var">value</var> for each compared
  39931. couple of frames.
  39932. </p>
  39933. <p>A description of each shown parameter follows:
  39934. </p>
  39935. <dl class="table">
  39936. <dt><samp class="option">n</samp></dt>
  39937. <dd><p>sequential number of the input frame, starting from 1
  39938. </p>
  39939. </dd>
  39940. <dt><samp class="option">Y, U, V, R, G, B</samp></dt>
  39941. <dd><p>SSIM of the compared frames for the component specified by the suffix.
  39942. </p>
  39943. </dd>
  39944. <dt><samp class="option">All</samp></dt>
  39945. <dd><p>SSIM of the compared frames for the whole frame.
  39946. </p>
  39947. </dd>
  39948. <dt><samp class="option">dB</samp></dt>
  39949. <dd><p>Same as above but in dB representation.
  39950. </p></dd>
  39951. </dl>
  39952. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  39953. </p>
  39954. <ul class="mini-toc">
  39955. <li><a href="#Examples-142" accesskey="1">Examples</a></li>
  39956. </ul>
  39957. <div class="subsection-level-extent" id="Examples-142">
  39958. <h4 class="subsection"><span>30.245.1 Examples<a class="copiable-link" href="#Examples-142"> &para;</a></span></h4>
  39959. <ul class="itemize mark-bullet">
  39960. <li>For example:
  39961. <div class="example">
  39962. <pre class="example-preformatted">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  39963. [main][ref] ssim=&quot;stats_file=stats.log&quot; [out]
  39964. </pre></div>
  39965. <p>On this example the input file being processed is compared with the
  39966. reference file <samp class="file">ref_movie.mpg</samp>. The SSIM of each individual frame
  39967. is stored in <samp class="file">stats.log</samp>.
  39968. </p>
  39969. </li><li>Another example with both psnr and ssim at same time:
  39970. <div class="example">
  39971. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi &quot;ssim;[0:v][1:v]psnr&quot; -f null -
  39972. </pre></div>
  39973. </li><li>Another example with different containers:
  39974. <div class="example">
  39975. <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 -
  39976. </pre></div>
  39977. </li></ul>
  39978. </div>
  39979. </div>
  39980. <div class="section-level-extent" id="stereo3d">
  39981. <h3 class="section"><span>30.246 stereo3d<a class="copiable-link" href="#stereo3d"> &para;</a></span></h3>
  39982. <p>Convert between different stereoscopic image formats.
  39983. </p>
  39984. <p>The filters accept the following options:
  39985. </p>
  39986. <dl class="table">
  39987. <dt><samp class="option">in</samp></dt>
  39988. <dd><p>Set stereoscopic image format of input.
  39989. </p>
  39990. <p>Available values for input image formats are:
  39991. </p><dl class="table">
  39992. <dt>&lsquo;<samp class="samp">sbsl</samp>&rsquo;</dt>
  39993. <dd><p>side by side parallel (left eye left, right eye right)
  39994. </p>
  39995. </dd>
  39996. <dt>&lsquo;<samp class="samp">sbsr</samp>&rsquo;</dt>
  39997. <dd><p>side by side crosseye (right eye left, left eye right)
  39998. </p>
  39999. </dd>
  40000. <dt>&lsquo;<samp class="samp">sbs2l</samp>&rsquo;</dt>
  40001. <dd><p>side by side parallel with half width resolution
  40002. (left eye left, right eye right)
  40003. </p>
  40004. </dd>
  40005. <dt>&lsquo;<samp class="samp">sbs2r</samp>&rsquo;</dt>
  40006. <dd><p>side by side crosseye with half width resolution
  40007. (right eye left, left eye right)
  40008. </p>
  40009. </dd>
  40010. <dt>&lsquo;<samp class="samp">abl</samp>&rsquo;</dt>
  40011. <dt>&lsquo;<samp class="samp">tbl</samp>&rsquo;</dt>
  40012. <dd><p>above-below (left eye above, right eye below)
  40013. </p>
  40014. </dd>
  40015. <dt>&lsquo;<samp class="samp">abr</samp>&rsquo;</dt>
  40016. <dt>&lsquo;<samp class="samp">tbr</samp>&rsquo;</dt>
  40017. <dd><p>above-below (right eye above, left eye below)
  40018. </p>
  40019. </dd>
  40020. <dt>&lsquo;<samp class="samp">ab2l</samp>&rsquo;</dt>
  40021. <dt>&lsquo;<samp class="samp">tb2l</samp>&rsquo;</dt>
  40022. <dd><p>above-below with half height resolution
  40023. (left eye above, right eye below)
  40024. </p>
  40025. </dd>
  40026. <dt>&lsquo;<samp class="samp">ab2r</samp>&rsquo;</dt>
  40027. <dt>&lsquo;<samp class="samp">tb2r</samp>&rsquo;</dt>
  40028. <dd><p>above-below with half height resolution
  40029. (right eye above, left eye below)
  40030. </p>
  40031. </dd>
  40032. <dt>&lsquo;<samp class="samp">al</samp>&rsquo;</dt>
  40033. <dd><p>alternating frames (left eye first, right eye second)
  40034. </p>
  40035. </dd>
  40036. <dt>&lsquo;<samp class="samp">ar</samp>&rsquo;</dt>
  40037. <dd><p>alternating frames (right eye first, left eye second)
  40038. </p>
  40039. </dd>
  40040. <dt>&lsquo;<samp class="samp">irl</samp>&rsquo;</dt>
  40041. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  40042. </p>
  40043. </dd>
  40044. <dt>&lsquo;<samp class="samp">irr</samp>&rsquo;</dt>
  40045. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  40046. </p>
  40047. </dd>
  40048. <dt>&lsquo;<samp class="samp">icl</samp>&rsquo;</dt>
  40049. <dd><p>interleaved columns, left eye first
  40050. </p>
  40051. </dd>
  40052. <dt>&lsquo;<samp class="samp">icr</samp>&rsquo;</dt>
  40053. <dd><p>interleaved columns, right eye first
  40054. </p>
  40055. <p>Default value is &lsquo;<samp class="samp">sbsl</samp>&rsquo;.
  40056. </p></dd>
  40057. </dl>
  40058. </dd>
  40059. <dt><samp class="option">out</samp></dt>
  40060. <dd><p>Set stereoscopic image format of output.
  40061. </p>
  40062. <dl class="table">
  40063. <dt>&lsquo;<samp class="samp">sbsl</samp>&rsquo;</dt>
  40064. <dd><p>side by side parallel (left eye left, right eye right)
  40065. </p>
  40066. </dd>
  40067. <dt>&lsquo;<samp class="samp">sbsr</samp>&rsquo;</dt>
  40068. <dd><p>side by side crosseye (right eye left, left eye right)
  40069. </p>
  40070. </dd>
  40071. <dt>&lsquo;<samp class="samp">sbs2l</samp>&rsquo;</dt>
  40072. <dd><p>side by side parallel with half width resolution
  40073. (left eye left, right eye right)
  40074. </p>
  40075. </dd>
  40076. <dt>&lsquo;<samp class="samp">sbs2r</samp>&rsquo;</dt>
  40077. <dd><p>side by side crosseye with half width resolution
  40078. (right eye left, left eye right)
  40079. </p>
  40080. </dd>
  40081. <dt>&lsquo;<samp class="samp">abl</samp>&rsquo;</dt>
  40082. <dt>&lsquo;<samp class="samp">tbl</samp>&rsquo;</dt>
  40083. <dd><p>above-below (left eye above, right eye below)
  40084. </p>
  40085. </dd>
  40086. <dt>&lsquo;<samp class="samp">abr</samp>&rsquo;</dt>
  40087. <dt>&lsquo;<samp class="samp">tbr</samp>&rsquo;</dt>
  40088. <dd><p>above-below (right eye above, left eye below)
  40089. </p>
  40090. </dd>
  40091. <dt>&lsquo;<samp class="samp">ab2l</samp>&rsquo;</dt>
  40092. <dt>&lsquo;<samp class="samp">tb2l</samp>&rsquo;</dt>
  40093. <dd><p>above-below with half height resolution
  40094. (left eye above, right eye below)
  40095. </p>
  40096. </dd>
  40097. <dt>&lsquo;<samp class="samp">ab2r</samp>&rsquo;</dt>
  40098. <dt>&lsquo;<samp class="samp">tb2r</samp>&rsquo;</dt>
  40099. <dd><p>above-below with half height resolution
  40100. (right eye above, left eye below)
  40101. </p>
  40102. </dd>
  40103. <dt>&lsquo;<samp class="samp">al</samp>&rsquo;</dt>
  40104. <dd><p>alternating frames (left eye first, right eye second)
  40105. </p>
  40106. </dd>
  40107. <dt>&lsquo;<samp class="samp">ar</samp>&rsquo;</dt>
  40108. <dd><p>alternating frames (right eye first, left eye second)
  40109. </p>
  40110. </dd>
  40111. <dt>&lsquo;<samp class="samp">irl</samp>&rsquo;</dt>
  40112. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  40113. </p>
  40114. </dd>
  40115. <dt>&lsquo;<samp class="samp">irr</samp>&rsquo;</dt>
  40116. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  40117. </p>
  40118. </dd>
  40119. <dt>&lsquo;<samp class="samp">arbg</samp>&rsquo;</dt>
  40120. <dd><p>anaglyph red/blue gray
  40121. (red filter on left eye, blue filter on right eye)
  40122. </p>
  40123. </dd>
  40124. <dt>&lsquo;<samp class="samp">argg</samp>&rsquo;</dt>
  40125. <dd><p>anaglyph red/green gray
  40126. (red filter on left eye, green filter on right eye)
  40127. </p>
  40128. </dd>
  40129. <dt>&lsquo;<samp class="samp">arcg</samp>&rsquo;</dt>
  40130. <dd><p>anaglyph red/cyan gray
  40131. (red filter on left eye, cyan filter on right eye)
  40132. </p>
  40133. </dd>
  40134. <dt>&lsquo;<samp class="samp">arch</samp>&rsquo;</dt>
  40135. <dd><p>anaglyph red/cyan half colored
  40136. (red filter on left eye, cyan filter on right eye)
  40137. </p>
  40138. </dd>
  40139. <dt>&lsquo;<samp class="samp">arcc</samp>&rsquo;</dt>
  40140. <dd><p>anaglyph red/cyan color
  40141. (red filter on left eye, cyan filter on right eye)
  40142. </p>
  40143. </dd>
  40144. <dt>&lsquo;<samp class="samp">arcd</samp>&rsquo;</dt>
  40145. <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
  40146. (red filter on left eye, cyan filter on right eye)
  40147. </p>
  40148. </dd>
  40149. <dt>&lsquo;<samp class="samp">agmg</samp>&rsquo;</dt>
  40150. <dd><p>anaglyph green/magenta gray
  40151. (green filter on left eye, magenta filter on right eye)
  40152. </p>
  40153. </dd>
  40154. <dt>&lsquo;<samp class="samp">agmh</samp>&rsquo;</dt>
  40155. <dd><p>anaglyph green/magenta half colored
  40156. (green filter on left eye, magenta filter on right eye)
  40157. </p>
  40158. </dd>
  40159. <dt>&lsquo;<samp class="samp">agmc</samp>&rsquo;</dt>
  40160. <dd><p>anaglyph green/magenta colored
  40161. (green filter on left eye, magenta filter on right eye)
  40162. </p>
  40163. </dd>
  40164. <dt>&lsquo;<samp class="samp">agmd</samp>&rsquo;</dt>
  40165. <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
  40166. (green filter on left eye, magenta filter on right eye)
  40167. </p>
  40168. </dd>
  40169. <dt>&lsquo;<samp class="samp">aybg</samp>&rsquo;</dt>
  40170. <dd><p>anaglyph yellow/blue gray
  40171. (yellow filter on left eye, blue filter on right eye)
  40172. </p>
  40173. </dd>
  40174. <dt>&lsquo;<samp class="samp">aybh</samp>&rsquo;</dt>
  40175. <dd><p>anaglyph yellow/blue half colored
  40176. (yellow filter on left eye, blue filter on right eye)
  40177. </p>
  40178. </dd>
  40179. <dt>&lsquo;<samp class="samp">aybc</samp>&rsquo;</dt>
  40180. <dd><p>anaglyph yellow/blue colored
  40181. (yellow filter on left eye, blue filter on right eye)
  40182. </p>
  40183. </dd>
  40184. <dt>&lsquo;<samp class="samp">aybd</samp>&rsquo;</dt>
  40185. <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
  40186. (yellow filter on left eye, blue filter on right eye)
  40187. </p>
  40188. </dd>
  40189. <dt>&lsquo;<samp class="samp">ml</samp>&rsquo;</dt>
  40190. <dd><p>mono output (left eye only)
  40191. </p>
  40192. </dd>
  40193. <dt>&lsquo;<samp class="samp">mr</samp>&rsquo;</dt>
  40194. <dd><p>mono output (right eye only)
  40195. </p>
  40196. </dd>
  40197. <dt>&lsquo;<samp class="samp">chl</samp>&rsquo;</dt>
  40198. <dd><p>checkerboard, left eye first
  40199. </p>
  40200. </dd>
  40201. <dt>&lsquo;<samp class="samp">chr</samp>&rsquo;</dt>
  40202. <dd><p>checkerboard, right eye first
  40203. </p>
  40204. </dd>
  40205. <dt>&lsquo;<samp class="samp">icl</samp>&rsquo;</dt>
  40206. <dd><p>interleaved columns, left eye first
  40207. </p>
  40208. </dd>
  40209. <dt>&lsquo;<samp class="samp">icr</samp>&rsquo;</dt>
  40210. <dd><p>interleaved columns, right eye first
  40211. </p>
  40212. </dd>
  40213. <dt>&lsquo;<samp class="samp">hdmi</samp>&rsquo;</dt>
  40214. <dd><p>HDMI frame pack
  40215. </p></dd>
  40216. </dl>
  40217. <p>Default value is &lsquo;<samp class="samp">arcd</samp>&rsquo;.
  40218. </p></dd>
  40219. </dl>
  40220. <ul class="mini-toc">
  40221. <li><a href="#Examples-143" accesskey="1">Examples</a></li>
  40222. </ul>
  40223. <div class="subsection-level-extent" id="Examples-143">
  40224. <h4 class="subsection"><span>30.246.1 Examples<a class="copiable-link" href="#Examples-143"> &para;</a></span></h4>
  40225. <ul class="itemize mark-bullet">
  40226. <li>Convert input video from side by side parallel to anaglyph yellow/blue dubois:
  40227. <div class="example">
  40228. <pre class="example-preformatted">stereo3d=sbsl:aybd
  40229. </pre></div>
  40230. </li><li>Convert input video from above below (left eye above, right eye below) to side by side crosseye.
  40231. <div class="example">
  40232. <pre class="example-preformatted">stereo3d=abl:sbsr
  40233. </pre></div>
  40234. </li></ul>
  40235. </div>
  40236. </div>
  40237. <div class="section-level-extent" id="streamselect_002c-astreamselect">
  40238. <h3 class="section"><span>30.247 streamselect, astreamselect<a class="copiable-link" href="#streamselect_002c-astreamselect"> &para;</a></span></h3>
  40239. <p>Select video or audio streams.
  40240. </p>
  40241. <p>The filter accepts the following options:
  40242. </p>
  40243. <dl class="table">
  40244. <dt><samp class="option">inputs</samp></dt>
  40245. <dd><p>Set number of inputs. Default is 2.
  40246. </p>
  40247. </dd>
  40248. <dt><samp class="option">map</samp></dt>
  40249. <dd><p>Set input indexes to remap to outputs.
  40250. </p></dd>
  40251. </dl>
  40252. <ul class="mini-toc">
  40253. <li><a href="#Commands-145" accesskey="1">Commands</a></li>
  40254. <li><a href="#Examples-144" accesskey="2">Examples</a></li>
  40255. </ul>
  40256. <div class="subsection-level-extent" id="Commands-145">
  40257. <h4 class="subsection"><span>30.247.1 Commands<a class="copiable-link" href="#Commands-145"> &para;</a></span></h4>
  40258. <p>The <code class="code">streamselect</code> and <code class="code">astreamselect</code> filter supports the following
  40259. commands:
  40260. </p>
  40261. <dl class="table">
  40262. <dt><samp class="option">map</samp></dt>
  40263. <dd><p>Set input indexes to remap to outputs.
  40264. </p></dd>
  40265. </dl>
  40266. </div>
  40267. <div class="subsection-level-extent" id="Examples-144">
  40268. <h4 class="subsection"><span>30.247.2 Examples<a class="copiable-link" href="#Examples-144"> &para;</a></span></h4>
  40269. <ul class="itemize mark-bullet">
  40270. <li>Select first 5 seconds 1st stream and rest of time 2nd stream:
  40271. <div class="example">
  40272. <pre class="example-preformatted">sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
  40273. </pre></div>
  40274. </li><li>Same as above, but for audio:
  40275. <div class="example">
  40276. <pre class="example-preformatted">asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
  40277. </pre></div>
  40278. </li></ul>
  40279. <a class="anchor" id="subtitles"></a></div>
  40280. </div>
  40281. <div class="section-level-extent" id="subtitles-1">
  40282. <h3 class="section"><span>30.248 subtitles<a class="copiable-link" href="#subtitles-1"> &para;</a></span></h3>
  40283. <p>Draw subtitles on top of input video using the libass library.
  40284. </p>
  40285. <p>To enable compilation of this filter you need to configure FFmpeg with
  40286. <code class="code">--enable-libass</code>. This filter also requires a build with libavcodec and
  40287. libavformat to convert the passed subtitles file to ASS (Advanced Substation
  40288. Alpha) subtitles format.
  40289. </p>
  40290. <p>The filter accepts the following options:
  40291. </p>
  40292. <dl class="table">
  40293. <dt><samp class="option">filename, f</samp></dt>
  40294. <dd><p>Set the filename of the subtitle file to read. It must be specified.
  40295. </p>
  40296. </dd>
  40297. <dt><samp class="option">original_size</samp></dt>
  40298. <dd><p>Specify the size of the original video, the video for which the ASS file
  40299. was composed. For the syntax of this option, check the
  40300. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  40301. Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to
  40302. correctly scale the fonts if the aspect ratio has been changed.
  40303. </p>
  40304. </dd>
  40305. <dt><samp class="option">fontsdir</samp></dt>
  40306. <dd><p>Set a directory path containing fonts that can be used by the filter.
  40307. These fonts will be used in addition to whatever the font provider uses.
  40308. </p>
  40309. </dd>
  40310. <dt><samp class="option">alpha</samp></dt>
  40311. <dd><p>Process alpha channel, by default alpha channel is untouched.
  40312. </p>
  40313. </dd>
  40314. <dt><samp class="option">charenc</samp></dt>
  40315. <dd><p>Set subtitles input character encoding. <code class="code">subtitles</code> filter only. Only
  40316. useful if not UTF-8.
  40317. </p>
  40318. </dd>
  40319. <dt><samp class="option">stream_index, si</samp></dt>
  40320. <dd><p>Set subtitles stream index. <code class="code">subtitles</code> filter only.
  40321. </p>
  40322. </dd>
  40323. <dt><samp class="option">force_style</samp></dt>
  40324. <dd><p>Override default style or script info parameters of the subtitles. It accepts a
  40325. string containing ASS style format <code class="code">KEY=VALUE</code> couples separated by &quot;,&quot;.
  40326. </p>
  40327. </dd>
  40328. <dt><samp class="option">wrap_unicode</samp></dt>
  40329. <dd><p>Break lines according to the Unicode Line Breaking Algorithm. Availability requires
  40330. at least libass release 0.17.0 (or LIBASS_VERSION 0x01600010), <em class="emph">and</em> libass must
  40331. have been built with libunibreak.
  40332. </p>
  40333. <p>The option is enabled by default except for native ASS.
  40334. </p></dd>
  40335. </dl>
  40336. <p>If the first key is not specified, it is assumed that the first value
  40337. specifies the <samp class="option">filename</samp>.
  40338. </p>
  40339. <p>For example, to render the file <samp class="file">sub.srt</samp> on top of the input
  40340. video, use the command:
  40341. </p><div class="example">
  40342. <pre class="example-preformatted">subtitles=sub.srt
  40343. </pre></div>
  40344. <p>which is equivalent to:
  40345. </p><div class="example">
  40346. <pre class="example-preformatted">subtitles=filename=sub.srt
  40347. </pre></div>
  40348. <p>To render the default subtitles stream from file <samp class="file">video.mkv</samp>, use:
  40349. </p><div class="example">
  40350. <pre class="example-preformatted">subtitles=video.mkv
  40351. </pre></div>
  40352. <p>To render the second subtitles stream from that file, use:
  40353. </p><div class="example">
  40354. <pre class="example-preformatted">subtitles=video.mkv:si=1
  40355. </pre></div>
  40356. <p>To make the subtitles stream from <samp class="file">sub.srt</samp> appear in 80% transparent blue
  40357. <code class="code">DejaVu Serif</code>, use:
  40358. </p><div class="example">
  40359. <pre class="example-preformatted">subtitles=sub.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&amp;HCCFF0000'
  40360. </pre></div>
  40361. </div>
  40362. <div class="section-level-extent" id="super2xsai">
  40363. <h3 class="section"><span>30.249 super2xsai<a class="copiable-link" href="#super2xsai"> &para;</a></span></h3>
  40364. <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
  40365. Interpolate) pixel art scaling algorithm.
  40366. </p>
  40367. <p>Useful for enlarging pixel art images without reducing sharpness.
  40368. </p>
  40369. </div>
  40370. <div class="section-level-extent" id="swaprect">
  40371. <h3 class="section"><span>30.250 swaprect<a class="copiable-link" href="#swaprect"> &para;</a></span></h3>
  40372. <p>Swap two rectangular objects in video.
  40373. </p>
  40374. <p>This filter accepts the following options:
  40375. </p>
  40376. <dl class="table">
  40377. <dt><samp class="option">w</samp></dt>
  40378. <dd><p>Set object width.
  40379. </p>
  40380. </dd>
  40381. <dt><samp class="option">h</samp></dt>
  40382. <dd><p>Set object height.
  40383. </p>
  40384. </dd>
  40385. <dt><samp class="option">x1</samp></dt>
  40386. <dd><p>Set 1st rect x coordinate.
  40387. </p>
  40388. </dd>
  40389. <dt><samp class="option">y1</samp></dt>
  40390. <dd><p>Set 1st rect y coordinate.
  40391. </p>
  40392. </dd>
  40393. <dt><samp class="option">x2</samp></dt>
  40394. <dd><p>Set 2nd rect x coordinate.
  40395. </p>
  40396. </dd>
  40397. <dt><samp class="option">y2</samp></dt>
  40398. <dd><p>Set 2nd rect y coordinate.
  40399. </p>
  40400. <p>All expressions are evaluated once for each frame.
  40401. </p></dd>
  40402. </dl>
  40403. <p>The all options are expressions containing the following constants:
  40404. </p>
  40405. <dl class="table">
  40406. <dt><samp class="option">w</samp></dt>
  40407. <dt><samp class="option">h</samp></dt>
  40408. <dd><p>The input width and height.
  40409. </p>
  40410. </dd>
  40411. <dt><samp class="option">a</samp></dt>
  40412. <dd><p>same as <var class="var">w</var> / <var class="var">h</var>
  40413. </p>
  40414. </dd>
  40415. <dt><samp class="option">sar</samp></dt>
  40416. <dd><p>input sample aspect ratio
  40417. </p>
  40418. </dd>
  40419. <dt><samp class="option">dar</samp></dt>
  40420. <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>
  40421. </p>
  40422. </dd>
  40423. <dt><samp class="option">n</samp></dt>
  40424. <dd><p>The number of the input frame, starting from 0.
  40425. </p>
  40426. </dd>
  40427. <dt><samp class="option">t</samp></dt>
  40428. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  40429. </p>
  40430. </dd>
  40431. <dt><samp class="option">pos</samp></dt>
  40432. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  40433. do not use
  40434. </p></dd>
  40435. </dl>
  40436. <ul class="mini-toc">
  40437. <li><a href="#Commands-146" accesskey="1">Commands</a></li>
  40438. </ul>
  40439. <div class="subsection-level-extent" id="Commands-146">
  40440. <h4 class="subsection"><span>30.250.1 Commands<a class="copiable-link" href="#Commands-146"> &para;</a></span></h4>
  40441. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  40442. </p>
  40443. </div>
  40444. </div>
  40445. <div class="section-level-extent" id="swapuv">
  40446. <h3 class="section"><span>30.251 swapuv<a class="copiable-link" href="#swapuv"> &para;</a></span></h3>
  40447. <p>Swap U &amp; V plane.
  40448. </p>
  40449. </div>
  40450. <div class="section-level-extent" id="tblend">
  40451. <h3 class="section"><span>30.252 tblend<a class="copiable-link" href="#tblend"> &para;</a></span></h3>
  40452. <p>Blend successive video frames.
  40453. </p>
  40454. <p>See <a class="ref" href="#blend">blend</a>
  40455. </p>
  40456. </div>
  40457. <div class="section-level-extent" id="telecine">
  40458. <h3 class="section"><span>30.253 telecine<a class="copiable-link" href="#telecine"> &para;</a></span></h3>
  40459. <p>Apply telecine process to the video.
  40460. </p>
  40461. <p>This filter accepts the following options:
  40462. </p>
  40463. <dl class="table">
  40464. <dt><samp class="option">first_field</samp></dt>
  40465. <dd><dl class="table">
  40466. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  40467. <dd><p>top field first
  40468. </p></dd>
  40469. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  40470. <dd><p>bottom field first
  40471. The default value is <code class="code">top</code>.
  40472. </p></dd>
  40473. </dl>
  40474. </dd>
  40475. <dt><samp class="option">pattern</samp></dt>
  40476. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  40477. The default value is <code class="code">23</code>.
  40478. </p></dd>
  40479. </dl>
  40480. <div class="example">
  40481. <pre class="example-preformatted">Some typical patterns:
  40482. NTSC output (30i):
  40483. 27.5p: 32222
  40484. 24p: 23 (classic)
  40485. 24p: 2332 (preferred)
  40486. 20p: 33
  40487. 18p: 334
  40488. 16p: 3444
  40489. PAL output (25i):
  40490. 27.5p: 12222
  40491. 24p: 222222222223 (&quot;Euro pulldown&quot;)
  40492. 16.67p: 33
  40493. 16p: 33333334
  40494. </pre></div>
  40495. </div>
  40496. <div class="section-level-extent" id="thistogram">
  40497. <h3 class="section"><span>30.254 thistogram<a class="copiable-link" href="#thistogram"> &para;</a></span></h3>
  40498. <p>Compute and draw a color distribution histogram for the input video across time.
  40499. </p>
  40500. <p>Unlike <a class="ref" href="#histogram">histogram</a> video filter which only shows histogram of single input frame
  40501. at certain time, this filter shows also past histograms of number of frames defined
  40502. by <code class="code">width</code> option.
  40503. </p>
  40504. <p>The computed histogram is a representation of the color component
  40505. distribution in an image.
  40506. </p>
  40507. <p>The filter accepts the following options:
  40508. </p>
  40509. <dl class="table">
  40510. <dt><samp class="option">width, w</samp></dt>
  40511. <dd><p>Set width of single color component output. Default value is <code class="code">0</code>.
  40512. Value of <code class="code">0</code> means width will be picked from input video.
  40513. This also set number of passed histograms to keep.
  40514. Allowed range is [0, 8192].
  40515. </p>
  40516. </dd>
  40517. <dt><samp class="option">display_mode, d</samp></dt>
  40518. <dd><p>Set display mode.
  40519. It accepts the following values:
  40520. </p><dl class="table">
  40521. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  40522. <dd><p>Per color component graphs are placed below each other.
  40523. </p>
  40524. </dd>
  40525. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  40526. <dd><p>Per color component graphs are placed side by side.
  40527. </p>
  40528. </dd>
  40529. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  40530. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  40531. that the graphs representing color components are superimposed directly
  40532. over one another.
  40533. </p></dd>
  40534. </dl>
  40535. <p>Default is <code class="code">stack</code>.
  40536. </p>
  40537. </dd>
  40538. <dt><samp class="option">levels_mode, m</samp></dt>
  40539. <dd><p>Set mode. Can be either <code class="code">linear</code>, or <code class="code">logarithmic</code>.
  40540. Default is <code class="code">linear</code>.
  40541. </p>
  40542. </dd>
  40543. <dt><samp class="option">components, c</samp></dt>
  40544. <dd><p>Set what color components to display.
  40545. Default is <code class="code">7</code>.
  40546. </p>
  40547. </dd>
  40548. <dt><samp class="option">bgopacity, b</samp></dt>
  40549. <dd><p>Set background opacity. Default is <code class="code">0.9</code>.
  40550. </p>
  40551. </dd>
  40552. <dt><samp class="option">envelope, e</samp></dt>
  40553. <dd><p>Show envelope. Default is disabled.
  40554. </p>
  40555. </dd>
  40556. <dt><samp class="option">ecolor, ec</samp></dt>
  40557. <dd><p>Set envelope color. Default is <code class="code">gold</code>.
  40558. </p>
  40559. </dd>
  40560. <dt><samp class="option">slide</samp></dt>
  40561. <dd><p>Set slide mode.
  40562. </p>
  40563. <p>Available values for slide is:
  40564. </p><dl class="table">
  40565. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  40566. <dd><p>Draw new frame when right border is reached.
  40567. </p>
  40568. </dd>
  40569. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  40570. <dd><p>Replace old columns with new ones.
  40571. </p>
  40572. </dd>
  40573. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  40574. <dd><p>Scroll from right to left.
  40575. </p>
  40576. </dd>
  40577. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  40578. <dd><p>Scroll from left to right.
  40579. </p>
  40580. </dd>
  40581. <dt>&lsquo;<samp class="samp">picture</samp>&rsquo;</dt>
  40582. <dd><p>Draw single picture.
  40583. </p></dd>
  40584. </dl>
  40585. <p>Default is <code class="code">replace</code>.
  40586. </p></dd>
  40587. </dl>
  40588. </div>
  40589. <div class="section-level-extent" id="threshold">
  40590. <h3 class="section"><span>30.255 threshold<a class="copiable-link" href="#threshold"> &para;</a></span></h3>
  40591. <p>Apply threshold effect to video stream.
  40592. </p>
  40593. <p>This filter needs four video streams to perform thresholding.
  40594. First stream is stream we are filtering.
  40595. Second stream is holding threshold values, third stream is holding min values,
  40596. and last, fourth stream is holding max values.
  40597. </p>
  40598. <p>The filter accepts the following option:
  40599. </p>
  40600. <dl class="table">
  40601. <dt><samp class="option">planes</samp></dt>
  40602. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  40603. By default value 0xf, all planes will be processed.
  40604. </p></dd>
  40605. </dl>
  40606. <p>For example if first stream pixel&rsquo;s component value is less then threshold value
  40607. of pixel component from 2nd threshold stream, third stream value will picked,
  40608. otherwise fourth stream pixel component value will be picked.
  40609. </p>
  40610. <p>Using color source filter one can perform various types of thresholding:
  40611. </p>
  40612. <ul class="mini-toc">
  40613. <li><a href="#Commands-147" accesskey="1">Commands</a></li>
  40614. <li><a href="#Examples-145" accesskey="2">Examples</a></li>
  40615. </ul>
  40616. <div class="subsection-level-extent" id="Commands-147">
  40617. <h4 class="subsection"><span>30.255.1 Commands<a class="copiable-link" href="#Commands-147"> &para;</a></span></h4>
  40618. <p>This filter supports the all options as <a class="ref" href="#commands">commands</a>.
  40619. </p>
  40620. </div>
  40621. <div class="subsection-level-extent" id="Examples-145">
  40622. <h4 class="subsection"><span>30.255.2 Examples<a class="copiable-link" href="#Examples-145"> &para;</a></span></h4>
  40623. <ul class="itemize mark-bullet">
  40624. <li>Binary threshold, using gray color as threshold:
  40625. <div class="example">
  40626. <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
  40627. </pre></div>
  40628. </li><li>Inverted binary threshold, using gray color as threshold:
  40629. <div class="example">
  40630. <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
  40631. </pre></div>
  40632. </li><li>Truncate binary threshold, using gray color as threshold:
  40633. <div class="example">
  40634. <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
  40635. </pre></div>
  40636. </li><li>Threshold to zero, using gray color as threshold:
  40637. <div class="example">
  40638. <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
  40639. </pre></div>
  40640. </li><li>Inverted threshold to zero, using gray color as threshold:
  40641. <div class="example">
  40642. <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
  40643. </pre></div>
  40644. </li></ul>
  40645. </div>
  40646. </div>
  40647. <div class="section-level-extent" id="thumbnail">
  40648. <h3 class="section"><span>30.256 thumbnail<a class="copiable-link" href="#thumbnail"> &para;</a></span></h3>
  40649. <p>Select the most representative frame in a given sequence of consecutive frames.
  40650. </p>
  40651. <p>The filter accepts the following options:
  40652. </p>
  40653. <dl class="table">
  40654. <dt><samp class="option">n</samp></dt>
  40655. <dd><p>Set the frames batch size to analyze; in a set of <var class="var">n</var> frames, the filter
  40656. will pick one of them, and then handle the next batch of <var class="var">n</var> frames until
  40657. the end. Default is <code class="code">100</code>.
  40658. </p>
  40659. </dd>
  40660. <dt><samp class="option">log</samp></dt>
  40661. <dd><p>Set the log level to display picked frame stats.
  40662. Default is <code class="code">info</code>.
  40663. </p></dd>
  40664. </dl>
  40665. <p>Since the filter keeps track of the whole frames sequence, a bigger <var class="var">n</var>
  40666. value will result in a higher memory usage, so a high value is not recommended.
  40667. </p>
  40668. <ul class="mini-toc">
  40669. <li><a href="#Examples-146" accesskey="1">Examples</a></li>
  40670. </ul>
  40671. <div class="subsection-level-extent" id="Examples-146">
  40672. <h4 class="subsection"><span>30.256.1 Examples<a class="copiable-link" href="#Examples-146"> &para;</a></span></h4>
  40673. <ul class="itemize mark-bullet">
  40674. <li>Extract one picture each 50 frames:
  40675. <div class="example">
  40676. <pre class="example-preformatted">thumbnail=50
  40677. </pre></div>
  40678. </li><li>Complete example of a thumbnail creation with <code class="command">ffmpeg</code>:
  40679. <div class="example">
  40680. <pre class="example-preformatted">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
  40681. </pre></div>
  40682. </li></ul>
  40683. <a class="anchor" id="tile"></a></div>
  40684. </div>
  40685. <div class="section-level-extent" id="tile-1">
  40686. <h3 class="section"><span>30.257 tile<a class="copiable-link" href="#tile-1"> &para;</a></span></h3>
  40687. <p>Tile several successive frames together.
  40688. </p>
  40689. <p>The <a class="ref" href="#untile">untile</a> filter can do the reverse.
  40690. </p>
  40691. <p>The filter accepts the following options:
  40692. </p>
  40693. <dl class="table">
  40694. <dt><samp class="option">layout</samp></dt>
  40695. <dd><p>Set the grid size in the form <code class="code">COLUMNSxROWS</code>. Range is up to UINT_MAX cells.
  40696. Default is <code class="code">6x5</code>.
  40697. </p>
  40698. </dd>
  40699. <dt><samp class="option">nb_frames</samp></dt>
  40700. <dd><p>Set the maximum number of frames to render in the given area. It must be less
  40701. 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
  40702. the area will be used.
  40703. </p>
  40704. </dd>
  40705. <dt><samp class="option">margin</samp></dt>
  40706. <dd><p>Set the outer border margin in pixels. Range is 0 to 1024. Default is <code class="code">0</code>.
  40707. </p>
  40708. </dd>
  40709. <dt><samp class="option">padding</samp></dt>
  40710. <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
  40711. more advanced padding options (such as having different values for the edges),
  40712. refer to the pad video filter. Range is 0 to 1024. Default is <code class="code">0</code>.
  40713. </p>
  40714. </dd>
  40715. <dt><samp class="option">color</samp></dt>
  40716. <dd><p>Specify the color of the unused area. For the syntax of this option, check the
  40717. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  40718. The default value of <var class="var">color</var> is &quot;black&quot;.
  40719. </p>
  40720. </dd>
  40721. <dt><samp class="option">overlap</samp></dt>
  40722. <dd><p>Set the number of frames to overlap when tiling several successive frames together.
  40723. 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>.
  40724. </p>
  40725. </dd>
  40726. <dt><samp class="option">init_padding</samp></dt>
  40727. <dd><p>Set the number of frames to initially be empty before displaying first output frame.
  40728. This controls how soon will one get first output frame.
  40729. 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>.
  40730. </p></dd>
  40731. </dl>
  40732. <ul class="mini-toc">
  40733. <li><a href="#Examples-147" accesskey="1">Examples</a></li>
  40734. </ul>
  40735. <div class="subsection-level-extent" id="Examples-147">
  40736. <h4 class="subsection"><span>30.257.1 Examples<a class="copiable-link" href="#Examples-147"> &para;</a></span></h4>
  40737. <ul class="itemize mark-bullet">
  40738. <li>Produce 8x8 PNG tiles of all keyframes (<samp class="option">-skip_frame nokey</samp>) in a movie:
  40739. <div class="example">
  40740. <pre class="example-preformatted">ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
  40741. </pre></div>
  40742. <p>The <samp class="option">-vsync 0</samp> is necessary to prevent <code class="command">ffmpeg</code> from
  40743. duplicating each output frame to accommodate the originally detected frame
  40744. rate.
  40745. </p>
  40746. </li><li>Display <code class="code">5</code> pictures in an area of <code class="code">3x2</code> frames,
  40747. with <code class="code">7</code> pixels between them, and <code class="code">2</code> pixels of initial margin, using
  40748. mixed flat and named options:
  40749. <div class="example">
  40750. <pre class="example-preformatted">tile=3x2:nb_frames=5:padding=7:margin=2
  40751. </pre></div>
  40752. </li></ul>
  40753. </div>
  40754. </div>
  40755. <div class="section-level-extent" id="tiltandshift">
  40756. <h3 class="section"><span>30.258 tiltandshift<a class="copiable-link" href="#tiltandshift"> &para;</a></span></h3>
  40757. <p>What happens when you invert time and space?
  40758. </p>
  40759. <p>Normally a video is composed of several frames that represent a different
  40760. instant of time and shows a scence that evolves in the space captured by the
  40761. frame. This filter is the antipode of that concept, taking inspiration by
  40762. tilt and shift photography.
  40763. </p>
  40764. <p>A filtered frame contains the whole timeline of events composing the sequence,
  40765. and this is obtained by placing a slice of pixels from each frame into a single
  40766. one. However, since there are no infinite-width frames, this is done up the
  40767. width of the input frame, and a video is recomposed by shifting away one
  40768. column for each subsequent frame. In order to map space to time, the filter
  40769. tilts each input frame as well, so that motion is preseved. This is accomplished
  40770. by progressively selecting a different column from each input frame.
  40771. </p>
  40772. <p>The end result is a sort of inverted parralax, so that far away objects move
  40773. much faster that the ones in the front. The ideal conditions for this video
  40774. effect are when there is either very little motion and the backgroud is static,
  40775. or when there is a lot of motion and a very wide depth of field (eg. wide
  40776. panorama, while moving on a train).
  40777. </p>
  40778. <p>The filter accepts the following parameters:
  40779. </p>
  40780. <dl class="table">
  40781. <dt><samp class="option">tilt</samp></dt>
  40782. <dd><p>Tilt video while shifting (default). When unset, video will be sliding a
  40783. static image, composed of the first column of each frame.
  40784. </p>
  40785. </dd>
  40786. <dt><samp class="option">start</samp></dt>
  40787. <dd><p>What to do at the start of filtering (see below).
  40788. </p>
  40789. </dd>
  40790. <dt><samp class="option">end</samp></dt>
  40791. <dd><p>What to do at the end of filtering (see below).
  40792. </p>
  40793. </dd>
  40794. <dt><samp class="option">hold</samp></dt>
  40795. <dd><p>How many columns should pass through before start of filtering.
  40796. </p>
  40797. </dd>
  40798. <dt><samp class="option">pad</samp></dt>
  40799. <dd><p>How many columns should be inserted before end of filtering.
  40800. </p>
  40801. </dd>
  40802. </dl>
  40803. <p>Normally the filter shifts and tils from the very first frame, and stops when
  40804. the last one is received. However, before filtering starts, normal video may
  40805. be preseved, so that the effect is slowly shifted in its place. Similarly,
  40806. the last video frame may be reconstructed at the end. Alternatively it is
  40807. possible to just start and end with black.
  40808. </p>
  40809. <dl class="table">
  40810. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  40811. <dd><p>Filtering is starts immediately and ends when the last frame is received.
  40812. </p>
  40813. </dd>
  40814. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  40815. <dd><p>The first frames or the very last frame are kept intact during processing.
  40816. </p>
  40817. </dd>
  40818. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  40819. <dd><p>Black is padded at the beginning or at the end of filtering.
  40820. </p>
  40821. </dd>
  40822. </dl>
  40823. </div>
  40824. <div class="section-level-extent" id="tinterlace">
  40825. <h3 class="section"><span>30.259 tinterlace<a class="copiable-link" href="#tinterlace"> &para;</a></span></h3>
  40826. <p>Perform various types of temporal field interlacing.
  40827. </p>
  40828. <p>Frames are counted starting from 1, so the first input frame is
  40829. considered odd.
  40830. </p>
  40831. <p>The filter accepts the following options:
  40832. </p>
  40833. <dl class="table">
  40834. <dt><samp class="option">mode</samp></dt>
  40835. <dd><p>Specify the mode of the interlacing. This option can also be specified
  40836. as a value alone. See below for a list of values for this option.
  40837. </p>
  40838. <p>Available values are:
  40839. </p>
  40840. <dl class="table">
  40841. <dt>&lsquo;<samp class="samp">merge, 0</samp>&rsquo;</dt>
  40842. <dd><p>Move odd frames into the upper field, even into the lower field,
  40843. generating a double height frame at half frame rate.
  40844. </p><div class="example">
  40845. <pre class="example-preformatted"> ------&gt; time
  40846. Input:
  40847. Frame 1 Frame 2 Frame 3 Frame 4
  40848. 11111 22222 33333 44444
  40849. 11111 22222 33333 44444
  40850. 11111 22222 33333 44444
  40851. 11111 22222 33333 44444
  40852. Output:
  40853. 11111 33333
  40854. 22222 44444
  40855. 11111 33333
  40856. 22222 44444
  40857. 11111 33333
  40858. 22222 44444
  40859. 11111 33333
  40860. 22222 44444
  40861. </pre></div>
  40862. </dd>
  40863. <dt>&lsquo;<samp class="samp">drop_even, 1</samp>&rsquo;</dt>
  40864. <dd><p>Only output odd frames, even frames are dropped, generating a frame with
  40865. unchanged height at half frame rate.
  40866. </p>
  40867. <div class="example">
  40868. <pre class="example-preformatted"> ------&gt; time
  40869. Input:
  40870. Frame 1 Frame 2 Frame 3 Frame 4
  40871. 11111 22222 33333 44444
  40872. 11111 22222 33333 44444
  40873. 11111 22222 33333 44444
  40874. 11111 22222 33333 44444
  40875. Output:
  40876. 11111 33333
  40877. 11111 33333
  40878. 11111 33333
  40879. 11111 33333
  40880. </pre></div>
  40881. </dd>
  40882. <dt>&lsquo;<samp class="samp">drop_odd, 2</samp>&rsquo;</dt>
  40883. <dd><p>Only output even frames, odd frames are dropped, generating a frame with
  40884. unchanged height at half frame rate.
  40885. </p>
  40886. <div class="example">
  40887. <pre class="example-preformatted"> ------&gt; time
  40888. Input:
  40889. Frame 1 Frame 2 Frame 3 Frame 4
  40890. 11111 22222 33333 44444
  40891. 11111 22222 33333 44444
  40892. 11111 22222 33333 44444
  40893. 11111 22222 33333 44444
  40894. Output:
  40895. 22222 44444
  40896. 22222 44444
  40897. 22222 44444
  40898. 22222 44444
  40899. </pre></div>
  40900. </dd>
  40901. <dt>&lsquo;<samp class="samp">pad, 3</samp>&rsquo;</dt>
  40902. <dd><p>Expand each frame to full height, but pad alternate lines with black,
  40903. generating a frame with double height at the same input frame rate.
  40904. </p>
  40905. <div class="example">
  40906. <pre class="example-preformatted"> ------&gt; time
  40907. Input:
  40908. Frame 1 Frame 2 Frame 3 Frame 4
  40909. 11111 22222 33333 44444
  40910. 11111 22222 33333 44444
  40911. 11111 22222 33333 44444
  40912. 11111 22222 33333 44444
  40913. Output:
  40914. 11111 ..... 33333 .....
  40915. ..... 22222 ..... 44444
  40916. 11111 ..... 33333 .....
  40917. ..... 22222 ..... 44444
  40918. 11111 ..... 33333 .....
  40919. ..... 22222 ..... 44444
  40920. 11111 ..... 33333 .....
  40921. ..... 22222 ..... 44444
  40922. </pre></div>
  40923. </dd>
  40924. <dt>&lsquo;<samp class="samp">interleave_top, 4</samp>&rsquo;</dt>
  40925. <dd><p>Interleave the upper field from odd frames with the lower field from
  40926. even frames, generating a frame with unchanged height at half frame rate.
  40927. </p>
  40928. <div class="example">
  40929. <pre class="example-preformatted"> ------&gt; time
  40930. Input:
  40931. Frame 1 Frame 2 Frame 3 Frame 4
  40932. 11111&lt;- 22222 33333&lt;- 44444
  40933. 11111 22222&lt;- 33333 44444&lt;-
  40934. 11111&lt;- 22222 33333&lt;- 44444
  40935. 11111 22222&lt;- 33333 44444&lt;-
  40936. Output:
  40937. 11111 33333
  40938. 22222 44444
  40939. 11111 33333
  40940. 22222 44444
  40941. </pre></div>
  40942. </dd>
  40943. <dt>&lsquo;<samp class="samp">interleave_bottom, 5</samp>&rsquo;</dt>
  40944. <dd><p>Interleave the lower field from odd frames with the upper field from
  40945. even frames, generating a frame with unchanged height at half frame rate.
  40946. </p>
  40947. <div class="example">
  40948. <pre class="example-preformatted"> ------&gt; time
  40949. Input:
  40950. Frame 1 Frame 2 Frame 3 Frame 4
  40951. 11111 22222&lt;- 33333 44444&lt;-
  40952. 11111&lt;- 22222 33333&lt;- 44444
  40953. 11111 22222&lt;- 33333 44444&lt;-
  40954. 11111&lt;- 22222 33333&lt;- 44444
  40955. Output:
  40956. 22222 44444
  40957. 11111 33333
  40958. 22222 44444
  40959. 11111 33333
  40960. </pre></div>
  40961. </dd>
  40962. <dt>&lsquo;<samp class="samp">interlacex2, 6</samp>&rsquo;</dt>
  40963. <dd><p>Double frame rate with unchanged height. Frames are inserted each
  40964. containing the second temporal field from the previous input frame and
  40965. the first temporal field from the next input frame. This mode relies on
  40966. the top_field_first flag. Useful for interlaced video displays with no
  40967. field synchronisation.
  40968. </p>
  40969. <div class="example">
  40970. <pre class="example-preformatted"> ------&gt; time
  40971. Input:
  40972. Frame 1 Frame 2 Frame 3 Frame 4
  40973. 11111 22222 33333 44444
  40974. 11111 22222 33333 44444
  40975. 11111 22222 33333 44444
  40976. 11111 22222 33333 44444
  40977. Output:
  40978. 11111 22222 22222 33333 33333 44444 44444
  40979. 11111 11111 22222 22222 33333 33333 44444
  40980. 11111 22222 22222 33333 33333 44444 44444
  40981. 11111 11111 22222 22222 33333 33333 44444
  40982. </pre></div>
  40983. </dd>
  40984. <dt>&lsquo;<samp class="samp">mergex2, 7</samp>&rsquo;</dt>
  40985. <dd><p>Move odd frames into the upper field, even into the lower field,
  40986. generating a double height frame at same frame rate.
  40987. </p>
  40988. <div class="example">
  40989. <pre class="example-preformatted"> ------&gt; time
  40990. Input:
  40991. Frame 1 Frame 2 Frame 3 Frame 4
  40992. 11111 22222 33333 44444
  40993. 11111 22222 33333 44444
  40994. 11111 22222 33333 44444
  40995. 11111 22222 33333 44444
  40996. Output:
  40997. 11111 33333 33333 55555
  40998. 22222 22222 44444 44444
  40999. 11111 33333 33333 55555
  41000. 22222 22222 44444 44444
  41001. 11111 33333 33333 55555
  41002. 22222 22222 44444 44444
  41003. 11111 33333 33333 55555
  41004. 22222 22222 44444 44444
  41005. </pre></div>
  41006. </dd>
  41007. </dl>
  41008. <p>Numeric values are deprecated but are accepted for backward
  41009. compatibility reasons.
  41010. </p>
  41011. <p>Default mode is <code class="code">merge</code>.
  41012. </p>
  41013. </dd>
  41014. <dt><samp class="option">flags</samp></dt>
  41015. <dd><p>Specify flags influencing the filter process.
  41016. </p>
  41017. <p>Available value for <var class="var">flags</var> is:
  41018. </p>
  41019. <dl class="table">
  41020. <dt><samp class="option">low_pass_filter, vlpf</samp></dt>
  41021. <dd><p>Enable linear vertical low-pass filtering in the filter.
  41022. Vertical low-pass filtering is required when creating an interlaced
  41023. destination from a progressive source which contains high-frequency
  41024. vertical detail. Filtering will reduce interlace &rsquo;twitter&rsquo; and Moire
  41025. patterning.
  41026. </p>
  41027. </dd>
  41028. <dt><samp class="option">complex_filter, cvlpf</samp></dt>
  41029. <dd><p>Enable complex vertical low-pass filtering.
  41030. This will slightly less reduce interlace &rsquo;twitter&rsquo; and Moire
  41031. patterning but better retain detail and subjective sharpness impression.
  41032. </p>
  41033. </dd>
  41034. <dt><samp class="option">bypass_il</samp></dt>
  41035. <dd><p>Bypass already interlaced frames, only adjust the frame rate.
  41036. </p></dd>
  41037. </dl>
  41038. <p>Vertical low-pass filtering and bypassing already interlaced frames can only be
  41039. enabled for <samp class="option">mode</samp> <var class="var">interleave_top</var> and <var class="var">interleave_bottom</var>.
  41040. </p>
  41041. </dd>
  41042. </dl>
  41043. </div>
  41044. <div class="section-level-extent" id="tmedian">
  41045. <h3 class="section"><span>30.260 tmedian<a class="copiable-link" href="#tmedian"> &para;</a></span></h3>
  41046. <p>Pick median pixels from several successive input video frames.
  41047. </p>
  41048. <p>The filter accepts the following options:
  41049. </p>
  41050. <dl class="table">
  41051. <dt><samp class="option">radius</samp></dt>
  41052. <dd><p>Set radius of median filter.
  41053. Default is 1. Allowed range is from 1 to 127.
  41054. </p>
  41055. </dd>
  41056. <dt><samp class="option">planes</samp></dt>
  41057. <dd><p>Set which planes to filter. Default value is <code class="code">15</code>, by which all planes are processed.
  41058. </p>
  41059. </dd>
  41060. <dt><samp class="option">percentile</samp></dt>
  41061. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  41062. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  41063. minimum values, and <code class="code">1</code> maximum values.
  41064. </p></dd>
  41065. </dl>
  41066. <ul class="mini-toc">
  41067. <li><a href="#Commands-148" accesskey="1">Commands</a></li>
  41068. </ul>
  41069. <div class="subsection-level-extent" id="Commands-148">
  41070. <h4 class="subsection"><span>30.260.1 Commands<a class="copiable-link" href="#Commands-148"> &para;</a></span></h4>
  41071. <p>This filter supports all above options as <a class="ref" href="#commands">commands</a>, excluding option <code class="code">radius</code>.
  41072. </p>
  41073. </div>
  41074. </div>
  41075. <div class="section-level-extent" id="tmidequalizer">
  41076. <h3 class="section"><span>30.261 tmidequalizer<a class="copiable-link" href="#tmidequalizer"> &para;</a></span></h3>
  41077. <p>Apply Temporal Midway Video Equalization effect.
  41078. </p>
  41079. <p>Midway Video Equalization adjusts a sequence of video frames to have the same
  41080. histograms, while maintaining their dynamics as much as possible. It&rsquo;s
  41081. useful for e.g. matching exposures from a video frames sequence.
  41082. </p>
  41083. <p>This filter accepts the following option:
  41084. </p>
  41085. <dl class="table">
  41086. <dt><samp class="option">radius</samp></dt>
  41087. <dd><p>Set filtering radius. Default is <code class="code">5</code>. Allowed range is from 1 to 127.
  41088. </p>
  41089. </dd>
  41090. <dt><samp class="option">sigma</samp></dt>
  41091. <dd><p>Set filtering sigma. Default is <code class="code">0.5</code>. This controls strength of filtering.
  41092. Setting this option to 0 effectively does nothing.
  41093. </p>
  41094. </dd>
  41095. <dt><samp class="option">planes</samp></dt>
  41096. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  41097. </p></dd>
  41098. </dl>
  41099. </div>
  41100. <div class="section-level-extent" id="tmix">
  41101. <h3 class="section"><span>30.262 tmix<a class="copiable-link" href="#tmix"> &para;</a></span></h3>
  41102. <p>Mix successive video frames.
  41103. </p>
  41104. <p>A description of the accepted options follows.
  41105. </p>
  41106. <dl class="table">
  41107. <dt><samp class="option">frames</samp></dt>
  41108. <dd><p>The number of successive frames to mix. If unspecified, it defaults to 3.
  41109. </p>
  41110. </dd>
  41111. <dt><samp class="option">weights</samp></dt>
  41112. <dd><p>Specify weight of each input video frame.
  41113. Each weight is separated by space. If number of weights is smaller than
  41114. number of <var class="var">frames</var> last specified weight will be used for all remaining
  41115. unset weights.
  41116. </p>
  41117. </dd>
  41118. <dt><samp class="option">scale</samp></dt>
  41119. <dd><p>Specify scale, if it is set it will be multiplied with sum
  41120. of each weight multiplied with pixel values to give final destination
  41121. pixel value. By default <var class="var">scale</var> is auto scaled to sum of weights.
  41122. </p>
  41123. </dd>
  41124. <dt><samp class="option">planes</samp></dt>
  41125. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  41126. </p></dd>
  41127. </dl>
  41128. <ul class="mini-toc">
  41129. <li><a href="#Examples-148" accesskey="1">Examples</a></li>
  41130. <li><a href="#Commands-149" accesskey="2">Commands</a></li>
  41131. </ul>
  41132. <div class="subsection-level-extent" id="Examples-148">
  41133. <h4 class="subsection"><span>30.262.1 Examples<a class="copiable-link" href="#Examples-148"> &para;</a></span></h4>
  41134. <ul class="itemize mark-bullet">
  41135. <li>Average 7 successive frames:
  41136. <div class="example">
  41137. <pre class="example-preformatted">tmix=frames=7:weights=&quot;1 1 1 1 1 1 1&quot;
  41138. </pre></div>
  41139. </li><li>Apply simple temporal convolution:
  41140. <div class="example">
  41141. <pre class="example-preformatted">tmix=frames=3:weights=&quot;-1 3 -1&quot;
  41142. </pre></div>
  41143. </li><li>Similar as above but only showing temporal differences:
  41144. <div class="example">
  41145. <pre class="example-preformatted">tmix=frames=3:weights=&quot;-1 2 -1&quot;:scale=1
  41146. </pre></div>
  41147. </li></ul>
  41148. </div>
  41149. <div class="subsection-level-extent" id="Commands-149">
  41150. <h4 class="subsection"><span>30.262.2 Commands<a class="copiable-link" href="#Commands-149"> &para;</a></span></h4>
  41151. <p>This filter supports the following commands:
  41152. </p><dl class="table">
  41153. <dt><samp class="option">weights</samp></dt>
  41154. <dt><samp class="option">scale</samp></dt>
  41155. <dt><samp class="option">planes</samp></dt>
  41156. <dd><p>Syntax is same as option with same name.
  41157. </p></dd>
  41158. </dl>
  41159. <a class="anchor" id="tonemap"></a></div>
  41160. </div>
  41161. <div class="section-level-extent" id="tonemap-1">
  41162. <h3 class="section"><span>30.263 tonemap<a class="copiable-link" href="#tonemap-1"> &para;</a></span></h3>
  41163. <p>Tone map colors from different dynamic ranges.
  41164. </p>
  41165. <p>This filter expects data in single precision floating point, as it needs to
  41166. operate on (and can output) out-of-range values. Another filter, such as
  41167. <a class="ref" href="#zscale">zscale</a>, is needed to convert the resulting frame to a usable format.
  41168. </p>
  41169. <p>The tonemapping algorithms implemented only work on linear light, so input
  41170. data should be linearized beforehand (and possibly correctly tagged).
  41171. </p>
  41172. <div class="example">
  41173. <pre class="example-preformatted">ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
  41174. </pre></div>
  41175. <ul class="mini-toc">
  41176. <li><a href="#Options-40" accesskey="1">Options</a></li>
  41177. </ul>
  41178. <div class="subsection-level-extent" id="Options-40">
  41179. <h4 class="subsection"><span>30.263.1 Options<a class="copiable-link" href="#Options-40"> &para;</a></span></h4>
  41180. <p>The filter accepts the following options.
  41181. </p>
  41182. <dl class="table">
  41183. <dt><samp class="option">tonemap</samp></dt>
  41184. <dd><p>Set the tone map algorithm to use.
  41185. </p>
  41186. <p>Possible values are:
  41187. </p><dl class="table">
  41188. <dt><var class="var">none</var></dt>
  41189. <dd><p>Do not apply any tone map, only desaturate overbright pixels.
  41190. </p>
  41191. </dd>
  41192. <dt><var class="var">clip</var></dt>
  41193. <dd><p>Hard-clip any out-of-range values. Use it for perfect color accuracy for
  41194. in-range values, while distorting out-of-range values.
  41195. </p>
  41196. </dd>
  41197. <dt><var class="var">linear</var></dt>
  41198. <dd><p>Stretch the entire reference gamut to a linear multiple of the display.
  41199. </p>
  41200. </dd>
  41201. <dt><var class="var">gamma</var></dt>
  41202. <dd><p>Fit a logarithmic transfer between the tone curves.
  41203. </p>
  41204. </dd>
  41205. <dt><var class="var">reinhard</var></dt>
  41206. <dd><p>Preserve overall image brightness with a simple curve, using nonlinear
  41207. contrast, which results in flattening details and degrading color accuracy.
  41208. </p>
  41209. </dd>
  41210. <dt><var class="var">hable</var></dt>
  41211. <dd><p>Preserve both dark and bright details better than <var class="var">reinhard</var>, at the cost
  41212. of slightly darkening everything. Use it when detail preservation is more
  41213. important than color and brightness accuracy.
  41214. </p>
  41215. </dd>
  41216. <dt><var class="var">mobius</var></dt>
  41217. <dd><p>Smoothly map out-of-range values, while retaining contrast and colors for
  41218. in-range material as much as possible. Use it when color accuracy is more
  41219. important than detail preservation.
  41220. </p></dd>
  41221. </dl>
  41222. <p>Default is none.
  41223. </p>
  41224. </dd>
  41225. <dt><samp class="option">param</samp></dt>
  41226. <dd><p>Tune the tone mapping algorithm.
  41227. </p>
  41228. <p>This affects the following algorithms:
  41229. </p><dl class="table">
  41230. <dt><var class="var">none</var></dt>
  41231. <dd><p>Ignored.
  41232. </p>
  41233. </dd>
  41234. <dt><var class="var">linear</var></dt>
  41235. <dd><p>Specifies the scale factor to use while stretching.
  41236. Default to 1.0.
  41237. </p>
  41238. </dd>
  41239. <dt><var class="var">gamma</var></dt>
  41240. <dd><p>Specifies the exponent of the function.
  41241. Default to 1.8.
  41242. </p>
  41243. </dd>
  41244. <dt><var class="var">clip</var></dt>
  41245. <dd><p>Specify an extra linear coefficient to multiply into the signal before clipping.
  41246. Default to 1.0.
  41247. </p>
  41248. </dd>
  41249. <dt><var class="var">reinhard</var></dt>
  41250. <dd><p>Specify the local contrast coefficient at the display peak.
  41251. Default to 0.5, which means that in-gamut values will be about half as bright
  41252. as when clipping.
  41253. </p>
  41254. </dd>
  41255. <dt><var class="var">hable</var></dt>
  41256. <dd><p>Ignored.
  41257. </p>
  41258. </dd>
  41259. <dt><var class="var">mobius</var></dt>
  41260. <dd><p>Specify the transition point from linear to mobius transform. Every value
  41261. below this point is guaranteed to be mapped 1:1. The higher the value, the
  41262. more accurate the result will be, at the cost of losing bright details.
  41263. Default to 0.3, which due to the steep initial slope still preserves in-range
  41264. colors fairly accurately.
  41265. </p></dd>
  41266. </dl>
  41267. </dd>
  41268. <dt><samp class="option">desat</samp></dt>
  41269. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  41270. higher the parameter, the more color information will be preserved. This
  41271. setting helps prevent unnaturally blown-out colors for super-highlights, by
  41272. (smoothly) turning into white instead. This makes images feel more natural,
  41273. at the cost of reducing information about out-of-range colors.
  41274. </p>
  41275. <p>The default of 2.0 is somewhat conservative and will mostly just apply to
  41276. skies or directly sunlit surfaces. A setting of 0.0 disables this option.
  41277. </p>
  41278. <p>This option works only if the input frame has a supported color tag.
  41279. </p>
  41280. </dd>
  41281. <dt><samp class="option">peak</samp></dt>
  41282. <dd><p>Override signal/nominal/reference peak with this value. Useful when the
  41283. embedded peak information in display metadata is not reliable or when tone
  41284. mapping from a lower range to a higher range.
  41285. </p></dd>
  41286. </dl>
  41287. </div>
  41288. </div>
  41289. <div class="section-level-extent" id="tpad">
  41290. <h3 class="section"><span>30.264 tpad<a class="copiable-link" href="#tpad"> &para;</a></span></h3>
  41291. <p>Temporarily pad video frames.
  41292. </p>
  41293. <p>The filter accepts the following options:
  41294. </p>
  41295. <dl class="table">
  41296. <dt><samp class="option">start</samp></dt>
  41297. <dd><p>Specify number of delay frames before input video stream. Default is 0.
  41298. </p>
  41299. </dd>
  41300. <dt><samp class="option">stop</samp></dt>
  41301. <dd><p>Specify number of padding frames after input video stream.
  41302. Set to -1 to pad indefinitely. Default is 0.
  41303. </p>
  41304. </dd>
  41305. <dt><samp class="option">start_mode</samp></dt>
  41306. <dd><p>Set kind of frames added to beginning of stream.
  41307. Can be either <var class="var">add</var> or <var class="var">clone</var>.
  41308. With <var class="var">add</var> frames of solid-color are added.
  41309. With <var class="var">clone</var> frames are clones of first frame.
  41310. Default is <var class="var">add</var>.
  41311. </p>
  41312. </dd>
  41313. <dt><samp class="option">stop_mode</samp></dt>
  41314. <dd><p>Set kind of frames added to end of stream.
  41315. Can be either <var class="var">add</var> or <var class="var">clone</var>.
  41316. With <var class="var">add</var> frames of solid-color are added.
  41317. With <var class="var">clone</var> frames are clones of last frame.
  41318. Default is <var class="var">add</var>.
  41319. </p>
  41320. </dd>
  41321. <dt><samp class="option">start_duration, stop_duration</samp></dt>
  41322. <dd><p>Specify the duration of the start/stop delay. See
  41323. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  41324. for the accepted syntax.
  41325. These options override <var class="var">start</var> and <var class="var">stop</var>. Default is 0.
  41326. </p>
  41327. </dd>
  41328. <dt><samp class="option">color</samp></dt>
  41329. <dd><p>Specify the color of the padded area. For the syntax of this option,
  41330. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  41331. manual</a>.
  41332. </p>
  41333. <p>The default value of <var class="var">color</var> is &quot;black&quot;.
  41334. </p></dd>
  41335. </dl>
  41336. <a class="anchor" id="transpose"></a></div>
  41337. <div class="section-level-extent" id="transpose-1">
  41338. <h3 class="section"><span>30.265 transpose<a class="copiable-link" href="#transpose-1"> &para;</a></span></h3>
  41339. <p>Transpose rows with columns in the input video and optionally flip it.
  41340. </p>
  41341. <p>It accepts the following parameters:
  41342. </p>
  41343. <dl class="table">
  41344. <dt><samp class="option">dir</samp></dt>
  41345. <dd><p>Specify the transposition direction.
  41346. </p>
  41347. <p>Can assume the following values:
  41348. </p><dl class="table">
  41349. <dt>&lsquo;<samp class="samp">0, 4, cclock_flip</samp>&rsquo;</dt>
  41350. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
  41351. </p><div class="example">
  41352. <pre class="example-preformatted">L.R L.l
  41353. . . -&gt; . .
  41354. l.r R.r
  41355. </pre></div>
  41356. </dd>
  41357. <dt>&lsquo;<samp class="samp">1, 5, clock</samp>&rsquo;</dt>
  41358. <dd><p>Rotate by 90 degrees clockwise, that is:
  41359. </p><div class="example">
  41360. <pre class="example-preformatted">L.R l.L
  41361. . . -&gt; . .
  41362. l.r r.R
  41363. </pre></div>
  41364. </dd>
  41365. <dt>&lsquo;<samp class="samp">2, 6, cclock</samp>&rsquo;</dt>
  41366. <dd><p>Rotate by 90 degrees counterclockwise, that is:
  41367. </p><div class="example">
  41368. <pre class="example-preformatted">L.R R.r
  41369. . . -&gt; . .
  41370. l.r L.l
  41371. </pre></div>
  41372. </dd>
  41373. <dt>&lsquo;<samp class="samp">3, 7, clock_flip</samp>&rsquo;</dt>
  41374. <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
  41375. </p><div class="example">
  41376. <pre class="example-preformatted">L.R r.R
  41377. . . -&gt; . .
  41378. l.r l.L
  41379. </pre></div>
  41380. </dd>
  41381. </dl>
  41382. <p>For values between 4-7, the transposition is only done if the input
  41383. video geometry is portrait and not landscape. These values are
  41384. deprecated, the <code class="code">passthrough</code> option should be used instead.
  41385. </p>
  41386. <p>Numerical values are deprecated, and should be dropped in favor of
  41387. symbolic constants.
  41388. </p>
  41389. </dd>
  41390. <dt><samp class="option">passthrough</samp></dt>
  41391. <dd><p>Do not apply the transposition if the input geometry matches the one
  41392. specified by the specified value. It accepts the following values:
  41393. </p><dl class="table">
  41394. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  41395. <dd><p>Always apply transposition.
  41396. </p></dd>
  41397. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  41398. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  41399. </p></dd>
  41400. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  41401. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  41402. </p></dd>
  41403. </dl>
  41404. <p>Default value is <code class="code">none</code>.
  41405. </p></dd>
  41406. </dl>
  41407. <p>For example to rotate by 90 degrees clockwise and preserve portrait
  41408. layout:
  41409. </p><div class="example">
  41410. <pre class="example-preformatted">transpose=dir=1:passthrough=portrait
  41411. </pre></div>
  41412. <p>The command above can also be specified as:
  41413. </p><div class="example">
  41414. <pre class="example-preformatted">transpose=1:portrait
  41415. </pre></div>
  41416. </div>
  41417. <div class="section-level-extent" id="transpose_005fnpp">
  41418. <h3 class="section"><span>30.266 transpose_npp<a class="copiable-link" href="#transpose_005fnpp"> &para;</a></span></h3>
  41419. <p>Transpose rows with columns in the input video and optionally flip it.
  41420. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  41421. </p>
  41422. <p>It accepts the following parameters:
  41423. </p>
  41424. <dl class="table">
  41425. <dt><samp class="option">dir</samp></dt>
  41426. <dd><p>Specify the transposition direction.
  41427. </p>
  41428. <p>Can assume the following values:
  41429. </p><dl class="table">
  41430. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  41431. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  41432. </p>
  41433. </dd>
  41434. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  41435. <dd><p>Rotate by 90 degrees clockwise.
  41436. </p>
  41437. </dd>
  41438. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  41439. <dd><p>Rotate by 90 degrees counterclockwise.
  41440. </p>
  41441. </dd>
  41442. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  41443. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  41444. </p></dd>
  41445. </dl>
  41446. </dd>
  41447. <dt><samp class="option">passthrough</samp></dt>
  41448. <dd><p>Do not apply the transposition if the input geometry matches the one
  41449. specified by the specified value. It accepts the following values:
  41450. </p><dl class="table">
  41451. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  41452. <dd><p>Always apply transposition. (default)
  41453. </p></dd>
  41454. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  41455. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  41456. </p></dd>
  41457. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  41458. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  41459. </p></dd>
  41460. </dl>
  41461. </dd>
  41462. </dl>
  41463. </div>
  41464. <div class="section-level-extent" id="trim">
  41465. <h3 class="section"><span>30.267 trim<a class="copiable-link" href="#trim"> &para;</a></span></h3>
  41466. <p>Trim the input so that the output contains one continuous subpart of the input.
  41467. </p>
  41468. <p>It accepts the following parameters:
  41469. </p><dl class="table">
  41470. <dt><samp class="option">start</samp></dt>
  41471. <dd><p>Specify the time of the start of the kept section, i.e. the frame with the
  41472. timestamp <var class="var">start</var> will be the first frame in the output.
  41473. </p>
  41474. </dd>
  41475. <dt><samp class="option">end</samp></dt>
  41476. <dd><p>Specify the time of the first frame that will be dropped, i.e. the frame
  41477. immediately preceding the one with the timestamp <var class="var">end</var> will be the last
  41478. frame in the output.
  41479. </p>
  41480. </dd>
  41481. <dt><samp class="option">start_pts</samp></dt>
  41482. <dd><p>This is the same as <var class="var">start</var>, except this option sets the start timestamp
  41483. in timebase units instead of seconds.
  41484. </p>
  41485. </dd>
  41486. <dt><samp class="option">end_pts</samp></dt>
  41487. <dd><p>This is the same as <var class="var">end</var>, except this option sets the end timestamp
  41488. in timebase units instead of seconds.
  41489. </p>
  41490. </dd>
  41491. <dt><samp class="option">duration</samp></dt>
  41492. <dd><p>The maximum duration of the output in seconds.
  41493. </p>
  41494. </dd>
  41495. <dt><samp class="option">start_frame</samp></dt>
  41496. <dd><p>The number of the first frame that should be passed to the output.
  41497. </p>
  41498. </dd>
  41499. <dt><samp class="option">end_frame</samp></dt>
  41500. <dd><p>The number of the first frame that should be dropped.
  41501. </p></dd>
  41502. </dl>
  41503. <p><samp class="option">start</samp>, <samp class="option">end</samp>, and <samp class="option">duration</samp> are expressed as time
  41504. duration specifications; see
  41505. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  41506. for the accepted syntax.
  41507. </p>
  41508. <p>Note that the first two sets of the start/end options and the <samp class="option">duration</samp>
  41509. option look at the frame timestamp, while the _frame variants simply count the
  41510. frames that pass through the filter. Also note that this filter does not modify
  41511. the timestamps. If you wish for the output timestamps to start at zero, insert a
  41512. setpts filter after the trim filter.
  41513. </p>
  41514. <p>If multiple start or end options are set, this filter tries to be greedy and
  41515. keep all the frames that match at least one of the specified constraints. To keep
  41516. only the part that matches all the constraints at once, chain multiple trim
  41517. filters.
  41518. </p>
  41519. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  41520. just the end values to keep everything before the specified time.
  41521. </p>
  41522. <p>Examples:
  41523. </p><ul class="itemize mark-bullet">
  41524. <li>Drop everything except the second minute of input:
  41525. <div class="example">
  41526. <pre class="example-preformatted">ffmpeg -i INPUT -vf trim=60:120
  41527. </pre></div>
  41528. </li><li>Keep only the first second:
  41529. <div class="example">
  41530. <pre class="example-preformatted">ffmpeg -i INPUT -vf trim=duration=1
  41531. </pre></div>
  41532. </li></ul>
  41533. </div>
  41534. <div class="section-level-extent" id="unpremultiply">
  41535. <h3 class="section"><span>30.268 unpremultiply<a class="copiable-link" href="#unpremultiply"> &para;</a></span></h3>
  41536. <p>Apply alpha unpremultiply effect to input video stream using first plane
  41537. of second stream as alpha.
  41538. </p>
  41539. <p>Both streams must have same dimensions and same pixel format.
  41540. </p>
  41541. <p>The filter accepts the following option:
  41542. </p>
  41543. <dl class="table">
  41544. <dt><samp class="option">planes</samp></dt>
  41545. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  41546. By default value 0xf, all planes will be processed.
  41547. </p>
  41548. <p>If the format has 1 or 2 components, then luma is bit 0.
  41549. If the format has 3 or 4 components:
  41550. for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red;
  41551. for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V.
  41552. If present, the alpha channel is always the last bit.
  41553. </p>
  41554. </dd>
  41555. <dt><samp class="option">inplace</samp></dt>
  41556. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  41557. </p></dd>
  41558. </dl>
  41559. <a class="anchor" id="unsharp"></a></div>
  41560. <div class="section-level-extent" id="unsharp-1">
  41561. <h3 class="section"><span>30.269 unsharp<a class="copiable-link" href="#unsharp-1"> &para;</a></span></h3>
  41562. <p>Sharpen or blur the input video.
  41563. </p>
  41564. <p>It accepts the following parameters:
  41565. </p>
  41566. <dl class="table">
  41567. <dt><samp class="option">luma_msize_x, lx</samp></dt>
  41568. <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
  41569. 3 and 23. The default value is 5.
  41570. </p>
  41571. </dd>
  41572. <dt><samp class="option">luma_msize_y, ly</samp></dt>
  41573. <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
  41574. and 23. The default value is 5.
  41575. </p>
  41576. </dd>
  41577. <dt><samp class="option">luma_amount, la</samp></dt>
  41578. <dd><p>Set the luma effect strength. It must be a floating point number, reasonable
  41579. values lay between -1.5 and 1.5.
  41580. </p>
  41581. <p>Negative values will blur the input video, while positive values will
  41582. sharpen it, a value of zero will disable the effect.
  41583. </p>
  41584. <p>Default value is 1.0.
  41585. </p>
  41586. </dd>
  41587. <dt><samp class="option">chroma_msize_x, cx</samp></dt>
  41588. <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
  41589. between 3 and 23. The default value is 5.
  41590. </p>
  41591. </dd>
  41592. <dt><samp class="option">chroma_msize_y, cy</samp></dt>
  41593. <dd><p>Set the chroma matrix vertical size. It must be an odd integer
  41594. between 3 and 23. The default value is 5.
  41595. </p>
  41596. </dd>
  41597. <dt><samp class="option">chroma_amount, ca</samp></dt>
  41598. <dd><p>Set the chroma effect strength. It must be a floating point number, reasonable
  41599. values lay between -1.5 and 1.5.
  41600. </p>
  41601. <p>Negative values will blur the input video, while positive values will
  41602. sharpen it, a value of zero will disable the effect.
  41603. </p>
  41604. <p>Default value is 0.0.
  41605. </p>
  41606. </dd>
  41607. <dt><samp class="option">alpha_msize_x, ax</samp></dt>
  41608. <dd><p>Set the alpha matrix horizontal size. It must be an odd integer
  41609. between 3 and 23. The default value is 5.
  41610. </p>
  41611. </dd>
  41612. <dt><samp class="option">alpha_msize_y, ay</samp></dt>
  41613. <dd><p>Set the alpha matrix vertical size. It must be an odd integer
  41614. between 3 and 23. The default value is 5.
  41615. </p>
  41616. </dd>
  41617. <dt><samp class="option">alpha_amount, aa</samp></dt>
  41618. <dd><p>Set the alpha effect strength. It must be a floating point number, reasonable
  41619. values lay between -1.5 and 1.5.
  41620. </p>
  41621. <p>Negative values will blur the input video, while positive values will
  41622. sharpen it, a value of zero will disable the effect.
  41623. </p>
  41624. <p>Default value is 0.0.
  41625. </p>
  41626. </dd>
  41627. </dl>
  41628. <p>All parameters are optional and default to the equivalent of the
  41629. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  41630. </p>
  41631. <ul class="mini-toc">
  41632. <li><a href="#Examples-149" accesskey="1">Examples</a></li>
  41633. </ul>
  41634. <div class="subsection-level-extent" id="Examples-149">
  41635. <h4 class="subsection"><span>30.269.1 Examples<a class="copiable-link" href="#Examples-149"> &para;</a></span></h4>
  41636. <ul class="itemize mark-bullet">
  41637. <li>Apply strong luma sharpen effect:
  41638. <div class="example">
  41639. <pre class="example-preformatted">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
  41640. </pre></div>
  41641. </li><li>Apply a strong blur of both luma and chroma parameters:
  41642. <div class="example">
  41643. <pre class="example-preformatted">unsharp=7:7:-2:7:7:-2
  41644. </pre></div>
  41645. </li></ul>
  41646. <a class="anchor" id="untile"></a></div>
  41647. </div>
  41648. <div class="section-level-extent" id="untile-1">
  41649. <h3 class="section"><span>30.270 untile<a class="copiable-link" href="#untile-1"> &para;</a></span></h3>
  41650. <p>Decompose a video made of tiled images into the individual images.
  41651. </p>
  41652. <p>The frame rate of the output video is the frame rate of the input video
  41653. multiplied by the number of tiles.
  41654. </p>
  41655. <p>This filter does the reverse of <a class="ref" href="#tile">tile</a>.
  41656. </p>
  41657. <p>The filter accepts the following options:
  41658. </p>
  41659. <dl class="table">
  41660. <dt><samp class="option">layout</samp></dt>
  41661. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  41662. this option, check the
  41663. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  41664. </p></dd>
  41665. </dl>
  41666. <ul class="mini-toc">
  41667. <li><a href="#Examples-150" accesskey="1">Examples</a></li>
  41668. </ul>
  41669. <div class="subsection-level-extent" id="Examples-150">
  41670. <h4 class="subsection"><span>30.270.1 Examples<a class="copiable-link" href="#Examples-150"> &para;</a></span></h4>
  41671. <ul class="itemize mark-bullet">
  41672. <li>Produce a 1-second video from a still image file made of 25 frames stacked
  41673. vertically, like an analogic film reel:
  41674. <div class="example">
  41675. <pre class="example-preformatted">ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
  41676. </pre></div>
  41677. </li></ul>
  41678. </div>
  41679. </div>
  41680. <div class="section-level-extent" id="uspp">
  41681. <h3 class="section"><span>30.271 uspp<a class="copiable-link" href="#uspp"> &para;</a></span></h3>
  41682. <p>Apply ultra slow/simple postprocessing filter that compresses and decompresses
  41683. the image at several (or - in the case of <samp class="option">quality</samp> level <code class="code">8</code> - all)
  41684. shifts and average the results.
  41685. </p>
  41686. <p>The way this differs from the behavior of spp is that uspp actually encodes &amp;
  41687. decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8
  41688. DCT similar to MJPEG.
  41689. </p>
  41690. <p>This filter is only available in ffmpeg version 4.4 or earlier.
  41691. </p>
  41692. <p>The filter accepts the following options:
  41693. </p>
  41694. <dl class="table">
  41695. <dt><samp class="option">quality</samp></dt>
  41696. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  41697. an integer in the range 0-8. If set to <code class="code">0</code>, the filter will have no
  41698. effect. A value of <code class="code">8</code> means the higher quality. For each increment of
  41699. that value the speed drops by a factor of approximately 2. Default value is
  41700. <code class="code">3</code>.
  41701. </p>
  41702. </dd>
  41703. <dt><samp class="option">qp</samp></dt>
  41704. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  41705. from the video stream (if available).
  41706. </p>
  41707. </dd>
  41708. <dt><samp class="option">codec</samp></dt>
  41709. <dd><p>Use specified codec instead of snow.
  41710. </p></dd>
  41711. </dl>
  41712. </div>
  41713. <div class="section-level-extent" id="v360">
  41714. <h3 class="section"><span>30.272 v360<a class="copiable-link" href="#v360"> &para;</a></span></h3>
  41715. <p>Convert 360 videos between various formats.
  41716. </p>
  41717. <p>The filter accepts the following options:
  41718. </p>
  41719. <dl class="table">
  41720. <dt><samp class="option">input</samp></dt>
  41721. <dt><samp class="option">output</samp></dt>
  41722. <dd><p>Set format of the input/output video.
  41723. </p>
  41724. <p>Available formats:
  41725. </p>
  41726. <dl class="table">
  41727. <dt>&lsquo;<samp class="samp">e</samp>&rsquo;</dt>
  41728. <dt>&lsquo;<samp class="samp">equirect</samp>&rsquo;</dt>
  41729. <dd><p>Equirectangular projection.
  41730. </p>
  41731. </dd>
  41732. <dt>&lsquo;<samp class="samp">c3x2</samp>&rsquo;</dt>
  41733. <dt>&lsquo;<samp class="samp">c6x1</samp>&rsquo;</dt>
  41734. <dt>&lsquo;<samp class="samp">c1x6</samp>&rsquo;</dt>
  41735. <dd><p>Cubemap with 3x2/6x1/1x6 layout.
  41736. </p>
  41737. <p>Format specific options:
  41738. </p>
  41739. <dl class="table">
  41740. <dt><samp class="option">in_pad</samp></dt>
  41741. <dt><samp class="option">out_pad</samp></dt>
  41742. <dd><p>Set padding proportion for the input/output cubemap. Values in decimals.
  41743. </p>
  41744. <p>Example values:
  41745. </p><dl class="table">
  41746. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  41747. <dd><p>No padding.
  41748. </p></dd>
  41749. <dt>&lsquo;<samp class="samp">0.01</samp>&rsquo;</dt>
  41750. <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)
  41751. </p></dd>
  41752. </dl>
  41753. <p>Default value is <b class="b">&lsquo;<samp class="samp">0</samp>&rsquo;</b>.
  41754. Maximum value is <b class="b">&lsquo;<samp class="samp">0.1</samp>&rsquo;</b>.
  41755. </p>
  41756. </dd>
  41757. <dt><samp class="option">fin_pad</samp></dt>
  41758. <dt><samp class="option">fout_pad</samp></dt>
  41759. <dd><p>Set fixed padding for the input/output cubemap. Values in pixels.
  41760. </p>
  41761. <p>Default value is <b class="b">&lsquo;<samp class="samp">0</samp>&rsquo;</b>. If greater than zero it overrides other padding options.
  41762. </p>
  41763. </dd>
  41764. <dt><samp class="option">in_forder</samp></dt>
  41765. <dt><samp class="option">out_forder</samp></dt>
  41766. <dd><p>Set order of faces for the input/output cubemap. Choose one direction for each position.
  41767. </p>
  41768. <p>Designation of directions:
  41769. </p><dl class="table">
  41770. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  41771. <dd><p>right
  41772. </p></dd>
  41773. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  41774. <dd><p>left
  41775. </p></dd>
  41776. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  41777. <dd><p>up
  41778. </p></dd>
  41779. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  41780. <dd><p>down
  41781. </p></dd>
  41782. <dt>&lsquo;<samp class="samp">f</samp>&rsquo;</dt>
  41783. <dd><p>forward
  41784. </p></dd>
  41785. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  41786. <dd><p>back
  41787. </p></dd>
  41788. </dl>
  41789. <p>Default value is <b class="b">&lsquo;<samp class="samp">rludfb</samp>&rsquo;</b>.
  41790. </p>
  41791. </dd>
  41792. <dt><samp class="option">in_frot</samp></dt>
  41793. <dt><samp class="option">out_frot</samp></dt>
  41794. <dd><p>Set rotation of faces for the input/output cubemap. Choose one angle for each position.
  41795. </p>
  41796. <p>Designation of angles:
  41797. </p><dl class="table">
  41798. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  41799. <dd><p>0 degrees clockwise
  41800. </p></dd>
  41801. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  41802. <dd><p>90 degrees clockwise
  41803. </p></dd>
  41804. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  41805. <dd><p>180 degrees clockwise
  41806. </p></dd>
  41807. <dt>&lsquo;<samp class="samp">3</samp>&rsquo;</dt>
  41808. <dd><p>270 degrees clockwise
  41809. </p></dd>
  41810. </dl>
  41811. <p>Default value is <b class="b">&lsquo;<samp class="samp">000000</samp>&rsquo;</b>.
  41812. </p></dd>
  41813. </dl>
  41814. </dd>
  41815. <dt>&lsquo;<samp class="samp">eac</samp>&rsquo;</dt>
  41816. <dd><p>Equi-Angular Cubemap.
  41817. </p>
  41818. </dd>
  41819. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  41820. <dt>&lsquo;<samp class="samp">gnomonic</samp>&rsquo;</dt>
  41821. <dt>&lsquo;<samp class="samp">rectilinear</samp>&rsquo;</dt>
  41822. <dd><p>Regular video.
  41823. </p>
  41824. <p>Format specific options:
  41825. </p><dl class="table">
  41826. <dt><samp class="option">h_fov</samp></dt>
  41827. <dt><samp class="option">v_fov</samp></dt>
  41828. <dt><samp class="option">d_fov</samp></dt>
  41829. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  41830. </p>
  41831. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41832. </p>
  41833. </dd>
  41834. <dt><samp class="option">ih_fov</samp></dt>
  41835. <dt><samp class="option">iv_fov</samp></dt>
  41836. <dt><samp class="option">id_fov</samp></dt>
  41837. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  41838. </p>
  41839. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41840. </p></dd>
  41841. </dl>
  41842. </dd>
  41843. <dt>&lsquo;<samp class="samp">dfisheye</samp>&rsquo;</dt>
  41844. <dd><p>Dual fisheye.
  41845. </p>
  41846. <p>Format specific options:
  41847. </p><dl class="table">
  41848. <dt><samp class="option">h_fov</samp></dt>
  41849. <dt><samp class="option">v_fov</samp></dt>
  41850. <dt><samp class="option">d_fov</samp></dt>
  41851. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  41852. </p>
  41853. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41854. </p>
  41855. </dd>
  41856. <dt><samp class="option">ih_fov</samp></dt>
  41857. <dt><samp class="option">iv_fov</samp></dt>
  41858. <dt><samp class="option">id_fov</samp></dt>
  41859. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  41860. </p>
  41861. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41862. </p></dd>
  41863. </dl>
  41864. </dd>
  41865. <dt>&lsquo;<samp class="samp">barrel</samp>&rsquo;</dt>
  41866. <dt>&lsquo;<samp class="samp">fb</samp>&rsquo;</dt>
  41867. <dt>&lsquo;<samp class="samp">barrelsplit</samp>&rsquo;</dt>
  41868. <dd><p>Facebook&rsquo;s 360 formats.
  41869. </p>
  41870. </dd>
  41871. <dt>&lsquo;<samp class="samp">sg</samp>&rsquo;</dt>
  41872. <dd><p>Stereographic format.
  41873. </p>
  41874. <p>Format specific options:
  41875. </p><dl class="table">
  41876. <dt><samp class="option">h_fov</samp></dt>
  41877. <dt><samp class="option">v_fov</samp></dt>
  41878. <dt><samp class="option">d_fov</samp></dt>
  41879. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  41880. </p>
  41881. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41882. </p>
  41883. </dd>
  41884. <dt><samp class="option">ih_fov</samp></dt>
  41885. <dt><samp class="option">iv_fov</samp></dt>
  41886. <dt><samp class="option">id_fov</samp></dt>
  41887. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  41888. </p>
  41889. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41890. </p></dd>
  41891. </dl>
  41892. </dd>
  41893. <dt>&lsquo;<samp class="samp">mercator</samp>&rsquo;</dt>
  41894. <dd><p>Mercator format.
  41895. </p>
  41896. </dd>
  41897. <dt>&lsquo;<samp class="samp">ball</samp>&rsquo;</dt>
  41898. <dd><p>Ball format, gives significant distortion toward the back.
  41899. </p>
  41900. </dd>
  41901. <dt>&lsquo;<samp class="samp">hammer</samp>&rsquo;</dt>
  41902. <dd><p>Hammer-Aitoff map projection format.
  41903. </p>
  41904. </dd>
  41905. <dt>&lsquo;<samp class="samp">sinusoidal</samp>&rsquo;</dt>
  41906. <dd><p>Sinusoidal map projection format.
  41907. </p>
  41908. </dd>
  41909. <dt>&lsquo;<samp class="samp">fisheye</samp>&rsquo;</dt>
  41910. <dd><p>Fisheye projection.
  41911. </p>
  41912. <p>Format specific options:
  41913. </p><dl class="table">
  41914. <dt><samp class="option">h_fov</samp></dt>
  41915. <dt><samp class="option">v_fov</samp></dt>
  41916. <dt><samp class="option">d_fov</samp></dt>
  41917. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  41918. </p>
  41919. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41920. </p>
  41921. </dd>
  41922. <dt><samp class="option">ih_fov</samp></dt>
  41923. <dt><samp class="option">iv_fov</samp></dt>
  41924. <dt><samp class="option">id_fov</samp></dt>
  41925. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  41926. </p>
  41927. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41928. </p></dd>
  41929. </dl>
  41930. </dd>
  41931. <dt>&lsquo;<samp class="samp">pannini</samp>&rsquo;</dt>
  41932. <dd><p>Pannini projection.
  41933. </p>
  41934. <p>Format specific options:
  41935. </p><dl class="table">
  41936. <dt><samp class="option">h_fov</samp></dt>
  41937. <dd><p>Set output pannini parameter.
  41938. </p>
  41939. </dd>
  41940. <dt><samp class="option">ih_fov</samp></dt>
  41941. <dd><p>Set input pannini parameter.
  41942. </p></dd>
  41943. </dl>
  41944. </dd>
  41945. <dt>&lsquo;<samp class="samp">cylindrical</samp>&rsquo;</dt>
  41946. <dd><p>Cylindrical projection.
  41947. </p>
  41948. <p>Format specific options:
  41949. </p><dl class="table">
  41950. <dt><samp class="option">h_fov</samp></dt>
  41951. <dt><samp class="option">v_fov</samp></dt>
  41952. <dt><samp class="option">d_fov</samp></dt>
  41953. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  41954. </p>
  41955. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41956. </p>
  41957. </dd>
  41958. <dt><samp class="option">ih_fov</samp></dt>
  41959. <dt><samp class="option">iv_fov</samp></dt>
  41960. <dt><samp class="option">id_fov</samp></dt>
  41961. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  41962. </p>
  41963. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41964. </p></dd>
  41965. </dl>
  41966. </dd>
  41967. <dt>&lsquo;<samp class="samp">perspective</samp>&rsquo;</dt>
  41968. <dd><p>Perspective projection. <i class="i">(output only)</i>
  41969. </p>
  41970. <p>Format specific options:
  41971. </p><dl class="table">
  41972. <dt><samp class="option">v_fov</samp></dt>
  41973. <dd><p>Set perspective parameter.
  41974. </p></dd>
  41975. </dl>
  41976. </dd>
  41977. <dt>&lsquo;<samp class="samp">tetrahedron</samp>&rsquo;</dt>
  41978. <dd><p>Tetrahedron projection.
  41979. </p>
  41980. </dd>
  41981. <dt>&lsquo;<samp class="samp">tsp</samp>&rsquo;</dt>
  41982. <dd><p>Truncated square pyramid projection.
  41983. </p>
  41984. </dd>
  41985. <dt>&lsquo;<samp class="samp">he</samp>&rsquo;</dt>
  41986. <dt>&lsquo;<samp class="samp">hequirect</samp>&rsquo;</dt>
  41987. <dd><p>Half equirectangular projection.
  41988. </p>
  41989. </dd>
  41990. <dt>&lsquo;<samp class="samp">equisolid</samp>&rsquo;</dt>
  41991. <dd><p>Equisolid format.
  41992. </p>
  41993. <p>Format specific options:
  41994. </p><dl class="table">
  41995. <dt><samp class="option">h_fov</samp></dt>
  41996. <dt><samp class="option">v_fov</samp></dt>
  41997. <dt><samp class="option">d_fov</samp></dt>
  41998. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  41999. </p>
  42000. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42001. </p>
  42002. </dd>
  42003. <dt><samp class="option">ih_fov</samp></dt>
  42004. <dt><samp class="option">iv_fov</samp></dt>
  42005. <dt><samp class="option">id_fov</samp></dt>
  42006. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  42007. </p>
  42008. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42009. </p></dd>
  42010. </dl>
  42011. </dd>
  42012. <dt>&lsquo;<samp class="samp">og</samp>&rsquo;</dt>
  42013. <dd><p>Orthographic format.
  42014. </p>
  42015. <p>Format specific options:
  42016. </p><dl class="table">
  42017. <dt><samp class="option">h_fov</samp></dt>
  42018. <dt><samp class="option">v_fov</samp></dt>
  42019. <dt><samp class="option">d_fov</samp></dt>
  42020. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  42021. </p>
  42022. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42023. </p>
  42024. </dd>
  42025. <dt><samp class="option">ih_fov</samp></dt>
  42026. <dt><samp class="option">iv_fov</samp></dt>
  42027. <dt><samp class="option">id_fov</samp></dt>
  42028. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  42029. </p>
  42030. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42031. </p></dd>
  42032. </dl>
  42033. </dd>
  42034. <dt>&lsquo;<samp class="samp">octahedron</samp>&rsquo;</dt>
  42035. <dd><p>Octahedron projection.
  42036. </p>
  42037. </dd>
  42038. <dt>&lsquo;<samp class="samp">cylindricalea</samp>&rsquo;</dt>
  42039. <dd><p>Cylindrical Equal Area projection.
  42040. </p></dd>
  42041. </dl>
  42042. </dd>
  42043. <dt><samp class="option">interp</samp></dt>
  42044. <dd><p>Set interpolation method.<br>
  42045. <i class="i">Note: more complex interpolation methods require much more memory to run.</i>
  42046. </p>
  42047. <p>Available methods:
  42048. </p>
  42049. <dl class="table">
  42050. <dt>&lsquo;<samp class="samp">near</samp>&rsquo;</dt>
  42051. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  42052. <dd><p>Nearest neighbour.
  42053. </p></dd>
  42054. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  42055. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  42056. <dd><p>Bilinear interpolation.
  42057. </p></dd>
  42058. <dt>&lsquo;<samp class="samp">lagrange9</samp>&rsquo;</dt>
  42059. <dd><p>Lagrange9 interpolation.
  42060. </p></dd>
  42061. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  42062. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  42063. <dd><p>Bicubic interpolation.
  42064. </p></dd>
  42065. <dt>&lsquo;<samp class="samp">lanc</samp>&rsquo;</dt>
  42066. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  42067. <dd><p>Lanczos interpolation.
  42068. </p></dd>
  42069. <dt>&lsquo;<samp class="samp">sp16</samp>&rsquo;</dt>
  42070. <dt>&lsquo;<samp class="samp">spline16</samp>&rsquo;</dt>
  42071. <dd><p>Spline16 interpolation.
  42072. </p></dd>
  42073. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  42074. <dt>&lsquo;<samp class="samp">gaussian</samp>&rsquo;</dt>
  42075. <dd><p>Gaussian interpolation.
  42076. </p></dd>
  42077. <dt>&lsquo;<samp class="samp">mitchell</samp>&rsquo;</dt>
  42078. <dd><p>Mitchell interpolation.
  42079. </p></dd>
  42080. </dl>
  42081. <p>Default value is <b class="b">&lsquo;<samp class="samp">line</samp>&rsquo;</b>.
  42082. </p>
  42083. </dd>
  42084. <dt><samp class="option">w</samp></dt>
  42085. <dt><samp class="option">h</samp></dt>
  42086. <dd><p>Set the output video resolution.
  42087. </p>
  42088. <p>Default resolution depends on formats.
  42089. </p>
  42090. </dd>
  42091. <dt><samp class="option">in_stereo</samp></dt>
  42092. <dt><samp class="option">out_stereo</samp></dt>
  42093. <dd><p>Set the input/output stereo format.
  42094. </p>
  42095. <dl class="table">
  42096. <dt>&lsquo;<samp class="samp">2d</samp>&rsquo;</dt>
  42097. <dd><p>2D mono
  42098. </p></dd>
  42099. <dt>&lsquo;<samp class="samp">sbs</samp>&rsquo;</dt>
  42100. <dd><p>Side by side
  42101. </p></dd>
  42102. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  42103. <dd><p>Top bottom
  42104. </p></dd>
  42105. </dl>
  42106. <p>Default value is <b class="b">&lsquo;<samp class="samp">2d</samp>&rsquo;</b> for input and output format.
  42107. </p>
  42108. </dd>
  42109. <dt><samp class="option">yaw</samp></dt>
  42110. <dt><samp class="option">pitch</samp></dt>
  42111. <dt><samp class="option">roll</samp></dt>
  42112. <dd><p>Set rotation for the output video. Values in degrees.
  42113. </p>
  42114. </dd>
  42115. <dt><samp class="option">rorder</samp></dt>
  42116. <dd><p>Set rotation order for the output video. Choose one item for each position.
  42117. </p>
  42118. <dl class="table">
  42119. <dt>&lsquo;<samp class="samp">y, Y</samp>&rsquo;</dt>
  42120. <dd><p>yaw
  42121. </p></dd>
  42122. <dt>&lsquo;<samp class="samp">p, P</samp>&rsquo;</dt>
  42123. <dd><p>pitch
  42124. </p></dd>
  42125. <dt>&lsquo;<samp class="samp">r, R</samp>&rsquo;</dt>
  42126. <dd><p>roll
  42127. </p></dd>
  42128. </dl>
  42129. <p>Default value is <b class="b">&lsquo;<samp class="samp">ypr</samp>&rsquo;</b>.
  42130. </p>
  42131. </dd>
  42132. <dt><samp class="option">h_flip</samp></dt>
  42133. <dt><samp class="option">v_flip</samp></dt>
  42134. <dt><samp class="option">d_flip</samp></dt>
  42135. <dd><p>Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values.
  42136. </p>
  42137. </dd>
  42138. <dt><samp class="option">ih_flip</samp></dt>
  42139. <dt><samp class="option">iv_flip</samp></dt>
  42140. <dd><p>Set if input video is flipped horizontally/vertically. Boolean values.
  42141. </p>
  42142. </dd>
  42143. <dt><samp class="option">in_trans</samp></dt>
  42144. <dd><p>Set if input video is transposed. Boolean value, by default disabled.
  42145. </p>
  42146. </dd>
  42147. <dt><samp class="option">out_trans</samp></dt>
  42148. <dd><p>Set if output video needs to be transposed. Boolean value, by default disabled.
  42149. </p>
  42150. </dd>
  42151. <dt><samp class="option">h_offset</samp></dt>
  42152. <dt><samp class="option">v_offset</samp></dt>
  42153. <dd><p>Set output horizontal/vertical off-axis offset. Default is set to 0.
  42154. Allowed range is from -1 to 1.
  42155. </p>
  42156. </dd>
  42157. <dt><samp class="option">alpha_mask</samp></dt>
  42158. <dd><p>Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled.
  42159. </p>
  42160. </dd>
  42161. <dt><samp class="option">reset_rot</samp></dt>
  42162. <dd><p>Reset rotation of output video. Boolean value, by default disabled.
  42163. </p></dd>
  42164. </dl>
  42165. <ul class="mini-toc">
  42166. <li><a href="#Examples-151" accesskey="1">Examples</a></li>
  42167. <li><a href="#Commands-150" accesskey="2">Commands</a></li>
  42168. </ul>
  42169. <div class="subsection-level-extent" id="Examples-151">
  42170. <h4 class="subsection"><span>30.272.1 Examples<a class="copiable-link" href="#Examples-151"> &para;</a></span></h4>
  42171. <ul class="itemize mark-bullet">
  42172. <li>Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation:
  42173. <div class="example">
  42174. <pre class="example-preformatted">ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
  42175. </pre></div>
  42176. </li><li>Extract back view of Equi-Angular Cubemap:
  42177. <div class="example">
  42178. <pre class="example-preformatted">ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
  42179. </pre></div>
  42180. </li><li>Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format:
  42181. <div class="example">
  42182. <pre class="example-preformatted">v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
  42183. </pre></div>
  42184. </li></ul>
  42185. </div>
  42186. <div class="subsection-level-extent" id="Commands-150">
  42187. <h4 class="subsection"><span>30.272.2 Commands<a class="copiable-link" href="#Commands-150"> &para;</a></span></h4>
  42188. <p>This filter supports subset of above options as <a class="ref" href="#commands">commands</a>.
  42189. </p>
  42190. </div>
  42191. </div>
  42192. <div class="section-level-extent" id="vaguedenoiser">
  42193. <h3 class="section"><span>30.273 vaguedenoiser<a class="copiable-link" href="#vaguedenoiser"> &para;</a></span></h3>
  42194. <p>Apply a wavelet based denoiser.
  42195. </p>
  42196. <p>It transforms each frame from the video input into the wavelet domain,
  42197. using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to
  42198. the obtained coefficients. It does an inverse wavelet transform after.
  42199. Due to wavelet properties, it should give a nice smoothed result, and
  42200. reduced noise, without blurring picture features.
  42201. </p>
  42202. <p>This filter accepts the following options:
  42203. </p>
  42204. <dl class="table">
  42205. <dt><samp class="option">threshold</samp></dt>
  42206. <dd><p>The filtering strength. The higher, the more filtered the video will be.
  42207. Hard thresholding can use a higher threshold than soft thresholding
  42208. before the video looks overfiltered. Default value is 2.
  42209. </p>
  42210. </dd>
  42211. <dt><samp class="option">method</samp></dt>
  42212. <dd><p>The filtering method the filter will use.
  42213. </p>
  42214. <p>It accepts the following values:
  42215. </p><dl class="table">
  42216. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  42217. <dd><p>All values under the threshold will be zeroed.
  42218. </p>
  42219. </dd>
  42220. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  42221. <dd><p>All values under the threshold will be zeroed. All values above will be
  42222. reduced by the threshold.
  42223. </p>
  42224. </dd>
  42225. <dt>&lsquo;<samp class="samp">garrote</samp>&rsquo;</dt>
  42226. <dd><p>Scales or nullifies coefficients - intermediary between (more) soft and
  42227. (less) hard thresholding.
  42228. </p></dd>
  42229. </dl>
  42230. <p>Default is garrote.
  42231. </p>
  42232. </dd>
  42233. <dt><samp class="option">nsteps</samp></dt>
  42234. <dd><p>Number of times, the wavelet will decompose the picture. Picture can&rsquo;t
  42235. be decomposed beyond a particular point (typically, 8 for a 640x480
  42236. frame - as 2^9 = 512 &gt; 480). Valid values are integers between 1 and 32. Default value is 6.
  42237. </p>
  42238. </dd>
  42239. <dt><samp class="option">percent</samp></dt>
  42240. <dd><p>Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85.
  42241. </p>
  42242. </dd>
  42243. <dt><samp class="option">planes</samp></dt>
  42244. <dd><p>A list of the planes to process. By default all planes are processed.
  42245. </p>
  42246. </dd>
  42247. <dt><samp class="option">type</samp></dt>
  42248. <dd><p>The threshold type the filter will use.
  42249. </p>
  42250. <p>It accepts the following values:
  42251. </p><dl class="table">
  42252. <dt>&lsquo;<samp class="samp">universal</samp>&rsquo;</dt>
  42253. <dd><p>Threshold used is same for all decompositions.
  42254. </p>
  42255. </dd>
  42256. <dt>&lsquo;<samp class="samp">bayes</samp>&rsquo;</dt>
  42257. <dd><p>Threshold used depends also on each decomposition coefficients.
  42258. </p></dd>
  42259. </dl>
  42260. <p>Default is universal.
  42261. </p></dd>
  42262. </dl>
  42263. </div>
  42264. <div class="section-level-extent" id="varblur">
  42265. <h3 class="section"><span>30.274 varblur<a class="copiable-link" href="#varblur"> &para;</a></span></h3>
  42266. <p>Apply variable blur filter by using 2nd video stream to set blur radius.
  42267. The 2nd stream must have the same dimensions.
  42268. </p>
  42269. <p>This filter accepts the following options:
  42270. </p>
  42271. <dl class="table">
  42272. <dt><samp class="option">min_r</samp></dt>
  42273. <dd><p>Set min allowed radius. Allowed range is from 0 to 254. Default is 0.
  42274. </p></dd>
  42275. <dt><samp class="option">max_r</samp></dt>
  42276. <dd><p>Set max allowed radius. Allowed range is from 1 to 255. Default is 8.
  42277. </p></dd>
  42278. <dt><samp class="option">planes</samp></dt>
  42279. <dd><p>Set which planes to process. By default, all are used.
  42280. </p></dd>
  42281. </dl>
  42282. <p>The <code class="code">varblur</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  42283. </p>
  42284. <ul class="mini-toc">
  42285. <li><a href="#Commands-151" accesskey="1">Commands</a></li>
  42286. </ul>
  42287. <div class="subsection-level-extent" id="Commands-151">
  42288. <h4 class="subsection"><span>30.274.1 Commands<a class="copiable-link" href="#Commands-151"> &para;</a></span></h4>
  42289. <p>This filter supports all the above options as <a class="ref" href="#commands">commands</a>.
  42290. </p>
  42291. </div>
  42292. </div>
  42293. <div class="section-level-extent" id="vectorscope">
  42294. <h3 class="section"><span>30.275 vectorscope<a class="copiable-link" href="#vectorscope"> &para;</a></span></h3>
  42295. <p>Display 2 color component values in the two dimensional graph (which is called
  42296. a vectorscope).
  42297. </p>
  42298. <p>This filter accepts the following options:
  42299. </p>
  42300. <dl class="table">
  42301. <dt><samp class="option">mode, m</samp></dt>
  42302. <dd><p>Set vectorscope mode.
  42303. </p>
  42304. <p>It accepts the following values:
  42305. </p><dl class="table">
  42306. <dt>&lsquo;<samp class="samp">gray</samp>&rsquo;</dt>
  42307. <dt>&lsquo;<samp class="samp">tint</samp>&rsquo;</dt>
  42308. <dd><p>Gray values are displayed on graph, higher brightness means more pixels have
  42309. same component color value on location in graph. This is the default mode.
  42310. </p>
  42311. </dd>
  42312. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  42313. <dd><p>Gray values are displayed on graph. Surrounding pixels values which are not
  42314. present in video frame are drawn in gradient of 2 color components which are
  42315. set by option <code class="code">x</code> and <code class="code">y</code>. The 3rd color component is static.
  42316. </p>
  42317. </dd>
  42318. <dt>&lsquo;<samp class="samp">color2</samp>&rsquo;</dt>
  42319. <dd><p>Actual color components values present in video frame are displayed on graph.
  42320. </p>
  42321. </dd>
  42322. <dt>&lsquo;<samp class="samp">color3</samp>&rsquo;</dt>
  42323. <dd><p>Similar as color2 but higher frequency of same values <code class="code">x</code> and <code class="code">y</code>
  42324. on graph increases value of another color component, which is luminance by
  42325. default values of <code class="code">x</code> and <code class="code">y</code>.
  42326. </p>
  42327. </dd>
  42328. <dt>&lsquo;<samp class="samp">color4</samp>&rsquo;</dt>
  42329. <dd><p>Actual colors present in video frame are displayed on graph. If two different
  42330. colors map to same position on graph then color with higher value of component
  42331. not present in graph is picked.
  42332. </p>
  42333. </dd>
  42334. <dt>&lsquo;<samp class="samp">color5</samp>&rsquo;</dt>
  42335. <dd><p>Gray values are displayed on graph. Similar to <code class="code">color</code> but with 3rd color
  42336. component picked from radial gradient.
  42337. </p></dd>
  42338. </dl>
  42339. </dd>
  42340. <dt><samp class="option">x</samp></dt>
  42341. <dd><p>Set which color component will be represented on X-axis. Default is <code class="code">1</code>.
  42342. </p>
  42343. </dd>
  42344. <dt><samp class="option">y</samp></dt>
  42345. <dd><p>Set which color component will be represented on Y-axis. Default is <code class="code">2</code>.
  42346. </p>
  42347. </dd>
  42348. <dt><samp class="option">intensity, i</samp></dt>
  42349. <dd><p>Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness
  42350. of color component which represents frequency of (X, Y) location in graph.
  42351. </p>
  42352. </dd>
  42353. <dt><samp class="option">envelope, e</samp></dt>
  42354. <dd><dl class="table">
  42355. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  42356. <dd><p>No envelope, this is default.
  42357. </p>
  42358. </dd>
  42359. <dt>&lsquo;<samp class="samp">instant</samp>&rsquo;</dt>
  42360. <dd><p>Instant envelope, even darkest single pixel will be clearly highlighted.
  42361. </p>
  42362. </dd>
  42363. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  42364. <dd><p>Hold maximum and minimum values presented in graph over time. This way you
  42365. can still spot out of range values without constantly looking at vectorscope.
  42366. </p>
  42367. </dd>
  42368. <dt>&lsquo;<samp class="samp">peak+instant</samp>&rsquo;</dt>
  42369. <dd><p>Peak and instant envelope combined together.
  42370. </p></dd>
  42371. </dl>
  42372. </dd>
  42373. <dt><samp class="option">graticule, g</samp></dt>
  42374. <dd><p>Set what kind of graticule to draw.
  42375. </p><dl class="table">
  42376. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  42377. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  42378. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  42379. <dt>&lsquo;<samp class="samp">invert</samp>&rsquo;</dt>
  42380. </dl>
  42381. </dd>
  42382. <dt><samp class="option">opacity, o</samp></dt>
  42383. <dd><p>Set graticule opacity.
  42384. </p>
  42385. </dd>
  42386. <dt><samp class="option">flags, f</samp></dt>
  42387. <dd><p>Set graticule flags.
  42388. </p>
  42389. <dl class="table">
  42390. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  42391. <dd><p>Draw graticule for white point.
  42392. </p>
  42393. </dd>
  42394. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  42395. <dd><p>Draw graticule for black point.
  42396. </p>
  42397. </dd>
  42398. <dt>&lsquo;<samp class="samp">name</samp>&rsquo;</dt>
  42399. <dd><p>Draw color points short names.
  42400. </p></dd>
  42401. </dl>
  42402. </dd>
  42403. <dt><samp class="option">bgopacity, b</samp></dt>
  42404. <dd><p>Set background opacity.
  42405. </p>
  42406. </dd>
  42407. <dt><samp class="option">lthreshold, l</samp></dt>
  42408. <dd><p>Set low threshold for color component not represented on X or Y axis.
  42409. Values lower than this value will be ignored. Default is 0.
  42410. Note this value is multiplied with actual max possible value one pixel component
  42411. can have. So for 8-bit input and low threshold value of 0.1 actual threshold
  42412. is 0.1 * 255 = 25.
  42413. </p>
  42414. </dd>
  42415. <dt><samp class="option">hthreshold, h</samp></dt>
  42416. <dd><p>Set high threshold for color component not represented on X or Y axis.
  42417. Values higher than this value will be ignored. Default is 1.
  42418. Note this value is multiplied with actual max possible value one pixel component
  42419. can have. So for 8-bit input and high threshold value of 0.9 actual threshold
  42420. is 0.9 * 255 = 230.
  42421. </p>
  42422. </dd>
  42423. <dt><samp class="option">colorspace, c</samp></dt>
  42424. <dd><p>Set what kind of colorspace to use when drawing graticule.
  42425. </p><dl class="table">
  42426. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  42427. <dt>&lsquo;<samp class="samp">601</samp>&rsquo;</dt>
  42428. <dt>&lsquo;<samp class="samp">709</samp>&rsquo;</dt>
  42429. </dl>
  42430. <p>Default is auto.
  42431. </p>
  42432. </dd>
  42433. <dt><samp class="option">tint0, t0</samp></dt>
  42434. <dt><samp class="option">tint1, t1</samp></dt>
  42435. <dd><p>Set color tint for gray/tint vectorscope mode. By default both options are zero.
  42436. This means no tint, and output will remain gray.
  42437. </p></dd>
  42438. </dl>
  42439. <a class="anchor" id="vidstabdetect"></a></div>
  42440. <div class="section-level-extent" id="vidstabdetect-1">
  42441. <h3 class="section"><span>30.276 vidstabdetect<a class="copiable-link" href="#vidstabdetect-1"> &para;</a></span></h3>
  42442. <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
  42443. <a class="ref" href="#vidstabtransform">vidstabtransform</a> for pass 2.
  42444. </p>
  42445. <p>This filter generates a file with relative translation and rotation
  42446. transform information about subsequent frames, which is then used by
  42447. the <a class="ref" href="#vidstabtransform">vidstabtransform</a> filter.
  42448. </p>
  42449. <p>To enable compilation of this filter you need to configure FFmpeg with
  42450. <code class="code">--enable-libvidstab</code>.
  42451. </p>
  42452. <p>This filter accepts the following options:
  42453. </p>
  42454. <dl class="table">
  42455. <dt><samp class="option">result</samp></dt>
  42456. <dd><p>Set the path to the file used to write the transforms information.
  42457. Default value is <samp class="file">transforms.trf</samp>.
  42458. </p>
  42459. </dd>
  42460. <dt><samp class="option">shakiness</samp></dt>
  42461. <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
  42462. integer in the range 1-10, a value of 1 means little shakiness, a
  42463. value of 10 means strong shakiness. Default value is 5.
  42464. </p>
  42465. </dd>
  42466. <dt><samp class="option">accuracy</samp></dt>
  42467. <dd><p>Set the accuracy of the detection process. It must be a value in the
  42468. range 1-15. A value of 1 means low accuracy, a value of 15 means high
  42469. accuracy. Default value is 15.
  42470. </p>
  42471. </dd>
  42472. <dt><samp class="option">stepsize</samp></dt>
  42473. <dd><p>Set stepsize of the search process. The region around minimum is
  42474. scanned with 1 pixel resolution. Default value is 6.
  42475. </p>
  42476. </dd>
  42477. <dt><samp class="option">mincontrast</samp></dt>
  42478. <dd><p>Set minimum contrast. Below this value a local measurement field is
  42479. discarded. Must be a floating point value in the range 0-1. Default
  42480. value is 0.3.
  42481. </p>
  42482. </dd>
  42483. <dt><samp class="option">tripod</samp></dt>
  42484. <dd><p>Set reference frame number for tripod mode.
  42485. </p>
  42486. <p>If enabled, the motion of the frames is compared to a reference frame
  42487. in the filtered stream, identified by the specified number. The idea
  42488. is to compensate all movements in a more-or-less static scene and keep
  42489. the camera view absolutely still.
  42490. </p>
  42491. <p>If set to 0, it is disabled. The frames are counted starting from 1.
  42492. </p>
  42493. </dd>
  42494. <dt><samp class="option">show</samp></dt>
  42495. <dd><p>Show fields and transforms in the resulting frames. It accepts an
  42496. integer in the range 0-2. Default value is 0, which disables any
  42497. visualization.
  42498. </p>
  42499. </dd>
  42500. <dt><samp class="option">fileformat</samp></dt>
  42501. <dd><p>Format for the transforms data file to be written.
  42502. Acceptable values are
  42503. </p>
  42504. <dl class="table">
  42505. <dt>&lsquo;<samp class="samp">ascii</samp>&rsquo;</dt>
  42506. <dd><p>Human-readable plain text
  42507. </p>
  42508. </dd>
  42509. <dt>&lsquo;<samp class="samp">binary</samp>&rsquo;</dt>
  42510. <dd><p>Binary format, roughly 40% smaller than <code class="code">ascii</code>. (<em class="emph">default</em>)
  42511. </p></dd>
  42512. </dl>
  42513. </dd>
  42514. </dl>
  42515. <ul class="mini-toc">
  42516. <li><a href="#Examples-152" accesskey="1">Examples</a></li>
  42517. </ul>
  42518. <div class="subsection-level-extent" id="Examples-152">
  42519. <h4 class="subsection"><span>30.276.1 Examples<a class="copiable-link" href="#Examples-152"> &para;</a></span></h4>
  42520. <ul class="itemize mark-bullet">
  42521. <li>Use default values:
  42522. <div class="example">
  42523. <pre class="example-preformatted">vidstabdetect
  42524. </pre></div>
  42525. </li><li>Analyze strongly shaky movie and put the results in file
  42526. <samp class="file">mytransforms.trf</samp>:
  42527. <div class="example">
  42528. <pre class="example-preformatted">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
  42529. </pre></div>
  42530. </li><li>Visualize the result of internal transformations in the resulting
  42531. video:
  42532. <div class="example">
  42533. <pre class="example-preformatted">vidstabdetect=show=1
  42534. </pre></div>
  42535. </li><li>Analyze a video with medium shakiness using <code class="command">ffmpeg</code>:
  42536. <div class="example">
  42537. <pre class="example-preformatted">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
  42538. </pre></div>
  42539. </li></ul>
  42540. <a class="anchor" id="vidstabtransform"></a></div>
  42541. </div>
  42542. <div class="section-level-extent" id="vidstabtransform-1">
  42543. <h3 class="section"><span>30.277 vidstabtransform<a class="copiable-link" href="#vidstabtransform-1"> &para;</a></span></h3>
  42544. <p>Video stabilization/deshaking: pass 2 of 2,
  42545. see <a class="ref" href="#vidstabdetect">vidstabdetect</a> for pass 1.
  42546. </p>
  42547. <p>Read a file with transform information for each frame and
  42548. apply/compensate them. Together with the <a class="ref" href="#vidstabdetect">vidstabdetect</a>
  42549. filter this can be used to deshake videos. See also
  42550. <a class="url" href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
  42551. the <a class="ref" href="#unsharp">unsharp</a> filter, see below.
  42552. </p>
  42553. <p>To enable compilation of this filter you need to configure FFmpeg with
  42554. <code class="code">--enable-libvidstab</code>.
  42555. </p>
  42556. <ul class="mini-toc">
  42557. <li><a href="#Options-41" accesskey="1">Options</a></li>
  42558. <li><a href="#Examples-153" accesskey="2">Examples</a></li>
  42559. </ul>
  42560. <div class="subsection-level-extent" id="Options-41">
  42561. <h4 class="subsection"><span>30.277.1 Options<a class="copiable-link" href="#Options-41"> &para;</a></span></h4>
  42562. <dl class="table">
  42563. <dt><samp class="option">input</samp></dt>
  42564. <dd><p>Set path to the file used to read the transforms. Default value is
  42565. <samp class="file">transforms.trf</samp>.
  42566. </p>
  42567. </dd>
  42568. <dt><samp class="option">smoothing</samp></dt>
  42569. <dd><p>Set the number of frames (value*2 + 1) used for lowpass filtering the
  42570. camera movements. Default value is 10.
  42571. </p>
  42572. <p>For example a number of 10 means that 21 frames are used (10 in the
  42573. past and 10 in the future) to smoothen the motion in the video. A
  42574. larger value leads to a smoother video, but limits the acceleration of
  42575. the camera (pan/tilt movements). 0 is a special case where a static
  42576. camera is simulated.
  42577. </p>
  42578. </dd>
  42579. <dt><samp class="option">optalgo</samp></dt>
  42580. <dd><p>Set the camera path optimization algorithm.
  42581. </p>
  42582. <p>Accepted values are:
  42583. </p><dl class="table">
  42584. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  42585. <dd><p>gaussian kernel low-pass filter on camera motion (default)
  42586. </p></dd>
  42587. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  42588. <dd><p>averaging on transformations
  42589. </p></dd>
  42590. </dl>
  42591. </dd>
  42592. <dt><samp class="option">maxshift</samp></dt>
  42593. <dd><p>Set maximal number of pixels to translate frames. Default value is -1,
  42594. meaning no limit.
  42595. </p>
  42596. </dd>
  42597. <dt><samp class="option">maxangle</samp></dt>
  42598. <dd><p>Set maximal angle in radians (degree*PI/180) to rotate frames. Default
  42599. value is -1, meaning no limit.
  42600. </p>
  42601. </dd>
  42602. <dt><samp class="option">crop</samp></dt>
  42603. <dd><p>Specify how to deal with borders that may be visible due to movement
  42604. compensation.
  42605. </p>
  42606. <p>Available values are:
  42607. </p><dl class="table">
  42608. <dt>&lsquo;<samp class="samp">keep</samp>&rsquo;</dt>
  42609. <dd><p>keep image information from previous frame (default)
  42610. </p></dd>
  42611. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  42612. <dd><p>fill the border black
  42613. </p></dd>
  42614. </dl>
  42615. </dd>
  42616. <dt><samp class="option">invert</samp></dt>
  42617. <dd><p>Invert transforms if set to 1. Default value is 0.
  42618. </p>
  42619. </dd>
  42620. <dt><samp class="option">relative</samp></dt>
  42621. <dd><p>Consider transforms as relative to previous frame if set to 1,
  42622. absolute if set to 0. Default value is 0.
  42623. </p>
  42624. </dd>
  42625. <dt><samp class="option">zoom</samp></dt>
  42626. <dd><p>Set percentage to zoom. A positive value will result in a zoom-in
  42627. effect, a negative value in a zoom-out effect. Default value is 0 (no
  42628. zoom).
  42629. </p>
  42630. </dd>
  42631. <dt><samp class="option">optzoom</samp></dt>
  42632. <dd><p>Set optimal zooming to avoid borders.
  42633. </p>
  42634. <p>Accepted values are:
  42635. </p><dl class="table">
  42636. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  42637. <dd><p>disabled
  42638. </p></dd>
  42639. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  42640. <dd><p>optimal static zoom value is determined (only very strong movements
  42641. will lead to visible borders) (default)
  42642. </p></dd>
  42643. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  42644. <dd><p>optimal adaptive zoom value is determined (no borders will be
  42645. visible), see <samp class="option">zoomspeed</samp>
  42646. </p></dd>
  42647. </dl>
  42648. <p>Note that the value given at zoom is added to the one calculated here.
  42649. </p>
  42650. </dd>
  42651. <dt><samp class="option">zoomspeed</samp></dt>
  42652. <dd><p>Set percent to zoom maximally each frame (enabled when
  42653. <samp class="option">optzoom</samp> is set to 2). Range is from 0 to 5, default value is
  42654. 0.25.
  42655. </p>
  42656. </dd>
  42657. <dt><samp class="option">interpol</samp></dt>
  42658. <dd><p>Specify type of interpolation.
  42659. </p>
  42660. <p>Available values are:
  42661. </p><dl class="table">
  42662. <dt>&lsquo;<samp class="samp">no</samp>&rsquo;</dt>
  42663. <dd><p>no interpolation
  42664. </p></dd>
  42665. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  42666. <dd><p>linear only horizontal
  42667. </p></dd>
  42668. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  42669. <dd><p>linear in both directions (default)
  42670. </p></dd>
  42671. <dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
  42672. <dd><p>cubic in both directions (slow)
  42673. </p></dd>
  42674. </dl>
  42675. </dd>
  42676. <dt><samp class="option">tripod</samp></dt>
  42677. <dd><p>Enable virtual tripod mode if set to 1, which is equivalent to
  42678. <code class="code">relative=0:smoothing=0</code>. Default value is 0.
  42679. </p>
  42680. <p>Use also <code class="code">tripod</code> option of <a class="ref" href="#vidstabdetect">vidstabdetect</a>.
  42681. </p>
  42682. </dd>
  42683. <dt><samp class="option">debug</samp></dt>
  42684. <dd><p>Increase log verbosity if set to 1. Also the detected global motions
  42685. are written to the temporary file <samp class="file">global_motions.trf</samp>. Default
  42686. value is 0.
  42687. </p></dd>
  42688. </dl>
  42689. </div>
  42690. <div class="subsection-level-extent" id="Examples-153">
  42691. <h4 class="subsection"><span>30.277.2 Examples<a class="copiable-link" href="#Examples-153"> &para;</a></span></h4>
  42692. <ul class="itemize mark-bullet">
  42693. <li>Use <code class="command">ffmpeg</code> for a typical stabilization with default values:
  42694. <div class="example">
  42695. <pre class="example-preformatted">ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
  42696. </pre></div>
  42697. <p>Note the use of the <a class="ref" href="#unsharp">unsharp</a> filter which is always recommended.
  42698. </p>
  42699. </li><li>Zoom in a bit more and load transform data from a given file:
  42700. <div class="example">
  42701. <pre class="example-preformatted">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
  42702. </pre></div>
  42703. </li><li>Smoothen the video even more:
  42704. <div class="example">
  42705. <pre class="example-preformatted">vidstabtransform=smoothing=30
  42706. </pre></div>
  42707. </li></ul>
  42708. </div>
  42709. </div>
  42710. <div class="section-level-extent" id="vflip">
  42711. <h3 class="section"><span>30.278 vflip<a class="copiable-link" href="#vflip"> &para;</a></span></h3>
  42712. <p>Flip the input video vertically.
  42713. </p>
  42714. <p>For example, to vertically flip a video with <code class="command">ffmpeg</code>:
  42715. </p><div class="example">
  42716. <pre class="example-preformatted">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
  42717. </pre></div>
  42718. </div>
  42719. <div class="section-level-extent" id="vfrdet">
  42720. <h3 class="section"><span>30.279 vfrdet<a class="copiable-link" href="#vfrdet"> &para;</a></span></h3>
  42721. <p>Detect variable frame rate video.
  42722. </p>
  42723. <p>This filter tries to detect if the input is variable or constant frame rate.
  42724. </p>
  42725. <p>At end it will output number of frames detected as having variable delta pts,
  42726. and ones with constant delta pts.
  42727. If there was frames with variable delta, than it will also show min, max and
  42728. average delta encountered.
  42729. </p>
  42730. </div>
  42731. <div class="section-level-extent" id="vibrance">
  42732. <h3 class="section"><span>30.280 vibrance<a class="copiable-link" href="#vibrance"> &para;</a></span></h3>
  42733. <p>Boost or alter saturation.
  42734. </p>
  42735. <p>The filter accepts the following options:
  42736. </p><dl class="table">
  42737. <dt><samp class="option">intensity</samp></dt>
  42738. <dd><p>Set strength of boost if positive value or strength of alter if negative value.
  42739. Default is 0. Allowed range is from -2 to 2.
  42740. </p>
  42741. </dd>
  42742. <dt><samp class="option">rbal</samp></dt>
  42743. <dd><p>Set the red balance. Default is 1. Allowed range is from -10 to 10.
  42744. </p>
  42745. </dd>
  42746. <dt><samp class="option">gbal</samp></dt>
  42747. <dd><p>Set the green balance. Default is 1. Allowed range is from -10 to 10.
  42748. </p>
  42749. </dd>
  42750. <dt><samp class="option">bbal</samp></dt>
  42751. <dd><p>Set the blue balance. Default is 1. Allowed range is from -10 to 10.
  42752. </p>
  42753. </dd>
  42754. <dt><samp class="option">rlum</samp></dt>
  42755. <dd><p>Set the red luma coefficient.
  42756. </p>
  42757. </dd>
  42758. <dt><samp class="option">glum</samp></dt>
  42759. <dd><p>Set the green luma coefficient.
  42760. </p>
  42761. </dd>
  42762. <dt><samp class="option">blum</samp></dt>
  42763. <dd><p>Set the blue luma coefficient.
  42764. </p>
  42765. </dd>
  42766. <dt><samp class="option">alternate</samp></dt>
  42767. <dd><p>If <code class="code">intensity</code> is negative and this is set to 1, colors will change,
  42768. otherwise colors will be less saturated, more towards gray.
  42769. </p></dd>
  42770. </dl>
  42771. <ul class="mini-toc">
  42772. <li><a href="#Commands-152" accesskey="1">Commands</a></li>
  42773. </ul>
  42774. <div class="subsection-level-extent" id="Commands-152">
  42775. <h4 class="subsection"><span>30.280.1 Commands<a class="copiable-link" href="#Commands-152"> &para;</a></span></h4>
  42776. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  42777. </p>
  42778. </div>
  42779. </div>
  42780. <div class="section-level-extent" id="vif">
  42781. <h3 class="section"><span>30.281 vif<a class="copiable-link" href="#vif"> &para;</a></span></h3>
  42782. <p>Obtain the average VIF (Visual Information Fidelity) between two input videos.
  42783. </p>
  42784. <p>This filter takes two input videos.
  42785. </p>
  42786. <p>Both input videos must have the same resolution and pixel format for
  42787. this filter to work correctly. Also it assumes that both inputs
  42788. have the same number of frames, which are compared one by one.
  42789. </p>
  42790. <p>The obtained average VIF score is printed through the logging system.
  42791. </p>
  42792. <p>The filter stores the calculated VIF score of each frame.
  42793. </p>
  42794. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  42795. </p>
  42796. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  42797. with the reference file <samp class="file">ref.mpg</samp>.
  42798. </p>
  42799. <div class="example">
  42800. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi vif -f null -
  42801. </pre></div>
  42802. <a class="anchor" id="vignette"></a></div>
  42803. <div class="section-level-extent" id="vignette-1">
  42804. <h3 class="section"><span>30.282 vignette<a class="copiable-link" href="#vignette-1"> &para;</a></span></h3>
  42805. <p>Make or reverse a natural vignetting effect.
  42806. </p>
  42807. <p>The filter accepts the following options:
  42808. </p>
  42809. <dl class="table">
  42810. <dt><samp class="option">angle, a</samp></dt>
  42811. <dd><p>Set lens angle expression as a number of radians.
  42812. </p>
  42813. <p>The value is clipped in the <code class="code">[0,PI/2]</code> range.
  42814. </p>
  42815. <p>Default value: <code class="code">&quot;PI/5&quot;</code>
  42816. </p>
  42817. </dd>
  42818. <dt><samp class="option">x0</samp></dt>
  42819. <dt><samp class="option">y0</samp></dt>
  42820. <dd><p>Set center coordinates expressions. Respectively <code class="code">&quot;w/2&quot;</code> and <code class="code">&quot;h/2&quot;</code>
  42821. by default.
  42822. </p>
  42823. </dd>
  42824. <dt><samp class="option">mode</samp></dt>
  42825. <dd><p>Set forward/backward mode.
  42826. </p>
  42827. <p>Available modes are:
  42828. </p><dl class="table">
  42829. <dt>&lsquo;<samp class="samp">forward</samp>&rsquo;</dt>
  42830. <dd><p>The larger the distance from the central point, the darker the image becomes.
  42831. </p>
  42832. </dd>
  42833. <dt>&lsquo;<samp class="samp">backward</samp>&rsquo;</dt>
  42834. <dd><p>The larger the distance from the central point, the brighter the image becomes.
  42835. This can be used to reverse a vignette effect, though there is no automatic
  42836. detection to extract the lens <samp class="option">angle</samp> and other settings (yet). It can
  42837. also be used to create a burning effect.
  42838. </p></dd>
  42839. </dl>
  42840. <p>Default value is &lsquo;<samp class="samp">forward</samp>&rsquo;.
  42841. </p>
  42842. </dd>
  42843. <dt><samp class="option">eval</samp></dt>
  42844. <dd><p>Set evaluation mode for the expressions (<samp class="option">angle</samp>, <samp class="option">x0</samp>, <samp class="option">y0</samp>).
  42845. </p>
  42846. <p>It accepts the following values:
  42847. </p><dl class="table">
  42848. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  42849. <dd><p>Evaluate expressions only once during the filter initialization.
  42850. </p>
  42851. </dd>
  42852. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  42853. <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
  42854. &lsquo;<samp class="samp">init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
  42855. allows advanced dynamic expressions.
  42856. </p></dd>
  42857. </dl>
  42858. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  42859. </p>
  42860. </dd>
  42861. <dt><samp class="option">dither</samp></dt>
  42862. <dd><p>Set dithering to reduce the circular banding effects. Default is <code class="code">1</code>
  42863. (enabled).
  42864. </p>
  42865. </dd>
  42866. <dt><samp class="option">aspect</samp></dt>
  42867. <dd><p>Set vignette aspect. This setting allows one to adjust the shape of the vignette.
  42868. Setting this value to the SAR of the input will make a rectangular vignetting
  42869. following the dimensions of the video.
  42870. </p>
  42871. <p>Default is <code class="code">1/1</code>.
  42872. </p></dd>
  42873. </dl>
  42874. <ul class="mini-toc">
  42875. <li><a href="#Expressions" accesskey="1">Expressions</a></li>
  42876. <li><a href="#Examples-154" accesskey="2">Examples</a></li>
  42877. </ul>
  42878. <div class="subsection-level-extent" id="Expressions">
  42879. <h4 class="subsection"><span>30.282.1 Expressions<a class="copiable-link" href="#Expressions"> &para;</a></span></h4>
  42880. <p>The <samp class="option">alpha</samp>, <samp class="option">x0</samp> and <samp class="option">y0</samp> expressions can contain the
  42881. following parameters.
  42882. </p>
  42883. <dl class="table">
  42884. <dt><samp class="option">w</samp></dt>
  42885. <dt><samp class="option">h</samp></dt>
  42886. <dd><p>input width and height
  42887. </p>
  42888. </dd>
  42889. <dt><samp class="option">n</samp></dt>
  42890. <dd><p>the number of input frame, starting from 0
  42891. </p>
  42892. </dd>
  42893. <dt><samp class="option">pts</samp></dt>
  42894. <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
  42895. <var class="var">TB</var> units, NAN if undefined
  42896. </p>
  42897. </dd>
  42898. <dt><samp class="option">r</samp></dt>
  42899. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  42900. </p>
  42901. </dd>
  42902. <dt><samp class="option">t</samp></dt>
  42903. <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
  42904. expressed in seconds, NAN if undefined
  42905. </p>
  42906. </dd>
  42907. <dt><samp class="option">tb</samp></dt>
  42908. <dd><p>time base of the input video
  42909. </p></dd>
  42910. </dl>
  42911. </div>
  42912. <div class="subsection-level-extent" id="Examples-154">
  42913. <h4 class="subsection"><span>30.282.2 Examples<a class="copiable-link" href="#Examples-154"> &para;</a></span></h4>
  42914. <ul class="itemize mark-bullet">
  42915. <li>Apply simple strong vignetting effect:
  42916. <div class="example">
  42917. <pre class="example-preformatted">vignette=PI/4
  42918. </pre></div>
  42919. </li><li>Make a flickering vignetting:
  42920. <div class="example">
  42921. <pre class="example-preformatted">vignette='PI/4+random(1)*PI/50':eval=frame
  42922. </pre></div>
  42923. </li></ul>
  42924. </div>
  42925. </div>
  42926. <div class="section-level-extent" id="vmafmotion">
  42927. <h3 class="section"><span>30.283 vmafmotion<a class="copiable-link" href="#vmafmotion"> &para;</a></span></h3>
  42928. <p>Obtain the average VMAF motion score of a video.
  42929. It is one of the component metrics of VMAF.
  42930. </p>
  42931. <p>The obtained average motion score is printed through the logging system.
  42932. </p>
  42933. <p>The filter accepts the following options:
  42934. </p>
  42935. <dl class="table">
  42936. <dt><samp class="option">stats_file</samp></dt>
  42937. <dd><p>If specified, the filter will use the named file to save the motion score of
  42938. each frame with respect to the previous frame.
  42939. When filename equals &quot;-&quot; the data is sent to standard output.
  42940. </p></dd>
  42941. </dl>
  42942. <p>Example:
  42943. </p><div class="example">
  42944. <pre class="example-preformatted">ffmpeg -i ref.mpg -vf vmafmotion -f null -
  42945. </pre></div>
  42946. <a class="anchor" id="vstack"></a></div>
  42947. <div class="section-level-extent" id="vstack-1">
  42948. <h3 class="section"><span>30.284 vstack<a class="copiable-link" href="#vstack-1"> &para;</a></span></h3>
  42949. <p>Stack input videos vertically.
  42950. </p>
  42951. <p>All streams must be of same pixel format and of same width.
  42952. </p>
  42953. <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
  42954. to create same output.
  42955. </p>
  42956. <p>The filter accepts the following options:
  42957. </p>
  42958. <dl class="table">
  42959. <dt><samp class="option">inputs</samp></dt>
  42960. <dd><p>Set number of input streams. Default is 2.
  42961. </p>
  42962. </dd>
  42963. <dt><samp class="option">shortest</samp></dt>
  42964. <dd><p>If set to 1, force the output to terminate when the shortest input
  42965. terminates. Default value is 0.
  42966. </p></dd>
  42967. </dl>
  42968. </div>
  42969. <div class="section-level-extent" id="w3fdif">
  42970. <h3 class="section"><span>30.285 w3fdif<a class="copiable-link" href="#w3fdif"> &para;</a></span></h3>
  42971. <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
  42972. Deinterlacing Filter&quot;).
  42973. </p>
  42974. <p>Based on the process described by Martin Weston for BBC R&amp;D, and
  42975. implemented based on the de-interlace algorithm written by Jim
  42976. Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
  42977. uses filter coefficients calculated by BBC R&amp;D.
  42978. </p>
  42979. <p>This filter uses field-dominance information in frame to decide which
  42980. of each pair of fields to place first in the output.
  42981. If it gets it wrong use <a class="ref" href="#setfield">setfield</a> filter before <code class="code">w3fdif</code> filter.
  42982. </p>
  42983. <p>There are two sets of filter coefficients, so called &quot;simple&quot;
  42984. and &quot;complex&quot;. Which set of filter coefficients is used can
  42985. be set by passing an optional parameter:
  42986. </p>
  42987. <dl class="table">
  42988. <dt><samp class="option">filter</samp></dt>
  42989. <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
  42990. </p>
  42991. <dl class="table">
  42992. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  42993. <dd><p>Simple filter coefficient set.
  42994. </p></dd>
  42995. <dt>&lsquo;<samp class="samp">complex</samp>&rsquo;</dt>
  42996. <dd><p>More-complex filter coefficient set.
  42997. </p></dd>
  42998. </dl>
  42999. <p>Default value is &lsquo;<samp class="samp">complex</samp>&rsquo;.
  43000. </p>
  43001. </dd>
  43002. <dt><samp class="option">mode</samp></dt>
  43003. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  43004. </p>
  43005. <dl class="table">
  43006. <dt><samp class="option">frame</samp></dt>
  43007. <dd><p>Output one frame for each frame.
  43008. </p></dd>
  43009. <dt><samp class="option">field</samp></dt>
  43010. <dd><p>Output one frame for each field.
  43011. </p></dd>
  43012. </dl>
  43013. <p>The default value is <code class="code">field</code>.
  43014. </p>
  43015. </dd>
  43016. <dt><samp class="option">parity</samp></dt>
  43017. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  43018. of the following values:
  43019. </p>
  43020. <dl class="table">
  43021. <dt><samp class="option">tff</samp></dt>
  43022. <dd><p>Assume the top field is first.
  43023. </p></dd>
  43024. <dt><samp class="option">bff</samp></dt>
  43025. <dd><p>Assume the bottom field is first.
  43026. </p></dd>
  43027. <dt><samp class="option">auto</samp></dt>
  43028. <dd><p>Enable automatic detection of field parity.
  43029. </p></dd>
  43030. </dl>
  43031. <p>The default value is <code class="code">auto</code>.
  43032. If the interlacing is unknown or the decoder does not export this information,
  43033. top field first will be assumed.
  43034. </p>
  43035. </dd>
  43036. <dt><samp class="option">deint</samp></dt>
  43037. <dd><p>Specify which frames to deinterlace. Accepts one of the following values:
  43038. </p>
  43039. <dl class="table">
  43040. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  43041. <dd><p>Deinterlace all frames,
  43042. </p></dd>
  43043. <dt>&lsquo;<samp class="samp">interlaced</samp>&rsquo;</dt>
  43044. <dd><p>Only deinterlace frames marked as interlaced.
  43045. </p></dd>
  43046. </dl>
  43047. <p>Default value is &lsquo;<samp class="samp">all</samp>&rsquo;.
  43048. </p></dd>
  43049. </dl>
  43050. <ul class="mini-toc">
  43051. <li><a href="#Commands-153" accesskey="1">Commands</a></li>
  43052. </ul>
  43053. <div class="subsection-level-extent" id="Commands-153">
  43054. <h4 class="subsection"><span>30.285.1 Commands<a class="copiable-link" href="#Commands-153"> &para;</a></span></h4>
  43055. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  43056. </p>
  43057. </div>
  43058. </div>
  43059. <div class="section-level-extent" id="waveform">
  43060. <h3 class="section"><span>30.286 waveform<a class="copiable-link" href="#waveform"> &para;</a></span></h3>
  43061. <p>Video waveform monitor.
  43062. </p>
  43063. <p>The waveform monitor plots color component intensity. By default luma
  43064. only. Each column of the waveform corresponds to a column of pixels in the
  43065. source video.
  43066. </p>
  43067. <p>It accepts the following options:
  43068. </p>
  43069. <dl class="table">
  43070. <dt><samp class="option">mode, m</samp></dt>
  43071. <dd><p>Can be either <code class="code">row</code>, or <code class="code">column</code>. Default is <code class="code">column</code>.
  43072. In row mode, the graph on the left side represents color component value 0 and
  43073. the right side represents value = 255. In column mode, the top side represents
  43074. color component value = 0 and bottom side represents value = 255.
  43075. </p>
  43076. </dd>
  43077. <dt><samp class="option">intensity, i</samp></dt>
  43078. <dd><p>Set intensity. Smaller values are useful to find out how many values of the same
  43079. luminance are distributed across input rows/columns.
  43080. Default value is <code class="code">0.04</code>. Allowed range is [0, 1].
  43081. </p>
  43082. </dd>
  43083. <dt><samp class="option">mirror, r</samp></dt>
  43084. <dd><p>Set mirroring mode. <code class="code">0</code> means unmirrored, <code class="code">1</code> means mirrored.
  43085. In mirrored mode, higher values will be represented on the left
  43086. side for <code class="code">row</code> mode and at the top for <code class="code">column</code> mode. Default is
  43087. <code class="code">1</code> (mirrored).
  43088. </p>
  43089. </dd>
  43090. <dt><samp class="option">display, d</samp></dt>
  43091. <dd><p>Set display mode.
  43092. It accepts the following values:
  43093. </p><dl class="table">
  43094. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  43095. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  43096. that the graphs representing color components are superimposed directly
  43097. over one another.
  43098. </p>
  43099. <p>This display mode makes it easier to spot relative differences or similarities
  43100. in overlapping areas of the color components that are supposed to be identical,
  43101. such as neutral whites, grays, or blacks.
  43102. </p>
  43103. </dd>
  43104. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  43105. <dd><p>Display separate graph for the color components side by side in
  43106. <code class="code">row</code> mode or one below the other in <code class="code">column</code> mode.
  43107. </p>
  43108. </dd>
  43109. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  43110. <dd><p>Display separate graph for the color components side by side in
  43111. <code class="code">column</code> mode or one below the other in <code class="code">row</code> mode.
  43112. </p>
  43113. <p>Using this display mode makes it easy to spot color casts in the highlights
  43114. and shadows of an image, by comparing the contours of the top and the bottom
  43115. graphs of each waveform. Since whites, grays, and blacks are characterized
  43116. by exactly equal amounts of red, green, and blue, neutral areas of the picture
  43117. should display three waveforms of roughly equal width/height. If not, the
  43118. correction is easy to perform by making level adjustments the three waveforms.
  43119. </p></dd>
  43120. </dl>
  43121. <p>Default is <code class="code">stack</code>.
  43122. </p>
  43123. </dd>
  43124. <dt><samp class="option">components, c</samp></dt>
  43125. <dd><p>Set which color components to display. Default is 1, which means only luma
  43126. or red color component if input is in RGB colorspace. If is set for example to
  43127. 7 it will display all 3 (if) available color components.
  43128. </p>
  43129. </dd>
  43130. <dt><samp class="option">envelope, e</samp></dt>
  43131. <dd><dl class="table">
  43132. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  43133. <dd><p>No envelope, this is default.
  43134. </p>
  43135. </dd>
  43136. <dt>&lsquo;<samp class="samp">instant</samp>&rsquo;</dt>
  43137. <dd><p>Instant envelope, minimum and maximum values presented in graph will be easily
  43138. visible even with small <code class="code">step</code> value.
  43139. </p>
  43140. </dd>
  43141. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  43142. <dd><p>Hold minimum and maximum values presented in graph across time. This way you
  43143. can still spot out of range values without constantly looking at waveforms.
  43144. </p>
  43145. </dd>
  43146. <dt>&lsquo;<samp class="samp">peak+instant</samp>&rsquo;</dt>
  43147. <dd><p>Peak and instant envelope combined together.
  43148. </p></dd>
  43149. </dl>
  43150. </dd>
  43151. <dt><samp class="option">filter, f</samp></dt>
  43152. <dd><dl class="table">
  43153. <dt>&lsquo;<samp class="samp">lowpass</samp>&rsquo;</dt>
  43154. <dd><p>No filtering, this is default.
  43155. </p>
  43156. </dd>
  43157. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  43158. <dd><p>Luma and chroma combined together.
  43159. </p>
  43160. </dd>
  43161. <dt>&lsquo;<samp class="samp">aflat</samp>&rsquo;</dt>
  43162. <dd><p>Similar as above, but shows difference between blue and red chroma.
  43163. </p>
  43164. </dd>
  43165. <dt>&lsquo;<samp class="samp">xflat</samp>&rsquo;</dt>
  43166. <dd><p>Similar as above, but use different colors.
  43167. </p>
  43168. </dd>
  43169. <dt>&lsquo;<samp class="samp">yflat</samp>&rsquo;</dt>
  43170. <dd><p>Similar as above, but again with different colors.
  43171. </p>
  43172. </dd>
  43173. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  43174. <dd><p>Displays only chroma.
  43175. </p>
  43176. </dd>
  43177. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  43178. <dd><p>Displays actual color value on waveform.
  43179. </p>
  43180. </dd>
  43181. <dt>&lsquo;<samp class="samp">acolor</samp>&rsquo;</dt>
  43182. <dd><p>Similar as above, but with luma showing frequency of chroma values.
  43183. </p></dd>
  43184. </dl>
  43185. </dd>
  43186. <dt><samp class="option">graticule, g</samp></dt>
  43187. <dd><p>Set which graticule to display.
  43188. </p>
  43189. <dl class="table">
  43190. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  43191. <dd><p>Do not display graticule.
  43192. </p>
  43193. </dd>
  43194. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  43195. <dd><p>Display green graticule showing legal broadcast ranges.
  43196. </p>
  43197. </dd>
  43198. <dt>&lsquo;<samp class="samp">orange</samp>&rsquo;</dt>
  43199. <dd><p>Display orange graticule showing legal broadcast ranges.
  43200. </p>
  43201. </dd>
  43202. <dt>&lsquo;<samp class="samp">invert</samp>&rsquo;</dt>
  43203. <dd><p>Display invert graticule showing legal broadcast ranges.
  43204. </p></dd>
  43205. </dl>
  43206. </dd>
  43207. <dt><samp class="option">opacity, o</samp></dt>
  43208. <dd><p>Set graticule opacity.
  43209. </p>
  43210. </dd>
  43211. <dt><samp class="option">flags, fl</samp></dt>
  43212. <dd><p>Set graticule flags.
  43213. </p>
  43214. <dl class="table">
  43215. <dt>&lsquo;<samp class="samp">numbers</samp>&rsquo;</dt>
  43216. <dd><p>Draw numbers above lines. By default enabled.
  43217. </p>
  43218. </dd>
  43219. <dt>&lsquo;<samp class="samp">dots</samp>&rsquo;</dt>
  43220. <dd><p>Draw dots instead of lines.
  43221. </p></dd>
  43222. </dl>
  43223. </dd>
  43224. <dt><samp class="option">scale, s</samp></dt>
  43225. <dd><p>Set scale used for displaying graticule.
  43226. </p>
  43227. <dl class="table">
  43228. <dt>&lsquo;<samp class="samp">digital</samp>&rsquo;</dt>
  43229. <dt>&lsquo;<samp class="samp">millivolts</samp>&rsquo;</dt>
  43230. <dt>&lsquo;<samp class="samp">ire</samp>&rsquo;</dt>
  43231. </dl>
  43232. <p>Default is digital.
  43233. </p>
  43234. </dd>
  43235. <dt><samp class="option">bgopacity, b</samp></dt>
  43236. <dd><p>Set background opacity.
  43237. </p>
  43238. </dd>
  43239. <dt><samp class="option">tint0, t0</samp></dt>
  43240. <dt><samp class="option">tint1, t1</samp></dt>
  43241. <dd><p>Set tint for output.
  43242. Only used with lowpass filter and when display is not overlay and input
  43243. pixel formats are not RGB.
  43244. </p>
  43245. </dd>
  43246. <dt><samp class="option">fitmode, fm</samp></dt>
  43247. <dd><p>Set sample aspect ratio of video output frames.
  43248. Can be used to configure waveform so it is not
  43249. streched too much in one of directions.
  43250. </p>
  43251. <dl class="table">
  43252. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  43253. <dd><p>Set sample aspect ration to 1/1.
  43254. </p></dd>
  43255. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  43256. <dd><p>Set sample aspect ratio to match input size of video
  43257. </p></dd>
  43258. </dl>
  43259. <p>Default is &lsquo;<samp class="samp">none</samp>&rsquo;.
  43260. </p>
  43261. </dd>
  43262. <dt><samp class="option">input</samp></dt>
  43263. <dd><p>Set input formats for filter to pick from.
  43264. Can be &lsquo;<samp class="samp">all</samp>&rsquo;, for selecting from all available formats,
  43265. or &lsquo;<samp class="samp">first</samp>&rsquo;, for selecting first available format.
  43266. Default is &lsquo;<samp class="samp">first</samp>&rsquo;.
  43267. </p></dd>
  43268. </dl>
  43269. </div>
  43270. <div class="section-level-extent" id="weave_002c-doubleweave">
  43271. <h3 class="section"><span>30.287 weave, doubleweave<a class="copiable-link" href="#weave_002c-doubleweave"> &para;</a></span></h3>
  43272. <p>The <code class="code">weave</code> takes a field-based video input and join
  43273. each two sequential fields into single frame, producing a new double
  43274. height clip with half the frame rate and half the frame count.
  43275. </p>
  43276. <p>The <code class="code">doubleweave</code> works same as <code class="code">weave</code> but without
  43277. halving frame rate and frame count.
  43278. </p>
  43279. <p>It accepts the following option:
  43280. </p>
  43281. <dl class="table">
  43282. <dt><samp class="option">first_field</samp></dt>
  43283. <dd><p>Set first field. Available values are:
  43284. </p>
  43285. <dl class="table">
  43286. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  43287. <dd><p>Set the frame as top-field-first.
  43288. </p>
  43289. </dd>
  43290. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  43291. <dd><p>Set the frame as bottom-field-first.
  43292. </p></dd>
  43293. </dl>
  43294. </dd>
  43295. </dl>
  43296. <ul class="mini-toc">
  43297. <li><a href="#Examples-155" accesskey="1">Examples</a></li>
  43298. </ul>
  43299. <div class="subsection-level-extent" id="Examples-155">
  43300. <h4 class="subsection"><span>30.287.1 Examples<a class="copiable-link" href="#Examples-155"> &para;</a></span></h4>
  43301. <ul class="itemize mark-bullet">
  43302. <li>Interlace video using <a class="ref" href="#select">select</a> and <a class="ref" href="#separatefields">separatefields</a> filter:
  43303. <div class="example">
  43304. <pre class="example-preformatted">separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
  43305. </pre></div>
  43306. </li></ul>
  43307. </div>
  43308. </div>
  43309. <div class="section-level-extent" id="xbr">
  43310. <h3 class="section"><span>30.288 xbr<a class="copiable-link" href="#xbr"> &para;</a></span></h3>
  43311. <p>Apply the xBR high-quality magnification filter which is designed for pixel
  43312. art. It follows a set of edge-detection rules, see
  43313. <a class="url" href="https://forums.libretro.com/t/xbr-algorithm-tutorial/123">https://forums.libretro.com/t/xbr-algorithm-tutorial/123</a>.
  43314. </p>
  43315. <p>It accepts the following option:
  43316. </p>
  43317. <dl class="table">
  43318. <dt><samp class="option">n</samp></dt>
  43319. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">2xBR</code>, <code class="code">3</code> for
  43320. <code class="code">3xBR</code> and <code class="code">4</code> for <code class="code">4xBR</code>.
  43321. Default is <code class="code">3</code>.
  43322. </p></dd>
  43323. </dl>
  43324. </div>
  43325. <div class="section-level-extent" id="xcorrelate">
  43326. <h3 class="section"><span>30.289 xcorrelate<a class="copiable-link" href="#xcorrelate"> &para;</a></span></h3>
  43327. <p>Apply normalized cross-correlation between first and second input video stream.
  43328. </p>
  43329. <p>Second input video stream dimensions must be lower than first input video stream.
  43330. </p>
  43331. <p>The filter accepts the following options:
  43332. </p>
  43333. <dl class="table">
  43334. <dt><samp class="option">planes</samp></dt>
  43335. <dd><p>Set which planes to process.
  43336. </p>
  43337. </dd>
  43338. <dt><samp class="option">secondary</samp></dt>
  43339. <dd><p>Set which secondary video frames will be processed from second input video stream,
  43340. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  43341. </p></dd>
  43342. </dl>
  43343. <p>The <code class="code">xcorrelate</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  43344. </p>
  43345. </div>
  43346. <div class="section-level-extent" id="xfade">
  43347. <h3 class="section"><span>30.290 xfade<a class="copiable-link" href="#xfade"> &para;</a></span></h3>
  43348. <p>Apply cross fade from one input video stream to another input video stream.
  43349. The cross fade is applied for specified duration.
  43350. </p>
  43351. <p>Both inputs must be constant frame-rate and have the same resolution, pixel format,
  43352. frame rate and timebase.
  43353. </p>
  43354. <p>The filter accepts the following options:
  43355. </p>
  43356. <dl class="table">
  43357. <dt><samp class="option">transition</samp></dt>
  43358. <dd><p>Set one of available transition effects:
  43359. </p>
  43360. <dl class="table">
  43361. <dt>&lsquo;<samp class="samp">custom</samp>&rsquo;</dt>
  43362. <dt>&lsquo;<samp class="samp">fade</samp>&rsquo;</dt>
  43363. <dt>&lsquo;<samp class="samp">wipeleft</samp>&rsquo;</dt>
  43364. <dt>&lsquo;<samp class="samp">wiperight</samp>&rsquo;</dt>
  43365. <dt>&lsquo;<samp class="samp">wipeup</samp>&rsquo;</dt>
  43366. <dt>&lsquo;<samp class="samp">wipedown</samp>&rsquo;</dt>
  43367. <dt>&lsquo;<samp class="samp">slideleft</samp>&rsquo;</dt>
  43368. <dt>&lsquo;<samp class="samp">slideright</samp>&rsquo;</dt>
  43369. <dt>&lsquo;<samp class="samp">slideup</samp>&rsquo;</dt>
  43370. <dt>&lsquo;<samp class="samp">slidedown</samp>&rsquo;</dt>
  43371. <dt>&lsquo;<samp class="samp">circlecrop</samp>&rsquo;</dt>
  43372. <dt>&lsquo;<samp class="samp">rectcrop</samp>&rsquo;</dt>
  43373. <dt>&lsquo;<samp class="samp">distance</samp>&rsquo;</dt>
  43374. <dt>&lsquo;<samp class="samp">fadeblack</samp>&rsquo;</dt>
  43375. <dt>&lsquo;<samp class="samp">fadewhite</samp>&rsquo;</dt>
  43376. <dt>&lsquo;<samp class="samp">radial</samp>&rsquo;</dt>
  43377. <dt>&lsquo;<samp class="samp">smoothleft</samp>&rsquo;</dt>
  43378. <dt>&lsquo;<samp class="samp">smoothright</samp>&rsquo;</dt>
  43379. <dt>&lsquo;<samp class="samp">smoothup</samp>&rsquo;</dt>
  43380. <dt>&lsquo;<samp class="samp">smoothdown</samp>&rsquo;</dt>
  43381. <dt>&lsquo;<samp class="samp">circleopen</samp>&rsquo;</dt>
  43382. <dt>&lsquo;<samp class="samp">circleclose</samp>&rsquo;</dt>
  43383. <dt>&lsquo;<samp class="samp">vertopen</samp>&rsquo;</dt>
  43384. <dt>&lsquo;<samp class="samp">vertclose</samp>&rsquo;</dt>
  43385. <dt>&lsquo;<samp class="samp">horzopen</samp>&rsquo;</dt>
  43386. <dt>&lsquo;<samp class="samp">horzclose</samp>&rsquo;</dt>
  43387. <dt>&lsquo;<samp class="samp">dissolve</samp>&rsquo;</dt>
  43388. <dt>&lsquo;<samp class="samp">pixelize</samp>&rsquo;</dt>
  43389. <dt>&lsquo;<samp class="samp">diagtl</samp>&rsquo;</dt>
  43390. <dt>&lsquo;<samp class="samp">diagtr</samp>&rsquo;</dt>
  43391. <dt>&lsquo;<samp class="samp">diagbl</samp>&rsquo;</dt>
  43392. <dt>&lsquo;<samp class="samp">diagbr</samp>&rsquo;</dt>
  43393. <dt>&lsquo;<samp class="samp">hlslice</samp>&rsquo;</dt>
  43394. <dt>&lsquo;<samp class="samp">hrslice</samp>&rsquo;</dt>
  43395. <dt>&lsquo;<samp class="samp">vuslice</samp>&rsquo;</dt>
  43396. <dt>&lsquo;<samp class="samp">vdslice</samp>&rsquo;</dt>
  43397. <dt>&lsquo;<samp class="samp">hblur</samp>&rsquo;</dt>
  43398. <dt>&lsquo;<samp class="samp">fadegrays</samp>&rsquo;</dt>
  43399. <dt>&lsquo;<samp class="samp">wipetl</samp>&rsquo;</dt>
  43400. <dt>&lsquo;<samp class="samp">wipetr</samp>&rsquo;</dt>
  43401. <dt>&lsquo;<samp class="samp">wipebl</samp>&rsquo;</dt>
  43402. <dt>&lsquo;<samp class="samp">wipebr</samp>&rsquo;</dt>
  43403. <dt>&lsquo;<samp class="samp">squeezeh</samp>&rsquo;</dt>
  43404. <dt>&lsquo;<samp class="samp">squeezev</samp>&rsquo;</dt>
  43405. <dt>&lsquo;<samp class="samp">zoomin</samp>&rsquo;</dt>
  43406. <dt>&lsquo;<samp class="samp">fadefast</samp>&rsquo;</dt>
  43407. <dt>&lsquo;<samp class="samp">fadeslow</samp>&rsquo;</dt>
  43408. <dt>&lsquo;<samp class="samp">hlwind</samp>&rsquo;</dt>
  43409. <dt>&lsquo;<samp class="samp">hrwind</samp>&rsquo;</dt>
  43410. <dt>&lsquo;<samp class="samp">vuwind</samp>&rsquo;</dt>
  43411. <dt>&lsquo;<samp class="samp">vdwind</samp>&rsquo;</dt>
  43412. <dt>&lsquo;<samp class="samp">coverleft</samp>&rsquo;</dt>
  43413. <dt>&lsquo;<samp class="samp">coverright</samp>&rsquo;</dt>
  43414. <dt>&lsquo;<samp class="samp">coverup</samp>&rsquo;</dt>
  43415. <dt>&lsquo;<samp class="samp">coverdown</samp>&rsquo;</dt>
  43416. <dt>&lsquo;<samp class="samp">revealleft</samp>&rsquo;</dt>
  43417. <dt>&lsquo;<samp class="samp">revealright</samp>&rsquo;</dt>
  43418. <dt>&lsquo;<samp class="samp">revealup</samp>&rsquo;</dt>
  43419. <dt>&lsquo;<samp class="samp">revealdown</samp>&rsquo;</dt>
  43420. </dl>
  43421. <p>Default transition effect is fade.
  43422. </p>
  43423. </dd>
  43424. <dt><samp class="option">duration</samp></dt>
  43425. <dd><p>Set cross fade duration in seconds.
  43426. Range is 0 to 60 seconds.
  43427. Default duration is 1 second.
  43428. </p>
  43429. </dd>
  43430. <dt><samp class="option">offset</samp></dt>
  43431. <dd><p>Set cross fade start relative to first input stream in seconds.
  43432. Default offset is 0.
  43433. </p>
  43434. </dd>
  43435. <dt><samp class="option">expr</samp></dt>
  43436. <dd><p>Set expression for custom transition effect.
  43437. </p>
  43438. <p>The expressions can use the following variables and functions:
  43439. </p>
  43440. <dl class="table">
  43441. <dt><samp class="option">X</samp></dt>
  43442. <dt><samp class="option">Y</samp></dt>
  43443. <dd><p>The coordinates of the current sample.
  43444. </p>
  43445. </dd>
  43446. <dt><samp class="option">W</samp></dt>
  43447. <dt><samp class="option">H</samp></dt>
  43448. <dd><p>The width and height of the image.
  43449. </p>
  43450. </dd>
  43451. <dt><samp class="option">P</samp></dt>
  43452. <dd><p>Progress of transition effect.
  43453. </p>
  43454. </dd>
  43455. <dt><samp class="option">PLANE</samp></dt>
  43456. <dd><p>Currently processed plane.
  43457. </p>
  43458. </dd>
  43459. <dt><samp class="option">A</samp></dt>
  43460. <dd><p>Return value of first input at current location and plane.
  43461. </p>
  43462. </dd>
  43463. <dt><samp class="option">B</samp></dt>
  43464. <dd><p>Return value of second input at current location and plane.
  43465. </p>
  43466. </dd>
  43467. <dt><samp class="option">a0(x, y)</samp></dt>
  43468. <dt><samp class="option">a1(x, y)</samp></dt>
  43469. <dt><samp class="option">a2(x, y)</samp></dt>
  43470. <dt><samp class="option">a3(x, y)</samp></dt>
  43471. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  43472. first/second/third/fourth component of first input.
  43473. </p>
  43474. </dd>
  43475. <dt><samp class="option">b0(x, y)</samp></dt>
  43476. <dt><samp class="option">b1(x, y)</samp></dt>
  43477. <dt><samp class="option">b2(x, y)</samp></dt>
  43478. <dt><samp class="option">b3(x, y)</samp></dt>
  43479. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  43480. first/second/third/fourth component of second input.
  43481. </p></dd>
  43482. </dl>
  43483. </dd>
  43484. </dl>
  43485. <ul class="mini-toc">
  43486. <li><a href="#Examples-156" accesskey="1">Examples</a></li>
  43487. </ul>
  43488. <div class="subsection-level-extent" id="Examples-156">
  43489. <h4 class="subsection"><span>30.290.1 Examples<a class="copiable-link" href="#Examples-156"> &para;</a></span></h4>
  43490. <ul class="itemize mark-bullet">
  43491. <li>Cross fade from one input video to another input video, with fade transition and duration of transition
  43492. of 2 seconds starting at offset of 5 seconds:
  43493. <div class="example">
  43494. <pre class="example-preformatted">ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
  43495. </pre></div>
  43496. </li></ul>
  43497. </div>
  43498. </div>
  43499. <div class="section-level-extent" id="xmedian">
  43500. <h3 class="section"><span>30.291 xmedian<a class="copiable-link" href="#xmedian"> &para;</a></span></h3>
  43501. <p>Pick median pixels from several input videos.
  43502. </p>
  43503. <p>The filter accepts the following options:
  43504. </p>
  43505. <dl class="table">
  43506. <dt><samp class="option">inputs</samp></dt>
  43507. <dd><p>Set number of inputs.
  43508. Default is 3. Allowed range is from 3 to 255.
  43509. If number of inputs is even number, than result will be mean value between two median values.
  43510. </p>
  43511. </dd>
  43512. <dt><samp class="option">planes</samp></dt>
  43513. <dd><p>Set which planes to filter. Default value is <code class="code">15</code>, by which all planes are processed.
  43514. </p>
  43515. </dd>
  43516. <dt><samp class="option">percentile</samp></dt>
  43517. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  43518. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  43519. minimum values, and <code class="code">1</code> maximum values.
  43520. </p></dd>
  43521. </dl>
  43522. <ul class="mini-toc">
  43523. <li><a href="#Commands-154" accesskey="1">Commands</a></li>
  43524. </ul>
  43525. <div class="subsection-level-extent" id="Commands-154">
  43526. <h4 class="subsection"><span>30.291.1 Commands<a class="copiable-link" href="#Commands-154"> &para;</a></span></h4>
  43527. <p>This filter supports all above options as <a class="ref" href="#commands">commands</a>, excluding option <code class="code">inputs</code>.
  43528. </p>
  43529. <a class="anchor" id="xstack"></a></div>
  43530. </div>
  43531. <div class="section-level-extent" id="xstack-1">
  43532. <h3 class="section"><span>30.292 xstack<a class="copiable-link" href="#xstack-1"> &para;</a></span></h3>
  43533. <p>Stack video inputs into custom layout.
  43534. </p>
  43535. <p>All streams must be of same pixel format.
  43536. </p>
  43537. <p>The filter accepts the following options:
  43538. </p>
  43539. <dl class="table">
  43540. <dt><samp class="option">inputs</samp></dt>
  43541. <dd><p>Set number of input streams. Default is 2.
  43542. </p>
  43543. </dd>
  43544. <dt><samp class="option">layout</samp></dt>
  43545. <dd><p>Specify layout of inputs.
  43546. This option requires the desired layout configuration to be explicitly set by the user.
  43547. This sets position of each video input in output. Each input
  43548. is separated by &rsquo;|&rsquo;.
  43549. The first number represents the column, and the second number represents the row.
  43550. Numbers start at 0 and are separated by &rsquo;_&rsquo;. Optionally one can use wX and hX,
  43551. where X is video input from which to take width or height.
  43552. Multiple values can be used when separated by &rsquo;+&rsquo;. In such
  43553. case values are summed together.
  43554. </p>
  43555. <p>Note that if inputs are of different sizes gaps may appear, as not all of
  43556. the output video frame will be filled. Similarly, videos can overlap each
  43557. other if their position doesn&rsquo;t leave enough space for the full frame of
  43558. adjoining videos.
  43559. </p>
  43560. <p>For 2 inputs, a default layout of <code class="code">0_0|w0_0</code> (equivalent to
  43561. <code class="code">grid=2x1</code>) is set. In all other cases, a layout or a grid must be set by
  43562. the user. Either <code class="code">grid</code> or <code class="code">layout</code> can be specified at a time.
  43563. Specifying both will result in an error.
  43564. </p>
  43565. </dd>
  43566. <dt><samp class="option">grid</samp></dt>
  43567. <dd><p>Specify a fixed size grid of inputs.
  43568. This option is used to create a fixed size grid of the input streams. Set the
  43569. grid size in the form <code class="code">COLUMNSxROWS</code>. There must be <code class="code">ROWS * COLUMNS</code>
  43570. input streams and they will be arranged as a grid with <code class="code">ROWS</code> rows and
  43571. <code class="code">COLUMNS</code> columns. When using this option, each input stream within a row
  43572. must have the same height and all the rows must have the same width.
  43573. </p>
  43574. <p>If <code class="code">grid</code> is set, then <code class="code">inputs</code> option is ignored and is implicitly
  43575. set to <code class="code">ROWS * COLUMNS</code>.
  43576. </p>
  43577. <p>For 2 inputs, a default grid of <code class="code">2x1</code> (equivalent to
  43578. <code class="code">layout=0_0|w0_0</code>) is set. In all other cases, a layout or a grid must be
  43579. set by the user. Either <code class="code">grid</code> or <code class="code">layout</code> can be specified at a time.
  43580. Specifying both will result in an error.
  43581. </p>
  43582. </dd>
  43583. <dt><samp class="option">shortest</samp></dt>
  43584. <dd><p>If set to 1, force the output to terminate when the shortest input
  43585. terminates. Default value is 0.
  43586. </p>
  43587. </dd>
  43588. <dt><samp class="option">fill</samp></dt>
  43589. <dd><p>If set to valid color, all unused pixels will be filled with that color.
  43590. By default fill is set to none, so it is disabled.
  43591. </p></dd>
  43592. </dl>
  43593. <ul class="mini-toc">
  43594. <li><a href="#Examples-157" accesskey="1">Examples</a></li>
  43595. </ul>
  43596. <div class="subsection-level-extent" id="Examples-157">
  43597. <h4 class="subsection"><span>30.292.1 Examples<a class="copiable-link" href="#Examples-157"> &para;</a></span></h4>
  43598. <ul class="itemize mark-bullet">
  43599. <li>Display 4 inputs into 2x2 grid.
  43600. <p>Layout:
  43601. </p><div class="example">
  43602. <pre class="example-preformatted">input1(0, 0) | input3(w0, 0)
  43603. input2(0, h0) | input4(w0, h0)
  43604. </pre></div>
  43605. <div class="example">
  43606. <pre class="example-preformatted">xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
  43607. </pre></div>
  43608. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  43609. </p>
  43610. </li><li>Display 4 inputs into 1x4 grid.
  43611. <p>Layout:
  43612. </p><div class="example">
  43613. <pre class="example-preformatted">input1(0, 0)
  43614. input2(0, h0)
  43615. input3(0, h0+h1)
  43616. input4(0, h0+h1+h2)
  43617. </pre></div>
  43618. <div class="example">
  43619. <pre class="example-preformatted">xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
  43620. </pre></div>
  43621. <p>Note that if inputs are of different widths, unused space will appear.
  43622. </p>
  43623. </li><li>Display 9 inputs into 3x3 grid.
  43624. <p>Layout:
  43625. </p><div class="example">
  43626. <pre class="example-preformatted">input1(0, 0) | input4(w0, 0) | input7(w0+w3, 0)
  43627. input2(0, h0) | input5(w0, h0) | input8(w0+w3, h0)
  43628. input3(0, h0+h1) | input6(w0, h0+h1) | input9(w0+w3, h0+h1)
  43629. </pre></div>
  43630. <div class="example">
  43631. <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
  43632. </pre></div>
  43633. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  43634. </p>
  43635. </li><li>Display 16 inputs into 4x4 grid.
  43636. <p>Layout:
  43637. </p><div class="example">
  43638. <pre class="example-preformatted">input1(0, 0) | input5(w0, 0) | input9 (w0+w4, 0) | input13(w0+w4+w8, 0)
  43639. input2(0, h0) | input6(w0, h0) | input10(w0+w4, h0) | input14(w0+w4+w8, h0)
  43640. input3(0, h0+h1) | input7(w0, h0+h1) | input11(w0+w4, h0+h1) | input15(w0+w4+w8, h0+h1)
  43641. input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
  43642. </pre></div>
  43643. <div class="example">
  43644. <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|
  43645. 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
  43646. </pre></div>
  43647. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  43648. </p>
  43649. </li></ul>
  43650. <a class="anchor" id="yadif"></a></div>
  43651. </div>
  43652. <div class="section-level-extent" id="yadif-1">
  43653. <h3 class="section"><span>30.293 yadif<a class="copiable-link" href="#yadif-1"> &para;</a></span></h3>
  43654. <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
  43655. filter&quot;).
  43656. </p>
  43657. <p>It accepts the following parameters:
  43658. </p>
  43659. <dl class="table">
  43660. <dt><samp class="option">mode</samp></dt>
  43661. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  43662. </p>
  43663. <dl class="table">
  43664. <dt><samp class="option">0, send_frame</samp></dt>
  43665. <dd><p>Output one frame for each frame.
  43666. </p></dd>
  43667. <dt><samp class="option">1, send_field</samp></dt>
  43668. <dd><p>Output one frame for each field.
  43669. </p></dd>
  43670. <dt><samp class="option">2, send_frame_nospatial</samp></dt>
  43671. <dd><p>Like <code class="code">send_frame</code>, but it skips the spatial interlacing check.
  43672. </p></dd>
  43673. <dt><samp class="option">3, send_field_nospatial</samp></dt>
  43674. <dd><p>Like <code class="code">send_field</code>, but it skips the spatial interlacing check.
  43675. </p></dd>
  43676. </dl>
  43677. <p>The default value is <code class="code">send_frame</code>.
  43678. </p>
  43679. </dd>
  43680. <dt><samp class="option">parity</samp></dt>
  43681. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  43682. of the following values:
  43683. </p>
  43684. <dl class="table">
  43685. <dt><samp class="option">0, tff</samp></dt>
  43686. <dd><p>Assume the top field is first.
  43687. </p></dd>
  43688. <dt><samp class="option">1, bff</samp></dt>
  43689. <dd><p>Assume the bottom field is first.
  43690. </p></dd>
  43691. <dt><samp class="option">-1, auto</samp></dt>
  43692. <dd><p>Enable automatic detection of field parity.
  43693. </p></dd>
  43694. </dl>
  43695. <p>The default value is <code class="code">auto</code>.
  43696. If the interlacing is unknown or the decoder does not export this information,
  43697. top field first will be assumed.
  43698. </p>
  43699. </dd>
  43700. <dt><samp class="option">deint</samp></dt>
  43701. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  43702. values:
  43703. </p>
  43704. <dl class="table">
  43705. <dt><samp class="option">0, all</samp></dt>
  43706. <dd><p>Deinterlace all frames.
  43707. </p></dd>
  43708. <dt><samp class="option">1, interlaced</samp></dt>
  43709. <dd><p>Only deinterlace frames marked as interlaced.
  43710. </p></dd>
  43711. </dl>
  43712. <p>The default value is <code class="code">all</code>.
  43713. </p></dd>
  43714. </dl>
  43715. </div>
  43716. <div class="section-level-extent" id="yadif_005fcuda">
  43717. <h3 class="section"><span>30.294 yadif_cuda<a class="copiable-link" href="#yadif_005fcuda"> &para;</a></span></h3>
  43718. <p>Deinterlace the input video using the <a class="ref" href="#yadif">yadif</a> algorithm, but implemented
  43719. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  43720. and/or nvenc.
  43721. </p>
  43722. <p>It accepts the following parameters:
  43723. </p>
  43724. <dl class="table">
  43725. <dt><samp class="option">mode</samp></dt>
  43726. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  43727. </p>
  43728. <dl class="table">
  43729. <dt><samp class="option">0, send_frame</samp></dt>
  43730. <dd><p>Output one frame for each frame.
  43731. </p></dd>
  43732. <dt><samp class="option">1, send_field</samp></dt>
  43733. <dd><p>Output one frame for each field.
  43734. </p></dd>
  43735. <dt><samp class="option">2, send_frame_nospatial</samp></dt>
  43736. <dd><p>Like <code class="code">send_frame</code>, but it skips the spatial interlacing check.
  43737. </p></dd>
  43738. <dt><samp class="option">3, send_field_nospatial</samp></dt>
  43739. <dd><p>Like <code class="code">send_field</code>, but it skips the spatial interlacing check.
  43740. </p></dd>
  43741. </dl>
  43742. <p>The default value is <code class="code">send_frame</code>.
  43743. </p>
  43744. </dd>
  43745. <dt><samp class="option">parity</samp></dt>
  43746. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  43747. of the following values:
  43748. </p>
  43749. <dl class="table">
  43750. <dt><samp class="option">0, tff</samp></dt>
  43751. <dd><p>Assume the top field is first.
  43752. </p></dd>
  43753. <dt><samp class="option">1, bff</samp></dt>
  43754. <dd><p>Assume the bottom field is first.
  43755. </p></dd>
  43756. <dt><samp class="option">-1, auto</samp></dt>
  43757. <dd><p>Enable automatic detection of field parity.
  43758. </p></dd>
  43759. </dl>
  43760. <p>The default value is <code class="code">auto</code>.
  43761. If the interlacing is unknown or the decoder does not export this information,
  43762. top field first will be assumed.
  43763. </p>
  43764. </dd>
  43765. <dt><samp class="option">deint</samp></dt>
  43766. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  43767. values:
  43768. </p>
  43769. <dl class="table">
  43770. <dt><samp class="option">0, all</samp></dt>
  43771. <dd><p>Deinterlace all frames.
  43772. </p></dd>
  43773. <dt><samp class="option">1, interlaced</samp></dt>
  43774. <dd><p>Only deinterlace frames marked as interlaced.
  43775. </p></dd>
  43776. </dl>
  43777. <p>The default value is <code class="code">all</code>.
  43778. </p></dd>
  43779. </dl>
  43780. </div>
  43781. <div class="section-level-extent" id="yaepblur">
  43782. <h3 class="section"><span>30.295 yaepblur<a class="copiable-link" href="#yaepblur"> &para;</a></span></h3>
  43783. <p>Apply blur filter while preserving edges (&quot;yaepblur&quot; means &quot;yet another edge preserving blur filter&quot;).
  43784. The algorithm is described in
  43785. &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;
  43786. </p>
  43787. <p>It accepts the following parameters:
  43788. </p>
  43789. <dl class="table">
  43790. <dt><samp class="option">radius, r</samp></dt>
  43791. <dd><p>Set the window radius. Default value is 3.
  43792. </p>
  43793. </dd>
  43794. <dt><samp class="option">planes, p</samp></dt>
  43795. <dd><p>Set which planes to filter. Default is only the first plane.
  43796. </p>
  43797. </dd>
  43798. <dt><samp class="option">sigma, s</samp></dt>
  43799. <dd><p>Set blur strength. Default value is 128.
  43800. </p></dd>
  43801. </dl>
  43802. <ul class="mini-toc">
  43803. <li><a href="#Commands-155" accesskey="1">Commands</a></li>
  43804. </ul>
  43805. <div class="subsection-level-extent" id="Commands-155">
  43806. <h4 class="subsection"><span>30.295.1 Commands<a class="copiable-link" href="#Commands-155"> &para;</a></span></h4>
  43807. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  43808. </p>
  43809. </div>
  43810. </div>
  43811. <div class="section-level-extent" id="zoompan">
  43812. <h3 class="section"><span>30.296 zoompan<a class="copiable-link" href="#zoompan"> &para;</a></span></h3>
  43813. <p>Apply Zoom &amp; Pan effect.
  43814. </p>
  43815. <p>This filter accepts the following options:
  43816. </p>
  43817. <dl class="table">
  43818. <dt><samp class="option">zoom, z</samp></dt>
  43819. <dd><p>Set the zoom expression. Range is 1-10. Default is 1.
  43820. </p>
  43821. </dd>
  43822. <dt><samp class="option">x</samp></dt>
  43823. <dt><samp class="option">y</samp></dt>
  43824. <dd><p>Set the x and y expression. Default is 0.
  43825. </p>
  43826. </dd>
  43827. <dt><samp class="option">d</samp></dt>
  43828. <dd><p>Set the duration expression in number of frames.
  43829. This sets for how many number of frames effect will last for
  43830. single input image. Default is 90.
  43831. </p>
  43832. </dd>
  43833. <dt><samp class="option">s</samp></dt>
  43834. <dd><p>Set the output image size, default is &rsquo;hd720&rsquo;.
  43835. </p>
  43836. </dd>
  43837. <dt><samp class="option">fps</samp></dt>
  43838. <dd><p>Set the output frame rate, default is &rsquo;25&rsquo;.
  43839. </p></dd>
  43840. </dl>
  43841. <p>Each expression can contain the following constants:
  43842. </p>
  43843. <dl class="table">
  43844. <dt><samp class="option">in_w, iw</samp></dt>
  43845. <dd><p>Input width.
  43846. </p>
  43847. </dd>
  43848. <dt><samp class="option">in_h, ih</samp></dt>
  43849. <dd><p>Input height.
  43850. </p>
  43851. </dd>
  43852. <dt><samp class="option">out_w, ow</samp></dt>
  43853. <dd><p>Output width.
  43854. </p>
  43855. </dd>
  43856. <dt><samp class="option">out_h, oh</samp></dt>
  43857. <dd><p>Output height.
  43858. </p>
  43859. </dd>
  43860. <dt><samp class="option">in</samp></dt>
  43861. <dd><p>Input frame count.
  43862. </p>
  43863. </dd>
  43864. <dt><samp class="option">on</samp></dt>
  43865. <dd><p>Output frame count.
  43866. </p>
  43867. </dd>
  43868. <dt><samp class="option">in_time, it</samp></dt>
  43869. <dd><p>The input timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  43870. </p>
  43871. </dd>
  43872. <dt><samp class="option">out_time, time, ot</samp></dt>
  43873. <dd><p>The output timestamp expressed in seconds.
  43874. </p>
  43875. </dd>
  43876. <dt><samp class="option">x</samp></dt>
  43877. <dt><samp class="option">y</samp></dt>
  43878. <dd><p>Last calculated &rsquo;x&rsquo; and &rsquo;y&rsquo; position from &rsquo;x&rsquo; and &rsquo;y&rsquo; expression
  43879. for current input frame.
  43880. </p>
  43881. </dd>
  43882. <dt><samp class="option">px</samp></dt>
  43883. <dt><samp class="option">py</samp></dt>
  43884. <dd><p>&rsquo;x&rsquo; and &rsquo;y&rsquo; of last output frame of previous input frame or 0 when there was
  43885. not yet such frame (first input frame).
  43886. </p>
  43887. </dd>
  43888. <dt><samp class="option">zoom</samp></dt>
  43889. <dd><p>Last calculated zoom from &rsquo;z&rsquo; expression for current input frame.
  43890. </p>
  43891. </dd>
  43892. <dt><samp class="option">pzoom</samp></dt>
  43893. <dd><p>Last calculated zoom of last output frame of previous input frame.
  43894. </p>
  43895. </dd>
  43896. <dt><samp class="option">duration</samp></dt>
  43897. <dd><p>Number of output frames for current input frame. Calculated from &rsquo;d&rsquo; expression
  43898. for each input frame.
  43899. </p>
  43900. </dd>
  43901. <dt><samp class="option">pduration</samp></dt>
  43902. <dd><p>number of output frames created for previous input frame
  43903. </p>
  43904. </dd>
  43905. <dt><samp class="option">a</samp></dt>
  43906. <dd><p>Rational number: input width / input height
  43907. </p>
  43908. </dd>
  43909. <dt><samp class="option">sar</samp></dt>
  43910. <dd><p>sample aspect ratio
  43911. </p>
  43912. </dd>
  43913. <dt><samp class="option">dar</samp></dt>
  43914. <dd><p>display aspect ratio
  43915. </p>
  43916. </dd>
  43917. </dl>
  43918. <ul class="mini-toc">
  43919. <li><a href="#Examples-158" accesskey="1">Examples</a></li>
  43920. </ul>
  43921. <div class="subsection-level-extent" id="Examples-158">
  43922. <h4 class="subsection"><span>30.296.1 Examples<a class="copiable-link" href="#Examples-158"> &para;</a></span></h4>
  43923. <ul class="itemize mark-bullet">
  43924. <li>Zoom in up to 1.5x and pan at same time to some spot near center of picture:
  43925. <div class="example">
  43926. <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
  43927. </pre></div>
  43928. </li><li>Zoom in up to 1.5x and pan always at center of picture:
  43929. <div class="example">
  43930. <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)'
  43931. </pre></div>
  43932. </li><li>Same as above but without pausing:
  43933. <div class="example">
  43934. <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)'
  43935. </pre></div>
  43936. </li><li>Zoom in 2x into center of picture only for the first second of the input video:
  43937. <div class="example">
  43938. <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)'
  43939. </pre></div>
  43940. </li></ul>
  43941. <a class="anchor" id="zscale"></a></div>
  43942. </div>
  43943. <div class="section-level-extent" id="zscale-1">
  43944. <h3 class="section"><span>30.297 zscale<a class="copiable-link" href="#zscale-1"> &para;</a></span></h3>
  43945. <p>Scale (resize) the input video, using the z.lib library:
  43946. <a class="url" href="https://github.com/sekrit-twc/zimg">https://github.com/sekrit-twc/zimg</a>. To enable compilation of this
  43947. filter, you need to configure FFmpeg with <code class="code">--enable-libzimg</code>.
  43948. </p>
  43949. <p>The zscale filter forces the output display aspect ratio to be the same
  43950. as the input, by changing the output sample aspect ratio.
  43951. </p>
  43952. <p>If the input image format is different from the format requested by
  43953. the next filter, the zscale filter will convert the input to the
  43954. requested format.
  43955. </p>
  43956. <ul class="mini-toc">
  43957. <li><a href="#Options-42" accesskey="1">Options</a></li>
  43958. <li><a href="#Commands-156" accesskey="2">Commands</a></li>
  43959. </ul>
  43960. <div class="subsection-level-extent" id="Options-42">
  43961. <h4 class="subsection"><span>30.297.1 Options<a class="copiable-link" href="#Options-42"> &para;</a></span></h4>
  43962. <p>The filter accepts the following options.
  43963. </p>
  43964. <dl class="table">
  43965. <dt><samp class="option">width, w</samp></dt>
  43966. <dt><samp class="option">height, h</samp></dt>
  43967. <dd><p>Set the output video dimension expression. Default value is the input
  43968. dimension.
  43969. </p>
  43970. <p>If the <var class="var">width</var> or <var class="var">w</var> value is 0, the input width is used for
  43971. the output. If the <var class="var">height</var> or <var class="var">h</var> value is 0, the input height
  43972. is used for the output.
  43973. </p>
  43974. <p>If one and only one of the values is -n with n &gt;= 1, the zscale filter
  43975. will use a value that maintains the aspect ratio of the input image,
  43976. calculated from the other specified dimension. After that it will,
  43977. however, make sure that the calculated dimension is divisible by n and
  43978. adjust the value if necessary.
  43979. </p>
  43980. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  43981. both values being set to 0 as previously detailed.
  43982. </p>
  43983. <p>See below for the list of accepted constants for use in the dimension
  43984. expression.
  43985. </p>
  43986. </dd>
  43987. <dt><samp class="option">size, s</samp></dt>
  43988. <dd><p>Set the video size. For the syntax of this option, check the
  43989. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  43990. </p>
  43991. </dd>
  43992. <dt><samp class="option">dither, d</samp></dt>
  43993. <dd><p>Set the dither type.
  43994. </p>
  43995. <p>Possible values are:
  43996. </p><dl class="table">
  43997. <dt><var class="var">none</var></dt>
  43998. <dt><var class="var">ordered</var></dt>
  43999. <dt><var class="var">random</var></dt>
  44000. <dt><var class="var">error_diffusion</var></dt>
  44001. </dl>
  44002. <p>Default is none.
  44003. </p>
  44004. </dd>
  44005. <dt><samp class="option">filter, f</samp></dt>
  44006. <dd><p>Set the resize filter type.
  44007. </p>
  44008. <p>Possible values are:
  44009. </p><dl class="table">
  44010. <dt><var class="var">point</var></dt>
  44011. <dt><var class="var">bilinear</var></dt>
  44012. <dt><var class="var">bicubic</var></dt>
  44013. <dt><var class="var">spline16</var></dt>
  44014. <dt><var class="var">spline36</var></dt>
  44015. <dt><var class="var">lanczos</var></dt>
  44016. </dl>
  44017. <p>Default is bilinear.
  44018. </p>
  44019. </dd>
  44020. <dt><samp class="option">range, r</samp></dt>
  44021. <dd><p>Set the color range.
  44022. </p>
  44023. <p>Possible values are:
  44024. </p><dl class="table">
  44025. <dt><var class="var">input</var></dt>
  44026. <dt><var class="var">limited</var></dt>
  44027. <dt><var class="var">full</var></dt>
  44028. </dl>
  44029. <p>Default is same as input.
  44030. </p>
  44031. </dd>
  44032. <dt><samp class="option">primaries, p</samp></dt>
  44033. <dd><p>Set the color primaries.
  44034. </p>
  44035. <p>Possible values are:
  44036. </p><dl class="table">
  44037. <dt><var class="var">input</var></dt>
  44038. <dt><var class="var">709</var></dt>
  44039. <dt><var class="var">unspecified</var></dt>
  44040. <dt><var class="var">170m</var></dt>
  44041. <dt><var class="var">240m</var></dt>
  44042. <dt><var class="var">2020</var></dt>
  44043. </dl>
  44044. <p>Default is same as input.
  44045. </p>
  44046. </dd>
  44047. <dt><samp class="option">transfer, t</samp></dt>
  44048. <dd><p>Set the transfer characteristics.
  44049. </p>
  44050. <p>Possible values are:
  44051. </p><dl class="table">
  44052. <dt><var class="var">input</var></dt>
  44053. <dt><var class="var">709</var></dt>
  44054. <dt><var class="var">unspecified</var></dt>
  44055. <dt><var class="var">601</var></dt>
  44056. <dt><var class="var">linear</var></dt>
  44057. <dt><var class="var">2020_10</var></dt>
  44058. <dt><var class="var">2020_12</var></dt>
  44059. <dt><var class="var">smpte2084</var></dt>
  44060. <dt><var class="var">iec61966-2-1</var></dt>
  44061. <dt><var class="var">arib-std-b67</var></dt>
  44062. </dl>
  44063. <p>Default is same as input.
  44064. </p>
  44065. </dd>
  44066. <dt><samp class="option">matrix, m</samp></dt>
  44067. <dd><p>Set the colorspace matrix.
  44068. </p>
  44069. <p>Possible value are:
  44070. </p><dl class="table">
  44071. <dt><var class="var">input</var></dt>
  44072. <dt><var class="var">709</var></dt>
  44073. <dt><var class="var">unspecified</var></dt>
  44074. <dt><var class="var">470bg</var></dt>
  44075. <dt><var class="var">170m</var></dt>
  44076. <dt><var class="var">2020_ncl</var></dt>
  44077. <dt><var class="var">2020_cl</var></dt>
  44078. </dl>
  44079. <p>Default is same as input.
  44080. </p>
  44081. </dd>
  44082. <dt><samp class="option">rangein, rin</samp></dt>
  44083. <dd><p>Set the input color range.
  44084. </p>
  44085. <p>Possible values are:
  44086. </p><dl class="table">
  44087. <dt><var class="var">input</var></dt>
  44088. <dt><var class="var">limited</var></dt>
  44089. <dt><var class="var">full</var></dt>
  44090. </dl>
  44091. <p>Default is same as input.
  44092. </p>
  44093. </dd>
  44094. <dt><samp class="option">primariesin, pin</samp></dt>
  44095. <dd><p>Set the input color primaries.
  44096. </p>
  44097. <p>Possible values are:
  44098. </p><dl class="table">
  44099. <dt><var class="var">input</var></dt>
  44100. <dt><var class="var">709</var></dt>
  44101. <dt><var class="var">unspecified</var></dt>
  44102. <dt><var class="var">170m</var></dt>
  44103. <dt><var class="var">240m</var></dt>
  44104. <dt><var class="var">2020</var></dt>
  44105. </dl>
  44106. <p>Default is same as input.
  44107. </p>
  44108. </dd>
  44109. <dt><samp class="option">transferin, tin</samp></dt>
  44110. <dd><p>Set the input transfer characteristics.
  44111. </p>
  44112. <p>Possible values are:
  44113. </p><dl class="table">
  44114. <dt><var class="var">input</var></dt>
  44115. <dt><var class="var">709</var></dt>
  44116. <dt><var class="var">unspecified</var></dt>
  44117. <dt><var class="var">601</var></dt>
  44118. <dt><var class="var">linear</var></dt>
  44119. <dt><var class="var">2020_10</var></dt>
  44120. <dt><var class="var">2020_12</var></dt>
  44121. </dl>
  44122. <p>Default is same as input.
  44123. </p>
  44124. </dd>
  44125. <dt><samp class="option">matrixin, min</samp></dt>
  44126. <dd><p>Set the input colorspace matrix.
  44127. </p>
  44128. <p>Possible value are:
  44129. </p><dl class="table">
  44130. <dt><var class="var">input</var></dt>
  44131. <dt><var class="var">709</var></dt>
  44132. <dt><var class="var">unspecified</var></dt>
  44133. <dt><var class="var">470bg</var></dt>
  44134. <dt><var class="var">170m</var></dt>
  44135. <dt><var class="var">2020_ncl</var></dt>
  44136. <dt><var class="var">2020_cl</var></dt>
  44137. </dl>
  44138. </dd>
  44139. <dt><samp class="option">chromal, c</samp></dt>
  44140. <dd><p>Set the output chroma location.
  44141. </p>
  44142. <p>Possible values are:
  44143. </p><dl class="table">
  44144. <dt><var class="var">input</var></dt>
  44145. <dt><var class="var">left</var></dt>
  44146. <dt><var class="var">center</var></dt>
  44147. <dt><var class="var">topleft</var></dt>
  44148. <dt><var class="var">top</var></dt>
  44149. <dt><var class="var">bottomleft</var></dt>
  44150. <dt><var class="var">bottom</var></dt>
  44151. </dl>
  44152. </dd>
  44153. <dt><samp class="option">chromalin, cin</samp></dt>
  44154. <dd><p>Set the input chroma location.
  44155. </p>
  44156. <p>Possible values are:
  44157. </p><dl class="table">
  44158. <dt><var class="var">input</var></dt>
  44159. <dt><var class="var">left</var></dt>
  44160. <dt><var class="var">center</var></dt>
  44161. <dt><var class="var">topleft</var></dt>
  44162. <dt><var class="var">top</var></dt>
  44163. <dt><var class="var">bottomleft</var></dt>
  44164. <dt><var class="var">bottom</var></dt>
  44165. </dl>
  44166. </dd>
  44167. <dt><samp class="option">npl</samp></dt>
  44168. <dd><p>Set the nominal peak luminance.
  44169. </p>
  44170. </dd>
  44171. <dt><samp class="option">param_a</samp></dt>
  44172. <dd><p>Parameter A for scaling filters. Parameter &quot;b&quot; for bicubic, and the number of
  44173. filter taps for lanczos.
  44174. </p>
  44175. </dd>
  44176. <dt><samp class="option">param_b</samp></dt>
  44177. <dd><p>Parameter B for scaling filters. Parameter &quot;c&quot; for bicubic.
  44178. </p></dd>
  44179. </dl>
  44180. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  44181. containing the following constants:
  44182. </p>
  44183. <dl class="table">
  44184. <dt><var class="var">in_w</var></dt>
  44185. <dt><var class="var">in_h</var></dt>
  44186. <dd><p>The input width and height
  44187. </p>
  44188. </dd>
  44189. <dt><var class="var">iw</var></dt>
  44190. <dt><var class="var">ih</var></dt>
  44191. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  44192. </p>
  44193. </dd>
  44194. <dt><var class="var">out_w</var></dt>
  44195. <dt><var class="var">out_h</var></dt>
  44196. <dd><p>The output (scaled) width and height
  44197. </p>
  44198. </dd>
  44199. <dt><var class="var">ow</var></dt>
  44200. <dt><var class="var">oh</var></dt>
  44201. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  44202. </p>
  44203. </dd>
  44204. <dt><var class="var">a</var></dt>
  44205. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  44206. </p>
  44207. </dd>
  44208. <dt><var class="var">sar</var></dt>
  44209. <dd><p>input sample aspect ratio
  44210. </p>
  44211. </dd>
  44212. <dt><var class="var">dar</var></dt>
  44213. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  44214. </p>
  44215. </dd>
  44216. <dt><var class="var">hsub</var></dt>
  44217. <dt><var class="var">vsub</var></dt>
  44218. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  44219. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  44220. </p>
  44221. </dd>
  44222. <dt><var class="var">ohsub</var></dt>
  44223. <dt><var class="var">ovsub</var></dt>
  44224. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  44225. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  44226. </p></dd>
  44227. </dl>
  44228. </div>
  44229. <div class="subsection-level-extent" id="Commands-156">
  44230. <h4 class="subsection"><span>30.297.2 Commands<a class="copiable-link" href="#Commands-156"> &para;</a></span></h4>
  44231. <p>This filter supports the following commands:
  44232. </p><dl class="table">
  44233. <dt><samp class="option">width, w</samp></dt>
  44234. <dt><samp class="option">height, h</samp></dt>
  44235. <dd><p>Set the output video dimension expression.
  44236. The command accepts the same syntax of the corresponding option.
  44237. </p>
  44238. <p>If the specified expression is not valid, it is kept at its current
  44239. value.
  44240. </p></dd>
  44241. </dl>
  44242. </div>
  44243. </div>
  44244. </div>
  44245. <div class="chapter-level-extent" id="OpenCL-Video-Filters">
  44246. <h2 class="chapter"><span>31 OpenCL Video Filters<a class="copiable-link" href="#OpenCL-Video-Filters"> &para;</a></span></h2>
  44247. <p>Below is a description of the currently available OpenCL video filters.
  44248. </p>
  44249. <p>To enable compilation of these filters you need to configure FFmpeg with
  44250. <code class="code">--enable-opencl</code>.
  44251. </p>
  44252. <p>Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  44253. </p><dl class="table">
  44254. <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>
  44255. <dd><p>Initialise a new hardware device of type <var class="var">opencl</var> called <var class="var">name</var>, using the
  44256. given device parameters.
  44257. </p>
  44258. </dd>
  44259. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  44260. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  44261. </p>
  44262. </dd>
  44263. </dl>
  44264. <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>
  44265. </p>
  44266. <ul class="itemize mark-bullet">
  44267. <li>Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it.
  44268. <div class="example">
  44269. <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
  44270. </pre></div>
  44271. </li></ul>
  44272. <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.
  44273. </p>
  44274. <ul class="mini-toc">
  44275. <li><a href="#avgblur_005fopencl" accesskey="1">avgblur_opencl</a></li>
  44276. <li><a href="#boxblur_005fopencl" accesskey="2">boxblur_opencl</a></li>
  44277. <li><a href="#colorkey_005fopencl" accesskey="3">colorkey_opencl</a></li>
  44278. <li><a href="#convolution_005fopencl" accesskey="4">convolution_opencl</a></li>
  44279. <li><a href="#erosion_005fopencl" accesskey="5">erosion_opencl</a></li>
  44280. <li><a href="#deshake_005fopencl" accesskey="6">deshake_opencl</a></li>
  44281. <li><a href="#dilation_005fopencl" accesskey="7">dilation_opencl</a></li>
  44282. <li><a href="#nlmeans_005fopencl-1" accesskey="8">nlmeans_opencl</a></li>
  44283. <li><a href="#overlay_005fopencl" accesskey="9">overlay_opencl</a></li>
  44284. <li><a href="#pad_005fopencl">pad_opencl</a></li>
  44285. <li><a href="#prewitt_005fopencl">prewitt_opencl</a></li>
  44286. <li><a href="#program_005fopencl-1">program_opencl</a></li>
  44287. <li><a href="#remap_005fopencl">remap_opencl</a></li>
  44288. <li><a href="#roberts_005fopencl">roberts_opencl</a></li>
  44289. <li><a href="#sobel_005fopencl">sobel_opencl</a></li>
  44290. <li><a href="#tonemap_005fopencl">tonemap_opencl</a></li>
  44291. <li><a href="#unsharp_005fopencl">unsharp_opencl</a></li>
  44292. <li><a href="#xfade_005fopencl">xfade_opencl</a></li>
  44293. </ul>
  44294. <div class="section-level-extent" id="avgblur_005fopencl">
  44295. <h3 class="section"><span>31.1 avgblur_opencl<a class="copiable-link" href="#avgblur_005fopencl"> &para;</a></span></h3>
  44296. <p>Apply average blur filter.
  44297. </p>
  44298. <p>The filter accepts the following options:
  44299. </p>
  44300. <dl class="table">
  44301. <dt><samp class="option">sizeX</samp></dt>
  44302. <dd><p>Set horizontal radius size.
  44303. Range is <code class="code">[1, 1024]</code> and default value is <code class="code">1</code>.
  44304. </p>
  44305. </dd>
  44306. <dt><samp class="option">planes</samp></dt>
  44307. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  44308. </p>
  44309. </dd>
  44310. <dt><samp class="option">sizeY</samp></dt>
  44311. <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.
  44312. </p></dd>
  44313. </dl>
  44314. <ul class="mini-toc">
  44315. <li><a href="#Example" accesskey="1">Example</a></li>
  44316. </ul>
  44317. <div class="subsection-level-extent" id="Example">
  44318. <h4 class="subsection"><span>31.1.1 Example<a class="copiable-link" href="#Example"> &para;</a></span></h4>
  44319. <ul class="itemize mark-bullet">
  44320. <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.
  44321. <div class="example">
  44322. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, avgblur_opencl=3, hwdownload&quot; OUTPUT
  44323. </pre></div>
  44324. </li></ul>
  44325. </div>
  44326. </div>
  44327. <div class="section-level-extent" id="boxblur_005fopencl">
  44328. <h3 class="section"><span>31.2 boxblur_opencl<a class="copiable-link" href="#boxblur_005fopencl"> &para;</a></span></h3>
  44329. <p>Apply a boxblur algorithm to the input video.
  44330. </p>
  44331. <p>It accepts the following parameters:
  44332. </p>
  44333. <dl class="table">
  44334. <dt><samp class="option">luma_radius, lr</samp></dt>
  44335. <dt><samp class="option">luma_power, lp</samp></dt>
  44336. <dt><samp class="option">chroma_radius, cr</samp></dt>
  44337. <dt><samp class="option">chroma_power, cp</samp></dt>
  44338. <dt><samp class="option">alpha_radius, ar</samp></dt>
  44339. <dt><samp class="option">alpha_power, ap</samp></dt>
  44340. </dl>
  44341. <p>A description of the accepted options follows.
  44342. </p>
  44343. <dl class="table">
  44344. <dt><samp class="option">luma_radius, lr</samp></dt>
  44345. <dt><samp class="option">chroma_radius, cr</samp></dt>
  44346. <dt><samp class="option">alpha_radius, ar</samp></dt>
  44347. <dd><p>Set an expression for the box radius in pixels used for blurring the
  44348. corresponding input plane.
  44349. </p>
  44350. <p>The radius value must be a non-negative number, and must not be
  44351. greater than the value of the expression <code class="code">min(w,h)/2</code> for the
  44352. luma and alpha planes, and of <code class="code">min(cw,ch)/2</code> for the chroma
  44353. planes.
  44354. </p>
  44355. <p>Default value for <samp class="option">luma_radius</samp> is &quot;2&quot;. If not specified,
  44356. <samp class="option">chroma_radius</samp> and <samp class="option">alpha_radius</samp> default to the
  44357. corresponding value set for <samp class="option">luma_radius</samp>.
  44358. </p>
  44359. <p>The expressions can contain the following constants:
  44360. </p><dl class="table">
  44361. <dt><samp class="option">w</samp></dt>
  44362. <dt><samp class="option">h</samp></dt>
  44363. <dd><p>The input width and height in pixels.
  44364. </p>
  44365. </dd>
  44366. <dt><samp class="option">cw</samp></dt>
  44367. <dt><samp class="option">ch</samp></dt>
  44368. <dd><p>The input chroma image width and height in pixels.
  44369. </p>
  44370. </dd>
  44371. <dt><samp class="option">hsub</samp></dt>
  44372. <dt><samp class="option">vsub</samp></dt>
  44373. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  44374. pixel format &quot;yuv422p&quot;, <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  44375. </p></dd>
  44376. </dl>
  44377. </dd>
  44378. <dt><samp class="option">luma_power, lp</samp></dt>
  44379. <dt><samp class="option">chroma_power, cp</samp></dt>
  44380. <dt><samp class="option">alpha_power, ap</samp></dt>
  44381. <dd><p>Specify how many times the boxblur filter is applied to the
  44382. corresponding plane.
  44383. </p>
  44384. <p>Default value for <samp class="option">luma_power</samp> is 2. If not specified,
  44385. <samp class="option">chroma_power</samp> and <samp class="option">alpha_power</samp> default to the
  44386. corresponding value set for <samp class="option">luma_power</samp>.
  44387. </p>
  44388. <p>A value of 0 will disable the effect.
  44389. </p></dd>
  44390. </dl>
  44391. <ul class="mini-toc">
  44392. <li><a href="#Examples-159" accesskey="1">Examples</a></li>
  44393. </ul>
  44394. <div class="subsection-level-extent" id="Examples-159">
  44395. <h4 class="subsection"><span>31.2.1 Examples<a class="copiable-link" href="#Examples-159"> &para;</a></span></h4>
  44396. <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.
  44397. </p>
  44398. <ul class="itemize mark-bullet">
  44399. <li>Apply a boxblur filter with the luma, chroma, and alpha radius
  44400. 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.
  44401. <div class="example">
  44402. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload&quot; OUTPUT
  44403. -i INPUT -vf &quot;hwupload, boxblur_opencl=2:3, hwdownload&quot; OUTPUT
  44404. </pre></div>
  44405. </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.
  44406. <p>For the luma plane, a 2x2 box radius will be run once.
  44407. </p>
  44408. <p>For the chroma plane, a 4x4 box radius will be run 5 times.
  44409. </p>
  44410. <p>For the alpha plane, a 3x3 box radius will be run 7 times.
  44411. </p><div class="example">
  44412. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload&quot; OUTPUT
  44413. </pre></div>
  44414. </li></ul>
  44415. </div>
  44416. </div>
  44417. <div class="section-level-extent" id="colorkey_005fopencl">
  44418. <h3 class="section"><span>31.3 colorkey_opencl<a class="copiable-link" href="#colorkey_005fopencl"> &para;</a></span></h3>
  44419. <p>RGB colorspace color keying.
  44420. </p>
  44421. <p>The filter accepts the following options:
  44422. </p>
  44423. <dl class="table">
  44424. <dt><samp class="option">color</samp></dt>
  44425. <dd><p>The color which will be replaced with transparency.
  44426. </p>
  44427. </dd>
  44428. <dt><samp class="option">similarity</samp></dt>
  44429. <dd><p>Similarity percentage with the key color.
  44430. </p>
  44431. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  44432. </p>
  44433. </dd>
  44434. <dt><samp class="option">blend</samp></dt>
  44435. <dd><p>Blend percentage.
  44436. </p>
  44437. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  44438. </p>
  44439. <p>Higher values result in semi-transparent pixels, with a higher transparency
  44440. the more similar the pixels color is to the key color.
  44441. </p></dd>
  44442. </dl>
  44443. <ul class="mini-toc">
  44444. <li><a href="#Examples-160" accesskey="1">Examples</a></li>
  44445. </ul>
  44446. <div class="subsection-level-extent" id="Examples-160">
  44447. <h4 class="subsection"><span>31.3.1 Examples<a class="copiable-link" href="#Examples-160"> &para;</a></span></h4>
  44448. <ul class="itemize mark-bullet">
  44449. <li>Make every semi-green pixel in the input transparent with some slight blending:
  44450. <div class="example">
  44451. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, colorkey_opencl=green:0.3:0.1, hwdownload&quot; OUTPUT
  44452. </pre></div>
  44453. </li></ul>
  44454. </div>
  44455. </div>
  44456. <div class="section-level-extent" id="convolution_005fopencl">
  44457. <h3 class="section"><span>31.4 convolution_opencl<a class="copiable-link" href="#convolution_005fopencl"> &para;</a></span></h3>
  44458. <p>Apply convolution of 3x3, 5x5, 7x7 matrix.
  44459. </p>
  44460. <p>The filter accepts the following options:
  44461. </p>
  44462. <dl class="table">
  44463. <dt><samp class="option">0m</samp></dt>
  44464. <dt><samp class="option">1m</samp></dt>
  44465. <dt><samp class="option">2m</samp></dt>
  44466. <dt><samp class="option">3m</samp></dt>
  44467. <dd><p>Set matrix for each plane.
  44468. Matrix is sequence of 9, 25 or 49 signed numbers.
  44469. Default value for each plane is <code class="code">0 0 0 0 1 0 0 0 0</code>.
  44470. </p>
  44471. </dd>
  44472. <dt><samp class="option">0rdiv</samp></dt>
  44473. <dt><samp class="option">1rdiv</samp></dt>
  44474. <dt><samp class="option">2rdiv</samp></dt>
  44475. <dt><samp class="option">3rdiv</samp></dt>
  44476. <dd><p>Set multiplier for calculated value for each plane.
  44477. If unset or 0, it will be sum of all matrix elements.
  44478. 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>.
  44479. </p>
  44480. </dd>
  44481. <dt><samp class="option">0bias</samp></dt>
  44482. <dt><samp class="option">1bias</samp></dt>
  44483. <dt><samp class="option">2bias</samp></dt>
  44484. <dt><samp class="option">3bias</samp></dt>
  44485. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  44486. Useful for making the overall image brighter or darker.
  44487. 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>.
  44488. </p>
  44489. </dd>
  44490. </dl>
  44491. <ul class="mini-toc">
  44492. <li><a href="#Examples-161" accesskey="1">Examples</a></li>
  44493. </ul>
  44494. <div class="subsection-level-extent" id="Examples-161">
  44495. <h4 class="subsection"><span>31.4.1 Examples<a class="copiable-link" href="#Examples-161"> &para;</a></span></h4>
  44496. <ul class="itemize mark-bullet">
  44497. <li>Apply sharpen:
  44498. <div class="example">
  44499. <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
  44500. </pre></div>
  44501. </li><li>Apply blur:
  44502. <div class="example">
  44503. <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
  44504. </pre></div>
  44505. </li><li>Apply edge enhance:
  44506. <div class="example">
  44507. <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
  44508. </pre></div>
  44509. </li><li>Apply edge detect:
  44510. <div class="example">
  44511. <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
  44512. </pre></div>
  44513. </li><li>Apply laplacian edge detector which includes diagonals:
  44514. <div class="example">
  44515. <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
  44516. </pre></div>
  44517. </li><li>Apply emboss:
  44518. <div class="example">
  44519. <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
  44520. </pre></div>
  44521. </li></ul>
  44522. </div>
  44523. </div>
  44524. <div class="section-level-extent" id="erosion_005fopencl">
  44525. <h3 class="section"><span>31.5 erosion_opencl<a class="copiable-link" href="#erosion_005fopencl"> &para;</a></span></h3>
  44526. <p>Apply erosion effect to the video.
  44527. </p>
  44528. <p>This filter replaces the pixel by the local(3x3) minimum.
  44529. </p>
  44530. <p>It accepts the following options:
  44531. </p>
  44532. <dl class="table">
  44533. <dt><samp class="option">threshold0</samp></dt>
  44534. <dt><samp class="option">threshold1</samp></dt>
  44535. <dt><samp class="option">threshold2</samp></dt>
  44536. <dt><samp class="option">threshold3</samp></dt>
  44537. <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>.
  44538. If <code class="code">0</code>, plane will remain unchanged.
  44539. </p>
  44540. </dd>
  44541. <dt><samp class="option">coordinates</samp></dt>
  44542. <dd><p>Flag which specifies the pixel to refer to.
  44543. Range is <code class="code">[0, 255]</code> and default value is <code class="code">255</code>, i.e. all eight pixels are used.
  44544. </p>
  44545. <p>Flags to local 3x3 coordinates region centered on <code class="code">x</code>:
  44546. </p>
  44547. <p>1 2 3
  44548. </p>
  44549. <p>4 x 5
  44550. </p>
  44551. <p>6 7 8
  44552. </p></dd>
  44553. </dl>
  44554. <ul class="mini-toc">
  44555. <li><a href="#Example-1" accesskey="1">Example</a></li>
  44556. </ul>
  44557. <div class="subsection-level-extent" id="Example-1">
  44558. <h4 class="subsection"><span>31.5.1 Example<a class="copiable-link" href="#Example-1"> &para;</a></span></h4>
  44559. <ul class="itemize mark-bullet">
  44560. <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.
  44561. <div class="example">
  44562. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  44563. </pre></div>
  44564. </li></ul>
  44565. </div>
  44566. </div>
  44567. <div class="section-level-extent" id="deshake_005fopencl">
  44568. <h3 class="section"><span>31.6 deshake_opencl<a class="copiable-link" href="#deshake_005fopencl"> &para;</a></span></h3>
  44569. <p>Feature-point based video stabilization filter.
  44570. </p>
  44571. <p>The filter accepts the following options:
  44572. </p>
  44573. <dl class="table">
  44574. <dt><samp class="option">tripod</samp></dt>
  44575. <dd><p>Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to <code class="code">0</code>.
  44576. </p>
  44577. </dd>
  44578. <dt><samp class="option">debug</samp></dt>
  44579. <dd><p>Whether or not additional debug info should be displayed, both in the processed output and in the console.
  44580. </p>
  44581. <p>Note that in order to see console debug output you will also need to pass <code class="code">-v verbose</code> to ffmpeg.
  44582. </p>
  44583. <p>Viewing point matches in the output video is only supported for RGB input.
  44584. </p>
  44585. <p>Defaults to <code class="code">0</code>.
  44586. </p>
  44587. </dd>
  44588. <dt><samp class="option">adaptive_crop</samp></dt>
  44589. <dd><p>Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels.
  44590. </p>
  44591. <p>Defaults to <code class="code">1</code>.
  44592. </p>
  44593. </dd>
  44594. <dt><samp class="option">refine_features</samp></dt>
  44595. <dd><p>Whether or not feature points should be refined at a sub-pixel level.
  44596. </p>
  44597. <p>This can be turned off for a slight performance gain at the cost of precision.
  44598. </p>
  44599. <p>Defaults to <code class="code">1</code>.
  44600. </p>
  44601. </dd>
  44602. <dt><samp class="option">smooth_strength</samp></dt>
  44603. <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>.
  44604. </p>
  44605. <p><code class="code">1.0</code> is the maximum smoothing strength while values less than that result in less smoothing.
  44606. </p>
  44607. <p><code class="code">0.0</code> causes the filter to adaptively choose a smoothing strength on a per-frame basis.
  44608. </p>
  44609. <p>Defaults to <code class="code">0.0</code>.
  44610. </p>
  44611. </dd>
  44612. <dt><samp class="option">smooth_window_multiplier</samp></dt>
  44613. <dd><p>Controls the size of the smoothing window (the number of frames buffered to determine motion information from).
  44614. </p>
  44615. <p>The size of the smoothing window is determined by multiplying the framerate of the video by this number.
  44616. </p>
  44617. <p>Acceptable values range from <code class="code">0.1</code> to <code class="code">10.0</code>.
  44618. </p>
  44619. <p>Larger values increase the amount of motion data available for determining how to smooth the camera path,
  44620. potentially improving smoothness, but also increase latency and memory usage.
  44621. </p>
  44622. <p>Defaults to <code class="code">2.0</code>.
  44623. </p>
  44624. </dd>
  44625. </dl>
  44626. <ul class="mini-toc">
  44627. <li><a href="#Examples-162" accesskey="1">Examples</a></li>
  44628. </ul>
  44629. <div class="subsection-level-extent" id="Examples-162">
  44630. <h4 class="subsection"><span>31.6.1 Examples<a class="copiable-link" href="#Examples-162"> &para;</a></span></h4>
  44631. <ul class="itemize mark-bullet">
  44632. <li>Stabilize a video with a fixed, medium smoothing strength:
  44633. <div class="example">
  44634. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, deshake_opencl=smooth_strength=0.5, hwdownload&quot; OUTPUT
  44635. </pre></div>
  44636. </li><li>Stabilize a video with debugging (both in console and in rendered video):
  44637. <div class="example">
  44638. <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
  44639. </pre></div>
  44640. </li></ul>
  44641. </div>
  44642. </div>
  44643. <div class="section-level-extent" id="dilation_005fopencl">
  44644. <h3 class="section"><span>31.7 dilation_opencl<a class="copiable-link" href="#dilation_005fopencl"> &para;</a></span></h3>
  44645. <p>Apply dilation effect to the video.
  44646. </p>
  44647. <p>This filter replaces the pixel by the local(3x3) maximum.
  44648. </p>
  44649. <p>It accepts the following options:
  44650. </p>
  44651. <dl class="table">
  44652. <dt><samp class="option">threshold0</samp></dt>
  44653. <dt><samp class="option">threshold1</samp></dt>
  44654. <dt><samp class="option">threshold2</samp></dt>
  44655. <dt><samp class="option">threshold3</samp></dt>
  44656. <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>.
  44657. If <code class="code">0</code>, plane will remain unchanged.
  44658. </p>
  44659. </dd>
  44660. <dt><samp class="option">coordinates</samp></dt>
  44661. <dd><p>Flag which specifies the pixel to refer to.
  44662. Range is <code class="code">[0, 255]</code> and default value is <code class="code">255</code>, i.e. all eight pixels are used.
  44663. </p>
  44664. <p>Flags to local 3x3 coordinates region centered on <code class="code">x</code>:
  44665. </p>
  44666. <p>1 2 3
  44667. </p>
  44668. <p>4 x 5
  44669. </p>
  44670. <p>6 7 8
  44671. </p></dd>
  44672. </dl>
  44673. <ul class="mini-toc">
  44674. <li><a href="#Example-2" accesskey="1">Example</a></li>
  44675. </ul>
  44676. <div class="subsection-level-extent" id="Example-2">
  44677. <h4 class="subsection"><span>31.7.1 Example<a class="copiable-link" href="#Example-2"> &para;</a></span></h4>
  44678. <ul class="itemize mark-bullet">
  44679. <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.
  44680. <div class="example">
  44681. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  44682. </pre></div>
  44683. </li></ul>
  44684. <a class="anchor" id="nlmeans_005fopencl"></a></div>
  44685. </div>
  44686. <div class="section-level-extent" id="nlmeans_005fopencl-1">
  44687. <h3 class="section"><span>31.8 nlmeans_opencl<a class="copiable-link" href="#nlmeans_005fopencl-1"> &para;</a></span></h3>
  44688. <p>Non-local Means denoise filter through OpenCL, this filter accepts same options as <a class="ref" href="#nlmeans">nlmeans</a>.
  44689. </p>
  44690. </div>
  44691. <div class="section-level-extent" id="overlay_005fopencl">
  44692. <h3 class="section"><span>31.9 overlay_opencl<a class="copiable-link" href="#overlay_005fopencl"> &para;</a></span></h3>
  44693. <p>Overlay one video on top of another.
  44694. </p>
  44695. <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.
  44696. This filter requires same memory layout for all the inputs. So, format conversion may be needed.
  44697. </p>
  44698. <p>The filter accepts the following options:
  44699. </p>
  44700. <dl class="table">
  44701. <dt><samp class="option">x</samp></dt>
  44702. <dd><p>Set the x coordinate of the overlaid video on the main video.
  44703. Default value is <code class="code">0</code>.
  44704. </p>
  44705. </dd>
  44706. <dt><samp class="option">y</samp></dt>
  44707. <dd><p>Set the y coordinate of the overlaid video on the main video.
  44708. Default value is <code class="code">0</code>.
  44709. </p>
  44710. </dd>
  44711. </dl>
  44712. <ul class="mini-toc">
  44713. <li><a href="#Examples-163" accesskey="1">Examples</a></li>
  44714. </ul>
  44715. <div class="subsection-level-extent" id="Examples-163">
  44716. <h4 class="subsection"><span>31.9.1 Examples<a class="copiable-link" href="#Examples-163"> &para;</a></span></h4>
  44717. <ul class="itemize mark-bullet">
  44718. <li>Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format.
  44719. <div class="example">
  44720. <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
  44721. </pre></div>
  44722. </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.
  44723. <div class="example">
  44724. <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
  44725. </pre></div>
  44726. </li></ul>
  44727. </div>
  44728. </div>
  44729. <div class="section-level-extent" id="pad_005fopencl">
  44730. <h3 class="section"><span>31.10 pad_opencl<a class="copiable-link" href="#pad_005fopencl"> &para;</a></span></h3>
  44731. <p>Add paddings to the input image, and place the original input at the
  44732. provided <var class="var">x</var>, <var class="var">y</var> coordinates.
  44733. </p>
  44734. <p>It accepts the following options:
  44735. </p>
  44736. <dl class="table">
  44737. <dt><samp class="option">width, w</samp></dt>
  44738. <dt><samp class="option">height, h</samp></dt>
  44739. <dd><p>Specify an expression for the size of the output image with the
  44740. paddings added. If the value for <var class="var">width</var> or <var class="var">height</var> is 0, the
  44741. corresponding input size is used for the output.
  44742. </p>
  44743. <p>The <var class="var">width</var> expression can reference the value set by the
  44744. <var class="var">height</var> expression, and vice versa.
  44745. </p>
  44746. <p>The default value of <var class="var">width</var> and <var class="var">height</var> is 0.
  44747. </p>
  44748. </dd>
  44749. <dt><samp class="option">x</samp></dt>
  44750. <dt><samp class="option">y</samp></dt>
  44751. <dd><p>Specify the offsets to place the input image at within the padded area,
  44752. with respect to the top/left border of the output image.
  44753. </p>
  44754. <p>The <var class="var">x</var> expression can reference the value set by the <var class="var">y</var>
  44755. expression, and vice versa.
  44756. </p>
  44757. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is 0.
  44758. </p>
  44759. <p>If <var class="var">x</var> or <var class="var">y</var> evaluate to a negative number, they&rsquo;ll be changed
  44760. so the input image is centered on the padded area.
  44761. </p>
  44762. </dd>
  44763. <dt><samp class="option">color</samp></dt>
  44764. <dd><p>Specify the color of the padded area. For the syntax of this option,
  44765. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  44766. manual</a>.
  44767. </p>
  44768. </dd>
  44769. <dt><samp class="option">aspect</samp></dt>
  44770. <dd><p>Pad to an aspect instead to a resolution.
  44771. </p></dd>
  44772. </dl>
  44773. <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>
  44774. options are expressions containing the following constants:
  44775. </p>
  44776. <dl class="table">
  44777. <dt><samp class="option">in_w</samp></dt>
  44778. <dt><samp class="option">in_h</samp></dt>
  44779. <dd><p>The input video width and height.
  44780. </p>
  44781. </dd>
  44782. <dt><samp class="option">iw</samp></dt>
  44783. <dt><samp class="option">ih</samp></dt>
  44784. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  44785. </p>
  44786. </dd>
  44787. <dt><samp class="option">out_w</samp></dt>
  44788. <dt><samp class="option">out_h</samp></dt>
  44789. <dd><p>The output width and height (the size of the padded area), as
  44790. specified by the <var class="var">width</var> and <var class="var">height</var> expressions.
  44791. </p>
  44792. </dd>
  44793. <dt><samp class="option">ow</samp></dt>
  44794. <dt><samp class="option">oh</samp></dt>
  44795. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  44796. </p>
  44797. </dd>
  44798. <dt><samp class="option">x</samp></dt>
  44799. <dt><samp class="option">y</samp></dt>
  44800. <dd><p>The x and y offsets as specified by the <var class="var">x</var> and <var class="var">y</var>
  44801. expressions, or NAN if not yet specified.
  44802. </p>
  44803. </dd>
  44804. <dt><samp class="option">a</samp></dt>
  44805. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  44806. </p>
  44807. </dd>
  44808. <dt><samp class="option">sar</samp></dt>
  44809. <dd><p>input sample aspect ratio
  44810. </p>
  44811. </dd>
  44812. <dt><samp class="option">dar</samp></dt>
  44813. <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>
  44814. </p></dd>
  44815. </dl>
  44816. </div>
  44817. <div class="section-level-extent" id="prewitt_005fopencl">
  44818. <h3 class="section"><span>31.11 prewitt_opencl<a class="copiable-link" href="#prewitt_005fopencl"> &para;</a></span></h3>
  44819. <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.
  44820. </p>
  44821. <p>The filter accepts the following option:
  44822. </p>
  44823. <dl class="table">
  44824. <dt><samp class="option">planes</samp></dt>
  44825. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  44826. </p>
  44827. </dd>
  44828. <dt><samp class="option">scale</samp></dt>
  44829. <dd><p>Set value which will be multiplied with filtered result.
  44830. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  44831. </p>
  44832. </dd>
  44833. <dt><samp class="option">delta</samp></dt>
  44834. <dd><p>Set value which will be added to filtered result.
  44835. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  44836. </p></dd>
  44837. </dl>
  44838. <ul class="mini-toc">
  44839. <li><a href="#Example-3" accesskey="1">Example</a></li>
  44840. </ul>
  44841. <div class="subsection-level-extent" id="Example-3">
  44842. <h4 class="subsection"><span>31.11.1 Example<a class="copiable-link" href="#Example-3"> &para;</a></span></h4>
  44843. <ul class="itemize mark-bullet">
  44844. <li>Apply the Prewitt operator with scale set to 2 and delta set to 10.
  44845. <div class="example">
  44846. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, prewitt_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  44847. </pre></div>
  44848. </li></ul>
  44849. <a class="anchor" id="program_005fopencl"></a></div>
  44850. </div>
  44851. <div class="section-level-extent" id="program_005fopencl-1">
  44852. <h3 class="section"><span>31.12 program_opencl<a class="copiable-link" href="#program_005fopencl-1"> &para;</a></span></h3>
  44853. <p>Filter video using an OpenCL program.
  44854. </p>
  44855. <dl class="table">
  44856. <dt><samp class="option">source</samp></dt>
  44857. <dd><p>OpenCL program source file.
  44858. </p>
  44859. </dd>
  44860. <dt><samp class="option">kernel</samp></dt>
  44861. <dd><p>Kernel name in program.
  44862. </p>
  44863. </dd>
  44864. <dt><samp class="option">inputs</samp></dt>
  44865. <dd><p>Number of inputs to the filter. Defaults to 1.
  44866. </p>
  44867. </dd>
  44868. <dt><samp class="option">size, s</samp></dt>
  44869. <dd><p>Size of output frames. Defaults to the same as the first input.
  44870. </p>
  44871. </dd>
  44872. </dl>
  44873. <p>The <code class="code">program_opencl</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  44874. </p>
  44875. <p>The program source file must contain a kernel function with the given name,
  44876. which will be run once for each plane of the output. Each run on a plane
  44877. gets enqueued as a separate 2D global NDRange with one work-item for each
  44878. pixel to be generated. The global ID offset for each work-item is therefore
  44879. the coordinates of a pixel in the destination image.
  44880. </p>
  44881. <p>The kernel function needs to take the following arguments:
  44882. </p><ul class="itemize mark-bullet">
  44883. <li>Destination image, <var class="var">__write_only image2d_t</var>.
  44884. <p>This image will become the output; the kernel should write all of it.
  44885. </p></li><li>Frame index, <var class="var">unsigned int</var>.
  44886. <p>This is a counter starting from zero and increasing by one for each frame.
  44887. </p></li><li>Source images, <var class="var">__read_only image2d_t</var>.
  44888. <p>These are the most recent images on each input. The kernel may read from
  44889. them to generate the output, but they can&rsquo;t be written to.
  44890. </p></li></ul>
  44891. <p>Example programs:
  44892. </p>
  44893. <ul class="itemize mark-bullet">
  44894. <li>Copy the input to the output (output must be the same size as the input).
  44895. <pre class="verbatim">__kernel void copy(__write_only image2d_t destination,
  44896. unsigned int index,
  44897. __read_only image2d_t source)
  44898. {
  44899. const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
  44900. int2 location = (int2)(get_global_id(0), get_global_id(1));
  44901. float4 value = read_imagef(source, sampler, location);
  44902. write_imagef(destination, location, value);
  44903. }
  44904. </pre>
  44905. </li><li>Apply a simple transformation, rotating the input by an amount increasing
  44906. with the index counter. Pixel values are linearly interpolated by the
  44907. sampler, and the output need not have the same dimensions as the input.
  44908. <pre class="verbatim">__kernel void rotate_image(__write_only image2d_t dst,
  44909. unsigned int index,
  44910. __read_only image2d_t src)
  44911. {
  44912. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  44913. CLK_FILTER_LINEAR);
  44914. float angle = (float)index / 100.0f;
  44915. float2 dst_dim = convert_float2(get_image_dim(dst));
  44916. float2 src_dim = convert_float2(get_image_dim(src));
  44917. float2 dst_cen = dst_dim / 2.0f;
  44918. float2 src_cen = src_dim / 2.0f;
  44919. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  44920. float2 dst_pos = convert_float2(dst_loc) - dst_cen;
  44921. float2 src_pos = {
  44922. cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
  44923. sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
  44924. };
  44925. src_pos = src_pos * src_dim / dst_dim;
  44926. float2 src_loc = src_pos + src_cen;
  44927. if (src_loc.x &lt; 0.0f || src_loc.y &lt; 0.0f ||
  44928. src_loc.x &gt; src_dim.x || src_loc.y &gt; src_dim.y)
  44929. write_imagef(dst, dst_loc, 0.5f);
  44930. else
  44931. write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
  44932. }
  44933. </pre>
  44934. </li><li>Blend two inputs together, with the amount of each input used varying
  44935. with the index counter.
  44936. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  44937. unsigned int index,
  44938. __read_only image2d_t src1,
  44939. __read_only image2d_t src2)
  44940. {
  44941. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  44942. CLK_FILTER_LINEAR);
  44943. float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
  44944. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  44945. int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
  44946. int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
  44947. float4 val1 = read_imagef(src1, sampler, src1_loc);
  44948. float4 val2 = read_imagef(src2, sampler, src2_loc);
  44949. write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
  44950. }
  44951. </pre>
  44952. </li></ul>
  44953. </div>
  44954. <div class="section-level-extent" id="remap_005fopencl">
  44955. <h3 class="section"><span>31.13 remap_opencl<a class="copiable-link" href="#remap_005fopencl"> &para;</a></span></h3>
  44956. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  44957. </p>
  44958. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  44959. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  44960. value for pixel will be used for destination pixel.
  44961. </p>
  44962. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  44963. will have Xmap/Ymap video stream dimensions.
  44964. Xmap and Ymap input video streams are 32bit float pixel format, single channel.
  44965. </p>
  44966. <dl class="table">
  44967. <dt><samp class="option">interp</samp></dt>
  44968. <dd><p>Specify interpolation used for remapping of pixels.
  44969. Allowed values are <code class="code">near</code> and <code class="code">linear</code>.
  44970. Default value is <code class="code">linear</code>.
  44971. </p>
  44972. </dd>
  44973. <dt><samp class="option">fill</samp></dt>
  44974. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  44975. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  44976. manual</a>. Default color is <code class="code">black</code>.
  44977. </p></dd>
  44978. </dl>
  44979. </div>
  44980. <div class="section-level-extent" id="roberts_005fopencl">
  44981. <h3 class="section"><span>31.14 roberts_opencl<a class="copiable-link" href="#roberts_005fopencl"> &para;</a></span></h3>
  44982. <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.
  44983. </p>
  44984. <p>The filter accepts the following option:
  44985. </p>
  44986. <dl class="table">
  44987. <dt><samp class="option">planes</samp></dt>
  44988. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  44989. </p>
  44990. </dd>
  44991. <dt><samp class="option">scale</samp></dt>
  44992. <dd><p>Set value which will be multiplied with filtered result.
  44993. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  44994. </p>
  44995. </dd>
  44996. <dt><samp class="option">delta</samp></dt>
  44997. <dd><p>Set value which will be added to filtered result.
  44998. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  44999. </p></dd>
  45000. </dl>
  45001. <ul class="mini-toc">
  45002. <li><a href="#Example-4" accesskey="1">Example</a></li>
  45003. </ul>
  45004. <div class="subsection-level-extent" id="Example-4">
  45005. <h4 class="subsection"><span>31.14.1 Example<a class="copiable-link" href="#Example-4"> &para;</a></span></h4>
  45006. <ul class="itemize mark-bullet">
  45007. <li>Apply the Roberts cross operator with scale set to 2 and delta set to 10
  45008. <div class="example">
  45009. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, roberts_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  45010. </pre></div>
  45011. </li></ul>
  45012. </div>
  45013. </div>
  45014. <div class="section-level-extent" id="sobel_005fopencl">
  45015. <h3 class="section"><span>31.15 sobel_opencl<a class="copiable-link" href="#sobel_005fopencl"> &para;</a></span></h3>
  45016. <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.
  45017. </p>
  45018. <p>The filter accepts the following option:
  45019. </p>
  45020. <dl class="table">
  45021. <dt><samp class="option">planes</samp></dt>
  45022. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  45023. </p>
  45024. </dd>
  45025. <dt><samp class="option">scale</samp></dt>
  45026. <dd><p>Set value which will be multiplied with filtered result.
  45027. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  45028. </p>
  45029. </dd>
  45030. <dt><samp class="option">delta</samp></dt>
  45031. <dd><p>Set value which will be added to filtered result.
  45032. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  45033. </p></dd>
  45034. </dl>
  45035. <ul class="mini-toc">
  45036. <li><a href="#Example-5" accesskey="1">Example</a></li>
  45037. </ul>
  45038. <div class="subsection-level-extent" id="Example-5">
  45039. <h4 class="subsection"><span>31.15.1 Example<a class="copiable-link" href="#Example-5"> &para;</a></span></h4>
  45040. <ul class="itemize mark-bullet">
  45041. <li>Apply sobel operator with scale set to 2 and delta set to 10
  45042. <div class="example">
  45043. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, sobel_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  45044. </pre></div>
  45045. </li></ul>
  45046. </div>
  45047. </div>
  45048. <div class="section-level-extent" id="tonemap_005fopencl">
  45049. <h3 class="section"><span>31.16 tonemap_opencl<a class="copiable-link" href="#tonemap_005fopencl"> &para;</a></span></h3>
  45050. <p>Perform HDR(PQ/HLG) to SDR conversion with tone-mapping.
  45051. </p>
  45052. <p>It accepts the following parameters:
  45053. </p>
  45054. <dl class="table">
  45055. <dt><samp class="option">tonemap</samp></dt>
  45056. <dd><p>Specify the tone-mapping operator to be used. Same as tonemap option in <a class="ref" href="#tonemap">tonemap</a>.
  45057. </p>
  45058. </dd>
  45059. <dt><samp class="option">param</samp></dt>
  45060. <dd><p>Tune the tone mapping algorithm. same as param option in <a class="ref" href="#tonemap">tonemap</a>.
  45061. </p>
  45062. </dd>
  45063. <dt><samp class="option">desat</samp></dt>
  45064. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  45065. higher the parameter, the more color information will be preserved. This
  45066. setting helps prevent unnaturally blown-out colors for super-highlights, by
  45067. (smoothly) turning into white instead. This makes images feel more natural,
  45068. at the cost of reducing information about out-of-range colors.
  45069. </p>
  45070. <p>The default value is 0.5, and the algorithm here is a little different from
  45071. the cpu version tonemap currently. A setting of 0.0 disables this option.
  45072. </p>
  45073. </dd>
  45074. <dt><samp class="option">threshold</samp></dt>
  45075. <dd><p>The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold
  45076. is used to detect whether the scene has changed or not. If the distance between
  45077. the current frame average brightness and the current running average exceeds
  45078. a threshold value, we would re-calculate scene average and peak brightness.
  45079. The default value is 0.2.
  45080. </p>
  45081. </dd>
  45082. <dt><samp class="option">format</samp></dt>
  45083. <dd><p>Specify the output pixel format.
  45084. </p>
  45085. <p>Currently supported formats are:
  45086. </p><dl class="table">
  45087. <dt><var class="var">p010</var></dt>
  45088. <dt><var class="var">nv12</var></dt>
  45089. </dl>
  45090. </dd>
  45091. <dt><samp class="option">range, r</samp></dt>
  45092. <dd><p>Set the output color range.
  45093. </p>
  45094. <p>Possible values are:
  45095. </p><dl class="table">
  45096. <dt><var class="var">tv/mpeg</var></dt>
  45097. <dt><var class="var">pc/jpeg</var></dt>
  45098. </dl>
  45099. <p>Default is same as input.
  45100. </p>
  45101. </dd>
  45102. <dt><samp class="option">primaries, p</samp></dt>
  45103. <dd><p>Set the output color primaries.
  45104. </p>
  45105. <p>Possible values are:
  45106. </p><dl class="table">
  45107. <dt><var class="var">bt709</var></dt>
  45108. <dt><var class="var">bt2020</var></dt>
  45109. </dl>
  45110. <p>Default is same as input.
  45111. </p>
  45112. </dd>
  45113. <dt><samp class="option">transfer, t</samp></dt>
  45114. <dd><p>Set the output transfer characteristics.
  45115. </p>
  45116. <p>Possible values are:
  45117. </p><dl class="table">
  45118. <dt><var class="var">bt709</var></dt>
  45119. <dt><var class="var">bt2020</var></dt>
  45120. </dl>
  45121. <p>Default is bt709.
  45122. </p>
  45123. </dd>
  45124. <dt><samp class="option">matrix, m</samp></dt>
  45125. <dd><p>Set the output colorspace matrix.
  45126. </p>
  45127. <p>Possible value are:
  45128. </p><dl class="table">
  45129. <dt><var class="var">bt709</var></dt>
  45130. <dt><var class="var">bt2020</var></dt>
  45131. </dl>
  45132. <p>Default is same as input.
  45133. </p>
  45134. </dd>
  45135. </dl>
  45136. <ul class="mini-toc">
  45137. <li><a href="#Example-6" accesskey="1">Example</a></li>
  45138. </ul>
  45139. <div class="subsection-level-extent" id="Example-6">
  45140. <h4 class="subsection"><span>31.16.1 Example<a class="copiable-link" href="#Example-6"> &para;</a></span></h4>
  45141. <ul class="itemize mark-bullet">
  45142. <li>Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator.
  45143. <div class="example">
  45144. <pre class="example-preformatted">-i INPUT -vf &quot;format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010&quot; OUTPUT
  45145. </pre></div>
  45146. </li></ul>
  45147. </div>
  45148. </div>
  45149. <div class="section-level-extent" id="unsharp_005fopencl">
  45150. <h3 class="section"><span>31.17 unsharp_opencl<a class="copiable-link" href="#unsharp_005fopencl"> &para;</a></span></h3>
  45151. <p>Sharpen or blur the input video.
  45152. </p>
  45153. <p>It accepts the following parameters:
  45154. </p>
  45155. <dl class="table">
  45156. <dt><samp class="option">luma_msize_x, lx</samp></dt>
  45157. <dd><p>Set the luma matrix horizontal size.
  45158. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  45159. </p>
  45160. </dd>
  45161. <dt><samp class="option">luma_msize_y, ly</samp></dt>
  45162. <dd><p>Set the luma matrix vertical size.
  45163. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  45164. </p>
  45165. </dd>
  45166. <dt><samp class="option">luma_amount, la</samp></dt>
  45167. <dd><p>Set the luma effect strength.
  45168. Range is <code class="code">[-10, 10]</code> and default value is <code class="code">1.0</code>.
  45169. </p>
  45170. <p>Negative values will blur the input video, while positive values will
  45171. sharpen it, a value of zero will disable the effect.
  45172. </p>
  45173. </dd>
  45174. <dt><samp class="option">chroma_msize_x, cx</samp></dt>
  45175. <dd><p>Set the chroma matrix horizontal size.
  45176. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  45177. </p>
  45178. </dd>
  45179. <dt><samp class="option">chroma_msize_y, cy</samp></dt>
  45180. <dd><p>Set the chroma matrix vertical size.
  45181. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  45182. </p>
  45183. </dd>
  45184. <dt><samp class="option">chroma_amount, ca</samp></dt>
  45185. <dd><p>Set the chroma effect strength.
  45186. Range is <code class="code">[-10, 10]</code> and default value is <code class="code">0.0</code>.
  45187. </p>
  45188. <p>Negative values will blur the input video, while positive values will
  45189. sharpen it, a value of zero will disable the effect.
  45190. </p>
  45191. </dd>
  45192. </dl>
  45193. <p>All parameters are optional and default to the equivalent of the
  45194. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  45195. </p>
  45196. <ul class="mini-toc">
  45197. <li><a href="#Examples-164" accesskey="1">Examples</a></li>
  45198. </ul>
  45199. <div class="subsection-level-extent" id="Examples-164">
  45200. <h4 class="subsection"><span>31.17.1 Examples<a class="copiable-link" href="#Examples-164"> &para;</a></span></h4>
  45201. <ul class="itemize mark-bullet">
  45202. <li>Apply strong luma sharpen effect:
  45203. <div class="example">
  45204. <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
  45205. </pre></div>
  45206. </li><li>Apply a strong blur of both luma and chroma parameters:
  45207. <div class="example">
  45208. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload&quot; OUTPUT
  45209. </pre></div>
  45210. </li></ul>
  45211. </div>
  45212. </div>
  45213. <div class="section-level-extent" id="xfade_005fopencl">
  45214. <h3 class="section"><span>31.18 xfade_opencl<a class="copiable-link" href="#xfade_005fopencl"> &para;</a></span></h3>
  45215. <p>Cross fade two videos with custom transition effect by using OpenCL.
  45216. </p>
  45217. <p>It accepts the following options:
  45218. </p>
  45219. <dl class="table">
  45220. <dt><samp class="option">transition</samp></dt>
  45221. <dd><p>Set one of possible transition effects.
  45222. </p>
  45223. <dl class="table">
  45224. <dt><samp class="option">custom</samp></dt>
  45225. <dd><p>Select custom transition effect, the actual transition description
  45226. will be picked from source and kernel options.
  45227. </p>
  45228. </dd>
  45229. <dt><samp class="option">fade</samp></dt>
  45230. <dt><samp class="option">wipeleft</samp></dt>
  45231. <dt><samp class="option">wiperight</samp></dt>
  45232. <dt><samp class="option">wipeup</samp></dt>
  45233. <dt><samp class="option">wipedown</samp></dt>
  45234. <dt><samp class="option">slideleft</samp></dt>
  45235. <dt><samp class="option">slideright</samp></dt>
  45236. <dt><samp class="option">slideup</samp></dt>
  45237. <dt><samp class="option">slidedown</samp></dt>
  45238. <dd>
  45239. <p>Default transition is fade.
  45240. </p></dd>
  45241. </dl>
  45242. </dd>
  45243. <dt><samp class="option">source</samp></dt>
  45244. <dd><p>OpenCL program source file for custom transition.
  45245. </p>
  45246. </dd>
  45247. <dt><samp class="option">kernel</samp></dt>
  45248. <dd><p>Set name of kernel to use for custom transition from program source file.
  45249. </p>
  45250. </dd>
  45251. <dt><samp class="option">duration</samp></dt>
  45252. <dd><p>Set duration of video transition.
  45253. </p>
  45254. </dd>
  45255. <dt><samp class="option">offset</samp></dt>
  45256. <dd><p>Set time of start of transition relative to first video.
  45257. </p></dd>
  45258. </dl>
  45259. <p>The program source file must contain a kernel function with the given name,
  45260. which will be run once for each plane of the output. Each run on a plane
  45261. gets enqueued as a separate 2D global NDRange with one work-item for each
  45262. pixel to be generated. The global ID offset for each work-item is therefore
  45263. the coordinates of a pixel in the destination image.
  45264. </p>
  45265. <p>The kernel function needs to take the following arguments:
  45266. </p><ul class="itemize mark-bullet">
  45267. <li>Destination image, <var class="var">__write_only image2d_t</var>.
  45268. <p>This image will become the output; the kernel should write all of it.
  45269. </p>
  45270. </li><li>First Source image, <var class="var">__read_only image2d_t</var>.
  45271. Second Source image, <var class="var">__read_only image2d_t</var>.
  45272. <p>These are the most recent images on each input. The kernel may read from
  45273. them to generate the output, but they can&rsquo;t be written to.
  45274. </p>
  45275. </li><li>Transition progress, <var class="var">float</var>. This value is always between 0 and 1 inclusive.
  45276. </li></ul>
  45277. <p>Example programs:
  45278. </p>
  45279. <ul class="itemize mark-bullet">
  45280. <li>Apply dots curtain transition effect:
  45281. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  45282. __read_only image2d_t src1,
  45283. __read_only image2d_t src2,
  45284. float progress)
  45285. {
  45286. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  45287. CLK_FILTER_LINEAR);
  45288. int2 p = (int2)(get_global_id(0), get_global_id(1));
  45289. float2 rp = (float2)(get_global_id(0), get_global_id(1));
  45290. float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
  45291. rp = rp / dim;
  45292. float2 dots = (float2)(20.0, 20.0);
  45293. float2 center = (float2)(0,0);
  45294. float2 unused;
  45295. float4 val1 = read_imagef(src1, sampler, p);
  45296. float4 val2 = read_imagef(src2, sampler, p);
  45297. bool next = distance(fract(rp * dots, &amp;unused), (float2)(0.5, 0.5)) &lt; (progress / distance(rp, center));
  45298. write_imagef(dst, p, next ? val1 : val2);
  45299. }
  45300. </pre>
  45301. </li></ul>
  45302. </div>
  45303. </div>
  45304. <div class="chapter-level-extent" id="VAAPI-Video-Filters">
  45305. <h2 class="chapter"><span>32 VAAPI Video Filters<a class="copiable-link" href="#VAAPI-Video-Filters"> &para;</a></span></h2>
  45306. <p>VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters.
  45307. </p>
  45308. <p>To enable compilation of these filters you need to configure FFmpeg with
  45309. <code class="code">--enable-vaapi</code>.
  45310. </p>
  45311. <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>
  45312. </p>
  45313. <ul class="mini-toc">
  45314. <li><a href="#overlay_005fvaapi" accesskey="1">overlay_vaapi</a></li>
  45315. <li><a href="#tonemap_005fvaapi" accesskey="2">tonemap_vaapi</a></li>
  45316. <li><a href="#hstack_005fvaapi" accesskey="3">hstack_vaapi</a></li>
  45317. <li><a href="#vstack_005fvaapi" accesskey="4">vstack_vaapi</a></li>
  45318. <li><a href="#xstack_005fvaapi" accesskey="5">xstack_vaapi</a></li>
  45319. </ul>
  45320. <div class="section-level-extent" id="overlay_005fvaapi">
  45321. <h3 class="section"><span>32.1 overlay_vaapi<a class="copiable-link" href="#overlay_005fvaapi"> &para;</a></span></h3>
  45322. <p>Overlay one video on the top of another.
  45323. </p>
  45324. <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.
  45325. </p>
  45326. <p>The filter accepts the following options:
  45327. </p>
  45328. <dl class="table">
  45329. <dt><samp class="option">x</samp></dt>
  45330. <dt><samp class="option">y</samp></dt>
  45331. <dd><p>Set expressions for the x and y coordinates of the overlaid video
  45332. on the main video.
  45333. </p>
  45334. <p>Default value is &quot;0&quot; for both expressions.
  45335. </p>
  45336. </dd>
  45337. <dt><samp class="option">w</samp></dt>
  45338. <dt><samp class="option">h</samp></dt>
  45339. <dd><p>Set expressions for the width and height the overlaid video
  45340. on the main video.
  45341. </p>
  45342. <p>Default values are &rsquo;overlay_iw&rsquo; for &rsquo;w&rsquo; and &rsquo;overlay_ih*w/overlay_iw&rsquo; for &rsquo;h&rsquo;.
  45343. </p>
  45344. <p>The expressions can contain the following parameters:
  45345. </p>
  45346. <dl class="table">
  45347. <dt><samp class="option">main_w, W</samp></dt>
  45348. <dt><samp class="option">main_h, H</samp></dt>
  45349. <dd><p>The main input width and height.
  45350. </p>
  45351. </dd>
  45352. <dt><samp class="option">overlay_iw</samp></dt>
  45353. <dt><samp class="option">overlay_ih</samp></dt>
  45354. <dd><p>The overlay input width and height.
  45355. </p>
  45356. </dd>
  45357. <dt><samp class="option">overlay_w, w</samp></dt>
  45358. <dt><samp class="option">overlay_h, h</samp></dt>
  45359. <dd><p>The overlay output width and height.
  45360. </p>
  45361. </dd>
  45362. <dt><samp class="option">overlay_x, x</samp></dt>
  45363. <dt><samp class="option">overlay_y, y</samp></dt>
  45364. <dd><p>Position of the overlay layer inside of main
  45365. </p>
  45366. </dd>
  45367. </dl>
  45368. </dd>
  45369. <dt><samp class="option">alpha</samp></dt>
  45370. <dd><p>Set transparency of overlaid video. Allowed range is 0.0 to 1.0.
  45371. Higher value means lower transparency.
  45372. Default value is <code class="code">1.0</code>.
  45373. </p>
  45374. </dd>
  45375. <dt><samp class="option">eof_action</samp></dt>
  45376. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  45377. </p>
  45378. </dd>
  45379. <dt><samp class="option">shortest</samp></dt>
  45380. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  45381. </p>
  45382. </dd>
  45383. <dt><samp class="option">repeatlast</samp></dt>
  45384. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  45385. </p>
  45386. </dd>
  45387. </dl>
  45388. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  45389. </p><ul class="mini-toc">
  45390. <li><a href="#Examples-165" accesskey="1">Examples</a></li>
  45391. </ul>
  45392. <div class="subsection-level-extent" id="Examples-165">
  45393. <h4 class="subsection"><span>32.1.1 Examples<a class="copiable-link" href="#Examples-165"> &para;</a></span></h4>
  45394. <ul class="itemize mark-bullet">
  45395. <li>Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs for this filter are yuv420p format.
  45396. <div class="example">
  45397. <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
  45398. </pre></div>
  45399. </li><li>Overlay an image LOGO at the offset (200, 100) from the top-left corner of the INPUT video.
  45400. The inputs have same memory layout for color channels, the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p.
  45401. <div class="example">
  45402. <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
  45403. </pre></div>
  45404. </li></ul>
  45405. </div>
  45406. </div>
  45407. <div class="section-level-extent" id="tonemap_005fvaapi">
  45408. <h3 class="section"><span>32.2 tonemap_vaapi<a class="copiable-link" href="#tonemap_005fvaapi"> &para;</a></span></h3>
  45409. <p>Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping.
  45410. It maps the dynamic range of HDR10 content to the SDR content.
  45411. It currently only accepts HDR10 as input.
  45412. </p>
  45413. <p>It accepts the following parameters:
  45414. </p>
  45415. <dl class="table">
  45416. <dt><samp class="option">format</samp></dt>
  45417. <dd><p>Specify the output pixel format.
  45418. </p>
  45419. <p>Currently supported formats are:
  45420. </p><dl class="table">
  45421. <dt><var class="var">p010</var></dt>
  45422. <dt><var class="var">nv12</var></dt>
  45423. </dl>
  45424. <p>Default is nv12.
  45425. </p>
  45426. </dd>
  45427. <dt><samp class="option">primaries, p</samp></dt>
  45428. <dd><p>Set the output color primaries.
  45429. </p>
  45430. <p>Default is same as input.
  45431. </p>
  45432. </dd>
  45433. <dt><samp class="option">transfer, t</samp></dt>
  45434. <dd><p>Set the output transfer characteristics.
  45435. </p>
  45436. <p>Default is bt709.
  45437. </p>
  45438. </dd>
  45439. <dt><samp class="option">matrix, m</samp></dt>
  45440. <dd><p>Set the output colorspace matrix.
  45441. </p>
  45442. <p>Default is same as input.
  45443. </p>
  45444. </dd>
  45445. </dl>
  45446. <ul class="mini-toc">
  45447. <li><a href="#Example-7" accesskey="1">Example</a></li>
  45448. </ul>
  45449. <div class="subsection-level-extent" id="Example-7">
  45450. <h4 class="subsection"><span>32.2.1 Example<a class="copiable-link" href="#Example-7"> &para;</a></span></h4>
  45451. <ul class="itemize mark-bullet">
  45452. <li>Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format
  45453. <div class="example">
  45454. <pre class="example-preformatted">tonemap_vaapi=format=p010:t=bt2020-10
  45455. </pre></div>
  45456. </li></ul>
  45457. </div>
  45458. </div>
  45459. <div class="section-level-extent" id="hstack_005fvaapi">
  45460. <h3 class="section"><span>32.3 hstack_vaapi<a class="copiable-link" href="#hstack_005fvaapi"> &para;</a></span></h3>
  45461. <p>Stack input videos horizontally.
  45462. </p>
  45463. <p>This is the VA-API variant of the <a class="ref" href="#hstack">hstack</a> filter, each input stream may
  45464. have different height, this filter will scale down/up each input stream while
  45465. keeping the original aspect.
  45466. </p>
  45467. <p>It accepts the following options:
  45468. </p>
  45469. <dl class="table">
  45470. <dt><samp class="option">inputs</samp></dt>
  45471. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  45472. </p>
  45473. </dd>
  45474. <dt><samp class="option">shortest</samp></dt>
  45475. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  45476. </p>
  45477. </dd>
  45478. <dt><samp class="option">height</samp></dt>
  45479. <dd><p>Set height of output. If set to 0, this filter will set height of output to
  45480. height of the first input stream. Default value is 0.
  45481. </p></dd>
  45482. </dl>
  45483. </div>
  45484. <div class="section-level-extent" id="vstack_005fvaapi">
  45485. <h3 class="section"><span>32.4 vstack_vaapi<a class="copiable-link" href="#vstack_005fvaapi"> &para;</a></span></h3>
  45486. <p>Stack input videos vertically.
  45487. </p>
  45488. <p>This is the VA-API variant of the <a class="ref" href="#vstack">vstack</a> filter, each input stream may
  45489. have different width, this filter will scale down/up each input stream while
  45490. keeping the original aspect.
  45491. </p>
  45492. <p>It accepts the following options:
  45493. </p>
  45494. <dl class="table">
  45495. <dt><samp class="option">inputs</samp></dt>
  45496. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  45497. </p>
  45498. </dd>
  45499. <dt><samp class="option">shortest</samp></dt>
  45500. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  45501. </p>
  45502. </dd>
  45503. <dt><samp class="option">width</samp></dt>
  45504. <dd><p>Set width of output. If set to 0, this filter will set width of output to
  45505. width of the first input stream. Default value is 0.
  45506. </p></dd>
  45507. </dl>
  45508. </div>
  45509. <div class="section-level-extent" id="xstack_005fvaapi">
  45510. <h3 class="section"><span>32.5 xstack_vaapi<a class="copiable-link" href="#xstack_005fvaapi"> &para;</a></span></h3>
  45511. <p>Stack video inputs into custom layout.
  45512. </p>
  45513. <p>This is the VA-API variant of the <a class="ref" href="#xstack">xstack</a> filter, each input stream may
  45514. have different size, this filter will scale down/up each input stream to the
  45515. given output size, or the size of the first input stream.
  45516. </p>
  45517. <p>It accepts the following options:
  45518. </p>
  45519. <dl class="table">
  45520. <dt><samp class="option">inputs</samp></dt>
  45521. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  45522. </p>
  45523. </dd>
  45524. <dt><samp class="option">shortest</samp></dt>
  45525. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  45526. </p>
  45527. </dd>
  45528. <dt><samp class="option">layout</samp></dt>
  45529. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  45530. Moreover, this permits the user to supply output size for each input stream.
  45531. </p><div class="example">
  45532. <pre class="example-preformatted">xstack_vaapi=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
  45533. </pre></div>
  45534. </dd>
  45535. <dt><samp class="option">grid</samp></dt>
  45536. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  45537. </p>
  45538. </dd>
  45539. <dt><samp class="option">grid_tile_size</samp></dt>
  45540. <dd><p>Set output size for each input stream when <samp class="option">grid</samp> is set. If this option
  45541. is not set, this filter will set output size by default to the size of the
  45542. first input stream. For the syntax of this option, check the
  45543. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  45544. </p>
  45545. </dd>
  45546. <dt><samp class="option">fill</samp></dt>
  45547. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  45548. </p></dd>
  45549. </dl>
  45550. </div>
  45551. </div>
  45552. <div class="chapter-level-extent" id="Vulkan-Video-Filters">
  45553. <h2 class="chapter"><span>33 Vulkan Video Filters<a class="copiable-link" href="#Vulkan-Video-Filters"> &para;</a></span></h2>
  45554. <p>Below is a description of the currently available Vulkan video filters.
  45555. </p>
  45556. <p>To enable compilation of these filters you need to configure FFmpeg with
  45557. <code class="code">--enable-vulkan</code> and either <code class="code">--enable-libglslang</code> or <code class="code">--enable-libshaderc</code>.
  45558. </p>
  45559. <p>Running Vulkan filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  45560. </p><dl class="table">
  45561. <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>
  45562. <dd><p>Initialise a new hardware device of type <var class="var">vulkan</var> called <var class="var">name</var>, using the
  45563. given device parameters and options in <var class="var">key=value</var>. The following options
  45564. are supported:
  45565. </p>
  45566. <dl class="table">
  45567. <dt><samp class="option">debug</samp></dt>
  45568. <dd><p>Switches validation layers on if set to 1.
  45569. </p>
  45570. </dd>
  45571. <dt><samp class="option">linear_images</samp></dt>
  45572. <dd><p>Allocates linear images. Does not apply to decoding.
  45573. </p>
  45574. </dd>
  45575. <dt><samp class="option">disable_multiplane</samp></dt>
  45576. <dd><p>Disables multiplane images. Does not apply to decoding.
  45577. </p></dd>
  45578. </dl>
  45579. </dd>
  45580. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  45581. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  45582. </p>
  45583. </dd>
  45584. </dl>
  45585. <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>
  45586. </p>
  45587. <ul class="itemize mark-bullet">
  45588. <li>Example of choosing the first device and running nlmeans_vulkan filter with default parameters on it.
  45589. <div class="example">
  45590. <pre class="example-preformatted">-init_hw_device vulkan=vk:0 -filter_hw_device vk -i INPUT -vf &quot;hwupload,nlmeans_vulkan,hwdownload&quot; OUTPUT
  45591. </pre></div>
  45592. </li></ul>
  45593. <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.
  45594. </p>
  45595. <ul class="mini-toc">
  45596. <li><a href="#avgblur_005fvulkan" accesskey="1">avgblur_vulkan</a></li>
  45597. <li><a href="#blend_005fvulkan" accesskey="2">blend_vulkan</a></li>
  45598. <li><a href="#bwdif_005fvulkan" accesskey="3">bwdif_vulkan</a></li>
  45599. <li><a href="#chromaber_005fvulkan" accesskey="4">chromaber_vulkan</a></li>
  45600. <li><a href="#color_005fvulkan" accesskey="5">color_vulkan</a></li>
  45601. <li><a href="#vflip_005fvulkan" accesskey="6">vflip_vulkan</a></li>
  45602. <li><a href="#hflip_005fvulkan" accesskey="7">hflip_vulkan</a></li>
  45603. <li><a href="#flip_005fvulkan" accesskey="8">flip_vulkan</a></li>
  45604. <li><a href="#gblur_005fvulkan" accesskey="9">gblur_vulkan</a></li>
  45605. <li><a href="#nlmeans_005fvulkan">nlmeans_vulkan</a></li>
  45606. <li><a href="#overlay_005fvulkan">overlay_vulkan</a></li>
  45607. <li><a href="#transpose_005fvt">transpose_vt</a></li>
  45608. <li><a href="#transpose_005fvulkan">transpose_vulkan</a></li>
  45609. </ul>
  45610. <div class="section-level-extent" id="avgblur_005fvulkan">
  45611. <h3 class="section"><span>33.1 avgblur_vulkan<a class="copiable-link" href="#avgblur_005fvulkan"> &para;</a></span></h3>
  45612. <p>Apply an average blur filter, implemented on the GPU using Vulkan.
  45613. </p>
  45614. <p>The filter accepts the following options:
  45615. </p>
  45616. <dl class="table">
  45617. <dt><samp class="option">sizeX</samp></dt>
  45618. <dd><p>Set horizontal radius size.
  45619. Range is <code class="code">[1, 32]</code> and default value is <code class="code">3</code>.
  45620. </p>
  45621. </dd>
  45622. <dt><samp class="option">sizeY</samp></dt>
  45623. <dd><p>Set vertical radius size. Range is <code class="code">[1, 32]</code> and default value is <code class="code">3</code>.
  45624. </p>
  45625. </dd>
  45626. <dt><samp class="option">planes</samp></dt>
  45627. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  45628. </p></dd>
  45629. </dl>
  45630. </div>
  45631. <div class="section-level-extent" id="blend_005fvulkan">
  45632. <h3 class="section"><span>33.2 blend_vulkan<a class="copiable-link" href="#blend_005fvulkan"> &para;</a></span></h3>
  45633. <p>Blend two Vulkan frames into each other.
  45634. </p>
  45635. <p>The <code class="code">blend</code> filter takes two input streams and outputs one
  45636. stream, the first input is the &quot;top&quot; layer and second input is
  45637. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  45638. </p>
  45639. <p>A description of the accepted options follows.
  45640. </p>
  45641. <dl class="table">
  45642. <dt><samp class="option">c0_mode</samp></dt>
  45643. <dt><samp class="option">c1_mode</samp></dt>
  45644. <dt><samp class="option">c2_mode</samp></dt>
  45645. <dt><samp class="option">c3_mode</samp></dt>
  45646. <dt><samp class="option">all_mode</samp></dt>
  45647. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  45648. of <var class="var">all_mode</var>. Default value is <code class="code">normal</code>.
  45649. </p>
  45650. <p>Available values for component modes are:
  45651. </p><dl class="table">
  45652. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  45653. <dt>&lsquo;<samp class="samp">multiply</samp>&rsquo;</dt>
  45654. </dl>
  45655. </dd>
  45656. </dl>
  45657. </div>
  45658. <div class="section-level-extent" id="bwdif_005fvulkan">
  45659. <h3 class="section"><span>33.3 bwdif_vulkan<a class="copiable-link" href="#bwdif_005fvulkan"> &para;</a></span></h3>
  45660. <p>Deinterlacer using <a class="ref" href="#bwdif">bwdif</a>, the &quot;Bob Weaver Deinterlacing Filter&quot; algorithm, implemented
  45661. on the GPU using Vulkan.
  45662. </p>
  45663. <p>It accepts the following parameters:
  45664. </p>
  45665. <dl class="table">
  45666. <dt><samp class="option">mode</samp></dt>
  45667. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  45668. </p>
  45669. <dl class="table">
  45670. <dt><samp class="option">0, send_frame</samp></dt>
  45671. <dd><p>Output one frame for each frame.
  45672. </p></dd>
  45673. <dt><samp class="option">1, send_field</samp></dt>
  45674. <dd><p>Output one frame for each field.
  45675. </p></dd>
  45676. </dl>
  45677. <p>The default value is <code class="code">send_field</code>.
  45678. </p>
  45679. </dd>
  45680. <dt><samp class="option">parity</samp></dt>
  45681. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  45682. of the following values:
  45683. </p>
  45684. <dl class="table">
  45685. <dt><samp class="option">0, tff</samp></dt>
  45686. <dd><p>Assume the top field is first.
  45687. </p></dd>
  45688. <dt><samp class="option">1, bff</samp></dt>
  45689. <dd><p>Assume the bottom field is first.
  45690. </p></dd>
  45691. <dt><samp class="option">-1, auto</samp></dt>
  45692. <dd><p>Enable automatic detection of field parity.
  45693. </p></dd>
  45694. </dl>
  45695. <p>The default value is <code class="code">auto</code>.
  45696. If the interlacing is unknown or the decoder does not export this information,
  45697. top field first will be assumed.
  45698. </p>
  45699. </dd>
  45700. <dt><samp class="option">deint</samp></dt>
  45701. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  45702. values:
  45703. </p>
  45704. <dl class="table">
  45705. <dt><samp class="option">0, all</samp></dt>
  45706. <dd><p>Deinterlace all frames.
  45707. </p></dd>
  45708. <dt><samp class="option">1, interlaced</samp></dt>
  45709. <dd><p>Only deinterlace frames marked as interlaced.
  45710. </p></dd>
  45711. </dl>
  45712. <p>The default value is <code class="code">all</code>.
  45713. </p></dd>
  45714. </dl>
  45715. </div>
  45716. <div class="section-level-extent" id="chromaber_005fvulkan">
  45717. <h3 class="section"><span>33.4 chromaber_vulkan<a class="copiable-link" href="#chromaber_005fvulkan"> &para;</a></span></h3>
  45718. <p>Apply an effect that emulates chromatic aberration. Works best with RGB inputs,
  45719. but provides a similar effect with YCbCr inputs too.
  45720. </p>
  45721. <dl class="table">
  45722. <dt><samp class="option">dist_x</samp></dt>
  45723. <dd><p>Horizontal displacement multiplier. Each chroma pixel&rsquo;s position will be multiplied
  45724. by this amount, starting from the center of the image. Default is <code class="code">0</code>.
  45725. </p>
  45726. </dd>
  45727. <dt><samp class="option">dist_y</samp></dt>
  45728. <dd><p>Similarly, this sets the vertical displacement multiplier. Default is <code class="code">0</code>.
  45729. </p>
  45730. </dd>
  45731. </dl>
  45732. </div>
  45733. <div class="section-level-extent" id="color_005fvulkan">
  45734. <h3 class="section"><span>33.5 color_vulkan<a class="copiable-link" href="#color_005fvulkan"> &para;</a></span></h3>
  45735. <p>Video source that creates a Vulkan frame of a solid color.
  45736. Useful for benchmarking, or overlaying.
  45737. </p>
  45738. <p>It accepts the following parameters:
  45739. </p>
  45740. <dl class="table">
  45741. <dt><samp class="option">color</samp></dt>
  45742. <dd><p>The color to use. Either a name, or a hexadecimal value.
  45743. The default value is <code class="code">black</code>.
  45744. </p>
  45745. </dd>
  45746. <dt><samp class="option">size</samp></dt>
  45747. <dd><p>The size of the output frame. Default value is <code class="code">1920x1080</code>.
  45748. </p>
  45749. </dd>
  45750. <dt><samp class="option">rate</samp></dt>
  45751. <dd><p>The framerate to output at. Default value is <code class="code">60</code> frames per second.
  45752. </p>
  45753. </dd>
  45754. <dt><samp class="option">duration</samp></dt>
  45755. <dd><p>The video duration. Default value is <code class="code">-0.000001</code>.
  45756. </p>
  45757. </dd>
  45758. <dt><samp class="option">sar</samp></dt>
  45759. <dd><p>The video signal aspect ratio. Default value is <code class="code">1/1</code>.
  45760. </p>
  45761. </dd>
  45762. <dt><samp class="option">format</samp></dt>
  45763. <dd><p>The pixel format of the output Vulkan frames. Default value is <code class="code">yuv444p</code>.
  45764. </p>
  45765. </dd>
  45766. <dt><samp class="option">out_range</samp></dt>
  45767. <dd><p>Set the output YCbCr sample range.
  45768. </p>
  45769. <p>This allows the autodetected value to be overridden as well as allows forcing
  45770. a specific value used for the output and encoder. If not specified, the
  45771. range depends on the pixel format. Possible values:
  45772. </p>
  45773. <dl class="table">
  45774. <dt>&lsquo;<samp class="samp">auto/unknown</samp>&rsquo;</dt>
  45775. <dd><p>Choose automatically.
  45776. </p>
  45777. </dd>
  45778. <dt>&lsquo;<samp class="samp">jpeg/full/pc</samp>&rsquo;</dt>
  45779. <dd><p>Set full range (0-255 in case of 8-bit luma).
  45780. </p>
  45781. </dd>
  45782. <dt>&lsquo;<samp class="samp">mpeg/limited/tv</samp>&rsquo;</dt>
  45783. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  45784. </p></dd>
  45785. </dl>
  45786. </dd>
  45787. </dl>
  45788. </div>
  45789. <div class="section-level-extent" id="vflip_005fvulkan">
  45790. <h3 class="section"><span>33.6 vflip_vulkan<a class="copiable-link" href="#vflip_005fvulkan"> &para;</a></span></h3>
  45791. <p>Flips an image vertically.
  45792. </p>
  45793. </div>
  45794. <div class="section-level-extent" id="hflip_005fvulkan">
  45795. <h3 class="section"><span>33.7 hflip_vulkan<a class="copiable-link" href="#hflip_005fvulkan"> &para;</a></span></h3>
  45796. <p>Flips an image horizontally.
  45797. </p>
  45798. </div>
  45799. <div class="section-level-extent" id="flip_005fvulkan">
  45800. <h3 class="section"><span>33.8 flip_vulkan<a class="copiable-link" href="#flip_005fvulkan"> &para;</a></span></h3>
  45801. <p>Flips an image along both the vertical and horizontal axis.
  45802. </p>
  45803. </div>
  45804. <div class="section-level-extent" id="gblur_005fvulkan">
  45805. <h3 class="section"><span>33.9 gblur_vulkan<a class="copiable-link" href="#gblur_005fvulkan"> &para;</a></span></h3>
  45806. <p>Apply Gaussian blur filter on Vulkan frames.
  45807. </p>
  45808. <p>The filter accepts the following options:
  45809. </p>
  45810. <dl class="table">
  45811. <dt><samp class="option">sigma</samp></dt>
  45812. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code class="code">0.5</code>.
  45813. </p>
  45814. </dd>
  45815. <dt><samp class="option">sigmaV</samp></dt>
  45816. <dd><p>Set vertical sigma, if negative it will be same as <code class="code">sigma</code>.
  45817. Default is <code class="code">-1</code>.
  45818. </p>
  45819. </dd>
  45820. <dt><samp class="option">planes</samp></dt>
  45821. <dd><p>Set which planes to filter. By default all planes are filtered.
  45822. </p>
  45823. </dd>
  45824. <dt><samp class="option">size</samp></dt>
  45825. <dd><p>Set the kernel size along the horizontal axis. Default is <code class="code">19</code>.
  45826. </p>
  45827. </dd>
  45828. <dt><samp class="option">sizeV</samp></dt>
  45829. <dd><p>Set the kernel size along the vertical axis. Default is <code class="code">0</code>,
  45830. which sets to use the same value as <var class="var">size</var>.
  45831. </p>
  45832. </dd>
  45833. </dl>
  45834. </div>
  45835. <div class="section-level-extent" id="nlmeans_005fvulkan">
  45836. <h3 class="section"><span>33.10 nlmeans_vulkan<a class="copiable-link" href="#nlmeans_005fvulkan"> &para;</a></span></h3>
  45837. <p>Denoise frames using Non-Local Means algorithm, implemented on the GPU using
  45838. Vulkan.
  45839. Supports more pixel formats than <a class="ref" href="#nlmeans">nlmeans</a> or <a class="ref" href="#nlmeans_005fopencl">nlmeans_opencl</a>, including
  45840. alpha channel support.
  45841. </p>
  45842. <p>The filter accepts the following options.
  45843. </p>
  45844. <dl class="table">
  45845. <dt><samp class="option">s</samp></dt>
  45846. <dd><p>Set denoising strength for all components. Default is 1.0. Must be in range [1.0, 100.0].
  45847. </p>
  45848. </dd>
  45849. <dt><samp class="option">p</samp></dt>
  45850. <dd><p>Set patch size for all planes. Default is 7. Must be odd number in range [0, 99].
  45851. </p>
  45852. </dd>
  45853. <dt><samp class="option">r</samp></dt>
  45854. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  45855. </p>
  45856. </dd>
  45857. <dt><samp class="option">t</samp></dt>
  45858. <dd><p>Set parallelism. Default is 36. Must be a number in the range [1, 168].
  45859. Larger values may speed up processing, at the cost of more VRAM.
  45860. Lower values will slow it down, reducing VRAM usage.
  45861. Only supported on GPUs with atomic float operations (RDNA3+, Ampere+).
  45862. </p>
  45863. </dd>
  45864. <dt><samp class="option">s0</samp></dt>
  45865. <dt><samp class="option">s1</samp></dt>
  45866. <dt><samp class="option">s2</samp></dt>
  45867. <dt><samp class="option">s3</samp></dt>
  45868. <dd><p>Set denoising strength for a specific component. Default is <var class="var">1</var>, equal to <samp class="option">s</samp>.
  45869. Must be odd number in range [1, 100].
  45870. </p>
  45871. </dd>
  45872. <dt><samp class="option">p0</samp></dt>
  45873. <dt><samp class="option">p1</samp></dt>
  45874. <dt><samp class="option">p2</samp></dt>
  45875. <dt><samp class="option">p3</samp></dt>
  45876. <dd><p>Set patch size for a specific component. Default is <var class="var">7</var>, equal to <samp class="option">p</samp>.
  45877. Must be odd number in range [0, 99].
  45878. </p>
  45879. </dd>
  45880. </dl>
  45881. </div>
  45882. <div class="section-level-extent" id="overlay_005fvulkan">
  45883. <h3 class="section"><span>33.11 overlay_vulkan<a class="copiable-link" href="#overlay_005fvulkan"> &para;</a></span></h3>
  45884. <p>Overlay one video on top of another.
  45885. </p>
  45886. <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.
  45887. This filter requires all inputs to use the same pixel format. So, format conversion may be needed.
  45888. </p>
  45889. <p>The filter accepts the following options:
  45890. </p>
  45891. <dl class="table">
  45892. <dt><samp class="option">x</samp></dt>
  45893. <dd><p>Set the x coordinate of the overlaid video on the main video.
  45894. Default value is <code class="code">0</code>.
  45895. </p>
  45896. </dd>
  45897. <dt><samp class="option">y</samp></dt>
  45898. <dd><p>Set the y coordinate of the overlaid video on the main video.
  45899. Default value is <code class="code">0</code>.
  45900. </p>
  45901. </dd>
  45902. </dl>
  45903. </div>
  45904. <div class="section-level-extent" id="transpose_005fvt">
  45905. <h3 class="section"><span>33.12 transpose_vt<a class="copiable-link" href="#transpose_005fvt"> &para;</a></span></h3>
  45906. <p>Transpose rows with columns in the input video and optionally flip it.
  45907. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  45908. </p>
  45909. <p>It accepts the following parameters:
  45910. </p>
  45911. <dl class="table">
  45912. <dt><samp class="option">dir</samp></dt>
  45913. <dd><p>Specify the transposition direction.
  45914. </p>
  45915. <p>Can assume the following values:
  45916. </p><dl class="table">
  45917. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  45918. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  45919. </p>
  45920. </dd>
  45921. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  45922. <dd><p>Rotate by 90 degrees clockwise.
  45923. </p>
  45924. </dd>
  45925. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  45926. <dd><p>Rotate by 90 degrees counterclockwise.
  45927. </p>
  45928. </dd>
  45929. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  45930. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  45931. </p>
  45932. </dd>
  45933. <dt>&lsquo;<samp class="samp">hflip</samp>&rsquo;</dt>
  45934. <dd><p>Flip the input video horizontally.
  45935. </p>
  45936. </dd>
  45937. <dt>&lsquo;<samp class="samp">vflip</samp>&rsquo;</dt>
  45938. <dd><p>Flip the input video vertically.
  45939. </p>
  45940. </dd>
  45941. </dl>
  45942. </dd>
  45943. <dt><samp class="option">passthrough</samp></dt>
  45944. <dd><p>Do not apply the transposition if the input geometry matches the one
  45945. specified by the specified value. It accepts the following values:
  45946. </p><dl class="table">
  45947. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  45948. <dd><p>Always apply transposition. (default)
  45949. </p></dd>
  45950. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  45951. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  45952. </p></dd>
  45953. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  45954. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  45955. </p></dd>
  45956. </dl>
  45957. </dd>
  45958. </dl>
  45959. </div>
  45960. <div class="section-level-extent" id="transpose_005fvulkan">
  45961. <h3 class="section"><span>33.13 transpose_vulkan<a class="copiable-link" href="#transpose_005fvulkan"> &para;</a></span></h3>
  45962. <p>Transpose rows with columns in the input video and optionally flip it.
  45963. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  45964. </p>
  45965. <p>It accepts the following parameters:
  45966. </p>
  45967. <dl class="table">
  45968. <dt><samp class="option">dir</samp></dt>
  45969. <dd><p>Specify the transposition direction.
  45970. </p>
  45971. <p>Can assume the following values:
  45972. </p><dl class="table">
  45973. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  45974. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  45975. </p>
  45976. </dd>
  45977. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  45978. <dd><p>Rotate by 90 degrees clockwise.
  45979. </p>
  45980. </dd>
  45981. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  45982. <dd><p>Rotate by 90 degrees counterclockwise.
  45983. </p>
  45984. </dd>
  45985. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  45986. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  45987. </p></dd>
  45988. </dl>
  45989. </dd>
  45990. <dt><samp class="option">passthrough</samp></dt>
  45991. <dd><p>Do not apply the transposition if the input geometry matches the one
  45992. specified by the specified value. It accepts the following values:
  45993. </p><dl class="table">
  45994. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  45995. <dd><p>Always apply transposition. (default)
  45996. </p></dd>
  45997. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  45998. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  45999. </p></dd>
  46000. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  46001. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  46002. </p></dd>
  46003. </dl>
  46004. </dd>
  46005. </dl>
  46006. </div>
  46007. </div>
  46008. <div class="chapter-level-extent" id="QSV-Video-Filters">
  46009. <h2 class="chapter"><span>34 QSV Video Filters<a class="copiable-link" href="#QSV-Video-Filters"> &para;</a></span></h2>
  46010. <p>Below is a description of the currently available QSV video filters.
  46011. </p>
  46012. <p>To enable compilation of these filters you need to configure FFmpeg with
  46013. <code class="code">--enable-libmfx</code> or <code class="code">--enable-libvpl</code>.
  46014. </p>
  46015. <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>
  46016. </p>
  46017. <ul class="mini-toc">
  46018. <li><a href="#hstack_005fqsv" accesskey="1">hstack_qsv</a></li>
  46019. <li><a href="#vstack_005fqsv" accesskey="2">vstack_qsv</a></li>
  46020. <li><a href="#xstack_005fqsv" accesskey="3">xstack_qsv</a></li>
  46021. </ul>
  46022. <div class="section-level-extent" id="hstack_005fqsv">
  46023. <h3 class="section"><span>34.1 hstack_qsv<a class="copiable-link" href="#hstack_005fqsv"> &para;</a></span></h3>
  46024. <p>Stack input videos horizontally.
  46025. </p>
  46026. <p>This is the QSV variant of the <a class="ref" href="#hstack">hstack</a> filter, each input stream may
  46027. have different height, this filter will scale down/up each input stream while
  46028. keeping the original aspect.
  46029. </p>
  46030. <p>It accepts the following options:
  46031. </p>
  46032. <dl class="table">
  46033. <dt><samp class="option">inputs</samp></dt>
  46034. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  46035. </p>
  46036. </dd>
  46037. <dt><samp class="option">shortest</samp></dt>
  46038. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  46039. </p>
  46040. </dd>
  46041. <dt><samp class="option">height</samp></dt>
  46042. <dd><p>Set height of output. If set to 0, this filter will set height of output to
  46043. height of the first input stream. Default value is 0.
  46044. </p></dd>
  46045. </dl>
  46046. </div>
  46047. <div class="section-level-extent" id="vstack_005fqsv">
  46048. <h3 class="section"><span>34.2 vstack_qsv<a class="copiable-link" href="#vstack_005fqsv"> &para;</a></span></h3>
  46049. <p>Stack input videos vertically.
  46050. </p>
  46051. <p>This is the QSV variant of the <a class="ref" href="#vstack">vstack</a> filter, each input stream may
  46052. have different width, this filter will scale down/up each input stream while
  46053. keeping the original aspect.
  46054. </p>
  46055. <p>It accepts the following options:
  46056. </p>
  46057. <dl class="table">
  46058. <dt><samp class="option">inputs</samp></dt>
  46059. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  46060. </p>
  46061. </dd>
  46062. <dt><samp class="option">shortest</samp></dt>
  46063. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  46064. </p>
  46065. </dd>
  46066. <dt><samp class="option">width</samp></dt>
  46067. <dd><p>Set width of output. If set to 0, this filter will set width of output to
  46068. width of the first input stream. Default value is 0.
  46069. </p></dd>
  46070. </dl>
  46071. </div>
  46072. <div class="section-level-extent" id="xstack_005fqsv">
  46073. <h3 class="section"><span>34.3 xstack_qsv<a class="copiable-link" href="#xstack_005fqsv"> &para;</a></span></h3>
  46074. <p>Stack video inputs into custom layout.
  46075. </p>
  46076. <p>This is the QSV variant of the <a class="ref" href="#xstack">xstack</a> filter.
  46077. </p>
  46078. <p>It accepts the following options:
  46079. </p>
  46080. <dl class="table">
  46081. <dt><samp class="option">inputs</samp></dt>
  46082. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  46083. </p>
  46084. </dd>
  46085. <dt><samp class="option">shortest</samp></dt>
  46086. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  46087. </p>
  46088. </dd>
  46089. <dt><samp class="option">layout</samp></dt>
  46090. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  46091. Moreover, this permits the user to supply output size for each input stream.
  46092. </p><div class="example">
  46093. <pre class="example-preformatted">xstack_qsv=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
  46094. </pre></div>
  46095. </dd>
  46096. <dt><samp class="option">grid</samp></dt>
  46097. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  46098. </p>
  46099. </dd>
  46100. <dt><samp class="option">grid_tile_size</samp></dt>
  46101. <dd><p>Set output size for each input stream when <samp class="option">grid</samp> is set. If this option
  46102. is not set, this filter will set output size by default to the size of the
  46103. first input stream. For the syntax of this option, check the
  46104. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46105. </p>
  46106. </dd>
  46107. <dt><samp class="option">fill</samp></dt>
  46108. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  46109. </p></dd>
  46110. </dl>
  46111. </div>
  46112. </div>
  46113. <div class="chapter-level-extent" id="Video-Sources">
  46114. <h2 class="chapter"><span>35 Video Sources<a class="copiable-link" href="#Video-Sources"> &para;</a></span></h2>
  46115. <p>Below is a description of the currently available video sources.
  46116. </p>
  46117. <ul class="mini-toc">
  46118. <li><a href="#buffer" accesskey="1">buffer</a></li>
  46119. <li><a href="#cellauto" accesskey="2">cellauto</a></li>
  46120. <li><a href="#coreimagesrc-1" accesskey="3">coreimagesrc</a></li>
  46121. <li><a href="#ddagrab" accesskey="4">ddagrab</a></li>
  46122. <li><a href="#gradients" accesskey="5">gradients</a></li>
  46123. <li><a href="#mandelbrot" accesskey="6">mandelbrot</a></li>
  46124. <li><a href="#mptestsrc" accesskey="7">mptestsrc</a></li>
  46125. <li><a href="#frei0r_005fsrc" accesskey="8">frei0r_src</a></li>
  46126. <li><a href="#life" accesskey="9">life</a></li>
  46127. <li><a href="#qrencodesrc">qrencodesrc</a></li>
  46128. <li><a 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">allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a></li>
  46129. <li><a href="#openclsrc">openclsrc</a></li>
  46130. <li><a href="#sierpinski">sierpinski</a></li>
  46131. <li><a href="#zoneplate">zoneplate</a></li>
  46132. </ul>
  46133. <div class="section-level-extent" id="buffer">
  46134. <h3 class="section"><span>35.1 buffer<a class="copiable-link" href="#buffer"> &para;</a></span></h3>
  46135. <p>Buffer video frames, and make them available to the filter chain.
  46136. </p>
  46137. <p>This source is mainly intended for a programmatic use, in particular
  46138. through the interface defined in <samp class="file">libavfilter/buffersrc.h</samp>.
  46139. </p>
  46140. <p>It accepts the following parameters:
  46141. </p>
  46142. <dl class="table">
  46143. <dt><samp class="option">video_size</samp></dt>
  46144. <dd><p>Specify the size (width and height) of the buffered video frames. For the
  46145. syntax of this option, check the
  46146. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46147. </p>
  46148. </dd>
  46149. <dt><samp class="option">width</samp></dt>
  46150. <dd><p>The input video width.
  46151. </p>
  46152. </dd>
  46153. <dt><samp class="option">height</samp></dt>
  46154. <dd><p>The input video height.
  46155. </p>
  46156. </dd>
  46157. <dt><samp class="option">pix_fmt</samp></dt>
  46158. <dd><p>A string representing the pixel format of the buffered video frames.
  46159. It may be a number corresponding to a pixel format, or a pixel format
  46160. name.
  46161. </p>
  46162. </dd>
  46163. <dt><samp class="option">time_base</samp></dt>
  46164. <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
  46165. </p>
  46166. </dd>
  46167. <dt><samp class="option">frame_rate</samp></dt>
  46168. <dd><p>Specify the frame rate expected for the video stream.
  46169. </p>
  46170. </dd>
  46171. <dt><samp class="option">colorspace</samp></dt>
  46172. <dd><p>A string representing the color space of the buffered video frames.
  46173. It may be a number corresponding to a color space, or a color space
  46174. name.
  46175. </p>
  46176. </dd>
  46177. <dt><samp class="option">range</samp></dt>
  46178. <dd><p>A string representing the color range of the buffered video frames.
  46179. It may be a number corresponding to a color range, or a color range
  46180. name.
  46181. </p>
  46182. </dd>
  46183. <dt><samp class="option">pixel_aspect, sar</samp></dt>
  46184. <dd><p>The sample (pixel) aspect ratio of the input video.
  46185. </p>
  46186. </dd>
  46187. <dt><samp class="option">hw_frames_ctx</samp></dt>
  46188. <dd><p>When using a hardware pixel format, this should be a reference to an
  46189. AVHWFramesContext describing input frames.
  46190. </p></dd>
  46191. </dl>
  46192. <p>For example:
  46193. </p><div class="example">
  46194. <pre class="example-preformatted">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
  46195. </pre></div>
  46196. <p>will instruct the source to accept video frames with size 320x240 and
  46197. with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
  46198. square pixels (1:1 sample aspect ratio).
  46199. Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
  46200. (check the enum AVPixelFormat definition in <samp class="file">libavutil/pixfmt.h</samp>),
  46201. this example corresponds to:
  46202. </p><div class="example">
  46203. <pre class="example-preformatted">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
  46204. </pre></div>
  46205. <p>Alternatively, the options can be specified as a flat string, but this
  46206. syntax is deprecated:
  46207. </p>
  46208. <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>
  46209. </p>
  46210. </div>
  46211. <div class="section-level-extent" id="cellauto">
  46212. <h3 class="section"><span>35.2 cellauto<a class="copiable-link" href="#cellauto"> &para;</a></span></h3>
  46213. <p>Create a pattern generated by an elementary cellular automaton.
  46214. </p>
  46215. <p>The initial state of the cellular automaton can be defined through the
  46216. <samp class="option">filename</samp> and <samp class="option">pattern</samp> options. If such options are
  46217. not specified an initial state is created randomly.
  46218. </p>
  46219. <p>At each new frame a new row in the video is filled with the result of
  46220. the cellular automaton next generation. The behavior when the whole
  46221. frame is filled is defined by the <samp class="option">scroll</samp> option.
  46222. </p>
  46223. <p>This source accepts the following options:
  46224. </p>
  46225. <dl class="table">
  46226. <dt><samp class="option">filename, f</samp></dt>
  46227. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  46228. the specified file.
  46229. In the file, each non-whitespace character is considered an alive
  46230. cell, a newline will terminate the row, and further characters in the
  46231. file will be ignored.
  46232. </p>
  46233. </dd>
  46234. <dt><samp class="option">pattern, p</samp></dt>
  46235. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  46236. the specified string.
  46237. </p>
  46238. <p>Each non-whitespace character in the string is considered an alive
  46239. cell, a newline will terminate the row, and further characters in the
  46240. string will be ignored.
  46241. </p>
  46242. </dd>
  46243. <dt><samp class="option">rate, r</samp></dt>
  46244. <dd><p>Set the video rate, that is the number of frames generated per second.
  46245. Default is 25.
  46246. </p>
  46247. </dd>
  46248. <dt><samp class="option">random_fill_ratio, ratio</samp></dt>
  46249. <dd><p>Set the random fill ratio for the initial cellular automaton row. It
  46250. is a floating point number value ranging from 0 to 1, defaults to
  46251. 1/PHI.
  46252. </p>
  46253. <p>This option is ignored when a file or a pattern is specified.
  46254. </p>
  46255. </dd>
  46256. <dt><samp class="option">random_seed, seed</samp></dt>
  46257. <dd><p>Set the seed for filling randomly the initial row, must be an integer
  46258. included between 0 and UINT32_MAX. If not specified, or if explicitly
  46259. set to -1, the filter will try to use a good random seed on a best
  46260. effort basis.
  46261. </p>
  46262. </dd>
  46263. <dt><samp class="option">rule</samp></dt>
  46264. <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
  46265. Default value is 110.
  46266. </p>
  46267. </dd>
  46268. <dt><samp class="option">size, s</samp></dt>
  46269. <dd><p>Set the size of the output video. For the syntax of this option, check the
  46270. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46271. </p>
  46272. <p>If <samp class="option">filename</samp> or <samp class="option">pattern</samp> is specified, the size is set
  46273. by default to the width of the specified initial state row, and the
  46274. height is set to <var class="var">width</var> * PHI.
  46275. </p>
  46276. <p>If <samp class="option">size</samp> is set, it must contain the width of the specified
  46277. pattern string, and the specified pattern will be centered in the
  46278. larger row.
  46279. </p>
  46280. <p>If a filename or a pattern string is not specified, the size value
  46281. defaults to &quot;320x518&quot; (used for a randomly generated initial state).
  46282. </p>
  46283. </dd>
  46284. <dt><samp class="option">scroll</samp></dt>
  46285. <dd><p>If set to 1, scroll the output upward when all the rows in the output
  46286. have been already filled. If set to 0, the new generated row will be
  46287. written over the top row just after the bottom row is filled.
  46288. Defaults to 1.
  46289. </p>
  46290. </dd>
  46291. <dt><samp class="option">start_full, full</samp></dt>
  46292. <dd><p>If set to 1, completely fill the output with generated rows before
  46293. outputting the first frame.
  46294. This is the default behavior, for disabling set the value to 0.
  46295. </p>
  46296. </dd>
  46297. <dt><samp class="option">stitch</samp></dt>
  46298. <dd><p>If set to 1, stitch the left and right row edges together.
  46299. This is the default behavior, for disabling set the value to 0.
  46300. </p></dd>
  46301. </dl>
  46302. <ul class="mini-toc">
  46303. <li><a href="#Examples-166" accesskey="1">Examples</a></li>
  46304. </ul>
  46305. <div class="subsection-level-extent" id="Examples-166">
  46306. <h4 class="subsection"><span>35.2.1 Examples<a class="copiable-link" href="#Examples-166"> &para;</a></span></h4>
  46307. <ul class="itemize mark-bullet">
  46308. <li>Read the initial state from <samp class="file">pattern</samp>, and specify an output of
  46309. size 200x400.
  46310. <div class="example">
  46311. <pre class="example-preformatted">cellauto=f=pattern:s=200x400
  46312. </pre></div>
  46313. </li><li>Generate a random initial row with a width of 200 cells, with a fill
  46314. ratio of 2/3:
  46315. <div class="example">
  46316. <pre class="example-preformatted">cellauto=ratio=2/3:s=200x200
  46317. </pre></div>
  46318. </li><li>Create a pattern generated by rule 18 starting by a single alive cell
  46319. centered on an initial row with width 100:
  46320. <div class="example">
  46321. <pre class="example-preformatted">cellauto=p=@:s=100x400:full=0:rule=18
  46322. </pre></div>
  46323. </li><li>Specify a more elaborated initial pattern:
  46324. <div class="example">
  46325. <pre class="example-preformatted">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
  46326. </pre></div>
  46327. </li></ul>
  46328. <a class="anchor" id="coreimagesrc"></a></div>
  46329. </div>
  46330. <div class="section-level-extent" id="coreimagesrc-1">
  46331. <h3 class="section"><span>35.3 coreimagesrc<a class="copiable-link" href="#coreimagesrc-1"> &para;</a></span></h3>
  46332. <p>Video source generated on GPU using Apple&rsquo;s CoreImage API on OSX.
  46333. </p>
  46334. <p>This video source is a specialized version of the <a class="ref" href="#coreimage">coreimage</a> video filter.
  46335. Use a core image generator at the beginning of the applied filterchain to
  46336. generate the content.
  46337. </p>
  46338. <p>The coreimagesrc video source accepts the following options:
  46339. </p><dl class="table">
  46340. <dt><samp class="option">list_generators</samp></dt>
  46341. <dd><p>List all available generators along with all their respective options as well as
  46342. possible minimum and maximum values along with the default values.
  46343. </p><div class="example">
  46344. <pre class="example-preformatted">list_generators=true
  46345. </pre></div>
  46346. </dd>
  46347. <dt><samp class="option">size, s</samp></dt>
  46348. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  46349. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46350. The default value is <code class="code">320x240</code>.
  46351. </p>
  46352. </dd>
  46353. <dt><samp class="option">rate, r</samp></dt>
  46354. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  46355. generated per second. It has to be a string in the format
  46356. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  46357. number or a valid video frame rate abbreviation. The default value is
  46358. &quot;25&quot;.
  46359. </p>
  46360. </dd>
  46361. <dt><samp class="option">sar</samp></dt>
  46362. <dd><p>Set the sample aspect ratio of the sourced video.
  46363. </p>
  46364. </dd>
  46365. <dt><samp class="option">duration, d</samp></dt>
  46366. <dd><p>Set the duration of the sourced video. See
  46367. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  46368. for the accepted syntax.
  46369. </p>
  46370. <p>If not specified, or the expressed duration is negative, the video is
  46371. supposed to be generated forever.
  46372. </p></dd>
  46373. </dl>
  46374. <p>Additionally, all options of the <a class="ref" href="#coreimage">coreimage</a> video filter are accepted.
  46375. A complete filterchain can be used for further processing of the
  46376. generated input without CPU-HOST transfer. See <a class="ref" href="#coreimage">coreimage</a> documentation
  46377. and examples for details.
  46378. </p>
  46379. <ul class="mini-toc">
  46380. <li><a href="#Examples-167" accesskey="1">Examples</a></li>
  46381. </ul>
  46382. <div class="subsection-level-extent" id="Examples-167">
  46383. <h4 class="subsection"><span>35.3.1 Examples<a class="copiable-link" href="#Examples-167"> &para;</a></span></h4>
  46384. <ul class="itemize mark-bullet">
  46385. <li>Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  46386. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  46387. <div class="example">
  46388. <pre class="example-preformatted">ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  46389. </pre></div>
  46390. <p>This example is equivalent to the QRCode example of <a class="ref" href="#coreimage">coreimage</a> without the
  46391. need for a nullsrc video source.
  46392. </p></li></ul>
  46393. </div>
  46394. </div>
  46395. <div class="section-level-extent" id="ddagrab">
  46396. <h3 class="section"><span>35.4 ddagrab<a class="copiable-link" href="#ddagrab"> &para;</a></span></h3>
  46397. <p>Captures the Windows Desktop via Desktop Duplication API.
  46398. </p>
  46399. <p>The filter exclusively returns D3D11 Hardware Frames, for on-gpu encoding
  46400. or processing. So an explicit <a class="ref" href="#hwdownload">hwdownload</a> is needed for any kind of
  46401. software processing.
  46402. </p>
  46403. <p>It accepts the following options:
  46404. </p>
  46405. <dl class="table">
  46406. <dt><samp class="option">output_idx</samp></dt>
  46407. <dd><p>DXGI Output Index to capture.
  46408. </p>
  46409. <p>Usually corresponds to the index Windows has given the screen minus one,
  46410. so it&rsquo;s starting at 0.
  46411. </p>
  46412. <p>Defaults to output 0.
  46413. </p>
  46414. </dd>
  46415. <dt><samp class="option">draw_mouse</samp></dt>
  46416. <dd><p>Whether to draw the mouse cursor.
  46417. </p>
  46418. <p>Defaults to true.
  46419. </p>
  46420. <p>Only affects hardware cursors. If a game or application renders its own cursor,
  46421. it&rsquo;ll always be captured.
  46422. </p>
  46423. </dd>
  46424. <dt><samp class="option">framerate</samp></dt>
  46425. <dd><p>Maximum framerate at which the desktop will be captured - the interval between
  46426. successive frames will not be smaller than the inverse of the framerate. When
  46427. <var class="var">dup_frames</var> is true (the default) and the desktop is not being updated
  46428. often enough, the filter will duplicate a previous frame. Note that there is no
  46429. background buffering going on, so when the filter is not polled often enough
  46430. then the actual inter-frame interval may be significantly larger.
  46431. </p>
  46432. <p>Defaults to 30 FPS.
  46433. </p>
  46434. </dd>
  46435. <dt><samp class="option">video_size</samp></dt>
  46436. <dd><p>Specify the size of the captured video.
  46437. </p>
  46438. <p>Defaults to the full size of the screen.
  46439. </p>
  46440. <p>Cropped from the bottom/right if smaller than screen size.
  46441. </p>
  46442. </dd>
  46443. <dt><samp class="option">offset_x</samp></dt>
  46444. <dd><p>Horizontal offset of the captured video.
  46445. </p>
  46446. </dd>
  46447. <dt><samp class="option">offset_y</samp></dt>
  46448. <dd><p>Vertical offset of the captured video.
  46449. </p>
  46450. </dd>
  46451. <dt><samp class="option">output_fmt</samp></dt>
  46452. <dd><p>Desired filter output format.
  46453. Defaults to 8 Bit BGRA.
  46454. </p>
  46455. <p>It accepts the following values:
  46456. </p><dl class="table">
  46457. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  46458. <dd><p>Passes all supported output formats to DDA and returns what DDA decides to use.
  46459. </p></dd>
  46460. <dt>&lsquo;<samp class="samp">8bit</samp>&rsquo;</dt>
  46461. <dt>&lsquo;<samp class="samp">bgra</samp>&rsquo;</dt>
  46462. <dd><p>8 Bit formats always work, and DDA will convert to them if necessary.
  46463. </p></dd>
  46464. <dt>&lsquo;<samp class="samp">10bit</samp>&rsquo;</dt>
  46465. <dt>&lsquo;<samp class="samp">x2bgr10</samp>&rsquo;</dt>
  46466. <dd><p>Filter initialization will fail if 10 bit format is requested but unavailable.
  46467. </p></dd>
  46468. </dl>
  46469. </dd>
  46470. <dt><samp class="option">dup_frames</samp></dt>
  46471. <dd><p>When this option is set to true (the default), the filter will duplicate frames
  46472. when the desktop has not been updated in order to maintain approximately
  46473. constant target framerate. When this option is set to false, the filter will
  46474. wait for the desktop to be updated (inter-frame intervals may vary significantly
  46475. in this case).
  46476. </p>
  46477. </dd>
  46478. </dl>
  46479. <ul class="mini-toc">
  46480. <li><a href="#Examples-168" accesskey="1">Examples</a></li>
  46481. </ul>
  46482. <div class="subsection-level-extent" id="Examples-168">
  46483. <h4 class="subsection"><span>35.4.1 Examples<a class="copiable-link" href="#Examples-168"> &para;</a></span></h4>
  46484. <p>Capture primary screen and encode using nvenc:
  46485. </p><div class="example">
  46486. <pre class="example-preformatted">ffmpeg -f lavfi -i ddagrab -c:v h264_nvenc -cq 18 output.mp4
  46487. </pre></div>
  46488. <p>You can also skip the lavfi device and directly use the filter.
  46489. Also demonstrates downloading the frame and encoding with libx264.
  46490. Explicit output format specification is required in this case:
  46491. </p><div class="example">
  46492. <pre class="example-preformatted">ffmpeg -filter_complex ddagrab=output_idx=1:framerate=60,hwdownload,format=bgra -c:v libx264 -crf 18 output.mp4
  46493. </pre></div>
  46494. <p>If you want to capture only a subsection of the desktop, this can be achieved
  46495. by specifying a smaller size and its offsets into the screen:
  46496. </p><div class="example">
  46497. <pre class="example-preformatted">ddagrab=video_size=800x600:offset_x=100:offset_y=100
  46498. </pre></div>
  46499. </div>
  46500. </div>
  46501. <div class="section-level-extent" id="gradients">
  46502. <h3 class="section"><span>35.5 gradients<a class="copiable-link" href="#gradients"> &para;</a></span></h3>
  46503. <p>Generate several gradients.
  46504. </p>
  46505. <dl class="table">
  46506. <dt><samp class="option">size, s</samp></dt>
  46507. <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
  46508. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  46509. </p>
  46510. </dd>
  46511. <dt><samp class="option">rate, r</samp></dt>
  46512. <dd><p>Set frame rate, expressed as number of frames per second. Default
  46513. value is &quot;25&quot;.
  46514. </p>
  46515. </dd>
  46516. <dt><samp class="option">c0, c1, c2, c3, c4, c5, c6, c7</samp></dt>
  46517. <dd><p>Set 8 colors. Default values for colors is to pick random one.
  46518. </p>
  46519. </dd>
  46520. <dt><samp class="option">x0, y0, y0, y1</samp></dt>
  46521. <dd><p>Set gradient line source and destination points. If negative or out of range, random ones
  46522. are picked.
  46523. </p>
  46524. </dd>
  46525. <dt><samp class="option">nb_colors, n</samp></dt>
  46526. <dd><p>Set number of colors to use at once. Allowed range is from 2 to 8. Default value is 2.
  46527. </p>
  46528. </dd>
  46529. <dt><samp class="option">seed</samp></dt>
  46530. <dd><p>Set seed for picking gradient line points.
  46531. </p>
  46532. </dd>
  46533. <dt><samp class="option">duration, d</samp></dt>
  46534. <dd><p>Set the duration of the sourced video. See
  46535. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  46536. for the accepted syntax.
  46537. </p>
  46538. <p>If not specified, or the expressed duration is negative, the video is
  46539. supposed to be generated forever.
  46540. </p>
  46541. </dd>
  46542. <dt><samp class="option">speed</samp></dt>
  46543. <dd><p>Set speed of gradients rotation.
  46544. </p>
  46545. </dd>
  46546. <dt><samp class="option">type, t</samp></dt>
  46547. <dd><p>Set type of gradients.
  46548. Available values are:
  46549. </p><dl class="table">
  46550. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  46551. <dt>&lsquo;<samp class="samp">radial</samp>&rsquo;</dt>
  46552. <dt>&lsquo;<samp class="samp">circular</samp>&rsquo;</dt>
  46553. <dt>&lsquo;<samp class="samp">spiral</samp>&rsquo;</dt>
  46554. <dt>&lsquo;<samp class="samp">square</samp>&rsquo;</dt>
  46555. </dl>
  46556. <p>Default type is <var class="var">linear</var>.
  46557. </p></dd>
  46558. </dl>
  46559. <ul class="mini-toc">
  46560. <li><a href="#Commands-157" accesskey="1">Commands</a></li>
  46561. </ul>
  46562. <div class="subsection-level-extent" id="Commands-157">
  46563. <h4 class="subsection"><span>35.5.1 Commands<a class="copiable-link" href="#Commands-157"> &para;</a></span></h4>
  46564. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  46565. </p>
  46566. </div>
  46567. </div>
  46568. <div class="section-level-extent" id="mandelbrot">
  46569. <h3 class="section"><span>35.6 mandelbrot<a class="copiable-link" href="#mandelbrot"> &para;</a></span></h3>
  46570. <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
  46571. point specified with <var class="var">start_x</var> and <var class="var">start_y</var>.
  46572. </p>
  46573. <p>This source accepts the following options:
  46574. </p>
  46575. <dl class="table">
  46576. <dt><samp class="option">end_pts</samp></dt>
  46577. <dd><p>Set the terminal pts value. Default value is 400.
  46578. </p>
  46579. </dd>
  46580. <dt><samp class="option">end_scale</samp></dt>
  46581. <dd><p>Set the terminal scale value.
  46582. Must be a floating point value. Default value is 0.3.
  46583. </p>
  46584. </dd>
  46585. <dt><samp class="option">inner</samp></dt>
  46586. <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
  46587. Mandelbrot fractal internal region.
  46588. </p>
  46589. <p>It shall assume one of the following values:
  46590. </p><dl class="table">
  46591. <dt><samp class="option">black</samp></dt>
  46592. <dd><p>Set black mode.
  46593. </p></dd>
  46594. <dt><samp class="option">convergence</samp></dt>
  46595. <dd><p>Show time until convergence.
  46596. </p></dd>
  46597. <dt><samp class="option">mincol</samp></dt>
  46598. <dd><p>Set color based on point closest to the origin of the iterations.
  46599. </p></dd>
  46600. <dt><samp class="option">period</samp></dt>
  46601. <dd><p>Set period mode.
  46602. </p></dd>
  46603. </dl>
  46604. <p>Default value is <var class="var">mincol</var>.
  46605. </p>
  46606. </dd>
  46607. <dt><samp class="option">bailout</samp></dt>
  46608. <dd><p>Set the bailout value. Default value is 10.0.
  46609. </p>
  46610. </dd>
  46611. <dt><samp class="option">maxiter</samp></dt>
  46612. <dd><p>Set the maximum of iterations performed by the rendering
  46613. algorithm. Default value is 7189.
  46614. </p>
  46615. </dd>
  46616. <dt><samp class="option">outer</samp></dt>
  46617. <dd><p>Set outer coloring mode.
  46618. It shall assume one of following values:
  46619. </p><dl class="table">
  46620. <dt><samp class="option">iteration_count</samp></dt>
  46621. <dd><p>Set iteration count mode.
  46622. </p></dd>
  46623. <dt><samp class="option">normalized_iteration_count</samp></dt>
  46624. <dd><p>set normalized iteration count mode.
  46625. </p></dd>
  46626. </dl>
  46627. <p>Default value is <var class="var">normalized_iteration_count</var>.
  46628. </p>
  46629. </dd>
  46630. <dt><samp class="option">rate, r</samp></dt>
  46631. <dd><p>Set frame rate, expressed as number of frames per second. Default
  46632. value is &quot;25&quot;.
  46633. </p>
  46634. </dd>
  46635. <dt><samp class="option">size, s</samp></dt>
  46636. <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
  46637. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  46638. </p>
  46639. </dd>
  46640. <dt><samp class="option">start_scale</samp></dt>
  46641. <dd><p>Set the initial scale value. Default value is 3.0.
  46642. </p>
  46643. </dd>
  46644. <dt><samp class="option">start_x</samp></dt>
  46645. <dd><p>Set the initial x position. Must be a floating point value between
  46646. -100 and 100. Default value is -0.743643887037158704752191506114774.
  46647. </p>
  46648. </dd>
  46649. <dt><samp class="option">start_y</samp></dt>
  46650. <dd><p>Set the initial y position. Must be a floating point value between
  46651. -100 and 100. Default value is -0.131825904205311970493132056385139.
  46652. </p></dd>
  46653. </dl>
  46654. </div>
  46655. <div class="section-level-extent" id="mptestsrc">
  46656. <h3 class="section"><span>35.7 mptestsrc<a class="copiable-link" href="#mptestsrc"> &para;</a></span></h3>
  46657. <p>Generate various test patterns, as generated by the MPlayer test filter.
  46658. </p>
  46659. <p>The size of the generated video is fixed, and is 256x256.
  46660. This source is useful in particular for testing encoding features.
  46661. </p>
  46662. <p>This source accepts the following options:
  46663. </p>
  46664. <dl class="table">
  46665. <dt><samp class="option">rate, r</samp></dt>
  46666. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  46667. generated per second. It has to be a string in the format
  46668. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  46669. number or a valid video frame rate abbreviation. The default value is
  46670. &quot;25&quot;.
  46671. </p>
  46672. </dd>
  46673. <dt><samp class="option">duration, d</samp></dt>
  46674. <dd><p>Set the duration of the sourced video. See
  46675. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  46676. for the accepted syntax.
  46677. </p>
  46678. <p>If not specified, or the expressed duration is negative, the video is
  46679. supposed to be generated forever.
  46680. </p>
  46681. </dd>
  46682. <dt><samp class="option">test, t</samp></dt>
  46683. <dd>
  46684. <p>Set the number or the name of the test to perform. Supported tests are:
  46685. </p><dl class="table">
  46686. <dt><samp class="option">dc_luma</samp></dt>
  46687. <dt><samp class="option">dc_chroma</samp></dt>
  46688. <dt><samp class="option">freq_luma</samp></dt>
  46689. <dt><samp class="option">freq_chroma</samp></dt>
  46690. <dt><samp class="option">amp_luma</samp></dt>
  46691. <dt><samp class="option">amp_chroma</samp></dt>
  46692. <dt><samp class="option">cbp</samp></dt>
  46693. <dt><samp class="option">mv</samp></dt>
  46694. <dt><samp class="option">ring1</samp></dt>
  46695. <dt><samp class="option">ring2</samp></dt>
  46696. <dt><samp class="option">all</samp></dt>
  46697. <dt><samp class="option">max_frames, m</samp></dt>
  46698. <dd><p>Set the maximum number of frames generated for each test, default value is 30.
  46699. </p>
  46700. </dd>
  46701. </dl>
  46702. <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
  46703. </p></dd>
  46704. </dl>
  46705. <p>Some examples:
  46706. </p><div class="example">
  46707. <pre class="example-preformatted">mptestsrc=t=dc_luma
  46708. </pre></div>
  46709. <p>will generate a &quot;dc_luma&quot; test pattern.
  46710. </p>
  46711. </div>
  46712. <div class="section-level-extent" id="frei0r_005fsrc">
  46713. <h3 class="section"><span>35.8 frei0r_src<a class="copiable-link" href="#frei0r_005fsrc"> &para;</a></span></h3>
  46714. <p>Provide a frei0r source.
  46715. </p>
  46716. <p>To enable compilation of this filter you need to install the frei0r
  46717. header and configure FFmpeg with <code class="code">--enable-frei0r</code>.
  46718. </p>
  46719. <p>This source accepts the following parameters:
  46720. </p>
  46721. <dl class="table">
  46722. <dt><samp class="option">size</samp></dt>
  46723. <dd><p>The size of the video to generate. For the syntax of this option, check the
  46724. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46725. </p>
  46726. </dd>
  46727. <dt><samp class="option">framerate</samp></dt>
  46728. <dd><p>The framerate of the generated video. It may be a string of the form
  46729. <var class="var">num</var>/<var class="var">den</var> or a frame rate abbreviation.
  46730. </p>
  46731. </dd>
  46732. <dt><samp class="option">filter_name</samp></dt>
  46733. <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
  46734. how to set the parameters, read the <a class="ref" href="#frei0r">frei0r</a> section in the video filters
  46735. documentation.
  46736. </p>
  46737. </dd>
  46738. <dt><samp class="option">filter_params</samp></dt>
  46739. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
  46740. </p>
  46741. </dd>
  46742. </dl>
  46743. <p>For example, to generate a frei0r partik0l source with size 200x200
  46744. and frame rate 10 which is overlaid on the overlay filter main input:
  46745. </p><div class="example">
  46746. <pre class="example-preformatted">frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
  46747. </pre></div>
  46748. </div>
  46749. <div class="section-level-extent" id="life">
  46750. <h3 class="section"><span>35.9 life<a class="copiable-link" href="#life"> &para;</a></span></h3>
  46751. <p>Generate a life pattern.
  46752. </p>
  46753. <p>This source is based on a generalization of John Conway&rsquo;s life game.
  46754. </p>
  46755. <p>The sourced input represents a life grid, each pixel represents a cell
  46756. which can be in one of two possible states, alive or dead. Every cell
  46757. interacts with its eight neighbours, which are the cells that are
  46758. horizontally, vertically, or diagonally adjacent.
  46759. </p>
  46760. <p>At each interaction the grid evolves according to the adopted rule,
  46761. which specifies the number of neighbor alive cells which will make a
  46762. cell stay alive or born. The <samp class="option">rule</samp> option allows one to specify
  46763. the rule to adopt.
  46764. </p>
  46765. <p>This source accepts the following options:
  46766. </p>
  46767. <dl class="table">
  46768. <dt><samp class="option">filename, f</samp></dt>
  46769. <dd><p>Set the file from which to read the initial grid state. In the file,
  46770. each non-whitespace character is considered an alive cell, and newline
  46771. is used to delimit the end of each row.
  46772. </p>
  46773. <p>If this option is not specified, the initial grid is generated
  46774. randomly.
  46775. </p>
  46776. </dd>
  46777. <dt><samp class="option">rate, r</samp></dt>
  46778. <dd><p>Set the video rate, that is the number of frames generated per second.
  46779. Default is 25.
  46780. </p>
  46781. </dd>
  46782. <dt><samp class="option">random_fill_ratio, ratio</samp></dt>
  46783. <dd><p>Set the random fill ratio for the initial random grid. It is a
  46784. floating point number value ranging from 0 to 1, defaults to 1/PHI.
  46785. It is ignored when a file is specified.
  46786. </p>
  46787. </dd>
  46788. <dt><samp class="option">random_seed, seed</samp></dt>
  46789. <dd><p>Set the seed for filling the initial random grid, must be an integer
  46790. included between 0 and UINT32_MAX. If not specified, or if explicitly
  46791. set to -1, the filter will try to use a good random seed on a best
  46792. effort basis.
  46793. </p>
  46794. </dd>
  46795. <dt><samp class="option">rule</samp></dt>
  46796. <dd><p>Set the life rule.
  46797. </p>
  46798. <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;,
  46799. where <var class="var">NS</var> and <var class="var">NB</var> are sequences of numbers in the range 0-8,
  46800. <var class="var">NS</var> specifies the number of alive neighbor cells which make a
  46801. live cell stay alive, and <var class="var">NB</var> the number of alive neighbor cells
  46802. which make a dead cell to become alive (i.e. to &quot;born&quot;).
  46803. &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
  46804. </p>
  46805. <p>Alternatively a rule can be specified by an 18-bits integer. The 9
  46806. high order bits are used to encode the next cell state if it is alive
  46807. for each number of neighbor alive cells, the low order bits specify
  46808. the rule for &quot;borning&quot; new cells. Higher order bits encode for an
  46809. higher number of neighbor cells.
  46810. For example the number 6153 = <code class="code">(12&lt;&lt;9)+9</code> specifies a stay alive
  46811. rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
  46812. </p>
  46813. <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;s game of life
  46814. rule, and will keep a cell alive if it has 2 or 3 neighbor alive
  46815. cells, and will born a new cell if there are three alive cells around
  46816. a dead cell.
  46817. </p>
  46818. </dd>
  46819. <dt><samp class="option">size, s</samp></dt>
  46820. <dd><p>Set the size of the output video. For the syntax of this option, check the
  46821. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46822. </p>
  46823. <p>If <samp class="option">filename</samp> is specified, the size is set by default to the
  46824. same size of the input file. If <samp class="option">size</samp> is set, it must contain
  46825. the size specified in the input file, and the initial grid defined in
  46826. that file is centered in the larger resulting area.
  46827. </p>
  46828. <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
  46829. (used for a randomly generated initial grid).
  46830. </p>
  46831. </dd>
  46832. <dt><samp class="option">stitch</samp></dt>
  46833. <dd><p>If set to 1, stitch the left and right grid edges together, and the
  46834. top and bottom edges also. Defaults to 1.
  46835. </p>
  46836. </dd>
  46837. <dt><samp class="option">mold</samp></dt>
  46838. <dd><p>Set cell mold speed. If set, a dead cell will go from <samp class="option">death_color</samp> to
  46839. <samp class="option">mold_color</samp> with a step of <samp class="option">mold</samp>. <samp class="option">mold</samp> can have a
  46840. value from 0 to 255.
  46841. </p>
  46842. </dd>
  46843. <dt><samp class="option">life_color</samp></dt>
  46844. <dd><p>Set the color of living (or new born) cells.
  46845. </p>
  46846. </dd>
  46847. <dt><samp class="option">death_color</samp></dt>
  46848. <dd><p>Set the color of dead cells. If <samp class="option">mold</samp> is set, this is the first color
  46849. used to represent a dead cell.
  46850. </p>
  46851. </dd>
  46852. <dt><samp class="option">mold_color</samp></dt>
  46853. <dd><p>Set mold color, for definitely dead and moldy cells.
  46854. </p>
  46855. <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
  46856. ffmpeg-utils manual</a>.
  46857. </p></dd>
  46858. </dl>
  46859. <ul class="mini-toc">
  46860. <li><a href="#Examples-169" accesskey="1">Examples</a></li>
  46861. </ul>
  46862. <div class="subsection-level-extent" id="Examples-169">
  46863. <h4 class="subsection"><span>35.9.1 Examples<a class="copiable-link" href="#Examples-169"> &para;</a></span></h4>
  46864. <ul class="itemize mark-bullet">
  46865. <li>Read a grid from <samp class="file">pattern</samp>, and center it on a grid of size
  46866. 300x300 pixels:
  46867. <div class="example">
  46868. <pre class="example-preformatted">life=f=pattern:s=300x300
  46869. </pre></div>
  46870. </li><li>Generate a random grid of size 200x200, with a fill ratio of 2/3:
  46871. <div class="example">
  46872. <pre class="example-preformatted">life=ratio=2/3:s=200x200
  46873. </pre></div>
  46874. </li><li>Specify a custom rule for evolving a randomly generated grid:
  46875. <div class="example">
  46876. <pre class="example-preformatted">life=rule=S14/B34
  46877. </pre></div>
  46878. </li><li>Full example with slow death effect (mold) using <code class="command">ffplay</code>:
  46879. <div class="example">
  46880. <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
  46881. </pre></div>
  46882. </li></ul>
  46883. </div>
  46884. </div>
  46885. <div class="section-level-extent" id="qrencodesrc">
  46886. <h3 class="section"><span>35.10 qrencodesrc<a class="copiable-link" href="#qrencodesrc"> &para;</a></span></h3>
  46887. <p>Generate a QR code using the libqrencode library (see
  46888. <a class="url" href="https://fukuchi.org/works/qrencode/">https://fukuchi.org/works/qrencode/</a>).
  46889. </p>
  46890. <p>To enable the compilation of this source, you need to configure FFmpeg with
  46891. <code class="code">--enable-libqrencode</code>.
  46892. </p>
  46893. <p>The QR code is generated from the provided text or text pattern. The
  46894. corresponding QR code is scaled and put in the video output according to the
  46895. specified output size options.
  46896. </p>
  46897. <p>In case no text is specified, the QR code is not generated, but an empty colored
  46898. output is returned instead.
  46899. </p>
  46900. <p>This source accepts the following options:
  46901. </p>
  46902. <dl class="table">
  46903. <dt><samp class="option">qrcode_width, q</samp></dt>
  46904. <dt><samp class="option">padded_qrcode_width, Q</samp></dt>
  46905. <dd><p>Specify an expression for the width of the rendered QR code, with and without
  46906. padding. The <var class="var">qrcode_width</var> expression can reference the value set by the
  46907. <var class="var">padded_qrcode_width</var> expression, and vice versa.
  46908. By default <var class="var">padded_qrcode_width</var> is set to <var class="var">qrcode_width</var>, meaning that
  46909. there is no padding.
  46910. </p>
  46911. <p>These expressions are evaluated only once, when initializing the source.
  46912. See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  46913. </p>
  46914. <p>Note that some of the constants are missing for the source (for example the
  46915. <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
  46916. expression for each frame rather than at initialization time.
  46917. </p>
  46918. </dd>
  46919. <dt><samp class="option">rate, r</samp></dt>
  46920. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  46921. generated per second. It has to be a string in the format
  46922. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  46923. number or a valid video frame rate abbreviation. The default value is
  46924. &quot;25&quot;.
  46925. </p>
  46926. </dd>
  46927. <dt><samp class="option">case_sensitive, cs</samp></dt>
  46928. <dd><p>Instruct libqrencode to use case sensitive encoding. This is enabled by
  46929. default. This can be disabled to reduce the QR encoding size.
  46930. </p>
  46931. </dd>
  46932. <dt><samp class="option">level, l</samp></dt>
  46933. <dd><p>Specify the QR encoding error correction level. With an higher correction level,
  46934. the encoding size will increase but the code will be more robust to corruption.
  46935. Lower level is <var class="var">L</var>.
  46936. </p>
  46937. <p>It accepts the following values:
  46938. </p><dl class="table">
  46939. <dt>&lsquo;<samp class="samp">L</samp>&rsquo;</dt>
  46940. <dt>&lsquo;<samp class="samp">M</samp>&rsquo;</dt>
  46941. <dt>&lsquo;<samp class="samp">Q</samp>&rsquo;</dt>
  46942. <dt>&lsquo;<samp class="samp">H</samp>&rsquo;</dt>
  46943. </dl>
  46944. </dd>
  46945. <dt><samp class="option">expansion</samp></dt>
  46946. <dd><p>Select how the input text is expanded. Can be either <code class="code">none</code>, or
  46947. <code class="code">normal</code> (default). See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode Text expansion</a>
  46948. section for details.
  46949. </p>
  46950. </dd>
  46951. <dt><samp class="option">text</samp></dt>
  46952. <dt><samp class="option">textfile</samp></dt>
  46953. <dd><p>Define the text to be rendered. In case neither is specified, no QR is encoded
  46954. (just an empty colored frame).
  46955. </p>
  46956. <p>In case expansion is enabled, the text is treated as a text template, using the
  46957. qrencode expansion mechanism. See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode
  46958. Text expansion</a> section for details.
  46959. </p>
  46960. </dd>
  46961. <dt><samp class="option">background_color, bc</samp></dt>
  46962. <dt><samp class="option">foreground_color, fc</samp></dt>
  46963. <dd><p>Set the QR code and background color. The default value of
  46964. <var class="var">foreground_color</var> is &quot;black&quot;, the default value of <var class="var">background_color</var>
  46965. is &quot;white&quot;.
  46966. </p>
  46967. <p>For the syntax of the color options, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot;
  46968. section in the ffmpeg-utils manual</a>.
  46969. </p></dd>
  46970. </dl>
  46971. <ul class="mini-toc">
  46972. <li><a href="#Examples-170" accesskey="1">Examples</a></li>
  46973. </ul>
  46974. <div class="subsection-level-extent" id="Examples-170">
  46975. <h4 class="subsection"><span>35.10.1 Examples<a class="copiable-link" href="#Examples-170"> &para;</a></span></h4>
  46976. <ul class="itemize mark-bullet">
  46977. <li>Generate a QR code encoding the specified text with the default size:
  46978. <div class="example">
  46979. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org
  46980. </pre></div>
  46981. </li><li>Same as below, but select blue on pink colors:
  46982. <div class="example">
  46983. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:bc=pink:fc=blue
  46984. </pre></div>
  46985. </li><li>Generate a QR code with width of 200 pixels and padding, making the padded width
  46986. 4/3 of the QR code width:
  46987. <div class="example">
  46988. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:q=200:Q=4/3*q
  46989. </pre></div>
  46990. </li><li>Generate a QR code with padded width of 200 pixels and padding, making the QR
  46991. code width 3/4 of the padded width:
  46992. <div class="example">
  46993. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:Q=200:q=3/4*Q
  46994. </pre></div>
  46995. </li><li>Generate a QR code encoding the frame number:
  46996. <div class="example">
  46997. <pre class="example-preformatted">qrencodesrc=text=%{n}
  46998. </pre></div>
  46999. </li><li>Generate a QR code encoding the GMT timestamp:
  47000. <div class="example">
  47001. <pre class="example-preformatted">qrencodesrc=text=%{gmtime}
  47002. </pre></div>
  47003. </li><li>Generate a QR code encoding the timestamp expressed as a float:
  47004. <div class="example">
  47005. <pre class="example-preformatted">qrencodesrc=text=%{pts}
  47006. </pre></div>
  47007. </li></ul>
  47008. <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></div>
  47009. </div>
  47010. <div class="section-level-extent" id="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">
  47011. <h3 class="section"><span>35.11 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc<a class="copiable-link" 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"> &para;</a></span></h3>
  47012. <p>The <code class="code">allrgb</code> source returns frames of size 4096x4096 of all rgb colors.
  47013. </p>
  47014. <p>The <code class="code">allyuv</code> source returns frames of size 4096x4096 of all yuv colors.
  47015. </p>
  47016. <p>The <code class="code">color</code> source provides an uniformly colored input.
  47017. </p>
  47018. <p>The <code class="code">colorchart</code> source provides a colors checker chart.
  47019. </p>
  47020. <p>The <code class="code">colorspectrum</code> source provides a color spectrum input.
  47021. </p>
  47022. <p>The <code class="code">haldclutsrc</code> source provides an identity Hald CLUT. See also
  47023. <a class="ref" href="#haldclut">haldclut</a> filter.
  47024. </p>
  47025. <p>The <code class="code">nullsrc</code> source returns unprocessed video frames. It is
  47026. mainly useful to be employed in analysis / debugging tools, or as the
  47027. source for filters which ignore the input data.
  47028. </p>
  47029. <p>The <code class="code">pal75bars</code> source generates a color bars pattern, based on
  47030. EBU PAL recommendations with 75% color levels.
  47031. </p>
  47032. <p>The <code class="code">pal100bars</code> source generates a color bars pattern, based on
  47033. EBU PAL recommendations with 100% color levels.
  47034. </p>
  47035. <p>The <code class="code">rgbtestsrc</code> source generates an RGB test pattern useful for
  47036. detecting RGB vs BGR issues. You should see a red, green and blue
  47037. stripe from top to bottom.
  47038. </p>
  47039. <p>The <code class="code">smptebars</code> source generates a color bars pattern, based on
  47040. the SMPTE Engineering Guideline EG 1-1990.
  47041. </p>
  47042. <p>The <code class="code">smptehdbars</code> source generates a color bars pattern, based on
  47043. the SMPTE RP 219-2002.
  47044. </p>
  47045. <p>The <code class="code">testsrc</code> source generates a test video pattern, showing a
  47046. color pattern, a scrolling gradient and a timestamp. This is mainly
  47047. intended for testing purposes.
  47048. </p>
  47049. <p>The <code class="code">testsrc2</code> source is similar to testsrc, but supports more
  47050. pixel formats instead of just <code class="code">rgb24</code>. This allows using it as an
  47051. input for other tests without requiring a format conversion.
  47052. </p>
  47053. <p>The <code class="code">yuvtestsrc</code> source generates an YUV test pattern. You should
  47054. see a y, cb and cr stripe from top to bottom.
  47055. </p>
  47056. <p>The sources accept the following parameters:
  47057. </p>
  47058. <dl class="table">
  47059. <dt><samp class="option">level</samp></dt>
  47060. <dd><p>Specify the level of the Hald CLUT, only available in the <code class="code">haldclutsrc</code>
  47061. 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>
  47062. pixels to be used as identity matrix for 3D lookup tables. Each component is
  47063. coded on a <code class="code">1/(N*N)</code> scale.
  47064. </p>
  47065. </dd>
  47066. <dt><samp class="option">color, c</samp></dt>
  47067. <dd><p>Specify the color of the source, only available in the <code class="code">color</code>
  47068. source. For the syntax of this option, check the
  47069. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  47070. </p>
  47071. </dd>
  47072. <dt><samp class="option">size, s</samp></dt>
  47073. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  47074. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47075. The default value is <code class="code">320x240</code>.
  47076. </p>
  47077. <p>This option is not available with the <code class="code">allrgb</code>, <code class="code">allyuv</code>, and
  47078. <code class="code">haldclutsrc</code> filters.
  47079. </p>
  47080. </dd>
  47081. <dt><samp class="option">rate, r</samp></dt>
  47082. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  47083. generated per second. It has to be a string in the format
  47084. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  47085. number or a valid video frame rate abbreviation. The default value is
  47086. &quot;25&quot;.
  47087. </p>
  47088. </dd>
  47089. <dt><samp class="option">duration, d</samp></dt>
  47090. <dd><p>Set the duration of the sourced video. See
  47091. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  47092. for the accepted syntax.
  47093. </p>
  47094. <p>If not specified, or the expressed duration is negative, the video is
  47095. supposed to be generated forever.
  47096. </p>
  47097. <p>Since the frame rate is used as time base, all frames including the last one
  47098. will have their full duration. If the specified duration is not a multiple
  47099. of the frame duration, it will be rounded up.
  47100. </p>
  47101. </dd>
  47102. <dt><samp class="option">sar</samp></dt>
  47103. <dd><p>Set the sample aspect ratio of the sourced video.
  47104. </p>
  47105. </dd>
  47106. <dt><samp class="option">alpha</samp></dt>
  47107. <dd><p>Specify the alpha (opacity) of the background, only available in the
  47108. <code class="code">testsrc2</code> source. The value must be between 0 (fully transparent) and
  47109. 255 (fully opaque, the default).
  47110. </p>
  47111. </dd>
  47112. <dt><samp class="option">decimals, n</samp></dt>
  47113. <dd><p>Set the number of decimals to show in the timestamp, only available in the
  47114. <code class="code">testsrc</code> source.
  47115. </p>
  47116. <p>The displayed timestamp value will correspond to the original
  47117. timestamp value multiplied by the power of 10 of the specified
  47118. value. Default value is 0.
  47119. </p>
  47120. </dd>
  47121. <dt><samp class="option">type</samp></dt>
  47122. <dd><p>Set the type of the color spectrum, only available in the
  47123. <code class="code">colorspectrum</code> source. Can be one of the following:
  47124. </p>
  47125. <dl class="table">
  47126. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  47127. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  47128. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  47129. </dl>
  47130. </dd>
  47131. <dt><samp class="option">patch_size</samp></dt>
  47132. <dd><p>Set patch size of single color patch, only available in the
  47133. <code class="code">colorchart</code> source. Default is <code class="code">64x64</code>.
  47134. </p>
  47135. </dd>
  47136. <dt><samp class="option">preset</samp></dt>
  47137. <dd><p>Set colorchecker colors preset, only available in the
  47138. <code class="code">colorchart</code> source.
  47139. </p>
  47140. <p>Available values are:
  47141. </p><dl class="table">
  47142. <dt>&lsquo;<samp class="samp">reference</samp>&rsquo;</dt>
  47143. <dt>&lsquo;<samp class="samp">skintones</samp>&rsquo;</dt>
  47144. </dl>
  47145. <p>Default value is <code class="code">reference</code>.
  47146. </p></dd>
  47147. </dl>
  47148. <ul class="mini-toc">
  47149. <li><a href="#Examples-171" accesskey="1">Examples</a></li>
  47150. <li><a href="#Commands-158" accesskey="2">Commands</a></li>
  47151. </ul>
  47152. <div class="subsection-level-extent" id="Examples-171">
  47153. <h4 class="subsection"><span>35.11.1 Examples<a class="copiable-link" href="#Examples-171"> &para;</a></span></h4>
  47154. <ul class="itemize mark-bullet">
  47155. <li>Generate a video with a duration of 5.3 seconds, with size
  47156. 176x144 and a frame rate of 10 frames per second:
  47157. <div class="example">
  47158. <pre class="example-preformatted">testsrc=duration=5.3:size=qcif:rate=10
  47159. </pre></div>
  47160. </li><li>The following graph description will generate a red source
  47161. with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
  47162. frames per second:
  47163. <div class="example">
  47164. <pre class="example-preformatted">color=c=red@0.2:s=qcif:r=10
  47165. </pre></div>
  47166. </li><li>If the input content is to be ignored, <code class="code">nullsrc</code> can be used. The
  47167. following command generates noise in the luma plane by employing
  47168. the <code class="code">geq</code> filter:
  47169. <div class="example">
  47170. <pre class="example-preformatted">nullsrc=s=256x256, geq=random(1)*255:128:128
  47171. </pre></div>
  47172. </li></ul>
  47173. </div>
  47174. <div class="subsection-level-extent" id="Commands-158">
  47175. <h4 class="subsection"><span>35.11.2 Commands<a class="copiable-link" href="#Commands-158"> &para;</a></span></h4>
  47176. <p>The <code class="code">color</code> source supports the following commands:
  47177. </p>
  47178. <dl class="table">
  47179. <dt><samp class="option">c, color</samp></dt>
  47180. <dd><p>Set the color of the created image. Accepts the same syntax of the
  47181. corresponding <samp class="option">color</samp> option.
  47182. </p></dd>
  47183. </dl>
  47184. </div>
  47185. </div>
  47186. <div class="section-level-extent" id="openclsrc">
  47187. <h3 class="section"><span>35.12 openclsrc<a class="copiable-link" href="#openclsrc"> &para;</a></span></h3>
  47188. <p>Generate video using an OpenCL program.
  47189. </p>
  47190. <dl class="table">
  47191. <dt><samp class="option">source</samp></dt>
  47192. <dd><p>OpenCL program source file.
  47193. </p>
  47194. </dd>
  47195. <dt><samp class="option">kernel</samp></dt>
  47196. <dd><p>Kernel name in program.
  47197. </p>
  47198. </dd>
  47199. <dt><samp class="option">size, s</samp></dt>
  47200. <dd><p>Size of frames to generate. This must be set.
  47201. </p>
  47202. </dd>
  47203. <dt><samp class="option">format</samp></dt>
  47204. <dd><p>Pixel format to use for the generated frames. This must be set.
  47205. </p>
  47206. </dd>
  47207. <dt><samp class="option">rate, r</samp></dt>
  47208. <dd><p>Number of frames generated every second. Default value is &rsquo;25&rsquo;.
  47209. </p>
  47210. </dd>
  47211. </dl>
  47212. <p>For details of how the program loading works, see the <a class="ref" href="#program_005fopencl">program_opencl</a>
  47213. filter.
  47214. </p>
  47215. <p>Example programs:
  47216. </p>
  47217. <ul class="itemize mark-bullet">
  47218. <li>Generate a colour ramp by setting pixel values from the position of the pixel
  47219. in the output image. (Note that this will work with all pixel formats, but
  47220. the generated output will not be the same.)
  47221. <pre class="verbatim">__kernel void ramp(__write_only image2d_t dst,
  47222. unsigned int index)
  47223. {
  47224. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  47225. float4 val;
  47226. val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
  47227. write_imagef(dst, loc, val);
  47228. }
  47229. </pre>
  47230. </li><li>Generate a Sierpinski carpet pattern, panning by a single pixel each frame.
  47231. <pre class="verbatim">__kernel void sierpinski_carpet(__write_only image2d_t dst,
  47232. unsigned int index)
  47233. {
  47234. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  47235. float4 value = 0.0f;
  47236. int x = loc.x + index;
  47237. int y = loc.y + index;
  47238. while (x &gt; 0 || y &gt; 0) {
  47239. if (x % 3 == 1 &amp;&amp; y % 3 == 1) {
  47240. value = 1.0f;
  47241. break;
  47242. }
  47243. x /= 3;
  47244. y /= 3;
  47245. }
  47246. write_imagef(dst, loc, value);
  47247. }
  47248. </pre>
  47249. </li></ul>
  47250. </div>
  47251. <div class="section-level-extent" id="sierpinski">
  47252. <h3 class="section"><span>35.13 sierpinski<a class="copiable-link" href="#sierpinski"> &para;</a></span></h3>
  47253. <p>Generate a Sierpinski carpet/triangle fractal, and randomly pan around.
  47254. </p>
  47255. <p>This source accepts the following options:
  47256. </p>
  47257. <dl class="table">
  47258. <dt><samp class="option">size, s</samp></dt>
  47259. <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
  47260. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  47261. </p>
  47262. </dd>
  47263. <dt><samp class="option">rate, r</samp></dt>
  47264. <dd><p>Set frame rate, expressed as number of frames per second. Default
  47265. value is &quot;25&quot;.
  47266. </p>
  47267. </dd>
  47268. <dt><samp class="option">seed</samp></dt>
  47269. <dd><p>Set seed which is used for random panning.
  47270. </p>
  47271. </dd>
  47272. <dt><samp class="option">jump</samp></dt>
  47273. <dd><p>Set max jump for single pan destination. Allowed range is from 1 to 10000.
  47274. </p>
  47275. </dd>
  47276. <dt><samp class="option">type</samp></dt>
  47277. <dd><p>Set fractal type, can be default <code class="code">carpet</code> or <code class="code">triangle</code>.
  47278. </p></dd>
  47279. </dl>
  47280. </div>
  47281. <div class="section-level-extent" id="zoneplate">
  47282. <h3 class="section"><span>35.14 zoneplate<a class="copiable-link" href="#zoneplate"> &para;</a></span></h3>
  47283. <p>Generate a zoneplate test video pattern.
  47284. </p>
  47285. <p>This source accepts the following options:
  47286. </p>
  47287. <dl class="table">
  47288. <dt><samp class="option">size, s</samp></dt>
  47289. <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
  47290. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;320x240&quot;.
  47291. </p>
  47292. </dd>
  47293. <dt><samp class="option">rate, r</samp></dt>
  47294. <dd><p>Set frame rate, expressed as number of frames per second. Default
  47295. value is &quot;25&quot;.
  47296. </p>
  47297. </dd>
  47298. <dt><samp class="option">duration, d</samp></dt>
  47299. <dd><p>Set the duration of the sourced video. See
  47300. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  47301. for the accepted syntax.
  47302. </p>
  47303. <p>If not specified, or the expressed duration is negative, the video is
  47304. supposed to be generated forever.
  47305. </p>
  47306. </dd>
  47307. <dt><samp class="option">sar</samp></dt>
  47308. <dd><p>Set the sample aspect ratio of the sourced video.
  47309. </p>
  47310. </dd>
  47311. <dt><samp class="option">precision</samp></dt>
  47312. <dd><p>Set precision in bits for look-up table for sine calculations. Default value is 10.
  47313. Allowed range is from 4 to 16.
  47314. </p>
  47315. </dd>
  47316. <dt><samp class="option">xo</samp></dt>
  47317. <dd><p>Set horizontal axis offset for output signal. Default value is 0.
  47318. </p>
  47319. </dd>
  47320. <dt><samp class="option">yo</samp></dt>
  47321. <dd><p>Set vertical axis offset for output signal. Default value is 0.
  47322. </p>
  47323. </dd>
  47324. <dt><samp class="option">to</samp></dt>
  47325. <dd><p>Set time axis offset for output signal. Default value is 0.
  47326. </p>
  47327. </dd>
  47328. <dt><samp class="option">k0</samp></dt>
  47329. <dd><p>Set 0-order, constant added to signal phase. Default value is 0.
  47330. </p>
  47331. </dd>
  47332. <dt><samp class="option">kx</samp></dt>
  47333. <dd><p>Set 1-order, phase factor multiplier for horizontal axis. Default value is 0.
  47334. </p>
  47335. </dd>
  47336. <dt><samp class="option">ky</samp></dt>
  47337. <dd><p>Set 1-order, phase factor multiplier for vertical axis. Default value is 0.
  47338. </p>
  47339. </dd>
  47340. <dt><samp class="option">kt</samp></dt>
  47341. <dd><p>Set 1-order, phase factor multiplier for time axis. Default value is 0.
  47342. </p>
  47343. </dd>
  47344. <dt><samp class="option">kxt, kyt, kxy</samp></dt>
  47345. <dd><p>Set phase factor multipliers for combination of spatial and temporal axis.
  47346. Default value is 0.
  47347. </p>
  47348. </dd>
  47349. <dt><samp class="option">kx2</samp></dt>
  47350. <dd><p>Set 2-order, phase factor multiplier for horizontal axis. Default value is 0.
  47351. </p>
  47352. </dd>
  47353. <dt><samp class="option">ky2</samp></dt>
  47354. <dd><p>Set 2-order, phase factor multiplier for vertical axis. Default value is 0.
  47355. </p>
  47356. </dd>
  47357. <dt><samp class="option">kt2</samp></dt>
  47358. <dd><p>Set 2-order, phase factor multiplier for time axis. Default value is 0.
  47359. </p>
  47360. </dd>
  47361. <dt><samp class="option">ku</samp></dt>
  47362. <dd><p>Set the constant added to final phase to produce chroma-blue component of signal.
  47363. Default value is 0.
  47364. </p>
  47365. </dd>
  47366. <dt><samp class="option">kv</samp></dt>
  47367. <dd><p>Set the constant added to final phase to produce chroma-red component of signal.
  47368. Default value is 0.
  47369. </p></dd>
  47370. </dl>
  47371. <ul class="mini-toc">
  47372. <li><a href="#Commands-159" accesskey="1">Commands</a></li>
  47373. <li><a href="#Examples-172" accesskey="2">Examples</a></li>
  47374. </ul>
  47375. <div class="subsection-level-extent" id="Commands-159">
  47376. <h4 class="subsection"><span>35.14.1 Commands<a class="copiable-link" href="#Commands-159"> &para;</a></span></h4>
  47377. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  47378. </p>
  47379. </div>
  47380. <div class="subsection-level-extent" id="Examples-172">
  47381. <h4 class="subsection"><span>35.14.2 Examples<a class="copiable-link" href="#Examples-172"> &para;</a></span></h4>
  47382. <ul class="itemize mark-bullet">
  47383. <li>Generate horizontal color sine sweep:
  47384. <div class="example">
  47385. <pre class="example-preformatted">zoneplate=ku=512:kv=0:kt2=0:kx2=256:s=wvga:xo=-426:kt=11
  47386. </pre></div>
  47387. </li><li>Generate vertical color sine sweep:
  47388. <div class="example">
  47389. <pre class="example-preformatted">zoneplate=ku=512:kv=0:kt2=0:ky2=156:s=wvga:yo=-240:kt=11
  47390. </pre></div>
  47391. </li><li>Generate circular zone-plate:
  47392. <div class="example">
  47393. <pre class="example-preformatted">zoneplate=ku=512:kv=100:kt2=0:ky2=256:kx2=556:s=wvga:yo=0:kt=11
  47394. </pre></div>
  47395. </li></ul>
  47396. </div>
  47397. </div>
  47398. </div>
  47399. <div class="chapter-level-extent" id="Video-Sinks">
  47400. <h2 class="chapter"><span>36 Video Sinks<a class="copiable-link" href="#Video-Sinks"> &para;</a></span></h2>
  47401. <p>Below is a description of the currently available video sinks.
  47402. </p>
  47403. <ul class="mini-toc">
  47404. <li><a href="#buffersink" accesskey="1">buffersink</a></li>
  47405. <li><a href="#nullsink" accesskey="2">nullsink</a></li>
  47406. </ul>
  47407. <div class="section-level-extent" id="buffersink">
  47408. <h3 class="section"><span>36.1 buffersink<a class="copiable-link" href="#buffersink"> &para;</a></span></h3>
  47409. <p>Buffer video frames, and make them available to the end of the filter
  47410. graph.
  47411. </p>
  47412. <p>This sink is mainly intended for programmatic use, in particular
  47413. through the interface defined in <samp class="file">libavfilter/buffersink.h</samp>
  47414. or the options system.
  47415. </p>
  47416. <p>It accepts a pointer to an AVBufferSinkContext structure, which
  47417. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  47418. parameter to <code class="code">avfilter_init_filter</code> for initialization.
  47419. </p>
  47420. </div>
  47421. <div class="section-level-extent" id="nullsink">
  47422. <h3 class="section"><span>36.2 nullsink<a class="copiable-link" href="#nullsink"> &para;</a></span></h3>
  47423. <p>Null video sink: do absolutely nothing with the input video. It is
  47424. mainly useful as a template and for use in analysis / debugging
  47425. tools.
  47426. </p>
  47427. </div>
  47428. </div>
  47429. <div class="chapter-level-extent" id="Multimedia-Filters">
  47430. <h2 class="chapter"><span>37 Multimedia Filters<a class="copiable-link" href="#Multimedia-Filters"> &para;</a></span></h2>
  47431. <p>Below is a description of the currently available multimedia filters.
  47432. </p>
  47433. <ul class="mini-toc">
  47434. <li><a href="#a3dscope" accesskey="1">a3dscope</a></li>
  47435. <li><a href="#abitscope" accesskey="2">abitscope</a></li>
  47436. <li><a href="#adrawgraph" accesskey="3">adrawgraph</a></li>
  47437. <li><a href="#agraphmonitor" accesskey="4">agraphmonitor</a></li>
  47438. <li><a href="#ahistogram" accesskey="5">ahistogram</a></li>
  47439. <li><a href="#aphasemeter" accesskey="6">aphasemeter</a></li>
  47440. <li><a href="#avectorscope" accesskey="7">avectorscope</a></li>
  47441. <li><a href="#bench_002c-abench" accesskey="8">bench, abench</a></li>
  47442. <li><a href="#concat-3" accesskey="9">concat</a></li>
  47443. <li><a href="#ebur128-1">ebur128</a></li>
  47444. <li><a href="#interleave_002c-ainterleave">interleave, ainterleave</a></li>
  47445. <li><a href="#latency_002c-alatency">latency, alatency</a></li>
  47446. <li><a href="#metadata_002c-ametadata">metadata, ametadata</a></li>
  47447. <li><a href="#perms_002c-aperms">perms, aperms</a></li>
  47448. <li><a href="#realtime_002c-arealtime">realtime, arealtime</a></li>
  47449. <li><a href="#segment_002c-asegment">segment, asegment</a></li>
  47450. <li><a href="#select_002c-aselect">select, aselect</a></li>
  47451. <li><a href="#sendcmd_002c-asendcmd">sendcmd, asendcmd</a></li>
  47452. <li><a href="#setpts_002c-asetpts">setpts, asetpts</a></li>
  47453. <li><a href="#setrange">setrange</a></li>
  47454. <li><a href="#settb_002c-asettb">settb, asettb</a></li>
  47455. <li><a href="#showcqt">showcqt</a></li>
  47456. <li><a href="#showcwt">showcwt</a></li>
  47457. <li><a href="#showfreqs">showfreqs</a></li>
  47458. <li><a href="#showspatial">showspatial</a></li>
  47459. <li><a href="#showspectrum-1">showspectrum</a></li>
  47460. <li><a href="#showspectrumpic">showspectrumpic</a></li>
  47461. <li><a href="#showvolume">showvolume</a></li>
  47462. <li><a href="#showwaves">showwaves</a></li>
  47463. <li><a href="#showwavespic">showwavespic</a></li>
  47464. <li><a href="#sidedata_002c-asidedata">sidedata, asidedata</a></li>
  47465. <li><a href="#spectrumsynth">spectrumsynth</a></li>
  47466. <li><a href="#split_002c-asplit">split, asplit</a></li>
  47467. <li><a href="#zmq_002c-azmq">zmq, azmq</a></li>
  47468. </ul>
  47469. <div class="section-level-extent" id="a3dscope">
  47470. <h3 class="section"><span>37.1 a3dscope<a class="copiable-link" href="#a3dscope"> &para;</a></span></h3>
  47471. <p>Convert input audio to 3d scope video output.
  47472. </p>
  47473. <p>The filter accepts the following options:
  47474. </p>
  47475. <dl class="table">
  47476. <dt><samp class="option">rate, r</samp></dt>
  47477. <dd><p>Set frame rate, expressed as number of frames per second. Default
  47478. value is &quot;25&quot;.
  47479. </p>
  47480. </dd>
  47481. <dt><samp class="option">size, s</samp></dt>
  47482. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  47483. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47484. Default value is <code class="code">hd720</code>.
  47485. </p>
  47486. </dd>
  47487. <dt><samp class="option">fov</samp></dt>
  47488. <dd><p>Set the camera field of view. Default is 90 degrees.
  47489. Allowed range is from 40 to 150.
  47490. </p>
  47491. </dd>
  47492. <dt><samp class="option">roll</samp></dt>
  47493. <dd><p>Set the camera roll.
  47494. </p>
  47495. </dd>
  47496. <dt><samp class="option">pitch</samp></dt>
  47497. <dd><p>Set the camera pitch.
  47498. </p>
  47499. </dd>
  47500. <dt><samp class="option">yaw</samp></dt>
  47501. <dd><p>Set the camera yaw.
  47502. </p>
  47503. </dd>
  47504. <dt><samp class="option">xzoom</samp></dt>
  47505. <dd><p>Set the camera zoom on X-axis.
  47506. </p>
  47507. </dd>
  47508. <dt><samp class="option">yzoom</samp></dt>
  47509. <dd><p>Set the camera zoom on Y-axis.
  47510. </p>
  47511. </dd>
  47512. <dt><samp class="option">zzoom</samp></dt>
  47513. <dd><p>Set the camera zoom on Z-axis.
  47514. </p>
  47515. </dd>
  47516. <dt><samp class="option">xpos</samp></dt>
  47517. <dd><p>Set the camera position on X-axis.
  47518. </p>
  47519. </dd>
  47520. <dt><samp class="option">ypos</samp></dt>
  47521. <dd><p>Set the camera position on Y-axis.
  47522. </p>
  47523. </dd>
  47524. <dt><samp class="option">zpos</samp></dt>
  47525. <dd><p>Set the camera position on Z-axis.
  47526. </p>
  47527. </dd>
  47528. <dt><samp class="option">length</samp></dt>
  47529. <dd><p>Set the length of displayed audio waves in number of frames.
  47530. </p></dd>
  47531. </dl>
  47532. <ul class="mini-toc">
  47533. <li><a href="#Commands-160" accesskey="1">Commands</a></li>
  47534. </ul>
  47535. <div class="subsection-level-extent" id="Commands-160">
  47536. <h4 class="subsection"><span>37.1.1 Commands<a class="copiable-link" href="#Commands-160"> &para;</a></span></h4>
  47537. <p>Filter supports the some above options as <a class="ref" href="#commands">commands</a>.
  47538. </p>
  47539. </div>
  47540. </div>
  47541. <div class="section-level-extent" id="abitscope">
  47542. <h3 class="section"><span>37.2 abitscope<a class="copiable-link" href="#abitscope"> &para;</a></span></h3>
  47543. <p>Convert input audio to a video output, displaying the audio bit scope.
  47544. </p>
  47545. <p>The filter accepts the following options:
  47546. </p>
  47547. <dl class="table">
  47548. <dt><samp class="option">rate, r</samp></dt>
  47549. <dd><p>Set frame rate, expressed as number of frames per second. Default
  47550. value is &quot;25&quot;.
  47551. </p>
  47552. </dd>
  47553. <dt><samp class="option">size, s</samp></dt>
  47554. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  47555. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47556. Default value is <code class="code">1024x256</code>.
  47557. </p>
  47558. </dd>
  47559. <dt><samp class="option">colors</samp></dt>
  47560. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  47561. draw channels. Unrecognized or missing colors will be replaced
  47562. by white color.
  47563. </p>
  47564. </dd>
  47565. <dt><samp class="option">mode, m</samp></dt>
  47566. <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>.
  47567. </p></dd>
  47568. </dl>
  47569. </div>
  47570. <div class="section-level-extent" id="adrawgraph">
  47571. <h3 class="section"><span>37.3 adrawgraph<a class="copiable-link" href="#adrawgraph"> &para;</a></span></h3>
  47572. <p>Draw a graph using input audio metadata.
  47573. </p>
  47574. <p>See <a class="ref" href="#drawgraph">drawgraph</a>
  47575. </p>
  47576. </div>
  47577. <div class="section-level-extent" id="agraphmonitor">
  47578. <h3 class="section"><span>37.4 agraphmonitor<a class="copiable-link" href="#agraphmonitor"> &para;</a></span></h3>
  47579. <p>See <a class="ref" href="#graphmonitor">graphmonitor</a>.
  47580. </p>
  47581. </div>
  47582. <div class="section-level-extent" id="ahistogram">
  47583. <h3 class="section"><span>37.5 ahistogram<a class="copiable-link" href="#ahistogram"> &para;</a></span></h3>
  47584. <p>Convert input audio to a video output, displaying the volume histogram.
  47585. </p>
  47586. <p>The filter accepts the following options:
  47587. </p>
  47588. <dl class="table">
  47589. <dt><samp class="option">dmode</samp></dt>
  47590. <dd><p>Specify how histogram is calculated.
  47591. </p>
  47592. <p>It accepts the following values:
  47593. </p><dl class="table">
  47594. <dt>&lsquo;<samp class="samp">single</samp>&rsquo;</dt>
  47595. <dd><p>Use single histogram for all channels.
  47596. </p></dd>
  47597. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  47598. <dd><p>Use separate histogram for each channel.
  47599. </p></dd>
  47600. </dl>
  47601. <p>Default is <code class="code">single</code>.
  47602. </p>
  47603. </dd>
  47604. <dt><samp class="option">rate, r</samp></dt>
  47605. <dd><p>Set frame rate, expressed as number of frames per second. Default
  47606. value is &quot;25&quot;.
  47607. </p>
  47608. </dd>
  47609. <dt><samp class="option">size, s</samp></dt>
  47610. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  47611. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47612. Default value is <code class="code">hd720</code>.
  47613. </p>
  47614. </dd>
  47615. <dt><samp class="option">scale</samp></dt>
  47616. <dd><p>Set display scale.
  47617. </p>
  47618. <p>It accepts the following values:
  47619. </p><dl class="table">
  47620. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  47621. <dd><p>logarithmic
  47622. </p></dd>
  47623. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  47624. <dd><p>square root
  47625. </p></dd>
  47626. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  47627. <dd><p>cubic root
  47628. </p></dd>
  47629. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  47630. <dd><p>linear
  47631. </p></dd>
  47632. <dt>&lsquo;<samp class="samp">rlog</samp>&rsquo;</dt>
  47633. <dd><p>reverse logarithmic
  47634. </p></dd>
  47635. </dl>
  47636. <p>Default is <code class="code">log</code>.
  47637. </p>
  47638. </dd>
  47639. <dt><samp class="option">ascale</samp></dt>
  47640. <dd><p>Set amplitude scale.
  47641. </p>
  47642. <p>It accepts the following values:
  47643. </p><dl class="table">
  47644. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  47645. <dd><p>logarithmic
  47646. </p></dd>
  47647. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  47648. <dd><p>linear
  47649. </p></dd>
  47650. </dl>
  47651. <p>Default is <code class="code">log</code>.
  47652. </p>
  47653. </dd>
  47654. <dt><samp class="option">acount</samp></dt>
  47655. <dd><p>Set how much frames to accumulate in histogram.
  47656. Default is 1. Setting this to -1 accumulates all frames.
  47657. </p>
  47658. </dd>
  47659. <dt><samp class="option">rheight</samp></dt>
  47660. <dd><p>Set histogram ratio of window height.
  47661. </p>
  47662. </dd>
  47663. <dt><samp class="option">slide</samp></dt>
  47664. <dd><p>Set sonogram sliding.
  47665. </p>
  47666. <p>It accepts the following values:
  47667. </p><dl class="table">
  47668. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  47669. <dd><p>replace old rows with new ones.
  47670. </p></dd>
  47671. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  47672. <dd><p>scroll from top to bottom.
  47673. </p></dd>
  47674. </dl>
  47675. <p>Default is <code class="code">replace</code>.
  47676. </p>
  47677. </dd>
  47678. <dt><samp class="option">hmode</samp></dt>
  47679. <dd><p>Set histogram mode.
  47680. </p>
  47681. <p>It accepts the following values:
  47682. </p><dl class="table">
  47683. <dt>&lsquo;<samp class="samp">abs</samp>&rsquo;</dt>
  47684. <dd><p>Use absolute values of samples.
  47685. </p></dd>
  47686. <dt>&lsquo;<samp class="samp">sign</samp>&rsquo;</dt>
  47687. <dd><p>Use untouched values of samples.
  47688. </p></dd>
  47689. </dl>
  47690. <p>Default is <code class="code">abs</code>.
  47691. </p></dd>
  47692. </dl>
  47693. </div>
  47694. <div class="section-level-extent" id="aphasemeter">
  47695. <h3 class="section"><span>37.6 aphasemeter<a class="copiable-link" href="#aphasemeter"> &para;</a></span></h3>
  47696. <p>Measures phase of input audio, which is exported as metadata <code class="code">lavfi.aphasemeter.phase</code>,
  47697. representing mean phase of current audio frame. A video output can also be produced and is
  47698. enabled by default. The audio is passed through as first output.
  47699. </p>
  47700. <p>Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in
  47701. range <code class="code">[-1, 1]</code> where <code class="code">-1</code> means left and right channels are completely out of phase
  47702. and <code class="code">1</code> means channels are in phase.
  47703. </p>
  47704. <p>The filter accepts the following options, all related to its video output:
  47705. </p>
  47706. <dl class="table">
  47707. <dt><samp class="option">rate, r</samp></dt>
  47708. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  47709. </p>
  47710. </dd>
  47711. <dt><samp class="option">size, s</samp></dt>
  47712. <dd><p>Set the video size for the output. For the syntax of this option, check the
  47713. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47714. Default value is <code class="code">800x400</code>.
  47715. </p>
  47716. </dd>
  47717. <dt><samp class="option">rc</samp></dt>
  47718. <dt><samp class="option">gc</samp></dt>
  47719. <dt><samp class="option">bc</samp></dt>
  47720. <dd><p>Specify the red, green, blue contrast. Default values are <code class="code">2</code>,
  47721. <code class="code">7</code> and <code class="code">1</code>.
  47722. Allowed range is <code class="code">[0, 255]</code>.
  47723. </p>
  47724. </dd>
  47725. <dt><samp class="option">mpc</samp></dt>
  47726. <dd><p>Set color which will be used for drawing median phase. If color is
  47727. <code class="code">none</code> which is default, no median phase value will be drawn.
  47728. </p>
  47729. </dd>
  47730. <dt><samp class="option">video</samp></dt>
  47731. <dd><p>Enable video output. Default is enabled.
  47732. </p></dd>
  47733. </dl>
  47734. <ul class="mini-toc">
  47735. <li><a href="#phasing-detection" accesskey="1">phasing detection</a></li>
  47736. <li><a href="#Examples-173" accesskey="2">Examples</a></li>
  47737. </ul>
  47738. <div class="subsection-level-extent" id="phasing-detection">
  47739. <h4 class="subsection"><span>37.6.1 phasing detection<a class="copiable-link" href="#phasing-detection"> &para;</a></span></h4>
  47740. <p>The filter also detects out of phase and mono sequences in stereo streams.
  47741. It logs the sequence start, end and duration when it lasts longer or as long as the minimum set.
  47742. </p>
  47743. <p>The filter accepts the following options for this detection:
  47744. </p>
  47745. <dl class="table">
  47746. <dt><samp class="option">phasing</samp></dt>
  47747. <dd><p>Enable mono and out of phase detection. Default is disabled.
  47748. </p>
  47749. </dd>
  47750. <dt><samp class="option">tolerance, t</samp></dt>
  47751. <dd><p>Set phase tolerance for mono detection, in amplitude ratio. Default is <code class="code">0</code>.
  47752. Allowed range is <code class="code">[0, 1]</code>.
  47753. </p>
  47754. </dd>
  47755. <dt><samp class="option">angle, a</samp></dt>
  47756. <dd><p>Set angle threshold for out of phase detection, in degree. Default is <code class="code">170</code>.
  47757. Allowed range is <code class="code">[90, 180]</code>.
  47758. </p>
  47759. </dd>
  47760. <dt><samp class="option">duration, d</samp></dt>
  47761. <dd><p>Set mono or out of phase duration until notification, expressed in seconds. Default is <code class="code">2</code>.
  47762. </p></dd>
  47763. </dl>
  47764. </div>
  47765. <div class="subsection-level-extent" id="Examples-173">
  47766. <h4 class="subsection"><span>37.6.2 Examples<a class="copiable-link" href="#Examples-173"> &para;</a></span></h4>
  47767. <ul class="itemize mark-bullet">
  47768. <li>Complete example with <code class="command">ffmpeg</code> to detect 1 second of mono with 0.001 phase tolerance:
  47769. <div class="example">
  47770. <pre class="example-preformatted">ffmpeg -i stereo.wav -af aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
  47771. </pre></div>
  47772. </li></ul>
  47773. </div>
  47774. </div>
  47775. <div class="section-level-extent" id="avectorscope">
  47776. <h3 class="section"><span>37.7 avectorscope<a class="copiable-link" href="#avectorscope"> &para;</a></span></h3>
  47777. <p>Convert input audio to a video output, representing the audio vector
  47778. scope.
  47779. </p>
  47780. <p>The filter is used to measure the difference between channels of stereo
  47781. audio stream. A monaural signal, consisting of identical left and right
  47782. signal, results in straight vertical line. Any stereo separation is visible
  47783. as a deviation from this line, creating a Lissajous figure.
  47784. If the straight (or deviation from it) but horizontal line appears this
  47785. indicates that the left and right channels are out of phase.
  47786. </p>
  47787. <p>The filter accepts the following options:
  47788. </p>
  47789. <dl class="table">
  47790. <dt><samp class="option">mode, m</samp></dt>
  47791. <dd><p>Set the vectorscope mode.
  47792. </p>
  47793. <p>Available values are:
  47794. </p><dl class="table">
  47795. <dt>&lsquo;<samp class="samp">lissajous</samp>&rsquo;</dt>
  47796. <dd><p>Lissajous rotated by 45 degrees.
  47797. </p>
  47798. </dd>
  47799. <dt>&lsquo;<samp class="samp">lissajous_xy</samp>&rsquo;</dt>
  47800. <dd><p>Same as above but not rotated.
  47801. </p>
  47802. </dd>
  47803. <dt>&lsquo;<samp class="samp">polar</samp>&rsquo;</dt>
  47804. <dd><p>Shape resembling half of circle.
  47805. </p></dd>
  47806. </dl>
  47807. <p>Default value is &lsquo;<samp class="samp">lissajous</samp>&rsquo;.
  47808. </p>
  47809. </dd>
  47810. <dt><samp class="option">size, s</samp></dt>
  47811. <dd><p>Set the video size for the output. For the syntax of this option, check the
  47812. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47813. Default value is <code class="code">400x400</code>.
  47814. </p>
  47815. </dd>
  47816. <dt><samp class="option">rate, r</samp></dt>
  47817. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  47818. </p>
  47819. </dd>
  47820. <dt><samp class="option">rc</samp></dt>
  47821. <dt><samp class="option">gc</samp></dt>
  47822. <dt><samp class="option">bc</samp></dt>
  47823. <dt><samp class="option">ac</samp></dt>
  47824. <dd><p>Specify the red, green, blue and alpha contrast. Default values are <code class="code">40</code>,
  47825. <code class="code">160</code>, <code class="code">80</code> and <code class="code">255</code>.
  47826. Allowed range is <code class="code">[0, 255]</code>.
  47827. </p>
  47828. </dd>
  47829. <dt><samp class="option">rf</samp></dt>
  47830. <dt><samp class="option">gf</samp></dt>
  47831. <dt><samp class="option">bf</samp></dt>
  47832. <dt><samp class="option">af</samp></dt>
  47833. <dd><p>Specify the red, green, blue and alpha fade. Default values are <code class="code">15</code>,
  47834. <code class="code">10</code>, <code class="code">5</code> and <code class="code">5</code>.
  47835. Allowed range is <code class="code">[0, 255]</code>.
  47836. </p>
  47837. </dd>
  47838. <dt><samp class="option">zoom</samp></dt>
  47839. <dd><p>Set the zoom factor. Default value is <code class="code">1</code>. Allowed range is <code class="code">[0, 10]</code>.
  47840. Values lower than <var class="var">1</var> will auto adjust zoom factor to maximal possible value.
  47841. </p>
  47842. </dd>
  47843. <dt><samp class="option">draw</samp></dt>
  47844. <dd><p>Set the vectorscope drawing mode.
  47845. </p>
  47846. <p>Available values are:
  47847. </p><dl class="table">
  47848. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  47849. <dd><p>Draw dot for each sample.
  47850. </p>
  47851. </dd>
  47852. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  47853. <dd><p>Draw line between previous and current sample.
  47854. </p>
  47855. </dd>
  47856. <dt>&lsquo;<samp class="samp">aaline</samp>&rsquo;</dt>
  47857. <dd><p>Draw anti-aliased line between previous and current sample.
  47858. </p></dd>
  47859. </dl>
  47860. <p>Default value is &lsquo;<samp class="samp">dot</samp>&rsquo;.
  47861. </p>
  47862. </dd>
  47863. <dt><samp class="option">scale</samp></dt>
  47864. <dd><p>Specify amplitude scale of audio samples.
  47865. </p>
  47866. <p>Available values are:
  47867. </p><dl class="table">
  47868. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  47869. <dd><p>Linear.
  47870. </p>
  47871. </dd>
  47872. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  47873. <dd><p>Square root.
  47874. </p>
  47875. </dd>
  47876. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  47877. <dd><p>Cubic root.
  47878. </p>
  47879. </dd>
  47880. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  47881. <dd><p>Logarithmic.
  47882. </p></dd>
  47883. </dl>
  47884. </dd>
  47885. <dt><samp class="option">swap</samp></dt>
  47886. <dd><p>Swap left channel axis with right channel axis.
  47887. </p>
  47888. </dd>
  47889. <dt><samp class="option">mirror</samp></dt>
  47890. <dd><p>Mirror axis.
  47891. </p>
  47892. <dl class="table">
  47893. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  47894. <dd><p>No mirror.
  47895. </p>
  47896. </dd>
  47897. <dt>&lsquo;<samp class="samp">x</samp>&rsquo;</dt>
  47898. <dd><p>Mirror only x axis.
  47899. </p>
  47900. </dd>
  47901. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  47902. <dd><p>Mirror only y axis.
  47903. </p>
  47904. </dd>
  47905. <dt>&lsquo;<samp class="samp">xy</samp>&rsquo;</dt>
  47906. <dd><p>Mirror both axis.
  47907. </p></dd>
  47908. </dl>
  47909. </dd>
  47910. </dl>
  47911. <ul class="mini-toc">
  47912. <li><a href="#Examples-174" accesskey="1">Examples</a></li>
  47913. <li><a href="#Commands-161" accesskey="2">Commands</a></li>
  47914. </ul>
  47915. <div class="subsection-level-extent" id="Examples-174">
  47916. <h4 class="subsection"><span>37.7.1 Examples<a class="copiable-link" href="#Examples-174"> &para;</a></span></h4>
  47917. <ul class="itemize mark-bullet">
  47918. <li>Complete example using <code class="command">ffplay</code>:
  47919. <div class="example">
  47920. <pre class="example-preformatted">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  47921. [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
  47922. </pre></div>
  47923. </li></ul>
  47924. </div>
  47925. <div class="subsection-level-extent" id="Commands-161">
  47926. <h4 class="subsection"><span>37.7.2 Commands<a class="copiable-link" href="#Commands-161"> &para;</a></span></h4>
  47927. <p>This filter supports the all above options as commands except options <code class="code">size</code> and <code class="code">rate</code>.
  47928. </p>
  47929. </div>
  47930. </div>
  47931. <div class="section-level-extent" id="bench_002c-abench">
  47932. <h3 class="section"><span>37.8 bench, abench<a class="copiable-link" href="#bench_002c-abench"> &para;</a></span></h3>
  47933. <p>Benchmark part of a filtergraph.
  47934. </p>
  47935. <p>The filter accepts the following options:
  47936. </p>
  47937. <dl class="table">
  47938. <dt><samp class="option">action</samp></dt>
  47939. <dd><p>Start or stop a timer.
  47940. </p>
  47941. <p>Available values are:
  47942. </p><dl class="table">
  47943. <dt>&lsquo;<samp class="samp">start</samp>&rsquo;</dt>
  47944. <dd><p>Get the current time, set it as frame metadata (using the key
  47945. <code class="code">lavfi.bench.start_time</code>), and forward the frame to the next filter.
  47946. </p>
  47947. </dd>
  47948. <dt>&lsquo;<samp class="samp">stop</samp>&rsquo;</dt>
  47949. <dd><p>Get the current time and fetch the <code class="code">lavfi.bench.start_time</code> metadata from
  47950. the input frame metadata to get the time difference. Time difference, average,
  47951. maximum and minimum time (respectively <code class="code">t</code>, <code class="code">avg</code>, <code class="code">max</code> and
  47952. <code class="code">min</code>) are then printed. The timestamps are expressed in seconds.
  47953. </p></dd>
  47954. </dl>
  47955. </dd>
  47956. </dl>
  47957. <ul class="mini-toc">
  47958. <li><a href="#Examples-175" accesskey="1">Examples</a></li>
  47959. </ul>
  47960. <div class="subsection-level-extent" id="Examples-175">
  47961. <h4 class="subsection"><span>37.8.1 Examples<a class="copiable-link" href="#Examples-175"> &para;</a></span></h4>
  47962. <ul class="itemize mark-bullet">
  47963. <li>Benchmark <a class="ref" href="#selectivecolor">selectivecolor</a> filter:
  47964. <div class="example">
  47965. <pre class="example-preformatted">bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
  47966. </pre></div>
  47967. </li></ul>
  47968. </div>
  47969. </div>
  47970. <div class="section-level-extent" id="concat-3">
  47971. <h3 class="section"><span>37.9 concat<a class="copiable-link" href="#concat-3"> &para;</a></span></h3>
  47972. <p>Concatenate audio and video streams, joining them together one after the
  47973. other.
  47974. </p>
  47975. <p>The filter works on segments of synchronized video and audio streams. All
  47976. segments must have the same number of streams of each type, and that will
  47977. also be the number of streams at output.
  47978. </p>
  47979. <p>The filter accepts the following options:
  47980. </p>
  47981. <dl class="table">
  47982. <dt><samp class="option">n</samp></dt>
  47983. <dd><p>Set the number of segments. Default is 2.
  47984. </p>
  47985. </dd>
  47986. <dt><samp class="option">v</samp></dt>
  47987. <dd><p>Set the number of output video streams, that is also the number of video
  47988. streams in each segment. Default is 1.
  47989. </p>
  47990. </dd>
  47991. <dt><samp class="option">a</samp></dt>
  47992. <dd><p>Set the number of output audio streams, that is also the number of audio
  47993. streams in each segment. Default is 0.
  47994. </p>
  47995. </dd>
  47996. <dt><samp class="option">unsafe</samp></dt>
  47997. <dd><p>Activate unsafe mode: do not fail if segments have a different format.
  47998. </p>
  47999. </dd>
  48000. </dl>
  48001. <p>The filter has <var class="var">v</var>+<var class="var">a</var> outputs: first <var class="var">v</var> video outputs, then
  48002. <var class="var">a</var> audio outputs.
  48003. </p>
  48004. <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
  48005. segment, in the same order as the outputs, then the inputs for the second
  48006. segment, etc.
  48007. </p>
  48008. <p>Related streams do not always have exactly the same duration, for various
  48009. reasons including codec frame size or sloppy authoring. For that reason,
  48010. related synchronized streams (e.g. a video and its audio track) should be
  48011. concatenated at once. The concat filter will use the duration of the longest
  48012. stream in each segment (except the last one), and if necessary pad shorter
  48013. audio streams with silence.
  48014. </p>
  48015. <p>For this filter to work correctly, all segments must start at timestamp 0.
  48016. </p>
  48017. <p>All corresponding streams must have the same parameters in all segments; the
  48018. filtering system will automatically select a common pixel format for video
  48019. streams, and a common sample format, sample rate and channel layout for
  48020. audio streams, but other settings, such as resolution, must be converted
  48021. explicitly by the user.
  48022. </p>
  48023. <p>Different frame rates are acceptable but will result in variable frame rate
  48024. at output; be sure to configure the output file to handle it.
  48025. </p>
  48026. <ul class="mini-toc">
  48027. <li><a href="#Examples-176" accesskey="1">Examples</a></li>
  48028. <li><a href="#Commands-162" accesskey="2">Commands</a></li>
  48029. </ul>
  48030. <div class="subsection-level-extent" id="Examples-176">
  48031. <h4 class="subsection"><span>37.9.1 Examples<a class="copiable-link" href="#Examples-176"> &para;</a></span></h4>
  48032. <ul class="itemize mark-bullet">
  48033. <li>Concatenate an opening, an episode and an ending, all in bilingual version
  48034. (video in stream 0, audio in streams 1 and 2):
  48035. <div class="example">
  48036. <pre class="example-preformatted">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
  48037. '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
  48038. concat=n=3:v=1:a=2 [v] [a1] [a2]' \
  48039. -map '[v]' -map '[a1]' -map '[a2]' output.mkv
  48040. </pre></div>
  48041. </li><li>Concatenate two parts, handling audio and video separately, using the
  48042. (a)movie sources, and adjusting the resolution:
  48043. <div class="example">
  48044. <pre class="example-preformatted">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
  48045. movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
  48046. [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
  48047. </pre></div>
  48048. <p>Note that a desync will happen at the stitch if the audio and video streams
  48049. do not have exactly the same duration in the first file.
  48050. </p>
  48051. </li></ul>
  48052. </div>
  48053. <div class="subsection-level-extent" id="Commands-162">
  48054. <h4 class="subsection"><span>37.9.2 Commands<a class="copiable-link" href="#Commands-162"> &para;</a></span></h4>
  48055. <p>This filter supports the following commands:
  48056. </p><dl class="table">
  48057. <dt><samp class="option">next</samp></dt>
  48058. <dd><p>Close the current segment and step to the next one
  48059. </p></dd>
  48060. </dl>
  48061. <a class="anchor" id="ebur128"></a></div>
  48062. </div>
  48063. <div class="section-level-extent" id="ebur128-1">
  48064. <h3 class="section"><span>37.10 ebur128<a class="copiable-link" href="#ebur128-1"> &para;</a></span></h3>
  48065. <p>EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness
  48066. level. By default, it logs a message at a frequency of 10Hz with the
  48067. Momentary loudness (identified by <code class="code">M</code>), Short-term loudness (<code class="code">S</code>),
  48068. Integrated loudness (<code class="code">I</code>) and Loudness Range (<code class="code">LRA</code>).
  48069. </p>
  48070. <p>The filter can only analyze streams which have
  48071. sample format is double-precision floating point. The input stream will be converted to
  48072. this specification, if needed. Users may need to insert aformat and/or aresample filters
  48073. after this filter to obtain the original parameters.
  48074. </p>
  48075. <p>The filter also has a video output (see the <var class="var">video</var> option) with a real
  48076. time graph to observe the loudness evolution. The graphic contains the logged
  48077. message mentioned above, so it is not printed anymore when this option is set,
  48078. unless the verbose logging is set. The main graphing area contains the
  48079. short-term loudness (3 seconds of analysis), and the gauge on the right is for
  48080. the momentary loudness (400 milliseconds), but can optionally be configured
  48081. to instead display short-term loudness (see <var class="var">gauge</var>).
  48082. </p>
  48083. <p>The green area marks a +/- 1LU target range around the target loudness
  48084. (-23LUFS by default, unless modified through <var class="var">target</var>).
  48085. </p>
  48086. <p>More information about the Loudness Recommendation EBU R128 on
  48087. <a class="url" href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
  48088. </p>
  48089. <p>The filter accepts the following options:
  48090. </p>
  48091. <dl class="table">
  48092. <dt><samp class="option">video</samp></dt>
  48093. <dd><p>Activate the video output. The audio stream is passed unchanged whether this
  48094. option is set or no. The video stream will be the first output stream if
  48095. activated. Default is <code class="code">0</code>.
  48096. </p>
  48097. </dd>
  48098. <dt><samp class="option">size</samp></dt>
  48099. <dd><p>Set the video size. This option is for video only. For the syntax of this
  48100. option, check the
  48101. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  48102. Default and minimum resolution is <code class="code">640x480</code>.
  48103. </p>
  48104. </dd>
  48105. <dt><samp class="option">meter</samp></dt>
  48106. <dd><p>Set the EBU scale meter. Default is <code class="code">9</code>. Common values are <code class="code">9</code> and
  48107. <code class="code">18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
  48108. other integer value between this range is allowed.
  48109. </p>
  48110. </dd>
  48111. <dt><samp class="option">metadata</samp></dt>
  48112. <dd><p>Set metadata injection. If set to <code class="code">1</code>, the audio input will be segmented
  48113. into 100ms output frames, each of them containing various loudness information
  48114. in metadata. All the metadata keys are prefixed with <code class="code">lavfi.r128.</code>.
  48115. </p>
  48116. <p>Default is <code class="code">0</code>.
  48117. </p>
  48118. </dd>
  48119. <dt><samp class="option">framelog</samp></dt>
  48120. <dd><p>Force the frame logging level.
  48121. </p>
  48122. <p>Available values are:
  48123. </p><dl class="table">
  48124. <dt>&lsquo;<samp class="samp">quiet</samp>&rsquo;</dt>
  48125. <dd><p>logging disabled
  48126. </p></dd>
  48127. <dt>&lsquo;<samp class="samp">info</samp>&rsquo;</dt>
  48128. <dd><p>information logging level
  48129. </p></dd>
  48130. <dt>&lsquo;<samp class="samp">verbose</samp>&rsquo;</dt>
  48131. <dd><p>verbose logging level
  48132. </p></dd>
  48133. </dl>
  48134. <p>By default, the logging level is set to <var class="var">info</var>. If the <samp class="option">video</samp> or
  48135. the <samp class="option">metadata</samp> options are set, it switches to <var class="var">verbose</var>.
  48136. </p>
  48137. </dd>
  48138. <dt><samp class="option">peak</samp></dt>
  48139. <dd><p>Set peak mode(s).
  48140. </p>
  48141. <p>Available modes can be cumulated (the option is a <code class="code">flag</code> type). Possible
  48142. values are:
  48143. </p><dl class="table">
  48144. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  48145. <dd><p>Disable any peak mode (default).
  48146. </p></dd>
  48147. <dt>&lsquo;<samp class="samp">sample</samp>&rsquo;</dt>
  48148. <dd><p>Enable sample-peak mode.
  48149. </p>
  48150. <p>Simple peak mode looking for the higher sample value. It logs a message
  48151. for sample-peak (identified by <code class="code">SPK</code>).
  48152. </p></dd>
  48153. <dt>&lsquo;<samp class="samp">true</samp>&rsquo;</dt>
  48154. <dd><p>Enable true-peak mode.
  48155. </p>
  48156. <p>If enabled, the peak lookup is done on an over-sampled version of the input
  48157. stream for better peak accuracy. It logs a message for true-peak.
  48158. (identified by <code class="code">TPK</code>) and true-peak per frame (identified by <code class="code">FTPK</code>).
  48159. This mode requires a build with <code class="code">libswresample</code>.
  48160. </p></dd>
  48161. </dl>
  48162. </dd>
  48163. <dt><samp class="option">dualmono</samp></dt>
  48164. <dd><p>Treat mono input files as &quot;dual mono&quot;. If a mono file is intended for playback
  48165. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  48166. If set to <code class="code">true</code>, this option will compensate for this effect.
  48167. Multi-channel input files are not affected by this option.
  48168. </p>
  48169. </dd>
  48170. <dt><samp class="option">panlaw</samp></dt>
  48171. <dd><p>Set a specific pan law to be used for the measurement of dual mono files.
  48172. This parameter is optional, and has a default value of -3.01dB.
  48173. </p>
  48174. </dd>
  48175. <dt><samp class="option">target</samp></dt>
  48176. <dd><p>Set a specific target level (in LUFS) used as relative zero in the visualization.
  48177. This parameter is optional and has a default value of -23LUFS as specified
  48178. by EBU R128. However, material published online may prefer a level of -16LUFS
  48179. (e.g. for use with podcasts or video platforms).
  48180. </p>
  48181. </dd>
  48182. <dt><samp class="option">gauge</samp></dt>
  48183. <dd><p>Set the value displayed by the gauge. Valid values are <code class="code">momentary</code> and s
  48184. <code class="code">shortterm</code>. By default the momentary value will be used, but in certain
  48185. scenarios it may be more useful to observe the short term value instead (e.g.
  48186. live mixing).
  48187. </p>
  48188. </dd>
  48189. <dt><samp class="option">scale</samp></dt>
  48190. <dd><p>Sets the display scale for the loudness. Valid parameters are <code class="code">absolute</code>
  48191. (in LUFS) or <code class="code">relative</code> (LU) relative to the target. This only affects the
  48192. video output, not the summary or continuous log output.
  48193. </p>
  48194. </dd>
  48195. <dt><samp class="option">integrated</samp></dt>
  48196. <dd><p>Read-only exported value for measured integrated loudness, in LUFS.
  48197. </p>
  48198. </dd>
  48199. <dt><samp class="option">range</samp></dt>
  48200. <dd><p>Read-only exported value for measured loudness range, in LU.
  48201. </p>
  48202. </dd>
  48203. <dt><samp class="option">lra_low</samp></dt>
  48204. <dd><p>Read-only exported value for measured LRA low, in LUFS.
  48205. </p>
  48206. </dd>
  48207. <dt><samp class="option">lra_high</samp></dt>
  48208. <dd><p>Read-only exported value for measured LRA high, in LUFS.
  48209. </p>
  48210. </dd>
  48211. <dt><samp class="option">sample_peak</samp></dt>
  48212. <dd><p>Read-only exported value for measured sample peak, in dBFS.
  48213. </p>
  48214. </dd>
  48215. <dt><samp class="option">true_peak</samp></dt>
  48216. <dd><p>Read-only exported value for measured true peak, in dBFS.
  48217. </p></dd>
  48218. </dl>
  48219. <ul class="mini-toc">
  48220. <li><a href="#Examples-177" accesskey="1">Examples</a></li>
  48221. </ul>
  48222. <div class="subsection-level-extent" id="Examples-177">
  48223. <h4 class="subsection"><span>37.10.1 Examples<a class="copiable-link" href="#Examples-177"> &para;</a></span></h4>
  48224. <ul class="itemize mark-bullet">
  48225. <li>Real-time graph using <code class="command">ffplay</code>, with a EBU scale meter +18:
  48226. <div class="example">
  48227. <pre class="example-preformatted">ffplay -f lavfi -i &quot;amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]&quot;
  48228. </pre></div>
  48229. </li><li>Run an analysis with <code class="command">ffmpeg</code>:
  48230. <div class="example">
  48231. <pre class="example-preformatted">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
  48232. </pre></div>
  48233. </li></ul>
  48234. </div>
  48235. </div>
  48236. <div class="section-level-extent" id="interleave_002c-ainterleave">
  48237. <h3 class="section"><span>37.11 interleave, ainterleave<a class="copiable-link" href="#interleave_002c-ainterleave"> &para;</a></span></h3>
  48238. <p>Temporally interleave frames from several inputs.
  48239. </p>
  48240. <p><code class="code">interleave</code> works with video inputs, <code class="code">ainterleave</code> with audio.
  48241. </p>
  48242. <p>These filters read frames from several inputs and send the oldest
  48243. queued frame to the output.
  48244. </p>
  48245. <p>Input streams must have well defined, monotonically increasing frame
  48246. timestamp values.
  48247. </p>
  48248. <p>In order to submit one frame to output, these filters need to enqueue
  48249. at least one frame for each input, so they cannot work in case one
  48250. input is not yet terminated and will not receive incoming frames.
  48251. </p>
  48252. <p>For example consider the case when one input is a <code class="code">select</code> filter
  48253. which always drops input frames. The <code class="code">interleave</code> filter will keep
  48254. reading from that input, but it will never be able to send new frames
  48255. to output until the input sends an end-of-stream signal.
  48256. </p>
  48257. <p>Also, depending on inputs synchronization, the filters will drop
  48258. frames in case one input receives more frames than the other ones, and
  48259. the queue is already filled.
  48260. </p>
  48261. <p>These filters accept the following options:
  48262. </p>
  48263. <dl class="table">
  48264. <dt><samp class="option">nb_inputs, n</samp></dt>
  48265. <dd><p>Set the number of different inputs, it is 2 by default.
  48266. </p>
  48267. </dd>
  48268. <dt><samp class="option">duration</samp></dt>
  48269. <dd><p>How to determine the end-of-stream.
  48270. </p>
  48271. <dl class="table">
  48272. <dt><samp class="option">longest</samp></dt>
  48273. <dd><p>The duration of the longest input. (default)
  48274. </p>
  48275. </dd>
  48276. <dt><samp class="option">shortest</samp></dt>
  48277. <dd><p>The duration of the shortest input.
  48278. </p>
  48279. </dd>
  48280. <dt><samp class="option">first</samp></dt>
  48281. <dd><p>The duration of the first input.
  48282. </p></dd>
  48283. </dl>
  48284. </dd>
  48285. </dl>
  48286. <ul class="mini-toc">
  48287. <li><a href="#Examples-178" accesskey="1">Examples</a></li>
  48288. </ul>
  48289. <div class="subsection-level-extent" id="Examples-178">
  48290. <h4 class="subsection"><span>37.11.1 Examples<a class="copiable-link" href="#Examples-178"> &para;</a></span></h4>
  48291. <ul class="itemize mark-bullet">
  48292. <li>Interleave frames belonging to different streams using <code class="command">ffmpeg</code>:
  48293. <div class="example">
  48294. <pre class="example-preformatted">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex &quot;[0:v][1:v] interleave&quot; out.avi
  48295. </pre></div>
  48296. </li><li>Add flickering blur effect:
  48297. <div class="example">
  48298. <pre class="example-preformatted">select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
  48299. </pre></div>
  48300. </li></ul>
  48301. </div>
  48302. </div>
  48303. <div class="section-level-extent" id="latency_002c-alatency">
  48304. <h3 class="section"><span>37.12 latency, alatency<a class="copiable-link" href="#latency_002c-alatency"> &para;</a></span></h3>
  48305. <p>Measure filtering latency.
  48306. </p>
  48307. <p>Report previous filter filtering latency, delay in number of audio samples for audio filters
  48308. or number of video frames for video filters.
  48309. </p>
  48310. <p>On end of input stream, filter will report min and max measured latency for previous running filter
  48311. in filtergraph.
  48312. </p>
  48313. </div>
  48314. <div class="section-level-extent" id="metadata_002c-ametadata">
  48315. <h3 class="section"><span>37.13 metadata, ametadata<a class="copiable-link" href="#metadata_002c-ametadata"> &para;</a></span></h3>
  48316. <p>Manipulate frame metadata.
  48317. </p>
  48318. <p>This filter accepts the following options:
  48319. </p>
  48320. <dl class="table">
  48321. <dt><samp class="option">mode</samp></dt>
  48322. <dd><p>Set mode of operation of the filter.
  48323. </p>
  48324. <p>Can be one of the following:
  48325. </p>
  48326. <dl class="table">
  48327. <dt>&lsquo;<samp class="samp">select</samp>&rsquo;</dt>
  48328. <dd><p>If both <code class="code">value</code> and <code class="code">key</code> is set, select frames
  48329. which have such metadata. If only <code class="code">key</code> is set, select
  48330. every frame that has such key in metadata.
  48331. </p>
  48332. </dd>
  48333. <dt>&lsquo;<samp class="samp">add</samp>&rsquo;</dt>
  48334. <dd><p>Add new metadata <code class="code">key</code> and <code class="code">value</code>. If key is already available
  48335. do nothing.
  48336. </p>
  48337. </dd>
  48338. <dt>&lsquo;<samp class="samp">modify</samp>&rsquo;</dt>
  48339. <dd><p>Modify value of already present key.
  48340. </p>
  48341. </dd>
  48342. <dt>&lsquo;<samp class="samp">delete</samp>&rsquo;</dt>
  48343. <dd><p>If <code class="code">value</code> is set, delete only keys that have such value.
  48344. Otherwise, delete key. If <code class="code">key</code> is not set, delete all metadata values in
  48345. the frame.
  48346. </p>
  48347. </dd>
  48348. <dt>&lsquo;<samp class="samp">print</samp>&rsquo;</dt>
  48349. <dd><p>Print key and its value if metadata was found. If <code class="code">key</code> is not set print all
  48350. metadata values available in frame.
  48351. </p></dd>
  48352. </dl>
  48353. </dd>
  48354. <dt><samp class="option">key</samp></dt>
  48355. <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>.
  48356. </p>
  48357. </dd>
  48358. <dt><samp class="option">value</samp></dt>
  48359. <dd><p>Set metadata value which will be used. This option is mandatory for
  48360. <code class="code">modify</code> and <code class="code">add</code> mode.
  48361. </p>
  48362. </dd>
  48363. <dt><samp class="option">function</samp></dt>
  48364. <dd><p>Which function to use when comparing metadata value and <code class="code">value</code>.
  48365. </p>
  48366. <p>Can be one of following:
  48367. </p>
  48368. <dl class="table">
  48369. <dt>&lsquo;<samp class="samp">same_str</samp>&rsquo;</dt>
  48370. <dd><p>Values are interpreted as strings, returns true if metadata value is same as <code class="code">value</code>.
  48371. </p>
  48372. </dd>
  48373. <dt>&lsquo;<samp class="samp">starts_with</samp>&rsquo;</dt>
  48374. <dd><p>Values are interpreted as strings, returns true if metadata value starts with
  48375. the <code class="code">value</code> option string.
  48376. </p>
  48377. </dd>
  48378. <dt>&lsquo;<samp class="samp">less</samp>&rsquo;</dt>
  48379. <dd><p>Values are interpreted as floats, returns true if metadata value is less than <code class="code">value</code>.
  48380. </p>
  48381. </dd>
  48382. <dt>&lsquo;<samp class="samp">equal</samp>&rsquo;</dt>
  48383. <dd><p>Values are interpreted as floats, returns true if <code class="code">value</code> is equal with metadata value.
  48384. </p>
  48385. </dd>
  48386. <dt>&lsquo;<samp class="samp">greater</samp>&rsquo;</dt>
  48387. <dd><p>Values are interpreted as floats, returns true if metadata value is greater than <code class="code">value</code>.
  48388. </p>
  48389. </dd>
  48390. <dt>&lsquo;<samp class="samp">expr</samp>&rsquo;</dt>
  48391. <dd><p>Values are interpreted as floats, returns true if expression from option <code class="code">expr</code>
  48392. evaluates to true.
  48393. </p>
  48394. </dd>
  48395. <dt>&lsquo;<samp class="samp">ends_with</samp>&rsquo;</dt>
  48396. <dd><p>Values are interpreted as strings, returns true if metadata value ends with
  48397. the <code class="code">value</code> option string.
  48398. </p></dd>
  48399. </dl>
  48400. </dd>
  48401. <dt><samp class="option">expr</samp></dt>
  48402. <dd><p>Set expression which is used when <code class="code">function</code> is set to <code class="code">expr</code>.
  48403. The expression is evaluated through the eval API and can contain the following
  48404. constants:
  48405. </p>
  48406. <dl class="table">
  48407. <dt><samp class="option">VALUE1, FRAMEVAL</samp></dt>
  48408. <dd><p>Float representation of <code class="code">value</code> from metadata key.
  48409. </p>
  48410. </dd>
  48411. <dt><samp class="option">VALUE2, USERVAL</samp></dt>
  48412. <dd><p>Float representation of <code class="code">value</code> as supplied by user in <code class="code">value</code> option.
  48413. </p></dd>
  48414. </dl>
  48415. </dd>
  48416. <dt><samp class="option">file</samp></dt>
  48417. <dd><p>If specified in <code class="code">print</code> mode, output is written to the named file. Instead of
  48418. plain filename any writable url can be specified. Filename &ldquo;-&rdquo; is a shorthand
  48419. for standard output. If <code class="code">file</code> option is not set, output is written to the log
  48420. with AV_LOG_INFO loglevel.
  48421. </p>
  48422. </dd>
  48423. <dt><samp class="option">direct</samp></dt>
  48424. <dd><p>Reduces buffering in print mode when output is written to a URL set using <var class="var">file</var>.
  48425. </p>
  48426. </dd>
  48427. </dl>
  48428. <ul class="mini-toc">
  48429. <li><a href="#Examples-179" accesskey="1">Examples</a></li>
  48430. </ul>
  48431. <div class="subsection-level-extent" id="Examples-179">
  48432. <h4 class="subsection"><span>37.13.1 Examples<a class="copiable-link" href="#Examples-179"> &para;</a></span></h4>
  48433. <ul class="itemize mark-bullet">
  48434. <li>Print all metadata values for frames with key <code class="code">lavfi.signalstats.YDIF</code> with values
  48435. between 0 and 1.
  48436. <div class="example">
  48437. <pre class="example-preformatted">signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
  48438. </pre></div>
  48439. </li><li>Print silencedetect output to file <samp class="file">metadata.txt</samp>.
  48440. <div class="example">
  48441. <pre class="example-preformatted">silencedetect,ametadata=mode=print:file=metadata.txt
  48442. </pre></div>
  48443. </li><li>Direct all metadata to a pipe with file descriptor 4.
  48444. <div class="example">
  48445. <pre class="example-preformatted">metadata=mode=print:file='pipe\:4'
  48446. </pre></div>
  48447. </li></ul>
  48448. </div>
  48449. </div>
  48450. <div class="section-level-extent" id="perms_002c-aperms">
  48451. <h3 class="section"><span>37.14 perms, aperms<a class="copiable-link" href="#perms_002c-aperms"> &para;</a></span></h3>
  48452. <p>Set read/write permissions for the output frames.
  48453. </p>
  48454. <p>These filters are mainly aimed at developers to test direct path in the
  48455. following filter in the filtergraph.
  48456. </p>
  48457. <p>The filters accept the following options:
  48458. </p>
  48459. <dl class="table">
  48460. <dt><samp class="option">mode</samp></dt>
  48461. <dd><p>Select the permissions mode.
  48462. </p>
  48463. <p>It accepts the following values:
  48464. </p><dl class="table">
  48465. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  48466. <dd><p>Do nothing. This is the default.
  48467. </p></dd>
  48468. <dt>&lsquo;<samp class="samp">ro</samp>&rsquo;</dt>
  48469. <dd><p>Set all the output frames read-only.
  48470. </p></dd>
  48471. <dt>&lsquo;<samp class="samp">rw</samp>&rsquo;</dt>
  48472. <dd><p>Set all the output frames directly writable.
  48473. </p></dd>
  48474. <dt>&lsquo;<samp class="samp">toggle</samp>&rsquo;</dt>
  48475. <dd><p>Make the frame read-only if writable, and writable if read-only.
  48476. </p></dd>
  48477. <dt>&lsquo;<samp class="samp">random</samp>&rsquo;</dt>
  48478. <dd><p>Set each output frame read-only or writable randomly.
  48479. </p></dd>
  48480. </dl>
  48481. </dd>
  48482. <dt><samp class="option">seed</samp></dt>
  48483. <dd><p>Set the seed for the <var class="var">random</var> mode, must be an integer included between
  48484. <code class="code">0</code> and <code class="code">UINT32_MAX</code>. If not specified, or if explicitly set to
  48485. <code class="code">-1</code>, the filter will try to use a good random seed on a best effort
  48486. basis.
  48487. </p></dd>
  48488. </dl>
  48489. <p>Note: in case of auto-inserted filter between the permission filter and the
  48490. following one, the permission might not be received as expected in that
  48491. following filter. Inserting a <a class="ref" href="#format">format</a> or <a class="ref" href="#aformat">aformat</a> filter before the
  48492. perms/aperms filter can avoid this problem.
  48493. </p>
  48494. </div>
  48495. <div class="section-level-extent" id="realtime_002c-arealtime">
  48496. <h3 class="section"><span>37.15 realtime, arealtime<a class="copiable-link" href="#realtime_002c-arealtime"> &para;</a></span></h3>
  48497. <p>Slow down filtering to match real time approximately.
  48498. </p>
  48499. <p>These filters will pause the filtering for a variable amount of time to
  48500. match the output rate with the input timestamps.
  48501. They are similar to the <samp class="option">re</samp> option to <code class="code">ffmpeg</code>.
  48502. </p>
  48503. <p>They accept the following options:
  48504. </p>
  48505. <dl class="table">
  48506. <dt><samp class="option">limit</samp></dt>
  48507. <dd><p>Time limit for the pauses. Any pause longer than that will be considered
  48508. a timestamp discontinuity and reset the timer. Default is 2 seconds.
  48509. </p></dd>
  48510. <dt><samp class="option">speed</samp></dt>
  48511. <dd><p>Speed factor for processing. The value must be a float larger than zero.
  48512. Values larger than 1.0 will result in faster than realtime processing,
  48513. smaller will slow processing down. The <var class="var">limit</var> is automatically adapted
  48514. accordingly. Default is 1.0.
  48515. </p>
  48516. <p>A processing speed faster than what is possible without these filters cannot
  48517. be achieved.
  48518. </p></dd>
  48519. </dl>
  48520. <ul class="mini-toc">
  48521. <li><a href="#Commands-163" accesskey="1">Commands</a></li>
  48522. </ul>
  48523. <div class="subsection-level-extent" id="Commands-163">
  48524. <h4 class="subsection"><span>37.15.1 Commands<a class="copiable-link" href="#Commands-163"> &para;</a></span></h4>
  48525. <p>Both filters supports the all above options as <a class="ref" href="#commands">commands</a>.
  48526. </p>
  48527. </div>
  48528. </div>
  48529. <div class="section-level-extent" id="segment_002c-asegment">
  48530. <h3 class="section"><span>37.16 segment, asegment<a class="copiable-link" href="#segment_002c-asegment"> &para;</a></span></h3>
  48531. <p>Split single input stream into multiple streams.
  48532. </p>
  48533. <p>This filter does opposite of concat filters.
  48534. </p>
  48535. <p><code class="code">segment</code> works on video frames, <code class="code">asegment</code> on audio samples.
  48536. </p>
  48537. <p>This filter accepts the following options:
  48538. </p>
  48539. <dl class="table">
  48540. <dt><samp class="option">timestamps</samp></dt>
  48541. <dd><p>Timestamps of output segments separated by &rsquo;|&rsquo;. The first segment will run
  48542. from the beginning of the input stream. The last segment will run until
  48543. the end of the input stream
  48544. </p>
  48545. </dd>
  48546. <dt><samp class="option">frames, samples</samp></dt>
  48547. <dd><p>Exact frame/sample count to split the segments.
  48548. </p></dd>
  48549. </dl>
  48550. <p>In all cases, prefixing an each segment with &rsquo;+&rsquo; will make it relative to the
  48551. previous segment.
  48552. </p>
  48553. <ul class="mini-toc">
  48554. <li><a href="#Examples-180" accesskey="1">Examples</a></li>
  48555. </ul>
  48556. <div class="subsection-level-extent" id="Examples-180">
  48557. <h4 class="subsection"><span>37.16.1 Examples<a class="copiable-link" href="#Examples-180"> &para;</a></span></h4>
  48558. <ul class="itemize mark-bullet">
  48559. <li>Split input audio stream into three output audio streams, starting at start of input audio stream
  48560. and storing that in 1st output audio stream, then following at 60th second and storing than in 2nd
  48561. output audio stream, and last after 150th second of input audio stream store in 3rd output audio stream:
  48562. <div class="example">
  48563. <pre class="example-preformatted">asegment=timestamps=&quot;60|150&quot;
  48564. </pre></div>
  48565. </li></ul>
  48566. <a class="anchor" id="select"></a></div>
  48567. </div>
  48568. <div class="section-level-extent" id="select_002c-aselect">
  48569. <h3 class="section"><span>37.17 select, aselect<a class="copiable-link" href="#select_002c-aselect"> &para;</a></span></h3>
  48570. <p>Select frames to pass in output.
  48571. </p>
  48572. <p>This filter accepts the following options:
  48573. </p>
  48574. <dl class="table">
  48575. <dt><samp class="option">expr, e</samp></dt>
  48576. <dd><p>Set expression, which is evaluated for each input frame.
  48577. </p>
  48578. <p>If the expression is evaluated to zero, the frame is discarded.
  48579. </p>
  48580. <p>If the evaluation result is negative or NaN, the frame is sent to the
  48581. first output; otherwise it is sent to the output with index
  48582. <code class="code">ceil(val)-1</code>, assuming that the input index starts from 0.
  48583. </p>
  48584. <p>For example a value of <code class="code">1.2</code> corresponds to the output with index
  48585. <code class="code">ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
  48586. </p>
  48587. </dd>
  48588. <dt><samp class="option">outputs, n</samp></dt>
  48589. <dd><p>Set the number of outputs. The output to which to send the selected
  48590. frame is based on the result of the evaluation. Default value is 1.
  48591. </p></dd>
  48592. </dl>
  48593. <p>The expression can contain the following constants:
  48594. </p>
  48595. <dl class="table">
  48596. <dt><samp class="option">n</samp></dt>
  48597. <dd><p>The (sequential) number of the filtered frame, starting from 0.
  48598. </p>
  48599. </dd>
  48600. <dt><samp class="option">selected_n</samp></dt>
  48601. <dd><p>The (sequential) number of the selected frame, starting from 0.
  48602. </p>
  48603. </dd>
  48604. <dt><samp class="option">prev_selected_n</samp></dt>
  48605. <dd><p>The sequential number of the last selected frame. It&rsquo;s NAN if undefined.
  48606. </p>
  48607. </dd>
  48608. <dt><samp class="option">TB</samp></dt>
  48609. <dd><p>The timebase of the input timestamps.
  48610. </p>
  48611. </dd>
  48612. <dt><samp class="option">pts</samp></dt>
  48613. <dd><p>The PTS (Presentation TimeStamp) of the filtered frame,
  48614. expressed in <var class="var">TB</var> units. It&rsquo;s NAN if undefined.
  48615. </p>
  48616. </dd>
  48617. <dt><samp class="option">t</samp></dt>
  48618. <dd><p>The PTS of the filtered frame,
  48619. expressed in seconds. It&rsquo;s NAN if undefined.
  48620. </p>
  48621. </dd>
  48622. <dt><samp class="option">prev_pts</samp></dt>
  48623. <dd><p>The PTS of the previously filtered frame. It&rsquo;s NAN if undefined.
  48624. </p>
  48625. </dd>
  48626. <dt><samp class="option">prev_selected_pts</samp></dt>
  48627. <dd><p>The PTS of the last previously filtered frame. It&rsquo;s NAN if undefined.
  48628. </p>
  48629. </dd>
  48630. <dt><samp class="option">prev_selected_t</samp></dt>
  48631. <dd><p>The PTS of the last previously selected frame, expressed in seconds. It&rsquo;s NAN if undefined.
  48632. </p>
  48633. </dd>
  48634. <dt><samp class="option">start_pts</samp></dt>
  48635. <dd><p>The first PTS in the stream which is not NAN. It remains NAN if not found.
  48636. </p>
  48637. </dd>
  48638. <dt><samp class="option">start_t</samp></dt>
  48639. <dd><p>The first PTS, in seconds, in the stream which is not NAN. It remains NAN if not found.
  48640. </p>
  48641. </dd>
  48642. <dt><samp class="option">pict_type <em class="emph">(video only)</em></samp></dt>
  48643. <dd><p>The type of the filtered frame. It can assume one of the following
  48644. values:
  48645. </p><dl class="table">
  48646. <dt><samp class="option">I</samp></dt>
  48647. <dt><samp class="option">P</samp></dt>
  48648. <dt><samp class="option">B</samp></dt>
  48649. <dt><samp class="option">S</samp></dt>
  48650. <dt><samp class="option">SI</samp></dt>
  48651. <dt><samp class="option">SP</samp></dt>
  48652. <dt><samp class="option">BI</samp></dt>
  48653. </dl>
  48654. </dd>
  48655. <dt><samp class="option">interlace_type <em class="emph">(video only)</em></samp></dt>
  48656. <dd><p>The frame interlace type. It can assume one of the following values:
  48657. </p><dl class="table">
  48658. <dt><samp class="option">PROGRESSIVE</samp></dt>
  48659. <dd><p>The frame is progressive (not interlaced).
  48660. </p></dd>
  48661. <dt><samp class="option">TOPFIRST</samp></dt>
  48662. <dd><p>The frame is top-field-first.
  48663. </p></dd>
  48664. <dt><samp class="option">BOTTOMFIRST</samp></dt>
  48665. <dd><p>The frame is bottom-field-first.
  48666. </p></dd>
  48667. </dl>
  48668. </dd>
  48669. <dt><samp class="option">consumed_sample_n <em class="emph">(audio only)</em></samp></dt>
  48670. <dd><p>the number of selected samples before the current frame
  48671. </p>
  48672. </dd>
  48673. <dt><samp class="option">samples_n <em class="emph">(audio only)</em></samp></dt>
  48674. <dd><p>the number of samples in the current frame
  48675. </p>
  48676. </dd>
  48677. <dt><samp class="option">sample_rate <em class="emph">(audio only)</em></samp></dt>
  48678. <dd><p>the input sample rate
  48679. </p>
  48680. </dd>
  48681. <dt><samp class="option">key</samp></dt>
  48682. <dd><p>This is 1 if the filtered frame is a key-frame, 0 otherwise.
  48683. </p>
  48684. </dd>
  48685. <dt><samp class="option">pos</samp></dt>
  48686. <dd><p>the position in the file of the filtered frame, -1 if the information
  48687. is not available (e.g. for synthetic video); deprecated, do not use
  48688. </p>
  48689. </dd>
  48690. <dt><samp class="option">scene <em class="emph">(video only)</em></samp></dt>
  48691. <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
  48692. probability for the current frame to introduce a new scene, while a higher
  48693. value means the current frame is more likely to be one (see the example below)
  48694. </p>
  48695. </dd>
  48696. <dt><samp class="option">concatdec_select</samp></dt>
  48697. <dd><p>The concat demuxer can select only part of a concat input file by setting an
  48698. inpoint and an outpoint, but the output packets may not be entirely contained
  48699. in the selected interval. By using this variable, it is possible to skip frames
  48700. generated by the concat demuxer which are not exactly contained in the selected
  48701. interval.
  48702. </p>
  48703. <p>This works by comparing the frame pts against the <var class="var">lavf.concat.start_time</var>
  48704. and the <var class="var">lavf.concat.duration</var> packet metadata values which are also
  48705. present in the decoded frames.
  48706. </p>
  48707. <p>The <var class="var">concatdec_select</var> variable is -1 if the frame pts is at least
  48708. start_time and either the duration metadata is missing or the frame pts is less
  48709. than start_time + duration, 0 otherwise, and NaN if the start_time metadata is
  48710. missing.
  48711. </p>
  48712. <p>That basically means that an input frame is selected if its pts is within the
  48713. interval set by the concat demuxer.
  48714. </p>
  48715. </dd>
  48716. </dl>
  48717. <p>The default value of the select expression is &quot;1&quot;.
  48718. </p>
  48719. <ul class="mini-toc">
  48720. <li><a href="#Examples-181" accesskey="1">Examples</a></li>
  48721. </ul>
  48722. <div class="subsection-level-extent" id="Examples-181">
  48723. <h4 class="subsection"><span>37.17.1 Examples<a class="copiable-link" href="#Examples-181"> &para;</a></span></h4>
  48724. <ul class="itemize mark-bullet">
  48725. <li>Select all frames in input:
  48726. <div class="example">
  48727. <pre class="example-preformatted">select
  48728. </pre></div>
  48729. <p>The example above is the same as:
  48730. </p><div class="example">
  48731. <pre class="example-preformatted">select=1
  48732. </pre></div>
  48733. </li><li>Skip all frames:
  48734. <div class="example">
  48735. <pre class="example-preformatted">select=0
  48736. </pre></div>
  48737. </li><li>Select only I-frames:
  48738. <div class="example">
  48739. <pre class="example-preformatted">select='eq(pict_type\,I)'
  48740. </pre></div>
  48741. </li><li>Select one frame every 100:
  48742. <div class="example">
  48743. <pre class="example-preformatted">select='not(mod(n\,100))'
  48744. </pre></div>
  48745. </li><li>Select only frames contained in the 10-20 time interval:
  48746. <div class="example">
  48747. <pre class="example-preformatted">select=between(t\,10\,20)
  48748. </pre></div>
  48749. </li><li>Select only I-frames contained in the 10-20 time interval:
  48750. <div class="example">
  48751. <pre class="example-preformatted">select=between(t\,10\,20)*eq(pict_type\,I)
  48752. </pre></div>
  48753. </li><li>Select frames with a minimum distance of 10 seconds:
  48754. <div class="example">
  48755. <pre class="example-preformatted">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
  48756. </pre></div>
  48757. </li><li>Use aselect to select only audio frames with samples number &gt; 100:
  48758. <div class="example">
  48759. <pre class="example-preformatted">aselect='gt(samples_n\,100)'
  48760. </pre></div>
  48761. </li><li>Create a mosaic of the first scenes:
  48762. <div class="example">
  48763. <pre class="example-preformatted">ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
  48764. </pre></div>
  48765. <p>Comparing <var class="var">scene</var> against a value between 0.3 and 0.5 is generally a sane
  48766. choice.
  48767. </p>
  48768. </li><li>Send even and odd frames to separate outputs, and compose them:
  48769. <div class="example">
  48770. <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
  48771. </pre></div>
  48772. </li><li>Select useful frames from an ffconcat file which is using inpoints and
  48773. outpoints but where the source files are not intra frame only.
  48774. <div class="example">
  48775. <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
  48776. </pre></div>
  48777. </li></ul>
  48778. </div>
  48779. </div>
  48780. <div class="section-level-extent" id="sendcmd_002c-asendcmd">
  48781. <h3 class="section"><span>37.18 sendcmd, asendcmd<a class="copiable-link" href="#sendcmd_002c-asendcmd"> &para;</a></span></h3>
  48782. <p>Send commands to filters in the filtergraph.
  48783. </p>
  48784. <p>These filters read commands to be sent to other filters in the
  48785. filtergraph.
  48786. </p>
  48787. <p><code class="code">sendcmd</code> must be inserted between two video filters,
  48788. <code class="code">asendcmd</code> must be inserted between two audio filters, but apart
  48789. from that they act the same way.
  48790. </p>
  48791. <p>The specification of commands can be provided in the filter arguments
  48792. with the <var class="var">commands</var> option, or in a file specified by the
  48793. <var class="var">filename</var> option.
  48794. </p>
  48795. <p>These filters accept the following options:
  48796. </p><dl class="table">
  48797. <dt><samp class="option">commands, c</samp></dt>
  48798. <dd><p>Set the commands to be read and sent to the other filters.
  48799. </p></dd>
  48800. <dt><samp class="option">filename, f</samp></dt>
  48801. <dd><p>Set the filename of the commands to be read and sent to the other
  48802. filters.
  48803. </p></dd>
  48804. </dl>
  48805. <ul class="mini-toc">
  48806. <li><a href="#Commands-syntax" accesskey="1">Commands syntax</a></li>
  48807. <li><a href="#Examples-182" accesskey="2">Examples</a></li>
  48808. </ul>
  48809. <div class="subsection-level-extent" id="Commands-syntax">
  48810. <h4 class="subsection"><span>37.18.1 Commands syntax<a class="copiable-link" href="#Commands-syntax"> &para;</a></span></h4>
  48811. <p>A commands description consists of a sequence of interval
  48812. specifications, comprising a list of commands to be executed when a
  48813. particular event related to that interval occurs. The occurring event
  48814. is typically the current frame time entering or leaving a given time
  48815. interval.
  48816. </p>
  48817. <p>An interval is specified by the following syntax:
  48818. </p><div class="example">
  48819. <pre class="example-preformatted"><var class="var">START</var>[-<var class="var">END</var>] <var class="var">COMMANDS</var>;
  48820. </pre></div>
  48821. <p>The time interval is specified by the <var class="var">START</var> and <var class="var">END</var> times.
  48822. <var class="var">END</var> is optional and defaults to the maximum time.
  48823. </p>
  48824. <p>The current frame time is considered within the specified interval if
  48825. it is included in the interval [<var class="var">START</var>, <var class="var">END</var>), that is when
  48826. the time is greater or equal to <var class="var">START</var> and is lesser than
  48827. <var class="var">END</var>.
  48828. </p>
  48829. <p><var class="var">COMMANDS</var> consists of a sequence of one or more command
  48830. specifications, separated by &quot;,&quot;, relating to that interval. The
  48831. syntax of a command specification is given by:
  48832. </p><div class="example">
  48833. <pre class="example-preformatted">[<var class="var">FLAGS</var>] <var class="var">TARGET</var> <var class="var">COMMAND</var> <var class="var">ARG</var>
  48834. </pre></div>
  48835. <p><var class="var">FLAGS</var> is optional and specifies the type of events relating to
  48836. the time interval which enable sending the specified command, and must
  48837. be a non-null sequence of identifier flags separated by &quot;+&quot; or &quot;|&quot; and
  48838. enclosed between &quot;[&quot; and &quot;]&quot;.
  48839. </p>
  48840. <p>The following flags are recognized:
  48841. </p><dl class="table">
  48842. <dt><samp class="option">enter</samp></dt>
  48843. <dd><p>The command is sent when the current frame timestamp enters the
  48844. specified interval. In other words, the command is sent when the
  48845. previous frame timestamp was not in the given interval, and the
  48846. current is.
  48847. </p>
  48848. </dd>
  48849. <dt><samp class="option">leave</samp></dt>
  48850. <dd><p>The command is sent when the current frame timestamp leaves the
  48851. specified interval. In other words, the command is sent when the
  48852. previous frame timestamp was in the given interval, and the
  48853. current is not.
  48854. </p>
  48855. </dd>
  48856. <dt><samp class="option">expr</samp></dt>
  48857. <dd><p>The command <var class="var">ARG</var> is interpreted as expression and result of
  48858. expression is passed as <var class="var">ARG</var>.
  48859. </p>
  48860. <p>The expression is evaluated through the eval API and can contain the following
  48861. constants:
  48862. </p>
  48863. <dl class="table">
  48864. <dt><samp class="option">POS</samp></dt>
  48865. <dd><p>Original position in the file of the frame, or undefined if undefined
  48866. for the current frame. Deprecated, do not use.
  48867. </p>
  48868. </dd>
  48869. <dt><samp class="option">PTS</samp></dt>
  48870. <dd><p>The presentation timestamp in input.
  48871. </p>
  48872. </dd>
  48873. <dt><samp class="option">N</samp></dt>
  48874. <dd><p>The count of the input frame for video or audio, starting from 0.
  48875. </p>
  48876. </dd>
  48877. <dt><samp class="option">T</samp></dt>
  48878. <dd><p>The time in seconds of the current frame.
  48879. </p>
  48880. </dd>
  48881. <dt><samp class="option">TS</samp></dt>
  48882. <dd><p>The start time in seconds of the current command interval.
  48883. </p>
  48884. </dd>
  48885. <dt><samp class="option">TE</samp></dt>
  48886. <dd><p>The end time in seconds of the current command interval.
  48887. </p>
  48888. </dd>
  48889. <dt><samp class="option">TI</samp></dt>
  48890. <dd><p>The interpolated time of the current command interval, TI = (T - TS) / (TE - TS).
  48891. </p>
  48892. </dd>
  48893. <dt><samp class="option">W</samp></dt>
  48894. <dd><p>The video frame width.
  48895. </p>
  48896. </dd>
  48897. <dt><samp class="option">H</samp></dt>
  48898. <dd><p>The video frame height.
  48899. </p></dd>
  48900. </dl>
  48901. </dd>
  48902. </dl>
  48903. <p>If <var class="var">FLAGS</var> is not specified, a default value of <code class="code">[enter]</code> is
  48904. assumed.
  48905. </p>
  48906. <p><var class="var">TARGET</var> specifies the target of the command, usually the name of
  48907. the filter class or a specific filter instance name.
  48908. </p>
  48909. <p><var class="var">COMMAND</var> specifies the name of the command for the target filter.
  48910. </p>
  48911. <p><var class="var">ARG</var> is optional and specifies the optional list of argument for
  48912. the given <var class="var">COMMAND</var>.
  48913. </p>
  48914. <p>Between one interval specification and another, whitespaces, or
  48915. sequences of characters starting with <code class="code">#</code> until the end of line,
  48916. are ignored and can be used to annotate comments.
  48917. </p>
  48918. <p>A simplified BNF description of the commands specification syntax
  48919. follows:
  48920. </p><div class="example">
  48921. <pre class="example-preformatted"><var class="var">COMMAND_FLAG</var> ::= &quot;enter&quot; | &quot;leave&quot;
  48922. <var class="var">COMMAND_FLAGS</var> ::= <var class="var">COMMAND_FLAG</var> [(+|&quot;|&quot;)<var class="var">COMMAND_FLAG</var>]
  48923. <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>]
  48924. <var class="var">COMMANDS</var> ::= <var class="var">COMMAND</var> [,<var class="var">COMMANDS</var>]
  48925. <var class="var">INTERVAL</var> ::= <var class="var">START</var>[-<var class="var">END</var>] <var class="var">COMMANDS</var>
  48926. <var class="var">INTERVALS</var> ::= <var class="var">INTERVAL</var>[;<var class="var">INTERVALS</var>]
  48927. </pre></div>
  48928. </div>
  48929. <div class="subsection-level-extent" id="Examples-182">
  48930. <h4 class="subsection"><span>37.18.2 Examples<a class="copiable-link" href="#Examples-182"> &para;</a></span></h4>
  48931. <ul class="itemize mark-bullet">
  48932. <li>Specify audio tempo change at second 4:
  48933. <div class="example">
  48934. <pre class="example-preformatted">asendcmd=c='4.0 atempo tempo 1.5',atempo
  48935. </pre></div>
  48936. </li><li>Target a specific filter instance:
  48937. <div class="example">
  48938. <pre class="example-preformatted">asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
  48939. </pre></div>
  48940. </li><li>Specify a list of drawtext and hue commands in a file.
  48941. <div class="example">
  48942. <pre class="example-preformatted"># show text in the interval 5-10
  48943. 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
  48944. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
  48945. # desaturate the image in the interval 15-20
  48946. 15.0-20.0 [enter] hue s 0,
  48947. [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
  48948. [leave] hue s 1,
  48949. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
  48950. # apply an exponential saturation fade-out effect, starting from time 25
  48951. 25 [enter] hue s exp(25-t)
  48952. </pre></div>
  48953. <p>A filtergraph allowing to read and process the above command list
  48954. stored in a file <samp class="file">test.cmd</samp>, can be specified with:
  48955. </p><div class="example">
  48956. <pre class="example-preformatted">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
  48957. </pre></div>
  48958. </li></ul>
  48959. <a class="anchor" id="setpts"></a></div>
  48960. </div>
  48961. <div class="section-level-extent" id="setpts_002c-asetpts">
  48962. <h3 class="section"><span>37.19 setpts, asetpts<a class="copiable-link" href="#setpts_002c-asetpts"> &para;</a></span></h3>
  48963. <p>Change the PTS (presentation timestamp) of the input frames.
  48964. </p>
  48965. <p><code class="code">setpts</code> works on video frames, <code class="code">asetpts</code> on audio frames.
  48966. </p>
  48967. <p>This filter accepts the following options:
  48968. </p>
  48969. <dl class="table">
  48970. <dt><samp class="option">expr</samp></dt>
  48971. <dd><p>The expression which is evaluated for each frame to construct its timestamp.
  48972. </p>
  48973. </dd>
  48974. </dl>
  48975. <p>The expression is evaluated through the eval API and can contain the following
  48976. constants:
  48977. </p>
  48978. <dl class="table">
  48979. <dt><samp class="option">FRAME_RATE, FR</samp></dt>
  48980. <dd><p>frame rate, only defined for constant frame-rate video
  48981. </p>
  48982. </dd>
  48983. <dt><samp class="option">PTS</samp></dt>
  48984. <dd><p>The presentation timestamp in input
  48985. </p>
  48986. </dd>
  48987. <dt><samp class="option">N</samp></dt>
  48988. <dd><p>The count of the input frame for video or the number of consumed samples,
  48989. not including the current frame for audio, starting from 0.
  48990. </p>
  48991. </dd>
  48992. <dt><samp class="option">NB_CONSUMED_SAMPLES</samp></dt>
  48993. <dd><p>The number of consumed samples, not including the current frame (only
  48994. audio)
  48995. </p>
  48996. </dd>
  48997. <dt><samp class="option">NB_SAMPLES, S</samp></dt>
  48998. <dd><p>The number of samples in the current frame (only audio)
  48999. </p>
  49000. </dd>
  49001. <dt><samp class="option">SAMPLE_RATE, SR</samp></dt>
  49002. <dd><p>The audio sample rate.
  49003. </p>
  49004. </dd>
  49005. <dt><samp class="option">STARTPTS</samp></dt>
  49006. <dd><p>The PTS of the first frame.
  49007. </p>
  49008. </dd>
  49009. <dt><samp class="option">STARTT</samp></dt>
  49010. <dd><p>the time in seconds of the first frame
  49011. </p>
  49012. </dd>
  49013. <dt><samp class="option">INTERLACED</samp></dt>
  49014. <dd><p>State whether the current frame is interlaced.
  49015. </p>
  49016. </dd>
  49017. <dt><samp class="option">T</samp></dt>
  49018. <dd><p>the time in seconds of the current frame
  49019. </p>
  49020. </dd>
  49021. <dt><samp class="option">POS</samp></dt>
  49022. <dd><p>original position in the file of the frame, or undefined if undefined
  49023. for the current frame; deprecated, do not use
  49024. </p>
  49025. </dd>
  49026. <dt><samp class="option">PREV_INPTS</samp></dt>
  49027. <dd><p>The previous input PTS.
  49028. </p>
  49029. </dd>
  49030. <dt><samp class="option">PREV_INT</samp></dt>
  49031. <dd><p>previous input time in seconds
  49032. </p>
  49033. </dd>
  49034. <dt><samp class="option">PREV_OUTPTS</samp></dt>
  49035. <dd><p>The previous output PTS.
  49036. </p>
  49037. </dd>
  49038. <dt><samp class="option">PREV_OUTT</samp></dt>
  49039. <dd><p>previous output time in seconds
  49040. </p>
  49041. </dd>
  49042. <dt><samp class="option">RTCTIME</samp></dt>
  49043. <dd><p>The wallclock (RTC) time in microseconds. This is deprecated, use time(0)
  49044. instead.
  49045. </p>
  49046. </dd>
  49047. <dt><samp class="option">RTCSTART</samp></dt>
  49048. <dd><p>The wallclock (RTC) time at the start of the movie in microseconds.
  49049. </p>
  49050. </dd>
  49051. <dt><samp class="option">TB</samp></dt>
  49052. <dd><p>The timebase of the input timestamps.
  49053. </p>
  49054. </dd>
  49055. <dt><samp class="option">T_CHANGE</samp></dt>
  49056. <dd><p>Time of the first frame after command was applied or time of the first frame if no commands.
  49057. </p>
  49058. </dd>
  49059. </dl>
  49060. <ul class="mini-toc">
  49061. <li><a href="#Examples-183" accesskey="1">Examples</a></li>
  49062. <li><a href="#Commands-164" accesskey="2">Commands</a></li>
  49063. </ul>
  49064. <div class="subsection-level-extent" id="Examples-183">
  49065. <h4 class="subsection"><span>37.19.1 Examples<a class="copiable-link" href="#Examples-183"> &para;</a></span></h4>
  49066. <ul class="itemize mark-bullet">
  49067. <li>Start counting PTS from zero
  49068. <div class="example">
  49069. <pre class="example-preformatted">setpts=PTS-STARTPTS
  49070. </pre></div>
  49071. </li><li>Apply fast motion effect:
  49072. <div class="example">
  49073. <pre class="example-preformatted">setpts=0.5*PTS
  49074. </pre></div>
  49075. </li><li>Apply slow motion effect:
  49076. <div class="example">
  49077. <pre class="example-preformatted">setpts=2.0*PTS
  49078. </pre></div>
  49079. </li><li>Set fixed rate of 25 frames per second:
  49080. <div class="example">
  49081. <pre class="example-preformatted">setpts=N/(25*TB)
  49082. </pre></div>
  49083. </li><li>Apply a random jitter effect of +/-100 TB units:
  49084. <div class="example">
  49085. <pre class="example-preformatted">setpts=PTS+randomi(0, -100\,100)
  49086. </pre></div>
  49087. </li><li>Set fixed rate 25 fps with some jitter:
  49088. <div class="example">
  49089. <pre class="example-preformatted">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
  49090. </pre></div>
  49091. </li><li>Apply an offset of 10 seconds to the input PTS:
  49092. <div class="example">
  49093. <pre class="example-preformatted">setpts=PTS+10/TB
  49094. </pre></div>
  49095. </li><li>Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
  49096. <div class="example">
  49097. <pre class="example-preformatted">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
  49098. </pre></div>
  49099. </li><li>Generate timestamps by counting samples:
  49100. <div class="example">
  49101. <pre class="example-preformatted">asetpts=N/SR/TB
  49102. </pre></div>
  49103. </li></ul>
  49104. </div>
  49105. <div class="subsection-level-extent" id="Commands-164">
  49106. <h4 class="subsection"><span>37.19.2 Commands<a class="copiable-link" href="#Commands-164"> &para;</a></span></h4>
  49107. <p>Both filters support all above options as <a class="ref" href="#commands">commands</a>.
  49108. </p>
  49109. </div>
  49110. </div>
  49111. <div class="section-level-extent" id="setrange">
  49112. <h3 class="section"><span>37.20 setrange<a class="copiable-link" href="#setrange"> &para;</a></span></h3>
  49113. <p>Force color range for the output video frame.
  49114. </p>
  49115. <p>The <code class="code">setrange</code> filter marks the color range property for the
  49116. output frames. It does not change the input frame, but only sets the
  49117. corresponding property, which affects how the frame is treated by
  49118. following filters.
  49119. </p>
  49120. <p>The filter accepts the following options:
  49121. </p>
  49122. <dl class="table">
  49123. <dt><samp class="option">range</samp></dt>
  49124. <dd><p>Available values are:
  49125. </p>
  49126. <dl class="table">
  49127. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  49128. <dd><p>Keep the same color range property.
  49129. </p>
  49130. </dd>
  49131. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  49132. <dd><p>Set the color range as unspecified.
  49133. </p>
  49134. </dd>
  49135. <dt>&lsquo;<samp class="samp">limited, tv, mpeg</samp>&rsquo;</dt>
  49136. <dd><p>Set the color range as limited.
  49137. </p>
  49138. </dd>
  49139. <dt>&lsquo;<samp class="samp">full, pc, jpeg</samp>&rsquo;</dt>
  49140. <dd><p>Set the color range as full.
  49141. </p></dd>
  49142. </dl>
  49143. </dd>
  49144. </dl>
  49145. </div>
  49146. <div class="section-level-extent" id="settb_002c-asettb">
  49147. <h3 class="section"><span>37.21 settb, asettb<a class="copiable-link" href="#settb_002c-asettb"> &para;</a></span></h3>
  49148. <p>Set the timebase to use for the output frames timestamps.
  49149. It is mainly useful for testing timebase configuration.
  49150. </p>
  49151. <p>It accepts the following parameters:
  49152. </p>
  49153. <dl class="table">
  49154. <dt><samp class="option">expr, tb</samp></dt>
  49155. <dd><p>The expression which is evaluated into the output timebase.
  49156. </p>
  49157. </dd>
  49158. </dl>
  49159. <p>The value for <samp class="option">tb</samp> is an arithmetic expression representing a
  49160. rational. The expression can contain the constants &quot;AVTB&quot; (the default
  49161. timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
  49162. audio only). Default value is &quot;intb&quot;.
  49163. </p>
  49164. <ul class="mini-toc">
  49165. <li><a href="#Examples-184" accesskey="1">Examples</a></li>
  49166. </ul>
  49167. <div class="subsection-level-extent" id="Examples-184">
  49168. <h4 class="subsection"><span>37.21.1 Examples<a class="copiable-link" href="#Examples-184"> &para;</a></span></h4>
  49169. <ul class="itemize mark-bullet">
  49170. <li>Set the timebase to 1/25:
  49171. <div class="example">
  49172. <pre class="example-preformatted">settb=expr=1/25
  49173. </pre></div>
  49174. </li><li>Set the timebase to 1/10:
  49175. <div class="example">
  49176. <pre class="example-preformatted">settb=expr=0.1
  49177. </pre></div>
  49178. </li><li>Set the timebase to 1001/1000:
  49179. <div class="example">
  49180. <pre class="example-preformatted">settb=1+0.001
  49181. </pre></div>
  49182. </li><li>Set the timebase to 2*intb:
  49183. <div class="example">
  49184. <pre class="example-preformatted">settb=2*intb
  49185. </pre></div>
  49186. </li><li>Set the default timebase value:
  49187. <div class="example">
  49188. <pre class="example-preformatted">settb=AVTB
  49189. </pre></div>
  49190. </li></ul>
  49191. </div>
  49192. </div>
  49193. <div class="section-level-extent" id="showcqt">
  49194. <h3 class="section"><span>37.22 showcqt<a class="copiable-link" href="#showcqt"> &para;</a></span></h3>
  49195. <p>Convert input audio to a video output representing frequency spectrum
  49196. logarithmically using Brown-Puckette constant Q transform algorithm with
  49197. direct frequency domain coefficient calculation (but the transform itself
  49198. is not really constant Q, instead the Q factor is actually variable/clamped),
  49199. with musical tone scale, from E0 to D#10.
  49200. </p>
  49201. <p>The filter accepts the following options:
  49202. </p>
  49203. <dl class="table">
  49204. <dt><samp class="option">size, s</samp></dt>
  49205. <dd><p>Specify the video size for the output. It must be even. For the syntax of this option,
  49206. 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>.
  49207. Default value is <code class="code">1920x1080</code>.
  49208. </p>
  49209. </dd>
  49210. <dt><samp class="option">fps, rate, r</samp></dt>
  49211. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  49212. </p>
  49213. </dd>
  49214. <dt><samp class="option">bar_h</samp></dt>
  49215. <dd><p>Set the bargraph height. It must be even. Default value is <code class="code">-1</code> which
  49216. computes the bargraph height automatically.
  49217. </p>
  49218. </dd>
  49219. <dt><samp class="option">axis_h</samp></dt>
  49220. <dd><p>Set the axis height. It must be even. Default value is <code class="code">-1</code> which computes
  49221. the axis height automatically.
  49222. </p>
  49223. </dd>
  49224. <dt><samp class="option">sono_h</samp></dt>
  49225. <dd><p>Set the sonogram height. It must be even. Default value is <code class="code">-1</code> which
  49226. computes the sonogram height automatically.
  49227. </p>
  49228. </dd>
  49229. <dt><samp class="option">fullhd</samp></dt>
  49230. <dd><p>Set the fullhd resolution. This option is deprecated, use <var class="var">size</var>, <var class="var">s</var>
  49231. instead. Default value is <code class="code">1</code>.
  49232. </p>
  49233. </dd>
  49234. <dt><samp class="option">sono_v, volume</samp></dt>
  49235. <dd><p>Specify the sonogram volume expression. It can contain variables:
  49236. </p><dl class="table">
  49237. <dt><samp class="option">bar_v</samp></dt>
  49238. <dd><p>the <var class="var">bar_v</var> evaluated expression
  49239. </p></dd>
  49240. <dt><samp class="option">frequency, freq, f</samp></dt>
  49241. <dd><p>the frequency where it is evaluated
  49242. </p></dd>
  49243. <dt><samp class="option">timeclamp, tc</samp></dt>
  49244. <dd><p>the value of <var class="var">timeclamp</var> option
  49245. </p></dd>
  49246. </dl>
  49247. <p>and functions:
  49248. </p><dl class="table">
  49249. <dt><samp class="option">a_weighting(f)</samp></dt>
  49250. <dd><p>A-weighting of equal loudness
  49251. </p></dd>
  49252. <dt><samp class="option">b_weighting(f)</samp></dt>
  49253. <dd><p>B-weighting of equal loudness
  49254. </p></dd>
  49255. <dt><samp class="option">c_weighting(f)</samp></dt>
  49256. <dd><p>C-weighting of equal loudness.
  49257. </p></dd>
  49258. </dl>
  49259. <p>Default value is <code class="code">16</code>.
  49260. </p>
  49261. </dd>
  49262. <dt><samp class="option">bar_v, volume2</samp></dt>
  49263. <dd><p>Specify the bargraph volume expression. It can contain variables:
  49264. </p><dl class="table">
  49265. <dt><samp class="option">sono_v</samp></dt>
  49266. <dd><p>the <var class="var">sono_v</var> evaluated expression
  49267. </p></dd>
  49268. <dt><samp class="option">frequency, freq, f</samp></dt>
  49269. <dd><p>the frequency where it is evaluated
  49270. </p></dd>
  49271. <dt><samp class="option">timeclamp, tc</samp></dt>
  49272. <dd><p>the value of <var class="var">timeclamp</var> option
  49273. </p></dd>
  49274. </dl>
  49275. <p>and functions:
  49276. </p><dl class="table">
  49277. <dt><samp class="option">a_weighting(f)</samp></dt>
  49278. <dd><p>A-weighting of equal loudness
  49279. </p></dd>
  49280. <dt><samp class="option">b_weighting(f)</samp></dt>
  49281. <dd><p>B-weighting of equal loudness
  49282. </p></dd>
  49283. <dt><samp class="option">c_weighting(f)</samp></dt>
  49284. <dd><p>C-weighting of equal loudness.
  49285. </p></dd>
  49286. </dl>
  49287. <p>Default value is <code class="code">sono_v</code>.
  49288. </p>
  49289. </dd>
  49290. <dt><samp class="option">sono_g, gamma</samp></dt>
  49291. <dd><p>Specify the sonogram gamma. Lower gamma makes the spectrum more contrast,
  49292. higher gamma makes the spectrum having more range. Default value is <code class="code">3</code>.
  49293. Acceptable range is <code class="code">[1, 7]</code>.
  49294. </p>
  49295. </dd>
  49296. <dt><samp class="option">bar_g, gamma2</samp></dt>
  49297. <dd><p>Specify the bargraph gamma. Default value is <code class="code">1</code>. Acceptable range is
  49298. <code class="code">[1, 7]</code>.
  49299. </p>
  49300. </dd>
  49301. <dt><samp class="option">bar_t</samp></dt>
  49302. <dd><p>Specify the bargraph transparency level. Lower value makes the bargraph sharper.
  49303. Default value is <code class="code">1</code>. Acceptable range is <code class="code">[0, 1]</code>.
  49304. </p>
  49305. </dd>
  49306. <dt><samp class="option">timeclamp, tc</samp></dt>
  49307. <dd><p>Specify the transform timeclamp. At low frequency, there is trade-off between
  49308. accuracy in time domain and frequency domain. If timeclamp is lower,
  49309. event in time domain is represented more accurately (such as fast bass drum),
  49310. otherwise event in frequency domain is represented more accurately
  49311. (such as bass guitar). Acceptable range is <code class="code">[0.002, 1]</code>. Default value is <code class="code">0.17</code>.
  49312. </p>
  49313. </dd>
  49314. <dt><samp class="option">attack</samp></dt>
  49315. <dd><p>Set attack time in seconds. The default is <code class="code">0</code> (disabled). Otherwise, it
  49316. limits future samples by applying asymmetric windowing in time domain, useful
  49317. when low latency is required. Accepted range is <code class="code">[0, 1]</code>.
  49318. </p>
  49319. </dd>
  49320. <dt><samp class="option">basefreq</samp></dt>
  49321. <dd><p>Specify the transform base frequency. Default value is <code class="code">20.01523126408007475</code>,
  49322. which is frequency 50 cents below E0. Acceptable range is <code class="code">[10, 100000]</code>.
  49323. </p>
  49324. </dd>
  49325. <dt><samp class="option">endfreq</samp></dt>
  49326. <dd><p>Specify the transform end frequency. Default value is <code class="code">20495.59681441799654</code>,
  49327. which is frequency 50 cents above D#10. Acceptable range is <code class="code">[10, 100000]</code>.
  49328. </p>
  49329. </dd>
  49330. <dt><samp class="option">coeffclamp</samp></dt>
  49331. <dd><p>This option is deprecated and ignored.
  49332. </p>
  49333. </dd>
  49334. <dt><samp class="option">tlength</samp></dt>
  49335. <dd><p>Specify the transform length in time domain. Use this option to control accuracy
  49336. trade-off between time domain and frequency domain at every frequency sample.
  49337. It can contain variables:
  49338. </p><dl class="table">
  49339. <dt><samp class="option">frequency, freq, f</samp></dt>
  49340. <dd><p>the frequency where it is evaluated
  49341. </p></dd>
  49342. <dt><samp class="option">timeclamp, tc</samp></dt>
  49343. <dd><p>the value of <var class="var">timeclamp</var> option.
  49344. </p></dd>
  49345. </dl>
  49346. <p>Default value is <code class="code">384*tc/(384+tc*f)</code>.
  49347. </p>
  49348. </dd>
  49349. <dt><samp class="option">count</samp></dt>
  49350. <dd><p>Specify the transform count for every video frame. Default value is <code class="code">6</code>.
  49351. Acceptable range is <code class="code">[1, 30]</code>.
  49352. </p>
  49353. </dd>
  49354. <dt><samp class="option">fcount</samp></dt>
  49355. <dd><p>Specify the transform count for every single pixel. Default value is <code class="code">0</code>,
  49356. which makes it computed automatically. Acceptable range is <code class="code">[0, 10]</code>.
  49357. </p>
  49358. </dd>
  49359. <dt><samp class="option">fontfile</samp></dt>
  49360. <dd><p>Specify font file for use with freetype to draw the axis. If not specified,
  49361. use embedded font. Note that drawing with font file or embedded font is not
  49362. implemented with custom <var class="var">basefreq</var> and <var class="var">endfreq</var>, use <var class="var">axisfile</var>
  49363. option instead.
  49364. </p>
  49365. </dd>
  49366. <dt><samp class="option">font</samp></dt>
  49367. <dd><p>Specify fontconfig pattern. This has lower priority than <var class="var">fontfile</var>. The
  49368. <code class="code">:</code> in the pattern may be replaced by <code class="code">|</code> to avoid unnecessary
  49369. escaping.
  49370. </p>
  49371. </dd>
  49372. <dt><samp class="option">fontcolor</samp></dt>
  49373. <dd><p>Specify font color expression. This is arithmetic expression that should return
  49374. integer value 0xRRGGBB. It can contain variables:
  49375. </p><dl class="table">
  49376. <dt><samp class="option">frequency, freq, f</samp></dt>
  49377. <dd><p>the frequency where it is evaluated
  49378. </p></dd>
  49379. <dt><samp class="option">timeclamp, tc</samp></dt>
  49380. <dd><p>the value of <var class="var">timeclamp</var> option
  49381. </p></dd>
  49382. </dl>
  49383. <p>and functions:
  49384. </p><dl class="table">
  49385. <dt><samp class="option">midi(f)</samp></dt>
  49386. <dd><p>midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
  49387. </p></dd>
  49388. <dt><samp class="option">r(x), g(x), b(x)</samp></dt>
  49389. <dd><p>red, green, and blue value of intensity x.
  49390. </p></dd>
  49391. </dl>
  49392. <p>Default value is <code class="code">st(0, (midi(f)-59.5)/12);
  49393. st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));
  49394. r(1-ld(1)) + b(ld(1))</code>.
  49395. </p>
  49396. </dd>
  49397. <dt><samp class="option">axisfile</samp></dt>
  49398. <dd><p>Specify image file to draw the axis. This option override <var class="var">fontfile</var> and
  49399. <var class="var">fontcolor</var> option.
  49400. </p>
  49401. </dd>
  49402. <dt><samp class="option">axis, text</samp></dt>
  49403. <dd><p>Enable/disable drawing text to the axis. If it is set to <code class="code">0</code>, drawing to
  49404. the axis is disabled, ignoring <var class="var">fontfile</var> and <var class="var">axisfile</var> option.
  49405. Default value is <code class="code">1</code>.
  49406. </p>
  49407. </dd>
  49408. <dt><samp class="option">csp</samp></dt>
  49409. <dd><p>Set colorspace. The accepted values are:
  49410. </p><dl class="table">
  49411. <dt>&lsquo;<samp class="samp">unspecified</samp>&rsquo;</dt>
  49412. <dd><p>Unspecified (default)
  49413. </p>
  49414. </dd>
  49415. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  49416. <dd><p>BT.709
  49417. </p>
  49418. </dd>
  49419. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  49420. <dd><p>FCC
  49421. </p>
  49422. </dd>
  49423. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  49424. <dd><p>BT.470BG or BT.601-6 625
  49425. </p>
  49426. </dd>
  49427. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  49428. <dd><p>SMPTE-170M or BT.601-6 525
  49429. </p>
  49430. </dd>
  49431. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  49432. <dd><p>SMPTE-240M
  49433. </p>
  49434. </dd>
  49435. <dt>&lsquo;<samp class="samp">bt2020ncl</samp>&rsquo;</dt>
  49436. <dd><p>BT.2020 with non-constant luminance
  49437. </p>
  49438. </dd>
  49439. </dl>
  49440. </dd>
  49441. <dt><samp class="option">cscheme</samp></dt>
  49442. <dd><p>Set spectrogram color scheme. This is list of floating point values with format
  49443. <code class="code">left_r|left_g|left_b|right_r|right_g|right_b</code>.
  49444. The default is <code class="code">1|0.5|0|0|0.5|1</code>.
  49445. </p>
  49446. </dd>
  49447. </dl>
  49448. <ul class="mini-toc">
  49449. <li><a href="#Examples-185" accesskey="1">Examples</a></li>
  49450. </ul>
  49451. <div class="subsection-level-extent" id="Examples-185">
  49452. <h4 class="subsection"><span>37.22.1 Examples<a class="copiable-link" href="#Examples-185"> &para;</a></span></h4>
  49453. <ul class="itemize mark-bullet">
  49454. <li>Playing audio while showing the spectrum:
  49455. <div class="example">
  49456. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
  49457. </pre></div>
  49458. </li><li>Same as above, but with frame rate 30 fps:
  49459. <div class="example">
  49460. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
  49461. </pre></div>
  49462. </li><li>Playing at 1280x720:
  49463. <div class="example">
  49464. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
  49465. </pre></div>
  49466. </li><li>Disable sonogram display:
  49467. <div class="example">
  49468. <pre class="example-preformatted">sono_h=0
  49469. </pre></div>
  49470. </li><li>A1 and its harmonics: A1, A2, (near)E3, A3:
  49471. <div class="example">
  49472. <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),
  49473. asplit[a][out1]; [a] showcqt [out0]'
  49474. </pre></div>
  49475. </li><li>Same as above, but with more accuracy in frequency domain:
  49476. <div class="example">
  49477. <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),
  49478. asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
  49479. </pre></div>
  49480. </li><li>Custom volume:
  49481. <div class="example">
  49482. <pre class="example-preformatted">bar_v=10:sono_v=bar_v*a_weighting(f)
  49483. </pre></div>
  49484. </li><li>Custom gamma, now spectrum is linear to the amplitude.
  49485. <div class="example">
  49486. <pre class="example-preformatted">bar_g=2:sono_g=2
  49487. </pre></div>
  49488. </li><li>Custom tlength equation:
  49489. <div class="example">
  49490. <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)))'
  49491. </pre></div>
  49492. </li><li>Custom fontcolor and fontfile, C-note is colored green, others are colored blue:
  49493. <div class="example">
  49494. <pre class="example-preformatted">fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
  49495. </pre></div>
  49496. </li><li>Custom font using fontconfig:
  49497. <div class="example">
  49498. <pre class="example-preformatted">font='Courier New,Monospace,mono|bold'
  49499. </pre></div>
  49500. </li><li>Custom frequency range with custom axis using image file:
  49501. <div class="example">
  49502. <pre class="example-preformatted">axisfile=myaxis.png:basefreq=40:endfreq=10000
  49503. </pre></div>
  49504. </li></ul>
  49505. </div>
  49506. </div>
  49507. <div class="section-level-extent" id="showcwt">
  49508. <h3 class="section"><span>37.23 showcwt<a class="copiable-link" href="#showcwt"> &para;</a></span></h3>
  49509. <p>Convert input audio to video output representing frequency spectrum
  49510. using Continuous Wavelet Transform and Morlet wavelet.
  49511. </p>
  49512. <p>The filter accepts the following options:
  49513. </p>
  49514. <dl class="table">
  49515. <dt><samp class="option">size, s</samp></dt>
  49516. <dd><p>Specify the video size for the output. For the syntax of this option,
  49517. 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>.
  49518. Default value is <code class="code">640x512</code>.
  49519. </p>
  49520. </dd>
  49521. <dt><samp class="option">rate, r</samp></dt>
  49522. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  49523. </p>
  49524. </dd>
  49525. <dt><samp class="option">scale</samp></dt>
  49526. <dd><p>Set the frequency scale used. Allowed values are:
  49527. </p>
  49528. <dl class="table">
  49529. <dt><samp class="option">linear</samp></dt>
  49530. <dt><samp class="option">log</samp></dt>
  49531. <dt><samp class="option">bark</samp></dt>
  49532. <dt><samp class="option">mel</samp></dt>
  49533. <dt><samp class="option">erbs</samp></dt>
  49534. <dt><samp class="option">sqrt</samp></dt>
  49535. <dt><samp class="option">cbrt</samp></dt>
  49536. <dt><samp class="option">qdrt</samp></dt>
  49537. <dt><samp class="option">fm</samp></dt>
  49538. </dl>
  49539. <p>Default value is <code class="code">linear</code>.
  49540. </p>
  49541. </dd>
  49542. <dt><samp class="option">iscale</samp></dt>
  49543. <dd><p>Set the intensity scale used. Allowed values are:
  49544. </p>
  49545. <dl class="table">
  49546. <dt><samp class="option">linear</samp></dt>
  49547. <dt><samp class="option">log</samp></dt>
  49548. <dt><samp class="option">sqrt</samp></dt>
  49549. <dt><samp class="option">cbrt</samp></dt>
  49550. <dt><samp class="option">qdrt</samp></dt>
  49551. </dl>
  49552. <p>Default value is <code class="code">log</code>.
  49553. </p>
  49554. </dd>
  49555. <dt><samp class="option">min</samp></dt>
  49556. <dd><p>Set the minimum frequency that will be used in output.
  49557. Default is <code class="code">20</code> Hz.
  49558. </p>
  49559. </dd>
  49560. <dt><samp class="option">max</samp></dt>
  49561. <dd><p>Set the maximum frequency that will be used in output.
  49562. Default is <code class="code">20000</code> Hz. The real frequency upper limit
  49563. depends on input audio&rsquo;s sample rate and such will be enforced
  49564. on this value when it is set to value greater than Nyquist frequency.
  49565. </p>
  49566. </dd>
  49567. <dt><samp class="option">imin</samp></dt>
  49568. <dd><p>Set the minimum intensity that will be used in output.
  49569. </p>
  49570. </dd>
  49571. <dt><samp class="option">imax</samp></dt>
  49572. <dd><p>Set the maximum intensity that will be used in output.
  49573. </p>
  49574. </dd>
  49575. <dt><samp class="option">logb</samp></dt>
  49576. <dd><p>Set the logarithmic basis for brightness strength when
  49577. mapping calculated magnitude values to pixel values.
  49578. Allowed range is from <code class="code">0</code> to <code class="code">1</code>.
  49579. Default value is <code class="code">0.0001</code>.
  49580. </p>
  49581. </dd>
  49582. <dt><samp class="option">deviation</samp></dt>
  49583. <dd><p>Set the frequency deviation.
  49584. Lower values than <code class="code">1</code> are more frequency oriented,
  49585. while higher values than <code class="code">1</code> are more time oriented.
  49586. Allowed range is from <code class="code">0</code> to <code class="code">10</code>.
  49587. Default value is <code class="code">1</code>.
  49588. </p>
  49589. </dd>
  49590. <dt><samp class="option">pps</samp></dt>
  49591. <dd><p>Set the number of pixel output per each second in one row.
  49592. Allowed range is from <code class="code">1</code> to <code class="code">1024</code>.
  49593. Default value is <code class="code">64</code>.
  49594. </p>
  49595. </dd>
  49596. <dt><samp class="option">mode</samp></dt>
  49597. <dd><p>Set the output visual mode. Allowed values are:
  49598. </p>
  49599. <dl class="table">
  49600. <dt><samp class="option">magnitude</samp></dt>
  49601. <dd><p>Show magnitude.
  49602. </p></dd>
  49603. <dt><samp class="option">phase</samp></dt>
  49604. <dd><p>Show only phase.
  49605. </p></dd>
  49606. <dt><samp class="option">magphase</samp></dt>
  49607. <dd><p>Show combination of magnitude and phase.
  49608. Magnitude is mapped to brightness and phase to color.
  49609. </p></dd>
  49610. <dt><samp class="option">channel</samp></dt>
  49611. <dd><p>Show unique color per channel magnitude.
  49612. </p></dd>
  49613. <dt><samp class="option">stereo</samp></dt>
  49614. <dd><p>Show unique color per stereo difference.
  49615. </p></dd>
  49616. </dl>
  49617. <p>Default value is <code class="code">magnitude</code>.
  49618. </p>
  49619. </dd>
  49620. <dt><samp class="option">slide</samp></dt>
  49621. <dd><p>Set the output slide method. Allowed values are:
  49622. </p>
  49623. <dl class="table">
  49624. <dt><samp class="option">replace</samp></dt>
  49625. <dt><samp class="option">scroll</samp></dt>
  49626. <dt><samp class="option">frame</samp></dt>
  49627. </dl>
  49628. </dd>
  49629. <dt><samp class="option">direction</samp></dt>
  49630. <dd><p>Set the direction method for output slide method. Allowed values are:
  49631. </p>
  49632. <dl class="table">
  49633. <dt><samp class="option">lr</samp></dt>
  49634. <dd><p>Direction from left to right.
  49635. </p></dd>
  49636. <dt><samp class="option">rl</samp></dt>
  49637. <dd><p>Direction from right to left.
  49638. </p></dd>
  49639. <dt><samp class="option">ud</samp></dt>
  49640. <dd><p>Direction from up to down.
  49641. </p></dd>
  49642. <dt><samp class="option">du</samp></dt>
  49643. <dd><p>Direction from down to up.
  49644. </p></dd>
  49645. </dl>
  49646. </dd>
  49647. <dt><samp class="option">bar</samp></dt>
  49648. <dd><p>Set the ratio of bargraph display to display size. Default is 0.
  49649. </p>
  49650. </dd>
  49651. <dt><samp class="option">rotation</samp></dt>
  49652. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  49653. Default value is <code class="code">0</code>.
  49654. </p></dd>
  49655. </dl>
  49656. </div>
  49657. <div class="section-level-extent" id="showfreqs">
  49658. <h3 class="section"><span>37.24 showfreqs<a class="copiable-link" href="#showfreqs"> &para;</a></span></h3>
  49659. <p>Convert input audio to video output representing the audio power spectrum.
  49660. Audio amplitude is on Y-axis while frequency is on X-axis.
  49661. </p>
  49662. <p>The filter accepts the following options:
  49663. </p>
  49664. <dl class="table">
  49665. <dt><samp class="option">size, s</samp></dt>
  49666. <dd><p>Specify size of video. For the syntax of this option, check the
  49667. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  49668. Default is <code class="code">1024x512</code>.
  49669. </p>
  49670. </dd>
  49671. <dt><samp class="option">rate, r</samp></dt>
  49672. <dd><p>Set video rate. Default is <code class="code">25</code>.
  49673. </p>
  49674. </dd>
  49675. <dt><samp class="option">mode</samp></dt>
  49676. <dd><p>Set display mode.
  49677. This set how each frequency bin will be represented.
  49678. </p>
  49679. <p>It accepts the following values:
  49680. </p><dl class="table">
  49681. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  49682. <dt>&lsquo;<samp class="samp">bar</samp>&rsquo;</dt>
  49683. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  49684. </dl>
  49685. <p>Default is <code class="code">bar</code>.
  49686. </p>
  49687. </dd>
  49688. <dt><samp class="option">ascale</samp></dt>
  49689. <dd><p>Set amplitude scale.
  49690. </p>
  49691. <p>It accepts the following values:
  49692. </p><dl class="table">
  49693. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  49694. <dd><p>Linear scale.
  49695. </p>
  49696. </dd>
  49697. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  49698. <dd><p>Square root scale.
  49699. </p>
  49700. </dd>
  49701. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  49702. <dd><p>Cubic root scale.
  49703. </p>
  49704. </dd>
  49705. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  49706. <dd><p>Logarithmic scale.
  49707. </p></dd>
  49708. </dl>
  49709. <p>Default is <code class="code">log</code>.
  49710. </p>
  49711. </dd>
  49712. <dt><samp class="option">fscale</samp></dt>
  49713. <dd><p>Set frequency scale.
  49714. </p>
  49715. <p>It accepts the following values:
  49716. </p><dl class="table">
  49717. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  49718. <dd><p>Linear scale.
  49719. </p>
  49720. </dd>
  49721. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  49722. <dd><p>Logarithmic scale.
  49723. </p>
  49724. </dd>
  49725. <dt>&lsquo;<samp class="samp">rlog</samp>&rsquo;</dt>
  49726. <dd><p>Reverse logarithmic scale.
  49727. </p></dd>
  49728. </dl>
  49729. <p>Default is <code class="code">lin</code>.
  49730. </p>
  49731. </dd>
  49732. <dt><samp class="option">win_size</samp></dt>
  49733. <dd><p>Set window size. Allowed range is from 16 to 65536.
  49734. </p>
  49735. <p>Default is <code class="code">2048</code>
  49736. </p>
  49737. </dd>
  49738. <dt><samp class="option">win_func</samp></dt>
  49739. <dd><p>Set windowing function.
  49740. </p>
  49741. <p>It accepts the following values:
  49742. </p><dl class="table">
  49743. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  49744. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  49745. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  49746. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  49747. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  49748. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  49749. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  49750. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  49751. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  49752. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  49753. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  49754. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  49755. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  49756. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  49757. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  49758. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  49759. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  49760. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  49761. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  49762. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  49763. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  49764. </dl>
  49765. <p>Default is <code class="code">hanning</code>.
  49766. </p>
  49767. </dd>
  49768. <dt><samp class="option">overlap</samp></dt>
  49769. <dd><p>Set window overlap. In range <code class="code">[0, 1]</code>. Default is <code class="code">1</code>,
  49770. which means optimal overlap for selected window function will be picked.
  49771. </p>
  49772. </dd>
  49773. <dt><samp class="option">averaging</samp></dt>
  49774. <dd><p>Set time averaging. Setting this to 0 will display current maximal peaks.
  49775. Default is <code class="code">1</code>, which means time averaging is disabled.
  49776. </p>
  49777. </dd>
  49778. <dt><samp class="option">colors</samp></dt>
  49779. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  49780. draw channel frequencies. Unrecognized or missing colors will be replaced
  49781. by white color.
  49782. </p>
  49783. </dd>
  49784. <dt><samp class="option">cmode</samp></dt>
  49785. <dd><p>Set channel display mode.
  49786. </p>
  49787. <p>It accepts the following values:
  49788. </p><dl class="table">
  49789. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  49790. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  49791. </dl>
  49792. <p>Default is <code class="code">combined</code>.
  49793. </p>
  49794. </dd>
  49795. <dt><samp class="option">minamp</samp></dt>
  49796. <dd><p>Set minimum amplitude used in <code class="code">log</code> amplitude scaler.
  49797. </p>
  49798. </dd>
  49799. <dt><samp class="option">data</samp></dt>
  49800. <dd><p>Set data display mode.
  49801. </p>
  49802. <p>It accepts the following values:
  49803. </p><dl class="table">
  49804. <dt>&lsquo;<samp class="samp">magnitude</samp>&rsquo;</dt>
  49805. <dt>&lsquo;<samp class="samp">phase</samp>&rsquo;</dt>
  49806. <dt>&lsquo;<samp class="samp">delay</samp>&rsquo;</dt>
  49807. </dl>
  49808. <p>Default is <code class="code">magnitude</code>.
  49809. </p>
  49810. </dd>
  49811. <dt><samp class="option">channels</samp></dt>
  49812. <dd><p>Set channels to use when processing audio. By default all are processed.
  49813. </p></dd>
  49814. </dl>
  49815. </div>
  49816. <div class="section-level-extent" id="showspatial">
  49817. <h3 class="section"><span>37.25 showspatial<a class="copiable-link" href="#showspatial"> &para;</a></span></h3>
  49818. <p>Convert stereo input audio to a video output, representing the spatial relationship
  49819. between two channels.
  49820. </p>
  49821. <p>The filter accepts the following options:
  49822. </p>
  49823. <dl class="table">
  49824. <dt><samp class="option">size, s</samp></dt>
  49825. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  49826. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  49827. Default value is <code class="code">512x512</code>.
  49828. </p>
  49829. </dd>
  49830. <dt><samp class="option">win_size</samp></dt>
  49831. <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>.
  49832. </p>
  49833. </dd>
  49834. <dt><samp class="option">win_func</samp></dt>
  49835. <dd><p>Set window function.
  49836. </p>
  49837. <p>It accepts the following values:
  49838. </p><dl class="table">
  49839. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  49840. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  49841. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  49842. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  49843. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  49844. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  49845. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  49846. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  49847. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  49848. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  49849. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  49850. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  49851. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  49852. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  49853. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  49854. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  49855. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  49856. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  49857. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  49858. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  49859. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  49860. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  49861. </dl>
  49862. <p>Default value is <code class="code">hann</code>.
  49863. </p>
  49864. </dd>
  49865. <dt><samp class="option">rate, r</samp></dt>
  49866. <dd><p>Set output framerate.
  49867. </p></dd>
  49868. </dl>
  49869. <a class="anchor" id="showspectrum"></a></div>
  49870. <div class="section-level-extent" id="showspectrum-1">
  49871. <h3 class="section"><span>37.26 showspectrum<a class="copiable-link" href="#showspectrum-1"> &para;</a></span></h3>
  49872. <p>Convert input audio to a video output, representing the audio frequency
  49873. spectrum.
  49874. </p>
  49875. <p>The filter accepts the following options:
  49876. </p>
  49877. <dl class="table">
  49878. <dt><samp class="option">size, s</samp></dt>
  49879. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  49880. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  49881. Default value is <code class="code">640x512</code>.
  49882. </p>
  49883. </dd>
  49884. <dt><samp class="option">slide</samp></dt>
  49885. <dd><p>Specify how the spectrum should slide along the window.
  49886. </p>
  49887. <p>It accepts the following values:
  49888. </p><dl class="table">
  49889. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  49890. <dd><p>the samples start again on the left when they reach the right
  49891. </p></dd>
  49892. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  49893. <dd><p>the samples scroll from right to left
  49894. </p></dd>
  49895. <dt>&lsquo;<samp class="samp">fullframe</samp>&rsquo;</dt>
  49896. <dd><p>frames are only produced when the samples reach the right
  49897. </p></dd>
  49898. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  49899. <dd><p>the samples scroll from left to right
  49900. </p></dd>
  49901. <dt>&lsquo;<samp class="samp">lreplace</samp>&rsquo;</dt>
  49902. <dd><p>the samples start again on the right when they reach the left
  49903. </p></dd>
  49904. </dl>
  49905. <p>Default value is <code class="code">replace</code>.
  49906. </p>
  49907. </dd>
  49908. <dt><samp class="option">mode</samp></dt>
  49909. <dd><p>Specify display mode.
  49910. </p>
  49911. <p>It accepts the following values:
  49912. </p><dl class="table">
  49913. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  49914. <dd><p>all channels are displayed in the same row
  49915. </p></dd>
  49916. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  49917. <dd><p>all channels are displayed in separate rows
  49918. </p></dd>
  49919. </dl>
  49920. <p>Default value is &lsquo;<samp class="samp">combined</samp>&rsquo;.
  49921. </p>
  49922. </dd>
  49923. <dt><samp class="option">color</samp></dt>
  49924. <dd><p>Specify display color mode.
  49925. </p>
  49926. <p>It accepts the following values:
  49927. </p><dl class="table">
  49928. <dt>&lsquo;<samp class="samp">channel</samp>&rsquo;</dt>
  49929. <dd><p>each channel is displayed in a separate color
  49930. </p></dd>
  49931. <dt>&lsquo;<samp class="samp">intensity</samp>&rsquo;</dt>
  49932. <dd><p>each channel is displayed using the same color scheme
  49933. </p></dd>
  49934. <dt>&lsquo;<samp class="samp">rainbow</samp>&rsquo;</dt>
  49935. <dd><p>each channel is displayed using the rainbow color scheme
  49936. </p></dd>
  49937. <dt>&lsquo;<samp class="samp">moreland</samp>&rsquo;</dt>
  49938. <dd><p>each channel is displayed using the moreland color scheme
  49939. </p></dd>
  49940. <dt>&lsquo;<samp class="samp">nebulae</samp>&rsquo;</dt>
  49941. <dd><p>each channel is displayed using the nebulae color scheme
  49942. </p></dd>
  49943. <dt>&lsquo;<samp class="samp">fire</samp>&rsquo;</dt>
  49944. <dd><p>each channel is displayed using the fire color scheme
  49945. </p></dd>
  49946. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  49947. <dd><p>each channel is displayed using the fiery color scheme
  49948. </p></dd>
  49949. <dt>&lsquo;<samp class="samp">fruit</samp>&rsquo;</dt>
  49950. <dd><p>each channel is displayed using the fruit color scheme
  49951. </p></dd>
  49952. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  49953. <dd><p>each channel is displayed using the cool color scheme
  49954. </p></dd>
  49955. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  49956. <dd><p>each channel is displayed using the magma color scheme
  49957. </p></dd>
  49958. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  49959. <dd><p>each channel is displayed using the green color scheme
  49960. </p></dd>
  49961. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  49962. <dd><p>each channel is displayed using the viridis color scheme
  49963. </p></dd>
  49964. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  49965. <dd><p>each channel is displayed using the plasma color scheme
  49966. </p></dd>
  49967. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  49968. <dd><p>each channel is displayed using the cividis color scheme
  49969. </p></dd>
  49970. <dt>&lsquo;<samp class="samp">terrain</samp>&rsquo;</dt>
  49971. <dd><p>each channel is displayed using the terrain color scheme
  49972. </p></dd>
  49973. </dl>
  49974. <p>Default value is &lsquo;<samp class="samp">channel</samp>&rsquo;.
  49975. </p>
  49976. </dd>
  49977. <dt><samp class="option">scale</samp></dt>
  49978. <dd><p>Specify scale used for calculating intensity color values.
  49979. </p>
  49980. <p>It accepts the following values:
  49981. </p><dl class="table">
  49982. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  49983. <dd><p>linear
  49984. </p></dd>
  49985. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  49986. <dd><p>square root, default
  49987. </p></dd>
  49988. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  49989. <dd><p>cubic root
  49990. </p></dd>
  49991. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  49992. <dd><p>logarithmic
  49993. </p></dd>
  49994. <dt>&lsquo;<samp class="samp">4thrt</samp>&rsquo;</dt>
  49995. <dd><p>4th root
  49996. </p></dd>
  49997. <dt>&lsquo;<samp class="samp">5thrt</samp>&rsquo;</dt>
  49998. <dd><p>5th root
  49999. </p></dd>
  50000. </dl>
  50001. <p>Default value is &lsquo;<samp class="samp">sqrt</samp>&rsquo;.
  50002. </p>
  50003. </dd>
  50004. <dt><samp class="option">fscale</samp></dt>
  50005. <dd><p>Specify frequency scale.
  50006. </p>
  50007. <p>It accepts the following values:
  50008. </p><dl class="table">
  50009. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  50010. <dd><p>linear
  50011. </p></dd>
  50012. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  50013. <dd><p>logarithmic
  50014. </p></dd>
  50015. </dl>
  50016. <p>Default value is &lsquo;<samp class="samp">lin</samp>&rsquo;.
  50017. </p>
  50018. </dd>
  50019. <dt><samp class="option">saturation</samp></dt>
  50020. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  50021. alternative color scheme. <code class="code">0</code> is no saturation at all.
  50022. Saturation must be in [-10.0, 10.0] range.
  50023. Default value is <code class="code">1</code>.
  50024. </p>
  50025. </dd>
  50026. <dt><samp class="option">win_func</samp></dt>
  50027. <dd><p>Set window function.
  50028. </p>
  50029. <p>It accepts the following values:
  50030. </p><dl class="table">
  50031. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  50032. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  50033. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  50034. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  50035. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  50036. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  50037. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  50038. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  50039. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  50040. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  50041. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  50042. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  50043. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  50044. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  50045. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  50046. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  50047. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  50048. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  50049. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  50050. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  50051. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  50052. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  50053. </dl>
  50054. <p>Default value is <code class="code">hann</code>.
  50055. </p>
  50056. </dd>
  50057. <dt><samp class="option">orientation</samp></dt>
  50058. <dd><p>Set orientation of time vs frequency axis. Can be <code class="code">vertical</code> or
  50059. <code class="code">horizontal</code>. Default is <code class="code">vertical</code>.
  50060. </p>
  50061. </dd>
  50062. <dt><samp class="option">overlap</samp></dt>
  50063. <dd><p>Set ratio of overlap window. Default value is <code class="code">0</code>.
  50064. When value is <code class="code">1</code> overlap is set to recommended size for specific
  50065. window function currently used.
  50066. </p>
  50067. </dd>
  50068. <dt><samp class="option">gain</samp></dt>
  50069. <dd><p>Set scale gain for calculating intensity color values.
  50070. Default value is <code class="code">1</code>.
  50071. </p>
  50072. </dd>
  50073. <dt><samp class="option">data</samp></dt>
  50074. <dd><p>Set which data to display. Can be <code class="code">magnitude</code>, default or <code class="code">phase</code>,
  50075. or unwrapped phase: <code class="code">uphase</code>.
  50076. </p>
  50077. </dd>
  50078. <dt><samp class="option">rotation</samp></dt>
  50079. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  50080. Default value is <code class="code">0</code>.
  50081. </p>
  50082. </dd>
  50083. <dt><samp class="option">start</samp></dt>
  50084. <dd><p>Set start frequency from which to display spectrogram. Default is <code class="code">0</code>.
  50085. </p>
  50086. </dd>
  50087. <dt><samp class="option">stop</samp></dt>
  50088. <dd><p>Set stop frequency to which to display spectrogram. Default is <code class="code">0</code>.
  50089. </p>
  50090. </dd>
  50091. <dt><samp class="option">fps</samp></dt>
  50092. <dd><p>Set upper frame rate limit. Default is <code class="code">auto</code>, unlimited.
  50093. </p>
  50094. </dd>
  50095. <dt><samp class="option">legend</samp></dt>
  50096. <dd><p>Draw time and frequency axes and legends. Default is disabled.
  50097. </p>
  50098. </dd>
  50099. <dt><samp class="option">drange</samp></dt>
  50100. <dd><p>Set dynamic range used to calculate intensity color values. Default is 120 dBFS.
  50101. Allowed range is from 10 to 200.
  50102. </p>
  50103. </dd>
  50104. <dt><samp class="option">limit</samp></dt>
  50105. <dd><p>Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS.
  50106. Allowed range is from -100 to 100.
  50107. </p>
  50108. </dd>
  50109. <dt><samp class="option">opacity</samp></dt>
  50110. <dd><p>Set opacity strength when using pixel format output with alpha component.
  50111. </p></dd>
  50112. </dl>
  50113. <p>The usage is very similar to the showwaves filter; see the examples in that
  50114. section.
  50115. </p>
  50116. <ul class="mini-toc">
  50117. <li><a href="#Examples-186" accesskey="1">Examples</a></li>
  50118. </ul>
  50119. <div class="subsection-level-extent" id="Examples-186">
  50120. <h4 class="subsection"><span>37.26.1 Examples<a class="copiable-link" href="#Examples-186"> &para;</a></span></h4>
  50121. <ul class="itemize mark-bullet">
  50122. <li>Large window with logarithmic color scaling:
  50123. <div class="example">
  50124. <pre class="example-preformatted">showspectrum=s=1280x480:scale=log
  50125. </pre></div>
  50126. </li><li>Complete example for a colored and sliding spectrum per channel using <code class="command">ffplay</code>:
  50127. <div class="example">
  50128. <pre class="example-preformatted">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  50129. [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
  50130. </pre></div>
  50131. </li></ul>
  50132. </div>
  50133. </div>
  50134. <div class="section-level-extent" id="showspectrumpic">
  50135. <h3 class="section"><span>37.27 showspectrumpic<a class="copiable-link" href="#showspectrumpic"> &para;</a></span></h3>
  50136. <p>Convert input audio to a single video frame, representing the audio frequency
  50137. spectrum.
  50138. </p>
  50139. <p>The filter accepts the following options:
  50140. </p>
  50141. <dl class="table">
  50142. <dt><samp class="option">size, s</samp></dt>
  50143. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  50144. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  50145. Default value is <code class="code">4096x2048</code>.
  50146. </p>
  50147. </dd>
  50148. <dt><samp class="option">mode</samp></dt>
  50149. <dd><p>Specify display mode.
  50150. </p>
  50151. <p>It accepts the following values:
  50152. </p><dl class="table">
  50153. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  50154. <dd><p>all channels are displayed in the same row
  50155. </p></dd>
  50156. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  50157. <dd><p>all channels are displayed in separate rows
  50158. </p></dd>
  50159. </dl>
  50160. <p>Default value is &lsquo;<samp class="samp">combined</samp>&rsquo;.
  50161. </p>
  50162. </dd>
  50163. <dt><samp class="option">color</samp></dt>
  50164. <dd><p>Specify display color mode.
  50165. </p>
  50166. <p>It accepts the following values:
  50167. </p><dl class="table">
  50168. <dt>&lsquo;<samp class="samp">channel</samp>&rsquo;</dt>
  50169. <dd><p>each channel is displayed in a separate color
  50170. </p></dd>
  50171. <dt>&lsquo;<samp class="samp">intensity</samp>&rsquo;</dt>
  50172. <dd><p>each channel is displayed using the same color scheme
  50173. </p></dd>
  50174. <dt>&lsquo;<samp class="samp">rainbow</samp>&rsquo;</dt>
  50175. <dd><p>each channel is displayed using the rainbow color scheme
  50176. </p></dd>
  50177. <dt>&lsquo;<samp class="samp">moreland</samp>&rsquo;</dt>
  50178. <dd><p>each channel is displayed using the moreland color scheme
  50179. </p></dd>
  50180. <dt>&lsquo;<samp class="samp">nebulae</samp>&rsquo;</dt>
  50181. <dd><p>each channel is displayed using the nebulae color scheme
  50182. </p></dd>
  50183. <dt>&lsquo;<samp class="samp">fire</samp>&rsquo;</dt>
  50184. <dd><p>each channel is displayed using the fire color scheme
  50185. </p></dd>
  50186. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  50187. <dd><p>each channel is displayed using the fiery color scheme
  50188. </p></dd>
  50189. <dt>&lsquo;<samp class="samp">fruit</samp>&rsquo;</dt>
  50190. <dd><p>each channel is displayed using the fruit color scheme
  50191. </p></dd>
  50192. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  50193. <dd><p>each channel is displayed using the cool color scheme
  50194. </p></dd>
  50195. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  50196. <dd><p>each channel is displayed using the magma color scheme
  50197. </p></dd>
  50198. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  50199. <dd><p>each channel is displayed using the green color scheme
  50200. </p></dd>
  50201. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  50202. <dd><p>each channel is displayed using the viridis color scheme
  50203. </p></dd>
  50204. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  50205. <dd><p>each channel is displayed using the plasma color scheme
  50206. </p></dd>
  50207. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  50208. <dd><p>each channel is displayed using the cividis color scheme
  50209. </p></dd>
  50210. <dt>&lsquo;<samp class="samp">terrain</samp>&rsquo;</dt>
  50211. <dd><p>each channel is displayed using the terrain color scheme
  50212. </p></dd>
  50213. </dl>
  50214. <p>Default value is &lsquo;<samp class="samp">intensity</samp>&rsquo;.
  50215. </p>
  50216. </dd>
  50217. <dt><samp class="option">scale</samp></dt>
  50218. <dd><p>Specify scale used for calculating intensity color values.
  50219. </p>
  50220. <p>It accepts the following values:
  50221. </p><dl class="table">
  50222. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  50223. <dd><p>linear
  50224. </p></dd>
  50225. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  50226. <dd><p>square root, default
  50227. </p></dd>
  50228. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  50229. <dd><p>cubic root
  50230. </p></dd>
  50231. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  50232. <dd><p>logarithmic
  50233. </p></dd>
  50234. <dt>&lsquo;<samp class="samp">4thrt</samp>&rsquo;</dt>
  50235. <dd><p>4th root
  50236. </p></dd>
  50237. <dt>&lsquo;<samp class="samp">5thrt</samp>&rsquo;</dt>
  50238. <dd><p>5th root
  50239. </p></dd>
  50240. </dl>
  50241. <p>Default value is &lsquo;<samp class="samp">log</samp>&rsquo;.
  50242. </p>
  50243. </dd>
  50244. <dt><samp class="option">fscale</samp></dt>
  50245. <dd><p>Specify frequency scale.
  50246. </p>
  50247. <p>It accepts the following values:
  50248. </p><dl class="table">
  50249. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  50250. <dd><p>linear
  50251. </p></dd>
  50252. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  50253. <dd><p>logarithmic
  50254. </p></dd>
  50255. </dl>
  50256. <p>Default value is &lsquo;<samp class="samp">lin</samp>&rsquo;.
  50257. </p>
  50258. </dd>
  50259. <dt><samp class="option">saturation</samp></dt>
  50260. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  50261. alternative color scheme. <code class="code">0</code> is no saturation at all.
  50262. Saturation must be in [-10.0, 10.0] range.
  50263. Default value is <code class="code">1</code>.
  50264. </p>
  50265. </dd>
  50266. <dt><samp class="option">win_func</samp></dt>
  50267. <dd><p>Set window function.
  50268. </p>
  50269. <p>It accepts the following values:
  50270. </p><dl class="table">
  50271. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  50272. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  50273. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  50274. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  50275. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  50276. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  50277. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  50278. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  50279. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  50280. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  50281. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  50282. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  50283. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  50284. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  50285. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  50286. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  50287. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  50288. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  50289. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  50290. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  50291. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  50292. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  50293. </dl>
  50294. <p>Default value is <code class="code">hann</code>.
  50295. </p>
  50296. </dd>
  50297. <dt><samp class="option">orientation</samp></dt>
  50298. <dd><p>Set orientation of time vs frequency axis. Can be <code class="code">vertical</code> or
  50299. <code class="code">horizontal</code>. Default is <code class="code">vertical</code>.
  50300. </p>
  50301. </dd>
  50302. <dt><samp class="option">gain</samp></dt>
  50303. <dd><p>Set scale gain for calculating intensity color values.
  50304. Default value is <code class="code">1</code>.
  50305. </p>
  50306. </dd>
  50307. <dt><samp class="option">legend</samp></dt>
  50308. <dd><p>Draw time and frequency axes and legends. Default is enabled.
  50309. </p>
  50310. </dd>
  50311. <dt><samp class="option">rotation</samp></dt>
  50312. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  50313. Default value is <code class="code">0</code>.
  50314. </p>
  50315. </dd>
  50316. <dt><samp class="option">start</samp></dt>
  50317. <dd><p>Set start frequency from which to display spectrogram. Default is <code class="code">0</code>.
  50318. </p>
  50319. </dd>
  50320. <dt><samp class="option">stop</samp></dt>
  50321. <dd><p>Set stop frequency to which to display spectrogram. Default is <code class="code">0</code>.
  50322. </p>
  50323. </dd>
  50324. <dt><samp class="option">drange</samp></dt>
  50325. <dd><p>Set dynamic range used to calculate intensity color values. Default is 120 dBFS.
  50326. Allowed range is from 10 to 200.
  50327. </p>
  50328. </dd>
  50329. <dt><samp class="option">limit</samp></dt>
  50330. <dd><p>Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS.
  50331. Allowed range is from -100 to 100.
  50332. </p>
  50333. </dd>
  50334. <dt><samp class="option">opacity</samp></dt>
  50335. <dd><p>Set opacity strength when using pixel format output with alpha component.
  50336. </p></dd>
  50337. </dl>
  50338. <ul class="mini-toc">
  50339. <li><a href="#Examples-187" accesskey="1">Examples</a></li>
  50340. </ul>
  50341. <div class="subsection-level-extent" id="Examples-187">
  50342. <h4 class="subsection"><span>37.27.1 Examples<a class="copiable-link" href="#Examples-187"> &para;</a></span></h4>
  50343. <ul class="itemize mark-bullet">
  50344. <li>Extract an audio spectrogram of a whole audio track
  50345. in a 1024x1024 picture using <code class="command">ffmpeg</code>:
  50346. <div class="example">
  50347. <pre class="example-preformatted">ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
  50348. </pre></div>
  50349. </li></ul>
  50350. </div>
  50351. </div>
  50352. <div class="section-level-extent" id="showvolume">
  50353. <h3 class="section"><span>37.28 showvolume<a class="copiable-link" href="#showvolume"> &para;</a></span></h3>
  50354. <p>Convert input audio volume to a video output.
  50355. </p>
  50356. <p>The filter accepts the following options:
  50357. </p>
  50358. <dl class="table">
  50359. <dt><samp class="option">rate, r</samp></dt>
  50360. <dd><p>Set video rate.
  50361. </p>
  50362. </dd>
  50363. <dt><samp class="option">b</samp></dt>
  50364. <dd><p>Set border width, allowed range is [0, 5]. Default is 1.
  50365. </p>
  50366. </dd>
  50367. <dt><samp class="option">w</samp></dt>
  50368. <dd><p>Set channel width, allowed range is [80, 8192]. Default is 400.
  50369. </p>
  50370. </dd>
  50371. <dt><samp class="option">h</samp></dt>
  50372. <dd><p>Set channel height, allowed range is [1, 900]. Default is 20.
  50373. </p>
  50374. </dd>
  50375. <dt><samp class="option">f</samp></dt>
  50376. <dd><p>Set fade, allowed range is [0, 1]. Default is 0.95.
  50377. </p>
  50378. </dd>
  50379. <dt><samp class="option">c</samp></dt>
  50380. <dd><p>Set volume color expression.
  50381. </p>
  50382. <p>The expression can use the following variables:
  50383. </p>
  50384. <dl class="table">
  50385. <dt><samp class="option">VOLUME</samp></dt>
  50386. <dd><p>Current max volume of channel in dB.
  50387. </p>
  50388. </dd>
  50389. <dt><samp class="option">PEAK</samp></dt>
  50390. <dd><p>Current peak.
  50391. </p>
  50392. </dd>
  50393. <dt><samp class="option">CHANNEL</samp></dt>
  50394. <dd><p>Current channel number, starting from 0.
  50395. </p></dd>
  50396. </dl>
  50397. </dd>
  50398. <dt><samp class="option">t</samp></dt>
  50399. <dd><p>If set, displays channel names. Default is enabled.
  50400. </p>
  50401. </dd>
  50402. <dt><samp class="option">v</samp></dt>
  50403. <dd><p>If set, displays volume values. Default is enabled.
  50404. </p>
  50405. </dd>
  50406. <dt><samp class="option">o</samp></dt>
  50407. <dd><p>Set orientation, can be horizontal: <code class="code">h</code> or vertical: <code class="code">v</code>,
  50408. default is <code class="code">h</code>.
  50409. </p>
  50410. </dd>
  50411. <dt><samp class="option">s</samp></dt>
  50412. <dd><p>Set step size, allowed range is [0, 5]. Default is 0, which means
  50413. step is disabled.
  50414. </p>
  50415. </dd>
  50416. <dt><samp class="option">p</samp></dt>
  50417. <dd><p>Set background opacity, allowed range is [0, 1]. Default is 0.
  50418. </p>
  50419. </dd>
  50420. <dt><samp class="option">m</samp></dt>
  50421. <dd><p>Set metering mode, can be peak: <code class="code">p</code> or rms: <code class="code">r</code>,
  50422. default is <code class="code">p</code>.
  50423. </p>
  50424. </dd>
  50425. <dt><samp class="option">ds</samp></dt>
  50426. <dd><p>Set display scale, can be linear: <code class="code">lin</code> or log: <code class="code">log</code>,
  50427. default is <code class="code">lin</code>.
  50428. </p>
  50429. </dd>
  50430. <dt><samp class="option">dm</samp></dt>
  50431. <dd><p>In second.
  50432. If set to &gt; 0., display a line for the max level
  50433. in the previous seconds.
  50434. default is disabled: <code class="code">0.</code>
  50435. </p>
  50436. </dd>
  50437. <dt><samp class="option">dmc</samp></dt>
  50438. <dd><p>The color of the max line. Use when <code class="code">dm</code> option is set to &gt; 0.
  50439. default is: <code class="code">orange</code>
  50440. </p></dd>
  50441. </dl>
  50442. </div>
  50443. <div class="section-level-extent" id="showwaves">
  50444. <h3 class="section"><span>37.29 showwaves<a class="copiable-link" href="#showwaves"> &para;</a></span></h3>
  50445. <p>Convert input audio to a video output, representing the samples waves.
  50446. </p>
  50447. <p>The filter accepts the following options:
  50448. </p>
  50449. <dl class="table">
  50450. <dt><samp class="option">size, s</samp></dt>
  50451. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  50452. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  50453. Default value is <code class="code">600x240</code>.
  50454. </p>
  50455. </dd>
  50456. <dt><samp class="option">mode</samp></dt>
  50457. <dd><p>Set display mode.
  50458. </p>
  50459. <p>Available values are:
  50460. </p><dl class="table">
  50461. <dt>&lsquo;<samp class="samp">point</samp>&rsquo;</dt>
  50462. <dd><p>Draw a point for each sample.
  50463. </p>
  50464. </dd>
  50465. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  50466. <dd><p>Draw a vertical line for each sample.
  50467. </p>
  50468. </dd>
  50469. <dt>&lsquo;<samp class="samp">p2p</samp>&rsquo;</dt>
  50470. <dd><p>Draw a point for each sample and a line between them.
  50471. </p>
  50472. </dd>
  50473. <dt>&lsquo;<samp class="samp">cline</samp>&rsquo;</dt>
  50474. <dd><p>Draw a centered vertical line for each sample.
  50475. </p></dd>
  50476. </dl>
  50477. <p>Default value is <code class="code">point</code>.
  50478. </p>
  50479. </dd>
  50480. <dt><samp class="option">n</samp></dt>
  50481. <dd><p>Set the number of samples which are printed on the same column. A
  50482. larger value will decrease the frame rate. Must be a positive
  50483. integer. This option can be set only if the value for <var class="var">rate</var>
  50484. is not explicitly specified.
  50485. </p>
  50486. </dd>
  50487. <dt><samp class="option">rate, r</samp></dt>
  50488. <dd><p>Set the (approximate) output frame rate. This is done by setting the
  50489. option <var class="var">n</var>. Default value is &quot;25&quot;.
  50490. </p>
  50491. </dd>
  50492. <dt><samp class="option">split_channels</samp></dt>
  50493. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  50494. </p>
  50495. </dd>
  50496. <dt><samp class="option">colors</samp></dt>
  50497. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  50498. </p>
  50499. </dd>
  50500. <dt><samp class="option">scale</samp></dt>
  50501. <dd><p>Set amplitude scale.
  50502. </p>
  50503. <p>Available values are:
  50504. </p><dl class="table">
  50505. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  50506. <dd><p>Linear.
  50507. </p>
  50508. </dd>
  50509. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  50510. <dd><p>Logarithmic.
  50511. </p>
  50512. </dd>
  50513. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  50514. <dd><p>Square root.
  50515. </p>
  50516. </dd>
  50517. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  50518. <dd><p>Cubic root.
  50519. </p></dd>
  50520. </dl>
  50521. <p>Default is linear.
  50522. </p>
  50523. </dd>
  50524. <dt><samp class="option">draw</samp></dt>
  50525. <dd><p>Set the draw mode. This is mostly useful to set for high <var class="var">n</var>.
  50526. </p>
  50527. <p>Available values are:
  50528. </p><dl class="table">
  50529. <dt>&lsquo;<samp class="samp">scale</samp>&rsquo;</dt>
  50530. <dd><p>Scale pixel values for each drawn sample.
  50531. </p>
  50532. </dd>
  50533. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  50534. <dd><p>Draw every sample directly.
  50535. </p></dd>
  50536. </dl>
  50537. <p>Default value is <code class="code">scale</code>.
  50538. </p></dd>
  50539. </dl>
  50540. <ul class="mini-toc">
  50541. <li><a href="#Examples-188" accesskey="1">Examples</a></li>
  50542. </ul>
  50543. <div class="subsection-level-extent" id="Examples-188">
  50544. <h4 class="subsection"><span>37.29.1 Examples<a class="copiable-link" href="#Examples-188"> &para;</a></span></h4>
  50545. <ul class="itemize mark-bullet">
  50546. <li>Output the input file audio and the corresponding video representation
  50547. at the same time:
  50548. <div class="example">
  50549. <pre class="example-preformatted">amovie=a.mp3,asplit[out0],showwaves[out1]
  50550. </pre></div>
  50551. </li><li>Create a synthetic signal and show it with showwaves, forcing a
  50552. frame rate of 30 frames per second:
  50553. <div class="example">
  50554. <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]
  50555. </pre></div>
  50556. </li></ul>
  50557. </div>
  50558. </div>
  50559. <div class="section-level-extent" id="showwavespic">
  50560. <h3 class="section"><span>37.30 showwavespic<a class="copiable-link" href="#showwavespic"> &para;</a></span></h3>
  50561. <p>Convert input audio to a single video frame, representing the samples waves.
  50562. </p>
  50563. <p>The filter accepts the following options:
  50564. </p>
  50565. <dl class="table">
  50566. <dt><samp class="option">size, s</samp></dt>
  50567. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  50568. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  50569. Default value is <code class="code">600x240</code>.
  50570. </p>
  50571. </dd>
  50572. <dt><samp class="option">split_channels</samp></dt>
  50573. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  50574. </p>
  50575. </dd>
  50576. <dt><samp class="option">colors</samp></dt>
  50577. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  50578. </p>
  50579. </dd>
  50580. <dt><samp class="option">scale</samp></dt>
  50581. <dd><p>Set amplitude scale.
  50582. </p>
  50583. <p>Available values are:
  50584. </p><dl class="table">
  50585. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  50586. <dd><p>Linear.
  50587. </p>
  50588. </dd>
  50589. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  50590. <dd><p>Logarithmic.
  50591. </p>
  50592. </dd>
  50593. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  50594. <dd><p>Square root.
  50595. </p>
  50596. </dd>
  50597. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  50598. <dd><p>Cubic root.
  50599. </p></dd>
  50600. </dl>
  50601. <p>Default is linear.
  50602. </p>
  50603. </dd>
  50604. <dt><samp class="option">draw</samp></dt>
  50605. <dd><p>Set the draw mode.
  50606. </p>
  50607. <p>Available values are:
  50608. </p><dl class="table">
  50609. <dt>&lsquo;<samp class="samp">scale</samp>&rsquo;</dt>
  50610. <dd><p>Scale pixel values for each drawn sample.
  50611. </p>
  50612. </dd>
  50613. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  50614. <dd><p>Draw every sample directly.
  50615. </p></dd>
  50616. </dl>
  50617. <p>Default value is <code class="code">scale</code>.
  50618. </p>
  50619. </dd>
  50620. <dt><samp class="option">filter</samp></dt>
  50621. <dd><p>Set the filter mode.
  50622. </p>
  50623. <p>Available values are:
  50624. </p><dl class="table">
  50625. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  50626. <dd><p>Use average samples values for each drawn sample.
  50627. </p>
  50628. </dd>
  50629. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  50630. <dd><p>Use peak samples values for each drawn sample.
  50631. </p></dd>
  50632. </dl>
  50633. <p>Default value is <code class="code">average</code>.
  50634. </p></dd>
  50635. </dl>
  50636. <ul class="mini-toc">
  50637. <li><a href="#Examples-189" accesskey="1">Examples</a></li>
  50638. </ul>
  50639. <div class="subsection-level-extent" id="Examples-189">
  50640. <h4 class="subsection"><span>37.30.1 Examples<a class="copiable-link" href="#Examples-189"> &para;</a></span></h4>
  50641. <ul class="itemize mark-bullet">
  50642. <li>Extract a channel split representation of the wave form of a whole audio track
  50643. in a 1024x800 picture using <code class="command">ffmpeg</code>:
  50644. <div class="example">
  50645. <pre class="example-preformatted">ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
  50646. </pre></div>
  50647. </li></ul>
  50648. </div>
  50649. </div>
  50650. <div class="section-level-extent" id="sidedata_002c-asidedata">
  50651. <h3 class="section"><span>37.31 sidedata, asidedata<a class="copiable-link" href="#sidedata_002c-asidedata"> &para;</a></span></h3>
  50652. <p>Delete frame side data, or select frames based on it.
  50653. </p>
  50654. <p>This filter accepts the following options:
  50655. </p>
  50656. <dl class="table">
  50657. <dt><samp class="option">mode</samp></dt>
  50658. <dd><p>Set mode of operation of the filter.
  50659. </p>
  50660. <p>Can be one of the following:
  50661. </p>
  50662. <dl class="table">
  50663. <dt>&lsquo;<samp class="samp">select</samp>&rsquo;</dt>
  50664. <dd><p>Select every frame with side data of <code class="code">type</code>.
  50665. </p>
  50666. </dd>
  50667. <dt>&lsquo;<samp class="samp">delete</samp>&rsquo;</dt>
  50668. <dd><p>Delete side data of <code class="code">type</code>. If <code class="code">type</code> is not set, delete all side
  50669. data in the frame.
  50670. </p>
  50671. </dd>
  50672. </dl>
  50673. </dd>
  50674. <dt><samp class="option">type</samp></dt>
  50675. <dd><p>Set side data type used with all modes. Must be set for <code class="code">select</code> mode. For
  50676. the list of frame side data types, refer to the <code class="code">AVFrameSideDataType</code> enum
  50677. in <samp class="file">libavutil/frame.h</samp>. For example, to choose
  50678. <code class="code">AV_FRAME_DATA_PANSCAN</code> side data, you must specify <code class="code">PANSCAN</code>.
  50679. </p>
  50680. </dd>
  50681. </dl>
  50682. </div>
  50683. <div class="section-level-extent" id="spectrumsynth">
  50684. <h3 class="section"><span>37.32 spectrumsynth<a class="copiable-link" href="#spectrumsynth"> &para;</a></span></h3>
  50685. <p>Synthesize audio from 2 input video spectrums, first input stream represents
  50686. magnitude across time and second represents phase across time.
  50687. The filter will transform from frequency domain as displayed in videos back
  50688. to time domain as presented in audio output.
  50689. </p>
  50690. <p>This filter is primarily created for reversing processed <a class="ref" href="#showspectrum">showspectrum</a>
  50691. filter outputs, but can synthesize sound from other spectrograms too.
  50692. But in such case results are going to be poor if the phase data is not
  50693. available, because in such cases phase data need to be recreated, usually
  50694. it&rsquo;s just recreated from random noise.
  50695. For best results use gray only output (<code class="code">channel</code> color mode in
  50696. <a class="ref" href="#showspectrum">showspectrum</a> filter) and <code class="code">log</code> scale for magnitude video and
  50697. <code class="code">lin</code> scale for phase video. To produce phase, for 2nd video, use
  50698. <code class="code">data</code> option. Inputs videos should generally use <code class="code">fullframe</code>
  50699. slide mode as that saves resources needed for decoding video.
  50700. </p>
  50701. <p>The filter accepts the following options:
  50702. </p>
  50703. <dl class="table">
  50704. <dt><samp class="option">sample_rate</samp></dt>
  50705. <dd><p>Specify sample rate of output audio, the sample rate of audio from which
  50706. spectrum was generated may differ.
  50707. </p>
  50708. </dd>
  50709. <dt><samp class="option">channels</samp></dt>
  50710. <dd><p>Set number of channels represented in input video spectrums.
  50711. </p>
  50712. </dd>
  50713. <dt><samp class="option">scale</samp></dt>
  50714. <dd><p>Set scale which was used when generating magnitude input spectrum.
  50715. Can be <code class="code">lin</code> or <code class="code">log</code>. Default is <code class="code">log</code>.
  50716. </p>
  50717. </dd>
  50718. <dt><samp class="option">slide</samp></dt>
  50719. <dd><p>Set slide which was used when generating inputs spectrums.
  50720. Can be <code class="code">replace</code>, <code class="code">scroll</code>, <code class="code">fullframe</code> or <code class="code">rscroll</code>.
  50721. Default is <code class="code">fullframe</code>.
  50722. </p>
  50723. </dd>
  50724. <dt><samp class="option">win_func</samp></dt>
  50725. <dd><p>Set window function used for resynthesis.
  50726. </p>
  50727. </dd>
  50728. <dt><samp class="option">overlap</samp></dt>
  50729. <dd><p>Set window overlap. In range <code class="code">[0, 1]</code>. Default is <code class="code">1</code>,
  50730. which means optimal overlap for selected window function will be picked.
  50731. </p>
  50732. </dd>
  50733. <dt><samp class="option">orientation</samp></dt>
  50734. <dd><p>Set orientation of input videos. Can be <code class="code">vertical</code> or <code class="code">horizontal</code>.
  50735. Default is <code class="code">vertical</code>.
  50736. </p></dd>
  50737. </dl>
  50738. <ul class="mini-toc">
  50739. <li><a href="#Examples-190" accesskey="1">Examples</a></li>
  50740. </ul>
  50741. <div class="subsection-level-extent" id="Examples-190">
  50742. <h4 class="subsection"><span>37.32.1 Examples<a class="copiable-link" href="#Examples-190"> &para;</a></span></h4>
  50743. <ul class="itemize mark-bullet">
  50744. <li>First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate,
  50745. then resynthesize videos back to audio with spectrumsynth:
  50746. <div class="example">
  50747. <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
  50748. 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
  50749. ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
  50750. </pre></div>
  50751. </li></ul>
  50752. </div>
  50753. </div>
  50754. <div class="section-level-extent" id="split_002c-asplit">
  50755. <h3 class="section"><span>37.33 split, asplit<a class="copiable-link" href="#split_002c-asplit"> &para;</a></span></h3>
  50756. <p>Split input into several identical outputs.
  50757. </p>
  50758. <p><code class="code">asplit</code> works with audio input, <code class="code">split</code> with video.
  50759. </p>
  50760. <p>The filter accepts a single parameter which specifies the number of outputs. If
  50761. unspecified, it defaults to 2.
  50762. </p>
  50763. <ul class="mini-toc">
  50764. <li><a href="#Examples-191" accesskey="1">Examples</a></li>
  50765. </ul>
  50766. <div class="subsection-level-extent" id="Examples-191">
  50767. <h4 class="subsection"><span>37.33.1 Examples<a class="copiable-link" href="#Examples-191"> &para;</a></span></h4>
  50768. <ul class="itemize mark-bullet">
  50769. <li>Create two separate outputs from the same input:
  50770. <div class="example">
  50771. <pre class="example-preformatted">[in] split [out0][out1]
  50772. </pre></div>
  50773. </li><li>To create 3 or more outputs, you need to specify the number of
  50774. outputs, like in:
  50775. <div class="example">
  50776. <pre class="example-preformatted">[in] asplit=3 [out0][out1][out2]
  50777. </pre></div>
  50778. </li><li>Create two separate outputs from the same input, one cropped and
  50779. one padded:
  50780. <div class="example">
  50781. <pre class="example-preformatted">[in] split [splitout1][splitout2];
  50782. [splitout1] crop=100:100:0:0 [cropout];
  50783. [splitout2] pad=200:200:100:100 [padout];
  50784. </pre></div>
  50785. </li><li>Create 5 copies of the input audio with <code class="command">ffmpeg</code>:
  50786. <div class="example">
  50787. <pre class="example-preformatted">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
  50788. </pre></div>
  50789. </li></ul>
  50790. </div>
  50791. </div>
  50792. <div class="section-level-extent" id="zmq_002c-azmq">
  50793. <h3 class="section"><span>37.34 zmq, azmq<a class="copiable-link" href="#zmq_002c-azmq"> &para;</a></span></h3>
  50794. <p>Receive commands sent through a libzmq client, and forward them to
  50795. filters in the filtergraph.
  50796. </p>
  50797. <p><code class="code">zmq</code> and <code class="code">azmq</code> work as a pass-through filters. <code class="code">zmq</code>
  50798. must be inserted between two video filters, <code class="code">azmq</code> between two
  50799. audio filters. Both are capable to send messages to any filter type.
  50800. </p>
  50801. <p>To enable these filters you need to install the libzmq library and
  50802. headers and configure FFmpeg with <code class="code">--enable-libzmq</code>.
  50803. </p>
  50804. <p>For more information about libzmq see:
  50805. <a class="url" href="http://www.zeromq.org/">http://www.zeromq.org/</a>
  50806. </p>
  50807. <p>The <code class="code">zmq</code> and <code class="code">azmq</code> filters work as a libzmq server, which
  50808. receives messages sent through a network interface defined by the
  50809. <samp class="option">bind_address</samp> (or the abbreviation &quot;<samp class="option">b</samp>&quot;) option.
  50810. Default value of this option is <samp class="file">tcp://localhost:5555</samp>. You may
  50811. want to alter this value to your needs, but do not forget to escape any
  50812. &rsquo;:&rsquo; signs (see <a class="ref" href="#filtergraph-escaping">filtergraph escaping</a>).
  50813. </p>
  50814. <p>The received message must be in the form:
  50815. </p><div class="example">
  50816. <pre class="example-preformatted"><var class="var">TARGET</var> <var class="var">COMMAND</var> [<var class="var">ARG</var>]
  50817. </pre></div>
  50818. <p><var class="var">TARGET</var> specifies the target of the command, usually the name of
  50819. the filter class or a specific filter instance name. The default
  50820. filter instance name uses the pattern &lsquo;<samp class="samp">Parsed_&lt;filter_name&gt;_&lt;index&gt;</samp>&rsquo;,
  50821. but you can override this by using the &lsquo;<samp class="samp">filter_name@id</samp>&rsquo; syntax
  50822. (see <a class="ref" href="#Filtergraph-syntax">Filtergraph syntax</a>).
  50823. </p>
  50824. <p><var class="var">COMMAND</var> specifies the name of the command for the target filter.
  50825. </p>
  50826. <p><var class="var">ARG</var> is optional and specifies the optional argument list for the
  50827. given <var class="var">COMMAND</var>.
  50828. </p>
  50829. <p>Upon reception, the message is processed and the corresponding command
  50830. is injected into the filtergraph. Depending on the result, the filter
  50831. will send a reply to the client, adopting the format:
  50832. </p><div class="example">
  50833. <pre class="example-preformatted"><var class="var">ERROR_CODE</var> <var class="var">ERROR_REASON</var>
  50834. <var class="var">MESSAGE</var>
  50835. </pre></div>
  50836. <p><var class="var">MESSAGE</var> is optional.
  50837. </p>
  50838. <ul class="mini-toc">
  50839. <li><a href="#Examples-192" accesskey="1">Examples</a></li>
  50840. </ul>
  50841. <div class="subsection-level-extent" id="Examples-192">
  50842. <h4 class="subsection"><span>37.34.1 Examples<a class="copiable-link" href="#Examples-192"> &para;</a></span></h4>
  50843. <p>Look at <samp class="file">tools/zmqsend</samp> for an example of a zmq client which can
  50844. be used to send commands processed by these filters.
  50845. </p>
  50846. <p>Consider the following filtergraph generated by <code class="command">ffplay</code>.
  50847. In this example the last overlay filter has an instance name. All other
  50848. filters will have default instance names.
  50849. </p>
  50850. <div class="example">
  50851. <pre class="example-preformatted">ffplay -dumpgraph 1 -f lavfi &quot;
  50852. color=s=100x100:c=red [l];
  50853. color=s=100x100:c=blue [r];
  50854. nullsrc=s=200x100, zmq [bg];
  50855. [bg][l] overlay [bg+l];
  50856. [bg+l][r] overlay@my=x=100 &quot;
  50857. </pre></div>
  50858. <p>To change the color of the left side of the video, the following
  50859. command can be used:
  50860. </p><div class="example">
  50861. <pre class="example-preformatted">echo Parsed_color_0 c yellow | tools/zmqsend
  50862. </pre></div>
  50863. <p>To change the right side:
  50864. </p><div class="example">
  50865. <pre class="example-preformatted">echo Parsed_color_1 c pink | tools/zmqsend
  50866. </pre></div>
  50867. <p>To change the position of the right side:
  50868. </p><div class="example">
  50869. <pre class="example-preformatted">echo overlay@my x 150 | tools/zmqsend
  50870. </pre></div>
  50871. </div>
  50872. </div>
  50873. </div>
  50874. <div class="chapter-level-extent" id="Multimedia-Sources">
  50875. <h2 class="chapter"><span>38 Multimedia Sources<a class="copiable-link" href="#Multimedia-Sources"> &para;</a></span></h2>
  50876. <p>Below is a description of the currently available multimedia sources.
  50877. </p>
  50878. <ul class="mini-toc">
  50879. <li><a href="#amovie" accesskey="1">amovie</a></li>
  50880. <li><a href="#avsynctest" accesskey="2">avsynctest</a></li>
  50881. <li><a href="#movie-1" accesskey="3">movie</a></li>
  50882. </ul>
  50883. <div class="section-level-extent" id="amovie">
  50884. <h3 class="section"><span>38.1 amovie<a class="copiable-link" href="#amovie"> &para;</a></span></h3>
  50885. <p>This is the same as <a class="ref" href="#movie">movie</a> source, except it selects an audio
  50886. stream by default.
  50887. </p>
  50888. </div>
  50889. <div class="section-level-extent" id="avsynctest">
  50890. <h3 class="section"><span>38.2 avsynctest<a class="copiable-link" href="#avsynctest"> &para;</a></span></h3>
  50891. <p>Generate an Audio/Video Sync Test.
  50892. </p>
  50893. <p>Generated stream periodically shows flash video frame and emits beep in audio.
  50894. Useful to inspect A/V sync issues.
  50895. </p>
  50896. <p>It accepts the following options:
  50897. </p>
  50898. <dl class="table">
  50899. <dt><samp class="option">size, s</samp></dt>
  50900. <dd><p>Set output video size. Default value is <code class="code">hd720</code>.
  50901. </p>
  50902. </dd>
  50903. <dt><samp class="option">framerate, fr</samp></dt>
  50904. <dd><p>Set output video frame rate. Default value is <code class="code">30</code>.
  50905. </p>
  50906. </dd>
  50907. <dt><samp class="option">samplerate, sr</samp></dt>
  50908. <dd><p>Set output audio sample rate. Default value is <code class="code">44100</code>.
  50909. </p>
  50910. </dd>
  50911. <dt><samp class="option">amplitude, a</samp></dt>
  50912. <dd><p>Set output audio beep amplitude. Default value is <code class="code">0.7</code>.
  50913. </p>
  50914. </dd>
  50915. <dt><samp class="option">period, p</samp></dt>
  50916. <dd><p>Set output audio beep period in seconds. Default value is <code class="code">3</code>.
  50917. </p>
  50918. </dd>
  50919. <dt><samp class="option">delay, dl</samp></dt>
  50920. <dd><p>Set output video flash delay in number of frames. Default value is <code class="code">0</code>.
  50921. </p>
  50922. </dd>
  50923. <dt><samp class="option">cycle, c</samp></dt>
  50924. <dd><p>Enable cycling of video delays, by default is disabled.
  50925. </p>
  50926. </dd>
  50927. <dt><samp class="option">duration, d</samp></dt>
  50928. <dd><p>Set stream output duration. By default duration is unlimited.
  50929. </p>
  50930. </dd>
  50931. <dt><samp class="option">fg, bg, ag</samp></dt>
  50932. <dd><p>Set foreground/background/additional color.
  50933. </p></dd>
  50934. </dl>
  50935. <ul class="mini-toc">
  50936. <li><a href="#Commands-165" accesskey="1">Commands</a></li>
  50937. </ul>
  50938. <div class="subsection-level-extent" id="Commands-165">
  50939. <h4 class="subsection"><span>38.2.1 Commands<a class="copiable-link" href="#Commands-165"> &para;</a></span></h4>
  50940. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  50941. </p>
  50942. <a class="anchor" id="movie"></a></div>
  50943. </div>
  50944. <div class="section-level-extent" id="movie-1">
  50945. <h3 class="section"><span>38.3 movie<a class="copiable-link" href="#movie-1"> &para;</a></span></h3>
  50946. <p>Read audio and/or video stream(s) from a movie container.
  50947. </p>
  50948. <p>It accepts the following parameters:
  50949. </p>
  50950. <dl class="table">
  50951. <dt><samp class="option">filename</samp></dt>
  50952. <dd><p>The name of the resource to read (not necessarily a file; it can also be a
  50953. device or a stream accessed through some protocol).
  50954. </p>
  50955. </dd>
  50956. <dt><samp class="option">format_name, f</samp></dt>
  50957. <dd><p>Specifies the format assumed for the movie to read, and can be either
  50958. the name of a container or an input device. If not specified, the
  50959. format is guessed from <var class="var">movie_name</var> or by probing.
  50960. </p>
  50961. </dd>
  50962. <dt><samp class="option">seek_point, sp</samp></dt>
  50963. <dd><p>Specifies the seek point in seconds. The frames will be output
  50964. starting from this seek point. The parameter is evaluated with
  50965. <code class="code">av_strtod</code>, so the numerical value may be suffixed by an IS
  50966. postfix. The default value is &quot;0&quot;.
  50967. </p>
  50968. </dd>
  50969. <dt><samp class="option">streams, s</samp></dt>
  50970. <dd><p>Specifies the streams to read. Several streams can be specified,
  50971. separated by &quot;+&quot;. The source will then have as many outputs, in the
  50972. same order. The syntax is explained in the <a data-manual="ffmpeg" href="ffmpeg.html#Stream-specifiers">&quot;Stream specifiers&quot;
  50973. section in the ffmpeg manual</a>. Two special names, &quot;dv&quot; and &quot;da&quot; specify
  50974. respectively the default (best suited) video and audio stream. Default
  50975. is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
  50976. </p>
  50977. </dd>
  50978. <dt><samp class="option">stream_index, si</samp></dt>
  50979. <dd><p>Specifies the index of the video stream to read. If the value is -1,
  50980. the most suitable video stream will be automatically selected. The default
  50981. value is &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
  50982. audio instead of video.
  50983. </p>
  50984. </dd>
  50985. <dt><samp class="option">loop</samp></dt>
  50986. <dd><p>Specifies how many times to read the stream in sequence.
  50987. If the value is 0, the stream will be looped infinitely.
  50988. Default value is &quot;1&quot;.
  50989. </p>
  50990. <p>Note that when the movie is looped the source timestamps are not
  50991. changed, so it will generate non monotonically increasing timestamps.
  50992. </p>
  50993. </dd>
  50994. <dt><samp class="option">discontinuity</samp></dt>
  50995. <dd><p>Specifies the time difference between frames above which the point is
  50996. considered a timestamp discontinuity which is removed by adjusting the later
  50997. timestamps.
  50998. </p>
  50999. </dd>
  51000. <dt><samp class="option">dec_threads</samp></dt>
  51001. <dd><p>Specifies the number of threads for decoding
  51002. </p>
  51003. </dd>
  51004. <dt><samp class="option">format_opts</samp></dt>
  51005. <dd><p>Specify format options for the opened file. Format options can be specified
  51006. as a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;. The following example
  51007. shows how to add protocol_whitelist and protocol_blacklist options:
  51008. </p><div class="example">
  51009. <pre class="example-preformatted">ffplay -f lavfi
  51010. &quot;movie=filename='1.sdp':format_opts='protocol_whitelist=file,rtp,udp\:protocol_blacklist=http'&quot;
  51011. </pre></div>
  51012. </dd>
  51013. </dl>
  51014. <p>It allows overlaying a second video on top of the main input of
  51015. a filtergraph, as shown in this graph:
  51016. </p><div class="example">
  51017. <pre class="example-preformatted">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
  51018. ^
  51019. |
  51020. movie --&gt; scale--&gt; deltapts1 -------+
  51021. </pre></div>
  51022. <ul class="mini-toc">
  51023. <li><a href="#Examples-193" accesskey="1">Examples</a></li>
  51024. <li><a href="#Commands-166" accesskey="2">Commands</a></li>
  51025. </ul>
  51026. <div class="subsection-level-extent" id="Examples-193">
  51027. <h4 class="subsection"><span>38.3.1 Examples<a class="copiable-link" href="#Examples-193"> &para;</a></span></h4>
  51028. <ul class="itemize mark-bullet">
  51029. <li>Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it
  51030. on top of the input labelled &quot;in&quot;:
  51031. <div class="example">
  51032. <pre class="example-preformatted">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
  51033. [in] setpts=PTS-STARTPTS [main];
  51034. [main][over] overlay=16:16 [out]
  51035. </pre></div>
  51036. </li><li>Read from a video4linux2 device, and overlay it on top of the input
  51037. labelled &quot;in&quot;:
  51038. <div class="example">
  51039. <pre class="example-preformatted">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
  51040. [in] setpts=PTS-STARTPTS [main];
  51041. [main][over] overlay=16:16 [out]
  51042. </pre></div>
  51043. </li><li>Read the first video stream and the audio stream with id 0x81 from
  51044. dvd.vob; the video is connected to the pad named &quot;video&quot; and the audio is
  51045. connected to the pad named &quot;audio&quot;:
  51046. <div class="example">
  51047. <pre class="example-preformatted">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
  51048. </pre></div>
  51049. </li></ul>
  51050. </div>
  51051. <div class="subsection-level-extent" id="Commands-166">
  51052. <h4 class="subsection"><span>38.3.2 Commands<a class="copiable-link" href="#Commands-166"> &para;</a></span></h4>
  51053. <p>Both movie and amovie support the following commands:
  51054. </p><dl class="table">
  51055. <dt><samp class="option">seek</samp></dt>
  51056. <dd><p>Perform seek using &quot;av_seek_frame&quot;.
  51057. The syntax is: seek <var class="var">stream_index</var>|<var class="var">timestamp</var>|<var class="var">flags</var>
  51058. </p><ul class="itemize mark-bullet">
  51059. <li><var class="var">stream_index</var>: If stream_index is -1, a default
  51060. stream is selected, and <var class="var">timestamp</var> is automatically converted
  51061. from AV_TIME_BASE units to the stream specific time_base.
  51062. </li><li><var class="var">timestamp</var>: Timestamp in AVStream.time_base units
  51063. or, if no stream is specified, in AV_TIME_BASE units.
  51064. </li><li><var class="var">flags</var>: Flags which select direction and seeking mode.
  51065. </li></ul>
  51066. </dd>
  51067. <dt><samp class="option">get_duration</samp></dt>
  51068. <dd><p>Get movie duration in AV_TIME_BASE units.
  51069. </p>
  51070. </dd>
  51071. </dl>
  51072. </div>
  51073. </div>
  51074. </div>
  51075. <div class="chapter-level-extent" id="External-libraries">
  51076. <h2 class="chapter"><span>39 External libraries<a class="copiable-link" href="#External-libraries"> &para;</a></span></h2>
  51077. <p>FFmpeg can be hooked up with a number of external libraries to add support
  51078. for more formats. None of them are used by default, their use has to be
  51079. explicitly requested by passing the appropriate flags to
  51080. <code class="command">./configure</code>.
  51081. </p>
  51082. <ul class="mini-toc">
  51083. <li><a href="#Alliance-for-Open-Media-_0028AOM_0029" accesskey="1">Alliance for Open Media (AOM)</a></li>
  51084. <li><a href="#AMD-AMF_002fVCE" accesskey="2">AMD AMF/VCE</a></li>
  51085. <li><a href="#AviSynth" accesskey="3">AviSynth</a></li>
  51086. <li><a href="#Chromaprint" accesskey="4">Chromaprint</a></li>
  51087. <li><a href="#codec2" accesskey="5">codec2</a></li>
  51088. <li><a href="#dav1d" accesskey="6">dav1d</a></li>
  51089. <li><a href="#davs2" accesskey="7">davs2</a></li>
  51090. <li><a href="#uavs3d" accesskey="8">uavs3d</a></li>
  51091. <li><a href="#Game-Music-Emu" accesskey="9">Game Music Emu</a></li>
  51092. <li><a href="#Intel-QuickSync-Video">Intel QuickSync Video</a></li>
  51093. <li><a href="#Kvazaar">Kvazaar</a></li>
  51094. <li><a href="#LAME">LAME</a></li>
  51095. <li><a href="#libilbc-1">libilbc</a></li>
  51096. <li><a href="#libjxl">libjxl</a></li>
  51097. <li><a href="#libvpx">libvpx</a></li>
  51098. <li><a href="#ModPlug">ModPlug</a></li>
  51099. <li><a href="#OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries">OpenCORE, VisualOn, and Fraunhofer libraries</a></li>
  51100. <li><a href="#OpenH264">OpenH264</a></li>
  51101. <li><a href="#OpenJPEG">OpenJPEG</a></li>
  51102. <li><a href="#rav1e">rav1e</a></li>
  51103. <li><a href="#SVT_002dAV1">SVT-AV1</a></li>
  51104. <li><a href="#TwoLAME">TwoLAME</a></li>
  51105. <li><a href="#VapourSynth">VapourSynth</a></li>
  51106. <li><a href="#x264">x264</a></li>
  51107. <li><a href="#x265">x265</a></li>
  51108. <li><a href="#xavs">xavs</a></li>
  51109. <li><a href="#xavs2">xavs2</a></li>
  51110. <li><a href="#eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029">eXtra-fast Essential Video Encoder (XEVE)</a></li>
  51111. <li><a href="#eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029">eXtra-fast Essential Video Decoder (XEVD)</a></li>
  51112. <li><a href="#ZVBI">ZVBI</a></li>
  51113. </ul>
  51114. <div class="section-level-extent" id="Alliance-for-Open-Media-_0028AOM_0029">
  51115. <h3 class="section"><span>39.1 Alliance for Open Media (AOM)<a class="copiable-link" href="#Alliance-for-Open-Media-_0028AOM_0029"> &para;</a></span></h3>
  51116. <p>FFmpeg can make use of the AOM library for AV1 decoding and encoding.
  51117. </p>
  51118. <p>Go to <a class="url" href="http://aomedia.org/">http://aomedia.org/</a> and follow the instructions for
  51119. installing the library. Then pass <code class="code">--enable-libaom</code> to configure to
  51120. enable it.
  51121. </p>
  51122. </div>
  51123. <div class="section-level-extent" id="AMD-AMF_002fVCE">
  51124. <h3 class="section"><span>39.2 AMD AMF/VCE<a class="copiable-link" href="#AMD-AMF_002fVCE"> &para;</a></span></h3>
  51125. <p>FFmpeg can use the AMD Advanced Media Framework library
  51126. for accelerated H.264 and HEVC(only windows) encoding on hardware with Video Coding Engine (VCE).
  51127. </p>
  51128. <p>To enable support you must obtain the AMF framework header files(version 1.4.9+) from
  51129. <a class="url" href="https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git">https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git</a>.
  51130. </p>
  51131. <p>Create an <code class="code">AMF/</code> directory in the system include path.
  51132. Copy the contents of <code class="code">AMF/amf/public/include/</code> into that directory.
  51133. Then configure FFmpeg with <code class="code">--enable-amf</code>.
  51134. </p>
  51135. <p>Initialization of amf encoder occurs in this order:
  51136. 1) trying to initialize through dx11(only windows)
  51137. 2) trying to initialize through dx9(only windows)
  51138. 3) trying to initialize through vulkan
  51139. </p>
  51140. <p>To use h.264(AMD VCE) encoder on linux amdgru-pro version 19.20+ and amf-amdgpu-pro
  51141. package(amdgru-pro contains, but does not install automatically) are required.
  51142. </p>
  51143. <p>This driver can be installed using amdgpu-pro-install script in official amd driver archive.
  51144. </p>
  51145. </div>
  51146. <div class="section-level-extent" id="AviSynth">
  51147. <h3 class="section"><span>39.3 AviSynth<a class="copiable-link" href="#AviSynth"> &para;</a></span></h3>
  51148. <p>FFmpeg can read AviSynth scripts as input. To enable support, pass
  51149. <code class="code">--enable-avisynth</code> to configure after installing the headers
  51150. provided by <a class="url" href="https://github.com/AviSynth/AviSynthPlus">AviSynth+</a>.
  51151. AviSynth+ can be configured to install only the headers by either
  51152. passing <code class="code">-DHEADERS_ONLY:bool=on</code> to the normal CMake-based build
  51153. system, or by using the supplied <code class="code">GNUmakefile</code>.
  51154. </p>
  51155. <p>For Windows, supported AviSynth variants are
  51156. <a class="url" href="http://avisynth.nl">AviSynth 2.6 RC1 or higher</a> for 32-bit builds and
  51157. <a class="url" href="http://avisynth.nl/index.php/AviSynth+">AviSynth+ r1718 or higher</a> for 32-bit and 64-bit builds.
  51158. </p>
  51159. <p>For Linux, macOS, and BSD, the only supported AviSynth variant is
  51160. <a class="url" href="https://github.com/AviSynth/AviSynthPlus">AviSynth+</a>, starting with version 3.5.
  51161. </p>
  51162. <div class="info">
  51163. <p>In 2016, AviSynth+ added support for building with GCC. However, due to
  51164. the eccentricities of Windows&rsquo; calling conventions, 32-bit GCC builds
  51165. of AviSynth+ are not compatible with typical 32-bit builds of FFmpeg.
  51166. </p>
  51167. <p>By default, FFmpeg assumes compatibility with 32-bit MSVC builds of
  51168. AviSynth+ since that is the most widely-used and entrenched build
  51169. configuration. Users can override this and enable support for 32-bit
  51170. GCC builds of AviSynth+ by passing <code class="code">-DAVSC_WIN32_GCC32</code> to
  51171. <code class="code">--extra-cflags</code> when configuring FFmpeg.
  51172. </p>
  51173. <p>64-bit builds of FFmpeg are not affected, and can use either MSVC or
  51174. GCC builds of AviSynth+ without any special flags.
  51175. </p></div>
  51176. <div class="info">
  51177. <p>AviSynth(+) is loaded dynamically. Distributors can build FFmpeg
  51178. with <code class="code">--enable-avisynth</code>, and the binaries will work regardless
  51179. of the end user having AviSynth installed. If/when an end user
  51180. would like to use AviSynth scripts, then they can install AviSynth(+)
  51181. and FFmpeg will be able to find and use it to open scripts.
  51182. </p></div>
  51183. </div>
  51184. <div class="section-level-extent" id="Chromaprint">
  51185. <h3 class="section"><span>39.4 Chromaprint<a class="copiable-link" href="#Chromaprint"> &para;</a></span></h3>
  51186. <p>FFmpeg can make use of the Chromaprint library for generating audio fingerprints.
  51187. Pass <code class="code">--enable-chromaprint</code> to configure to
  51188. enable it. See <a class="url" href="https://acoustid.org/chromaprint">https://acoustid.org/chromaprint</a>.
  51189. </p>
  51190. </div>
  51191. <div class="section-level-extent" id="codec2">
  51192. <h3 class="section"><span>39.5 codec2<a class="copiable-link" href="#codec2"> &para;</a></span></h3>
  51193. <p>FFmpeg can make use of the codec2 library for codec2 decoding and encoding.
  51194. There is currently no native decoder, so libcodec2 must be used for decoding.
  51195. </p>
  51196. <p>Go to <a class="url" href="http://freedv.org/">http://freedv.org/</a>, download &quot;Codec 2 source archive&quot;.
  51197. Build and install using CMake. Debian users can install the libcodec2-dev package instead.
  51198. Once libcodec2 is installed you can pass <code class="code">--enable-libcodec2</code> to configure to enable it.
  51199. </p>
  51200. <p>The easiest way to use codec2 is with .c2 files, since they contain the mode information required for decoding.
  51201. To encode such a file, use a .c2 file extension and give the libcodec2 encoder the -mode option:
  51202. <code class="code">ffmpeg -i input.wav -mode 700C output.c2</code>.
  51203. Playback is as simple as <code class="code">ffplay output.c2</code>.
  51204. For a list of supported modes, run <code class="code">ffmpeg -h encoder=libcodec2</code>.
  51205. Raw codec2 files are also supported.
  51206. To make sense of them the mode in use needs to be specified as a format option:
  51207. <code class="code">ffmpeg -f codec2raw -mode 1300 -i input.raw output.wav</code>.
  51208. </p>
  51209. </div>
  51210. <div class="section-level-extent" id="dav1d">
  51211. <h3 class="section"><span>39.6 dav1d<a class="copiable-link" href="#dav1d"> &para;</a></span></h3>
  51212. <p>FFmpeg can make use of the dav1d library for AV1 video decoding.
  51213. </p>
  51214. <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
  51215. installing the library. Then pass <code class="code">--enable-libdav1d</code> to configure to enable it.
  51216. </p>
  51217. </div>
  51218. <div class="section-level-extent" id="davs2">
  51219. <h3 class="section"><span>39.7 davs2<a class="copiable-link" href="#davs2"> &para;</a></span></h3>
  51220. <p>FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video decoding.
  51221. </p>
  51222. <p>Go to <a class="url" href="https://github.com/pkuvcl/davs2">https://github.com/pkuvcl/davs2</a> and follow the instructions for
  51223. installing the library. Then pass <code class="code">--enable-libdavs2</code> to configure to
  51224. enable it.
  51225. </p>
  51226. <div class="info">
  51227. <p>libdavs2 is under the GNU Public License Version 2 or later
  51228. (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
  51229. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  51230. </p></div>
  51231. </div>
  51232. <div class="section-level-extent" id="uavs3d">
  51233. <h3 class="section"><span>39.8 uavs3d<a class="copiable-link" href="#uavs3d"> &para;</a></span></h3>
  51234. <p>FFmpeg can make use of the uavs3d library for AVS3-P2/IEEE1857.10 video decoding.
  51235. </p>
  51236. <p>Go to <a class="url" href="https://github.com/uavs3/uavs3d">https://github.com/uavs3/uavs3d</a> and follow the instructions for
  51237. installing the library. Then pass <code class="code">--enable-libuavs3d</code> to configure to
  51238. enable it.
  51239. </p>
  51240. </div>
  51241. <div class="section-level-extent" id="Game-Music-Emu">
  51242. <h3 class="section"><span>39.9 Game Music Emu<a class="copiable-link" href="#Game-Music-Emu"> &para;</a></span></h3>
  51243. <p>FFmpeg can make use of the Game Music Emu library to read audio from supported video game
  51244. music file formats. Pass <code class="code">--enable-libgme</code> to configure to
  51245. enable it. See <a class="url" href="https://bitbucket.org/mpyne/game-music-emu/overview">https://bitbucket.org/mpyne/game-music-emu/overview</a>.
  51246. </p>
  51247. </div>
  51248. <div class="section-level-extent" id="Intel-QuickSync-Video">
  51249. <h3 class="section"><span>39.10 Intel QuickSync Video<a class="copiable-link" href="#Intel-QuickSync-Video"> &para;</a></span></h3>
  51250. <p>FFmpeg can use Intel QuickSync Video (QSV) for accelerated decoding and encoding
  51251. of multiple codecs. To use QSV, FFmpeg must be linked against the <code class="code">libmfx</code>
  51252. dispatcher, which loads the actual decoding libraries.
  51253. </p>
  51254. <p>The dispatcher is open source and can be downloaded from
  51255. <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
  51256. with the <code class="code">--enable-libmfx</code> option and <code class="code">pkg-config</code> needs to be able to
  51257. locate the dispatcher&rsquo;s <code class="code">.pc</code> files.
  51258. </p>
  51259. </div>
  51260. <div class="section-level-extent" id="Kvazaar">
  51261. <h3 class="section"><span>39.11 Kvazaar<a class="copiable-link" href="#Kvazaar"> &para;</a></span></h3>
  51262. <p>FFmpeg can make use of the Kvazaar library for HEVC encoding.
  51263. </p>
  51264. <p>Go to <a class="url" href="https://github.com/ultravideo/kvazaar">https://github.com/ultravideo/kvazaar</a> and follow the
  51265. instructions for installing the library. Then pass
  51266. <code class="code">--enable-libkvazaar</code> to configure to enable it.
  51267. </p>
  51268. </div>
  51269. <div class="section-level-extent" id="LAME">
  51270. <h3 class="section"><span>39.12 LAME<a class="copiable-link" href="#LAME"> &para;</a></span></h3>
  51271. <p>FFmpeg can make use of the LAME library for MP3 encoding.
  51272. </p>
  51273. <p>Go to <a class="url" href="http://lame.sourceforge.net/">http://lame.sourceforge.net/</a> and follow the
  51274. instructions for installing the library.
  51275. Then pass <code class="code">--enable-libmp3lame</code> to configure to enable it.
  51276. </p>
  51277. </div>
  51278. <div class="section-level-extent" id="libilbc-1">
  51279. <h3 class="section"><span>39.13 libilbc<a class="copiable-link" href="#libilbc-1"> &para;</a></span></h3>
  51280. <p>iLBC is a narrowband speech codec that has been made freely available
  51281. by Google as part of the WebRTC project. libilbc is a packaging friendly
  51282. copy of the iLBC codec. FFmpeg can make use of the libilbc library for
  51283. iLBC decoding and encoding.
  51284. </p>
  51285. <p>Go to <a class="url" href="https://github.com/TimothyGu/libilbc">https://github.com/TimothyGu/libilbc</a> and follow the instructions for
  51286. installing the library. Then pass <code class="code">--enable-libilbc</code> to configure to
  51287. enable it.
  51288. </p>
  51289. </div>
  51290. <div class="section-level-extent" id="libjxl">
  51291. <h3 class="section"><span>39.14 libjxl<a class="copiable-link" href="#libjxl"> &para;</a></span></h3>
  51292. <p>JPEG XL is an image format intended to fully replace legacy JPEG for an extended
  51293. period of life. See <a class="url" href="https://jpegxl.info/">https://jpegxl.info/</a> for more information, and see
  51294. <a class="url" href="https://github.com/libjxl/libjxl">https://github.com/libjxl/libjxl</a> for the library source. You can pass
  51295. <code class="code">--enable-libjxl</code> to configure in order enable the libjxl wrapper.
  51296. </p>
  51297. </div>
  51298. <div class="section-level-extent" id="libvpx">
  51299. <h3 class="section"><span>39.15 libvpx<a class="copiable-link" href="#libvpx"> &para;</a></span></h3>
  51300. <p>FFmpeg can make use of the libvpx library for VP8/VP9 decoding and encoding.
  51301. </p>
  51302. <p>Go to <a class="url" href="http://www.webmproject.org/">http://www.webmproject.org/</a> and follow the instructions for
  51303. installing the library. Then pass <code class="code">--enable-libvpx</code> to configure to
  51304. enable it.
  51305. </p>
  51306. </div>
  51307. <div class="section-level-extent" id="ModPlug">
  51308. <h3 class="section"><span>39.16 ModPlug<a class="copiable-link" href="#ModPlug"> &para;</a></span></h3>
  51309. <p>FFmpeg can make use of this library, originating in Modplug-XMMS, to read from MOD-like music files.
  51310. 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
  51311. enable it.
  51312. </p>
  51313. </div>
  51314. <div class="section-level-extent" id="OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries">
  51315. <h3 class="section"><span>39.17 OpenCORE, VisualOn, and Fraunhofer libraries<a class="copiable-link" href="#OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries"> &para;</a></span></h3>
  51316. <p>Spun off Google Android sources, OpenCore, VisualOn and Fraunhofer
  51317. libraries provide encoders for a number of audio codecs.
  51318. </p>
  51319. <div class="info">
  51320. <p>OpenCORE and VisualOn libraries are under the Apache License 2.0
  51321. (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
  51322. incompatible to the LGPL version 2.1 and GPL version 2. You have to
  51323. upgrade FFmpeg&rsquo;s license to LGPL version 3 (or if you have enabled
  51324. GPL components, GPL version 3) by passing <code class="code">--enable-version3</code> to configure in
  51325. order to use it.
  51326. </p>
  51327. <p>The license of the Fraunhofer AAC library is incompatible with the GPL.
  51328. Therefore, for GPL builds, you have to pass <code class="code">--enable-nonfree</code> to
  51329. configure in order to use it. To the best of our knowledge, it is
  51330. compatible with the LGPL.
  51331. </p></div>
  51332. <ul class="mini-toc">
  51333. <li><a href="#OpenCORE-AMR" accesskey="1">OpenCORE AMR</a></li>
  51334. <li><a href="#VisualOn-AMR_002dWB-encoder-library" accesskey="2">VisualOn AMR-WB encoder library</a></li>
  51335. <li><a href="#Fraunhofer-AAC-library" accesskey="3">Fraunhofer AAC library</a></li>
  51336. </ul>
  51337. <div class="subsection-level-extent" id="OpenCORE-AMR">
  51338. <h4 class="subsection"><span>39.17.1 OpenCORE AMR<a class="copiable-link" href="#OpenCORE-AMR"> &para;</a></span></h4>
  51339. <p>FFmpeg can make use of the OpenCORE libraries for AMR-NB
  51340. decoding/encoding and AMR-WB decoding.
  51341. </p>
  51342. <p>Go to <a class="url" href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  51343. instructions for installing the libraries.
  51344. Then pass <code class="code">--enable-libopencore-amrnb</code> and/or
  51345. <code class="code">--enable-libopencore-amrwb</code> to configure to enable them.
  51346. </p>
  51347. </div>
  51348. <div class="subsection-level-extent" id="VisualOn-AMR_002dWB-encoder-library">
  51349. <h4 class="subsection"><span>39.17.2 VisualOn AMR-WB encoder library<a class="copiable-link" href="#VisualOn-AMR_002dWB-encoder-library"> &para;</a></span></h4>
  51350. <p>FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding.
  51351. </p>
  51352. <p>Go to <a class="url" href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  51353. instructions for installing the library.
  51354. Then pass <code class="code">--enable-libvo-amrwbenc</code> to configure to enable it.
  51355. </p>
  51356. </div>
  51357. <div class="subsection-level-extent" id="Fraunhofer-AAC-library">
  51358. <h4 class="subsection"><span>39.17.3 Fraunhofer AAC library<a class="copiable-link" href="#Fraunhofer-AAC-library"> &para;</a></span></h4>
  51359. <p>FFmpeg can make use of the Fraunhofer AAC library for AAC decoding &amp; encoding.
  51360. </p>
  51361. <p>Go to <a class="url" href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  51362. instructions for installing the library.
  51363. Then pass <code class="code">--enable-libfdk-aac</code> to configure to enable it.
  51364. </p>
  51365. </div>
  51366. </div>
  51367. <div class="section-level-extent" id="OpenH264">
  51368. <h3 class="section"><span>39.18 OpenH264<a class="copiable-link" href="#OpenH264"> &para;</a></span></h3>
  51369. <p>FFmpeg can make use of the OpenH264 library for H.264 decoding and encoding.
  51370. </p>
  51371. <p>Go to <a class="url" href="http://www.openh264.org/">http://www.openh264.org/</a> and follow the instructions for
  51372. installing the library. Then pass <code class="code">--enable-libopenh264</code> to configure to
  51373. enable it.
  51374. </p>
  51375. <p>For decoding, this library is much more limited than the built-in decoder
  51376. in libavcodec; currently, this library lacks support for decoding B-frames
  51377. and some other main/high profile features. (It currently only supports
  51378. constrained baseline profile and CABAC.) Using it is mostly useful for
  51379. testing and for taking advantage of Cisco&rsquo;s patent portfolio license
  51380. (<a class="url" href="http://www.openh264.org/BINARY_LICENSE.txt">http://www.openh264.org/BINARY_LICENSE.txt</a>).
  51381. </p>
  51382. </div>
  51383. <div class="section-level-extent" id="OpenJPEG">
  51384. <h3 class="section"><span>39.19 OpenJPEG<a class="copiable-link" href="#OpenJPEG"> &para;</a></span></h3>
  51385. <p>FFmpeg can use the OpenJPEG libraries for decoding/encoding J2K videos. Go to
  51386. <a class="url" href="http://www.openjpeg.org/">http://www.openjpeg.org/</a> to get the libraries and follow the installation
  51387. instructions. To enable using OpenJPEG in FFmpeg, pass <code class="code">--enable-libopenjpeg</code> to
  51388. <samp class="file">./configure</samp>.
  51389. </p>
  51390. </div>
  51391. <div class="section-level-extent" id="rav1e">
  51392. <h3 class="section"><span>39.20 rav1e<a class="copiable-link" href="#rav1e"> &para;</a></span></h3>
  51393. <p>FFmpeg can make use of rav1e (Rust AV1 Encoder) via its C bindings to encode videos.
  51394. Go to <a class="url" href="https://github.com/xiph/rav1e/">https://github.com/xiph/rav1e/</a> and follow the instructions to build
  51395. the C library. To enable using rav1e in FFmpeg, pass <code class="code">--enable-librav1e</code>
  51396. to <samp class="file">./configure</samp>.
  51397. </p>
  51398. </div>
  51399. <div class="section-level-extent" id="SVT_002dAV1">
  51400. <h3 class="section"><span>39.21 SVT-AV1<a class="copiable-link" href="#SVT_002dAV1"> &para;</a></span></h3>
  51401. <p>FFmpeg can make use of the Scalable Video Technology for AV1 library for AV1 encoding.
  51402. </p>
  51403. <p>Go to <a class="url" href="https://gitlab.com/AOMediaCodec/SVT-AV1/">https://gitlab.com/AOMediaCodec/SVT-AV1/</a> and follow the instructions
  51404. for installing the library. Then pass <code class="code">--enable-libsvtav1</code> to configure to
  51405. enable it.
  51406. </p>
  51407. </div>
  51408. <div class="section-level-extent" id="TwoLAME">
  51409. <h3 class="section"><span>39.22 TwoLAME<a class="copiable-link" href="#TwoLAME"> &para;</a></span></h3>
  51410. <p>FFmpeg can make use of the TwoLAME library for MP2 encoding.
  51411. </p>
  51412. <p>Go to <a class="url" href="http://www.twolame.org/">http://www.twolame.org/</a> and follow the
  51413. instructions for installing the library.
  51414. Then pass <code class="code">--enable-libtwolame</code> to configure to enable it.
  51415. </p>
  51416. </div>
  51417. <div class="section-level-extent" id="VapourSynth">
  51418. <h3 class="section"><span>39.23 VapourSynth<a class="copiable-link" href="#VapourSynth"> &para;</a></span></h3>
  51419. <p>FFmpeg can read VapourSynth scripts as input. To enable support, pass
  51420. <code class="code">--enable-vapoursynth</code> to configure. Vapoursynth is detected via
  51421. <code class="code">pkg-config</code>. Versions 42 or greater supported.
  51422. See <a class="url" href="http://www.vapoursynth.com/">http://www.vapoursynth.com/</a>.
  51423. </p>
  51424. <p>Due to security concerns, Vapoursynth scripts will not
  51425. be autodetected so the input format has to be forced. For ff* CLI tools,
  51426. add <code class="code">-f vapoursynth</code> before the input <code class="code">-i yourscript.vpy</code>.
  51427. </p>
  51428. </div>
  51429. <div class="section-level-extent" id="x264">
  51430. <h3 class="section"><span>39.24 x264<a class="copiable-link" href="#x264"> &para;</a></span></h3>
  51431. <p>FFmpeg can make use of the x264 library for H.264 encoding.
  51432. </p>
  51433. <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
  51434. instructions for installing the library. Then pass <code class="code">--enable-libx264</code> to
  51435. configure to enable it.
  51436. </p>
  51437. <div class="info">
  51438. <p>x264 is under the GNU Public License Version 2 or later
  51439. (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
  51440. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  51441. </p></div>
  51442. </div>
  51443. <div class="section-level-extent" id="x265">
  51444. <h3 class="section"><span>39.25 x265<a class="copiable-link" href="#x265"> &para;</a></span></h3>
  51445. <p>FFmpeg can make use of the x265 library for HEVC encoding.
  51446. </p>
  51447. <p>Go to <a class="url" href="http://x265.org/developers.html">http://x265.org/developers.html</a> and follow the instructions
  51448. for installing the library. Then pass <code class="code">--enable-libx265</code> to configure
  51449. to enable it.
  51450. </p>
  51451. <div class="info">
  51452. <p>x265 is under the GNU Public License Version 2 or later
  51453. (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
  51454. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  51455. </p></div>
  51456. </div>
  51457. <div class="section-level-extent" id="xavs">
  51458. <h3 class="section"><span>39.26 xavs<a class="copiable-link" href="#xavs"> &para;</a></span></h3>
  51459. <p>FFmpeg can make use of the xavs library for AVS encoding.
  51460. </p>
  51461. <p>Go to <a class="url" href="http://xavs.sf.net/">http://xavs.sf.net/</a> and follow the instructions for
  51462. installing the library. Then pass <code class="code">--enable-libxavs</code> to configure to
  51463. enable it.
  51464. </p>
  51465. </div>
  51466. <div class="section-level-extent" id="xavs2">
  51467. <h3 class="section"><span>39.27 xavs2<a class="copiable-link" href="#xavs2"> &para;</a></span></h3>
  51468. <p>FFmpeg can make use of the xavs2 library for AVS2-P2/IEEE1857.4 video encoding.
  51469. </p>
  51470. <p>Go to <a class="url" href="https://github.com/pkuvcl/xavs2">https://github.com/pkuvcl/xavs2</a> and follow the instructions for
  51471. installing the library. Then pass <code class="code">--enable-libxavs2</code> to configure to
  51472. enable it.
  51473. </p>
  51474. <div class="info">
  51475. <p>libxavs2 is under the GNU Public License Version 2 or later
  51476. (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
  51477. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  51478. </p></div>
  51479. </div>
  51480. <div class="section-level-extent" id="eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029">
  51481. <h3 class="section"><span>39.28 eXtra-fast Essential Video Encoder (XEVE)<a class="copiable-link" href="#eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029"> &para;</a></span></h3>
  51482. <p>FFmpeg can make use of the XEVE library for EVC video encoding.
  51483. </p>
  51484. <p>Go to <a class="url" href="https://github.com/mpeg5/xeve">https://github.com/mpeg5/xeve</a> and follow the instructions for
  51485. installing the XEVE library. Then pass <code class="code">--enable-libxeve</code> to configure to
  51486. enable it.
  51487. </p>
  51488. </div>
  51489. <div class="section-level-extent" id="eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029">
  51490. <h3 class="section"><span>39.29 eXtra-fast Essential Video Decoder (XEVD)<a class="copiable-link" href="#eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029"> &para;</a></span></h3>
  51491. <p>FFmpeg can make use of the XEVD library for EVC video decoding.
  51492. </p>
  51493. <p>Go to <a class="url" href="https://github.com/mpeg5/xevd">https://github.com/mpeg5/xevd</a> and follow the instructions for
  51494. installing the XEVD library. Then pass <code class="code">--enable-libxevd</code> to configure to
  51495. enable it.
  51496. </p>
  51497. </div>
  51498. <div class="section-level-extent" id="ZVBI">
  51499. <h3 class="section"><span>39.30 ZVBI<a class="copiable-link" href="#ZVBI"> &para;</a></span></h3>
  51500. <p>ZVBI is a VBI decoding library which can be used by FFmpeg to decode DVB
  51501. teletext pages and DVB teletext subtitles.
  51502. </p>
  51503. <p>Go to <a class="url" href="http://sourceforge.net/projects/zapping/">http://sourceforge.net/projects/zapping/</a> and follow the instructions for
  51504. installing the library. Then pass <code class="code">--enable-libzvbi</code> to configure to
  51505. enable it.
  51506. </p>
  51507. </div>
  51508. </div>
  51509. <div class="chapter-level-extent" id="Supported-File-Formats_002c-Codecs-or-Features">
  51510. <h2 class="chapter"><span>40 Supported File Formats, Codecs or Features<a class="copiable-link" href="#Supported-File-Formats_002c-Codecs-or-Features"> &para;</a></span></h2>
  51511. <p>You can use the <code class="code">-formats</code> and <code class="code">-codecs</code> options to have an exhaustive list.
  51512. </p>
  51513. <ul class="mini-toc">
  51514. <li><a href="#File-Formats" accesskey="1">File Formats</a></li>
  51515. <li><a href="#Image-Formats" accesskey="2">Image Formats</a></li>
  51516. <li><a href="#Video-Codecs" accesskey="3">Video Codecs</a></li>
  51517. <li><a href="#Audio-Codecs" accesskey="4">Audio Codecs</a></li>
  51518. <li><a href="#Subtitle-Formats" accesskey="5">Subtitle Formats</a></li>
  51519. <li><a href="#Network-Protocols" accesskey="6">Network Protocols</a></li>
  51520. <li><a href="#Input_002fOutput-Devices" accesskey="7">Input/Output Devices</a></li>
  51521. <li><a href="#Timecode" accesskey="8">Timecode</a></li>
  51522. </ul>
  51523. <div class="section-level-extent" id="File-Formats">
  51524. <h3 class="section"><span>40.1 File Formats<a class="copiable-link" href="#File-Formats"> &para;</a></span></h3>
  51525. <p>FFmpeg supports the following file formats through the <code class="code">libavformat</code>
  51526. library:
  51527. </p>
  51528. <table class="multitable">
  51529. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  51530. <tr><td width="40%">3dostr</td><td width="10%"></td><td width="10%">X</td></tr>
  51531. <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>
  51532. <tr><td width="40%">8088flex TMV</td><td width="10%"></td><td width="10%">X</td></tr>
  51533. <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>
  51534. <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>
  51535. <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>
  51536. <tr><td width="40%">Adobe Filmstrip</td><td width="10%">X</td><td width="10%">X</td></tr>
  51537. <tr><td width="40%">Audio IFF (AIFF)</td><td width="10%">X</td><td width="10%">X</td></tr>
  51538. <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>
  51539. <tr><td width="40%">3GPP AMR</td><td width="10%">X</td><td width="10%">X</td></tr>
  51540. <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>
  51541. <tr><td width="40%">Apple HTTP Live Streaming</td><td width="10%"></td><td width="10%">X</td></tr>
  51542. <tr><td width="40%">Artworx Data Format</td><td width="10%"></td><td width="10%">X</td></tr>
  51543. <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>
  51544. <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>
  51545. <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>
  51546. <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>
  51547. <tr><td width="40%">APNG</td><td width="10%">X</td><td width="10%">X</td></tr>
  51548. <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>
  51549. <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>
  51550. <tr><td width="40%">AVI</td><td width="10%">X</td><td width="10%">X</td></tr>
  51551. <tr><td width="40%">AviSynth</td><td width="10%"></td><td width="10%">X</td></tr>
  51552. <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>
  51553. <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>
  51554. <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>
  51555. <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>
  51556. <tr><td width="40%">Binary text</td><td width="10%"></td><td width="10%">X</td></tr>
  51557. <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>
  51558. <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>
  51559. <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>
  51560. <tr><td width="40%">BRP</td><td width="10%"></td><td width="10%">X</td><td width="40%">Argonaut Games format.</td></tr>
  51561. <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>
  51562. <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>
  51563. <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>
  51564. <tr><td width="40%">BW64</td><td width="10%"></td><td width="10%">X</td><td width="40%">Broadcast Wave 64bit.</td></tr>
  51565. <tr><td width="40%">BWF</td><td width="10%">X</td><td width="10%">X</td></tr>
  51566. <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>
  51567. <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>
  51568. <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>
  51569. <tr><td width="40%">CRI AIX</td><td width="10%"></td><td width="10%">X</td></tr>
  51570. <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>
  51571. <tr><td width="40%">Discworld II BMV</td><td width="10%"></td><td width="10%">X</td></tr>
  51572. <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>
  51573. <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>
  51574. <tr><td width="40%">Digital Speech Standard (DSS)</td><td width="10%"></td><td width="10%">X</td></tr>
  51575. <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>
  51576. <tr><td width="40%">Phantom Cine</td><td width="10%"></td><td width="10%">X</td></tr>
  51577. <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>
  51578. <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>
  51579. <tr><td width="40%">CRC testing format</td><td width="10%">X</td><td width="10%"></td></tr>
  51580. <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>
  51581. <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>
  51582. <tr><td width="40%">D-Cinema audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  51583. <tr><td width="40%">Deluxe Paint Animation</td><td width="10%"></td><td width="10%">X</td></tr>
  51584. <tr><td width="40%">DCSTR</td><td width="10%"></td><td width="10%">X</td></tr>
  51585. <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>
  51586. <tr><td width="40%">DirectDraw Surface</td><td width="10%"></td><td width="10%">X</td></tr>
  51587. <tr><td width="40%">DSD Stream File (DSF)</td><td width="10%"></td><td width="10%">X</td></tr>
  51588. <tr><td width="40%">DV video</td><td width="10%">X</td><td width="10%">X</td></tr>
  51589. <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
  51590. game and different game cutscenes repacked for use with ScummVM.</td></tr>
  51591. <tr><td width="40%">Electronic Arts cdata</td><td width="10%"></td><td width="10%">X</td></tr>
  51592. <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>
  51593. <tr><td width="40%">Ensoniq Paris Audio File</td><td width="10%"></td><td width="10%">X</td></tr>
  51594. <tr><td width="40%">FFM (FFserver live feed)</td><td width="10%">X</td><td width="10%">X</td></tr>
  51595. <tr><td width="40%">Flash (SWF)</td><td width="10%">X</td><td width="10%">X</td></tr>
  51596. <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>
  51597. <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>
  51598. <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>
  51599. <tr><td width="40%">framecrc testing format</td><td width="10%">X</td><td width="10%"></td></tr>
  51600. <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>
  51601. <tr><td width="40%">G.723.1</td><td width="10%">X</td><td width="10%">X</td></tr>
  51602. <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>
  51603. <tr><td width="40%">G.729 BIT</td><td width="10%">X</td><td width="10%">X</td></tr>
  51604. <tr><td width="40%">G.729 raw</td><td width="10%"></td><td width="10%">X</td></tr>
  51605. <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>
  51606. <tr><td width="40%">GIF Animation</td><td width="10%">X</td><td width="10%">X</td></tr>
  51607. <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
  51608. playout servers.</td></tr>
  51609. <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>
  51610. <tr><td width="40%">iCEDraw File</td><td width="10%"></td><td width="10%">X</td></tr>
  51611. <tr><td width="40%">ICO</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Microsoft Windows ICO</td></tr>
  51612. <tr><td width="40%">id Quake II CIN video</td><td width="10%"></td><td width="10%">X</td></tr>
  51613. <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>
  51614. <tr><td width="40%">IEC61937 encapsulation</td><td width="10%">X</td><td width="10%">X</td></tr>
  51615. <tr><td width="40%">IFF</td><td width="10%"></td><td width="10%">X</td><td width="40%">Interchange File Format</td></tr>
  51616. <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>
  51617. <tr><td width="40%">iLBC</td><td width="10%">X</td><td width="10%">X</td></tr>
  51618. <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>
  51619. <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>
  51620. <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>
  51621. <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>
  51622. <tr><td width="40%">Internet Video Recording</td><td width="10%"></td><td width="10%">X</td></tr>
  51623. <tr><td width="40%">IRCAM</td><td width="10%">X</td><td width="10%">X</td></tr>
  51624. <tr><td width="40%">LAF</td><td width="10%"></td><td width="10%">X</td><td width="40%">Limitless Audio Format</td></tr>
  51625. <tr><td width="40%">LATM</td><td width="10%">X</td><td width="10%">X</td></tr>
  51626. <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>
  51627. <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>
  51628. <tr><td width="40%">LRC</td><td width="10%">X</td><td width="10%">X</td></tr>
  51629. <tr><td width="40%">LVF</td><td width="10%"></td><td width="10%">X</td></tr>
  51630. <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>
  51631. <tr><td width="40%">Magic Lantern Video (MLV)</td><td width="10%"></td><td width="10%">X</td></tr>
  51632. <tr><td width="40%">Matroska</td><td width="10%">X</td><td width="10%">X</td></tr>
  51633. <tr><td width="40%">Matroska audio</td><td width="10%">X</td><td width="10%"></td></tr>
  51634. <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>
  51635. <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>
  51636. <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>
  51637. <tr><td width="40%">MD Studio</td><td width="10%"></td><td width="10%">X</td></tr>
  51638. <tr><td width="40%">Metal Gear Solid: The Twin Snakes</td><td width="10%"></td><td width="10%">X</td></tr>
  51639. <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>
  51640. <tr><td width="40%">MobiClip MODS</td><td width="10%"></td><td width="10%">X</td></tr>
  51641. <tr><td width="40%">MobiClip MOFLEX</td><td width="10%"></td><td width="10%">X</td></tr>
  51642. <tr><td width="40%">Mobotix .mxg</td><td width="10%"></td><td width="10%">X</td></tr>
  51643. <tr><td width="40%">Monkey&rsquo;s Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  51644. <tr><td width="40%">Motion Pixels MVI</td><td width="10%"></td><td width="10%">X</td></tr>
  51645. <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>
  51646. <tr><td width="40%">MP2</td><td width="10%">X</td><td width="10%">X</td></tr>
  51647. <tr><td width="40%">MP3</td><td width="10%">X</td><td width="10%">X</td></tr>
  51648. <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>
  51649. <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>
  51650. <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>
  51651. <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>
  51652. <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>
  51653. <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>
  51654. <tr><td width="40%">MIDI Sample Dump Standard</td><td width="10%"></td><td width="10%">X</td></tr>
  51655. <tr><td width="40%">MIME multipart JPEG</td><td width="10%">X</td><td width="10%"></td></tr>
  51656. <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>
  51657. <tr><td width="40%">MTV</td><td width="10%"></td><td width="10%">X</td></tr>
  51658. <tr><td width="40%">Musepack</td><td width="10%"></td><td width="10%">X</td></tr>
  51659. <tr><td width="40%">Musepack SV8</td><td width="10%"></td><td width="10%">X</td></tr>
  51660. <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>
  51661. <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>
  51662. <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>
  51663. <tr><td width="40%">NIST SPeech HEader REsources</td><td width="10%"></td><td width="10%">X</td></tr>
  51664. <tr><td width="40%">Computerized Speech Lab NSP</td><td width="10%"></td><td width="10%">X</td></tr>
  51665. <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>
  51666. <tr><td width="40%">Nullsoft Streaming Video</td><td width="10%"></td><td width="10%">X</td></tr>
  51667. <tr><td width="40%">NuppelVideo</td><td width="10%"></td><td width="10%">X</td></tr>
  51668. <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>
  51669. <tr><td width="40%">Ogg</td><td width="10%">X</td><td width="10%">X</td></tr>
  51670. <tr><td width="40%">Playstation Portable PMP</td><td width="10%"></td><td width="10%">X</td></tr>
  51671. <tr><td width="40%">Portable Voice Format</td><td width="10%"></td><td width="10%">X</td></tr>
  51672. <tr><td width="40%">RK Audio (RKA)</td><td width="10%"></td><td width="10%">X</td></tr>
  51673. <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>
  51674. <tr><td width="40%">QCP</td><td width="10%"></td><td width="10%">X</td></tr>
  51675. <tr><td width="40%">raw ADTS (AAC)</td><td width="10%">X</td><td width="10%">X</td></tr>
  51676. <tr><td width="40%">raw AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  51677. <tr><td width="40%">raw AMR-NB</td><td width="10%"></td><td width="10%">X</td></tr>
  51678. <tr><td width="40%">raw AMR-WB</td><td width="10%"></td><td width="10%">X</td></tr>
  51679. <tr><td width="40%">raw APAC</td><td width="10%"></td><td width="10%">X</td></tr>
  51680. <tr><td width="40%">raw aptX</td><td width="10%">X</td><td width="10%">X</td></tr>
  51681. <tr><td width="40%">raw aptX HD</td><td width="10%">X</td><td width="10%">X</td></tr>
  51682. <tr><td width="40%">raw Bonk</td><td width="10%"></td><td width="10%">X</td></tr>
  51683. <tr><td width="40%">raw Chinese AVS video</td><td width="10%">X</td><td width="10%">X</td></tr>
  51684. <tr><td width="40%">raw DFPWM</td><td width="10%">X</td><td width="10%">X</td></tr>
  51685. <tr><td width="40%">raw Dirac</td><td width="10%">X</td><td width="10%">X</td></tr>
  51686. <tr><td width="40%">raw DNxHD</td><td width="10%">X</td><td width="10%">X</td></tr>
  51687. <tr><td width="40%">raw DTS</td><td width="10%">X</td><td width="10%">X</td></tr>
  51688. <tr><td width="40%">raw DTS-HD</td><td width="10%"></td><td width="10%">X</td></tr>
  51689. <tr><td width="40%">raw E-AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  51690. <tr><td width="40%">raw EVC</td><td width="10%">X</td><td width="10%">X</td></tr>
  51691. <tr><td width="40%">raw FLAC</td><td width="10%">X</td><td width="10%">X</td></tr>
  51692. <tr><td width="40%">raw GSM</td><td width="10%"></td><td width="10%">X</td></tr>
  51693. <tr><td width="40%">raw H.261</td><td width="10%">X</td><td width="10%">X</td></tr>
  51694. <tr><td width="40%">raw H.263</td><td width="10%">X</td><td width="10%">X</td></tr>
  51695. <tr><td width="40%">raw H.264</td><td width="10%">X</td><td width="10%">X</td></tr>
  51696. <tr><td width="40%">raw HEVC</td><td width="10%">X</td><td width="10%">X</td></tr>
  51697. <tr><td width="40%">raw Ingenient MJPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  51698. <tr><td width="40%">raw MJPEG</td><td width="10%">X</td><td width="10%">X</td></tr>
  51699. <tr><td width="40%">raw MLP</td><td width="10%"></td><td width="10%">X</td></tr>
  51700. <tr><td width="40%">raw MPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  51701. <tr><td width="40%">raw MPEG-1</td><td width="10%"></td><td width="10%">X</td></tr>
  51702. <tr><td width="40%">raw MPEG-2</td><td width="10%"></td><td width="10%">X</td></tr>
  51703. <tr><td width="40%">raw MPEG-4</td><td width="10%">X</td><td width="10%">X</td></tr>
  51704. <tr><td width="40%">raw NULL</td><td width="10%">X</td><td width="10%"></td></tr>
  51705. <tr><td width="40%">raw video</td><td width="10%">X</td><td width="10%">X</td></tr>
  51706. <tr><td width="40%">raw id RoQ</td><td width="10%">X</td><td width="10%"></td></tr>
  51707. <tr><td width="40%">raw OBU</td><td width="10%">X</td><td width="10%">X</td></tr>
  51708. <tr><td width="40%">raw OSQ</td><td width="10%"></td><td width="10%">X</td></tr>
  51709. <tr><td width="40%">raw SBC</td><td width="10%">X</td><td width="10%">X</td></tr>
  51710. <tr><td width="40%">raw Shorten</td><td width="10%"></td><td width="10%">X</td></tr>
  51711. <tr><td width="40%">raw TAK</td><td width="10%"></td><td width="10%">X</td></tr>
  51712. <tr><td width="40%">raw TrueHD</td><td width="10%">X</td><td width="10%">X</td></tr>
  51713. <tr><td width="40%">raw VC-1</td><td width="10%">X</td><td width="10%">X</td></tr>
  51714. <tr><td width="40%">raw PCM A-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  51715. <tr><td width="40%">raw PCM mu-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  51716. <tr><td width="40%">raw PCM Archimedes VIDC</td><td width="10%">X</td><td width="10%">X</td></tr>
  51717. <tr><td width="40%">raw PCM signed 8 bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  51718. <tr><td width="40%">raw PCM signed 16 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51719. <tr><td width="40%">raw PCM signed 16 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51720. <tr><td width="40%">raw PCM signed 24 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51721. <tr><td width="40%">raw PCM signed 24 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51722. <tr><td width="40%">raw PCM signed 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51723. <tr><td width="40%">raw PCM signed 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51724. <tr><td width="40%">raw PCM signed 64 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51725. <tr><td width="40%">raw PCM signed 64 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51726. <tr><td width="40%">raw PCM unsigned 8 bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  51727. <tr><td width="40%">raw PCM unsigned 16 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51728. <tr><td width="40%">raw PCM unsigned 16 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51729. <tr><td width="40%">raw PCM unsigned 24 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51730. <tr><td width="40%">raw PCM unsigned 24 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51731. <tr><td width="40%">raw PCM unsigned 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51732. <tr><td width="40%">raw PCM unsigned 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51733. <tr><td width="40%">raw PCM 16.8 floating point little-endian</td><td width="10%"></td><td width="10%">X</td></tr>
  51734. <tr><td width="40%">raw PCM 24.0 floating point little-endian</td><td width="10%"></td><td width="10%">X</td></tr>
  51735. <tr><td width="40%">raw PCM floating-point 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51736. <tr><td width="40%">raw PCM floating-point 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51737. <tr><td width="40%">raw PCM floating-point 64 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51738. <tr><td width="40%">raw PCM floating-point 64 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  51739. <tr><td width="40%">RDT</td><td width="10%"></td><td width="10%">X</td></tr>
  51740. <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>
  51741. <tr><td width="40%">RealMedia</td><td width="10%">X</td><td width="10%">X</td></tr>
  51742. <tr><td width="40%">Redirector</td><td width="10%"></td><td width="10%">X</td></tr>
  51743. <tr><td width="40%">RedSpark</td><td width="10%"></td><td width="10%">X</td></tr>
  51744. <tr><td width="40%">Renderware TeXture Dictionary</td><td width="10%"></td><td width="10%">X</td></tr>
  51745. <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>
  51746. <tr><td width="40%">RF64</td><td width="10%"></td><td width="10%">X</td></tr>
  51747. <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>
  51748. <tr><td width="40%">RPL/ARMovie</td><td width="10%"></td><td width="10%">X</td></tr>
  51749. <tr><td width="40%">Lego Mindstorms RSO</td><td width="10%">X</td><td width="10%">X</td></tr>
  51750. <tr><td width="40%">RSD</td><td width="10%"></td><td width="10%">X</td></tr>
  51751. <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>
  51752. <tr><td width="40%">RTP</td><td width="10%">X</td><td width="10%">X</td></tr>
  51753. <tr><td width="40%">RTSP</td><td width="10%">X</td><td width="10%">X</td></tr>
  51754. <tr><td width="40%">Sample Dump eXchange</td><td width="10%"></td><td width="10%">X</td></tr>
  51755. <tr><td width="40%">SAP</td><td width="10%">X</td><td width="10%">X</td></tr>
  51756. <tr><td width="40%">SBG</td><td width="10%"></td><td width="10%">X</td></tr>
  51757. <tr><td width="40%">SDNS</td><td width="10%"></td><td width="10%">X</td></tr>
  51758. <tr><td width="40%">SDP</td><td width="10%"></td><td width="10%">X</td></tr>
  51759. <tr><td width="40%">SER</td><td width="10%"></td><td width="10%">X</td></tr>
  51760. <tr><td width="40%">Digital Pictures SGA</td><td width="10%"></td><td width="10%">X</td></tr>
  51761. <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>
  51762. <tr><td width="40%">Silicon Graphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  51763. <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>
  51764. <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>
  51765. <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>
  51766. <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>
  51767. <tr><td width="40%">SMPTE 337M encapsulation</td><td width="10%"></td><td width="10%">X</td></tr>
  51768. <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>
  51769. <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>
  51770. <tr><td width="40%">Sony PlayStation STR</td><td width="10%"></td><td width="10%">X</td></tr>
  51771. <tr><td width="40%">Sony Wave64 (W64)</td><td width="10%">X</td><td width="10%">X</td></tr>
  51772. <tr><td width="40%">SoX native format</td><td width="10%">X</td><td width="10%">X</td></tr>
  51773. <tr><td width="40%">SUN AU format</td><td width="10%">X</td><td width="10%">X</td></tr>
  51774. <tr><td width="40%">SUP raw PGS subtitles</td><td width="10%">X</td><td width="10%">X</td></tr>
  51775. <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>
  51776. <tr><td width="40%">TDSC</td><td width="10%"></td><td width="10%">X</td></tr>
  51777. <tr><td width="40%">Text files</td><td width="10%"></td><td width="10%">X</td></tr>
  51778. <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>
  51779. <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>
  51780. <tr><td width="40%">True Audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  51781. <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>
  51782. <tr><td width="40%">VC-1 test bitstream</td><td width="10%">X</td><td width="10%">X</td></tr>
  51783. <tr><td width="40%">Vidvox Hap</td><td width="10%">X</td><td width="10%">X</td></tr>
  51784. <tr><td width="40%">Vivo</td><td width="10%"></td><td width="10%">X</td></tr>
  51785. <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>
  51786. <tr><td width="40%">Marble WADY</td><td width="10%"></td><td width="10%">X</td></tr>
  51787. <tr><td width="40%">WAV</td><td width="10%">X</td><td width="10%">X</td></tr>
  51788. <tr><td width="40%">Waveform Archiver</td><td width="10%"></td><td width="10%">X</td></tr>
  51789. <tr><td width="40%">WavPack</td><td width="10%">X</td><td width="10%">X</td></tr>
  51790. <tr><td width="40%">WebM</td><td width="10%">X</td><td width="10%">X</td></tr>
  51791. <tr><td width="40%">Windows Televison (WTV)</td><td width="10%">X</td><td width="10%">X</td></tr>
  51792. <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>
  51793. <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>
  51794. <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>
  51795. <tr><td width="40%">Wideband Single-bit Data (WSD)</td><td width="10%"></td><td width="10%">X</td></tr>
  51796. <tr><td width="40%">WVE</td><td width="10%"></td><td width="10%">X</td></tr>
  51797. <tr><td width="40%">Konami XMD</td><td width="10%"></td><td width="10%">X</td></tr>
  51798. <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>
  51799. <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>
  51800. <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>
  51801. <tr><td width="40%">eXtended BINary text (XBIN)</td><td width="10%"></td><td width="10%">X</td></tr>
  51802. <tr><td width="40%">YUV4MPEG pipe</td><td width="10%">X</td><td width="10%">X</td></tr>
  51803. <tr><td width="40%">Psygnosis YOP</td><td width="10%"></td><td width="10%">X</td></tr>
  51804. </tbody>
  51805. </table>
  51806. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  51807. </p>
  51808. </div>
  51809. <div class="section-level-extent" id="Image-Formats">
  51810. <h3 class="section"><span>40.2 Image Formats<a class="copiable-link" href="#Image-Formats"> &para;</a></span></h3>
  51811. <p>FFmpeg can read and write images for each frame of a video sequence. The
  51812. following image formats are supported:
  51813. </p>
  51814. <table class="multitable">
  51815. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  51816. <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>
  51817. <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>
  51818. <tr><td width="40%">animated GIF</td><td width="10%">X</td><td width="10%">X</td></tr>
  51819. <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>
  51820. <tr><td width="40%">BMP</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Microsoft BMP image</td></tr>
  51821. <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>
  51822. <tr><td width="40%">CRI</td><td width="10%"></td><td width="10%">X</td><td width="40%">Cintel RAW</td></tr>
  51823. <tr><td width="40%">DPX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Digital Picture Exchange</td></tr>
  51824. <tr><td width="40%">EXR</td><td width="10%"></td><td width="10%">X</td><td width="40%">OpenEXR</td></tr>
  51825. <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>
  51826. <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>
  51827. <tr><td width="40%">IMG</td><td width="10%"></td><td width="10%">X</td><td width="40%">GEM Raster image</td></tr>
  51828. <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>
  51829. <tr><td width="40%">JPEG 2000</td><td width="10%">X</td><td width="10%">X</td></tr>
  51830. <tr><td width="40%">JPEG-LS</td><td width="10%">X</td><td width="10%">X</td></tr>
  51831. <tr><td width="40%">LJPEG</td><td width="10%">X</td><td width="10%"></td><td width="40%">Lossless JPEG</td></tr>
  51832. <tr><td width="40%">Media 100</td><td width="10%"></td><td width="10%">X</td></tr>
  51833. <tr><td width="40%">MSP</td><td width="10%"></td><td width="10%">X</td><td width="40%">Microsoft Paint image</td></tr>
  51834. <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>
  51835. <tr><td width="40%">PBM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable BitMap image</td></tr>
  51836. <tr><td width="40%">PCD</td><td width="10%"></td><td width="10%">X</td><td width="40%">PhotoCD</td></tr>
  51837. <tr><td width="40%">PCX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">PC Paintbrush</td></tr>
  51838. <tr><td width="40%">PFM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable FloatMap image</td></tr>
  51839. <tr><td width="40%">PGM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable GrayMap image</td></tr>
  51840. <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>
  51841. <tr><td width="40%">PGX</td><td width="10%"></td><td width="10%">X</td><td width="40%">PGX file decoder</td></tr>
  51842. <tr><td width="40%">PHM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable HalfFloatMap image</td></tr>
  51843. <tr><td width="40%">PIC</td><td width="10%"></td><td width="10%">X</td><td width="40%">Pictor/PC Paint</td></tr>
  51844. <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>
  51845. <tr><td width="40%">PPM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable PixelMap image</td></tr>
  51846. <tr><td width="40%">PSD</td><td width="10%"></td><td width="10%">X</td><td width="40%">Photoshop</td></tr>
  51847. <tr><td width="40%">PTX</td><td width="10%"></td><td width="10%">X</td><td width="40%">V.Flash PTX format</td></tr>
  51848. <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>
  51849. <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>
  51850. <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>
  51851. <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>
  51852. <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>
  51853. <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>
  51854. <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>
  51855. <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>
  51856. <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>
  51857. <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>
  51858. <tr><td width="40%">XPM</td><td width="10%"></td><td width="10%">X</td><td width="40%">X PixMap image format</td></tr>
  51859. <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>
  51860. </tbody>
  51861. </table>
  51862. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  51863. </p>
  51864. <p><code class="code">E</code> means that support is provided through an external library.
  51865. </p>
  51866. </div>
  51867. <div class="section-level-extent" id="Video-Codecs">
  51868. <h3 class="section"><span>40.3 Video Codecs<a class="copiable-link" href="#Video-Codecs"> &para;</a></span></h3>
  51869. <table class="multitable">
  51870. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  51871. <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>
  51872. <tr><td width="40%">8088flex TMV</td><td width="10%"></td><td width="10%">X</td></tr>
  51873. <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>
  51874. <tr><td width="40%">Amazing Studio PAF Video</td><td width="10%"></td><td width="10%">X</td></tr>
  51875. <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>
  51876. <tr><td width="40%">Amuse Graphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  51877. <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>
  51878. <tr><td width="40%">ANSI/ASCII art</td><td width="10%"></td><td width="10%">X</td></tr>
  51879. <tr><td width="40%">Apple Intermediate Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  51880. <tr><td width="40%">Apple MJPEG-B</td><td width="10%"></td><td width="10%">X</td></tr>
  51881. <tr><td width="40%">Apple Pixlet</td><td width="10%"></td><td width="10%">X</td></tr>
  51882. <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>
  51883. <tr><td width="40%">Apple QuickDraw</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: qdrw</td></tr>
  51884. <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>
  51885. <tr><td width="40%">Asus v1</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: ASV1</td></tr>
  51886. <tr><td width="40%">Asus v2</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: ASV2</td></tr>
  51887. <tr><td width="40%">ATI VCR1</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VCR1</td></tr>
  51888. <tr><td width="40%">ATI VCR2</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VCR2</td></tr>
  51889. <tr><td width="40%">Auravision Aura</td><td width="10%"></td><td width="10%">X</td></tr>
  51890. <tr><td width="40%">Auravision Aura 2</td><td width="10%"></td><td width="10%">X</td></tr>
  51891. <tr><td width="40%">Autodesk Animator Flic video</td><td width="10%"></td><td width="10%">X</td></tr>
  51892. <tr><td width="40%">Autodesk RLE</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: AASC</td></tr>
  51893. <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>
  51894. <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>
  51895. <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>
  51896. <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>
  51897. <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>
  51898. <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>
  51899. <tr><td width="40%">Beam Software VB</td><td width="10%"></td><td width="10%">X</td></tr>
  51900. <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>
  51901. <tr><td width="40%">Bink Video</td><td width="10%"></td><td width="10%">X</td></tr>
  51902. <tr><td width="40%">BitJazz SheerVideo</td><td width="10%"></td><td width="10%">X</td></tr>
  51903. <tr><td width="40%">Bitmap Brothers JV video</td><td width="10%"></td><td width="10%">X</td></tr>
  51904. <tr><td width="40%">y41p Brooktree uncompressed 4:1:1 12-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  51905. <tr><td width="40%">Brooktree ProSumer Video</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: BT20</td></tr>
  51906. <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>
  51907. <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>
  51908. <tr><td width="40%">CamStudio</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: CSCD</td></tr>
  51909. <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>
  51910. <tr><td width="40%">CDXL</td><td width="10%"></td><td width="10%">X</td><td width="40%">Amiga CD video codec</td></tr>
  51911. <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>
  51912. <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>
  51913. <tr><td width="40%">Discworld II BMV Video</td><td width="10%"></td><td width="10%">X</td></tr>
  51914. <tr><td width="40%">CineForm HD</td><td width="10%">X</td><td width="10%">X</td></tr>
  51915. <tr><td width="40%">Canopus HQ</td><td width="10%"></td><td width="10%">X</td></tr>
  51916. <tr><td width="40%">Canopus HQA</td><td width="10%"></td><td width="10%">X</td></tr>
  51917. <tr><td width="40%">Canopus HQX</td><td width="10%"></td><td width="10%">X</td></tr>
  51918. <tr><td width="40%">Canopus Lossless Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  51919. <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>
  51920. <tr><td width="40%">Cinepak</td><td width="10%"></td><td width="10%">X</td></tr>
  51921. <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>
  51922. <tr><td width="40%">CPiA Video Format</td><td width="10%"></td><td width="10%">X</td></tr>
  51923. <tr><td width="40%">Creative YUV (CYUV)</td><td width="10%"></td><td width="10%">X</td></tr>
  51924. <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>
  51925. <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>
  51926. <tr><td width="40%">Deluxe Paint Animation</td><td width="10%"></td><td width="10%">X</td></tr>
  51927. <tr><td width="40%">DNxHD</td><td width="10%">X</td><td width="10%">X</td><td width="40%">aka SMPTE VC3</td></tr>
  51928. <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>
  51929. <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>
  51930. <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>
  51931. <tr><td width="40%">DV (Digital Video)</td><td width="10%">X</td><td width="10%">X</td></tr>
  51932. <tr><td width="40%">Dxtory capture format</td><td width="10%"></td><td width="10%">X</td></tr>
  51933. <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>
  51934. <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>
  51935. <tr><td width="40%">Electronic Arts Madcow video</td><td width="10%"></td><td width="10%">X</td></tr>
  51936. <tr><td width="40%">Electronic Arts TGV video</td><td width="10%"></td><td width="10%">X</td></tr>
  51937. <tr><td width="40%">Electronic Arts TGQ video</td><td width="10%"></td><td width="10%">X</td></tr>
  51938. <tr><td width="40%">Electronic Arts TQI video</td><td width="10%"></td><td width="10%">X</td></tr>
  51939. <tr><td width="40%">Escape 124</td><td width="10%"></td><td width="10%">X</td></tr>
  51940. <tr><td width="40%">Escape 130</td><td width="10%"></td><td width="10%">X</td></tr>
  51941. <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>
  51942. <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>
  51943. <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>
  51944. <tr><td width="40%">Flash Screen Video v2</td><td width="10%">X</td><td width="10%">X</td></tr>
  51945. <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>
  51946. <tr><td width="40%">FM Screen Capture Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  51947. <tr><td width="40%">Forward Uncompressed</td><td width="10%"></td><td width="10%">X</td></tr>
  51948. <tr><td width="40%">Fraps</td><td width="10%"></td><td width="10%">X</td></tr>
  51949. <tr><td width="40%">Go2Meeting</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: G2M2, G2M3</td></tr>
  51950. <tr><td width="40%">Go2Webinar</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: G2M4</td></tr>
  51951. <tr><td width="40%">Gremlin Digital Video</td><td width="10%"></td><td width="10%">X</td></tr>
  51952. <tr><td width="40%">H.261</td><td width="10%">X</td><td width="10%">X</td></tr>
  51953. <tr><td width="40%">H.263 / H.263-1996</td><td width="10%">X</td><td width="10%">X</td></tr>
  51954. <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>
  51955. <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>
  51956. <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>
  51957. <tr><td width="40%">HNM version 4</td><td width="10%"></td><td width="10%">X</td></tr>
  51958. <tr><td width="40%">HuffYUV</td><td width="10%">X</td><td width="10%">X</td></tr>
  51959. <tr><td width="40%">HuffYUV FFmpeg variant</td><td width="10%">X</td><td width="10%">X</td></tr>
  51960. <tr><td width="40%">IBM Ultimotion</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: ULTI</td></tr>
  51961. <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>
  51962. <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>
  51963. <tr><td width="40%">IFF ILBM</td><td width="10%"></td><td width="10%">X</td><td width="40%">IFF interleaved bitmap</td></tr>
  51964. <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>
  51965. <tr><td width="40%">Infinity IMM4</td><td width="10%"></td><td width="10%">X</td></tr>
  51966. <tr><td width="40%">Intel H.263</td><td width="10%"></td><td width="10%">X</td></tr>
  51967. <tr><td width="40%">Intel Indeo 2</td><td width="10%"></td><td width="10%">X</td></tr>
  51968. <tr><td width="40%">Intel Indeo 3</td><td width="10%"></td><td width="10%">X</td></tr>
  51969. <tr><td width="40%">Intel Indeo 4</td><td width="10%"></td><td width="10%">X</td></tr>
  51970. <tr><td width="40%">Intel Indeo 5</td><td width="10%"></td><td width="10%">X</td></tr>
  51971. <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>
  51972. <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>
  51973. <tr><td width="40%">J2K</td><td width="10%">X</td><td width="10%">X</td></tr>
  51974. <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>
  51975. <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>
  51976. <tr><td width="40%">Lagarith</td><td width="10%"></td><td width="10%">X</td></tr>
  51977. <tr><td width="40%">LCL (LossLess Codec Library) MSZH</td><td width="10%"></td><td width="10%">X</td></tr>
  51978. <tr><td width="40%">LCL (LossLess Codec Library) ZLIB</td><td width="10%">E</td><td width="10%">E</td></tr>
  51979. <tr><td width="40%">LEAD MCMP</td><td width="10%"></td><td width="10%">X</td></tr>
  51980. <tr><td width="40%">LOCO</td><td width="10%"></td><td width="10%">X</td></tr>
  51981. <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>
  51982. <tr><td width="40%">lossless MJPEG</td><td width="10%">X</td><td width="10%">X</td></tr>
  51983. <tr><td width="40%">MagicYUV Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  51984. <tr><td width="40%">Mandsoft Screen Capture Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  51985. <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>
  51986. <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>
  51987. <tr><td width="40%">Microsoft RLE</td><td width="10%">X</td><td width="10%">X</td></tr>
  51988. <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>
  51989. <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>
  51990. <tr><td width="40%">Microsoft Video 1</td><td width="10%"></td><td width="10%">X</td></tr>
  51991. <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>
  51992. <tr><td width="40%">Miro VideoXL</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VIXL</td></tr>
  51993. <tr><td width="40%">MJPEG (Motion JPEG)</td><td width="10%">X</td><td width="10%">X</td></tr>
  51994. <tr><td width="40%">Mobotix MxPEG video</td><td width="10%"></td><td width="10%">X</td></tr>
  51995. <tr><td width="40%">Motion Pixels video</td><td width="10%"></td><td width="10%">X</td></tr>
  51996. <tr><td width="40%">MPEG-1 video</td><td width="10%">X</td><td width="10%">X</td></tr>
  51997. <tr><td width="40%">MPEG-2 video</td><td width="10%">X</td><td width="10%">X</td></tr>
  51998. <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>
  51999. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 1</td><td width="10%"></td><td width="10%">X</td></tr>
  52000. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 2</td><td width="10%">X</td><td width="10%">X</td></tr>
  52001. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 3</td><td width="10%">X</td><td width="10%">X</td></tr>
  52002. <tr><td width="40%">Newtek SpeedHQ</td><td width="10%">X</td><td width="10%">X</td></tr>
  52003. <tr><td width="40%">Nintendo Gamecube THP video</td><td width="10%"></td><td width="10%">X</td></tr>
  52004. <tr><td width="40%">NotchLC</td><td width="10%"></td><td width="10%">X</td></tr>
  52005. <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>
  52006. <tr><td width="40%">On2 VP3</td><td width="10%"></td><td width="10%">X</td><td width="40%">still experimental</td></tr>
  52007. <tr><td width="40%">On2 VP4</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP40</td></tr>
  52008. <tr><td width="40%">On2 VP5</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP50</td></tr>
  52009. <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>
  52010. <tr><td width="40%">On2 VP7</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP70,VP71</td></tr>
  52011. <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>
  52012. <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>
  52013. <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>
  52014. <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>
  52015. <tr><td width="40%">QuickTime 8BPS video</td><td width="10%"></td><td width="10%">X</td></tr>
  52016. <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>
  52017. <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>
  52018. <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>
  52019. <tr><td width="40%">R10K AJA Kona 10-bit RGB Codec</td><td width="10%">X</td><td width="10%">X</td></tr>
  52020. <tr><td width="40%">R210 Quicktime Uncompressed RGB 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  52021. <tr><td width="40%">Raw Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  52022. <tr><td width="40%">RealVideo 1.0</td><td width="10%">X</td><td width="10%">X</td></tr>
  52023. <tr><td width="40%">RealVideo 2.0</td><td width="10%">X</td><td width="10%">X</td></tr>
  52024. <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>
  52025. <tr><td width="40%">RealVideo 4.0</td><td width="10%"></td><td width="10%">X</td></tr>
  52026. <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>
  52027. <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>
  52028. <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>
  52029. <tr><td width="40%">ScreenPressor</td><td width="10%"></td><td width="10%">X</td></tr>
  52030. <tr><td width="40%">Screenpresso</td><td width="10%"></td><td width="10%">X</td></tr>
  52031. <tr><td width="40%">Screen Recorder Gold Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  52032. <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>
  52033. <tr><td width="40%">Silicon Graphics Motion Video Compressor 1 (MVC1)</td><td width="10%"></td><td width="10%">X</td></tr>
  52034. <tr><td width="40%">Silicon Graphics Motion Video Compressor 2 (MVC2)</td><td width="10%"></td><td width="10%">X</td></tr>
  52035. <tr><td width="40%">Silicon Graphics RLE 8-bit video</td><td width="10%"></td><td width="10%">X</td></tr>
  52036. <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>
  52037. <tr><td width="40%">SMPTE VC-1</td><td width="10%"></td><td width="10%">X</td></tr>
  52038. <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>
  52039. <tr><td width="40%">Sony PlayStation MDEC (Motion DECoder)</td><td width="10%"></td><td width="10%">X</td></tr>
  52040. <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>
  52041. <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>
  52042. <tr><td width="40%">Sunplus JPEG (SP5X)</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: SP5X</td></tr>
  52043. <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>
  52044. <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>
  52045. <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>
  52046. <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>
  52047. <tr><td width="40%">Ut Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  52048. <tr><td width="40%">v210 QuickTime uncompressed 4:2:2 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  52049. <tr><td width="40%">v308 QuickTime uncompressed 4:4:4</td><td width="10%">X</td><td width="10%">X</td></tr>
  52050. <tr><td width="40%">v408 QuickTime uncompressed 4:4:4:4</td><td width="10%">X</td><td width="10%">X</td></tr>
  52051. <tr><td width="40%">v410 QuickTime uncompressed 4:4:4 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  52052. <tr><td width="40%">VBLE Lossless Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  52053. <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>
  52054. <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>
  52055. <tr><td width="40%">Westwood Studios VQA (Vector Quantized Animation) video</td><td width="10%"></td><td width="10%">X</td></tr>
  52056. <tr><td width="40%">Windows Media Image</td><td width="10%"></td><td width="10%">X</td></tr>
  52057. <tr><td width="40%">Windows Media Video 7</td><td width="10%">X</td><td width="10%">X</td></tr>
  52058. <tr><td width="40%">Windows Media Video 8</td><td width="10%">X</td><td width="10%">X</td></tr>
  52059. <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>
  52060. <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>
  52061. <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>
  52062. <tr><td width="40%">Winnov WNV1</td><td width="10%"></td><td width="10%">X</td></tr>
  52063. <tr><td width="40%">WMV7</td><td width="10%">X</td><td width="10%">X</td></tr>
  52064. <tr><td width="40%">YAMAHA SMAF</td><td width="10%">X</td><td width="10%">X</td></tr>
  52065. <tr><td width="40%">Psygnosis YOP Video</td><td width="10%"></td><td width="10%">X</td></tr>
  52066. <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>
  52067. <tr><td width="40%">ZeroCodec Lossless Video</td><td width="10%"></td><td width="10%">X</td></tr>
  52068. <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>
  52069. <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>
  52070. </tbody>
  52071. </table>
  52072. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  52073. </p>
  52074. <p><code class="code">E</code> means that support is provided through an external library.
  52075. </p>
  52076. </div>
  52077. <div class="section-level-extent" id="Audio-Codecs">
  52078. <h3 class="section"><span>40.4 Audio Codecs<a class="copiable-link" href="#Audio-Codecs"> &para;</a></span></h3>
  52079. <table class="multitable">
  52080. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  52081. <tr><td width="40%">8SVX exponential</td><td width="10%"></td><td width="10%">X</td></tr>
  52082. <tr><td width="40%">8SVX fibonacci</td><td width="10%"></td><td width="10%">X</td></tr>
  52083. <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>
  52084. <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>
  52085. <tr><td width="40%">AC-3</td><td width="10%">IX</td><td width="10%">IX</td></tr>
  52086. <tr><td width="40%">ACELP.KELVIN</td><td width="10%"></td><td width="10%">X</td></tr>
  52087. <tr><td width="40%">ADPCM 4X Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  52088. <tr><td width="40%">ADPCM Yamaha AICA</td><td width="10%"></td><td width="10%">X</td></tr>
  52089. <tr><td width="40%">ADPCM AmuseGraphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  52090. <tr><td width="40%">ADPCM Argonaut Games</td><td width="10%">X</td><td width="10%">X</td></tr>
  52091. <tr><td width="40%">ADPCM CDROM XA</td><td width="10%"></td><td width="10%">X</td></tr>
  52092. <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>
  52093. <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>
  52094. <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>
  52095. <tr><td width="40%">ADPCM Electronic Arts R1</td><td width="10%"></td><td width="10%">X</td></tr>
  52096. <tr><td width="40%">ADPCM Electronic Arts R2</td><td width="10%"></td><td width="10%">X</td></tr>
  52097. <tr><td width="40%">ADPCM Electronic Arts R3</td><td width="10%"></td><td width="10%">X</td></tr>
  52098. <tr><td width="40%">ADPCM Electronic Arts XAS</td><td width="10%"></td><td width="10%">X</td></tr>
  52099. <tr><td width="40%">ADPCM G.722</td><td width="10%">X</td><td width="10%">X</td></tr>
  52100. <tr><td width="40%">ADPCM G.726</td><td width="10%">X</td><td width="10%">X</td></tr>
  52101. <tr><td width="40%">ADPCM IMA Acorn Replay</td><td width="10%"></td><td width="10%">X</td></tr>
  52102. <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>
  52103. <tr><td width="40%">ADPCM IMA Cunning Developments</td><td width="10%"></td><td width="10%">X</td></tr>
  52104. <tr><td width="40%">ADPCM IMA Electronic Arts EACS</td><td width="10%"></td><td width="10%">X</td></tr>
  52105. <tr><td width="40%">ADPCM IMA Electronic Arts SEAD</td><td width="10%"></td><td width="10%">X</td></tr>
  52106. <tr><td width="40%">ADPCM IMA Funcom</td><td width="10%"></td><td width="10%">X</td></tr>
  52107. <tr><td width="40%">ADPCM IMA High Voltage Software ALP</td><td width="10%">X</td><td width="10%">X</td></tr>
  52108. <tr><td width="40%">ADPCM IMA Mobiclip MOFLEX</td><td width="10%"></td><td width="10%">X</td></tr>
  52109. <tr><td width="40%">ADPCM IMA QuickTime</td><td width="10%">X</td><td width="10%">X</td></tr>
  52110. <tr><td width="40%">ADPCM IMA Simon &amp; Schuster Interactive</td><td width="10%">X</td><td width="10%">X</td></tr>
  52111. <tr><td width="40%">ADPCM IMA Ubisoft APM</td><td width="10%">X</td><td width="10%">X</td></tr>
  52112. <tr><td width="40%">ADPCM IMA Loki SDL MJPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  52113. <tr><td width="40%">ADPCM IMA WAV</td><td width="10%">X</td><td width="10%">X</td></tr>
  52114. <tr><td width="40%">ADPCM IMA Westwood</td><td width="10%"></td><td width="10%">X</td></tr>
  52115. <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>
  52116. <tr><td width="40%">ADPCM IMA Dialogic</td><td width="10%"></td><td width="10%">X</td></tr>
  52117. <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>
  52118. <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>
  52119. <tr><td width="40%">ADPCM IMA Radical</td><td width="10%"></td><td width="10%">X</td></tr>
  52120. <tr><td width="40%">ADPCM Microsoft</td><td width="10%">X</td><td width="10%">X</td></tr>
  52121. <tr><td width="40%">ADPCM MS IMA</td><td width="10%">X</td><td width="10%">X</td></tr>
  52122. <tr><td width="40%">ADPCM Nintendo Gamecube AFC</td><td width="10%"></td><td width="10%">X</td></tr>
  52123. <tr><td width="40%">ADPCM Nintendo Gamecube DTK</td><td width="10%"></td><td width="10%">X</td></tr>
  52124. <tr><td width="40%">ADPCM Nintendo THP</td><td width="10%"></td><td width="10%">X</td></tr>
  52125. <tr><td width="40%">ADPCM Playstation</td><td width="10%"></td><td width="10%">X</td></tr>
  52126. <tr><td width="40%">ADPCM QT IMA</td><td width="10%">X</td><td width="10%">X</td></tr>
  52127. <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>
  52128. <tr><td width="40%">ADPCM Shockwave Flash</td><td width="10%">X</td><td width="10%">X</td></tr>
  52129. <tr><td width="40%">ADPCM Sound Blaster Pro 2-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  52130. <tr><td width="40%">ADPCM Sound Blaster Pro 2.6-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  52131. <tr><td width="40%">ADPCM Sound Blaster Pro 4-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  52132. <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>
  52133. <tr><td width="40%">ADPCM Konami XMD</td><td width="10%"></td><td width="10%">X</td></tr>
  52134. <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>
  52135. <tr><td width="40%">ADPCM Yamaha</td><td width="10%">X</td><td width="10%">X</td></tr>
  52136. <tr><td width="40%">ADPCM Zork</td><td width="10%"></td><td width="10%">X</td></tr>
  52137. <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>
  52138. <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>
  52139. <tr><td width="40%">Amazing Studio PAF Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  52140. <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>
  52141. <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>
  52142. <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>
  52143. <tr><td width="40%">ATRAC1</td><td width="10%"></td><td width="10%">X</td></tr>
  52144. <tr><td width="40%">ATRAC3</td><td width="10%"></td><td width="10%">X</td></tr>
  52145. <tr><td width="40%">ATRAC3+</td><td width="10%"></td><td width="10%">X</td></tr>
  52146. <tr><td width="40%">ATRAC9</td><td width="10%"></td><td width="10%">X</td></tr>
  52147. <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>
  52148. <tr><td width="40%">Bonk audio</td><td width="10%"></td><td width="10%">X</td></tr>
  52149. <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>
  52150. <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>
  52151. <tr><td width="40%">CRI HCA</td><td width="10%"></td><td width="10%">X</td></tr>
  52152. <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>
  52153. <tr><td width="40%">DFPWM</td><td width="10%">X</td><td width="10%">X</td></tr>
  52154. <tr><td width="40%">Digital Speech Standard - Standard Play mode (DSS SP)</td><td width="10%"></td><td width="10%">X</td></tr>
  52155. <tr><td width="40%">Discworld II BMV Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  52156. <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>
  52157. <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>
  52158. <tr><td width="40%">Dolby E</td><td width="10%"></td><td width="10%">X</td></tr>
  52159. <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>
  52160. <tr><td width="40%">DPCM Gremlin</td><td width="10%"></td><td width="10%">X</td></tr>
  52161. <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>
  52162. <tr><td width="40%">DPCM Marble WADY</td><td width="10%"></td><td width="10%">X</td></tr>
  52163. <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>
  52164. <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>
  52165. <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>
  52166. <tr><td width="40%">DPCM Sol</td><td width="10%"></td><td width="10%">X</td></tr>
  52167. <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>
  52168. <tr><td width="40%">DPCM Xilam DERF</td><td width="10%"></td><td width="10%">X</td></tr>
  52169. <tr><td width="40%">DSD (Direct Stream Digital), least significant bit first</td><td width="10%"></td><td width="10%">X</td></tr>
  52170. <tr><td width="40%">DSD (Direct Stream Digital), most significant bit first</td><td width="10%"></td><td width="10%">X</td></tr>
  52171. <tr><td width="40%">DSD (Direct Stream Digital), least significant bit first, planar</td><td width="10%"></td><td width="10%">X</td></tr>
  52172. <tr><td width="40%">DSD (Direct Stream Digital), most significant bit first, planar</td><td width="10%"></td><td width="10%">X</td></tr>
  52173. <tr><td width="40%">DSP Group TrueSpeech</td><td width="10%"></td><td width="10%">X</td></tr>
  52174. <tr><td width="40%">DST (Direct Stream Transfer)</td><td width="10%"></td><td width="10%">X</td></tr>
  52175. <tr><td width="40%">DV audio</td><td width="10%"></td><td width="10%">X</td></tr>
  52176. <tr><td width="40%">Enhanced AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  52177. <tr><td width="40%">EVRC (Enhanced Variable Rate Codec)</td><td width="10%"></td><td width="10%">X</td></tr>
  52178. <tr><td width="40%">FLAC (Free Lossless Audio Codec)</td><td width="10%">X</td><td width="10%">IX</td></tr>
  52179. <tr><td width="40%">FTR Voice</td><td width="10%"></td><td width="10%">X</td></tr>
  52180. <tr><td width="40%">G.723.1</td><td width="10%">X</td><td width="10%">X</td></tr>
  52181. <tr><td width="40%">G.729</td><td width="10%"></td><td width="10%">X</td></tr>
  52182. <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>
  52183. <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>
  52184. <tr><td width="40%">IAC (Indeo Audio Coder)</td><td width="10%"></td><td width="10%">X</td></tr>
  52185. <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>
  52186. <tr><td width="40%">IMC (Intel Music Coder)</td><td width="10%"></td><td width="10%">X</td></tr>
  52187. <tr><td width="40%">Interplay ACM</td><td width="10%"></td><td width="10%">X</td></tr>
  52188. <tr><td width="40%">MACE (Macintosh Audio Compression/Expansion) 3:1</td><td width="10%"></td><td width="10%">X</td></tr>
  52189. <tr><td width="40%">MACE (Macintosh Audio Compression/Expansion) 6:1</td><td width="10%"></td><td width="10%">X</td></tr>
  52190. <tr><td width="40%">Marian&rsquo;s A-pac audio</td><td width="10%"></td><td width="10%">X</td></tr>
  52191. <tr><td width="40%">MI-SC4 (Micronas SC-4 Audio)</td><td width="10%"></td><td width="10%">X</td></tr>
  52192. <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>
  52193. <tr><td width="40%">Monkey&rsquo;s Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  52194. <tr><td width="40%">MP1 (MPEG audio layer 1)</td><td width="10%"></td><td width="10%">IX</td></tr>
  52195. <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>
  52196. <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>
  52197. <tr><td width="40%">MPEG-4 Audio Lossless Coding (ALS)</td><td width="10%"></td><td width="10%">X</td></tr>
  52198. <tr><td width="40%">MobiClip FastAudio</td><td width="10%"></td><td width="10%">X</td></tr>
  52199. <tr><td width="40%">Musepack SV7</td><td width="10%"></td><td width="10%">X</td></tr>
  52200. <tr><td width="40%">Musepack SV8</td><td width="10%"></td><td width="10%">X</td></tr>
  52201. <tr><td width="40%">Nellymoser Asao</td><td width="10%">X</td><td width="10%">X</td></tr>
  52202. <tr><td width="40%">On2 AVC (Audio for Video Codec)</td><td width="10%"></td><td width="10%">X</td></tr>
  52203. <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>
  52204. <tr><td width="40%">OSQ (Original Sound Quality)</td><td width="10%"></td><td width="10%">X</td></tr>
  52205. <tr><td width="40%">PCM A-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  52206. <tr><td width="40%">PCM mu-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  52207. <tr><td width="40%">PCM Archimedes VIDC</td><td width="10%">X</td><td width="10%">X</td></tr>
  52208. <tr><td width="40%">PCM signed 8-bit planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  52209. <tr><td width="40%">PCM signed 16-bit big-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  52210. <tr><td width="40%">PCM signed 16-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  52211. <tr><td width="40%">PCM signed 24-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  52212. <tr><td width="40%">PCM signed 32-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  52213. <tr><td width="40%">PCM 32-bit floating point big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52214. <tr><td width="40%">PCM 32-bit floating point little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52215. <tr><td width="40%">PCM 64-bit floating point big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52216. <tr><td width="40%">PCM 64-bit floating point little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52217. <tr><td width="40%">PCM D-Cinema audio signed 24-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  52218. <tr><td width="40%">PCM signed 8-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  52219. <tr><td width="40%">PCM signed 16-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52220. <tr><td width="40%">PCM signed 16-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52221. <tr><td width="40%">PCM signed 24-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52222. <tr><td width="40%">PCM signed 24-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52223. <tr><td width="40%">PCM signed 32-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52224. <tr><td width="40%">PCM signed 32-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52225. <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>
  52226. <tr><td width="40%">PCM unsigned 8-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  52227. <tr><td width="40%">PCM unsigned 16-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52228. <tr><td width="40%">PCM unsigned 16-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52229. <tr><td width="40%">PCM unsigned 24-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52230. <tr><td width="40%">PCM unsigned 24-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52231. <tr><td width="40%">PCM unsigned 32-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52232. <tr><td width="40%">PCM unsigned 32-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  52233. <tr><td width="40%">PCM SGA</td><td width="10%"></td><td width="10%">X</td></tr>
  52234. <tr><td width="40%">QCELP / PureVoice</td><td width="10%"></td><td width="10%">X</td></tr>
  52235. <tr><td width="40%">QDesign Music Codec 1</td><td width="10%"></td><td width="10%">X</td></tr>
  52236. <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>
  52237. <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>
  52238. <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>
  52239. <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>
  52240. <tr><td width="40%">RealAudio Lossless</td><td width="10%"></td><td width="10%">X</td></tr>
  52241. <tr><td width="40%">RealAudio SIPR / ACELP.NET</td><td width="10%"></td><td width="10%">X</td></tr>
  52242. <tr><td width="40%">RK Audio (RKA)</td><td width="10%"></td><td width="10%">X</td></tr>
  52243. <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>
  52244. <tr><td width="40%">Shorten</td><td width="10%"></td><td width="10%">X</td></tr>
  52245. <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>
  52246. <tr><td width="40%">Smacker audio</td><td width="10%"></td><td width="10%">X</td></tr>
  52247. <tr><td width="40%">SMPTE 302M AES3 audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  52248. <tr><td width="40%">Sonic</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental codec</td></tr>
  52249. <tr><td width="40%">Sonic lossless</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental codec</td></tr>
  52250. <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>
  52251. <tr><td width="40%">TAK (Tom&rsquo;s lossless Audio Kompressor)</td><td width="10%"></td><td width="10%">X</td></tr>
  52252. <tr><td width="40%">True Audio (TTA)</td><td width="10%">X</td><td width="10%">X</td></tr>
  52253. <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>
  52254. <tr><td width="40%">TwinVQ (VQF flavor)</td><td width="10%"></td><td width="10%">X</td></tr>
  52255. <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>
  52256. <tr><td width="40%">ViewQuest VQC</td><td width="10%"></td><td width="10%">X</td></tr>
  52257. <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>
  52258. <tr><td width="40%">Voxware MetaSound</td><td width="10%"></td><td width="10%">X</td></tr>
  52259. <tr><td width="40%">Waveform Archiver</td><td width="10%"></td><td width="10%">X</td></tr>
  52260. <tr><td width="40%">WavPack</td><td width="10%">X</td><td width="10%">X</td></tr>
  52261. <tr><td width="40%">Westwood Audio (SND1)</td><td width="10%"></td><td width="10%">X</td></tr>
  52262. <tr><td width="40%">Windows Media Audio 1</td><td width="10%">X</td><td width="10%">X</td></tr>
  52263. <tr><td width="40%">Windows Media Audio 2</td><td width="10%">X</td><td width="10%">X</td></tr>
  52264. <tr><td width="40%">Windows Media Audio Lossless</td><td width="10%"></td><td width="10%">X</td></tr>
  52265. <tr><td width="40%">Windows Media Audio Pro</td><td width="10%"></td><td width="10%">X</td></tr>
  52266. <tr><td width="40%">Windows Media Audio Voice</td><td width="10%"></td><td width="10%">X</td></tr>
  52267. <tr><td width="40%">Xbox Media Audio 1</td><td width="10%"></td><td width="10%">X</td></tr>
  52268. <tr><td width="40%">Xbox Media Audio 2</td><td width="10%"></td><td width="10%">X</td></tr>
  52269. </tbody>
  52270. </table>
  52271. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  52272. </p>
  52273. <p><code class="code">E</code> means that support is provided through an external library.
  52274. </p>
  52275. <p><code class="code">I</code> means that an integer-only version is available, too (ensures high
  52276. performance on systems without hardware floating point support).
  52277. </p>
  52278. </div>
  52279. <div class="section-level-extent" id="Subtitle-Formats">
  52280. <h3 class="section"><span>40.5 Subtitle Formats<a class="copiable-link" href="#Subtitle-Formats"> &para;</a></span></h3>
  52281. <table class="multitable">
  52282. <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>
  52283. <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>
  52284. <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>
  52285. <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>
  52286. <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>
  52287. <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>
  52288. <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>
  52289. <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>
  52290. <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>
  52291. <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>
  52292. <tr><td width="40%">PGS</td><td width="10%"></td><td width="10%"></td><td width="10%"></td><td width="10%">X</td></tr>
  52293. <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>
  52294. <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>
  52295. <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>
  52296. <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>
  52297. <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>
  52298. <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>
  52299. <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>
  52300. <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>
  52301. <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>
  52302. <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>
  52303. <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>
  52304. <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>
  52305. <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>
  52306. <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>
  52307. </tbody>
  52308. </table>
  52309. <p><code class="code">X</code> means that the feature is supported.
  52310. </p>
  52311. <p><code class="code">E</code> means that support is provided through an external library.
  52312. </p>
  52313. </div>
  52314. <div class="section-level-extent" id="Network-Protocols">
  52315. <h3 class="section"><span>40.6 Network Protocols<a class="copiable-link" href="#Network-Protocols"> &para;</a></span></h3>
  52316. <table class="multitable">
  52317. <tbody><tr><td width="40%">Name</td><td width="10%">Support</td></tr>
  52318. <tr><td width="40%">AMQP</td><td width="10%">E</td></tr>
  52319. <tr><td width="40%">file</td><td width="10%">X</td></tr>
  52320. <tr><td width="40%">FTP</td><td width="10%">X</td></tr>
  52321. <tr><td width="40%">Gopher</td><td width="10%">X</td></tr>
  52322. <tr><td width="40%">Gophers</td><td width="10%">X</td></tr>
  52323. <tr><td width="40%">HLS</td><td width="10%">X</td></tr>
  52324. <tr><td width="40%">HTTP</td><td width="10%">X</td></tr>
  52325. <tr><td width="40%">HTTPS</td><td width="10%">X</td></tr>
  52326. <tr><td width="40%">Icecast</td><td width="10%">X</td></tr>
  52327. <tr><td width="40%">MMSH</td><td width="10%">X</td></tr>
  52328. <tr><td width="40%">MMST</td><td width="10%">X</td></tr>
  52329. <tr><td width="40%">pipe</td><td width="10%">X</td></tr>
  52330. <tr><td width="40%">Pro-MPEG FEC</td><td width="10%">X</td></tr>
  52331. <tr><td width="40%">RTMP</td><td width="10%">X</td></tr>
  52332. <tr><td width="40%">RTMPE</td><td width="10%">X</td></tr>
  52333. <tr><td width="40%">RTMPS</td><td width="10%">X</td></tr>
  52334. <tr><td width="40%">RTMPT</td><td width="10%">X</td></tr>
  52335. <tr><td width="40%">RTMPTE</td><td width="10%">X</td></tr>
  52336. <tr><td width="40%">RTMPTS</td><td width="10%">X</td></tr>
  52337. <tr><td width="40%">RTP</td><td width="10%">X</td></tr>
  52338. <tr><td width="40%">SAMBA</td><td width="10%">E</td></tr>
  52339. <tr><td width="40%">SCTP</td><td width="10%">X</td></tr>
  52340. <tr><td width="40%">SFTP</td><td width="10%">E</td></tr>
  52341. <tr><td width="40%">TCP</td><td width="10%">X</td></tr>
  52342. <tr><td width="40%">TLS</td><td width="10%">X</td></tr>
  52343. <tr><td width="40%">UDP</td><td width="10%">X</td></tr>
  52344. <tr><td width="40%">ZMQ</td><td width="10%">E</td></tr>
  52345. </tbody>
  52346. </table>
  52347. <p><code class="code">X</code> means that the protocol is supported.
  52348. </p>
  52349. <p><code class="code">E</code> means that support is provided through an external library.
  52350. </p>
  52351. </div>
  52352. <div class="section-level-extent" id="Input_002fOutput-Devices">
  52353. <h3 class="section"><span>40.7 Input/Output Devices<a class="copiable-link" href="#Input_002fOutput-Devices"> &para;</a></span></h3>
  52354. <table class="multitable">
  52355. <tbody><tr><td width="40%">Name</td><td width="10%">Input</td><td width="10%">Output</td></tr>
  52356. <tr><td width="40%">ALSA</td><td width="10%">X</td><td width="10%">X</td></tr>
  52357. <tr><td width="40%">BKTR</td><td width="10%">X</td><td width="10%"></td></tr>
  52358. <tr><td width="40%">caca</td><td width="10%"></td><td width="10%">X</td></tr>
  52359. <tr><td width="40%">DV1394</td><td width="10%">X</td><td width="10%"></td></tr>
  52360. <tr><td width="40%">Lavfi virtual device</td><td width="10%">X</td><td width="10%"></td></tr>
  52361. <tr><td width="40%">Linux framebuffer</td><td width="10%">X</td><td width="10%">X</td></tr>
  52362. <tr><td width="40%">JACK</td><td width="10%">X</td><td width="10%"></td></tr>
  52363. <tr><td width="40%">LIBCDIO</td><td width="10%">X</td></tr>
  52364. <tr><td width="40%">LIBDC1394</td><td width="10%">X</td><td width="10%"></td></tr>
  52365. <tr><td width="40%">OpenAL</td><td width="10%">X</td></tr>
  52366. <tr><td width="40%">OpenGL</td><td width="10%"></td><td width="10%">X</td></tr>
  52367. <tr><td width="40%">OSS</td><td width="10%">X</td><td width="10%">X</td></tr>
  52368. <tr><td width="40%">PulseAudio</td><td width="10%">X</td><td width="10%">X</td></tr>
  52369. <tr><td width="40%">SDL</td><td width="10%"></td><td width="10%">X</td></tr>
  52370. <tr><td width="40%">Video4Linux2</td><td width="10%">X</td><td width="10%">X</td></tr>
  52371. <tr><td width="40%">VfW capture</td><td width="10%">X</td><td width="10%"></td></tr>
  52372. <tr><td width="40%">X11 grabbing</td><td width="10%">X</td><td width="10%"></td></tr>
  52373. <tr><td width="40%">Win32 grabbing</td><td width="10%">X</td><td width="10%"></td></tr>
  52374. </tbody>
  52375. </table>
  52376. <p><code class="code">X</code> means that input/output is supported.
  52377. </p>
  52378. </div>
  52379. <div class="section-level-extent" id="Timecode">
  52380. <h3 class="section"><span>40.8 Timecode<a class="copiable-link" href="#Timecode"> &para;</a></span></h3>
  52381. <table class="multitable">
  52382. <tbody><tr><td width="40%">Codec/format</td><td width="10%">Read</td><td width="10%">Write</td></tr>
  52383. <tr><td width="40%">AVI</td><td width="10%">X</td><td width="10%">X</td></tr>
  52384. <tr><td width="40%">DV</td><td width="10%">X</td><td width="10%">X</td></tr>
  52385. <tr><td width="40%">GXF</td><td width="10%">X</td><td width="10%">X</td></tr>
  52386. <tr><td width="40%">MOV</td><td width="10%">X</td><td width="10%">X</td></tr>
  52387. <tr><td width="40%">MPEG1/2</td><td width="10%">X</td><td width="10%">X</td></tr>
  52388. <tr><td width="40%">MXF</td><td width="10%">X</td><td width="10%">X</td></tr>
  52389. </tbody>
  52390. </table>
  52391. </div>
  52392. </div>
  52393. <div class="chapter-level-extent" id="See-Also">
  52394. <h2 class="chapter"><span>41 See Also<a class="copiable-link" href="#See-Also"> &para;</a></span></h2>
  52395. <p><a class="url" href="ffplay.html">ffplay</a>,
  52396. <a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
  52397. <a class="url" href="ffmpeg-utils.html">ffmpeg-utils</a>,
  52398. <a class="url" href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
  52399. <a class="url" href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
  52400. <a class="url" href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
  52401. <a class="url" href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
  52402. <a class="url" href="ffmpeg-formats.html">ffmpeg-formats</a>,
  52403. <a class="url" href="ffmpeg-devices.html">ffmpeg-devices</a>,
  52404. <a class="url" href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
  52405. <a class="url" href="ffmpeg-filters.html">ffmpeg-filters</a>
  52406. </p>
  52407. </div>
  52408. <div class="chapter-level-extent" id="Authors">
  52409. <h2 class="chapter"><span>42 Authors<a class="copiable-link" href="#Authors"> &para;</a></span></h2>
  52410. <p>The FFmpeg developers.
  52411. </p>
  52412. <p>For details about the authorship, see the Git history of the project
  52413. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  52414. <code class="command">git log</code> in the FFmpeg source directory, or browsing the
  52415. online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
  52416. </p>
  52417. <p>Maintainers for the specific components are listed in the file
  52418. <samp class="file">MAINTAINERS</samp> in the source code tree.
  52419. </p>
  52420. </div>
  52421. </div>
  52422. <p style="font-size: small;">
  52423. This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
  52424. </p>
  52425. </div>
  52426. </body>
  52427. </html>